Add distant item glows.

This commit is contained in:
Mari the Deer 2021-07-09 13:21:28 +02:00
commit 8f4630ae8b
24 changed files with 164 additions and 87 deletions

View file

@ -195,60 +195,64 @@ extend Class SWWMHandler
return;
}
// dump the values of all mod RNGs (might help someday to track down what desyncs)
Console.Printf("\cxSWWM GZ RNG dump for player %d (\c-%s\cx):\c-",consoleplayer,players[consoleplayer].GetUserName());
Console.Printf("bdscreen: %08x",Random2[bdscreen]());
Console.Printf("Blood: %08x",Random2[Blood]());
Console.Printf("Boolet: %08x",Random2[Boolet]());
Console.Printf("BrainExplode: %08x",Random2[BrainExplode]());
Console.Printf("Bundle: %08x",Random2[Bundle]());
Console.Printf("Candy: %08x",Random2[Candy]());
Console.Printf("Chancebox: %08x",Random2[Chancebox]());
Console.Printf("ClientSparkles: %08x",Random2[ClientSparkles]());
Console.Printf("Corrode: %08x",Random2[Corrode]());
Console.Printf("DemoLines: %08x",Random2[DemoLines]());
Console.Printf("DropChance: %08x",Random2[DropChance]());
Console.Printf("DoBlast: %08x",Random2[DoBlast]());
Console.Printf("Eviscerator: %08x",Random2[Eviscerator]());
Console.Printf("Explodium: %08x",Random2[Explodium]());
Console.Printf("ExploS: %08x",Random2[ExploS]());
Console.Printf("ExtraMissiles: %08x",Random2[ExtraMissiles]());
Console.Printf("FInTheChat: %08x",Random2[FInTheChat]());
Console.Printf("FlameT: %08x",Random2[FlameT]());
Console.Printf("Flicker: %08x",Random2[Flicker]());
Console.Printf("FunTags: %08x",Random2[FunTags]());
Console.Printf("Gesture: %08x",Random2[Gesture]());
Console.Printf("Gibs: %08x",Random2[Gibs]());
Console.Printf("GoldDrop: %08x",Random2[GoldDrop]());
Console.Printf("Goldy: %08x",Random2[Goldy]());
Console.Printf("GunFlash: %08x",Random2[GunFlash]());
Console.Printf("hdscreen: %08x",Random2[hdscreen]());
Console.Printf("Hellblazer: %08x",Random2[Hellblazer]());
Console.Printf("HudStuff: %08x",Random2[HudStuff]());
Console.Printf("Impact: %08x",Random2[Impact]());
Console.Printf("InterArt: %08x",Random2[InterArt]());
Console.Printf("Invinciball: %08x",Random2[Invinciball]());
Console.Printf("Junk: %08x",Random2[Junk]());
Console.Printf("Moth: %08x",Random2[Moth]());
Console.Printf("Nugget: %08x",Random2[Nugget]());
Console.Printf("Parry: %08x",Random2[Parry]());
Console.Printf("Ponch: %08x",Random2[Ponch]());
Console.Printf("Puff: %08x",Random2[Puff]());
Console.Printf("Pusher: %08x",Random2[Pusher]());
Console.Printf("Rage: %08x",Random2[Rage]());
Console.Printf("Replacements: %08x",Random2[Replacements]());
Console.Printf("ScoreBits: %08x",Random2[ScoreBits]());
Console.Printf("ShellDrop: %08x",Random2[ShellDrop]());
Console.Printf("Shivers: %08x",Random2[Shivers]());
Console.Printf("Silverbullet: %08x",Random2[Silverbullet]());
Console.Printf("SpareShells: %08x",Random2[SpareShells]());
Console.Printf("Sparkster: %08x",Random2[Sparkster]());
Console.Printf("Spread: %08x",Random2[Spread]());
Console.Printf("Spreadgun: %08x",Random2[Spreadgun]());
Console.Printf("TUID: %08x",Random2[TUID]());
Console.Printf("UIStuff: %08x",Random2[UIStuff]());
Console.Printf("Wallbuster: %08x",Random2[Wallbuster]());
Console.Printf("WallbusterMenu: %08x",Random2[WallbusterMenu]());
Console.Printf("Ynykron: %08x",Random2[Ynykron]());
String msg = String.Format("\cxSWWM GZ RNG dump for player %d (\c-%s\cx):\c-",consoleplayer,players[consoleplayer].GetUserName());
msg.AppendFormat("\n\n\cfPlay RNG (will cause desyncs if mismatched):\c-\n");
msg.AppendFormat("\nBlood: %08x",Random2[Blood]());
msg.AppendFormat("\nBoolet: %08x",Random2[Boolet]());
msg.AppendFormat("\nBundle: %08x",Random2[Bundle]());
msg.AppendFormat("\nCandy: %08x",Random2[Candy]());
msg.AppendFormat("\nChancebox: %08x",Random2[Chancebox]());
msg.AppendFormat("\nCorrode: %08x",Random2[Corrode]());
msg.AppendFormat("\nDemolitionist: %08x",Random2[Demolitionist]());
msg.AppendFormat("\nDoBlast: %08x",Random2[DoBlast]());
msg.AppendFormat("\nDropChance: %08x",Random2[DropChance]());
msg.AppendFormat("\nEviscerator: %08x",Random2[Eviscerator]());
msg.AppendFormat("\nExplodium: %08x",Random2[Explodium]());
msg.AppendFormat("\nExploS: %08x",Random2[ExploS]());
msg.AppendFormat("\nExtraMissiles: %08x",Random2[ExtraMissiles]());
msg.AppendFormat("\nFlameT: %08x",Random2[FlameT]());
msg.AppendFormat("\nFlicker: %08x",Random2[Flicker]());
msg.AppendFormat("\nGesture: %08x",Random2[Gesture]());
msg.AppendFormat("\nGibs: %08x",Random2[Gibs]());
msg.AppendFormat("\nGoldDrop: %08x",Random2[GoldDrop]());
msg.AppendFormat("\nGoldy: %08x",Random2[Goldy]());
msg.AppendFormat("\nGunFlash: %08x",Random2[GunFlash]());
msg.AppendFormat("\nHellblazer: %08x",Random2[Hellblazer]());
msg.AppendFormat("\nImpact: %08x",Random2[Impact]());
msg.AppendFormat("\nInvinciball: %08x",Random2[Invinciball]());
msg.AppendFormat("\nJunk: %08x",Random2[Junk]());
msg.AppendFormat("\nMoth: %08x",Random2[Moth]());
msg.AppendFormat("\nMykradvo: %08x",Random2[Mykradvo]());
msg.AppendFormat("\nNugget: %08x",Random2[Nugget]());
msg.AppendFormat("\nParry: %08x",Random2[Parry]());
msg.AppendFormat("\nPonch: %08x",Random2[Ponch]());
msg.AppendFormat("\nPuff: %08x",Random2[Puff]());
msg.AppendFormat("\nPusher: %08x",Random2[Pusher]());
msg.AppendFormat("\nRage: %08x",Random2[Rage]());
msg.AppendFormat("\nReplacements: %08x",Random2[Replacements]());
msg.AppendFormat("\nShellDrop: %08x",Random2[ShellDrop]());
msg.AppendFormat("\nShivers: %08x",Random2[Shivers]());
msg.AppendFormat("\nSilverbullet: %08x",Random2[Silverbullet]());
msg.AppendFormat("\nSpareShells: %08x",Random2[SpareShells]());
msg.AppendFormat("\nSparkster: %08x",Random2[Sparkster]());
msg.AppendFormat("\nSpread: %08x",Random2[Spread]());
msg.AppendFormat("\nSpreadgun: %08x",Random2[Spreadgun]());
msg.AppendFormat("\nWallbuster: %08x",Random2[Wallbuster]());
msg.AppendFormat("\nYnykron: %08x",Random2[Ynykron]());
msg.AppendFormat("\n\n\cfUI RNG (should not cause desyncs if mismatched):\c-\n");
msg.AppendFormat("\nbdscreen: %08x [UI]",Random2[bdscreen]());
msg.AppendFormat("\nClientSparkles: %08x [UI]",Random2[ClientSparkles]());
msg.AppendFormat("\nDemoLines: %08x [UI]",Random2[DemoLines]());
msg.AppendFormat("\nFInTheChat: %08x [UI]",Random2[FInTheChat]());
msg.AppendFormat("\nFunTags: %08x [UI]",Random2[FunTags]());
msg.AppendFormat("\nhdscreen: %08x [UI]",Random2[hdscreen]());
msg.AppendFormat("\nHudStuff: %08x [UI]",Random2[HudStuff]());
msg.AppendFormat("\nInterArt: %08x [UI]",Random2[InterArt]());
msg.AppendFormat("\nScoreBits: %08x [UI]",Random2[ScoreBits]());
msg.AppendFormat("\nTUID: %08x [UI]",Random2[TUID]());
msg.AppendFormat("\nUIStuff: %08x [UI]",Random2[UIStuff]());
msg.AppendFormat("\nWallbusterMenu: %08x [UI]",Random2[WallbusterMenu]());
Console.Printf(msg);
return;
}
else if ( e.Name ~== "swwmprofilehandler" )

View file

@ -248,7 +248,15 @@ extend Class SWWMHandler
d.bNOGRAVITY = e.Thing.bNOGRAVITY;
}
if ( e.Thing is 'Inventory' )
{
CopyFloatBob(e.Thing);
if ( (Inventory(e.Thing).PickupFlash is 'SWWMPickupFlash') && swwm_itemglows )
{
let p = Actor.Spawn(Inventory(e.Thing).PickupFlash,e.Thing.Vec3Offset(0,0,16));
p.target = e.Thing;
p.SetStateLabel("Pickup");
}
}
if ( swwm_doomfall && e.Thing.bISMONSTER )
e.Thing.bFALLDAMAGE = true;
if ( e.Thing is 'Key' )

View file

@ -57,7 +57,6 @@ Class SWWMStatusBar : BaseStatusBar
int midtic, midtype;
bool koraxhack;
int ignoremsg;
double minimapzoom, oldminimapzoom;
// minimap constants
@ -180,18 +179,11 @@ Class SWWMStatusBar : BaseStatusBar
override bool ProcessNotify( EPrintLevel printlevel, String outline )
{
if ( ignoremsg )
{
ignoremsg--;
return true;
}
// this ignoring stuff has to be a thing until we can set printlevels directly
if ( outline.Left(21) == "SWWMHandler profiling" )
return true;
if ( outline.left(18) == "\cxSWWM GZ RNG dump" )
{
ignoremsg = 52;
return true;
}
if ( koraxhack )
{
// treat as chat message

View file

@ -7,6 +7,7 @@ Class AmmoFabricator : Inventory abstract
Mixin SWWMOverlapPickupSound;
Mixin SWWMUseToPickup;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
int budget, pertype, maxunitprice;

View file

@ -153,6 +153,7 @@ Class SWWMSpareArmor : Inventory abstract
Mixin SWWMUseToPickup;
Mixin SWWMOverlapPickupSound;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
Class<SWWMArmor> giveme;

View file

@ -5,6 +5,7 @@ Class SWWMHealth : Inventory abstract
Mixin SWWMUseToPickup;
Mixin SWWMOverlapPickupSound;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
// can't use the Health class for whatever reason
// nice parser you got there I guess?

View file

@ -165,6 +165,22 @@ Class SWWMRespawnTimer : Actor
}
}
Mixin Class SWWMPickupGlow
{
override Inventory CreateTossable( int amt )
{
let ret = Super.CreateTossable(amt);
// reattach our glow if we became a pickup
if ( (ret == self) && (PickupFlash is 'SWWMPickupFlash') && swwm_itemglows )
{
let p = Spawn(PickupFlash,Vec3Offset(0,0,16));
p.target = self;
p.SetStateLabel("Pickup");
}
return ret;
}
}
Mixin Class SWWMRespawn
{
override void Hide()

View file

@ -19,6 +19,7 @@ Class GrilledCheeseSandwich : Inventory
Mixin SWWMOverlapPickupSound;
Mixin SWWMUseToPickup;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
// for falling off cliffs and others
// last 5 seconds of safe positions
@ -452,6 +453,7 @@ Class GhostArtifact : Inventory
Mixin SWWMOverlapPickupSound;
Mixin SWWMUseToPickup;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
Default
{
@ -629,6 +631,7 @@ Class GravitySuppressor : Inventory
Mixin SWWMOverlapPickupSound;
Mixin SWWMUseToPickup;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
override bool Use( bool pickup )
{
@ -867,6 +870,7 @@ Class FuckingInvinciball : Inventory
Mixin SWWMOverlapPickupSound;
Mixin SWWMUseToPickup;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
override Inventory CreateCopy( Actor other )
{
@ -1154,6 +1158,7 @@ Class Ragekit : Inventory
Mixin SWWMOverlapPickupSound;
Mixin SWWMUseToPickup;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
override bool Use( bool pickup )
{
@ -1864,6 +1869,7 @@ Class SWWMLamp : Inventory
Mixin SWWMOverlapPickupSound;
Mixin SWWMUseToPickup;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
bool bActive, bActivated;
TextureID OnIcon;
@ -2143,6 +2149,7 @@ Class EBarrier : Inventory
Mixin SWWMOverlapPickupSound;
Mixin SWWMUseToPickup;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
override bool Use( bool pickup )
{
@ -2686,6 +2693,7 @@ Class Mykradvo : Inventory
Mixin SWWMOverlapPickupSound;
Mixin SWWMUseToPickup;
Mixin SWWMRespawn;
Mixin SWWMPickupGlow;
Actor ringa[2];

View file

@ -1029,31 +1029,53 @@ Class SWWMPickupFlash : Actor
Super.PostBeginPlay();
frame = Args[0];
}
action void A_Sparkle()
{
// offset up
SetOrigin(Vec3Offset(0,0,16),false);
roll = FRandom[ExploS](0,360);
scale *= FRandom[ExploS](.9,1.1);
scale.x *= RandomPick[ExploS](-1,1);
scale.y *= RandomPick[ExploS](-1,1);
int numpt = Random[ExploS](8,10);
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (FRandom[ExploS](-1,1),FRandom[ExploS](-1,1),FRandom[ExploS](-1,1)).unit()*FRandom[ExploS](.3,8);
let s = Spawn("SWWMSmallSmoke",pos);
s.vel = pvel;
s.SetShade(Color(Args[1],Args[2],Args[3])*Random[ExploS](64,85));
s.A_SetRenderStyle(s.alpha,STYLE_AddShaded);
s.scale *= 3.;
s.alpha *= .5;
}
}
action void A_Shimmer()
{
if ( !target || Inventory(target).Owner )
{
Destroy();
return;
}
if ( target.bINVISIBLE )
{
bINVISIBLE = true;
return;
}
else if ( bINVISIBLE ) bINVISIBLE = false;
SetOrigin(target.Vec3Offset(0,0,16+target.GetBobOffset()),true);
A_SetScale(FRandom[ClientSparkles](.9,1.1)*(max(target.radius,target.height)/16.));
alpha = FRandom[ClientSparkles](.9,1.)*clamp((max(0,Distance3DSquared(players[consoleplayer].Camera)-40000.)/160000000.)**.25,0.,1.);
}
States
{
Spawn:
BLPF # 1 Bright NoDelay
{
// offset up
SetOrigin(Vec3Offset(0,0,16),false);
roll = FRandom[ExploS](0,360);
scale *= FRandom[ExploS](0.9,1.1);
scale.x *= RandomPick[ExploS](-1,1);
scale.y *= RandomPick[ExploS](-1,1);
int numpt = Random[ExploS](8,10);
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (FRandom[ExploS](-1,1),FRandom[ExploS](-1,1),FRandom[ExploS](-1,1)).unit()*FRandom[ExploS](.3,8);
let s = Spawn("SWWMSmallSmoke",pos);
s.vel = pvel;
s.SetShade(Color(Args[1],Args[2],Args[3])*Random[ExploS](64,85));
s.A_SetRenderStyle(s.alpha,STYLE_AddShaded);
s.scale *= 3.;
s.alpha *= .5;
}
}
BLPF # 0 Bright;
BLPF # 1 Bright A_Sparkle();
BLPF # 1 Bright A_FadeOut(.2);
Wait;
Pickup:
BLPS # 1 Bright A_Shimmer();
Wait;
}
}
Class SWWMPinkPickupFlash : SWWMPickupFlash

View file

@ -404,7 +404,15 @@ Class SWWMWeapon : Weapon abstract
// disallow dropping if weapon isn't ready for switching
if ( (Owner.player.ReadyWeapon == self) && (!(Owner.player.WeaponState&WF_WEAPONSWITCHOK) || (Owner.player.WeaponState&WF_DISABLESWITCH)) )
return null;
return Super.CreateTossable(amt);
let ret = Super.CreateTossable(amt);
// reattach our glow if we became a pickup
if ( (ret == self) && (PickupFlash is 'SWWMPickupFlash') && swwm_itemglows )
{
let p = Spawn(PickupFlash,Vec3Offset(0,0,16));
p.target = self;
p.SetStateLabel("Pickup");
}
return ret;
}
Default
{

View file

@ -231,17 +231,27 @@ Class ExplodiumGun : SWWMWeapon
override Inventory CreateTossable( int amt )
{
// disallow dropping if weapon isn't ready for switching
if ( (Owner.player.ReadyWeapon == self) && (!(Owner.player.WeaponState&WF_WEAPONSWITCHOK) || (Owner.player.WeaponState&WF_DISABLESWITCH)) )
return null;
let copy = ExplodiumGun(Inventory.CreateTossable(1));
if ( !copy ) return null;
// destroy sister weapon if we're removing ourselves
if ( copy == self )
{
copy.preinit = true; // need this in case we get picked up again out of order
preinit = true; // need this in case we get picked up again out of order
if ( SisterWeapon )
{
SisterWeapon.SisterWeapon = null;
SisterWeapon.Destroy();
}
// reattach our glow if we became a pickup
if ( (PickupFlash is 'SWWMPickupFlash') && swwm_itemglows )
{
let p = Spawn(PickupFlash,Vec3Offset(0,0,16));
p.target = self;
p.SetStateLabel("Pickup");
}
}
else if ( SisterWeapon )
{