Thorough microoptimization of non-interacting actors.

Omnisight now handles 3d floors and midtextures, and exit line merging works properly.
Reduced Pusher primary fire damage slightly.
Cleared improper usages of GetAge().
This commit is contained in:
Mari the Deer 2020-06-24 12:00:55 +02:00
commit a54c1869cb
18 changed files with 272 additions and 64 deletions

View file

@ -499,6 +499,7 @@ Class GoldShellSparkle : Actor
+DONTSPLASH;
+NOTELEPORT;
+FORCEXYBILLBOARD;
FloatBobPhase 0;
}
States
{

View file

@ -42,6 +42,7 @@ Class HellblazerSubExpl : Actor
+NOBLOCKMAP;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
}
States
{
@ -63,6 +64,7 @@ Class HellblazerRing : Actor
+NOBLOCKMAP;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
}
States
{
@ -84,6 +86,7 @@ Class HellblazerRing2 : Actor
+NOBLOCKMAP;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
}
States
{
@ -107,6 +110,7 @@ Class HellblazerTrail : Actor
+DONTSPLASH;
+NOTELEPORT;
+FORCEXYBILLBOARD;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -144,11 +148,11 @@ Class HellblazerFlare : Actor
+DONTSPLASH;
+NOTELEPORT;
+FORCEXYBILLBOARD;
+NOINTERACTION;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
if ( !master ) return;
State sp = FindState("Spawn");
if ( master is 'HellblazerCrackshot' ) SetState(sp+1);
@ -158,7 +162,6 @@ Class HellblazerFlare : Actor
override void Tick()
{
Super.Tick();
if ( !master || !master.bMISSILE )
{
Destroy();
@ -752,6 +755,7 @@ Class HellblazerClusterMini : HellblazerMissile2
void A_ClusterTick( Color smokecol )
{
special2++;
Vector3 traildir = -(cos(angle)*cos(pitch),sin(angle)*cos(pitch),sin(-pitch));
for ( int i=0; i<2; i++ )
{
@ -762,7 +766,7 @@ Class HellblazerClusterMini : HellblazerMissile2
s.alpha *= .4;
s.vel = .3*vel + (traildir+(FRandom[Hellblazer](-.4,.4),FRandom[Hellblazer](-.4,.4),FRandom[Hellblazer](-.4,.4))).unit()*FRandom[Hellblazer](1.,2.);
}
if ( (deto > 1) && (GetAge() > 2) )
if ( (deto > 1) && (special2 > 2) )
{
ExplodeMissile();
return;
@ -1031,7 +1035,7 @@ Class HellblazerRavagerArm : Actor
l.ReactionTime = int(2+8*(ReactionTime/20.));
l.target = p;
}
if ( !(GetAge()%2) )
if ( !(ReactionTime%2) )
{
SWWMHandler.DoBlast(self,250-6*reactiontime,1000+200*reactiontime,bHITOWNER?null:target);
A_Explode(4+reactiontime*4,250-6*reactiontime,bHITOWNER?XF_HURTSOURCE:0);
@ -1073,6 +1077,7 @@ Class HellblazerWarheadTrail : Actor
+NOGRAVITY;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
Scale 1.5;
}
States

View file

@ -105,6 +105,7 @@ Class mkBloodSpray : Actor
Class mkBloodDrop : Actor
{
int deadtimer;
bool dead;
Default
{
@ -125,7 +126,7 @@ Class mkBloodDrop : Actor
{
Super.Tick();
if ( waterlevel > 0 ) A_FadeOut();
if ( !InStateSequence(CurState,ResolveState("Spawn")) )
if ( dead )
{
deadtimer++;
if ( deadtimer > 350 ) A_FadeOut(.01);
@ -150,6 +151,7 @@ Class mkBloodDrop : Actor
Death:
SBLD E 0
{
invoker.dead = true;
A_StartSound("misc/blooddrop",volume:.1);
if ( pos.z > floorz )
{

View file

@ -422,14 +422,20 @@ Class BustedQuake : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
if ( special1 < 4 ) A_StartSound("wallbuster/smallbust",CHAN_VOICE,CHANF_OVERLAP,min(1.,special1*.32),1./max(1.,special1*.35),1.-special1*.05);
else A_StartSound("wallbuster/bigbust",CHAN_VOICE,CHANF_OVERLAP,min(1.,special1*.16),1./max(1.,special1*.35),1.-special1*.03);
A_QuakeEx(special1,special1,special1,20+special1*5,0,300+special1*90,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:special1*.1);
}
override void Tick()
{
if ( isFrozen() ) return;
tics--;
if ( tics <= 0 ) Destroy();
}
States
{
Spawn:

View file

@ -1507,7 +1507,6 @@ Class SWWMSpark : Actor
+FORCEXYBILLBOARD;
+MISSILE;
+DROPOFF;
+MOVEWITHSECTOR;
+THRUACTORS;
+NOTELEPORT;
+DONTSPLASH;
@ -1575,7 +1574,7 @@ Class SWWMChip : Actor
{
Super.Tick();
if ( isFrozen() ) return;
if ( InStateSequence(CurState,ResolveState("Death")) )
if ( CurState == ResolveState("Death") )
{
deadtimer++;
if ( deadtimer > 300 ) A_FadeOut(0.05);
@ -1643,7 +1642,7 @@ Class FancyConfetti : Actor
if ( isFrozen() ) return;
vel.xy *= 0.98;
if ( vel.z > 0 ) vel.z *= 0.98;
if ( InStateSequence(CurState,ResolveState("Death")) )
if ( CurState == ResolveState("Death") )
{
deadtimer++;
if ( deadtimer > 300 ) A_FadeOut(0.05);
@ -1713,6 +1712,7 @@ Class SWWMItemFog : Actor
+DONTSPLASH;
+ROLLSPRITE;
+ROLLCENTER;
+NOINTERACTION;
}
States
{
@ -1791,6 +1791,7 @@ Class SWWMTeleportFog : Actor
+NOGRAVITY;
+NOBLOCKMAP;
+DONTSPLASH;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -2282,23 +2283,99 @@ Class SWWMHandler : EventHandler
ah = (l.v1.p,highestfloor.ZatPoint(l.v1.p));
bl = (l.v2.p,lowestfloor.ZatPoint(l.v2.p));
bh = (l.v2.p,highestfloor.ZatPoint(l.v2.p));
if ( (al-ah).length() > 0 && (bl-bh).length() > 0 )
if ( ((al-ah).length() > 0) && ((bl-bh).length() > 0) )
return (al+ah+bl+bh)*.25;
// check if upper part available
al = (l.v1.p,lowestceiling.ZatPoint(l.v1.p));
ah = (l.v1.p,highestceiling.ZatPoint(l.v1.p));
bl = (l.v2.p,lowestceiling.ZatPoint(l.v2.p));
bh = (l.v2.p,highestceiling.ZatPoint(l.v2.p));
if ( (al-ah).length() > 0 && (bl-bh).length() > 0 )
if ( ((al-ah).length() > 0) && ((bl-bh).length() > 0) )
return (al+ah+bl+bh)*.25;
// TODO check for any 3d floors
for ( int i=0; i<l.frontsector.Get3DFloorCount(); i++ )
{
}
// check for 3d floors
bool floorfound = false;
Vector3 fal, fah, fbl, fbh;
for ( int i=0; i<l.backsector.Get3DFloorCount(); i++ )
{
let ff = l.backsector.Get3DFloor(i);
fal = (l.v1.p,ff.model.floorplane.ZAtPoint(l.v1.p));
fah = (l.v1.p,ff.model.floorplane.ZAtPoint(l.v1.p));
fbl = (l.v2.p,ff.model.ceilingplane.ZAtPoint(l.v2.p));
fbh = (l.v2.p,ff.model.ceilingplane.ZAtPoint(l.v2.p));
// skip if higher, we'll go with the lowest 3d floor (may not be right, but whatever)
if ( floorfound && (fah.z > ah.z) && (fbh.z > bh.z) && (fal.z > al.z) && (fbl.z > bl.z) ) continue;
al = fal;
ah = fah;
bl = fbl;
bh = fbh;
floorfound = true;
}
if ( floorfound ) return (al+ah+bl+bh)*.25;
for ( int i=0; i<l.frontsector.Get3DFloorCount(); i++ )
{
let ff = l.frontsector.Get3DFloor(i);
fal = (l.v1.p,ff.model.floorplane.ZAtPoint(l.v1.p));
fah = (l.v1.p,ff.model.floorplane.ZAtPoint(l.v1.p));
fbl = (l.v2.p,ff.model.ceilingplane.ZAtPoint(l.v2.p));
fbh = (l.v2.p,ff.model.ceilingplane.ZAtPoint(l.v2.p));
// skip if higher, we'll go with the lowest 3d floor (may not be right, but whatever)
if ( floorfound && (fah.z > ah.z) && (fbh.z > bh.z) && (fal.z > al.z) && (fbl.z > bl.z) ) continue;
al = fal;
ah = fah;
bl = fbl;
bh = fbh;
floorfound = true;
}
if ( floorfound ) return (al+ah+bl+bh)*.25;
// check for midtex
if ( !l.sidedef[0].GetTexture(1).IsNull() )
{
double ofs = l.sidedef[0].GetTextureYOffset(1);
Vector2 siz = TexMan.GetScaledSize(l.sidedef[0].GetTexture(1));
Vector2 tofs = TexMan.GetScaledOffset(l.sidedef[0].GetTexture(1));
ofs += tofs.y;
ofs *= l.sidedef[0].GetTextureYScale(1);
siz.y *= l.sidedef[0].GetTextureYScale(1);
if ( l.flags&Line.ML_DONTPEGBOTTOM )
{
al = (l.v1.p,highestfloor.ZAtPoint(l.v1.p)+ofs);
bl = (l.v2.p,highestfloor.ZAtPoint(l.v2.p)+ofs);
ah = al+(0,0,siz.y);
bh = bl+(0,0,siz.y);
}
else
{
ah = (l.v1.p,lowestceiling.ZAtPoint(l.v1.p)+ofs);
bh = (l.v2.p,lowestceiling.ZAtPoint(l.v2.p)+ofs);
al = ah-(0,0,siz.y);
bl = bh-(0,0,siz.y);
}
return (al+ah+bl+bh)*.25;
}
if ( !l.sidedef[1].GetTexture(1).IsNull() )
{
double ofs = l.sidedef[1].GetTextureYOffset(1);
Vector2 siz = TexMan.GetScaledSize(l.sidedef[1].GetTexture(1));
Vector2 tofs = TexMan.GetScaledOffset(l.sidedef[1].GetTexture(1));
ofs += tofs.y;
ofs *= l.sidedef[1].GetTextureYScale(1);
siz.y *= l.sidedef[1].GetTextureYScale(1);
if ( l.flags&Line.ML_DONTPEGBOTTOM )
{
al = (l.v1.p,highestfloor.ZAtPoint(l.v1.p)+ofs);
bl = (l.v2.p,highestfloor.ZAtPoint(l.v2.p)+ofs);
ah = al+(0,0,siz.y);
bh = bl+(0,0,siz.y);
}
else
{
ah = (l.v1.p,lowestceiling.ZAtPoint(l.v1.p)+ofs);
bh = (l.v2.p,lowestceiling.ZAtPoint(l.v2.p)+ofs);
al = ah-(0,0,siz.y);
bl = bh-(0,0,siz.y);
}
return (al+ah+bl+bh)*.25;
}
// TODO check for midtex
// just use the intersection
al = (l.v1.p,highestfloor.ZatPoint(l.v1.p));
ah = (l.v1.p,lowestceiling.ZatPoint(l.v1.p));
@ -2315,7 +2392,7 @@ Class SWWMHandler : EventHandler
if ( !e.IsSaveGame && !e.IsReopen )
{
// for skipping over merged exit lines (sharing vertices)
Array<int> skipme;
Array<Line> skipme;
skipme.Clear();
// find exit lines, and use lines that aren't exits
for ( int i=0; i<level.lines.Size(); i++ )
@ -2323,7 +2400,7 @@ Class SWWMHandler : EventHandler
Line l = level.lines[i];
if ( !SWWMUtility.IsExitLine(l) )
continue;
if ( skipme.Find(l.Index()) < skipme.Size() ) continue;
if ( skipme.Find(l) < skipme.Size() ) continue;
Vector3 lpos = UseLinePos(l);
// look for connected lines
int xcnt = 1;
@ -2333,7 +2410,20 @@ Class SWWMHandler : EventHandler
{
let l2 = l.frontsector.Lines[j];
if ( (l2 == l) || (l2.special != l.special) ) continue;
skipme.Push(l2.Index());
// needs to have a point in common with this one or any of the added lines
if ( (l2.v1 != l.v1) && (l2.v2 != l.v2) && (l2.v1 != l.v2) && (l2.v2 != l.v1) )
{
bool nomatches = true;
for ( int k=0; k<skipme.Size(); k++ )
{
if ( (l2.v1 != skipme[k].v1) && (l2.v2 != skipme[k].v2) && (l2.v1 != skipme[k].v2) && (l2.v2 != skipme[k].v1) )
continue;
nomatches = false;
break;
}
if ( nomatches ) continue;
}
skipme.Push(l2);
xcnt++;
lpos += UseLinePos(l2);
}
@ -2344,7 +2434,20 @@ Class SWWMHandler : EventHandler
{
let l2 = l.backsector.Lines[j];
if ( (l2 == l) || (l2.special != l.special) ) continue;
skipme.Push(l2.Index());
// needs to have a point in common with this one or any of the added lines
if ( (l2.v1 != l.v1) && (l2.v2 != l.v2) && (l2.v1 != l.v2) && (l2.v2 != l.v1) )
{
bool nomatches = true;
for ( int k=0; k<skipme.Size(); k++ )
{
if ( (l2.v1 != skipme[k].v1) && (l2.v2 != skipme[k].v2) && (l2.v1 != skipme[k].v2) && (l2.v2 != skipme[k].v1) )
continue;
nomatches = false;
break;
}
if ( nomatches ) continue;
}
skipme.Push(l2);
xcnt++;
lpos += UseLinePos(l2);
}

View file

@ -35,6 +35,7 @@ Class ChunkImpact : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -278,16 +279,15 @@ Class EvisceratorProjSmoke : Actor
+NOGRAVITY;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
lifetime = 0;
lifespeed = FRandom[Eviscerator](0.004,0.008);
}
override void Tick()
{
Super.Tick();
if ( isFrozen() ) return;
lifetime += lifespeed;
let s = Spawn("SWWMSmoke",pos);
@ -298,12 +298,6 @@ Class EvisceratorProjSmoke : Actor
scale.x = max(0,1-lifetime);
if ( scale.x <= 0 ) Destroy();
}
States
{
Spawn:
TNT1 A -1;
Stop;
}
}
Class EvisceratorProjLight : PaletteLight
@ -467,6 +461,7 @@ Class EvisceratorSubExpl : Actor
+NOBLOCKMAP;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
}
States
{
@ -488,6 +483,7 @@ Class EvisceratorRing : Actor
+NOBLOCKMAP;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
}
States
{

View file

@ -163,6 +163,7 @@ Class YnykronImpactTrail : Actor
+NOGRAVITY;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
Scale 2.;
Alpha .4;
}
@ -192,6 +193,7 @@ Class YnykronImpact : Actor
+FORCEXYBILLBOARD;
+OLDRADIUSDMG;
+EXTREMEDEATH;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -355,9 +357,15 @@ Class YnykronBeamTrail : Actor
}
override void Tick()
{
Super.Tick();
if ( isFrozen() ) return;
A_FadeOut(FRandom[Ynykron](.0005,.001));
if ( !CheckNoDelay() || (tics == -1) ) return;
if ( tics > 0 ) tics--;
while ( !tics )
{
if ( !SetState(CurState.NextState) )
return;
}
}
Default
{
@ -372,6 +380,7 @@ Class YnykronBeamTrail : Actor
+FORCEXYBILLBOARD;
+ROLLSPRITE;
+ROLLCENTER;
+NOINTERACTION;
}
States
{
@ -518,7 +527,6 @@ Class YnykronBeam : Actor
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
if ( YnykronShot(master) )
YnykronShot(master).beamcount++;
// sprite trail
@ -533,12 +541,18 @@ Class YnykronBeam : Actor
}
override void Tick()
{
Super.Tick();
if ( isFrozen() ) return;
A_FadeOut(FRandom[Ynykron](.001,.002));
special2++;
if ( special2 == 2 )
SpreadOut();
if ( !CheckNoDelay() || (tics == -1) ) return;
if ( tics > 0 ) tics--;
while ( !tics )
{
if ( !SetState(CurState.NextState) )
return;
}
}
override void OnDestroy()
{
@ -566,6 +580,7 @@ Class YnykronBeam : Actor
+FORCERADIUSDMG;
+FOILINVUL;
+EXTREMEDEATH;
+NOINTERACTION;
}
States
{
@ -620,16 +635,15 @@ Class DelayedWallBeam : Actor
+NOBLOCKMAP;
+NOTELEPORT;
+DONTSPLASH;
+NOINTERACTION;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
if ( YnykronShot(master) )
YnykronShot(master).beamcount++;
}
override void Tick()
{
Super.Tick();
if ( isFrozen() ) return;
special2--;
if ( special2 > 0 ) return;
@ -687,6 +701,7 @@ Class YnykronRing : Actor
+DONTSPLASH;
+ROLLSPRITE;
+ROLLCENTER;
+NOINTERACTION;
}
States
{
@ -727,6 +742,7 @@ Class YnykronShot : Actor
+NOBLOCKMAP;
+NOTELEPORT;
+DONTSPLASH;
+NOINTERACTION;
}
override void PostBeginPlay()
{

View file

@ -147,6 +147,7 @@ Class AirBulletRing : Actor
+ROLLSPRITE;
+ROLLCENTER;
+FORCEXYBILLBOARD;
+NOINTERACTION;
Radius 0.1;
Height 0;
}

View file

@ -435,6 +435,7 @@ Class SWWMBulletImpact : Actor
+NOBLOCKMAP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
Scale 0.25;
}
override void PostBeginPlay()
@ -514,6 +515,7 @@ Class PunchImpact : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -564,6 +566,7 @@ Class BigPunchSplash : Actor
+NOTELEPORT;
+NODAMAGETHRUST;
+FORCERADIUSDMG;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -584,6 +587,7 @@ Class BigPunchImpact : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -701,6 +705,7 @@ Class ParryRing : Actor
+NOBLOCKMAP;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
}
States
{
@ -724,6 +729,7 @@ Class ParryField : Actor
+NONSHOOTABLE;
+NOBLOOD;
+DONTTHRUST;
+NOINTERACTION;
Health int.max;
Mass int.max;
Radius 20;
@ -740,7 +746,6 @@ Class ParryField : Actor
override void Tick()
{
Super.Tick();
if ( !master )
{
Destroy();
@ -871,13 +876,6 @@ Class ParryField : Actor
}
return 0;
}
States
{
Spawn:
TNT1 A -1;
Stop;
}
}
Class UseList

View file

@ -11,6 +11,7 @@ Class PusherImpact : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -55,6 +56,7 @@ Class BigPusherImpact : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -374,7 +376,7 @@ Class PusherWeapon : SWWMWeapon
{
A_QuakeEx(3,3,3,7,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:.8);
A_AlertMonsters(1200);
int dmg = int(10+invoker.chargelevel*5);
int dmg = int(5+invoker.chargelevel*3);
if ( d.HitType == TRACE_HitActor )
{
double diff = deltaangle(self.angle,AngleTo(d.HitActor));

View file

@ -1739,6 +1739,7 @@ Class DashTrail : Actor
+NOBLOCKMAP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -1785,6 +1786,7 @@ Class DashTrail2 : Actor
+NOBLOCKMAP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -1826,6 +1828,7 @@ Class DemolitionistRadiusShockwaveTail : Actor
+DONTSPLASH;
+WALLSPRITE;
+NOTELEPORT;
+NOINTERACTION;
}
States
{
@ -1910,6 +1913,7 @@ Class DemolitionistShockwave : Actor
+NOTELEPORT;
+NODAMAGETHRUST;
+FORCERADIUSDMG;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -1999,6 +2003,7 @@ Class DemolitionistSelfLight : Actor
+NOGRAVITY;
+NOBLOCKMAP;
+DONTSPLASH;
+NOINTERACTION;
}
bool activelight()
{
@ -2013,7 +2018,6 @@ Class DemolitionistSelfLight : Actor
}
override void Tick()
{
Super.Tick();
if ( !target || !(target is 'Demolitionist') || (Demolitionist(target).selflight != self) )
{
Destroy();

View file

@ -136,10 +136,10 @@ Class GhostSnd : Actor
{
+NOBLOCKMAP;
+NOGRAVITY;
+NOINTERACTION;
}
override void Tick()
{
Super.Tick();
if ( !target || !master )
{
Destroy();
@ -228,6 +228,7 @@ Class GhostArtifactX : Actor
+NOGRAVITY;
+NOCLIP;
+DONTSPLASH;
+NOINTERACTION;
Radius 0.1;
Height 0;
+FLOATBOB;
@ -309,10 +310,10 @@ Class GravSnd : Actor
{
+NOBLOCKMAP;
+NOGRAVITY;
+NOINTERACTION;
}
override void Tick()
{
Super.Tick();
if ( !target || !master )
{
Destroy();
@ -473,10 +474,10 @@ Class InvinciSnd : Actor
{
+NOBLOCKMAP;
+NOGRAVITY;
+NOINTERACTION;
}
override void Tick()
{
Super.Tick();
if ( !target || !master )
{
Destroy();
@ -585,8 +586,6 @@ Class InvinciballPower : Powerup
{
if ( Owner.ApplyDamageFactor(damageType,damage) <= 0 )
return; // this damage type is ignored, so don't flash
if ( damageType == 'Ynykron' )
return; // can't block this
if ( damageType == 'EndLevel' )
return; // don't trigger on endlevel damage
if ( damage > 0 )
@ -700,10 +699,10 @@ Class RageSnd : Actor
{
+NOBLOCKMAP;
+NOGRAVITY;
+NOINTERACTION;
}
override void Tick()
{
Super.Tick();
if ( !target || !master )
{
Destroy();
@ -1273,13 +1272,14 @@ Class CompanionLamp : Actor
void A_Moth()
{
// count up
special1++;
for ( int i=0; i<moff.Size(); i++ )
{
if ( moff[i] && (moff[i].lamp == self) && moff[i].isEntranced() ) continue;
moff.Delete(i);
i--;
}
if ( (GetAge()%35) || Random[Moth](0,9) || (moff.Size() >= 30) ) return;
if ( (special1%35) || Random[Moth](0,9) || (moff.Size() >= 30) ) return;
// spawn a moth at a random offset
double ang = FRandom[Moth](0,360);
double pt = FRandom[Moth](-30,30);
@ -1614,10 +1614,10 @@ Class BarrierSnd : Actor
{
+NOBLOCKMAP;
+NOGRAVITY;
+NOINTERACTION;
}
override void Tick()
{
Super.Tick();
if ( !target || !master )
{
Destroy();

View file

@ -224,6 +224,7 @@ Class SpreadImpact : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -270,6 +271,7 @@ Class SlugImpact : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -452,7 +454,7 @@ Class DragonBreathArm : Actor
l.ReactionTime = int(2+8*(ReactionTime/20.));
l.target = p;
}
if ( !(GetAge()%2) )
if ( !(ReactionTime%2) )
{
SWWMHandler.DoBlast(self,150-6*reactiontime,1000+200*reactiontime,bHITOWNER?null:target);
A_Explode(1+int(reactiontime/1.5),150-6*reactiontime,bHITOWNER?XF_HURTSOURCE:0);
@ -561,6 +563,7 @@ Class SaltImpact : Actor
+FORCEXYBILLBOARD;
+NOTELEPORT;
+FOILINVUL;
+NOINTERACTION;
}
override String GetObituary( Actor victim, Actor inflictor, Name mod, bool playerattack )
{
@ -640,6 +643,7 @@ Class SaltBeam : Actor
+NODAMAGETHRUST;
+FORCERADIUSDMG;
+FOILINVUL;
+NOINTERACTION;
}
override String GetObituary( Actor victim, Actor inflictor, Name mod, bool playerattack )
@ -748,15 +752,22 @@ Class SaltBeam : Actor
override void Tick()
{
Super.Tick();
if ( isFrozen() ) return;
A_FadeOut(.04);
if ( Random[Spreadgun](-2,GetAge()/10) == 0 )
if ( Random[Spreadgun](-2,args[2]/10) == 0 )
{
SWWMHandler.DoBlast(self,64,5000,target);
A_Explode(5+Accuracy,64,0);
}
if ( ((special2%5) || GetAge()) && !special1 ) SpreadOut();
args[2]++;
if ( ((special2%5) || args[2]) && !special1 ) SpreadOut();
if ( !CheckNoDelay() || (tics == -1) ) return;
if ( tics > 0 ) tics--;
while ( !tics )
{
if ( !SetState(CurState.NextState) )
return;
}
}
States
@ -1007,6 +1018,7 @@ Class OnFire : Actor
+NOBLOCKMAP;
+DONTSPLASH;
+NOEXTREMEDEATH;
+NOINTERACTION;
Obituary "$O_SPREADGUN_BLACK";
}
}
@ -1046,6 +1058,7 @@ Class OnFireTrail : Actor
}
action void A_Flame()
{
special1++;
if ( waterlevel > 0 )
vel *= .9;
else
@ -1059,7 +1072,7 @@ Class OnFireTrail : Actor
s.vel = (FRandom[FlameT](-.2,.2),FRandom[FlameT](-.2,.2),FRandom[FlameT](-.2,.2));
s.vel += vel*.3;
s.alpha *= alpha*2;
s.scale *= .5+abs(scale.x)*(.5+GetAge()/6.);
s.scale *= .5+abs(scale.x)*(.5+special1/6.);
Destroy();
return;
}
@ -1069,7 +1082,7 @@ Class OnFireTrail : Actor
s.vel = (FRandom[FlameT](-.2,.2),FRandom[FlameT](-.2,.2),FRandom[FlameT](-.2,.2));
s.vel += vel*.3;
s.alpha *= alpha*1.5;
s.scale *= .5+abs(scale.x)*(.5+GetAge()/6.);
s.scale *= .5+abs(scale.x)*(.5+special1/6.);
}
}
Default
@ -1084,8 +1097,6 @@ Class OnFireTrail : Actor
+NOGRAVITY;
+NOFRICTION;
+SLIDESONWALLS;
+ACTIVATEPCROSS;
+ACTIVATEIMPACT;
+NOTELEPORT;
+FORCEXYBILLBOARD;
+ROLLSPRITE;
@ -1093,6 +1104,7 @@ Class OnFireTrail : Actor
+DROPOFF;
+NOBLOCKMONST;
+DONTSPLASH;
+NOINTERACTION;
}
States
{
@ -1269,6 +1281,7 @@ Class BallImpact : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -1600,6 +1613,7 @@ Class GoldenImpact : Actor
+FORCEXYBILLBOARD;
+NOTELEPORT;
+FOILINVUL;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -1728,6 +1742,7 @@ Class GoldenSubImpact : Actor
+FORCEXYBILLBOARD;
+NOTELEPORT;
+FOILINVUL;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -1853,6 +1868,7 @@ Class GoldenSubSubImpact : Actor
+FORCEXYBILLBOARD;
+NOTELEPORT;
+FOILINVUL;
+NOINTERACTION;
}
override void PostBeginPlay()
{

View file

@ -63,10 +63,10 @@ Class BiosparkHitbox : Actor
+NOCLIP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void Tick()
{
Super.Tick();
if ( !target || !target.InStateSequence(target.CurState,target.FindState("Spawn")) )
{
Destroy();
@ -166,8 +166,9 @@ Class BigBiospark : Actor
void A_BigsparkTick()
{
if ( !(GetAge()%4) )
if ( !(special2%4) )
A_QuakeEx(Random[Sparkster](1,3),Random[Sparkster](1,3),Random[Sparkster](1,3),Random[Sparkster](4,6),0,400,"",QF_RELATIVE|QF_SCALEDOWN,falloff:100,rollIntensity:FRandom[Sparkster](.1,.3));
special2++;
int numpt = Random[ExploS](8,12);
for ( int i=0; i<numpt; i++ )
{
@ -193,7 +194,7 @@ Class BigBiospark : Actor
if ( LineTrace(ang,dist,pt,TRF_THRUACTORS|TRF_THRUHITSCAN) ) continue;
Vector3 ofs = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*dist;
Vector3 spos = level.Vec3Offset(pos,ofs);
let s = Spawn((!(GetAge()%8)&&!Random[Sparkster](0,10))?"BiosparkArcBig":!Random[Sparkster](0,5)?"BiosparkArc":"BiosparkArcSmall",spos);
let s = Spawn((!(special2%8)&&!Random[Sparkster](0,10))?"BiosparkArcBig":!Random[Sparkster](0,5)?"BiosparkArc":"BiosparkArcSmall",spos);
s.target = target;
s.master = self;
s.ReactionTime += Random[Sparkster](-6,6);
@ -216,7 +217,7 @@ Class BigBiospark : Actor
// wander
dir = (dir+(FRandom[Sparkster](-1,1),FRandom[Sparkster](-1,1),FRandom[Sparkster](-1,1))*FRandom[Sparkster](.05,.1)).unit();
// seek targets
if ( !(GetAge()%5) )
if ( !(special2%5) )
{
double closest = double.infinity;
let bt = BlockThingsIterator.Create(self,8000);
@ -443,6 +444,7 @@ Class BiosparkBall : Actor
}
void A_SparkTick()
{
special2++;
int numpt = Random[ExploS](4,8);
for ( int i=0; i<numpt; i++ )
{
@ -482,7 +484,7 @@ Class BiosparkBall : Actor
if ( bAMBUSH )
dir = (dir+(FRandom[Sparkster](-1,1),FRandom[Sparkster](-1,1),FRandom[Sparkster](-1,1))*FRandom[Sparkster](.02,.03)).unit();
// check targets at an interval, to save on performance
if ( !(GetAge()%5) )
if ( !(special2%5) )
{
double closest = double.infinity;
let bt = BlockThingsIterator.Create(self,500);
@ -693,6 +695,7 @@ Class BiosparkBeamImpact : Actor
+FORCERADIUSDMG;
+NODAMAGETHRUST;
+FORCEXYBILLBOARD;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -823,6 +826,7 @@ Class BiosparkComboImpactSub : Actor
+NOBLOCKMAP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
States
{
@ -850,6 +854,7 @@ Class BiosparkComboImpact : Actor
+NOBLOCKMAP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
void FlashPlayer( int str, double rad )
{
@ -1207,6 +1212,18 @@ Class BiosparkBeam : Actor
}
}
override void Tick()
{
if ( isFrozen() ) return;
if ( !CheckNoDelay() || (tics == -1) ) return;
if ( tics > 0 ) tics--;
while ( !tics )
{
if ( !SetState(CurState.NextState) )
return;
}
}
Default
{
Obituary "$O_SPARKSTER";
@ -1221,6 +1238,7 @@ Class BiosparkBeam : Actor
+INTERPOLATEANGLES;
+NOTELEPORT;
+FOILINVUL;
+NOINTERACTION;
}
States
@ -1252,12 +1270,19 @@ Class BiosparkChildBeam : Actor
+NOTELEPORT;
+ROLLSPRITE;
+ROLLCENTER;
+NOINTERACTION;
}
override void Tick()
{
Super.Tick();
if ( isFrozen() ) return;
A_FadeOut(.02);
if ( !CheckNoDelay() || (tics == -1) ) return;
if ( tics > 0 ) tics--;
while ( !tics )
{
if ( !SetState(CurState.NextState) )
return;
}
}
States
{
@ -1485,6 +1510,17 @@ Class BiosparkArc : Actor
frame = Random[Sparkster](0,11);
if ( !special1 ) special2 = Random[Sparkster](0,8);
}
override void Tick()
{
if ( isFrozen() ) return;
if ( !CheckNoDelay() || (tics == -1) ) return;
if ( tics > 0 ) tics--;
while ( !tics )
{
if ( !SetState(CurState.NextState) )
return;
}
}
Default
{
Obituary "$O_SPARKSTER";
@ -1500,6 +1536,7 @@ Class BiosparkArc : Actor
+INTERPOLATEANGLES;
+NOTELEPORT;
+FOILINVUL;
+NOINTERACTION;
}
States
{
@ -1564,6 +1601,7 @@ Class BiosparkSpark : Actor
+ROLLSPRITE;
+ROLLCENTER;
+FORCEXYBILLBOARD;
+NOINTERACTION;
}
States
{

View file

@ -89,6 +89,7 @@ Class ExplodiumMagTrail : Actor
+NOGRAVITY;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
Scale 1.1;
}
States
@ -224,6 +225,7 @@ Class ExplodiumBulletImpact : Actor
+FORCERADIUSDMG;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{

View file

@ -172,6 +172,17 @@ Class CandyBeam : Actor
b.special2 = special2;
b.frame = frame;
}
override void Tick()
{
if ( isFrozen() ) return;
if ( !CheckNoDelay() || (tics == -1) ) return;
if ( tics > 0 ) tics--;
while ( !tics )
{
if ( !SetState(CurState.NextState) )
return;
}
}
Default
{
Obituary "$O_CANDYGUN";
@ -186,6 +197,7 @@ Class CandyBeam : Actor
+DONTSPLASH;
+INTERPOLATEANGLES;
+NOTELEPORT;
+NOINTERACTION;
}
States
{
@ -214,6 +226,7 @@ Class CandyPop : Actor
+ROLLSPRITE;
+ROLLCENTER;
+NOTELEPORT;
+NOINTERACTION;
}
void FlashPlayer( int str, double rad )
{
@ -397,6 +410,7 @@ Class CandyMagTrail : Actor
+NOGRAVITY;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
Scale 2.4;
Alpha 0.7;
}
@ -713,6 +727,7 @@ Class CandyBulletImpact : Actor
+FORCERADIUSDMG;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -788,6 +803,7 @@ Class CandyRing : Actor
+NOBLOCKMAP;
+FORCEXYBILLBOARD;
+NOTELEPORT;
+NOINTERACTION;
}
States
{

View file

@ -51,6 +51,7 @@ Class SilverAirRip : Actor
+NOTELEPORT;
+FORCERADIUSDMG;
+NODAMAGETHRUST;
+NOINTERACTION;
}
override void PostBeginPlay()
{
@ -73,6 +74,7 @@ Class SilverImpact : Actor
+NOTELEPORT;
+FORCERADIUSDMG;
+NODAMAGETHRUST;
+NOINTERACTION;
}
override void PostBeginPlay()
{