From 23947d8471ae558d26b41b094dd3af2db7312f7d Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Sat, 26 Nov 2022 11:57:17 +0100 Subject: [PATCH] Remove unnecessary uses of "action" and "invoker". --- language.version | 4 +- zscript/dlc1/swwm_notashotgun_fx.zsc | 4 +- zscript/items/swwm_funstuff.zsc | 8 +- zscript/items/swwm_powerups.zsc | 24 +++--- zscript/swwm_blod.zsc | 12 +-- zscript/swwm_gesture_fx.zsc | 8 +- zscript/weapons/swwm_danmaku_fx.zsc | 12 +-- .../weapons/swwm_deathlydeathcannon_fx.zsc | 28 +++---- zscript/weapons/swwm_shot_fx.zsc | 4 +- zscript/weapons/swwm_sparkyboi_fx.zsc | 75 ++++++++++--------- zscript/weapons/swwm_tastytreat_fx.zsc | 18 ++--- 11 files changed, 99 insertions(+), 98 deletions(-) diff --git a/language.version b/language.version index fda2a915f..7c149294d 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r636 \cu(Sat 26 Nov 03:42:35 CET 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r636 \cu(2022-11-26 03:42:35)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r637 \cu(Sat 26 Nov 11:57:17 CET 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r637 \cu(2022-11-26 11:57:17)\c-"; diff --git a/zscript/dlc1/swwm_notashotgun_fx.zsc b/zscript/dlc1/swwm_notashotgun_fx.zsc index bade41e73..ba9faf9f7 100644 --- a/zscript/dlc1/swwm_notashotgun_fx.zsc +++ b/zscript/dlc1/swwm_notashotgun_fx.zsc @@ -104,7 +104,7 @@ Class QuadTrail : SWWMNonInteractiveActor roll = FRandom[ExploS](0,360); SetState(SpawnState+Random[ExploS](0,19)); } - action void A_Flame() + void A_Flame() { vel *= .9; A_SetScale(scale.x*.96); @@ -1050,7 +1050,7 @@ Class OnFireTrail : SWWMNonInteractiveActor roll = FRandom[ExploS](0,360); SetState(SpawnState+Random[ExploS](0,39)); } - action void A_Flame() + void A_Flame() { special1++; if ( waterlevel > 0 ) diff --git a/zscript/items/swwm_funstuff.zsc b/zscript/items/swwm_funstuff.zsc index fa0be9113..4ca266f26 100644 --- a/zscript/items/swwm_funstuff.zsc +++ b/zscript/items/swwm_funstuff.zsc @@ -654,7 +654,7 @@ Class PartyTime : SWWMNonInteractiveActor } SetOrigin(target.pos,false); } - action void A_Confetti() + void A_Confetti() { if ( !bAMBUSH && !bSTANDSTILL ) A_StartSound("misc/tada",CHAN_ITEM); double ang, pt; @@ -1118,7 +1118,7 @@ Class Chancebox : Actor } } - action void A_DropSomething() + void A_DropSomething() { Array > candidates; candidates.Clear(); @@ -1139,7 +1139,7 @@ Class Chancebox : Actor if ( f < candidates.Size() ) candidates.Delete(f); } - if ( (candidates.Size() <= 0) || invoker.dud ) + if ( (candidates.Size() <= 0) || dud ) { // no collectible candidates? just burst into treats if ( (scale.x > .5) && (Random[Chancebox](0,int(9*scale.x*scale.x)) < 3) ) @@ -1186,7 +1186,7 @@ Class Chancebox : Actor s.scale *= 2.4; } } - action void A_Confetti() + void A_Confetti() { A_StartSound("misc/tada",CHAN_ITEM,pitch:1./scale.x); double ang, pt; diff --git a/zscript/items/swwm_powerups.zsc b/zscript/items/swwm_powerups.zsc index 57dc07191..d8c94dbc5 100644 --- a/zscript/items/swwm_powerups.zsc +++ b/zscript/items/swwm_powerups.zsc @@ -2234,7 +2234,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor { Vector3 nextpos, nextdir; - action void A_Trace() + void A_Trace() { tics = bMISSILEMORE?2:1; Vector3 x, y, z; @@ -2263,7 +2263,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor t.hitlist[i].hitactor.Howl(); } } - invoker.nextpos = level.Vec3Offset(pos,x*speed); + nextpos = level.Vec3Offset(pos,x*speed); if ( !bSTANDSTILL && (!tracer || !tracer.bSHOOTABLE || (tracer.Health <= 0) || ((tracer.bBOSS || tracer.FindInventory("BossMarker")) && !bMISSILEMORE)) ) { ReactionTime--; @@ -2278,7 +2278,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor if ( tracer ) { Vector3 destofs = bMISSILEMORE?tracer.Vec3Offset(0,0,tracer.Height/2.):tracer.Vec3Offset(FRandom[Mykradvo](-1.2,1.2)*tracer.Radius,FRandom[Mykradvo](-1.2,1.2)*tracer.Radius,FRandom[Mykradvo](-.1,1.1)*tracer.height); - Vector3 dirto = level.Vec3Diff(invoker.nextpos,destofs); + Vector3 dirto = level.Vec3Diff(nextpos,destofs); double dist = dirto.length(); if ( dist > 1 ) { @@ -2288,9 +2288,9 @@ Class MykradvoTendril : SWWMNonInteractiveActor // early split if ( dist < speed ) bMISSILEEVENMORE = true; } - invoker.nextdir = dir; + nextdir = dir; } - action void A_Spread() + void A_Spread() { if ( bMISSILEMORE && bMISSILEEVENMORE ) { @@ -2300,7 +2300,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor int ntendies = tracer?clamp(tracer.GetSpawnHealth()/400,2,10):2; for ( int i=0; i level.maptime ) return; - invoker.lastbleed = level.maptime+5; + rollvel = FRandom[Gibs](10,50)*RandomPick[Gibs](-1,1)*clamp(vel.length()/10.,.25,4.); + if ( lastbleed > level.maptime ) return; + lastbleed = level.maptime+5; TraceBleedAngle(int(vel.length()),angle+180,-pitch); } @@ -594,7 +594,7 @@ Class mkFlyingGib : Actor // floor drop let b = Spawn("mkBloodDrop",pos); b.scale *= 2.0; - b.SetShade(invoker.shadecol); + b.SetShade(shadecol); } Stop; } diff --git a/zscript/swwm_gesture_fx.zsc b/zscript/swwm_gesture_fx.zsc index d23592504..73b7df5ff 100644 --- a/zscript/swwm_gesture_fx.zsc +++ b/zscript/swwm_gesture_fx.zsc @@ -168,7 +168,7 @@ Class LoveHeart : Actor return -1; } - action void A_HeartTick() + void A_HeartTick() { special1++; if ( !(special1%3) && (special2 > 0) ) special2--; @@ -432,9 +432,9 @@ Class LoveHeart : Actor } } } - action void A_HeartBurst() + void A_HeartBurst() { - invoker.CheckDefaceTexture(); + CheckDefaceTexture(); // use line if ( BlockingLine ) { @@ -481,7 +481,7 @@ Class LoveHeart : Actor s.alpha *= 2; } } - action void A_HeartDie() + void A_HeartDie() { scale *= 1.2; A_FadeOut(); diff --git a/zscript/weapons/swwm_danmaku_fx.zsc b/zscript/weapons/swwm_danmaku_fx.zsc index 3bcaaa1f0..54a202500 100644 --- a/zscript/weapons/swwm_danmaku_fx.zsc +++ b/zscript/weapons/swwm_danmaku_fx.zsc @@ -379,7 +379,7 @@ Class EvisceratorChunk : Actor XZW1 # 1 A_FadeOut(); Wait; XDeath: - TNT1 A 35 { invoker.justdied = true; } + TNT1 A 35 { justdied = true; } Stop; } } @@ -448,11 +448,11 @@ Class EvisceratorProj : Actor if ( waterlevel <= 0 ) vel.z += 3; heat = 1.5; } - action void A_EvisExplode() + void A_EvisExplode() { if ( target && tracer && (tracer.bIsMonster||tracer.player) && tracer.IsHostile(target) ) { - double dist = level.Vec3Diff(pos,invoker.startpos).length(); + double dist = level.Vec3Diff(pos,startpos).length(); SWWMUtility.AchievementProgress("lead",int(dist),target.player); } bForceXYBillboard = true; @@ -544,7 +544,7 @@ Class EvisceratorProj : Actor Spawn("EvisceratorRing",pos); if ( swwm_omnibust ) BusterWall.ProjectileBust(self,150,SWWMUtility.Vec3FromAngles(angle,pitch)); } - action void A_SubExpl() + void A_SubExpl() { special1++; if ( special1 > 8 ) return; @@ -586,8 +586,8 @@ Class EvisceratorProj : Actor Spawn: XZW1 A 1 { - invoker.heat -= 0.004+0.0004*vel.length(); - if ( invoker.heat > 0 ) + heat -= 0.004+0.0004*vel.length(); + if ( heat > 0 ) { let s = Spawn("SWWMHalfSmoke",pos); s.alpha *= heat; diff --git a/zscript/weapons/swwm_deathlydeathcannon_fx.zsc b/zscript/weapons/swwm_deathlydeathcannon_fx.zsc index b42fddbc8..cb903897a 100644 --- a/zscript/weapons/swwm_deathlydeathcannon_fx.zsc +++ b/zscript/weapons/swwm_deathlydeathcannon_fx.zsc @@ -1486,7 +1486,7 @@ Class YnykronLightningArc : SWWMNonInteractiveActor Vector3 nextpos, nextdir; Vector3 destpos; - action void A_Trace() + void A_Trace() { let t = new("CandyBeamTracer"); t.hitlist.Clear(); @@ -1533,17 +1533,17 @@ Class YnykronLightningArc : SWWMNonInteractiveActor s.pitch = asin(-normal.z); if ( swwm_omnibust ) BusterWall.Bust(t.Results,GetMissileDamage(0,0),target,t.Results.HitVector,t.Results.HitPos.z); } - invoker.nextpos = t.Results.HitPos; + nextpos = t.Results.HitPos; bAMBUSH = true; speed = t.Results.Distance; // shortens in minimap return; } - invoker.nextpos = level.Vec3Offset(pos,x*speed); + nextpos = level.Vec3Offset(pos,x*speed); double a = FRandom[Ynykron](0,360), s = FRandom[Ynykron](0.,.8); dir = SWWMUtility.ConeSpread(dir,y,z,a,s); if ( !special1 ) { - invoker.destpos = level.Vec3Offset(pos,x*10000); + destpos = level.Vec3Offset(pos,x*10000); // calculate the closest strike point to home in onto Vector3 strikepoints[32]; double closest = 10000.; @@ -1557,23 +1557,23 @@ Class YnykronLightningArc : SWWMNonInteractiveActor strikepoints[i] = d.HitLocation; if ( d.Distance < closest ) { - invoker.destpos = strikepoints[i]; + destpos = strikepoints[i]; closest = d.Distance; } } } - Vector3 dirto = level.Vec3Diff(invoker.nextpos,invoker.destpos); + Vector3 dirto = level.Vec3Diff(nextpos,destpos); double dist = dirto.length(); if ( dist > 10 ) { dirto /= dist; dir = (dir+.8*dirto*(clamp(1.-(dist/1500.),0.,1.)**1.5)).unit(); } - invoker.nextdir = dir; + nextdir = dir; } - action void A_Spread( Sound arcsnd ) + void A_Spread( Sound arcsnd ) { - Vector3 tdir = level.Vec3Diff(pos,invoker.nextpos); + Vector3 tdir = level.Vec3Diff(pos,nextpos); if ( (GetClass() == 'YnykronLightningArc') && !Random[Ynykron](0,3) ) { for ( int i=0; i<3; i++ ) @@ -1587,18 +1587,18 @@ Class YnykronLightningArc : SWWMNonInteractiveActor r.pitch = asin(-sdir.z); r.target = target; r.special1 = 1; - YnykronLightningArc(r).destpos = invoker.destpos; + YnykronLightningArc(r).destpos = destpos; r.ReactionTime += Random[Ynykron](-3,3); } } if ( arcsnd != "" ) A_StartSound(arcsnd,CHAN_WEAPON); if ( ((ReactionTime > 0) && (special1 > ReactionTime)) || bAMBUSH ) return; - let b = Spawn(GetClass(),invoker.nextpos); - b.angle = atan2(invoker.nextdir.y,invoker.nextdir.x); - b.pitch = asin(-invoker.nextdir.z); + let b = Spawn(GetClass(),nextpos); + b.angle = atan2(nextdir.y,nextdir.x); + b.pitch = asin(-nextdir.z); b.target = target; b.special1 = special1+1; - YnykronLightningArc(b).destpos = invoker.destpos; + YnykronLightningArc(b).destpos = destpos; b.SetState(b.FindState("Trailer")); } override void PostBeginPlay() diff --git a/zscript/weapons/swwm_shot_fx.zsc b/zscript/weapons/swwm_shot_fx.zsc index 5d82a9209..01ed18cdb 100644 --- a/zscript/weapons/swwm_shot_fx.zsc +++ b/zscript/weapons/swwm_shot_fx.zsc @@ -142,7 +142,7 @@ Class GoldenImpact : SWWMNonInteractiveActor Spawn("GExploLight",pos); let r = Spawn("GExploRing",pos); } - action void A_GoldSpread() + void A_GoldSpread() { special1++; if ( (special1%4) || (special1 > 30) ) return; @@ -255,7 +255,7 @@ Class GoldenSubImpact : SWWMNonInteractiveActor s.vel = pvel; } } - action void A_GoldSubSpread() + void A_GoldSubSpread() { special1++; if ( (special1%2) || (special1 > 20) ) return; diff --git a/zscript/weapons/swwm_sparkyboi_fx.zsc b/zscript/weapons/swwm_sparkyboi_fx.zsc index f363a85a2..e352bfb1d 100644 --- a/zscript/weapons/swwm_sparkyboi_fx.zsc +++ b/zscript/weapons/swwm_sparkyboi_fx.zsc @@ -1017,7 +1017,7 @@ Class BiosparkBeam : SWWMNonInteractiveActor { Vector3 nextpos, nextdir; - action void A_Trace() + void A_Trace() { let t = new("BiosparkTracer"); t.hitlist.Clear(); @@ -1075,7 +1075,7 @@ Class BiosparkBeam : SWWMNonInteractiveActor else normal = t.Results.HitSector.ceilingplane.Normal; } else normal *= 0; - invoker.nextpos = level.Vec3Offset(t.Results.HitPos,normal*8.); + nextpos = level.Vec3Offset(t.Results.HitPos,normal*8.); if ( t.Results.HitType == TRACE_HasHitSky ) { bAMBUSH = true; @@ -1084,7 +1084,7 @@ Class BiosparkBeam : SWWMNonInteractiveActor } if ( t.Results.HitType != TRACE_HitNone ) { - let s = Spawn("BiosparkBeamImpact",invoker.nextpos); + let s = Spawn("BiosparkBeamImpact",nextpos); s.target = target; s.angle = atan2(normal.y,normal.x); s.pitch = asin(-normal.z); @@ -1100,7 +1100,7 @@ Class BiosparkBeam : SWWMNonInteractiveActor let t = bt.Thing; double dist; if ( !t || (!(t is 'BiosparkHitbox') && (!t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain') && !t.player) || (t.Health <= 0) || (target && t.IsFriend(target)))) || ((dist=Distance3DSquared(t)) > 250000) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue; - Vector3 dirto = level.Vec3Diff(invoker.nextpos,t.Vec3Offset(0,0,t.height/2)); + Vector3 dirto = level.Vec3Diff(nextpos,t.Vec3Offset(0,0,t.height/2)); if ( dir dot dirto < .2 ) continue; if ( dist > closest ) continue; closest = dist; @@ -1108,7 +1108,7 @@ Class BiosparkBeam : SWWMNonInteractiveActor } if ( tracer ) { - Vector3 dirto = level.Vec3Diff(invoker.nextpos,tracer.Vec3Offset(0,0,tracer.height/2)); + Vector3 dirto = level.Vec3Diff(nextpos,tracer.Vec3Offset(0,0,tracer.height/2)); double dist = dirto.length(); if ( dist > 10 ) { @@ -1121,17 +1121,17 @@ Class BiosparkBeam : SWWMNonInteractiveActor dir = (dir+SWWMUtility.Vec3FromAngles(FRandom[Sparkster](0,360),FRandom[Sparkster](-90,90))*FRandom[Sparkster](.8,.16)).unit(); else if ( bMISSILEMORE ) dir = (dir+SWWMUtility.Vec3FromAngles(FRandom[Sparkster](0,360),FRandom[Sparkster](-90,90))*FRandom[Sparkster](.02,.04)).unit(); - invoker.nextdir = dir; + nextdir = dir; } - action void A_Spread() + void A_Spread() { let c = Spawn("BiosparkChildBeam",pos); c.angle = angle; c.pitch = pitch; if ( frame ) c.SetStateLabel("TrailSpawn"); c.roll = Random[Sparkster](0,7)*45; - Vector3 tdir = level.Vec3Diff(pos,invoker.nextpos); + Vector3 tdir = level.Vec3Diff(pos,nextpos); int numpt = Random[Sparkster](-1,3); for ( int i=0; i 10 ) { @@ -1430,7 +1430,7 @@ Class BiosparkArc : SWWMNonInteractiveActor let t = bt.Thing; double dist; if ( !t || !t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain') && !t.player) || (t.Health <= 0) || (target && t.IsFriend(target)) || ((dist=Distance3DSquared(t)) > 2250000) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue; - Vector3 dirto = level.Vec3Diff(invoker.nextpos,t.Vec3Offset(0,0,t.height/2)); + Vector3 dirto = level.Vec3Diff(nextpos,t.Vec3Offset(0,0,t.height/2)); if ( dir dot dirto < .2 ) continue; if ( dist > closest ) continue; closest = dist; @@ -1438,7 +1438,7 @@ Class BiosparkArc : SWWMNonInteractiveActor } if ( tracer ) { - Vector3 dirto = level.Vec3Diff(invoker.nextpos,tracer.Vec3Offset(0,0,tracer.height/2)); + Vector3 dirto = level.Vec3Diff(nextpos,tracer.Vec3Offset(0,0,tracer.height/2)); double dist = dirto.length(); if ( dist > 10 ) { @@ -1447,11 +1447,11 @@ Class BiosparkArc : SWWMNonInteractiveActor } } } - invoker.nextdir = dir; + nextdir = dir; } - action void A_Spread( Sound arcsnd = "", double attn = 1., int extra = 0 ) + void A_Spread( Sound arcsnd = "", double attn = 1., int extra = 0 ) { - Vector3 tdir = level.Vec3Diff(pos,invoker.nextpos); + Vector3 tdir = level.Vec3Diff(pos,nextpos); if ( (extra > 1) && !Random[Sparkster](0,3) ) { Vector3 x, y, z; @@ -1469,9 +1469,9 @@ Class BiosparkArc : SWWMNonInteractiveActor } } if ( (special1 > ReactionTime) || bAMBUSH ) return; - let b = Spawn(GetClass(),invoker.nextpos); - b.angle = atan2(invoker.nextdir.y,invoker.nextdir.x); - b.pitch = asin(-invoker.nextdir.z); + let b = Spawn(GetClass(),nextpos); + b.angle = atan2(nextdir.y,nextdir.x); + b.pitch = asin(-nextdir.z); b.target = target; b.master = master; b.tracer = tracer; @@ -1777,23 +1777,24 @@ Class BiosparkCore : Actor s.ReactionTime += Random[Sparkster](0,int(5*factor)); } } + void A_CoreTick() + { + A_CountDown(); + angle += anglevel; + pitch += pitchvel; + roll += rollvel; + Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](.1,.4); + let s = Spawn("SWWMHalfSmoke",pos); + s.vel = pvel+vel*.1; + s.SetShade(Color(4,5,2)*Random[ExploS](40,50)); + s.A_SetRenderStyle(s.alpha*.4,STYLE_AddShaded); + s.scale *= 2.; + s.bAMBUSH = true; + } States { Spawn: - XZW1 A 1 - { - A_CountDown(); - angle += invoker.anglevel; - pitch += invoker.pitchvel; - roll += invoker.rollvel; - Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](.1,.4); - let s = Spawn("SWWMHalfSmoke",pos); - s.vel = pvel+vel*.1; - s.SetShade(Color(4,5,2)*Random[ExploS](40,50)); - s.A_SetRenderStyle(s.alpha*.4,STYLE_AddShaded); - s.scale *= 2.; - s.bAMBUSH = true; - } + XZW1 A 1 A_CoreTick(); Wait; Bounce: XZW1 A 0 A_HandleBounce(); diff --git a/zscript/weapons/swwm_tastytreat_fx.zsc b/zscript/weapons/swwm_tastytreat_fx.zsc index 5c47fa36d..d54e88a32 100644 --- a/zscript/weapons/swwm_tastytreat_fx.zsc +++ b/zscript/weapons/swwm_tastytreat_fx.zsc @@ -93,7 +93,7 @@ Class CandyBeam : SWWMNonInteractiveActor { Vector3 nextpos, nextdir; - action void A_Trace() + void A_Trace() { let t = new("CandyBeamTracer"); t.hitlist.Clear(); @@ -136,12 +136,12 @@ Class CandyBeam : SWWMNonInteractiveActor else normal *= 0; if ( t.Results.HitType != TRACE_HitNone ) speed = t.Results.Distance; // shortens in minimap double a = FRandom[Candy](0,360), s = FRandom[Candy](0.,.8); - invoker.nextpos = level.Vec3Offset(t.Results.HitPos,normal); - invoker.nextdir = SWWMUtility.ConeSpread(dir,y,z,a,s); + nextpos = level.Vec3Offset(t.Results.HitPos,normal); + nextdir = SWWMUtility.ConeSpread(dir,y,z,a,s); } - action void A_Spread( Class pop = "CandyPop", Class smk = "SWWMHalfSmoke" ) + void A_Spread( Class pop = "CandyPop", Class smk = "SWWMHalfSmoke" ) { - Vector3 tdir = level.Vec3Diff(pos,invoker.nextpos); + Vector3 tdir = level.Vec3Diff(pos,nextpos); Vector3 pvel = .1*tdir+SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](.1,.3); if ( special2 && !Random[ExploS](0,special2) ) { @@ -154,13 +154,13 @@ Class CandyBeam : SWWMNonInteractiveActor } if ( special1 > ReactionTime ) { - let s = Spawn(pop,invoker.nextpos); + let s = Spawn(pop,nextpos); s.target = target; return; } - let b = Spawn(GetClass(),invoker.nextpos); - b.angle = atan2(invoker.nextdir.y,invoker.nextdir.x); - b.pitch = asin(-invoker.nextdir.z); + let b = Spawn(GetClass(),nextpos); + b.angle = atan2(nextdir.y,nextdir.x); + b.pitch = asin(-nextdir.z); b.target = target; b.special1 = special1+1; b.special2 = special2;