- Adjust AmbientGlow shader to work EXACTLY like in UE1 (don't ask how I figured this out). - Fix Enforcer sometimes reloading when reloading is disabled. - Fix Enforcer pickups having no ambient glow.
716 lines
18 KiB
Text
716 lines
18 KiB
Text
Class EClip : MiniAmmo
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_CLIP"; // "Large Bullets" in UT, but I think that's an oversight, since it's the same as the Minigun ammo
|
|
Inventory.PickupMessage "$I_CLIP";
|
|
Inventory.Amount 20;
|
|
Ammo.DropAmount 5;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
ECLP A -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class EnforcerLight : DynamicLight
|
|
{
|
|
int cnt;
|
|
Default
|
|
{
|
|
DynamicLight.Type "Point";
|
|
args 255,224,64,150;
|
|
}
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
if ( !target )
|
|
{
|
|
Destroy();
|
|
return;
|
|
}
|
|
if ( target.player )
|
|
{
|
|
Vector3 x, y, z, origin;
|
|
[x, y, z] = dt_CoordUtil.GetAxes(target.pitch,target.angle,target.roll);
|
|
origin = level.Vec3Offset(target.Vec2OffsetZ(0,0,target.player.viewz),x*12);
|
|
SetOrigin(origin,true);
|
|
}
|
|
else SetOrigin(target.pos,true);
|
|
if ( cnt++ > 2 ) Destroy();
|
|
}
|
|
}
|
|
|
|
Class BulletImpact : Actor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
Radius 0.1;
|
|
Height 0;
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+DONTSPLASH;
|
|
+NOTELEPORT;
|
|
Scale 0.25;
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
A_SprayDecal("Pock",-20);
|
|
int numpt = int(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+x*2);
|
|
s.vel = pvel;
|
|
s.SetShade(Color(1,1,1)*Random[Enforcer](128,192));
|
|
}
|
|
numpt = int(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+x*2);
|
|
s.vel = pvel;
|
|
}
|
|
numpt = int(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+x*2);
|
|
s.vel = pvel;
|
|
}
|
|
A_PlaySound("bullet/hit",CHAN_VOICE,attenuation:3.0);
|
|
let s = Spawn("Splasher",Vec3Offset(0,0,2));
|
|
s.vel = (0,0,-4);
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
BIMP ABCDE 1 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class Splasher : Actor
|
|
{
|
|
Default
|
|
{
|
|
Radius 0.1;
|
|
Height 0;
|
|
+CORPSE;
|
|
+NOTELEPORT;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
Crash:
|
|
TNT1 A 2;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class UTCasing : Actor
|
|
{
|
|
int deadtimer, numbounces;
|
|
double pitchvel, anglevel;
|
|
double heat;
|
|
|
|
Default
|
|
{
|
|
Radius 2;
|
|
Height 2;
|
|
+NOBLOCKMAP;
|
|
+MISSILE;
|
|
+MOVEWITHSECTOR;
|
|
+THRUACTORS;
|
|
+USEBOUNCESTATE;
|
|
+INTERPOLATEANGLES;
|
|
+NOTELEPORT;
|
|
Mass 1;
|
|
Gravity 0.35;
|
|
BounceType "Hexen";
|
|
WallBounceFactor 0.65;
|
|
BounceFactor 0.65;
|
|
BounceSound "bullet/casing";
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
deadtimer = 0;
|
|
pitchvel = FRandom[Junk](10,30)*RandomPick[Junk](-1,1);
|
|
anglevel = FRandom[Junk](10,30)*RandomPick[Junk](-1,1);
|
|
heat = 1.0;
|
|
}
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
if ( isFrozen() ) return;
|
|
if ( InStateSequence(CurState,ResolveState("Death")) )
|
|
{
|
|
deadtimer++;
|
|
if ( deadtimer > 300 ) A_FadeOut(0.05);
|
|
return;
|
|
}
|
|
heat -= 0.05;
|
|
if ( heat <= 0 ) return;
|
|
let s = Spawn("UTSmallSmoke",pos);
|
|
s.alpha *= heat;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
PCAS A 1
|
|
{
|
|
angle += anglevel;
|
|
pitch += pitchvel;
|
|
}
|
|
Loop;
|
|
Bounce:
|
|
PCAS A 0
|
|
{
|
|
pitchvel = FRandom[Junk](10,30)*RandomPick[Junk](-1,1);
|
|
anglevel = FRandom[Junk](10,30)*RandomPick[Junk](-1,1);
|
|
vel = (vel.unit()+(FRandom[Junk](-.2,.2),FRandom[Junk](-.2,.2),FRandom[Junk](-.2,.2))).unit()*vel.length();
|
|
if ( numbounces && ((numbounces > 3) || (Random[Junk](1,20) < 17) || (vel.z > -1.4)) )
|
|
{
|
|
ClearBounce();
|
|
ExplodeMissile();
|
|
}
|
|
numbounces++;
|
|
}
|
|
Goto Spawn;
|
|
Death:
|
|
PCAS A -1
|
|
{
|
|
pitch = 0;
|
|
angle = FRandom[Junk](0,360);
|
|
roll = FRandom[Junk](0,360);
|
|
}
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class EnforcerMag : UTCasing
|
|
{
|
|
Default
|
|
{
|
|
BounceSound "enforcer/bounce";
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
heat = 0.;
|
|
}
|
|
States
|
|
{
|
|
Death:
|
|
PCAS A -1
|
|
{
|
|
pitch = RandomPick[Junk](-90,90);
|
|
angle = FRandom[Junk](0,360);
|
|
}
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class Enforcer : UTWeapon
|
|
{
|
|
int ClipCount, SlaveClipCount;
|
|
bool SlaveActive, SlaveDown, SlaveReload, SlaveAltFire;
|
|
int SlaveRefire;
|
|
double AltAccuracy;
|
|
|
|
property ClipCount : ClipCount;
|
|
property SlaveClipCount : SlaveClipCount;
|
|
|
|
override bool HandlePickup( Inventory item )
|
|
{
|
|
if ( item.GetClass() == GetClass() )
|
|
{
|
|
SetTag(StringTable.Localize("$T_ENFORCER2"));
|
|
return Super.HandlePickup(item);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
override Inventory CreateTossable( int amt )
|
|
{
|
|
Inventory inv = Super.CreateTossable(amt);
|
|
if ( inv )
|
|
{
|
|
SetTag(StringTable.Localize("$T_ENFORCER"));
|
|
inv.SetTag(StringTable.Localize("$T_ENFORCER"));
|
|
if ( Owner && (Owner.player.ReadyWeapon == self) )
|
|
{
|
|
// delete the slave overlay
|
|
PSprite psp;
|
|
for ( psp = Owner.player.psprites; psp; psp = psp.next )
|
|
{
|
|
if ( (psp.Caller == self) && ((psp.id == 2) || (psp.id == -9998)) ) psp.Destroy();
|
|
slaveactive = false;
|
|
slavedown = false;
|
|
}
|
|
}
|
|
}
|
|
return inv;
|
|
}
|
|
|
|
action void A_EnforcerRefire( statelabel flash = null, bool slave = false )
|
|
{
|
|
Weapon weap = Weapon(invoker);
|
|
if ( !weap || !player ) return;
|
|
if ( invoker.altaccuracy < 0.2 ) invoker.altaccuracy += 0.05;
|
|
if ( slave )
|
|
{
|
|
if ( flak_enforcerreload && (invoker.slaveclipcount < 5) ) A_PlaySound("enforcer/click",CHAN_6);
|
|
if ( (invoker.slaveclipcount <= 0) || (weap.Ammo1.Amount <= 0) )
|
|
{
|
|
invoker.slaverefire = 0;
|
|
return;
|
|
}
|
|
bool pending = (player.PendingWeapon != WP_NOCHANGE) && (player.WeaponState & WF_REFIRESWITCHOK);
|
|
if ( (player.cmd.buttons&BT_ATTACK) && !invoker.slavealtfire && !pending && (player.health > 0) )
|
|
{
|
|
invoker.slaverefire++;
|
|
if ( player.ReadyWeapon.CheckAmmo(Weapon.PrimaryFire,true) )
|
|
player.setpsprite(2,flash?ResolveState(flash):ResolveState("LeftHold"));
|
|
}
|
|
else if ( (player.cmd.buttons&BT_ALTATTACK) && invoker.slavealtfire && !pending && (player.health > 0) )
|
|
{
|
|
invoker.slaverefire++;
|
|
if ( player.ReadyWeapon.CheckAmmo(Weapon.AltFire,true) )
|
|
player.setpsprite(2,flash?ResolveState(flash):ResolveState("LeftAltHold"));
|
|
}
|
|
else
|
|
{
|
|
invoker.slaverefire = 0;
|
|
player.ReadyWeapon.CheckAmmo(invoker.slavealtfire?Weapon.AltFire:Weapon.PrimaryFire,true);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if ( flak_enforcerreload && (invoker.clipcount < 5) ) A_PlaySound("enforcer/click",CHAN_WEAPON);
|
|
if ( (invoker.clipcount <= 0) || (weap.Ammo1.Amount <= 0) )
|
|
{
|
|
A_ClearRefire();
|
|
return;
|
|
}
|
|
A_Refire(flash);
|
|
}
|
|
}
|
|
|
|
action void A_LeftWeaponReady()
|
|
{
|
|
Weapon weap = Weapon(invoker);
|
|
if ( !weap || !player ) return;
|
|
if ( player.cmd.buttons&BT_ATTACK && !player.ReadyWeapon.bAltFire )
|
|
{
|
|
if ( flak_enforcerreload && (invoker.slaveclipcount <= 0) && (weap.Ammo1.Amount > 0) )
|
|
{
|
|
player.setpsprite(2,ResolveState("LeftReload"));
|
|
return;
|
|
}
|
|
invoker.slaverefire = 0;
|
|
invoker.slavealtfire = false;
|
|
player.setpsprite(2,ResolveState("LeftFire"));
|
|
}
|
|
else if ( player.cmd.buttons&BT_ALTATTACK && player.ReadyWeapon.bAltFire )
|
|
{
|
|
if ( flak_enforcerreload && (invoker.slaveclipcount <= 0) && (weap.Ammo1.Amount > 0) )
|
|
{
|
|
player.setpsprite(2,ResolveState("LeftReload"));
|
|
return;
|
|
}
|
|
invoker.slaverefire = 0;
|
|
invoker.slavealtfire = true;
|
|
player.setpsprite(2,ResolveState("LeftAltFire"));
|
|
}
|
|
}
|
|
|
|
action void A_EnforcerFire( bool alt = false, bool slave = false )
|
|
{
|
|
Weapon weap = Weapon(invoker);
|
|
if ( !weap ) return;
|
|
if ( weap.Ammo1.Amount <= 0 ) return;
|
|
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
|
|
if ( slave )
|
|
{
|
|
invoker.slaveclipcount--;
|
|
if ( !flak_enforcerreload && (invoker.slaveclipcount <=0) ) invoker.slaveclipcount = Min(invoker.default.slaveclipcount,weap.Ammo1.Amount);
|
|
}
|
|
else
|
|
{
|
|
invoker.clipcount--;
|
|
if ( !flak_enforcerreload && (invoker.clipcount <=0) ) invoker.clipcount = Min(invoker.default.clipcount,weap.Ammo1.Amount);
|
|
}
|
|
invoker.FireEffect();
|
|
UTMainHandler.DoFlash(self,Color(32,255,128,0),1);
|
|
A_PlaySound("enforcer/shoot",slave?CHAN_6:CHAN_WEAPON);
|
|
A_AlertMonsters();
|
|
A_QuakeEx(2,2,2,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.08);
|
|
if ( slave )
|
|
{
|
|
if ( alt ) A_Overlay(-3,"LeftAltMuzzleFlash");
|
|
else A_Overlay(-3,"LeftMuzzleFlash");
|
|
A_OverlayFlags(-3,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true);
|
|
A_OverlayRenderstyle(-3,STYLE_Add);
|
|
UTMainHandler.DoSwing(self,(FRandom[Enforcer](0.5,0.2),FRandom[Enforcer](-0.3,0.2)),2,0,1,SWING_Spring,0,2);
|
|
}
|
|
else
|
|
{
|
|
if ( alt ) A_Overlay(-2,"AltMuzzleFlash");
|
|
else A_Overlay(-2,"MuzzleFlash");
|
|
A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true);
|
|
A_OverlayRenderstyle(-2,STYLE_Add);
|
|
UTMainHandler.DoSwing(self,(FRandom[Enforcer](-0.2,-0.5),FRandom[Enforcer](-0.3,0.2)),2,0,1,SWING_Spring,0,2);
|
|
}
|
|
Vector3 x, y, z, x2, y2, z2;
|
|
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
|
|
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x);
|
|
int ydir = slave?-1:1;
|
|
if ( alt ) origin = level.Vec3Offset(origin,-z*3+ydir*y);
|
|
else origin = level.Vec3Offset(origin,-z+ydir*y*4);
|
|
double a = FRandom[Enforcer](0,360), s = FRandom[Enforcer](0,alt?invoker.altaccuracy:0.004);
|
|
[x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll);
|
|
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
|
|
FLineTraceData d;
|
|
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
|
|
UTBulletTrail.DoTrail(self,origin,dir,10000,int((invoker.Amount+alt)**2));
|
|
if ( d.HitType == TRACE_HitActor )
|
|
{
|
|
int dmg = 17;
|
|
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'shot',DMG_USEANGLE|DMG_THRUSTLESS,atan2(d.HitDir.y,d.HitDir.x));
|
|
double mm = 3000;
|
|
if ( FRandom[Enforcer](0,1) < 0.2 ) mm *= 5;
|
|
UTMainHandler.DoKnockback(d.HitActor,d.HitDir,mm);
|
|
if ( d.HitActor.bNOBLOOD )
|
|
{
|
|
let p = Spawn("BulletImpact",d.HitLocation);
|
|
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 )
|
|
{
|
|
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;
|
|
}
|
|
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);
|
|
}
|
|
for ( int i=0; i<3; i++ )
|
|
{
|
|
let s = Spawn("UTViewSmoke",origin);
|
|
if ( alt ) UTViewSmoke(s).ofs = (10,ydir,-3);
|
|
else UTViewSmoke(s).ofs = (10,4*ydir,-1);
|
|
s.target = self;
|
|
s.alpha *= 0.5;
|
|
}
|
|
origin = level.Vec3Offset(origin,x*8+ydir*y*6-z*2);
|
|
let c = Spawn("UTCasing",origin);
|
|
c.angle = angle;
|
|
c.pitch = pitch;
|
|
c.vel = x*FRandom[Junk](-1.5,1.5)+y*ydir*FRandom[Junk](2,4)+z*FRandom[Junk](2,3);
|
|
}
|
|
|
|
override String GetObituary( Actor victim, Actor inflictor, Name mod, bool playerattack )
|
|
{
|
|
if ( Amount > 1 ) return StringTable.Localize("$O_ENFORCER2");
|
|
return StringTable.Localize("$O_ENFORCER");
|
|
}
|
|
|
|
override void Travelled()
|
|
{
|
|
Super.Travelled();
|
|
slaveactive = false;
|
|
}
|
|
|
|
override void OwnerDied()
|
|
{
|
|
Super.OwnerDied();
|
|
slavereload = slaverefire = 0;
|
|
if ( Owner.player.ReadyWeapon != self ) return;
|
|
let psp = Owner.player.FindPSprite(2);
|
|
if ( psp )
|
|
{
|
|
slaveactive = false;
|
|
Owner.player.SetPSprite(2,ResolveState("LeftDeselect"));
|
|
}
|
|
}
|
|
|
|
Default
|
|
{
|
|
Tag "$T_ENFORCER";
|
|
Inventory.PickupMessage "$I_ENFORCER";
|
|
Inventory.MaxAmount 2;
|
|
Inventory.InterHubAmount 2;
|
|
Weapon.UpSound "enforcer/select";
|
|
Weapon.SlotNumber 2;
|
|
Weapon.SelectionOrder 8;
|
|
Weapon.AmmoType "MiniAmmo";
|
|
Weapon.AmmoUse 1;
|
|
Weapon.AmmoType2 "MiniAmmo";
|
|
Weapon.AmmoUse2 1;
|
|
Weapon.AmmoGive 30;
|
|
Weapon.Kickback 180;
|
|
UTWeapon.DropAmmo 10;
|
|
Enforcer.ClipCount 20;
|
|
Enforcer.SlaveClipCount 20;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
ENFP A -1;
|
|
Stop;
|
|
ENFP B -1;
|
|
Stop;
|
|
Select:
|
|
ENFS A 1 A_Raise(int.max);
|
|
Ready:
|
|
ENFS A 0
|
|
{
|
|
invoker.slavedown = false;
|
|
if ( !invoker.slaveactive && (CountInv("Enforcer") > 1) )
|
|
{
|
|
invoker.slavereload = invoker.slaverefire = 0;
|
|
A_Overlay(2,"LeftReady");
|
|
}
|
|
}
|
|
ENFS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_WeaponReady(WRF_NOFIRE);
|
|
Idle:
|
|
ENFI A 0 A_Overlay(-9999,"Dummy");
|
|
ENFI AB 30;
|
|
ENFI A 0 A_Jump(50,"Twiddle");
|
|
Goto Idle+1;
|
|
LeftReady:
|
|
2NFS A 0
|
|
{
|
|
A_PlaySound("enforcer/select",CHAN_6);
|
|
invoker.slaveactive = true;
|
|
}
|
|
2NFS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_JumpIf(invoker.slavedown,"LeftDeselect");
|
|
LeftIdle:
|
|
2NFI A 0 A_Overlay(-9998,"LeftDummy");
|
|
2NFI AB 30;
|
|
2NFI A 0 A_Jump(50,"LeftTwiddle");
|
|
Goto LeftIdle+1;
|
|
Twiddle:
|
|
ENFT ABCDEFGHIJKLMNOPQRSTUVWXY 2;
|
|
Goto Idle+1;
|
|
LeftTwiddle:
|
|
2NFT ABCDEFGHIJKLMNOPQRSTUVWXY 2;
|
|
Goto LeftIdle+1;
|
|
Dummy:
|
|
TNT1 A 1
|
|
{
|
|
if ( flak_enforcerreload && (invoker.clipcount <= 0) && (invoker.Ammo1.Amount > 0) ) player.SetPSprite(PSP_WEAPON,ResolveState("Reload"));
|
|
else if ( flak_enforcerreload && ((invoker.clipcount < min(invoker.default.clipcount,invoker.Ammo1.Amount)) || (invoker.slaveclipcount < min(invoker.default.slaveclipcount,invoker.Ammo1.Amount))) ) A_WeaponReady(WRF_ALLOWRELOAD);
|
|
else A_WeaponReady();
|
|
if ( !invoker.slaveactive && (CountInv("Enforcer") > 1) )
|
|
{
|
|
invoker.slavereload = invoker.slaverefire = 0;
|
|
A_Overlay(2,"LeftReady");
|
|
}
|
|
}
|
|
Wait;
|
|
LeftDummy:
|
|
TNT1 A 1
|
|
{
|
|
if ( flak_enforcerreload && invoker.slavereload ) player.SetPSprite(2,ResolveState("LeftReload"));
|
|
else if ( invoker.slavedown ) player.SetPSprite(2,ResolveState("LeftDeselect"));
|
|
else A_LeftWeaponReady();
|
|
}
|
|
Wait;
|
|
Fire:
|
|
ENFF A 0 A_Overlay(-9999,null);
|
|
Hold:
|
|
ENFF A 0 A_EnforcerFire();
|
|
ENFF ABCDEFGHIJ 1;
|
|
ENFF J 2;
|
|
ENFF J 0 A_EnforcerRefire();
|
|
ENFF J 2;
|
|
ENFI A 0;
|
|
Goto Idle;
|
|
LeftFire:
|
|
2NFI A 0 A_Overlay(-9998,null);
|
|
2NFI A 5;
|
|
2NFI A 0 A_EnforcerRefire(1,true);
|
|
Goto LeftIdle;
|
|
LeftHold:
|
|
2NFF A 0 A_EnforcerFire(false,true);
|
|
2NFF ABCDEFGHIJ 1;
|
|
2NFF J 2;
|
|
2NFF J 0 A_EnforcerRefire("LeftHold",true);
|
|
2NFF J 2;
|
|
2NFI A 0;
|
|
Goto LeftIdle;
|
|
AltFire:
|
|
ENFA A 0
|
|
{
|
|
invoker.altaccuracy = 0.08;
|
|
A_Overlay(-9999,null);
|
|
}
|
|
ENFA ABCDEF 1;
|
|
AltHold:
|
|
ENFA G 0 A_EnforcerFire(true);
|
|
ENFA GHIJKLMN 1;
|
|
ENFA N 1;
|
|
ENFA G 0 A_EnforcerRefire();
|
|
ENFA OPQRSTU 1;
|
|
Goto Idle;
|
|
LeftAltFire:
|
|
2NFI A 0 A_Overlay(-9998,null);
|
|
2NFI A 5;
|
|
2NFI A 0 A_EnforcerRefire(1,true);
|
|
Goto LeftIdle;
|
|
2NFA ABCDEF 1;
|
|
LeftAltHold:
|
|
2NFA G 0 A_EnforcerFire(true,true);
|
|
2NFA GHIJKLMN 1;
|
|
2NFA N 1;
|
|
2NFA G 0 A_EnforcerRefire("LeftAltHold",true);
|
|
2NFA OPQRSTU 1;
|
|
Goto LeftIdle;
|
|
Reload:
|
|
ENFR A 0
|
|
{
|
|
if ( invoker.clipcount >= invoker.default.clipcount )
|
|
{
|
|
invoker.slavereload = (flak_enforcerreload&&invoker.slaveactive&&(invoker.slaveclipcount<min(invoker.default.slaveclipcount,invoker.Ammo1.Amount)));
|
|
return ResolveState("Idle");
|
|
}
|
|
return ResolveState(null);
|
|
}
|
|
ENFR A 0
|
|
{
|
|
invoker.clipcount = 0;
|
|
A_Overlay(-9999,null);
|
|
A_PlaySound("enforcer/click",CHAN_WEAPON);
|
|
}
|
|
ENFR ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
|
|
ENR2 AB 1;
|
|
ENR2 B 30
|
|
{
|
|
invoker.clipcount = min(invoker.default.clipcount,invoker.Ammo1.Amount);
|
|
A_PlaySound("enforcer/reload",CHAN_WEAPON);
|
|
if ( self is 'UTPlayer' )
|
|
UTPlayer(self).PlayReloading();
|
|
invoker.slavereload = (flak_enforcerreload&&invoker.slaveactive&&(invoker.slaveclipcount<min(invoker.default.slaveclipcount,invoker.Ammo1.Amount)));
|
|
Vector3 x, y, z, origin;
|
|
[x,y,z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
|
|
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.+y*4.-z*8.);
|
|
let c = Spawn("EnforcerMag",origin);
|
|
c.angle = angle;
|
|
c.pitch = pitch;
|
|
c.vel = vel*.5+x*FRandom[Junk](-.5,.5)+y*FRandom[Junk](-.5,.5)-z*FRandom[Junk](1,2);
|
|
}
|
|
ENFS A 0 A_PlaySound("enforcer/select",CHAN_WEAPON);
|
|
Goto Ready;
|
|
LeftReload:
|
|
2NFR A 0
|
|
{
|
|
if ( invoker.slaveclipcount >= invoker.default.slaveclipcount )
|
|
{
|
|
invoker.slavereload = 0;
|
|
return ResolveState("LeftIdle");
|
|
}
|
|
invoker.slaveclipcount = 0;
|
|
A_Overlay(-9998,null);
|
|
A_PlaySound("enforcer/click",CHAN_6);
|
|
return ResolveState(null);
|
|
}
|
|
2NFR ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
|
|
2NR2 AB 1;
|
|
2NR2 B 30
|
|
{
|
|
invoker.slaveclipcount = min(invoker.default.slaveclipcount,invoker.Ammo1.Amount);
|
|
A_PlaySound("enforcer/reload",CHAN_6);
|
|
if ( self is 'UTPlayer' )
|
|
UTPlayer(self).PlayReloading();
|
|
invoker.slavereload = false;
|
|
Vector3 x, y, z, origin;
|
|
[x,y,z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
|
|
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.-y*4.-z*8.);
|
|
let c = Spawn("EnforcerMag",origin);
|
|
c.angle = angle;
|
|
c.pitch = pitch;
|
|
c.vel = vel*.5+x*FRandom[Junk](-.5,.5)+y*FRandom[Junk](-.5,.5)-z*FRandom[Junk](1,2);
|
|
}
|
|
2NFS A 0 A_PlaySound("enforcer/select",CHAN_6);
|
|
Goto LeftReady;
|
|
Deselect:
|
|
ENFD A 0
|
|
{
|
|
A_Overlay(-9999,null);
|
|
invoker.slavedown = true;
|
|
}
|
|
ENFD ABDEGHJK 1;
|
|
ENFD L 1
|
|
{
|
|
if ( !player.FindPSprite(2) )
|
|
A_Lower(int.max);
|
|
}
|
|
Wait;
|
|
LeftDeselect:
|
|
2NFD A 0
|
|
{
|
|
A_Overlay(-9998,null);
|
|
invoker.slaveactive = false;
|
|
}
|
|
2NFD ABDEGHJK 1;
|
|
2NFD L 0;
|
|
Stop;
|
|
MuzzleFlash:
|
|
EMUZ A 2 Bright
|
|
{
|
|
let l = Spawn("EnforcerLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
AltMuzzleFlash:
|
|
EMUZ B 2 Bright
|
|
{
|
|
let l = Spawn("EnforcerLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
LeftMuzzleFlash:
|
|
EMUZ C 2 Bright
|
|
{
|
|
let l = Spawn("EnforcerLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
LeftAltMuzzleFlash:
|
|
EMUZ D 2 Bright
|
|
{
|
|
let l = Spawn("EnforcerLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
}
|
|
}
|