Sniper rifle added, bullet impact mesh added. Only the RL remains.
Headshots added/tweaked, and made compatible with the future announcer add-on.
This commit is contained in:
parent
1b95d4219b
commit
e6420e16be
22 changed files with 318 additions and 28 deletions
|
|
@ -41,41 +41,48 @@ Class BulletImpact : Actor
|
|||
{
|
||||
Default
|
||||
{
|
||||
RenderStyle "Add";
|
||||
Radius 0.1;
|
||||
Height 0;
|
||||
+NOGRAVITY;
|
||||
+NOCLIP;
|
||||
+DONTSPLASH;
|
||||
Scale 0.25;
|
||||
}
|
||||
override void PostBeginPlay()
|
||||
{
|
||||
Super.PostBeginPlay();
|
||||
A_SprayDecal("Pock",20);
|
||||
int numpt = Random[Enforcer](5,10);
|
||||
A_SprayDecal("Pock",-20);
|
||||
int numpt = Random[Enforcer](5,10)*scale.x*4;
|
||||
Vector3 x = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
Vector3 pvel = (-x+(FRandom[Enforcer](-.8,.8),FRandom[Enforcer](-.8,.8),FRandom[Enforcer](-.8,.8))).unit()*FRandom[Enforcer](0.1,1.2);
|
||||
let s = Spawn("UTSmoke",pos);
|
||||
Vector3 pvel = (x+(FRandom[Enforcer](-.8,.8),FRandom[Enforcer](-.8,.8),FRandom[Enforcer](-.8,.8))).unit()*FRandom[Enforcer](0.1,1.2);
|
||||
let s = Spawn("UTSmoke",pos+x*2);
|
||||
s.vel = pvel;
|
||||
s.SetShade(Color(1,1,1)*Random[Enforcer](128,192));
|
||||
}
|
||||
numpt = Random[Enforcer](3,8);
|
||||
numpt = Random[Enforcer](3,8)*scale.x*4;
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
Vector3 pvel = (FRandom[Enforcer](-1,1),FRandom[Enforcer](-1,1),FRandom[Enforcer](-1,1)).unit()*FRandom[Enforcer](2,8);
|
||||
let s = Spawn("UTSpark",pos);
|
||||
let s = Spawn("UTSpark",pos+x*2);
|
||||
s.vel = pvel;
|
||||
}
|
||||
numpt = Random[Enforcer](2,5);
|
||||
numpt = Random[Enforcer](2,5)*scale.x*4;
|
||||
for ( int i=0; i<numpt; i++ )
|
||||
{
|
||||
Vector3 pvel = (FRandom[Enforcer](-1,1),FRandom[Enforcer](-1,1),FRandom[Enforcer](-1,1)).unit()*FRandom[Enforcer](2,8);
|
||||
let s = Spawn("UTChip",pos);
|
||||
let s = Spawn("UTChip",pos+x*2);
|
||||
s.vel = pvel;
|
||||
}
|
||||
A_PlaySound("bullet/hit",CHAN_VOICE,attenuation:4.0);
|
||||
Destroy();
|
||||
A_PlaySound("bullet/hit",CHAN_VOICE,attenuation:3.0);
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
BIMP ABCDE 1 Bright;
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -302,9 +309,9 @@ Class Enforcer : UTWeapon replaces Pistol
|
|||
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'shot');
|
||||
if ( d.HitActor.bNOBLOOD )
|
||||
{
|
||||
let p = Spawn("BulletImpact",d.HitLocation-d.HitDir*4);
|
||||
p.angle = atan2(d.HitDir.y,d.HitDir.x);
|
||||
p.pitch = asin(-d.HitDir.z);
|
||||
let p = Spawn("BulletImpact",d.HitLocation);
|
||||
p.angle = atan2(d.HitDir.y,d.HitDir.x)+180;
|
||||
p.pitch = asin(d.HitDir.z);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -314,9 +321,17 @@ Class Enforcer : UTWeapon replaces Pistol
|
|||
}
|
||||
else if ( d.HitType != TRACE_HitNone )
|
||||
{
|
||||
let p = Spawn("BulletImpact",d.HitLocation-d.HitDir*4);
|
||||
p.angle = atan2(d.HitDir.y,d.HitDir.x);
|
||||
p.pitch = asin(-d.HitDir.z);
|
||||
Vector3 hitnormal = -d.HitDir;
|
||||
if ( d.HitType == TRACE_HitFloor ) hitnormal = d.HitSector.floorplane.Normal;
|
||||
else if ( d.HitType == TRACE_HitCeiling ) 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("BulletImpact",d.HitLocation+hitnormal*0.01);
|
||||
p.angle = atan2(hitnormal.y,hitnormal.x);
|
||||
p.pitch = asin(-hitnormal.z);
|
||||
if ( d.HitLine ) d.HitLine.RemoteActivate(self,d.LineSide,SPAC_Impact,d.HitLocation);
|
||||
}
|
||||
origin += x*8.0+ydir*y*6.0-z*2.0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue