324 lines
8.4 KiB
Text
324 lines
8.4 KiB
Text
// Spreadgun projectiles and effects
|
|
|
|
Class RedShellCasing : SWWMCasing
|
|
{
|
|
Default
|
|
{
|
|
BounceSound "spreadgun/casing";
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
heat = 0;
|
|
}
|
|
}
|
|
Class GoldShellCasing : RedShellCasing
|
|
{
|
|
Default
|
|
{
|
|
BounceSound "spreadgun/gcasing";
|
|
}
|
|
}
|
|
|
|
Class SpreadImpact : SWWMNonInteractiveActor
|
|
{
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
A_StartSound("spreadgun/pellet",CHAN_VOICE,CHANF_DEFAULT,.4,2.);
|
|
A_SprayDecal("TinyPock",-20);
|
|
int numpt = Random[Spreadgun](2,4)-special1;
|
|
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = (x+SWWMUtility.Vec3FromAngles(FRandom[Spreadgun](0,360),FRandom[Spreadgun](-90,90))*.8).unit()*FRandom[Spreadgun](.1,1.2);
|
|
let s = Spawn("SWWMSmoke",pos);
|
|
s.vel = pvel;
|
|
s.scale *= .6;
|
|
s.special1 = Random[Spreadgun](0,1);
|
|
s.SetShade(Color(1,1,1)*Random[Spreadgun](96,192));
|
|
}
|
|
numpt = Random[Spreadgun](-1,3)-special1;
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[Spreadgun](0,360),FRandom[Spreadgun](-90,90))*FRandom[Spreadgun](2,8);
|
|
let s = Spawn("SWWMSpark",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[Spreadgun](2,4)-special1;
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[Spreadgun](0,360),FRandom[Spreadgun](-90,90))*FRandom[Spreadgun](1,4);
|
|
let s = Spawn("SWWMChip",pos);
|
|
s.vel = pvel;
|
|
}
|
|
Destroy();
|
|
}
|
|
}
|
|
|
|
Class GExploLight : PaletteLight
|
|
{
|
|
Default
|
|
{
|
|
ReactionTime 80;
|
|
Args 0,0,0,800;
|
|
}
|
|
}
|
|
|
|
Class GExploRing : SWWMNonInteractiveActor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
Scale 8.;
|
|
+FORCEXYBILLBOARD;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XRG0 ABCDEFGHIJKLMNOPQRSTUVWX 1 Bright A_SetScale(scale.x*1.05);
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class GoldenImpact : SWWMNonInteractiveActor
|
|
{
|
|
Default
|
|
{
|
|
DamageType 'Explodium';
|
|
RenderStyle "Add";
|
|
Scale 8.;
|
|
+NODAMAGETHRUST;
|
|
+FORCERADIUSDMG;
|
|
+FORCEXYBILLBOARD;
|
|
+FOILINVUL;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
A_AlertMonsters(swwm_uncapalert?0:40000,AMF_EMITFROMTARGET);
|
|
SWWMUtility.DoExplosion(self,7777,90000,600,500,DE_EXTRAZTHRUST);
|
|
A_QuakeEx(9.,9.,9.,40,0,5000,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,falloff:500,rollintensity:1.5);
|
|
A_StartSound("spreadgun/goldexpl",CHAN_VOICE,attenuation:.3);
|
|
A_StartSound("spreadgun/goldexpl",CHAN_WEAPON,attenuation:.15);
|
|
A_SprayDecal("WumboRocketBlast",-172);
|
|
Scale *= FRandom[ExploS](0.8,1.1);
|
|
Scale.x *= RandomPick[ExploS](-1,1);
|
|
Scale.y *= RandomPick[ExploS](-1,1);
|
|
int numpt = Random[ExploS](30,40);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](1,9);
|
|
let s = Spawn("SWWMSmoke",pos);
|
|
s.vel = pvel;
|
|
s.SetShade(Color(1,1,1)*Random[ExploS](64,224)+Color(30,25,0));
|
|
s.special1 = Random[ExploS](3,6);
|
|
s.scale *= 3.5;
|
|
s.alpha *= .8;
|
|
}
|
|
numpt = Random[ExploS](8,12);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](2,12);
|
|
let s = Spawn("SWWMSpark",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[ExploS](6,16);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](2,24);
|
|
let s = Spawn("SWWMChip",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[ExploS](12,24);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](8,40);
|
|
let s = Spawn("FancyConfetti",pos);
|
|
s.scale *= 3.;
|
|
s.bAMBUSH = true;
|
|
s.vel = pvel;
|
|
}
|
|
Spawn("GExploLight",pos);
|
|
let r = Spawn("GExploRing",pos);
|
|
}
|
|
void A_GoldSpread()
|
|
{
|
|
special1++;
|
|
if ( (special1%4) || (special1 > 30) ) return;
|
|
FLineTraceData d;
|
|
Vector3 HitNormal;
|
|
Vector3 origin;
|
|
double ang, pt;
|
|
for ( int i=0; i<3; i++ )
|
|
{
|
|
double totaldist = 30+(special1**2.)*.4;
|
|
ang = FRandom[ExploS](0,360);
|
|
pt = FRandom[ExploS](-90,90);
|
|
origin = pos;
|
|
while ( totaldist > 0 )
|
|
{
|
|
LineTrace(ang,totaldist,pt,TRF_THRUACTORS|TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
|
|
HitNormal = SWWMUtility.GetLineTraceHitNormal(d);
|
|
totaldist -= d.Distance;
|
|
if ( totaldist > 0 )
|
|
{
|
|
Vector3 bounced = d.HitDir-(1.2*hitnormal*(d.HitDir dot HitNormal));
|
|
ang = atan2(bounced.y,bounced.x);
|
|
pt = asin(-bounced.z);
|
|
origin = d.HitLocation+hitnormal;
|
|
}
|
|
}
|
|
let p = Spawn("GoldenSubImpact",d.HitLocation+hitnormal*4);
|
|
p.angle = atan2(hitnormal.y,hitnormal.x);
|
|
p.pitch = asin(-hitnormal.z);
|
|
p.target = target;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XEX1 AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ[[\\]] 1 Bright A_GoldSpread();
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class GoldenSubImpact : SWWMNonInteractiveActor
|
|
{
|
|
Default
|
|
{
|
|
DamageType 'Explodium';
|
|
RenderStyle "Add";
|
|
Scale 6.;
|
|
Alpha .8;
|
|
+NODAMAGETHRUST;
|
|
+FORCERADIUSDMG;
|
|
+FORCEXYBILLBOARD;
|
|
+FOILINVUL;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
SWWMUtility.DoExplosion(self,777,80000,500,400,DE_EXTRAZTHRUST);
|
|
A_QuakeEx(7.,7.,7.,20,0,2000,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,falloff:200,rollintensity:.8);
|
|
A_SprayDecal("BigRocketBlast",-172);
|
|
Scale *= FRandom[ExploS](0.8,1.1);
|
|
Scale.x *= RandomPick[ExploS](-1,1);
|
|
Scale.y *= RandomPick[ExploS](-1,1);
|
|
int numpt = Random[ExploS](4,8);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](1,9);
|
|
let s = Spawn("SWWMSmoke",pos);
|
|
s.vel = pvel;
|
|
s.SetShade(Color(1,1,1)*Random[ExploS](64,224)+Color(30,25,0));
|
|
s.special1 = Random[ExploS](2,4);
|
|
s.scale *= 2.6;
|
|
s.alpha *= .5;
|
|
}
|
|
numpt = Random[ExploS](2,3);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](2,12);
|
|
let s = Spawn("SWWMSpark",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[ExploS](1,2);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](2,18);
|
|
let s = Spawn("SWWMChip",pos);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = Random[ExploS](2,3);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](8,24);
|
|
let s = Spawn("FancyConfetti",pos);
|
|
s.scale *= 2.;
|
|
s.bAMBUSH = true;
|
|
s.vel = pvel;
|
|
}
|
|
}
|
|
void A_GoldSubSpread()
|
|
{
|
|
special1++;
|
|
if ( (special1%2) || (special1 > 20) ) return;
|
|
FLineTraceData d;
|
|
Vector3 HitNormal;
|
|
Vector3 origin;
|
|
double ang, pt;
|
|
for ( int i=0; i<2; i++ )
|
|
{
|
|
double totaldist = 20+(special1**2.)*.2;
|
|
ang = FRandom[ExploS](0,360);
|
|
pt = FRandom[ExploS](-90,90);
|
|
origin = pos;
|
|
while ( totaldist > 0 )
|
|
{
|
|
LineTrace(ang,totaldist,pt,TRF_THRUACTORS|TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
|
|
HitNormal = SWWMUtility.GetLineTraceHitNormal(d);
|
|
totaldist -= d.Distance;
|
|
if ( totaldist > 0 )
|
|
{
|
|
Vector3 bounced = d.HitDir-(1.2*hitnormal*(d.HitDir dot HitNormal));
|
|
ang = atan2(bounced.y,bounced.x);
|
|
pt = asin(-bounced.z);
|
|
origin = d.HitLocation+hitnormal;
|
|
}
|
|
}
|
|
let p = Spawn("GoldenSubSubImpact",d.HitLocation+hitnormal*4);
|
|
p.angle = atan2(hitnormal.y,hitnormal.x);
|
|
p.pitch = asin(-hitnormal.z);
|
|
p.target = target;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XEX1 ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] 1 Bright A_GoldSubSpread();
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class GoldenSubSubImpact : SWWMNonInteractiveActor
|
|
{
|
|
Default
|
|
{
|
|
DamageType 'Explodium';
|
|
RenderStyle "Add";
|
|
Scale 3.;
|
|
Alpha .6;
|
|
+NODAMAGETHRUST;
|
|
+FORCERADIUSDMG;
|
|
+FORCEXYBILLBOARD;
|
|
+FOILINVUL;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
SWWMUtility.DoExplosion(self,77,70000,400,300,DE_EXTRAZTHRUST);
|
|
A_QuakeEx(4.,4.,4.,15,0,1000,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,falloff:100,rollintensity:.4);
|
|
A_SprayDecal("RocketBlast",-172);
|
|
Scale *= FRandom[ExploS](0.8,1.1);
|
|
Scale.x *= RandomPick[ExploS](-1,1);
|
|
Scale.y *= RandomPick[ExploS](-1,1);
|
|
int numpt = Random[ExploS](1,2);
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
Vector3 pvel = SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](1,3);
|
|
let s = Spawn("SWWMSmoke",pos);
|
|
s.vel = pvel;
|
|
s.SetShade(Color(1,1,1)*Random[ExploS](64,224)+Color(30,25,0));
|
|
s.special1 = Random[ExploS](0,3);
|
|
s.scale *= 1.6;
|
|
s.alpha *= .2;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XEX1 ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] 1 Bright;
|
|
Stop;
|
|
}
|
|
}
|