1289 lines
32 KiB
Text
1289 lines
32 KiB
Text
// Hellblazer projectiles and effects
|
|
|
|
Class HellblazerExplLight : PaletteLight
|
|
{
|
|
Default
|
|
{
|
|
Tag "HellExpl";
|
|
Args 0,0,0,200;
|
|
ReactionTime 25;
|
|
}
|
|
}
|
|
Class HellblazerExplLight2 : PaletteLight
|
|
{
|
|
Default
|
|
{
|
|
Tag "HellExpl";
|
|
Args 0,0,0,120;
|
|
ReactionTime 20;
|
|
}
|
|
}
|
|
Class HellblazerExplLight3 : PaletteLight
|
|
{
|
|
Default
|
|
{
|
|
Tag "HellExpl";
|
|
Args 0,0,0,900;
|
|
ReactionTime 60;
|
|
}
|
|
}
|
|
|
|
Class HellblazerSubExpl : Actor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
Scale 2.2;
|
|
Radius 0.1;
|
|
Height 0;
|
|
Alpha .75;
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+FORCEXYBILLBOARD;
|
|
+NOTELEPORT;
|
|
+NOINTERACTION;
|
|
+ROLLSPRITE;
|
|
+ROLLCENTER;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
roll = FRandom[ExploS](0,360);
|
|
scale.x *= RandomPick[ExploS](-1,1);
|
|
scale.y *= RandomPick[ExploS](-1,1);
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( isFrozen() ) return;
|
|
if ( !CheckNoDelay() || (tics == -1) ) return;
|
|
if ( tics > 0 ) tics--;
|
|
while ( !tics )
|
|
{
|
|
if ( !SetState(CurState.NextState) )
|
|
return;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XEX0 ABCDEFGHIJKLMNOPQRS 1 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class HellblazerRing : Actor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
Scale 2.;
|
|
Radius 0.1;
|
|
Height 0;
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+FORCEXYBILLBOARD;
|
|
+NOTELEPORT;
|
|
+NOINTERACTION;
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( isFrozen() ) return;
|
|
if ( !CheckNoDelay() || (tics == -1) ) return;
|
|
if ( tics > 0 ) tics--;
|
|
while ( !tics )
|
|
{
|
|
if ( !SetState(CurState.NextState) )
|
|
return;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XRG3 ACEGIKMOQSUW 1 Bright A_SetScale(scale.x*1.15);
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class HellblazerRing2 : Actor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
Scale 3.;
|
|
Radius 0.1;
|
|
Height 0;
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+FORCEXYBILLBOARD;
|
|
+NOTELEPORT;
|
|
+NOINTERACTION;
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( isFrozen() ) return;
|
|
if ( !CheckNoDelay() || (tics == -1) ) return;
|
|
if ( tics > 0 ) tics--;
|
|
while ( !tics )
|
|
{
|
|
if ( !SetState(CurState.NextState) )
|
|
return;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XRG3 ABCDEFGHIJKLMNOPQRSTUVWX 1 Bright A_SetScale(scale.x*1.1);
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class HellblazerTrail : Actor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
Radius .1;
|
|
Height 0.;
|
|
Scale .2;
|
|
Alpha .3;
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+DONTSPLASH;
|
|
+NOTELEPORT;
|
|
+FORCEXYBILLBOARD;
|
|
+NOINTERACTION;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
SetState(FindState("Spawn")+Random[ExploS](0,7));
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( isFrozen() ) return;
|
|
if ( !CheckNoDelay() || (tics == -1) ) return;
|
|
if ( tics > 0 ) tics--;
|
|
while ( !tics )
|
|
{
|
|
if ( !SetState(CurState.NextState) )
|
|
return;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
JFLR ABCDEFGH 1 Bright
|
|
{
|
|
A_FadeOut(.06);
|
|
A_SetScale(scale.x*.95);
|
|
if ( waterlevel > 0 )
|
|
{
|
|
let b = Spawn("SWWMBubble",pos);
|
|
b.vel = vel;
|
|
b.scale *= scale.x;
|
|
Destroy();
|
|
}
|
|
}
|
|
Loop;
|
|
}
|
|
}
|
|
|
|
Class HellblazerFlare : Actor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
Radius .1;
|
|
Height 0.;
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+DONTSPLASH;
|
|
+NOTELEPORT;
|
|
+FORCEXYBILLBOARD;
|
|
+NOINTERACTION;
|
|
}
|
|
|
|
override void PostBeginPlay()
|
|
{
|
|
if ( !master ) return;
|
|
State sp = FindState("Spawn");
|
|
if ( master is 'HellblazerCrackshot' ) SetState(sp+1);
|
|
else if ( master is 'HellblazerRavager' ) SetState(sp+2);
|
|
else if ( master is 'HellblazerWarhead' ) SetState(sp+3);
|
|
}
|
|
|
|
override void Tick()
|
|
{
|
|
if ( isFrozen() ) return;
|
|
if ( !master || !master.bMISSILE )
|
|
{
|
|
Destroy();
|
|
return;
|
|
}
|
|
Vector3 traildir = -(cos(master.angle)*cos(master.pitch),sin(master.angle)*cos(master.pitch),sin(-master.pitch));
|
|
SetOrigin(level.Vec3Offset(master.pos,traildir*3),true);
|
|
}
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
HFLR ABCD -1 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
// rockets
|
|
Class HellblazerMissile : Actor
|
|
{
|
|
int deto;
|
|
Actor seektarget;
|
|
Vector3 InitialDir, Acceleration;
|
|
|
|
Default
|
|
{
|
|
Obituary "$O_HELLBLAZER";
|
|
DamageType 'Exploded';
|
|
Radius 2;
|
|
Height 4;
|
|
Speed 50;
|
|
PROJECTILE;
|
|
+EXPLODEONWATER;
|
|
+FORCERADIUSDMG;
|
|
+NODAMAGETHRUST;
|
|
+HITTRACER;
|
|
}
|
|
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
if ( bNOGRAVITY )
|
|
{
|
|
A_StartSound("hellblazer/fly",CHAN_BODY,CHANF_LOOP,1.,2.);
|
|
let t = Spawn("HellblazerFlare",pos);
|
|
t.master = self;
|
|
}
|
|
}
|
|
|
|
void A_BlazerTick( Color smokecol )
|
|
{
|
|
Vector3 traildir = -(cos(angle)*cos(pitch),sin(angle)*cos(pitch),sin(-pitch));
|
|
for ( int i=0; i<3; i++ )
|
|
{
|
|
let s = Spawn("SWWMHalfSmoke",level.Vec3Offset(pos,traildir*3));
|
|
s.SetShade(smokecol*Random[Hellblazer](48,63));
|
|
s.scale *= FRandom[Hellblazer](.8,1.2);
|
|
s.special1 = Random[Hellblazer](0,2);
|
|
s.alpha *= .5;
|
|
s.vel = .3*vel + (traildir+(FRandom[Hellblazer](-.4,.4),FRandom[Hellblazer](-.4,.4),FRandom[Hellblazer](-.4,.4))).unit()*FRandom[Hellblazer](1.,2.);
|
|
}
|
|
if ( bNOGRAVITY )
|
|
{
|
|
for ( double i=0.; i<vel.length(); i+= 5. )
|
|
{
|
|
let t = Spawn("HellblazerTrail",level.Vec3Offset(pos,-vel.unit()*i+traildir*3));
|
|
t.vel = traildir*4.;
|
|
}
|
|
if ( InitialDir.length() < double.epsilon ) InitialDir = vel.unit();
|
|
vel += Acceleration/GameTicRate;
|
|
Vector3 dir = vel.unit();
|
|
if ( vel.length() > 50. ) vel = dir*50.;
|
|
}
|
|
if ( deto > 1 )
|
|
{
|
|
ExplodeMissile();
|
|
return;
|
|
}
|
|
if ( seektarget )
|
|
{
|
|
// seek tracer
|
|
if ( SWWMUtility.SphereIntersect(seektarget,level.Vec3Offset(pos,vel),bNOGRAVITY?50:90) )
|
|
{
|
|
deto++;
|
|
tracer = seektarget;
|
|
return;
|
|
}
|
|
if ( bNOGRAVITY )
|
|
{
|
|
Vector3 SeekingDir = level.Vec3Diff(pos,seektarget.Vec3Offset(0,0,seektarget.height/2)).unit();
|
|
if ( SeekingDir dot InitialDir > -1 )
|
|
{
|
|
double MagnitudeVel = Vel.length();
|
|
SeekingDir = (SeekingDir*.25*MagnitudeVel+Vel).unit();
|
|
Vel = MagnitudeVel*SeekingDir;
|
|
Acceleration = 25*SeekingDir;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
// proximity check
|
|
let bt = BlockThingsIterator.Create(self,200);
|
|
while ( bt.Next() )
|
|
{
|
|
let t = bt.Thing;
|
|
if ( !t || !t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain') && !t.player) || (t.Health <= 0) || (target && t.IsFriend(target)) || !SWWMUtility.SphereIntersect(t,level.Vec3Offset(pos,vel),bNOGRAVITY?50:90) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
|
|
deto++;
|
|
tracer = t;
|
|
break;
|
|
}
|
|
}
|
|
|
|
void A_BlazerMissileExplode()
|
|
{
|
|
bForceXYBillboard = true;
|
|
bRollSprite = false;
|
|
A_SetRenderStyle(1.0,STYLE_Add);
|
|
A_SprayDecal("BigRocketBlast",50);
|
|
A_SetScale(4.5);
|
|
SWWMUtility.DoExplosion(self,250,320000,200,90);
|
|
A_NoGravity();
|
|
A_QuakeEx(5,5,5,15,0,1500,"",QF_RELATIVE|QF_SCALEDOWN,falloff:500,rollIntensity:.8);
|
|
A_StopSound(CHAN_BODY);
|
|
A_StartSound("hellblazer/hitm",CHAN_WEAPON,attenuation:.8);
|
|
A_StartSound("hellblazer/hitm",CHAN_VOICE,attenuation:.5);
|
|
A_AlertMonsters(swwm_uncapalert?0:2500);
|
|
Spawn("HellblazerExplLight",pos);
|
|
int numpt = Random[Hellblazer](12,24);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](2,8);
|
|
let s = Spawn("SWWMSmoke",pos);
|
|
s.vel = pvel;
|
|
s.SetShade(Color(4,2,1)*Random[Hellblazer](48,63));
|
|
s.special1 = Random[Hellblazer](1,4);
|
|
s.scale *= 2.8;
|
|
s.alpha *= .4;
|
|
}
|
|
numpt = Random[Hellblazer](8,12);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](4,12);
|
|
let s = Spawn("SWWMSpark",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[Hellblazer](12,16);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](10,20);
|
|
let s = Spawn("SWWMChip",pos);
|
|
s.vel = pvel;
|
|
s.scale *= FRandom[Hellblazer](0.9,1.8);
|
|
}
|
|
Spawn("HellblazerRing",pos);
|
|
if ( swwm_omnibust ) BusterWall.ProjectileBust(self,250,(cos(angle)*cos(pitch),sin(angle)*cos(pitch),sin(-pitch)));
|
|
}
|
|
|
|
void A_SubExpl( double xscale = 1. )
|
|
{
|
|
special1++;
|
|
if ( (special1 > 8) || !(special1%2) ) return;
|
|
int numpt = Random[Hellblazer](0,8-special1);
|
|
double ang, pt;
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
ang = FRandom[Hellblazer](0,360);
|
|
pt = FRandom[Hellblazer](-90,90);
|
|
FLineTraceData d;
|
|
Vector3 HitNormal;
|
|
LineTrace(ang,FRandom[Hellblazer](10,20)+10*special1*xscale,pt,TRF_THRUACTORS,data:d);
|
|
hitnormal = -d.HitDir;
|
|
if ( d.HitType == TRACE_HitFloor )
|
|
{
|
|
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.top.Normal;
|
|
else hitnormal = d.HitSector.floorplane.Normal;
|
|
}
|
|
else if ( d.HitType == TRACE_HitCeiling )
|
|
{
|
|
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.bottom.Normal;
|
|
else hitnormal = d.HitSector.ceilingplane.Normal;
|
|
}
|
|
else if ( d.HitType == TRACE_HitWall )
|
|
{
|
|
hitnormal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit();
|
|
if ( !d.LineSide ) hitnormal *= -1;
|
|
}
|
|
let p = Spawn("HellblazerSubExpl",d.HitLocation+hitnormal*4);
|
|
p.angle = atan2(hitnormal.y,hitnormal.x);
|
|
p.pitch = asin(-hitnormal.z);
|
|
p.target = target;
|
|
p.scale *= xscale*(2-special1*.1);
|
|
p.alpha *= 1-special1*.1;
|
|
}
|
|
}
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A 1 A_BlazerTick(Color(4,3,2));
|
|
Wait;
|
|
Death:
|
|
TNT1 A 0 A_BlazerMissileExplode();
|
|
HEXP ABCDEFGHIJKLMNOPQR 1 Bright A_SubExpl();
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class HellblazerCrackshot : HellblazerMissile
|
|
{
|
|
void A_BlazerCrackshotExplode()
|
|
{
|
|
bForceXYBillboard = true;
|
|
bRollSprite = false;
|
|
A_SetRenderStyle(1.0,STYLE_Add);
|
|
A_SprayDecal("BigRocketBlast",50);
|
|
A_SetScale(3.);
|
|
SWWMUtility.DoExplosion(self,200,320000,160,60);
|
|
A_NoGravity();
|
|
A_QuakeEx(4,4,4,12,0,1200,"",QF_RELATIVE|QF_SCALEDOWN,falloff:400,rollIntensity:.6);
|
|
A_StopSound(CHAN_BODY);
|
|
A_StartSound("hellblazer/hitc",CHAN_WEAPON,attenuation:.7);
|
|
A_StartSound("hellblazer/hitc",CHAN_VOICE,attenuation:.4);
|
|
A_AlertMonsters(swwm_uncapalert?0:2400);
|
|
Spawn("HellblazerExplLight",pos);
|
|
int numpt = Random[Hellblazer](12,24);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](2,8);
|
|
let s = Spawn("SWWMSmoke",pos);
|
|
s.vel = pvel;
|
|
s.SetShade(Color(4,2,1)*Random[Hellblazer](48,63));
|
|
s.special1 = Random[Hellblazer](1,4);
|
|
s.scale *= 2.8;
|
|
s.alpha *= .4;
|
|
}
|
|
numpt = Random[Hellblazer](8,12);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](4,12);
|
|
let s = Spawn("SWWMSpark",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[Hellblazer](12,16);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](10,20);
|
|
let s = Spawn("SWWMChip",pos);
|
|
s.vel = pvel;
|
|
s.scale *= FRandom[Hellblazer](0.9,1.8);
|
|
}
|
|
Spawn("HellblazerRing",pos);
|
|
for ( int i=0; i<8; i++ )
|
|
{
|
|
double ang = FRandom[Hellblazer](0,360);
|
|
double pt = FRandom[Hellblazer](-90,90);
|
|
let c = Spawn("HellblazerClusterMini",pos);
|
|
c.angle = ang;
|
|
c.pitch = pt;
|
|
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),sin(-pt))*c.speed*FRandom[Hellblazer](.8,1.2);
|
|
c.target = target;
|
|
c.ReactionTime += Random[Hellblazer](-10,10);
|
|
HellblazerClusterMini(c).A_Steer(tracer);
|
|
}
|
|
if ( swwm_omnibust ) BusterWall.ProjectileBust(self,200,(cos(angle)*cos(pitch),sin(angle)*cos(pitch),sin(-pitch)));
|
|
}
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A 1 A_BlazerTick(Color(2,4,2));
|
|
Wait;
|
|
Death:
|
|
TNT1 A 0 A_BlazerCrackshotExplode();
|
|
HEXP ABCDEFGHIJKLMNOPQR 1 Bright A_SubExpl(1.25);
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class HellblazerRavager : HellblazerMissile
|
|
{
|
|
void A_BlazerRavagerExplode()
|
|
{
|
|
bForceXYBillboard = true;
|
|
bRollSprite = false;
|
|
A_SetRenderStyle(1.0,STYLE_Add);
|
|
A_SprayDecal("HugeRocketBlast",50);
|
|
A_SetScale(8.);
|
|
SWWMUtility.DoExplosion(self,300,320000,300,120);
|
|
A_NoGravity();
|
|
A_QuakeEx(6,6,6,30,0,2000,"",QF_RELATIVE|QF_SCALEDOWN,falloff:800,rollIntensity:1.);
|
|
A_StopSound(CHAN_BODY);
|
|
A_StartSound("hellblazer/hitr",CHAN_WEAPON,attenuation:.6);
|
|
A_StartSound("hellblazer/hitr",CHAN_VOICE,attenuation:.3);
|
|
A_AlertMonsters(swwm_uncapalert?0:4500);
|
|
Spawn("HellblazerExplLight",pos);
|
|
int numpt = Random[Hellblazer](16,28);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](4,12);
|
|
let s = Spawn("SWWMSmoke",pos);
|
|
s.vel = pvel;
|
|
s.SetShade(Color(4,2,1)*Random[Hellblazer](48,63));
|
|
s.special1 = Random[Hellblazer](2,5);
|
|
s.scale *= 3.2;
|
|
s.alpha *= .3;
|
|
}
|
|
numpt = Random[Hellblazer](8,12);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](4,12);
|
|
let s = Spawn("SWWMSpark",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[Hellblazer](12,20);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](10,20);
|
|
let s = Spawn("SWWMChip",pos);
|
|
s.vel = pvel;
|
|
s.scale *= FRandom[Hellblazer](0.9,1.8);
|
|
}
|
|
Spawn("HellblazerRing",pos);
|
|
if ( swwm_omnibust ) BusterWall.ProjectileBust(self,400,(cos(angle)*cos(pitch),sin(angle)*cos(pitch),sin(-pitch)));
|
|
}
|
|
|
|
void A_RavagerSub()
|
|
{
|
|
special2++;
|
|
if ( (special2 > 10) || (special2%3) ) return;
|
|
int numpt = 11-special2;
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
double ang = FRandom[Hellblazer](0,360);
|
|
double pt = FRandom[Hellblazer](-90,90);
|
|
let c = Spawn("HellblazerRavagerArm",pos);
|
|
c.angle = ang;
|
|
c.pitch = pt;
|
|
c.target = target;
|
|
}
|
|
}
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A 1 A_BlazerTick(Color(4,2,2));
|
|
Wait;
|
|
Death:
|
|
TNT1 A 0 A_BlazerRavagerExplode();
|
|
HEXP ABCDEFGHIJKLMNOPQR 1 Bright
|
|
{
|
|
A_SubExpl(2.);
|
|
A_RavagerSub();
|
|
}
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class HellblazerWarhead : HellblazerMissile
|
|
{
|
|
int nkill;
|
|
|
|
void A_BlazerWarheadExplode()
|
|
{
|
|
nkill = 0;
|
|
bForceXYBillboard = true;
|
|
bRollSprite = false;
|
|
A_SetRenderStyle(1.0,STYLE_Add);
|
|
A_SprayDecal("WumboRocketBlast",150);
|
|
A_SetScale(7.);
|
|
int nhit;
|
|
[nhit, nkill] = SWWMUtility.DoExplosion(self,1500,600000,400,200,DE_COUNTENEMIES);
|
|
A_NoGravity();
|
|
A_QuakeEx(9,9,9,150,0,12000,"",QF_RELATIVE|QF_SCALEDOWN,falloff:4000,rollIntensity:2.);
|
|
A_StopSound(CHAN_BODY);
|
|
A_StartSound("hellblazer/hitw",CHAN_WEAPON,attenuation:.4);
|
|
A_StartSound("hellblazer/hitw",CHAN_VOICE,attenuation:.1);
|
|
A_AlertMonsters(swwm_uncapalert?0:40000);
|
|
Spawn("HellblazerExplLight3",pos);
|
|
int numpt = Random[Hellblazer](20,30);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](4,20);
|
|
let s = Spawn("SWWMSmoke",pos);
|
|
s.vel = pvel;
|
|
s.SetShade(Color(4,2,1)*Random[Hellblazer](48,63));
|
|
s.special1 = Random[Hellblazer](3,8);
|
|
s.scale *= 4.;
|
|
s.alpha *= .4;
|
|
}
|
|
numpt = Random[Hellblazer](10,20);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](4,28);
|
|
let s = Spawn("SWWMSpark",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[Hellblazer](20,25);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](10,40);
|
|
let s = Spawn("SWWMChip",pos);
|
|
s.vel = pvel;
|
|
s.scale *= FRandom[Hellblazer](0.9,1.8);
|
|
}
|
|
Spawn("HellblazerRing2",pos);
|
|
if ( swwm_omnibust ) BusterWall.ProjectileBust(self,1500,(cos(angle)*cos(pitch),sin(angle)*cos(pitch),sin(-pitch)));
|
|
}
|
|
|
|
void A_WarheadSub()
|
|
{
|
|
if ( special1 < 40 )
|
|
{
|
|
int nhit, nkil;
|
|
[nhit, nkil] = SWWMUtility.DoExplosion(self,320-special1*8,600000-special1*12000,200+special1*30,flags:DE_COUNTENEMIES);
|
|
nkill += nkil;
|
|
}
|
|
special1++;
|
|
if ( (special1 <= 30) && !(special1%2) )
|
|
{
|
|
int numpt = 30-special1/2;
|
|
double ang, pt;
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
ang = FRandom[Hellblazer](0,360);
|
|
pt = FRandom[Hellblazer](-90,90);
|
|
FLineTraceData d;
|
|
Vector3 HitNormal;
|
|
LineTrace(ang,FRandom[Hellblazer](30,40)+12*special1,pt,TRF_THRUACTORS,data:d);
|
|
hitnormal = -d.HitDir;
|
|
if ( d.HitType == TRACE_HitFloor )
|
|
{
|
|
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.top.Normal;
|
|
else hitnormal = d.HitSector.floorplane.Normal;
|
|
}
|
|
else if ( d.HitType == TRACE_HitCeiling )
|
|
{
|
|
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.bottom.Normal;
|
|
else hitnormal = d.HitSector.ceilingplane.Normal;
|
|
}
|
|
else if ( d.HitType == TRACE_HitWall )
|
|
{
|
|
hitnormal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit();
|
|
if ( !d.LineSide ) hitnormal *= -1;
|
|
}
|
|
let p = Spawn("HellblazerSubExpl",d.HitLocation+hitnormal*4);
|
|
p.angle = atan2(hitnormal.y,hitnormal.x);
|
|
p.pitch = asin(-hitnormal.z);
|
|
p.target = target;
|
|
p.scale *= (3-special1*.04);
|
|
p.alpha *= 1-special1*.02;
|
|
}
|
|
}
|
|
special2++;
|
|
if ( (special2 <= 15) && !(special2%3) )
|
|
{
|
|
int numpt = 5-special2/5;
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
double ang = FRandom[Hellblazer](0,360);
|
|
double pt = FRandom[Hellblazer](-90,90);
|
|
let c = Spawn("HellblazerWarheadArm",pos);
|
|
c.angle = ang;
|
|
c.pitch = pt;
|
|
c.target = target;
|
|
c.master = self;
|
|
}
|
|
}
|
|
}
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A 1 A_BlazerTick(Color(3,2,4));
|
|
Wait;
|
|
Death:
|
|
TNT1 A 0 A_BlazerWarheadExplode();
|
|
HEXP AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRR 1 Bright A_WarheadSub();
|
|
TNT1 A 1
|
|
{
|
|
A_WarheadSub();
|
|
if ( special1 >= 40 )
|
|
{
|
|
if ( target ) SWWMUtility.AchievementProgress("slayer",invoker.nkill,target.player);
|
|
Destroy();
|
|
}
|
|
}
|
|
Wait;
|
|
}
|
|
}
|
|
|
|
Mixin Class HellblazerGrenade
|
|
{
|
|
double rollvel, anglevel, pitchvel;
|
|
Vector3 oldvel;
|
|
|
|
Default
|
|
{
|
|
BounceFactor 1.;
|
|
WallBounceFactor 1.;
|
|
Gravity .35;
|
|
ReactionTime 85;
|
|
-NOGRAVITY;
|
|
+USEBOUNCESTATE;
|
|
+BOUNCEONWALLS;
|
|
+BOUNCEONFLOORS;
|
|
+BOUNCEONCEILINGS;
|
|
+ALLOWBOUNCEONACTORS;
|
|
+DONTBOUNCEONSKY;
|
|
+CANBOUNCEWATER;
|
|
+INTERPOLATEANGLES;
|
|
+ROLLSPRITE;
|
|
+ROLLCENTER;
|
|
}
|
|
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
rollvel = FRandom[Hellblazer](-4,4);
|
|
anglevel = FRandom[Hellblazer](-4,4);
|
|
pitchvel = FRandom[Hellblazer](-4,4);
|
|
oldvel = vel;
|
|
}
|
|
override void Tick()
|
|
{
|
|
oldvel = vel;
|
|
Super.Tick();
|
|
if ( isFrozen() || !InStateSequence(CurState,FindState("Spawn")) ) return;
|
|
roll += rollvel;
|
|
angle += anglevel;
|
|
pitch += pitchvel;
|
|
ReactionTime--;
|
|
if ( ReactionTime <= 0 ) ExplodeMissile();
|
|
}
|
|
virtual void A_HandleBounce()
|
|
{
|
|
Vector3 HitNormal = -vel.unit();
|
|
F3DFloor ff;
|
|
if ( BlockingFloor )
|
|
{
|
|
// find closest 3d floor for its normal
|
|
for ( int i=0; i<BlockingFloor.Get3DFloorCount(); i++ )
|
|
{
|
|
if ( !(BlockingFloor.Get3DFloor(i).flags&F3DFloor.FF_SOLID) ) continue;
|
|
if ( !(BlockingFloor.Get3DFloor(i).top.ZAtPoint(pos.xy) ~== floorz) ) continue;
|
|
ff = BlockingFloor.Get3DFloor(i);
|
|
break;
|
|
}
|
|
if ( ff ) HitNormal = -ff.top.Normal;
|
|
else HitNormal = BlockingFloor.floorplane.Normal;
|
|
}
|
|
else if ( BlockingCeiling )
|
|
{
|
|
// find closest 3d floor for its normal
|
|
for ( int i=0; i<BlockingCeiling.Get3DFloorCount(); i++ )
|
|
{
|
|
if ( !(BlockingCeiling.Get3DFloor(i).flags&F3DFloor.FF_SOLID) ) continue;
|
|
if ( !(BlockingCeiling.Get3DFloor(i).bottom.ZAtPoint(pos.xy) ~== ceilingz) ) continue;
|
|
ff = BlockingCeiling.Get3DFloor(i);
|
|
break;
|
|
}
|
|
if ( ff ) HitNormal = -ff.bottom.Normal;
|
|
else HitNormal = BlockingCeiling.ceilingplane.Normal;
|
|
}
|
|
else if ( BlockingLine )
|
|
{
|
|
HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit();
|
|
if ( !SWWMUtility.PointOnLineSide(pos.xy,BlockingLine) )
|
|
HitNormal *= -1;
|
|
}
|
|
else if ( BlockingMobj )
|
|
{
|
|
Vector3 diff = level.Vec3Diff(BlockingMobj.Vec3Offset(0,0,BlockingMobj.Height/2),pos);
|
|
HitNormal = diff.unit();
|
|
}
|
|
// undo the bounce, we need to hook in our own
|
|
vel = oldvel;
|
|
// re-do the bounce with our formula
|
|
Vector3 RealHitNormal = HitNormal;
|
|
HitNormal = (HitNormal+(FRandom[Hellblazer](-.1,.1),FRandom[Hellblazer](-.1,.1),FRandom[Hellblazer](-.1,.1))).unit();
|
|
if ( (HitNormal dot RealHitNormal) < 0 ) HitNormal *= -.5;
|
|
vel = FRandom[Hellblazer](.8,.9)*((vel dot HitNormal)*HitNormal*(FRandom[Hellblazer](-2.,-1.6))+vel);
|
|
if ( vel.z > 10 ) vel.z = 0.5*(10+vel.z);
|
|
bHITOWNER = true;
|
|
if ( vel.length() < 4. )
|
|
{
|
|
ClearBounce();
|
|
ExplodeMissile();
|
|
return;
|
|
}
|
|
if ( swwm_extraalert ) A_AlertMonsters(swwm_uncapalert?0:300);
|
|
A_StartSound("hellblazer/bounce",CHAN_ITEM);
|
|
rollvel = FRandom[Hellblazer](-16,16);
|
|
anglevel = FRandom[Hellblazer](-16,16);
|
|
pitchvel = FRandom[Hellblazer](-16,16);
|
|
// steer towards seek target
|
|
if ( seektarget )
|
|
{
|
|
Vector3 dirto = level.Vec3Diff(pos,seektarget.Vec3Offset(0,0,seektarget.Height/2));
|
|
dirto /= dirto.length();
|
|
dirto.z += .1;
|
|
double spd = vel.length();
|
|
vel /= spd;
|
|
vel = (vel*.3+dirto*.7)*spd;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Bounce:
|
|
XZW1 A 0 A_HandleBounce();
|
|
Goto Spawn;
|
|
}
|
|
}
|
|
|
|
// grenades
|
|
Class HellblazerMissile2 : HellblazerMissile
|
|
{
|
|
Mixin HellblazerGrenade;
|
|
}
|
|
|
|
Class HellblazerCrackshot2 : HellblazerCrackshot
|
|
{
|
|
Mixin HellblazerGrenade;
|
|
}
|
|
|
|
Class HellblazerRavager2 : HellblazerRavager
|
|
{
|
|
Mixin HellblazerGrenade;
|
|
}
|
|
|
|
Class HellblazerWarhead2 : HellblazerWarhead
|
|
{
|
|
Mixin HellblazerGrenade;
|
|
}
|
|
|
|
Class HellblazerClusterMini : HellblazerMissile2
|
|
{
|
|
Default
|
|
{
|
|
Radius 2;
|
|
Height 4;
|
|
Speed 20;
|
|
ReactionTime 30;
|
|
}
|
|
|
|
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++ )
|
|
{
|
|
let s = Spawn("SWWMHalfSmoke",level.Vec3Offset(pos,traildir*3));
|
|
s.SetShade(smokecol*Random[Hellblazer](48,63));
|
|
s.scale *= FRandom[Hellblazer](.6,.8);
|
|
s.special1 = Random[Hellblazer](0,1);
|
|
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) && (special2 > 5) )
|
|
{
|
|
ExplodeMissile();
|
|
return;
|
|
}
|
|
// proximity check
|
|
let bt = BlockThingsIterator.Create(self,200);
|
|
while ( bt.Next() )
|
|
{
|
|
let t = bt.Thing;
|
|
if ( !t || !t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain') && !t.player) || (t.Health <= 0) || (target && t.IsFriend(target)) || !SWWMUtility.SphereIntersect(t,level.Vec3Offset(pos,vel),60) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
|
|
deto++;
|
|
break;
|
|
}
|
|
}
|
|
|
|
void A_ClusterExplode()
|
|
{
|
|
bForceXYBillboard = true;
|
|
bRollSprite = false;
|
|
A_SetRenderStyle(1.0,STYLE_Add);
|
|
A_SprayDecal("BigRocketBlast",50);
|
|
A_SetScale(2.5);
|
|
SWWMUtility.DoExplosion(self,50,200000,150,60);
|
|
A_NoGravity();
|
|
A_QuakeEx(4,4,4,12,0,1000,"",QF_RELATIVE|QF_SCALEDOWN,falloff:400,rollIntensity:.6);
|
|
A_StopSound(CHAN_BODY);
|
|
A_StartSound("hellblazer/hitcs",CHAN_WEAPON,attenuation:.9);
|
|
A_StartSound("hellblazer/hitcs",CHAN_VOICE,attenuation:.5);
|
|
A_AlertMonsters(swwm_uncapalert?0:2000);
|
|
Spawn("HellblazerExplLight2",pos);
|
|
int numpt = Random[Hellblazer](4,8);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](1,5);
|
|
let s = Spawn("SWWMSmoke",pos);
|
|
s.vel = pvel;
|
|
s.SetShade(Color(4,2,1)*Random[Hellblazer](48,63));
|
|
s.special1 = Random[Hellblazer](1,3);
|
|
s.scale *= 1.5;
|
|
s.alpha *= .4;
|
|
}
|
|
numpt = Random[Hellblazer](4,6);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](2,5);
|
|
let s = Spawn("SWWMSpark",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[Hellblazer](4,6);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](5,10);
|
|
let s = Spawn("SWWMChip",pos);
|
|
s.vel = pvel;
|
|
s.scale *= FRandom[Hellblazer](0.8,1.4);
|
|
}
|
|
let r = Spawn("HellblazerRing",pos);
|
|
r.scale *= .4;
|
|
}
|
|
void A_ClusterSubExpl()
|
|
{
|
|
special1++;
|
|
if ( (special1 > 5) || !(special1%2) ) return;
|
|
int numpt = Random[Hellblazer](0,5-special1);
|
|
double ang, pt;
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
ang = FRandom[Hellblazer](0,360);
|
|
pt = FRandom[Hellblazer](-90,90);
|
|
FLineTraceData d;
|
|
Vector3 HitNormal;
|
|
LineTrace(ang,FRandom[Hellblazer](6,12)+6*special1,pt,TRF_THRUACTORS,data:d);
|
|
hitnormal = -d.HitDir;
|
|
if ( d.HitType == TRACE_HitFloor )
|
|
{
|
|
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.top.Normal;
|
|
else hitnormal = d.HitSector.floorplane.Normal;
|
|
}
|
|
else if ( d.HitType == TRACE_HitCeiling )
|
|
{
|
|
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.bottom.Normal;
|
|
else hitnormal = d.HitSector.ceilingplane.Normal;
|
|
}
|
|
else if ( d.HitType == TRACE_HitWall )
|
|
{
|
|
hitnormal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit();
|
|
if ( !d.LineSide ) hitnormal *= -1;
|
|
}
|
|
let p = Spawn("HellblazerSubExpl",d.HitLocation+hitnormal*4);
|
|
p.angle = atan2(hitnormal.y,hitnormal.x);
|
|
p.pitch = asin(-hitnormal.z);
|
|
p.target = target;
|
|
p.scale *= 1.5-special1*.1;
|
|
p.alpha *= 1-special1*.1;
|
|
}
|
|
}
|
|
void A_Steer( Actor ignoreme = null )
|
|
{
|
|
if ( !bMISSILE ) return;
|
|
// try to steer towards a target
|
|
let bt = BlockThingsIterator.Create(self,800);
|
|
double closest = double.infinity;
|
|
Actor whomst = null;
|
|
while ( bt.Next() )
|
|
{
|
|
let t = bt.Thing;
|
|
if ( !t || (ignoreme && (t == ignoreme)) || !t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain')) || (t.Health <= 0) || (target && t.IsFriend(target)) || !SWWMUtility.SphereIntersect(t,level.Vec3Offset(pos,vel),800) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
|
|
double dist = Distance3D(t);
|
|
if ( dist > closest ) continue;
|
|
closest = dist;
|
|
whomst = t;
|
|
}
|
|
if ( !whomst ) return;
|
|
Vector3 dirto = level.Vec3Diff(pos,whomst.Vec3Offset(0,0,whomst.Height/2));
|
|
dirto /= dirto.length();
|
|
dirto.z += .1;
|
|
double spd = vel.length();
|
|
vel /= spd;
|
|
vel = (vel*.3+dirto*.7)*spd;
|
|
}
|
|
override void A_HandleBounce()
|
|
{
|
|
Super.A_HandleBounce();
|
|
A_Steer();
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A 1 A_ClusterTick(Color(2,4,2));
|
|
Wait;
|
|
Bounce:
|
|
XZW1 A 0 A_HandleBounce();
|
|
Goto Spawn;
|
|
Death:
|
|
TNT1 A 0 A_ClusterExplode();
|
|
HEXP ABCDEFGHIJKLMNOPQR 1 Bright A_ClusterSubExpl();
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class RavagerLight : PaletteLight
|
|
{
|
|
Default
|
|
{
|
|
Tag "DRed";
|
|
Args 0,0,0,250;
|
|
}
|
|
}
|
|
|
|
Class RavagerPuff : Actor
|
|
{
|
|
Vector2 initsc;
|
|
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
Scale .8;
|
|
Alpha .7;
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+DONTSPLASH;
|
|
+NOINTERACTION;
|
|
+NOTELEPORT;
|
|
+ROLLSPRITE;
|
|
+ROLLCENTER;
|
|
+FORCEXYBILLBOARD;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
scale *= FRandom[Hellblazer](.8,1.);
|
|
alpha *= FRandom[Hellblazer](.8,1.);
|
|
roll = FRandom[Hellblazer](0,360);
|
|
SetState(FindState("Spawn")+Random[Hellblazer](0,19));
|
|
initsc = scale;
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( isFrozen() ) return;
|
|
A_FadeOut((waterlevel>0)?.1:.02);
|
|
scale += initsc*.2;
|
|
if ( !CheckNoDelay() || (tics == -1) ) return;
|
|
if ( tics > 0 ) tics--;
|
|
while ( !tics )
|
|
{
|
|
if ( !SetState(CurState.NextState) )
|
|
return;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
RFLM ABCDEFGHIJKLMNOPQRST -1 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class HellblazerRavagerArm : Actor
|
|
{
|
|
Vector3 oldvel;
|
|
|
|
Default
|
|
{
|
|
Obituary "$O_HELLBLAZER";
|
|
DamageType 'Fire';
|
|
PROJECTILE;
|
|
+THRUACTORS;
|
|
+BOUNCEONWALLS;
|
|
+BOUNCEONFLOORS;
|
|
+BOUNCEONCEILINGS;
|
|
+CANBOUNCEWATER;
|
|
+USEBOUNCESTATE;
|
|
+NODAMAGETHRUST;
|
|
+FORCERADIUSDMG;
|
|
-NOGRAVITY;
|
|
Gravity 0.35;
|
|
BounceFactor 1.0;
|
|
Radius 2;
|
|
Height 2;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
reactiontime = Random[ExploS](15,25);
|
|
vel = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch))*FRandom[ExploS](10.,15.);
|
|
}
|
|
override void Tick()
|
|
{
|
|
oldvel = vel;
|
|
Super.Tick();
|
|
}
|
|
void A_HandleBounce()
|
|
{
|
|
Vector3 HitNormal = -vel.unit();
|
|
F3DFloor ff;
|
|
if ( BlockingFloor )
|
|
{
|
|
// find closest 3d floor for its normal
|
|
for ( int i=0; i<BlockingFloor.Get3DFloorCount(); i++ )
|
|
{
|
|
if ( !(BlockingFloor.Get3DFloor(i).flags&F3DFloor.FF_SOLID) ) continue;
|
|
if ( !(BlockingFloor.Get3DFloor(i).top.ZAtPoint(pos.xy) ~== floorz) ) continue;
|
|
ff = BlockingFloor.Get3DFloor(i);
|
|
break;
|
|
}
|
|
if ( ff ) HitNormal = -ff.top.Normal;
|
|
else HitNormal = BlockingFloor.floorplane.Normal;
|
|
}
|
|
else if ( BlockingCeiling )
|
|
{
|
|
// find closest 3d floor for its normal
|
|
for ( int i=0; i<BlockingCeiling.Get3DFloorCount(); i++ )
|
|
{
|
|
if ( !(BlockingCeiling.Get3DFloor(i).flags&F3DFloor.FF_SOLID) ) continue;
|
|
if ( !(BlockingCeiling.Get3DFloor(i).bottom.ZAtPoint(pos.xy) ~== ceilingz) ) continue;
|
|
ff = BlockingCeiling.Get3DFloor(i);
|
|
break;
|
|
}
|
|
if ( ff ) HitNormal = -ff.bottom.Normal;
|
|
else HitNormal = BlockingCeiling.ceilingplane.Normal;
|
|
}
|
|
else if ( BlockingLine )
|
|
{
|
|
HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit();
|
|
if ( !SWWMUtility.PointOnLineSide(pos.xy,BlockingLine) )
|
|
HitNormal *= -1;
|
|
}
|
|
else if ( BlockingMobj )
|
|
{
|
|
Vector3 diff = level.Vec3Diff(pos,BlockingMobj.pos);
|
|
if ( (pos.x+radius) <= (BlockingMobj.pos.x-BlockingMobj.radius) )
|
|
HitNormal = (-1,0,0);
|
|
else if ( (pos.x-radius) >= (BlockingMobj.pos.x+BlockingMobj.radius) )
|
|
HitNormal = (1,0,0);
|
|
else if ( (pos.y+radius) <= (BlockingMobj.pos.y-BlockingMobj.radius) )
|
|
HitNormal = (0,-1,0);
|
|
else if ( (pos.y-radius) >= (BlockingMobj.pos.y+BlockingMobj.radius) )
|
|
HitNormal = (0,1,0);
|
|
else if ( pos.z >= (BlockingMobj.pos.z+BlockingMobj.height) )
|
|
HitNormal = (0,0,1);
|
|
else if ( (pos.z+height) <= BlockingMobj.pos.z )
|
|
HitNormal = (0,0,-1);
|
|
}
|
|
// undo the bounce, we need to hook in our own
|
|
vel = oldvel;
|
|
// re-do the bounce with our formula
|
|
vel = (vel dot HitNormal)*HitNormal*FRandom[Hellblazer](-1.5,-1.)+vel;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
TNT1 A 1
|
|
{
|
|
if ( waterlevel > 0 ) ReactionTime -= 2;
|
|
let p = Spawn("RavagerPuff",pos);
|
|
p.alpha *= .4+.6*(ReactionTime/25.);
|
|
p.scale *= 2.5-1.5*(ReactionTime/25.);
|
|
if ( !(ReactionTime%3) )
|
|
{
|
|
let l = Spawn("RavagerLight",pos);
|
|
l.Args[3] = int(90+50*(ReactionTime/25.));
|
|
l.ReactionTime = int(2+8*(ReactionTime/25.));
|
|
l.target = p;
|
|
}
|
|
SWWMUtility.DoExplosion(self,15+reactiontime/2,2000+400*reactiontime,300-4*reactiontime,100);
|
|
double spd = min(vel.length()*1.1,50);
|
|
vel = (vel*.1+(FRandom[ExploS](-1.,1.),FRandom[ExploS](-1.,1.),FRandom[ExploS](-1.,1.))).unit()*spd;
|
|
Vector3 pvel = (FRandom[ExploS](-1,1),FRandom[ExploS](-1,1),FRandom[ExploS](-1,1)).unit()*FRandom[ExploS](1,5);
|
|
let s = Spawn("SWWMHalfSmoke",pos);
|
|
s.vel = pvel+vel*.2;
|
|
s.SetShade(Color(4,2,1)*Random[ExploS](48,63));
|
|
s.special1 = Random[ExploS](4,8);
|
|
s.scale *= 4.;
|
|
s.alpha *= .2+.3*(ReactionTime/25.);
|
|
if ( !(ReactionTime%2) )
|
|
{
|
|
int numpt = Random[Hellblazer](-2,4);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = vel+(FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1),FRandom[Hellblazer](-1,1)).unit()*FRandom[Hellblazer](2,4);
|
|
let s2 = Spawn("SWWMSpark",pos);
|
|
s2.scale *= .4;
|
|
s2.vel = pvel;
|
|
}
|
|
}
|
|
A_CountDown();
|
|
}
|
|
Wait;
|
|
Bounce:
|
|
TNT1 A 0 A_HandleBounce();
|
|
Goto Spawn;
|
|
}
|
|
}
|
|
|
|
Class HellblazerWarheadTrail : Actor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
+NOBLOCKMAP;
|
|
+NOGRAVITY;
|
|
+FORCEXYBILLBOARD;
|
|
+NOTELEPORT;
|
|
+NOINTERACTION;
|
|
Scale 2.4;
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( isFrozen() ) return;
|
|
if ( !CheckNoDelay() || (tics == -1) ) return;
|
|
if ( tics > 0 ) tics--;
|
|
while ( !tics )
|
|
{
|
|
if ( !SetState(CurState.NextState) )
|
|
return;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XEX0 ABCDEFGHIJKLMNOPQRS 1 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class HellblazerWarheadArm : Actor
|
|
{
|
|
Default
|
|
{
|
|
Obituary "$O_HELLBLAZER";
|
|
DamageType 'Exploded';
|
|
PROJECTILE;
|
|
+THRUACTORS;
|
|
+BOUNCEONWALLS;
|
|
+BOUNCEONFLOORS;
|
|
+BOUNCEONCEILINGS;
|
|
+CANBOUNCEWATER;
|
|
+NODAMAGETHRUST;
|
|
+FORCERADIUSDMG;
|
|
-NOGRAVITY;
|
|
Gravity 0.35;
|
|
BounceFactor 1.0;
|
|
Radius 4;
|
|
Height 4;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
reactiontime = Random[ExploS](20,25);
|
|
double ang, pt;
|
|
ang = FRandom[ExploS](0,360);
|
|
pt = FRandom[ExploS](-90,90);
|
|
vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[ExploS](20.,35.);
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
TNT1 A 1
|
|
{
|
|
Spawn("HellblazerWarheadTrail",pos);
|
|
int nhit, nkill;
|
|
[nhit, nkill] = SWWMUtility.DoExplosion(self,20+reactiontime*4,3000+500*reactiontime,120+4*reactiontime,flags:DE_COUNTENEMIES);
|
|
if ( HellblazerWarhead(master) ) HellblazerWarhead(master).nkill += nkill;
|
|
Vector3 pvel = (FRandom[ExploS](-1,1),FRandom[ExploS](-1,1),FRandom[ExploS](-1,1)).unit()*FRandom[ExploS](1,5);
|
|
let s = Spawn("SWWMHalfSmoke",pos);
|
|
s.vel = pvel+vel*.2;
|
|
s.SetShade(Color(4,2,1)*Random[ExploS](48,63));
|
|
s.special1 = Random[ExploS](1,3);
|
|
s.scale *= 6.;
|
|
s.alpha *= 0.1+.4*(ReactionTime/25.);
|
|
A_CountDown();
|
|
}
|
|
Wait;
|
|
}
|
|
}
|