Fixed the sizes and offsets of player models. Adjusted weapon offsets to be more in line with the originals. Implemented all armors and most of the usable items. Add lights to some item pickups. This might get done to DT too. Key display on both HUD types, along with some fixes. ASMD has complete animations. Other weapons will follow.
225 lines
5.2 KiB
Text
225 lines
5.2 KiB
Text
Class StingerAmmo : Ammo
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_STINGERAMMO";
|
|
Inventory.Icon "I_Stingr";
|
|
Inventory.PickupMessage "";
|
|
Inventory.Amount 5;
|
|
Inventory.MaxAmount 200;
|
|
Ammo.BackpackAmount 20;
|
|
Ammo.BackpackMaxAmount 400;
|
|
Ammo.DropAmount 2;
|
|
}
|
|
override String PickupMessage()
|
|
{
|
|
return String.Format("%s%d%s",StringTable.Localize("$I_STINGERAMMOL"),Amount,StringTable.Localize("$I_STINGERAMMOR"));
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
SAMO A -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class StingerAmmo2 : StingerAmmo
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_STINGERAMMO2";
|
|
Inventory.Amount 40;
|
|
Ammo.DropAmount 15;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
SAMO B -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class StingerProjectile : Actor
|
|
{
|
|
Default
|
|
{
|
|
Obituary "$O_STINGER";
|
|
DamageType 'shot';
|
|
DamageFunction Random[Stinger](15,25);
|
|
Speed 40;
|
|
Radius 2;
|
|
Height 2;
|
|
PROJECTILE;
|
|
+SKYEXPLODE;
|
|
}
|
|
override int DoSpecialDamage( Actor target, int damage, Name damagetype )
|
|
{
|
|
if ( !target.bNOBLOOD )
|
|
{
|
|
target.SpawnBlood(pos,AngleTo(target),damage);
|
|
A_PlaySound("stinger/flesh");
|
|
A_AlertMonsters();
|
|
}
|
|
return damage;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
TPRJ A -1 Bright;
|
|
Stop;
|
|
Death:
|
|
Crash:
|
|
TNT1 A 0
|
|
{
|
|
if ( !Random[Stinger](0,2) ) A_PlaySound("stinger/hit2",CHAN_BODY,0.5,pitch:FRandom[Stinger](0.5,1.5));
|
|
else A_PlaySound("stinger/hit",CHAN_BODY,0.6);
|
|
A_AlertMonsters();
|
|
}
|
|
TPRJ BCDEFG 2 Bright;
|
|
Stop;
|
|
XDeath:
|
|
TNT1 A 1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class Stinger : UTWeapon
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_STINGER";
|
|
Inventory.PickupMessage "$I_STINGER";
|
|
Weapon.UpSound "stinger/select";
|
|
Weapon.SlotNumber 3;
|
|
Weapon.SelectionOrder 7;
|
|
Weapon.AmmoType "StingerAmmo";
|
|
Weapon.AmmoUse 1;
|
|
Weapon.AmmoType2 "StingerAmmo";
|
|
Weapon.AmmoUse2 1;
|
|
Weapon.AmmoGive 40;
|
|
UTWeapon.DropAmmo 20;
|
|
}
|
|
override void PlayUpSound( Actor origin )
|
|
{
|
|
origin.A_PlaySound(upsound,CHAN_WEAPON,Dampener.Active(origin)?.1:1.);
|
|
}
|
|
action void A_StingerFire( bool hold = false )
|
|
{
|
|
Weapon weap = Weapon(invoker);
|
|
if ( !weap ) return;
|
|
if ( weap.Ammo1.Amount <= 0 ) return;
|
|
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
|
|
if ( hold )
|
|
{
|
|
A_SoundVolume(CHAN_WEAPON,Dampener.Active(self)?.1:1.);
|
|
A_Overlay(PSP_FLASH,"MFlashHold");
|
|
}
|
|
else
|
|
{
|
|
A_PlaySound("stinger/fire",CHAN_WEAPON,Dampener.Active(self)?.1:1.);
|
|
A_Overlay(PSP_FLASH,"MFlash");
|
|
}
|
|
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
|
|
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
|
|
UTMainHandler.DoFlash(self,Color(16,0,64,255),1);
|
|
UTMainHandler.DoSwing(self,(FRandom[Stinger](-0.1,-0.2),FRandom[Stinger](-0.1,0.1)),4,-1.5,2,SWING_Spring,2,2);
|
|
if ( !Dampener.Active(self) ) A_AlertMonsters();
|
|
A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
|
|
Vector3 x, y, z;
|
|
[x, y, z] = dt_Matrix4.GetAxes(pitch,angle,roll);
|
|
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+8.0*y-9.0*z;
|
|
Actor p = Spawn("StingerProjectile",origin);
|
|
p.angle = angle;
|
|
p.pitch = BulletSlope();
|
|
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
|
|
p.target = self;
|
|
}
|
|
action void A_StingerAltFire()
|
|
{
|
|
Weapon weap = Weapon(invoker);
|
|
if ( !weap ) return;
|
|
if ( weap.Ammo1.Amount <= 0 ) return;
|
|
A_PlaySound("stinger/altfire",CHAN_WEAPON,Dampener.Active(self)?.1:1.);
|
|
A_Overlay(PSP_FLASH,"MFlash");
|
|
A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true);
|
|
A_OverlayRenderstyle(PSP_FLASH,STYLE_Add);
|
|
UTMainHandler.DoFlash(self,Color(16,0,64,255),1);
|
|
UTMainHandler.DoSwing(self,(FRandom[Stinger](-0.3,-0.8),FRandom[Stinger](-0.4,0.4)),4,-1,3,SWING_Spring,3,5);
|
|
if ( !Dampener.Active(self) ) A_AlertMonsters();
|
|
A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
|
|
Vector3 x, y, z;
|
|
[x, y, z] = dt_Matrix4.GetAxes(pitch,angle,roll);
|
|
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x+8.0*y-9.0*z;
|
|
[x, y, z] = dt_Matrix4.GetAxes(BulletSlope(),angle,roll);
|
|
Actor p;
|
|
double a, s;
|
|
Vector3 dir;
|
|
for ( int i=0; i<4; i++ )
|
|
{
|
|
if ( weap.Ammo1.Amount <= 0 ) return;
|
|
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
|
|
a = FRandom[Stinger](0,360);
|
|
s = FRandom[Stinger](0,0.08);
|
|
dir = (x+y*cos(a)*s+z*sin(a)*s).unit();
|
|
p = Spawn("StingerProjectile",origin);
|
|
p.angle = atan2(dir.y,dir.x);
|
|
p.pitch = asin(-dir.z);
|
|
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
|
|
p.target = self;
|
|
}
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
STNP A -1;
|
|
Stop;
|
|
STNP B -1;
|
|
Stop;
|
|
Select:
|
|
STNS A 1 A_Raise(int.max);
|
|
Wait;
|
|
Ready:
|
|
STNS ABCDEFGHIJKLMNOPQRSTU 1 A_WeaponReady(WRF_NOFIRE);
|
|
Idle:
|
|
STNI A 1
|
|
{
|
|
A_CheckReload();
|
|
A_WeaponReady();
|
|
}
|
|
Wait;
|
|
Fire:
|
|
STNF A 2 A_StingerFire();
|
|
STNF BC 2;
|
|
STNI A 3;
|
|
STNI A 0 A_Refire(1);
|
|
Goto Idle;
|
|
STNI A 0 A_PlaySound("stinger/hold",CHAN_WEAPON,Dampener.Active(self)?.1:1.,true);
|
|
Hold:
|
|
STNH A 1
|
|
{
|
|
// need to make sure player does the repeat fire anim
|
|
if ( self is 'UPlayer' )
|
|
UPlayer(self).PlayAttacking();
|
|
A_StingerFire(true);
|
|
}
|
|
STNH BCDEFG 1;
|
|
STNH A 0 A_Refire();
|
|
STNH A 2 A_PlaySound("stinger/release",CHAN_WEAPON,Dampener.Active(self)?.1:1.);
|
|
Goto Idle;
|
|
AltFire:
|
|
STNF A 2 A_StingerAltFire();
|
|
STNF BC 2;
|
|
STNI A 35; // yes, 1 second cooldown
|
|
Goto Idle;
|
|
Deselect:
|
|
STND ABCDEFGHIJK 1;
|
|
STND K 1 A_Lower(int.max);
|
|
Wait;
|
|
MFlash:
|
|
STFF ABC 2 Bright;
|
|
Stop;
|
|
MFlashHold:
|
|
STFH ABCDEFG 1 Bright;
|
|
Stop;
|
|
}
|
|
}
|