774 lines
21 KiB
Text
774 lines
21 KiB
Text
// Kmonn Shuna Quadravol (from UnSX series, not a Quadshot reskin anymore)
|
|
// Slot 6, spawns shared with Hellblazer
|
|
|
|
Class Quadravol : SWWMWeapon
|
|
{
|
|
int clipcount;
|
|
int chargelevel;
|
|
bool chambered, charged, waschambered, wascharged, fromfire;
|
|
bool onehand;
|
|
|
|
Property ClipCount : clipcount;
|
|
|
|
int wastecycle; // for easter egg
|
|
|
|
override bool ReportHUDAmmo()
|
|
{
|
|
return (chargelevel>0)||(chambered&&!charged)||(clipcount>0)||(Ammo1.Amount > 0);
|
|
}
|
|
|
|
override bool CheckAmmo( int firemode, bool autoswitch, bool requireammo, int ammocount )
|
|
{
|
|
if ( sv_infiniteammo || Owner.FindInventory('PowerInfiniteAmmo',true) ) return true;
|
|
if ( (firemode == PrimaryFire) || (firemode == EitherFire) )
|
|
{
|
|
if ( (chargelevel > 0) || (chambered && !charged) || (clipcount > 0) || (Ammo1.Amount > 0) ) return true;
|
|
if ( autoswitch ) PlayerPawn(Owner).PickNewWeapon(null);
|
|
return false;
|
|
}
|
|
return Super.CheckAmmo(firemode,autoswitch,requireammo,ammocount);
|
|
}
|
|
|
|
override void PlayUpSound( Actor origin )
|
|
{
|
|
if ( onehand ) origin.A_StartSound("quadshot/selectfast",CHAN_WEAPON,CHANF_OVERLAP);
|
|
else origin.A_StartSound(UpSound,CHAN_WEAPON,CHANF_OVERLAP);
|
|
}
|
|
|
|
override Vector3 GetTraceOffset( int index )
|
|
{
|
|
return onehand?(10,3.5,-2):(10,3,-2.5);
|
|
}
|
|
|
|
action State A_QuadFire( bool bMelee = false )
|
|
{
|
|
static const String BaseNum[] = {"one","two","three","four","five"};
|
|
static const StateLabel FireStates[] = {"FireOne","FireTwo","FireThree","FireFour","FireFive"};
|
|
static const StateLabel FireStates1H[] = {"FireOne1H","FireTwo1H","FireThree1H","FireFour1H","FireFive1H"};
|
|
int idx = clamp(invoker.chargelevel-1,0,4);
|
|
A_StartSound("quadshot/fire"..BaseNum[idx],CHAN_WEAPON,CHANF_OVERLAP);
|
|
A_PlayerFire();
|
|
let [x, y, z] = SWWMUtility.GetPlayerAxes(self);
|
|
double offy = invoker.onehand?3.5:3;
|
|
double offz = invoker.onehand?-2:-2.5;
|
|
Vector3 origin = SWWMUtility.GetFireOffset(self,10,offy,offz);
|
|
bool pointblank = false;
|
|
int rings = 1;
|
|
Vector3 dir;
|
|
FLineTraceData d;
|
|
Actor fool = null;
|
|
Line fline = null;
|
|
bool fside;
|
|
for ( double i=0; i<.16; i+=.04 )
|
|
{
|
|
for ( int j=0; j<360; j+=(360/rings) )
|
|
{
|
|
dir = SWWMUtility.ConeSpread(x,y,z,j,i);
|
|
pointblank |= LineTrace(atan2(dir.y,dir.x),60,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
|
|
if ( (d.HitType == TRACE_HitActor) && !fool ) fool = d.HitActor;
|
|
if ( (d.HitType == TRACE_HitWall) && !fline )
|
|
{
|
|
fline = d.HitLine;
|
|
fside = d.LineSide;
|
|
}
|
|
}
|
|
rings += 3;
|
|
}
|
|
if ( bMelee && fool ) SWWMUtility.AchievementProgressInc("roast",1,player);
|
|
if ( bMelee || fool || (idx>=4) ) A_StartSound("quadshot/pointblank",CHAN_WEAPON,CHANF_OVERLAP,.6+idx*.1,.4-idx*.05,1.2-idx*.05);
|
|
let [x2, y2, z2] = SWWMUtility.GetPlayerAxesAutoAimed(self);
|
|
double a, s;
|
|
Actor p;
|
|
bool bExtra = ((idx>=4)&&invoker.chambered&&!invoker.charged);
|
|
// line activation
|
|
if ( pointblank )
|
|
{
|
|
if ( fline ) fline.Activate(self,fside,SPAC_Impact);
|
|
SWWMBulletTrail.DoTrail(self,origin,x,60,0);
|
|
}
|
|
switch ( idx )
|
|
{
|
|
default:
|
|
A_QuakeEx(3.,3.,3.,15,0,10,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.4);
|
|
A_BumpFOV(.98);
|
|
A_SWWMFlash();
|
|
SWWMHandler.DoFlash(self,Color(64,255,192,64),5);
|
|
A_AlertMonsters(swwm_uncapalert?0:2000);
|
|
SWWMUtility.DoKnockback(self,-x,20000.);
|
|
p = Spawn("QuadProj",origin);
|
|
p.target = self;
|
|
p.angle = atan2(x2.y,x2.x);
|
|
p.pitch = asin(-x2.z);
|
|
p.vel = x2*p.speed;
|
|
if ( pointblank || bMelee )
|
|
{
|
|
p.tracer = self;
|
|
p.master = fool;
|
|
p.special1 += bMelee?100:50;
|
|
p.special2 += bMelee?120000:40000;
|
|
p.bAMBUSH = bMelee;
|
|
p.ExplodeMissile(null,null);
|
|
}
|
|
break;
|
|
case 1:
|
|
A_QuakeEx(4.,4.,4.,18,0,10,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.5);
|
|
A_BumpFOV(.97);
|
|
A_SWWMFlash();
|
|
SWWMHandler.DoFlash(self,Color(64,255,192,64),7);
|
|
A_AlertMonsters(swwm_uncapalert?0:3000);
|
|
SWWMUtility.DoKnockback(self,-x,40000.);
|
|
p = Spawn("QuadProj2",origin);
|
|
p.target = self;
|
|
p.angle = atan2(x2.y,x2.x);
|
|
p.pitch = asin(-x2.z);
|
|
p.vel = x2*p.speed;
|
|
if ( pointblank || bMelee )
|
|
{
|
|
p.tracer = self;
|
|
p.master = fool;
|
|
p.special1 = bMelee?150:80;
|
|
p.special2 = bMelee?150000:60000;
|
|
p.bAMBUSH = bMelee;
|
|
p.ExplodeMissile(null,null);
|
|
}
|
|
break;
|
|
case 2:
|
|
A_QuakeEx(6.,6.,6.,25,0,10,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.8);
|
|
A_BumpFOV(.96);
|
|
A_SWWMFlash();
|
|
SWWMHandler.DoFlash(self,Color(64,255,192,64),8);
|
|
A_AlertMonsters(swwm_uncapalert?0:4000);
|
|
SWWMUtility.DoKnockback(self,-x,80000.);
|
|
p = Spawn("QuadProj3",origin);
|
|
p.target = self;
|
|
p.angle = atan2(x2.y,x2.x);
|
|
p.pitch = asin(-x2.z);
|
|
p.vel = x2*p.speed;
|
|
if ( pointblank || bMelee )
|
|
{
|
|
p.tracer = self;
|
|
p.master = fool;
|
|
p.special1 = bMelee?200:100;
|
|
p.special2 = bMelee?180000:80000;
|
|
p.bAMBUSH = bMelee;
|
|
p.ExplodeMissile(null,null);
|
|
}
|
|
break;
|
|
case 3:
|
|
A_QuakeEx(7.,7.,7.,30,0,10,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:1.2);
|
|
A_BumpFOV(.95);
|
|
A_SWWMFlash();
|
|
SWWMHandler.DoFlash(self,Color(64,255,192,64),12);
|
|
A_AlertMonsters(swwm_uncapalert?0:6000);
|
|
SWWMUtility.DoKnockback(self,-x,150000.);
|
|
if ( pointblank || bMelee )
|
|
{
|
|
p = Spawn("QuadProj3",origin);
|
|
p.target = self;
|
|
p.angle = atan2(x2.y,x2.x);
|
|
p.pitch = asin(-x2.z);
|
|
p.vel = x2*p.speed;
|
|
p.tracer = self;
|
|
p.master = fool;
|
|
p.special1 = bMelee?300:200;
|
|
p.special2 = bMelee?200000:100000;
|
|
p.bAMBUSH = bMelee;
|
|
p.ExplodeMissile(null,null);
|
|
}
|
|
else for ( int i=0; i<20; i++ )
|
|
{
|
|
s = FRandom[Quadravol](0,.2);
|
|
a = (i%4)*90 + FRandom[Quadravol](-50,50)*s;
|
|
dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
|
|
p = Spawn("QuadProjSub2",origin);
|
|
p.target = self;
|
|
p.angle = atan2(dir.y,dir.x);
|
|
p.pitch = asin(-dir.z);
|
|
p.vel = dir*p.speed*FRandom[Quadravol](1.,1.5);
|
|
}
|
|
break;
|
|
case 4:
|
|
A_QuakeEx(8.+bExtra,8.+bExtra,8.+bExtra,40,0,10,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:1.5+bExtra*.25);
|
|
A_BumpFOV(.94-bExtra*.1);
|
|
A_SWWMFlash();
|
|
SWWMHandler.DoFlash(self,Color(64,255,192,64),15+bExtra*3);
|
|
A_AlertMonsters(swwm_uncapalert?0:8000);
|
|
if ( bMelee ) SWWMUtility.DoKnockback(self,-x,600000.+bExtra*100000.);
|
|
else if ( pointblank ) SWWMUtility.DoKnockback(self,-x,1500000.+bExtra*500000.);
|
|
else SWWMUtility.DoKnockback(self,-x,400000.+bExtra*100000.);
|
|
if ( fool )
|
|
{
|
|
SWWMUtility.DoKnockback(fool,x,1500000.+bExtra*500000.);
|
|
if ( fool.bCANBLAST && !fool.bDONTBLAST ) fool.bBLASTED = true;
|
|
OnFire.Apply(fool,self,200+bExtra*100);
|
|
fool.DamageMobj(invoker,self,150+bExtra*50,'Fire',DMG_EXPLOSION);
|
|
}
|
|
int numpt = bExtra?15:10;
|
|
for ( int i=0; i<numpt; i++ )
|
|
{
|
|
s = FRandom[Quadravol](0,bExtra?.5:.4);
|
|
a = (i%4)*90 + FRandom[Quadravol](-50,50)*s;
|
|
dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
|
|
p = Spawn("QuadExplArm2",origin);
|
|
p.target = self;
|
|
p.tracer = self;
|
|
p.angle = atan2(dir.y,dir.x);
|
|
p.pitch = asin(-dir.z);
|
|
p.special1 = bExtra*4;
|
|
p.special2 = bExtra*10;
|
|
}
|
|
Spawn("QuadExplLight3",origin);
|
|
break;
|
|
}
|
|
if ( pointblank || bMelee ) self.DamageMobj(invoker,self,bMelee?(5+idx*2):(10+idx*4),'Fire',DMG_EXPLOSION);
|
|
for ( int i=0; i<(4+idx); i++ )
|
|
{
|
|
let s = Spawn("SWWMSmoke",origin);
|
|
s.special1 = 1;
|
|
s.scale *= 1.3;
|
|
s.alpha *= .2;
|
|
s.vel += vel*.5+x*FRandom[Quadravol](5.,15.)+y*FRandom[Quadravol](-.5,.5)+z*FRandom[Quadravol](-.5,.5);
|
|
s.vel *= 1.+.1*idx;
|
|
}
|
|
for ( int i=0; i<(10+2*idx); i++ )
|
|
{
|
|
let s = Spawn("SWWMSpark",origin);
|
|
s.scale *= .3;
|
|
s.alpha *= .4;
|
|
s.vel += vel*.5+x*FRandom[Quadravol](4.,8.)+y*FRandom[Quadravol](-1.,1.)+z*FRandom[Quadravol](-1.,1.);
|
|
s.vel *= 1.+.1*idx;
|
|
}
|
|
invoker.chargelevel = 0;
|
|
invoker.charged = true; // eat it up
|
|
if ( bMelee ) return ResolveState(null);
|
|
return invoker.onehand?ResolveState(FireStates1H[idx]):ResolveState(FireStates[idx]);
|
|
}
|
|
|
|
action void A_Eject()
|
|
{
|
|
invoker.waschambered = invoker.chambered;
|
|
invoker.wascharged = invoker.charged;
|
|
invoker.chambered = (invoker.clipcount>0);
|
|
invoker.clipcount = max(0,invoker.clipcount-1);
|
|
invoker.charged = false;
|
|
if ( invoker.waschambered )
|
|
{
|
|
A_ChangeModel("",2,"","",0,"models",invoker.wascharged?"QuadCell_Used.png":"QuadCell.png",CMDL_USESURFACESKIN,-1);
|
|
if ( invoker.onehand ) A_Overlay(PSP_WEAPON+1,"DropCasing1H");
|
|
else A_Overlay(PSP_WEAPON+1,"DropCasing");
|
|
invoker.wastecycle = 0;
|
|
}
|
|
else if ( !Demolitionist(self) || !(Demolitionist(self).mystats) || swwm_nomapmsg ) return;
|
|
invoker.wastecycle++;
|
|
let s = Demolitionist(self).mystats;
|
|
if ( s.quadegg < 7 )
|
|
{
|
|
if ( (invoker.onehand && (invoker.wastecycle < 12)) || (!invoker.onehand && (invoker.wastecycle < 24)) ) return;
|
|
s.quadegg++;
|
|
}
|
|
else return;
|
|
invoker.wastecycle = 0;
|
|
if (( s.quadegg > 0) && (player == players[consoleplayer]) )
|
|
EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue.LEVER"..1+(s.quadegg-1));
|
|
}
|
|
|
|
action void A_LoadOverlay()
|
|
{
|
|
A_PlayerReload(true);
|
|
A_StartSound("demolitionist/handsdown",CHAN_WEAPON,CHANF_OVERLAP,.8);
|
|
A_ChangeModel("",2,"","",0,"models","QuadCell.png",CMDL_USESURFACESKIN,-1);
|
|
A_Overlay(PSP_WEAPON+1,"LoadOverlay");
|
|
}
|
|
|
|
action void A_Load()
|
|
{
|
|
A_StartSound("demolitionist/handsup",CHAN_WEAPON,CHANF_OVERLAP,.3);
|
|
invoker.clipcount = min(invoker.default.clipcount,invoker.clipcount+1);
|
|
if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) )
|
|
invoker.Ammo1.Amount = max(0,invoker.Ammo1.Amount-1);
|
|
}
|
|
|
|
action bool A_Fill()
|
|
{
|
|
if ( !invoker.chambered || invoker.charged || (invoker.chargelevel >= 5) ) return false;
|
|
invoker.charged = true;
|
|
invoker.chargelevel++;
|
|
return true;
|
|
}
|
|
|
|
action void A_DropCasing()
|
|
{
|
|
let [x, y, z] = SWWMUtility.GetPlayerAxes(self);
|
|
Vector3 origin = SWWMUtility.GetFireOffset(self,-8,8,-16);
|
|
if ( invoker.wascharged )
|
|
{
|
|
let c = Spawn("QuadravolCasing",origin);
|
|
c.angle = angle;
|
|
c.pitch = pitch-90;
|
|
c.vel = x*FRandom[Junk](-2.5,-1.5)+y*FRandom[Junk](.5,1.)-(0,0,FRandom[Junk](2.,5.));
|
|
c.vel += vel*.5;
|
|
return;
|
|
}
|
|
if ( invoker.Ammo1.Amount >= invoker.Ammo1.MaxAmount )
|
|
{
|
|
let a = Inventory(Spawn("QuadravolAmmo",origin));
|
|
a.bDROPPED = true;
|
|
a.DropTime = 30;
|
|
a.bSpecial = a.bSolid = false;
|
|
a.Angle = Angle+190;
|
|
a.VelFromAngle(5.);
|
|
a.Vel.Z = -1.;
|
|
a.Vel += Vel;
|
|
a.bNoGravity = false;
|
|
a.ClearCounters();
|
|
a.OnDrop(self);
|
|
a.vel += (RotateVector((FRandom[Junk](-1.5,.5),FRandom[Junk](-1.5,1.5)),a.angle),FRandom[Junk](-1.5,1.5));
|
|
return;
|
|
}
|
|
invoker.Ammo1.Amount++;
|
|
}
|
|
|
|
action void A_FireBayonet()
|
|
{
|
|
A_StartSound("quadshot/bayonetfire",CHAN_WEAPON,CHANF_OVERLAP);
|
|
A_Melee(60,"misc/slughit",1.5,.6,-.2,MELEE_Rip|MELEE_FleshSound|MELEE_NoRage|MELEE_NoUse,null);
|
|
Vector3 dir = SWWMUtility.Vec3FromAngles(angle,pitch);
|
|
vel += dir*4.;
|
|
A_QuakeEx(4.,4.,4.,8,0,10,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.75);
|
|
A_BumpFOV(1.03);
|
|
}
|
|
|
|
action void A_LeverForward()
|
|
{
|
|
A_StartSound("quadshot/leverforward",CHAN_WEAPON,CHANF_OVERLAP);
|
|
}
|
|
action void A_LeverBack()
|
|
{
|
|
A_StartSound("quadshot/leverback",CHAN_WEAPON,CHANF_OVERLAP);
|
|
}
|
|
|
|
override bool PickupForAmmoSWWM( SWWMWeapon ownedWeapon )
|
|
{
|
|
bool good = Super.PickupForAmmoSWWM(ownedWeapon);
|
|
let Owner = ownedWeapon.Owner;
|
|
if ( (AmmoGive1 == 0) && ((clipcount > 0) || (chambered && !charged)) )
|
|
{
|
|
// let's get this bread
|
|
Inventory cur = Owner.FindInventory(AmmoType1);
|
|
if ( !cur )
|
|
{
|
|
cur = Inventory(Spawn(AmmoType1));
|
|
cur.Amount = 0;
|
|
cur.AttachToOwner(Owner);
|
|
}
|
|
int ingun = clipcount+(chambered&&!charged);
|
|
int maxgiveamt = min(cur.MaxAmount-cur.Amount,ingun);
|
|
int dropamt = ingun-maxgiveamt;
|
|
if ( dropamt > 0 ) cur.CreateTossable(dropamt);
|
|
cur.Amount = min(cur.MaxAmount,cur.Amount+ingun);
|
|
good = true;
|
|
}
|
|
return good;
|
|
}
|
|
override void InitializeWeapon()
|
|
{
|
|
charged = false;
|
|
chambered = false;
|
|
clipcount = default.AmmoGive1; // match the ammo that the pickup should give
|
|
}
|
|
|
|
override void MarkPrecacheSounds()
|
|
{
|
|
Super.MarkPrecacheSounds();
|
|
MarkSound("quadshot/select");
|
|
MarkSound("quadshot/deselect");
|
|
MarkSound("quadshot/selectfast");
|
|
MarkSound("quadshot/deselectfast");
|
|
MarkSound("quadshot/onehand");
|
|
MarkSound("quadshot/twohand");
|
|
MarkSound("quadshot/leverforward");
|
|
MarkSound("quadshot/leverback");
|
|
MarkSound("quadshot/bayonetfire");
|
|
MarkSound("quadshot/bayonetreturn");
|
|
MarkSound("quadshot/load1");
|
|
MarkSound("quadshot/load2");
|
|
MarkSound("quadshot/load3");
|
|
MarkSound("quadshot/load4");
|
|
MarkSound("quadshot/fireone");
|
|
MarkSound("quadshot/firetwo");
|
|
MarkSound("quadshot/firethree");
|
|
MarkSound("quadshot/firefour");
|
|
MarkSound("quadshot/firefive");
|
|
MarkSound("quadshot/casing1");
|
|
MarkSound("quadshot/casing2");
|
|
MarkSound("quadshot/casing3");
|
|
MarkSound("quadshot/casing4");
|
|
MarkSound("quadshot/hit1");
|
|
MarkSound("quadshot/hit2");
|
|
MarkSound("quadshot/hit3");
|
|
MarkSound("quadshot/twohit1");
|
|
MarkSound("quadshot/twohit2");
|
|
MarkSound("quadshot/twohit3");
|
|
MarkSound("quadshot/extrahit");
|
|
MarkSound("quadshot/pointblank");
|
|
MarkSound("quadshot/fly");
|
|
}
|
|
|
|
Default
|
|
{
|
|
Tag "$T_QUADRAVOL";
|
|
Inventory.Icon "graphics/HUD/Icons/W_Quadravol.png";
|
|
Inventory.PickupMessage "$I_QUADRAVOL";
|
|
Obituary "$O_QUADRAVOL";
|
|
SWWMWeapon.Tooltip "$TT_QUADRAVOL";
|
|
SWWMWeapon.GetLine "getquadravol";
|
|
Weapon.SlotNumber 6;
|
|
Weapon.SlotPriority 2.;
|
|
Weapon.SelectionOrder 650;
|
|
Weapon.UpSound "quadshot/select";
|
|
Weapon.AmmoType1 "QuadravolAmmo";
|
|
Weapon.AmmoGive1 3;
|
|
SWWMWeapon.DropAmmoType "SWWMRocketAmmoSmall";
|
|
Quadravol.ClipCount 5;
|
|
Stamina 80000;
|
|
+SWWMWEAPON.NOFIRSTGIVE;
|
|
+SWWMWEAPON.HASSCRTEX;
|
|
+WEAPON.EXPLOSIVE;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A -1;
|
|
Stop;
|
|
Select:
|
|
XZW2 R 1
|
|
{
|
|
A_FullRaise();
|
|
return A_JumpIf(invoker.onehand,"Select1H");
|
|
}
|
|
XZW2 STUVWXYZ 1;
|
|
XZW3 ABCDEFGHI 1;
|
|
XZW3 JKLMN 2;
|
|
Goto Ready;
|
|
Ready:
|
|
XZW2 A 1
|
|
{
|
|
A_Fill(); // just in case
|
|
int flg = WRF_ALLOWRELOAD|WRF_ALLOWUSER1|WRF_ALLOWZOOM;
|
|
if ( (invoker.chargelevel <= 0) && (invoker.Ammo1.Amount <= 0) && (invoker.clipcount <= 0) && !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) ) flg |= WRF_NOPRIMARY;
|
|
invoker.fromfire = false;
|
|
A_WeaponReady(flg);
|
|
if ( player.cmd.buttons&BT_ATTACK )
|
|
invoker.CheckAmmo(EitherFire,true);
|
|
}
|
|
Wait;
|
|
Fire:
|
|
XZW2 A 1
|
|
{
|
|
if ( invoker.chargelevel <= 0 )
|
|
{
|
|
if ( invoker.clipcount > 0 ) return ResolveState("AltFire");
|
|
invoker.fromfire = true;
|
|
return ResolveState("Reload");
|
|
}
|
|
return A_QuadFire();
|
|
}
|
|
FireOne:
|
|
XZW2 A 1;
|
|
XZW3 OPQR 1;
|
|
XZW3 STUV 2;
|
|
Goto Ready;
|
|
FireTwo:
|
|
XZW2 A 1;
|
|
XZW3 WX 1;
|
|
XZW3 YZ 2;
|
|
XZW4 ABCD 3;
|
|
Goto Ready;
|
|
FireThree:
|
|
XZW2 A 1;
|
|
XZW4 EFGH 2;
|
|
XZW4 IJKL 3;
|
|
Goto Ready;
|
|
FireFour:
|
|
XZW2 A 1;
|
|
XZW4 MNOP 2;
|
|
XZW4 QR 3;
|
|
XZW4 ST 4;
|
|
Goto Ready;
|
|
FireFive:
|
|
XZW2 A 1;
|
|
XZW4 UV 2;
|
|
XZW4 WX 3;
|
|
XZW4 YZ 4;
|
|
XZW5 AB 5;
|
|
Goto Ready;
|
|
AltFire:
|
|
XZW2 A 2
|
|
{
|
|
A_PlayerCheckGun();
|
|
return A_JumpIf(invoker.onehand,"AltFire1H");
|
|
}
|
|
XZW5 C 2;
|
|
XZW5 D 2 A_LeverForward();
|
|
XZW5 E 2 A_Eject();
|
|
XZW5 FG 3;
|
|
XZW5 H 2 A_LeverBack();
|
|
XZW5 I 2;
|
|
XZW5 J 2 A_Fill();
|
|
XZW5 K 2;
|
|
XZW5 L 2;
|
|
Goto Ready;
|
|
DropCasing:
|
|
XZWZ ABCDEF 2;
|
|
XZWZ G 0;
|
|
TNT1 A 1 A_DropCasing();
|
|
Stop;
|
|
Reload:
|
|
XZW2 A 2
|
|
{
|
|
if ( (invoker.clipcount >= invoker.default.clipcount) || ((invoker.Ammo1.Amount <= 0) && !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true)) )
|
|
return invoker.onehand?ResolveState("Idle1H"):ResolveState("Idle");
|
|
if ( invoker.onehand ) return ResolveState("Reload1H");
|
|
A_StartSound("quadshot/onehand",CHAN_WEAPON,CHANF_OVERLAP);
|
|
return ResolveState(null);
|
|
}
|
|
XZW5 MNO 3;
|
|
Goto ReloadHold;
|
|
ReloadHold:
|
|
XZW5 P 2 A_LoadOverlay();
|
|
XZW5 QRS 2;
|
|
XZW5 T 2 A_StartSound("quadshot/load",CHAN_WEAPON,CHANF_OVERLAP);
|
|
XZW5 UV 2;
|
|
XZW5 W 2 A_Load();
|
|
XZW5 XYZ 2;
|
|
XZW6 A 2;
|
|
XZW5 P 2
|
|
{
|
|
if ( (invoker.clipcount >= invoker.default.clipcount) || ((invoker.Ammo1.Amount <= 0) && !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true)) )
|
|
return A_JumpIf(invoker.onehand,"ReloadEnd1H");
|
|
if ( invoker.fromfire && (player.cmd.buttons&BT_ATTACK) )
|
|
return ResolveState("ReloadHold");
|
|
invoker.fromfire = false;
|
|
if ( player.cmd.buttons&BT_RELOAD ) return ResolveState("ReloadHold");
|
|
return A_JumpIf(invoker.onehand,"ReloadEnd1H");
|
|
}
|
|
XZW6 B 2 A_StartSound("quadshot/twohand",CHAN_WEAPON,CHANF_OVERLAP);
|
|
XZW6 CDEF 2;
|
|
XZW6 GHIJK 3;
|
|
Goto Ready;
|
|
LoadOverlay:
|
|
XZWZ HIJKLMN 2;
|
|
XZWZ O 0;
|
|
Stop;
|
|
Idle:
|
|
XZW2 A 2 A_StartSound("demolitionist/handsup",CHAN_WEAPON,CHANF_OVERLAP,.8);
|
|
XZW6 LMNO 2;
|
|
XZW6 PQRST 3;
|
|
XZW6 U 2 A_StartSound("quadshot/twohand",CHAN_WEAPON,CHANF_OVERLAP,.6);
|
|
XZW6 VW 2;
|
|
XZW6 XYZ 3;
|
|
XZW7 A 3;
|
|
Goto Ready;
|
|
Zoom:
|
|
XZW2 A 2
|
|
{
|
|
if ( invoker.onehand )
|
|
{
|
|
invoker.onehand = false;
|
|
return ResolveState("Zoom1H");
|
|
}
|
|
A_StartSound("quadshot/onehand",CHAN_WEAPON,CHANF_OVERLAP);
|
|
invoker.onehand = true;
|
|
return ResolveState(null);
|
|
}
|
|
XZW8 Z 2;
|
|
XZW9 ABCDEF 2;
|
|
Goto Ready1H;
|
|
User1:
|
|
XZW2 A 1
|
|
{
|
|
A_StartSound("demolitionist/handsup",CHAN_WEAPON,CHANF_OVERLAP);
|
|
return A_JumpIf(invoker.onehand,"User11H");
|
|
}
|
|
XZW7 BCD 1;
|
|
XZW7 E 2
|
|
{
|
|
A_PlayerMelee();
|
|
A_StartSound("demolitionist/wswing",CHAN_WEAPON,CHANF_OVERLAP);
|
|
}
|
|
XZW7 FG 2;
|
|
XZW7 H 2 A_Parry(6);
|
|
XZW7 I 1;
|
|
XZW7 J 1 A_JumpIf(A_Melee(20,"demolitionist/whitm",1.2,.6,.2),"Bayonet");
|
|
XZW7 KLM 1;
|
|
XZW7 NOPQRSTUVWX 2;
|
|
Goto Ready;
|
|
Bayonet:
|
|
XZW7 J 1 A_FireBayonet();
|
|
XZW7 YZ 2 A_JumpIf((player.cmd.buttons&BT_ATTACK)&&(invoker.chargelevel>0),"BayonetFire");
|
|
XZW8 ABC 2 A_JumpIf((player.cmd.buttons&BT_ATTACK)&&(invoker.chargelevel>0),"BayonetFire");
|
|
XZW8 D 1 A_StartSound("quadshot/bayonetreturn",CHAN_WEAPON,CHANF_OVERLAP);
|
|
XZW8 EFGH 1;
|
|
XZW8 IJKL 2;
|
|
Goto Ready;
|
|
BayonetFire:
|
|
#### # 1 A_QuadFire(true);
|
|
XZW8 MNO 1;
|
|
XZW8 P 1 A_StartSound("quadshot/bayonetreturn",CHAN_WEAPON,CHANF_OVERLAP);
|
|
XZW8 QRST 1;
|
|
XZW8 UVWXY 2;
|
|
Goto Ready;
|
|
Deselect:
|
|
XZW2 A 1
|
|
{
|
|
A_StartSound(invoker.onehand?"quadshot/deselectfast":"quadshot/deselect",CHAN_WEAPON,CHANF_OVERLAP);
|
|
return A_JumpIf(invoker.onehand,"Deselect1H");
|
|
}
|
|
XZW2 BCDEFGHIJKLMNOPQ 1;
|
|
XZW2 R -1 A_FullLower();
|
|
Stop;
|
|
Flash:
|
|
XZW0 A 2 Bright
|
|
{
|
|
let psp = player.GetPSprite(PSP_FLASH);
|
|
psp.frame = Random[GunFlash](0,9)+invoker.onehand*10;
|
|
let l = Spawn("SWWMWeaponLight",pos);
|
|
l.target = self;
|
|
}
|
|
Stop;
|
|
// one-handed states
|
|
Select1H:
|
|
XZW9 N 2 A_FullRaise();
|
|
XZW9 OPQRSTUVW 2;
|
|
Goto Ready1H;
|
|
Ready1H:
|
|
XZW9 G 1
|
|
{
|
|
A_Fill(); // just in case
|
|
int flg = WRF_ALLOWRELOAD|WRF_ALLOWUSER1|WRF_ALLOWZOOM;
|
|
if ( (invoker.chargelevel <= 0) && (invoker.Ammo1.Amount <= 0) && (invoker.clipcount <= 0) && !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) ) flg |= WRF_NOPRIMARY;
|
|
invoker.fromfire = false;
|
|
A_WeaponReady(flg);
|
|
if ( player.cmd.buttons&BT_ATTACK )
|
|
invoker.CheckAmmo(EitherFire,true);
|
|
}
|
|
Wait;
|
|
FireOne1H:
|
|
XZW9 G 1;
|
|
XZW9 XYZ 1;
|
|
XZWA A 1;
|
|
XZWA BCDE 2;
|
|
Goto Ready1H;
|
|
FireTwo1H:
|
|
XZW9 G 1;
|
|
XZWA FG 1;
|
|
XZWA HI 2;
|
|
XZWA JKLM 3;
|
|
Goto Ready1H;
|
|
FireThree1H:
|
|
XZW9 G 1;
|
|
XZWA NOPQ 2;
|
|
XZWA RSTU 3;
|
|
Goto Ready1H;
|
|
FireFour1H:
|
|
XZW9 G 1;
|
|
XZWA VWXY 2;
|
|
XZWA Z 3;
|
|
XZWB A 3;
|
|
XZWB BC 4;
|
|
Goto Ready1H;
|
|
FireFive1H:
|
|
XZW9 G 1;
|
|
XZWB DE 2;
|
|
XZWB FG 3;
|
|
XZWB HI 4;
|
|
XZWB JK 5;
|
|
Goto Ready1H;
|
|
AltFire1H:
|
|
XZW9 G 2;
|
|
XZWB L 2;
|
|
XZWB M 1
|
|
{
|
|
A_LeverForward();
|
|
A_Eject();
|
|
}
|
|
XZWB NO 1;
|
|
XZWB P 2 A_StartSound("demolitionist/swing",CHAN_WEAPON,CHANF_OVERLAP,pitch:.6);
|
|
XZWB QR 2;
|
|
XZWB S 2 A_StartSound("demolitionist/swing",CHAN_WEAPON,CHANF_OVERLAP,pitch:.5);
|
|
XZWB TUV 2;
|
|
XZWB W 2 A_StartSound("demolitionist/swing",CHAN_WEAPON,CHANF_OVERLAP,pitch:.4);
|
|
XZWB XY 1;
|
|
XZWB Z 0 A_LeverBack(); // skip frame to undo 360 degree rotation
|
|
XZWF M 1;
|
|
XZWC A 2;
|
|
XZWC B 2 A_Fill();
|
|
XZWC CDEF 3;
|
|
Goto Ready1H;
|
|
DropCasing1H:
|
|
XZWZ PQRSTUVW 1;
|
|
XZWZ X 0;
|
|
TNT1 A 1 A_DropCasing();
|
|
Stop;
|
|
Idle1H:
|
|
XZW9 G 2 A_StartSound("demolitionist/handsup",CHAN_WEAPON,CHANF_OVERLAP,.8);
|
|
XZWC JKLM 2;
|
|
XZWC NOPQR 3;
|
|
XZWC STU 2;
|
|
XZWC VWX 3;
|
|
XZWC Y 3;
|
|
Goto Ready1H;
|
|
Zoom1H:
|
|
XZW9 G 2;
|
|
XZWE XYZ 2;
|
|
XZWF AB 2;
|
|
XZWF C 1 A_StartSound("quadshot/twohand",CHAN_WEAPON,CHANF_OVERLAP);
|
|
XZWF DEFG 1;
|
|
XZWF HIJKL 2;
|
|
Goto Ready;
|
|
User11H:
|
|
XZW9 G 1;
|
|
XZWC Z 1;
|
|
XZWD AB 1;
|
|
XZWD C 2
|
|
{
|
|
A_PlayerMelee();
|
|
A_StartSound("demolitionist/wswing",CHAN_WEAPON,CHANF_OVERLAP);
|
|
}
|
|
XZWD DE 2;
|
|
XZWD F 2 A_Parry(6);
|
|
XZWD G 1;
|
|
XZWD H 1 A_JumpIf(A_Melee(20,"demolitionist/whitm",1.2,.6,.2),"Bayonet1H");
|
|
XZWD IJK 1;
|
|
XZWD LMNOPQRSTUV 2;
|
|
Goto Ready1H;
|
|
Bayonet1H:
|
|
XZWD H 1 A_FireBayonet();
|
|
XZWD WX 2 A_JumpIf((player.cmd.buttons&BT_ATTACK)&&(invoker.chargelevel>0),"BayonetFire1H");
|
|
XZWD YZ 2 A_JumpIf((player.cmd.buttons&BT_ATTACK)&&(invoker.chargelevel>0),"BayonetFire1H");
|
|
XZWE A 2 A_JumpIf((player.cmd.buttons&BT_ATTACK)&&(invoker.chargelevel>0),"BayonetFire1H");
|
|
XZWE B 1 A_StartSound("quadshot/bayonetreturn",CHAN_WEAPON,CHANF_OVERLAP);
|
|
XZWE CDEF 1;
|
|
XZWE GHIJ 2;
|
|
Goto Ready1H;
|
|
BayonetFire1H:
|
|
#### # 1 A_QuadFire(true);
|
|
XZWE KLM 1;
|
|
XZWE N 1 A_StartSound("quadshot/bayonetreturn",CHAN_WEAPON,CHANF_OVERLAP);
|
|
XZWE OPQR 1;
|
|
XZWE STUVW 2;
|
|
Goto Ready1H;
|
|
Deselect1H:
|
|
XZW9 GHIJKLM 2;
|
|
XZW9 N -1 A_FullLower();
|
|
Stop;
|
|
Reload1H:
|
|
XZW9 G 2;
|
|
XZWC G 3;
|
|
Goto ReloadHold;
|
|
ReloadEnd1H:
|
|
XZW5 P 2;
|
|
XZWC HI 3;
|
|
Goto Ready1H;
|
|
}
|
|
}
|