Notable changes since last commit are the full implementation of the automag and asmd. Also the Translator is now fully functional. Fonts have been restructured to a neater format. There have also been other random changes I don't have the time to document in detail.
286 lines
6.1 KiB
Text
286 lines
6.1 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 StingerBurstLight : PaletteLight
|
|
{
|
|
Default
|
|
{
|
|
Tag "Blue3";
|
|
Args 0,0,0,30;
|
|
ReactionTime 10;
|
|
}
|
|
}
|
|
|
|
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();
|
|
Spawn("StingerBurstLight",pos);
|
|
}
|
|
TPRJ BCDEFG 2 Bright;
|
|
Stop;
|
|
XDeath:
|
|
TNT1 A 1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class StingerLight : EnforcerLight
|
|
{
|
|
Default
|
|
{
|
|
args 64,128,255,80;
|
|
}
|
|
}
|
|
|
|
Class Stinger : UnrealWeapon
|
|
{
|
|
int flashnum;
|
|
|
|
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;
|
|
}
|
|
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);
|
|
invoker.FireEffect();
|
|
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)+5.0*x+8.0*y-8.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);
|
|
invoker.FireEffect();
|
|
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)+5.0*x+8.0*y-8.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);
|
|
invoker.flashnum = Random[Stinger](0,3);
|
|
}
|
|
Hold:
|
|
STNH A 1
|
|
{
|
|
// need to make sure player does the repeat fire anim
|
|
if ( self is 'UPlayer' )
|
|
UPlayer(self).PlayAttacking();
|
|
A_StingerFire(true);
|
|
invoker.flashnum = (invoker.flashnum+1)%4;
|
|
}
|
|
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 ACEGIK 1;
|
|
STND K 1 A_Lower(int.max);
|
|
Wait;
|
|
MFlash:
|
|
STFF A 2 Bright
|
|
{
|
|
let l = Spawn("StingerLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
MFlashHold:
|
|
TNT1 A 0 A_JumpIf(invoker.flashnum==0,7);
|
|
TNT1 A 0 A_JumpIf(invoker.flashnum==1,4);
|
|
TNT1 A 0 A_JumpIf(invoker.flashnum==2,4);
|
|
TNT1 A 0 A_JumpIf(invoker.flashnum==3,1);
|
|
Stop;
|
|
STFF A 2 Bright
|
|
{
|
|
let l = Spawn("StingerLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
STFF B 2 Bright
|
|
{
|
|
let l = Spawn("StingerLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
STFF C 2 Bright
|
|
{
|
|
let l = Spawn("StingerLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
STFF D 2 Bright
|
|
{
|
|
let l = Spawn("StingerLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
/*MFlash:
|
|
STFF ABC 2 Bright;
|
|
Stop;
|
|
MFlashHold:
|
|
STFH ABCDEFG 1 Bright;
|
|
Stop;*/
|
|
}
|
|
}
|