Code: Select all
Class DualPistols : Weapon
{
Default {}
action void SetWeaponState(statelabel st,int layer=PSP_WEAPON) // Credits goes to Matt ==> Weapon input shortcuts
{
if(player) player.setpsprite(layer,invoker.findstate(st));
}
action bool PressingFire(){return player.cmd.buttons & BT_ATTACK;}
action bool PressingAltFire(){return player.cmd.buttons & BT_ALTATTACK;}
States
{
Ready:
DP2G A 1
{
if(PressingFire()) SetWeaponState("FireLeftGun");
if(PressingAltFire()) SetWeaponState("FireRightGun");
A_WeaponReady(WRF_NOFIRE|WRF_ALLOWRELOAD);
}
Loop;
Fire:
FireLeftGun:
DP2G A 0 A_JumpIfInventory("Pistol2Ammo",1,1);
Goto DryFire;
"####" G 1 //2
{
A_GunFlash("Flash_L");
A_AlertMonsters();
A_PlaySound("Weapons/Pistol/Fire",CHAN_WEAPON);
A_FireBullets(0,0,1,Random(7,8),"NewBulletPuff",0,2048,"BulletTracer",0,-10);
A_SetPitch(Pitch - 0.4);
}
"####" H 1; //2
"####" I 1
{
A_SetPitch(Pitch + 0.2);
A_FireProjectile("PistolCasingSpawner",0,0,-9,1,FPF_NOAUTOAIM);
}
"####" K 1;
"####" J 1 A_SetPitch(Pitch + 0.2);
"####" K 1;
Goto Ready;
FireRightGun:
DP2G A 0 A_JumpIfInventory("PistolAmmo",1,1);
Goto DryFire;
"####" B 1 //2
{
A_GunFlash("Flash_R");
A_AlertMonsters();
A_PlaySound("Weapons/Pistol/Fire",CHAN_WEAPON);
A_FireBullets(0,0,1,Random(7,8),"NewBulletPuff",0,2048,"BulletTracer",0,10);
A_SetPitch(Pitch - 0.4);
}
"####" C 1; //2
"####" D 1
{
A_SetPitch(Pitch + 0.2);
A_FireProjectile("PistolCasingSpawner",0,0,18,1,FPF_NOAUTOAIM);
}
"####" E 1;
"####" E 1 A_SetPitch(Pitch + 0.2);
"####" E 1;
Goto Ready;
DryFire:
DP2G A 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH);
Goto Ready;
Flash_L:
DP2G G 1 Bright A_Light1;
Goto LightDone;
Flash_R:
DP2G B 1 Bright A_Light1;
Goto LightDone;
}
}