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
|
|
@ -22,6 +22,31 @@ Model "UTRocketAmmo2"
|
||||||
FrameIndex RCKT A 0 0
|
FrameIndex RCKT A 0 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Model "UTGrenade"
|
||||||
|
{
|
||||||
|
Path "models"
|
||||||
|
Model 0 "UTRocket_d.3d"
|
||||||
|
Skin 0 "JuRocket1.png"
|
||||||
|
Scale 0.07 0.0822 0.09864
|
||||||
|
USEACTORPITCH
|
||||||
|
USEACTORROLL
|
||||||
|
AngleOffset -90
|
||||||
|
|
||||||
|
FrameIndex RCKT A 0 0
|
||||||
|
}
|
||||||
|
Model "UTRocket"
|
||||||
|
{
|
||||||
|
Path "models"
|
||||||
|
Model 0 "UTRocket_d.3d"
|
||||||
|
Skin 0 "JuRocket1.png"
|
||||||
|
Scale 0.07 0.0822 0.09864
|
||||||
|
USEACTORPITCH
|
||||||
|
USEACTORROLL
|
||||||
|
AngleOffset -90
|
||||||
|
|
||||||
|
FrameIndex RCKT B 0 1
|
||||||
|
}
|
||||||
|
|
||||||
Model "UTRocketLauncher"
|
Model "UTRocketLauncher"
|
||||||
{
|
{
|
||||||
Path "models"
|
Path "models"
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,67 @@ Model "UTCasing"
|
||||||
FrameIndex PCAS A 0 0
|
FrameIndex PCAS A 0 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Model "BulletImpact"
|
||||||
|
{
|
||||||
|
Path "models"
|
||||||
|
Model 0 "BulletImpact_d.3d"
|
||||||
|
Skin 0 "Impact_a00.png"
|
||||||
|
Scale 0.32 0.268 0.24
|
||||||
|
PitchOffset -90
|
||||||
|
USEACTORPITCH
|
||||||
|
USEACTORROLL
|
||||||
|
DONTCULLBACKFACES
|
||||||
|
FrameIndex BIMP A 0 0
|
||||||
|
}
|
||||||
|
Model "BulletImpact"
|
||||||
|
{
|
||||||
|
Path "models"
|
||||||
|
Model 0 "BulletImpact_d.3d"
|
||||||
|
Skin 0 "Impact_a01.png"
|
||||||
|
Scale 0.32 0.268 0.24
|
||||||
|
PitchOffset -90
|
||||||
|
USEACTORPITCH
|
||||||
|
USEACTORROLL
|
||||||
|
DONTCULLBACKFACES
|
||||||
|
FrameIndex BIMP B 0 0
|
||||||
|
}
|
||||||
|
Model "BulletImpact"
|
||||||
|
{
|
||||||
|
Path "models"
|
||||||
|
Model 0 "BulletImpact_d.3d"
|
||||||
|
Skin 0 "Impact_a02.png"
|
||||||
|
Scale 0.32 0.268 0.24
|
||||||
|
PitchOffset -90
|
||||||
|
USEACTORPITCH
|
||||||
|
USEACTORROLL
|
||||||
|
DONTCULLBACKFACES
|
||||||
|
FrameIndex BIMP C 0 0
|
||||||
|
}
|
||||||
|
Model "BulletImpact"
|
||||||
|
{
|
||||||
|
Path "models"
|
||||||
|
Model 0 "BulletImpact_d.3d"
|
||||||
|
Skin 0 "Impact_a03.png"
|
||||||
|
Scale 0.32 0.268 0.24
|
||||||
|
PitchOffset -90
|
||||||
|
USEACTORPITCH
|
||||||
|
USEACTORROLL
|
||||||
|
DONTCULLBACKFACES
|
||||||
|
FrameIndex BIMP D 0 0
|
||||||
|
}
|
||||||
|
Model "BulletImpact"
|
||||||
|
{
|
||||||
|
Path "models"
|
||||||
|
Model 0 "BulletImpact_d.3d"
|
||||||
|
Skin 0 "Impact_a04.png"
|
||||||
|
Scale 0.32 0.268 0.24
|
||||||
|
PitchOffset -90
|
||||||
|
USEACTORPITCH
|
||||||
|
USEACTORROLL
|
||||||
|
DONTCULLBACKFACES
|
||||||
|
FrameIndex BIMP E 0 0
|
||||||
|
}
|
||||||
|
|
||||||
Model "Enforcer"
|
Model "Enforcer"
|
||||||
{
|
{
|
||||||
Path "models"
|
Path "models"
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,18 @@ Model "SniperRifle"
|
||||||
|
|
||||||
FrameIndex SRFP B 1 0
|
FrameIndex SRFP B 1 0
|
||||||
}
|
}
|
||||||
|
Model "SniperRifle"
|
||||||
|
{
|
||||||
|
Path "models"
|
||||||
|
Model 2 "Flat_d.3d"
|
||||||
|
Skin 2 "MuzzleFlash2.png"
|
||||||
|
AngleOffset 90
|
||||||
|
PitchOffset 90
|
||||||
|
Scale 0.12 0.12 0.12
|
||||||
|
Offset 6.0 -40.0 -6.0
|
||||||
|
|
||||||
|
FrameIndex SMUZ A 2 0
|
||||||
|
}
|
||||||
|
|
||||||
Model "SniperRifle"
|
Model "SniperRifle"
|
||||||
{
|
{
|
||||||
|
|
|
||||||
BIN
models/BulletImpact_a.3d
Normal file
BIN
models/BulletImpact_a.3d
Normal file
Binary file not shown.
BIN
models/BulletImpact_d.3d
Normal file
BIN
models/BulletImpact_d.3d
Normal file
Binary file not shown.
BIN
models/Impact_a00.png
Normal file
BIN
models/Impact_a00.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
models/Impact_a01.png
Normal file
BIN
models/Impact_a01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3 KiB |
BIN
models/Impact_a02.png
Normal file
BIN
models/Impact_a02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3 KiB |
BIN
models/Impact_a03.png
Normal file
BIN
models/Impact_a03.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
models/Impact_a04.png
Normal file
BIN
models/Impact_a04.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
|
|
@ -37,11 +37,11 @@ Currently implemented:
|
||||||
- Ripper (slot 6)
|
- Ripper (slot 6)
|
||||||
- Jump Boots (radsuit, has "iron boots" powerup effect to compensate)
|
- Jump Boots (radsuit, has "iron boots" powerup effect to compensate)
|
||||||
- Minigun (slot 7)
|
- Minigun (slot 7)
|
||||||
|
- Sniper Rifle (slot 0)
|
||||||
|
|
||||||
In progress:
|
In progress:
|
||||||
|
|
||||||
- Rocket Launcher (slot 9)
|
- Rocket Launcher (slot 9)
|
||||||
- Sniper Rifle (slot 0)
|
|
||||||
|
|
||||||
Things to do eventually:
|
Things to do eventually:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
Sprite "RPAKA0",1,1{}
|
Sprite "RPAKA0",1,1{}
|
||||||
Sprite "RCKTA0",1,1{}
|
Sprite "RCKTA0",1,1{}
|
||||||
|
Sprite "RCKTB0",1,1{}
|
||||||
Sprite "EBLPA0",1,1{}
|
Sprite "EBLPA0",1,1{}
|
||||||
Sprite "EBLPB0",1,1{}
|
Sprite "EBLPB0",1,1{}
|
||||||
Sprite "EBLSA0",1,1{}
|
Sprite "EBLSA0",1,1{}
|
||||||
|
|
@ -178,4 +179,4 @@ Sprite "EBLDG0",1,1{}
|
||||||
Sprite "EBLDH0",1,1{}
|
Sprite "EBLDH0",1,1{}
|
||||||
Sprite "EBLDI0",1,1{}
|
Sprite "EBLDI0",1,1{}
|
||||||
Sprite "EBLDJ0",1,1{}
|
Sprite "EBLDJ0",1,1{}
|
||||||
Sprite "EBLDK0",1,1{}
|
Sprite "EBLDK0",1,1{}
|
||||||
|
|
@ -253,3 +253,8 @@ Sprite "EMUZA0",1,1{}
|
||||||
Sprite "EMUZB0",1,1{}
|
Sprite "EMUZB0",1,1{}
|
||||||
Sprite "EMUZC0",1,1{}
|
Sprite "EMUZC0",1,1{}
|
||||||
Sprite "EMUZD0",1,1{}
|
Sprite "EMUZD0",1,1{}
|
||||||
|
Sprite "BIMPA0",1,1{}
|
||||||
|
Sprite "BIMPB0",1,1{}
|
||||||
|
Sprite "BIMPC0",1,1{}
|
||||||
|
Sprite "BIMPD0",1,1{}
|
||||||
|
Sprite "BIMPE0",1,1{}
|
||||||
|
|
|
||||||
|
|
@ -77,3 +77,4 @@ Sprite "SRFDD0",1,1{}
|
||||||
Sprite "SRFDE0",1,1{}
|
Sprite "SRFDE0",1,1{}
|
||||||
Sprite "SRFDF0",1,1{}
|
Sprite "SRFDF0",1,1{}
|
||||||
Sprite "SRFDG0",1,1{}
|
Sprite "SRFDG0",1,1{}
|
||||||
|
Sprite "SMUZA0",1,1{}
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,10 @@ Class UTChainsaw : UTWeapon
|
||||||
LineTrace(angle,90,BulletSlope(),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
|
LineTrace(angle,90,BulletSlope(),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
|
||||||
if ( d.HitType == TRACE_HitActor )
|
if ( d.HitType == TRACE_HitActor )
|
||||||
{
|
{
|
||||||
int dmg = Random[Chainsaw](100,110);
|
int dmg = Random[Chainsaw](50,55);
|
||||||
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'Decapitated');
|
if ( d.HitLocation.z >= (d.HitActor.pos.z+d.HitActor.height*0.8) )
|
||||||
|
dmg = d.HitActor.DamageMobj(invoker,self,dmg*2,'Decapitated');
|
||||||
|
else dmg = d.HitActor.DamageMobj(invoker,self,dmg,'slashed');
|
||||||
d.HitActor.vel = -y*(1200/d.HitActor.mass);
|
d.HitActor.vel = -y*(1200/d.HitActor.mass);
|
||||||
vel += x*(100/mass);
|
vel += x*(100/mass);
|
||||||
if ( d.HitActor.player ) d.HitActor.A_QuakeEx(5,5,5,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.25);
|
if ( d.HitActor.player ) d.HitActor.A_QuakeEx(5,5,5,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.25);
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,26 @@ Class UTRocketAmmo2 : UTRocketAmmo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Class UTRocket : Actor
|
||||||
|
{
|
||||||
|
States
|
||||||
|
{
|
||||||
|
Spawn:
|
||||||
|
RCKT B 1;
|
||||||
|
Wait;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Class UTGrenade : Actor
|
||||||
|
{
|
||||||
|
States
|
||||||
|
{
|
||||||
|
Spawn:
|
||||||
|
RCKT A 1;
|
||||||
|
Wait;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Class UTRocketLauncher : UTWeapon
|
Class UTRocketLauncher : UTWeapon
|
||||||
{
|
{
|
||||||
int loaded;
|
int loaded;
|
||||||
|
|
@ -43,6 +63,7 @@ Class UTRocketLauncher : UTWeapon
|
||||||
Default
|
Default
|
||||||
{
|
{
|
||||||
Tag "Rocket Launcher";
|
Tag "Rocket Launcher";
|
||||||
|
//Obituary "%o was smacked down by %k's Rocket Launcher.";
|
||||||
Inventory.PickupMessage "You got the Rocket Launcher.";
|
Inventory.PickupMessage "You got the Rocket Launcher.";
|
||||||
Weapon.UpSound "utrl/select";
|
Weapon.UpSound "utrl/select";
|
||||||
Weapon.SlotNumber 9;
|
Weapon.SlotNumber 9;
|
||||||
|
|
|
||||||
|
|
@ -41,41 +41,48 @@ Class BulletImpact : Actor
|
||||||
{
|
{
|
||||||
Default
|
Default
|
||||||
{
|
{
|
||||||
|
RenderStyle "Add";
|
||||||
Radius 0.1;
|
Radius 0.1;
|
||||||
Height 0;
|
Height 0;
|
||||||
+NOGRAVITY;
|
+NOGRAVITY;
|
||||||
+NOCLIP;
|
+NOCLIP;
|
||||||
+DONTSPLASH;
|
+DONTSPLASH;
|
||||||
|
Scale 0.25;
|
||||||
}
|
}
|
||||||
override void PostBeginPlay()
|
override void PostBeginPlay()
|
||||||
{
|
{
|
||||||
Super.PostBeginPlay();
|
Super.PostBeginPlay();
|
||||||
A_SprayDecal("Pock",20);
|
A_SprayDecal("Pock",-20);
|
||||||
int numpt = Random[Enforcer](5,10);
|
int numpt = Random[Enforcer](5,10)*scale.x*4;
|
||||||
Vector3 x = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
Vector3 x = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
||||||
for ( int i=0; i<numpt; i++ )
|
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);
|
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);
|
let s = Spawn("UTSmoke",pos+x*2);
|
||||||
s.vel = pvel;
|
s.vel = pvel;
|
||||||
s.SetShade(Color(1,1,1)*Random[Enforcer](128,192));
|
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++ )
|
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);
|
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;
|
s.vel = pvel;
|
||||||
}
|
}
|
||||||
numpt = Random[Enforcer](2,5);
|
numpt = Random[Enforcer](2,5)*scale.x*4;
|
||||||
for ( int i=0; i<numpt; i++ )
|
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);
|
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;
|
s.vel = pvel;
|
||||||
}
|
}
|
||||||
A_PlaySound("bullet/hit",CHAN_VOICE,attenuation:4.0);
|
A_PlaySound("bullet/hit",CHAN_VOICE,attenuation:3.0);
|
||||||
Destroy();
|
}
|
||||||
|
States
|
||||||
|
{
|
||||||
|
Spawn:
|
||||||
|
BIMP ABCDE 1 Bright;
|
||||||
|
Stop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -302,9 +309,9 @@ Class Enforcer : UTWeapon replaces Pistol
|
||||||
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'shot');
|
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'shot');
|
||||||
if ( d.HitActor.bNOBLOOD )
|
if ( d.HitActor.bNOBLOOD )
|
||||||
{
|
{
|
||||||
let p = Spawn("BulletImpact",d.HitLocation-d.HitDir*4);
|
let p = Spawn("BulletImpact",d.HitLocation);
|
||||||
p.angle = atan2(d.HitDir.y,d.HitDir.x);
|
p.angle = atan2(d.HitDir.y,d.HitDir.x)+180;
|
||||||
p.pitch = asin(-d.HitDir.z);
|
p.pitch = asin(d.HitDir.z);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -314,9 +321,17 @@ Class Enforcer : UTWeapon replaces Pistol
|
||||||
}
|
}
|
||||||
else if ( d.HitType != TRACE_HitNone )
|
else if ( d.HitType != TRACE_HitNone )
|
||||||
{
|
{
|
||||||
let p = Spawn("BulletImpact",d.HitLocation-d.HitDir*4);
|
Vector3 hitnormal = -d.HitDir;
|
||||||
p.angle = atan2(d.HitDir.y,d.HitDir.x);
|
if ( d.HitType == TRACE_HitFloor ) hitnormal = d.HitSector.floorplane.Normal;
|
||||||
p.pitch = asin(-d.HitDir.z);
|
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);
|
if ( d.HitLine ) d.HitLine.RemoteActivate(self,d.LineSide,SPAC_Impact,d.HitLocation);
|
||||||
}
|
}
|
||||||
origin += x*8.0+ydir*y*6.0-z*2.0;
|
origin += x*8.0+ydir*y*6.0-z*2.0;
|
||||||
|
|
|
||||||
|
|
@ -126,9 +126,10 @@ Class Minigun : UTWeapon
|
||||||
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'shot');
|
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'shot');
|
||||||
if ( d.HitActor.bNOBLOOD )
|
if ( d.HitActor.bNOBLOOD )
|
||||||
{
|
{
|
||||||
let p = Spawn("BulletImpact",d.HitLocation-d.HitDir*4);
|
let p = Spawn("BulletImpact",d.HitLocation);
|
||||||
p.angle = atan2(d.HitDir.y,d.HitDir.x);
|
p.scale *= 0.75;
|
||||||
p.pitch = asin(-d.HitDir.z);
|
p.angle = atan2(d.HitDir.y,d.HitDir.x)+180;
|
||||||
|
p.pitch = asin(d.HitDir.z);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -138,9 +139,18 @@ Class Minigun : UTWeapon
|
||||||
}
|
}
|
||||||
else if ( d.HitType != TRACE_HitNone )
|
else if ( d.HitType != TRACE_HitNone )
|
||||||
{
|
{
|
||||||
let p = Spawn("BulletImpact",d.HitLocation-d.HitDir*4);
|
Vector3 hitnormal = -d.HitDir;
|
||||||
p.angle = atan2(d.HitDir.y,d.HitDir.x);
|
if ( d.HitType == TRACE_HitFloor ) hitnormal = d.HitSector.floorplane.Normal;
|
||||||
p.pitch = asin(-d.HitDir.z);
|
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.scale *= 0.75;
|
||||||
|
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);
|
if ( d.HitLine ) d.HitLine.RemoteActivate(self,d.LineSide,SPAC_Impact,d.HitLocation);
|
||||||
}
|
}
|
||||||
if ( !Random[Minigun](0,1) )
|
if ( !Random[Minigun](0,1) )
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@ Class UDamage : PowerupGiver replaces Berserk
|
||||||
Inventory.PickupSound "udamage/pickup";
|
Inventory.PickupSound "udamage/pickup";
|
||||||
Inventory.RespawnTics 4200;
|
Inventory.RespawnTics 4200;
|
||||||
}
|
}
|
||||||
|
override void PostBeginPlay()
|
||||||
|
{
|
||||||
|
Super.PostBeginPlay();
|
||||||
|
A_CheckSkin();
|
||||||
|
}
|
||||||
action void A_CheckSkin()
|
action void A_CheckSkin()
|
||||||
{
|
{
|
||||||
bool isbeta = CVar.GetCVar('flak_betaudamage').GetBool();
|
bool isbeta = CVar.GetCVar('flak_betaudamage').GetBool();
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,14 @@ Class Razor2 : Actor
|
||||||
A_SetAngle(atan2(dir.y,dir.x));
|
A_SetAngle(atan2(dir.y,dir.x));
|
||||||
A_SetPitch(asin(-dir.z));
|
A_SetPitch(asin(-dir.z));
|
||||||
}
|
}
|
||||||
|
override int SpecialMissileHit( Actor victim )
|
||||||
|
{
|
||||||
|
if ( pos.z > victim.pos.z+victim.height*0.8 ) DamageType = 'Decapitated';
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
override int DoSpecialDamage( Actor target, int damage, Name damagetype )
|
override int DoSpecialDamage( Actor target, int damage, Name damagetype )
|
||||||
{
|
{
|
||||||
if ( pos.z > target.pos.z+target.height*0.8 ) damage *= 3;
|
if ( pos.z > target.pos.z+target.height*0.8 ) damage *= 2;
|
||||||
if ( !target.bNOBLOOD )
|
if ( !target.bNOBLOOD )
|
||||||
{
|
{
|
||||||
target.SpawnBlood(pos,AngleTo(target),damage);
|
target.SpawnBlood(pos,AngleTo(target),damage);
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,100 @@ Class RifleAmmo2 : RifleAmmo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Class SniperRifle : UTWeapon
|
Class SniperLight : EnforcerLight
|
||||||
{
|
{
|
||||||
|
Default
|
||||||
|
{
|
||||||
|
args 255,224,64,120;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Class SniperRifle : UTWeapon
|
||||||
|
{
|
||||||
|
double sniperzoom;
|
||||||
|
TextureID reticle;
|
||||||
|
|
||||||
|
override void PostBeginPlay()
|
||||||
|
{
|
||||||
|
Super.PostBeginPlay();
|
||||||
|
reticle = TexMan.CheckForTexture("RReticle",Texman.Type_Any);
|
||||||
|
}
|
||||||
|
override void PreRender()
|
||||||
|
{
|
||||||
|
if ( sniperzoom <= 1.0 ) return;
|
||||||
|
Screen.DrawTexture(reticle,false,320,240,DTA_VirtualWidth,640,DTA_VirtualHeight,480);
|
||||||
|
Screen.DrawText(confont,Font.CR_DARKGREEN,192,160,String.Format("X%.1f",sniperzoom),DTA_Clean,true);
|
||||||
|
}
|
||||||
|
action void A_SniperFire( bool zoomed = false )
|
||||||
|
{
|
||||||
|
Weapon weap = Weapon(invoker);
|
||||||
|
if ( !weap ) return;
|
||||||
|
if ( weap.Ammo1.Amount <= 0 ) return;
|
||||||
|
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
|
||||||
|
invoker.FireEffect();
|
||||||
|
UTMainHandler.DoFlash(self,Color(32,0,0,255),1);
|
||||||
|
A_PlaySound("sniper/fire",CHAN_WEAPON);
|
||||||
|
A_AlertMonsters();
|
||||||
|
if ( zoomed ) A_QuakeEx(2,2,2,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.09);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
A_QuakeEx(3,3,3,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.12);
|
||||||
|
A_Overlay(-2,"MuzzleFlash");
|
||||||
|
A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true);
|
||||||
|
A_OverlayRenderstyle(-2,STYLE_Add);
|
||||||
|
}
|
||||||
|
let l = Spawn("SniperLight",pos);
|
||||||
|
l.target = self;
|
||||||
|
Vector3 x, y, z;
|
||||||
|
[x, y, z] = Matrix4.GetAxes(pitch,angle,roll);
|
||||||
|
Vector3 origin = Vec2OffsetZ(0,0,player.viewz)+10.0*x;
|
||||||
|
if ( !zoomed ) origin = origin+y*4.0-z*2.0;
|
||||||
|
FLineTraceData d;
|
||||||
|
LineTrace(angle,10000,BulletSlope(),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
|
||||||
|
if ( d.HitType == TRACE_HitActor )
|
||||||
|
{
|
||||||
|
int dmg = Random[Sniper](40,50);
|
||||||
|
if ( d.HitLocation.z >= (d.HitActor.pos.z+d.HitActor.height*0.8) )
|
||||||
|
dmg = d.HitActor.DamageMobj(invoker,self,dmg+65,'Decapitated');
|
||||||
|
else dmg = d.HitActor.DamageMobj(invoker,self,dmg,'shot');
|
||||||
|
if ( d.HitActor.bNOBLOOD )
|
||||||
|
{
|
||||||
|
let p = Spawn("BulletImpact",d.HitLocation);
|
||||||
|
p.scale *= 1.5;
|
||||||
|
p.angle = atan2(d.HitDir.y,d.HitDir.x)+180;
|
||||||
|
p.pitch = asin(d.HitDir.z);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
d.HitActor.TraceBleed(dmg,self);
|
||||||
|
d.HitActor.SpawnBlood(d.HitLocation,atan2(d.HitDir.y,d.HitDir.x)+180,dmg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( d.HitType != TRACE_HitNone )
|
||||||
|
{
|
||||||
|
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.scale *= 1.5;
|
||||||
|
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+y*6.0-z*9.0;
|
||||||
|
let c = Spawn("UTCasing",origin);
|
||||||
|
c.scale *= 1.25;
|
||||||
|
c.vel = x*FRandom[Junk](-2,2)+y*FRandom[Junk](3,6)+z*FRandom[Junk](3,5);
|
||||||
|
}
|
||||||
Default
|
Default
|
||||||
{
|
{
|
||||||
Tag "Sniper Rifle";
|
Tag "Sniper Rifle";
|
||||||
|
Obituary "%k put a bullet through %o's head.";
|
||||||
Inventory.PickupMessage "You got the Sniper Rifle.";
|
Inventory.PickupMessage "You got the Sniper Rifle.";
|
||||||
Weapon.UpSound "sniper/select";
|
Weapon.UpSound "sniper/select";
|
||||||
Weapon.SlotNumber 0;
|
Weapon.SlotNumber 0;
|
||||||
|
|
@ -61,7 +150,7 @@ Class SniperRifle : UTWeapon
|
||||||
SRFS A 1 A_Raise(int.max);
|
SRFS A 1 A_Raise(int.max);
|
||||||
Wait;
|
Wait;
|
||||||
Ready:
|
Ready:
|
||||||
SRFS A 1;
|
SRFS A 1 A_ZoomFactor(invoker.sniperzoom=1.0,ZOOM_INSTANT);
|
||||||
SRFS B 2;
|
SRFS B 2;
|
||||||
SRFS C 1;
|
SRFS C 1;
|
||||||
SRFS D 2;
|
SRFS D 2;
|
||||||
|
|
@ -85,7 +174,21 @@ Class SniperRifle : UTWeapon
|
||||||
A_WeaponReady();
|
A_WeaponReady();
|
||||||
}
|
}
|
||||||
Wait;
|
Wait;
|
||||||
|
ZoomedIdle:
|
||||||
|
TNT1 A 1
|
||||||
|
{
|
||||||
|
A_CheckReload();
|
||||||
|
A_WeaponReady();
|
||||||
|
}
|
||||||
|
Wait;
|
||||||
Fire:
|
Fire:
|
||||||
|
SRFI A 0 A_JumpIf(invoker.sniperzoom>1.0,"ZoomedFire");
|
||||||
|
SRFI A 0
|
||||||
|
{
|
||||||
|
A_SniperFire();
|
||||||
|
return A_Jump(256,1,11,21,31,41);
|
||||||
|
}
|
||||||
|
Goto Idle;
|
||||||
SRF1 ABCDEFGHIJ 2;
|
SRF1 ABCDEFGHIJ 2;
|
||||||
Goto Idle;
|
Goto Idle;
|
||||||
SRF2 ABCDEFGHIJ 2;
|
SRF2 ABCDEFGHIJ 2;
|
||||||
|
|
@ -96,9 +199,31 @@ Class SniperRifle : UTWeapon
|
||||||
Goto Idle;
|
Goto Idle;
|
||||||
SRF5 ABCDEFGHIJ 2;
|
SRF5 ABCDEFGHIJ 2;
|
||||||
Goto Idle;
|
Goto Idle;
|
||||||
|
ZoomedFire:
|
||||||
|
TNT1 A 20 A_SniperFire(true);
|
||||||
|
Goto ZoomedIdle;
|
||||||
|
AltFire:
|
||||||
|
SRFI A 0 A_JumpIf(invoker.sniperzoom>1.0,"AltHold2");
|
||||||
|
AltHold:
|
||||||
|
TNT1 A 1
|
||||||
|
{
|
||||||
|
if ( invoker.sniperzoom <= 8.0 )
|
||||||
|
A_ZoomFactor(invoker.sniperzoom*=1.1);
|
||||||
|
invoker.sniperzoom = min(invoker.sniperzoom,8.1);
|
||||||
|
}
|
||||||
|
TNT1 A 0 A_Refire("AltHold");
|
||||||
|
Goto ZoomedIdle;
|
||||||
|
AltHold2:
|
||||||
|
SRFI A 1 A_ZoomFactor(invoker.sniperzoom=1.0,ZOOM_INSTANT);
|
||||||
|
SRFI A 0 A_Refire("AltHold2");
|
||||||
|
Goto Idle;
|
||||||
Deselect:
|
Deselect:
|
||||||
|
SRFD A 0 A_ZoomFactor(invoker.sniperzoom=1.0,ZOOM_INSTANT);
|
||||||
SRFD ABCDEFG 2;
|
SRFD ABCDEFG 2;
|
||||||
SRFD G 1 A_Lower(int.max);
|
SRFD G 1 A_Lower(int.max);
|
||||||
Wait;
|
Wait;
|
||||||
|
MuzzleFlash:
|
||||||
|
SMUZ A 3 Bright;
|
||||||
|
Stop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,9 @@ Class RandomSpawner2 : RandomSpawner
|
||||||
|
|
||||||
Class UTWeapon : Weapon
|
Class UTWeapon : Weapon
|
||||||
{
|
{
|
||||||
|
// Drawstuffs under HUD
|
||||||
virtual ui void PreRender() {}
|
virtual ui void PreRender() {}
|
||||||
|
// Drawstuffs over HUD
|
||||||
virtual ui void PostRender() {}
|
virtual ui void PostRender() {}
|
||||||
|
|
||||||
override Inventory CreateTossable( int amt )
|
override Inventory CreateTossable( int amt )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue