More polished MR Precision Shot.
This commit is contained in:
parent
639999de8b
commit
f709bd9372
3 changed files with 217 additions and 6 deletions
|
|
@ -463,9 +463,9 @@ Class MisterRifle : SWWMWeapon
|
|||
SWWMBulletTrail.DoTrail(self,origin,dir,10000,2);
|
||||
if ( d.HitType == TRACE_HitActor )
|
||||
{
|
||||
int dmg = 48;
|
||||
int dmg = 44;
|
||||
// might as well apply explosion on top
|
||||
if ( dmg >= d.HitActor.Health ) dmg += 200;
|
||||
if ( dmg >= d.HitActor.Health ) dmg += 400;
|
||||
SWWMUtility.DoKnockback(d.HitActor,d.HitDir,20000);
|
||||
let p = SWWMPuff.Setup(d.HitLocation,d.HitDir,invoker,self,d.HitActor);
|
||||
dmg = d.HitActor.DamageMobj(p,self,dmg,'Mortal',DMG_THRUSTLESS|DMG_FOILINVUL|DMG_INFLICTOR_IS_PUFF);
|
||||
|
|
|
|||
|
|
@ -132,6 +132,201 @@ Class MisterBulletImpactPop : Actor
|
|||
}
|
||||
}
|
||||
|
||||
Class MisterFuzzy : Actor
|
||||
{
|
||||
Default
|
||||
{
|
||||
Obituary "$O_MORTALRIFLE";
|
||||
DamageType "Mortal";
|
||||
RenderStyle "Add";
|
||||
Radius .1;
|
||||
Height 0;
|
||||
+NODAMAGETHRUST;
|
||||
+FORCERADIUSDMG;
|
||||
+FOILINVUL;
|
||||
+NOGRAVITY;
|
||||
+NOBLOCKMAP;
|
||||
+DONTSPLASH;
|
||||
+NOINTERACTION;
|
||||
}
|
||||
override void PostBeginPlay()
|
||||
{
|
||||
special1 = Random[ExploS](4,8);
|
||||
vel = SWWMUtility.Vec3FromAngles(angle,pitch)*FRandom[ExploS](8,24);
|
||||
}
|
||||
override void Tick()
|
||||
{
|
||||
if ( isFrozen() ) return;
|
||||
SWWMUtility.DoExplosion(self,4,8000,40,20,DE_EXTRAZTHRUST);
|
||||
special1--;
|
||||
if ( special1 <= 0 )
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
Vector3 dir = vel;
|
||||
double magvel = dir.length();
|
||||
magvel *= 1.2;
|
||||
if ( magvel > 0. )
|
||||
{
|
||||
dir /= magvel;
|
||||
dir += .5*SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90));
|
||||
dir = dir.unit();
|
||||
vel = dir*magvel;
|
||||
}
|
||||
FLineTraceData d;
|
||||
Vector3 newpos = pos;
|
||||
newpos.z = clamp(newpos.z,floorz,ceilingz);
|
||||
int nstep = 0;
|
||||
double dist = magvel;
|
||||
while ( dist > 0 )
|
||||
{
|
||||
// safeguard, too many bounces
|
||||
if ( nstep > MAXBOUNCEPERTIC )
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
Vector3 oldpos = newpos;
|
||||
double ang = atan2(dir.y,dir.x);
|
||||
double pt = asin(-dir.z);
|
||||
LineTrace(ang,dist,pt,TRF_THRUACTORS|TRF_THRUHITSCAN|TRF_ABSPOSITION,newpos.z,newpos.x,newpos.y,d);
|
||||
Vector3 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;
|
||||
}
|
||||
if ( d.HitType != TRACE_HitNone )
|
||||
{
|
||||
dist -= d.Distance;
|
||||
// should only happen if we bounced
|
||||
dir = d.HitDir-(FRandom[Puff](1.5,2.)*hitnormal*(d.HitDir dot hitnormal));
|
||||
vel = dir*magvel;
|
||||
newpos = d.HitLocation+dir;
|
||||
}
|
||||
else
|
||||
{
|
||||
dist = 0.;
|
||||
newpos = level.Vec3Offset(newpos,dir*magvel);
|
||||
}
|
||||
Vector3 traildir = level.Vec3Diff(oldpos,newpos);
|
||||
double len = traildir.length();
|
||||
if ( len > 0. )
|
||||
{
|
||||
traildir /= len;
|
||||
for ( double i=0.; i<len; i+=4. )
|
||||
{
|
||||
let p = Spawn("MisterFuzzyTrail",level.Vec3Offset(oldpos,traildir*i));
|
||||
p.vel = dir*FRandom[ExploS](1.,4.);
|
||||
p.scale *= special1/6.;
|
||||
}
|
||||
}
|
||||
nstep++;
|
||||
}
|
||||
newpos.z = clamp(newpos.z,floorz,ceilingz);
|
||||
SetOrigin(newpos,true);
|
||||
}
|
||||
}
|
||||
|
||||
Class MisterFuzzyTrail : Actor
|
||||
{
|
||||
Default
|
||||
{
|
||||
RenderStyle "Add";
|
||||
Radius .1;
|
||||
Height 0.;
|
||||
Scale 1.5;
|
||||
Alpha .25;
|
||||
+FORCEXYBILLBOARD;
|
||||
+NOGRAVITY;
|
||||
+NOBLOCKMAP;
|
||||
+NOINTERACTION;
|
||||
+DONTSPLASH;
|
||||
+NOTELEPORT;
|
||||
}
|
||||
override void Tick()
|
||||
{
|
||||
prev = pos;
|
||||
if ( isFrozen() ) return;
|
||||
if ( vel != (0,0,0) )
|
||||
SetOrigin(level.Vec3Offset(pos,vel),true);
|
||||
A_SetScale(scale.x*1.05);
|
||||
A_FadeOut(FRandom[ExploS](.01,.03));
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
BLPS C -1 Bright;
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
|
||||
Class MisterPop : Actor
|
||||
{
|
||||
Default
|
||||
{
|
||||
Obituary "$O_MORTALRIFLE";
|
||||
DamageType "Mortal";
|
||||
RenderStyle "Add";
|
||||
Radius .1;
|
||||
Height 0.;
|
||||
Scale .2;
|
||||
+FORCEXYBILLBOARD;
|
||||
+NOGRAVITY;
|
||||
+NOBLOCKMAP;
|
||||
+NODAMAGETHRUST;
|
||||
+FORCERADIUSDMG;
|
||||
+NOINTERACTION;
|
||||
+DONTSPLASH;
|
||||
+NOTELEPORT;
|
||||
+FOILINVUL;
|
||||
+ROLLSPRITE;
|
||||
+ROLLCENTER;
|
||||
}
|
||||
override void Tick()
|
||||
{
|
||||
if ( isFrozen() ) return;
|
||||
if ( !CheckNoDelay() || (tics == -1) ) return;
|
||||
if ( tics > 0 ) tics--;
|
||||
while ( !tics )
|
||||
{
|
||||
if ( !SetState(CurState.NextState) )
|
||||
return;
|
||||
}
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
TNT1 A 1 NoDelay
|
||||
{
|
||||
A_SetTics(Random[ExploS](1,5));
|
||||
Scale *= FRandom[ExploS](.5,1.5);
|
||||
Scale.x *= RandomPick[ExploS](-1,1);
|
||||
Scale.y *= RandomPick[ExploS](-1,1);
|
||||
roll = FRandom[ExploS](0,360);
|
||||
}
|
||||
BLPF C 2 Bright { SWWMUtility.DoExplosion(self,44,5000,20,10,DE_EXTRAZTHRUST); }
|
||||
TNT1 A 1
|
||||
{
|
||||
let p = Spawn("MisterFuzzyTrail",pos);
|
||||
p.alpha *= 1.5;
|
||||
p.scale *= .5;
|
||||
}
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
|
||||
Class MisterBulletImpact : Actor
|
||||
{
|
||||
Default
|
||||
|
|
@ -155,7 +350,7 @@ Class MisterBulletImpact : Actor
|
|||
{
|
||||
Super.PostBeginPlay();
|
||||
A_AlertMonsters(swwm_uncapalert?0:4000);
|
||||
SWWMUtility.DoExplosion(self,200,20000,100,40,DE_EXTRAZTHRUST);
|
||||
SWWMUtility.DoExplosion(self,400,40000,140,40,DE_EXTRAZTHRUST);
|
||||
A_QuakeEx(6,6,6,10,0,400,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,falloff:150,rollintensity:.6);
|
||||
A_StartSound("mister/hitsemi",CHAN_VOICE,attenuation:.3);
|
||||
A_StartSound("mister/hitsemi",CHAN_WEAPON,attenuation:.2);
|
||||
|
|
@ -188,6 +383,13 @@ Class MisterBulletImpact : Actor
|
|||
let s = Spawn("SWWMChip",pos);
|
||||
s.vel = pvel;
|
||||
}
|
||||
numpt = Random[ExploS](10,12);
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
let s = Spawn("MisterFuzzy",pos);
|
||||
s.angle = FRandom[ExploS](0,360);
|
||||
s.pitch = FRandom[ExploS](-90,90);
|
||||
}
|
||||
Spawn("MisterExLight",pos);
|
||||
Spawn("MisterBulletImpactPop",pos);
|
||||
}
|
||||
|
|
@ -208,7 +410,16 @@ Class MisterBulletImpact : Actor
|
|||
Spawn:
|
||||
XEX7 ACEGIKMOQSUWY[] 1 Bright
|
||||
{
|
||||
if ( special1 && (special1 < 10) ) SWWMUtility.DoExplosion(self,200-special1*20,20000+special1*1000,100+special1*5,40+special1*2,DE_EXTRAZTHRUST);
|
||||
if ( special1 && (special1 < 10) )
|
||||
{
|
||||
SWWMUtility.DoExplosion(self,200-special1*20,20000+special1*1000,200+special1*4,100+special1*2,DE_EXTRAZTHRUST);
|
||||
int numpt = Random[ExploS](special1/2,special1+2)/2;
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
Vector3 np = level.Vec3Offset(pos,SWWMUtility.Vec3FromAngles(FRandom[ExploS](0,360),FRandom[ExploS](-90,90))*FRandom[ExploS](2,16)*special1);
|
||||
if ( level.IsPointInLevel(np) ) Spawn("MisterPop",np);
|
||||
}
|
||||
}
|
||||
special1++;
|
||||
}
|
||||
Stop;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue