Remove unnecessary uses of "action" and "invoker".
This commit is contained in:
parent
4ad26239d4
commit
23947d8471
11 changed files with 99 additions and 98 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<numpt; i++ )
|
||||
{
|
||||
|
|
@ -1170,17 +1170,17 @@ Class BiosparkBeam : SWWMNonInteractiveActor
|
|||
Spawn("SparkBeamLight",level.Vec3Offset(pos,tdir/2));
|
||||
}
|
||||
if ( bAMBUSH ) return;
|
||||
let b = Spawn(GetClass(),invoker.nextpos);
|
||||
let b = Spawn(GetClass(),nextpos);
|
||||
b.frame = 1;
|
||||
b.angle = atan2(invoker.nextdir.y,invoker.nextdir.x);
|
||||
b.pitch = asin(-invoker.nextdir.z);
|
||||
b.angle = atan2(nextdir.y,nextdir.x);
|
||||
b.pitch = asin(-nextdir.z);
|
||||
b.target = target;
|
||||
b.special1 = special1+1;
|
||||
b.bMISSILEMORE = bMISSILEMORE;
|
||||
b.bMISSILEEVENMORE = bMISSILEEVENMORE;
|
||||
}
|
||||
|
||||
action void A_Fade()
|
||||
void A_Fade()
|
||||
{
|
||||
A_FadeOut(.05);
|
||||
let t = new("BiosparkTracer");
|
||||
|
|
@ -1358,7 +1358,7 @@ Class BiosparkArc : SWWMNonInteractiveActor
|
|||
{
|
||||
Vector3 nextpos, nextdir;
|
||||
|
||||
action void A_Trace()
|
||||
void A_Trace()
|
||||
{
|
||||
let t = new("CandyBeamTracer");
|
||||
t.hitlist.Clear();
|
||||
|
|
@ -1401,7 +1401,7 @@ Class BiosparkArc : SWWMNonInteractiveActor
|
|||
dir -= 2*normal*(dir dot normal);
|
||||
}
|
||||
else normal *= 0;
|
||||
invoker.nextpos = level.Vec3Offset(t.Results.HitPos,normal);
|
||||
nextpos = level.Vec3Offset(t.Results.HitPos,normal);
|
||||
if ( t.Results.HitType != TRACE_HitNone ) speed = t.Results.Distance; // shortens in minimap
|
||||
if ( t.Results.HitType == TRACE_HasHitSky )
|
||||
{
|
||||
|
|
@ -1413,7 +1413,7 @@ Class BiosparkArc : SWWMNonInteractiveActor
|
|||
dir = SWWMUtility.ConeSpread(dir,y,z,a,s);
|
||||
if ( master )
|
||||
{
|
||||
Vector3 dirto = level.Vec3Diff(invoker.nextpos,master.Vec3Offset(0,0,master.height/2));
|
||||
Vector3 dirto = level.Vec3Diff(nextpos,master.Vec3Offset(0,0,master.height/2));
|
||||
double dist = dirto.length();
|
||||
if ( dist > 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();
|
||||
|
|
|
|||
|
|
@ -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<Actor> pop = "CandyPop", Class<Actor> smk = "SWWMHalfSmoke" )
|
||||
void A_Spread( Class<Actor> pop = "CandyPop", Class<Actor> 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue