ACTOR OrderExplosiveHUD : Inventory { Inventory.MaxAmount 1 }

ACTOR PistolBoomProjectile : FastProjectile
{
	Speed 184
	Radius 4
	Height 8
	Damage 10
	DAmageType "ExplosiveDamage"
	States
	{
		Spawn:
		TNT1 A 1
		Loop
		Death:
		// TNT1 A 0 A_PlaySoundEx("orderpistol/boom","Body")
		TNT1 A 0 A_Explode(35,64)
		TNT1 A 0 Radius_Quake(2,8,0,8,0)
		TNT1 A 0 A_SpawnItemEx("ShakeItSmaller",0,0,0)
		TNT1 A 0 A_PlaySound("pistol/puffboom")
		TNT1 A 0 A_Stop
		TNT1 A 0 A_SpawnItemEx("PistolBoomFX",0,0,0)
		Stop
	}
}

ACTOR PistolBoomFX
{
	+NOBLOCKMAP
	+NOGRAVITY
	+CLIENTSIDEONLY
	Renderstyle Add
	Scale 0.35
	States
	{
		Spawn:
		TNT1 A 0
		TNT1 AAAA 0 A_SpawnItemEx("CasingSpark",random(-1,1),random(-1,1),random(-1,1),random(-5,5),random(-5,5),random(-5,5))
		TNT1 AAAA 0 A_SpawnItemEx("CasingSpark",random(-1,1),random(-1,1),random(-1,1),random(-10,10),random(-10,10),random(-10,10))
		TNT1 AA 0 A_SpawnItemEx("QExplosionSmoke",random(-2,2),random(-2,2),random(-2,2),random(-4,4),random(-4,4),random(-4,-2))
		TNT1 AA 0 A_SpawnItemEx("QExplosionSmoke",random(-2,2),random(-2,2),random(-2,2),random(-4,4),random(-4,4),random(2,4))
		EXP5 ABCDEFGHIJK 1 bright A_FadeOut(0.1)
		Stop
		//TNT1 AAAAAAAA 0 A_SpawnItemEx("CasingSpark",random(-2,2),random(-2,2),random(-2,2),random(-6,6),random(-6,6),random(-6,6))
		//TNT1 AAAAAAAA 0 A_SpawnItemEx("CasingSmoke",random(-2,2),random(-2,2),random(-2,2),random(-6,6),random(-6,6),random(-6,6))
	}
}

ACTOR PistolMagazine
{
	BounceType "Doom"
	BounceFactor 0.6
	WallBounceFactor 0.6
	BounceSound "magazine/bounce"
	Projectile
	-NOGRAVITY
	-SOLID
	+CLIENTSIDEONLY
	+MOVEWITHSECTOR
	+MISSILE
	Scale 0.15
	States
	{
	Spawn:
	PMAG ABCDEFGHIJKLMNOPQR 1
	Loop
	Death:
	TNT1 A 0
	TNT1 A 0 A_Jump(255,"Lay1","Lay2")
	Goto Lay1
	
	Lay1:
	PMAG FFF 300
	CAS2 A 0 A_JumpIf(0 == (ACS_ExecuteWithResult(823,0,0,0)), "Vanish1")
	Loop
	
	Vanish1:
	CHON FFFFFFFFFF 1 A_FadeOut(0.1)
	Stop
	
	Lay2:
	PMAG NNN 300
	CAS2 A 0 A_JumpIf(0 == (ACS_ExecuteWithResult(823,0,0,0)), "Vanish2")
	Loop
	
	Vanish2:
	CHON NNNNNNNNNN 1 A_FadeOut(0.1)
	Stop
	}
}

ACTOR PistolMagShooter
{
	Speed 5
	PROJECTILE
	+NOCLIP
	+CLIENTSIDEONLY
	States
	{
	Spawn:
        TNT1 A 0
		TNT1 A 0 A_CustomMissile("PistolMagazine",-5,0,0,2,90)
		TNT1 A 1
		Stop
	}
}

ACTOR FlungMagazine : PistolMagazine
{
	Speed 20
}

ACTOR PistolMagFlinger
{
	Speed 5
	PROJECTILE
	+NOCLIP
	+CLIENTSIDEONLY
	States
	{
	Spawn:
        TNT1 A 0
		TNT1 A 0 A_CustomMissile("FlungMagazine",5,0,-15,2,5)
		TNT1 A 1
		Stop
	}
}

ACTOR OrderPrimary : Ammo
{
  Inventory.Amount 1
  Inventory.MaxAmount 20
  Inventory.Icon "CLIPA0"
  +INVENTORY.IGNORESKILL
}

ACTOR OrderSecondary : Ammo
{
  Inventory.PickupMessage "You picked up a mag of Order Pistol ammunition." // "Picked up a clip."
  Inventory.PickupSound "bullpup/magin"
  Inventory.Amount 10
  Inventory.MaxAmount 180
  Ammo.BackpackAmount 40
  Ammo.BackpackMaxAmount 260
  Inventory.Icon "CLIPA0"
  +INVENTORY.IGNORESKILL
  States
  {
  Spawn:
    CLIP A -1
    Stop
  }
}

ACTOR BackToEmpty : Inventory
{
	Inventory.MaxAmount 1
}

ACTOR "Order Pistol Explosive" : Inventory
{
	Inventory.MaxAmount 1
}

ACTOR "Order Pistol" : Weapon
{
  +WEAPON.NOAUTOAIM
  Weapon.AmmoUse 1
  Weapon.AmmoGive2 60
  Weapon.BobStyle Smooth
  Weapon.BobSpeed 2.5
  Weapon.BobRangeX 0.5
  Weapon.BobRangeY 0.3
  Weapon.AmmoType "OrderPrimary"
  Weapon.AmmoType2 "OrderSecondary"
  Obituary "\cJ%k \cG> \cKOrder Pistol \cG> \cJ%o"
  Inventory.Pickupmessage "You picked up the Order Pistol."
  Inventory.PickupSound "ppsh/pickup"
	//$Category ZT2 - Weapons
	//$Title PPSH-41
	//$Sprite PPSHF0
  Tag "The Order Pistol"
  Scale 0.75
  +WEAPON.NOAUTOFIRE
  +INVENTORY.UNDROPPABLE
  +WEAPON.AMMO_OPTIONAL
  States
  {
  Ready:
	PPSS A 0 A_JumpIfInventory("DoBlocking",1,"QuickMelee")
    PPSS A 0 A_JumpIfInventory("PendingQuickness",1,"ToQuick")
	PPSS A 0 A_JumpIfInventory("IsReloading",1,"ReloadCheck")
	PPSS A 0 A_TakeInventory("BackToEmpty",1)
	PPSS A 0 A_JumpIfInventory("OrderPrimary",1,1)
	Goto ReadyEmpty
    ORDD A 1 A_WeaponReady
    Loop
  ReadyEmpty:
	ORDD M 1 A_WeaponReady
	Goto Ready
  ToQuick:
	TNT1 A 0 ACS_NamedExecute("ProcessQuick",0,0,0,0)
	GoTo Ready+5
  QuickMeleeEmpty:
	 ORDS HGFE 1
	 GoTo QuickMelee+6
  QuickMelee:
	ORDS A 0 A_JumpIfInventory("OrderPrimary",1,1)
	Goto QuickMeleeEmpty
	ORDS DCBA 1
	TNT1 AAA 3
	MCFI E 1
	MCFI E 0 A_PlaySoundEx("machete/fire","Weapon")
	MCFI FG 1
    MCFI H 0 A_CustomPunch(2*random(1, 10), TRUE, 0, "ZTMeleePuff")
	MCFI HIJ 1
	MCFI K 2
	TNT1 AAA 3
	ORDS ABCD 1
	TNT1 A 0 A_TakeInventory("DoBlocking",1)
	Goto Ready+5
  Profanity:
	9MRL A 0 ACS_ExecuteAlways(820,0,2,0,0)
	ORFU ABC 2
	ORFU D 26
	ORFU CBA 2
	PPFU A 0 A_TakeInventory("FuckYou",1)
	Goto Ready
  QMEmpty:
	ORDN A 0 A_PlaySoundEx("fist/swing","Weapon")
	ORDN ABCDF 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	PPBL D 0 A_CustomPunch (random(4,5),1,0,"BlockPuff")
	ORDN HIJKL 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	TNT1 A 2
	ORDS EFGH 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	PPBL A 0 A_TakeInventory("DoBlocking",1)
	Goto Ready
  ToReady:
	NULL A 0
	Goto Ready
	NULL AAA 0
	NULL A 0 A_PlaySoundEx("orderpistol/dryfire","SoundSlot6")
	Goto Ready
  Deselect:
	 ORDS A 0 A_JumpIfInventory("OrderPrimary",1,1)
	 Goto DeselectEmpty
	 ORDS DCBA 1
	 ORDS A 0 ACS_NamedExecuteAlways("SwapWeaponType",0,-1,0,0)
     TNT1 AAAAAAAAAA 0 A_Lower
	 TNT1 A 1 A_Lower
     Goto Deselect+10
  DeselectEmpty:
	 ORDS HGFE 1
	 ORDS A 0 ACS_NamedExecuteAlways("SwapWeaponType",0,-1,0,0)
     TNT1 AAAAAAAAAA 0 A_Lower
	 TNT1 A 1 A_Lower
     Goto DeselectEmpty+6
  TakeDualies:
	TNT1 A 0 A_SelectWeapon("DualOrderPistols")
	Goto Deselect
  Select:
	 TNT1 A 0 A_JumpIfInventory("DualOrderPistols",1,"TakeDualies")
	 TNT1 A 0 A_SetCrosshair(15)
	 TNT1 AA 0 A_Raise
	 TNT1 A 1 A_WeaponReady
	 TNT1 A 0 A_PlaySoundEx("orderpistol/select","SoundSlot6")
	 Goto SelectAnim
  SelectAnim:
	ORDS A 0 ACS_NamedExecuteAlways("SwapWeaponType",0,1,0,0)
	ORDS A 0 A_JumpIfInventory("OrderPrimary",1,1)
	Goto SelectEmpty
	ORDS ABCD 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	Goto Ready
  SelectEmpty:
	ORDS EFGH 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	Goto Ready
  //========================================================================
  // RELOAD CHECKING
  //========================================================================
  
  ReloadCheck:
	 TNT1 A 0 A_TakeInventory("IsReloading",1)
	 TNT1 A 0 A_JumpIfInventory("Perk_Rifleman",1,"ReloadCheckPerk")
	 TNT1 A 0 A_JumpIfInventory("OrderPrimary",10,"ToReady")
	 TNT1 A 0 A_JumpIfInventory("OrderSecondary",1,"ReloadAnim")
	 Goto ToReady
	
  ReloadCheckPerk:
	 TNT1 A 0 A_JumpIfInventory("PerkLevel",10,"ReloadCheckPerk10")
	 TNT1 A 0 A_JumpIfInventory("OrderPrimary",15,"ToReady")
	 TNT1 A 0 A_JumpIfInventory("OrderSecondary",1,"ReloadAnim")
	 Goto ToReady
	 
  ReloadCheckPerk10:
	 TNT1 A 0 A_JumpIfInventory("OrderPrimary",20,"ToReady")
	 TNT1 A 0 A_JumpIfInventory("OrderSecondary",1,"ReloadAnim")
	 Goto ToReady
  
  //========================================================================
  ReloadAnim:
	 9MRL A 0 ACS_ExecuteAlways(820,0,0,0,0)
	 9MRL A 0 A_JumpIfInventory("OrderPrimary",1,1)
	 Goto ReloadAnimEmpty
	 NORD A 0 A_SetPitch(pitch+0.5)
	 NORD A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORD A 0 A_SetPitch(pitch+0.4)
	 NORD B 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORD A 0 A_SetPitch(pitch+0.3)
	 NORD C 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORD A 0 A_SetPitch(pitch+0.25)
	 NORD D 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORD A 0 A_SetPitch(pitch+0.25)
	 NORD F 0 A_PlaySoundEx("orderpistol/magout","SoundSlot6")
	 NORD E 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORD A 0 A_SetPitch(pitch+0.25)
	 NORD F 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 BPSS A 0 A_FireCustomMissile("PistolMagFlinger",5,0,4,-3)
	 NORD G 0 A_SetPitch(pitch-1)
	 NORD G 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORD G 0 A_SetPitch(pitch-0.75)
	 NORD H 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORD G 0 A_SetPitch(pitch-0.4)
	 NORD I 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORD G 0 A_SetPitch(pitch-0.2)
	 NORD J 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORD IJKLM 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRL R 0 A_PlaySoundEx("cloth/knife","SoundSlot6")
	 NORD NOPQRS 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRL F 0 A_PlaySoundEx("orderpistol/magin","SoundSlot6")
	 NORD TU 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 Goto CalculateCheck
  ReloadAnimOld:
	 9MRL A 0 ACS_ExecuteAlways(820,0,0,0,0)
	 9MRL A 0 A_JumpIfInventory("OrderPrimary",1,1)
	 Goto ReloadAnimEmpty
	 ORRL ABCDE 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRL F 0 A_PlaySoundEx("orderpistol/magout","SoundSlot6")
	 ORRL FGHI 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 BPSS A 0 A_FireCustomMissile("PistolMagShooter",5,0,16,-3)
	 ORRL JKLMNOPQ 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRL R 0 A_PlaySoundEx("cloth/knife","SoundSlot6")
	 ORRL RSTUV 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRL WX 2 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRL F 0 A_PlaySoundEx("orderpistol/magin","SoundSlot6")
	 Goto CalculateCheck
  ReloadAnimEmpty:
	 NORF A 0 A_SetPitch(pitch+0.5)
	 NORF A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORF A 0 A_SetPitch(pitch+0.4)
	 NORF B 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORF A 0 A_SetPitch(pitch+0.3)
	 NORF C 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORF A 0 A_SetPitch(pitch+0.25)
	 NORF D 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORF A 0 A_SetPitch(pitch+0.25)
	 NORF F 0 A_PlaySoundEx("orderpistol/magout","SoundSlot6")
	 NORF E 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORF A 0 A_SetPitch(pitch+0.25)
	 NORF F 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 BPSS A 0 A_FireCustomMissile("PistolMagFlinger",5,0,4,-3)
	 NORF G 0 A_SetPitch(pitch-1)
	 NORF G 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORF G 0 A_SetPitch(pitch-0.75)
	 NORF H 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORF G 0 A_SetPitch(pitch-0.4)
	 NORF I 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORF G 0 A_SetPitch(pitch-0.2)
	 NORF J 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORF IJKLM 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRF R 0 A_PlaySoundEx("cloth/knife","SoundSlot6")
	 NORF NOPQRS 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRF F 0 A_PlaySoundEx("orderpistol/magin","SoundSlot6")
	 NORF TU 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 TNT1 A 0 A_GiveInventory("BackToEmpty",1)
	 Goto CalculateCheck
  //========================================================================
  // AMMO CALCULATION
  //========================================================================
  CalculateCheck:
	 TNT1 A 0
	 TNT1 A 0 A_JumpIfInventory("Perk_Rifleman",1,"LevelCheck")			// If we're a rifleman then give us an ammo boost
	 Goto CalculateAmmo
	 
  LevelCheck:
	 TNT1 A 0 A_JumpIfInventory("PerkLevel",10,"CalculateAmmoPerk10")
	 Goto CalculateAmmoPerk
	 
  CalculateAmmo:
     TNT1 A 0 A_JumpIfInventory("OrderSecondary",1,2)
	 Goto ReloadEnd
	 TNT1 AAA 0
	 TNT1 A 0 A_JumpIfInventory("OrderPrimary",10,"ReloadEnd")
	 TNT1 A 0 A_TakeInventory("OrderSecondary",1)
	 TNT1 A 0 A_GiveInventory("OrderPrimary",1)
	 Loop
	 
  CalculateAmmoPerk:
     TNT1 A 0 A_JumpIfInventory("OrderSecondary",1,2)
	 Goto ReloadEnd
	 TNT1 AAA 0
	 TNT1 A 0 A_JumpIfInventory("OrderPrimary",15,"ReloadEnd")
	 TNT1 A 0 A_TakeInventory("OrderSecondary",1)
	 TNT1 A 0 A_GiveInventory("OrderPrimary",1)
	 Loop
	 
  CalculateAmmoPerk10:
     TNT1 A 0 A_JumpIfInventory("OrderSecondary",1,2)
	 Goto ReloadEnd
	 TNT1 AAA 0
	 TNT1 A 0 A_JumpIfInventory("OrderPrimary",20,"ReloadEnd")
	 TNT1 A 0 A_TakeInventory("OrderSecondary",1)
	 TNT1 A 0 A_GiveInventory("OrderPrimary",1)
	 Loop
  //========================================================================
  ReloadEnd:
	 NORE Z 0 A_JumpIfInventory("BackToEmpty",1,"ReloadEndEmpty")
	 NORD VW 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORE ABCDEFGHIJK 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 Goto Ready
  ReloadEndOld:
	 ORRL Z 0 A_JumpIfInventory("BackToEmpty",1,"ReloadEndEmpty")
	 ORRL Z 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRM BCDEFGH 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 Goto Ready
  ReloadEndEmpty:
	 NORF VW 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NORG ABCDEFGH 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 Goto SlidePullTwo
  SlidePullTwo:
	 NOSP A 0 A_Jump(128,"SlidePullOne")
	 NOSP ABCDEFG 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRO Q 0 A_PlaySoundEx("orderpistol/slideback","SoundSlot6")
	 NOSP HIJK 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRO U 0 A_PlaySoundEx("orderpistol/slidefwd","SoundSlot5")
	 NOSP L 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NOSP M 2 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NOSP N 3 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 NOSP OPQRS 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 Goto Ready
  SlidePullOne:
	 ORRO IJKLMNOP 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRO Q 0 A_PlaySoundEx("orderpistol/slideback","SoundSlot6")
	 ORRO Q 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRO R 2 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRO S 3 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRO T 4 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 ORRO U 0 A_PlaySoundEx("orderpistol/slidefwd","SoundSlot6")
	 ORRO UVWXY 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 Goto Ready
  Fire:
	 PPFI A 0 A_JumpIfInventory("OrderPrimary",1,1)
	 Goto ToReady+2
	 PPFI A 0 A_AlertMonsters
	 Goto ActualFire
  ActualFire:
	PPFI A 0 A_FireCustomMissile("MuzzleSmokeFX",0,0,4,0)
	 PPFI A 0 A_JumpIfInventory("Order Pistol Explosive",1,"ActualFireBoom")
	 PPFI A 0 A_FireBullets (ACS_ExecuteWithResult(566,2,0,0), ACS_ExecuteWithResult(566,2,0,0), 1, 10, "BulletPuff2")
	 PPFI A 0 A_PlaySound("orderpistol/fire", CHAN_WEAPON)
	 PPFI A 0 A_FireCustomMissile("GunTracer",2 + random(-2,2),0,8,0,0,random(-2,2))
	 BPSS A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-3)
	 Goto ContinueFire
  ActualFireBoom:
	 PPFI A 0 A_FireCustomMissile("PistolBoomProjectile",random(-2,2),1,0,0,0,random(-2,2))
	 PPFI A 0 A_PlaySound("orderpistol/fireboom", CHAN_WEAPON)
	 BPSS A 0 A_FireCustomMissile("ExplosiveCaseSpawn",5,0,16,-3)
	 Goto ContinueFire
  ContinueFire:
	 TNT1 A 0 A_SpawnItemEx("ShooterLight",0,0,0)
	 PPFI A 0 A_SetPitch(pitch-1.0)
	 PPFI A 0 A_Jump(255,"Flash1","Flash2","Flash3")
	 Goto Flash1
  Flash1:
	 ORDD B 1 bright A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 Goto FireEnd
  Flash2:
	 ORDD C 1 bright A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 Goto FireEnd
  Flash3:
	 ORDD H 1 bright A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
	 Goto FireEnd
  FireEnd:
	 PPFI A 0 A_SetPitch(pitch+0.6)
	 PPFI A 0 A_JumpIfInventory("OrderPrimary",1,1)
	 Goto FireEmpty
	 ORDD DEFG 1 A_WeaponReady(WRF_NOSWITCH)
	 Goto Ready
  FireEmpty:
	 ORDD HIJK 1 A_WeaponReady(WRF_NOSWITCH)
	 Goto ReadyEmpty
  Spawn:
    PPSH F -1
    Stop
  }
}