ACTOR DualPistols : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip1"
	Weapon.AmmoType2 "BDDualPistolAmmo"
	Obituary "%o was shot down by %k's pistol."
    AttackSound "None"
	weapon.selectionorder 1900
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "You got dual pistols! (Slot 2)"
    +WEAPON.NOAUTOAIM
	+WEAPON.NOALERT
	+WEAPON.NOAUTOFIRE
	+WEAPON.WIMPY_WEAPON
	+WEAPON.NO_AUTO_SWITCH
    +FORCEXYBILLBOARD
	Scale 0.9
	Tag "Dual Pistols"
	Dropitem "PistolSpawner"
	States
	{
	Ready3:
	Ready:
        PI2G A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        PI2G A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		PI2G A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		PI2G A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        PI2G A 0 A_JumpIfInventory("Reloading",1,"Reload")
		PI2G A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		PI2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		PI2G A 0 A_JumpIfInventory("Unloading",1,"Unload")
		PI2G A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		PI2G A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Loop

	DualWield:
		PI2G A 1
		PI2G A 0 A_GiveInventory("BrutalPistol",1)
		PI2G A 0 A_Takeinventory("StartDualWield",1)
		PI2G A 0 A_SelectWeapon("BrutalPistol")
		Goto Ready

	StartSprint:
		PI2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		SHTN A 0 A_Takeinventory("Zoomed",1)
        SHTN A 0 A_ZoomFactor(1.0)
		SHTN A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(0)
		SHTN A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.

	Sprinting:
		PI2G A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		PI2G A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		PI2G A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		PI2G A 1 offset(0,38) A_SetPitch(pitch -0.5)
		PI2G A 1 offset(3,36) A_SetPitch(pitch -0.5)
		PI2G A 1 offset(6,34) A_SetPitch(pitch -0.5)
		PI2G A 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 1)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        SMGG A 0 A_JumpIfInventory("Reloading",1,"Reload")

		PI2G A 1 offset(9,34) A_SetPitch(pitch +0.5)
		PI2G A 1 offset(6,36) A_SetPitch(pitch +0.5)
		PI2G A 1 offset(3,38) A_SetPitch(pitch +0.5)
		PI2G A 1 offset(0,38) A_SetPitch(pitch +0.5)
		PI2G A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		PI2G A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		PI2G A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 1)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        SMGG A 0 A_JumpIfInventory("Reloading",1,"Reload")

		PLAY A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.
		SMGG A 0 A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint

	StopSprint:
		PI2G A 0 A_JumpIfInventory("PowerStrength", 1, 2)
		PI2G A 0 A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		PI2G A 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		Goto Ready

	StopSprintTired:
		PI2G A 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		PI2G A 0 A_PlaySound("Tired", 2)
		Goto Ready

	Deselect:
        PIS2 BA 1
		TNT1 AAAAAAAAAAAA 0 A_Lower
		PI2G A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 1 A_Lower
		Wait

	Select:
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_TakeInventory("FistsSelected", 1)
		TNT1 A 0 A_TakeInventory("ShotgunSelected", 1)
		TNT1 A 0 A_TakeInventory("MinigunSelected", 1)
		TNT1 A 0 A_TakeInventory("SSGSelected", 1)
		TNT1 A 0 A_TakeInventory("RocketLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("GrenadeLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("PlasmaGunSelected", 1)
		TNT1 A 0 A_TakeInventory("RailGunSelected", 1)
		TNT1 A 0 A_TakeInventory("RevenantLauncherSelected", 1)
		TNT1 A 0 A_GiveInventory("SubMachineGunSelected", 1)
		TNT1 A 0 A_GiveInventory("HasDualPistol",1)
		TNT1 A 0 A_TakeInventory("BFG10KSelected", 1)
		TNT1 A 0 A_TakeInventory("BFGSelected", 1)
		TNT1 A 0 A_TakeInventory("FlameCannonSelected", 1)
		TNT1 A 0 A_TakeInventory("SawSelected", 1)
		PI2G A 0 A_Takeinventory("HasBarrel",1)
		PIST F 0 A_Takeinventory("BrutalPistol",1)
        PI2G A 0 A_GunFlash
		TNT1 A 1 A_Raise
		TNT1 AAAAAAAAAAAA 0 A_Raise
		Goto SelectAnimation

	SelectAnimation:
		TNT1 A 1
	    PI2G A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        PI2G A 0 A_PlaySound("CLIPIN")
        PIS2 AB 1
		PI2G A 0 A_Takeinventory("StartDualWield",1)
		Goto Ready

    Fire:
		TNT1 A 0
		TNT1 A 0 A_JumpIFInventory("PistolBurstFire", 1, "Fire2")
		PI2G A 0 A_JumpIfInventory("BDPistolAmmo", 1, 1)
		Goto FireLeft
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
        PI2G A 0 A_PlaySound("pfire", 1)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,-4,28)
		PI2F A 1 BRIGHT A_FireBullets (1.8, 1.4, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDPistolAmmo",1)
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
		PI2F C 1
		TNT1 A 0 A_ZoomFactor(1.0)

		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,1)
        Goto NoAmmo
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
        PI2G A 0 A_PlaySound("pfire", 2)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,4,28)
		PI2F D 1 BRIGHT A_FireBullets (1.8, 1.4, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
		PI2F F 1
		TNT1 A 0 A_ZoomFactor(1.0)
		PI2G A 2 A_WeaponReady(WRF_NOBOB | WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready

	FireLeft:
		TNT1 A 0
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,1)
        Goto NoAmmo
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
        PI2G A 0 A_PlaySound("pfire", 2)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,4,28)
		PI2F D 1 BRIGHT A_FireBullets (1.8, 1.4, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
        PI2F E 1
		TNT1 A 0 A_ZoomFactor(1.0)
		PI2F F 1
		PI2G A 1
		PI2G A 2 A_WeaponReady(WRF_NOBOB | WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready

	Fire2:
		TNT1 A 0
		PI2G A 0 A_JumpIfInventory("BDPistolAmmo", 1, 1)
		Goto Fire2Left
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		PI2G A 0 A_PlaySound("pfire", 1)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,-4,28)
		PI2F A 1 BRIGHT A_FireBullets (1.8, 1.4, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDPistolAmmo",1)
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
		PI2F B 1
		TNT1 A 0 A_ZoomFactor(1.0)

		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,1)
        Goto NoAmmo
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		PI2G A 0 A_PlaySound("pfire", 2)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,4,28)
		PI2F D 1 BRIGHT A_FireBullets (1.8, 1.4, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
        PI2F E 1
		TNT1 A 0 A_ZoomFactor(1.0)

		//FIRE2RIGHT2
		PI2G A 0 A_JumpIfInventory("BDPistolAmmo", 1, 1)
		Goto Fire2Left2
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		PI2G A 0 A_PlaySound("pfire", 1)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,-4,28)
		PI2F A 1 BRIGHT A_FireBullets (2.0, 1.6, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDPistolAmmo",1)
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
		PI2F B 1
		TNT1 A 0 A_ZoomFactor(1.0)

		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,1)
        Goto NoAmmo
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		PI2G A 0 A_PlaySound("pfire", 2)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,4,28)
		PI2F D 1 BRIGHT A_FireBullets (2.0, 1.6, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
        PI2F E 1
		TNT1 A 0 A_ZoomFactor(1.0)

		//FIRE2RIGHT3
		PI2G A 0 A_JumpIfInventory("BDPistolAmmo", 1, 1)
		Goto Fire2Left3
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
        PI2G A 0 A_PlaySound("pfire", 1)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,-4,28)
		PI2F A 1 BRIGHT A_FireBullets (2.3, 1.9, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDPistolAmmo",1)
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
		PI2F B 1
		TNT1 A 0 A_ZoomFactor(1.0)

		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,1)
        Goto NoAmmo
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		PI2G A 0 A_PlaySound("pfire", 2)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,4,28)
		PI2F D 1 BRIGHT A_FireBullets (2.3, 1.9, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
        PI2F E 1
		TNT1 A 0 A_ZoomFactor(1.0)

		PI2G A 2 A_WeaponReady(WRF_NOBOB | WRF_ALLOWRELOAD)
		Goto Ready

	Fire2Left:
		TNT1 A 0
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,1)
        Goto NoAmmo
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		PI2G A 0 A_PlaySound("pfire", 2)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,4,28)
		PI2F D 1 BRIGHT A_FireBullets (1.8, 1.4, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
        PI2F E 1
		TNT1 A 0 A_ZoomFactor(1.0)
		PI2F F 1

	Fire2Left2:
		TNT1 A 0
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,1)
        Goto NoAmmo
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		PI2G A 0 A_PlaySound("pfire", 2)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,4,28)
		PI2F D 1 BRIGHT A_FireBullets (2.0, 1.6, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
        PI2F E 1
		TNT1 A 0 A_ZoomFactor(1.0)
		PI2F F 1

	Fire2Left3:
		TNT1 A 0
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,1)
        Goto NoAmmo
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		PI2G A 0 A_PlaySound("pfire", 2)
		PIST F 0 A_AlertMonsters
		PI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,4,28)
		PI2F D 1 BRIGHT A_FireBullets (2.3, 1.9, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,-8,-4)
		TNT1 A 0 A_SetPitch(-0.2 + pitch)
        PI2F E 1
		TNT1 A 0 A_ZoomFactor(1.0)
		PI2F F 1

		PI2G A 2 A_WeaponReady(WRF_NOBOB | WRF_ALLOWRELOAD)
		Goto Ready

	AltFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIFInventory("PistolBurstFire", 1, "StopAlt")
		TNT1 A 0 A_GiveInventory("PistolBurstFire", 1)
		TNT1 A 0 A_Print("Burst fire")
		Goto Ready3

	StopAlt:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("PistolBurstFire", 1)
		TNT1 A 0 A_Print("Single shot")
		Goto Ready3


	NoAmmo:
		RIFG A 0
		RIFG A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_Takeinventory("Zoomed",1)
		RIFG A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		TNT1 A 0 A_PlaySound("weapons/empty", 4)
		NoAmmo2:
		RIFG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
	    RIFG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		RIFG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		RIFG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		RIFG A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		RIFG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		PI2G A 5 A_WeaponReady(WRF_ALLOWRELOAD)
		RIFG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RIFG A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, 2)
		RIFG A 0 A_JumpIfInventory("Clip1",1,"Reload")
		RIFG A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Goto Ready3

    Reload:
		PI2G A 1 A_WeaponReady
		PI2G A 0 A_Takeinventory("Reloading",1)
		PI2G A 0 A_Takeinventory("ADSmode",1)
		PI2G A 0 A_Takeinventory("Zoomed",1)
        PI2G A 0 A_ZoomFactor(1.0)
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",32,"Ready")

        PI2G A 0 A_JumpIfInventory("Clip1",1,3)
        Goto Ready
        TNT1 AAA 0
		PI2G A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		PI2G A 0 A_JumpIfInventory("PistolUnloaded", 1, "PutMag")

		PIST F 0 A_PlaySound("RELO1")
        PISR ABCDE 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		PISR F 4 A_FireCustomMissile("EmptyPistolClipSpawn",0,0,0,-20)
	PutMag:
		PISR F 4
		PISR GH 1
		PISR A 0 A_PlaySound("prel")
		PISR IJKLMN 2
		PISR OPQR 1
		PI2G A 0 A_JumpIfInventory("PistolUnloaded", 1, "PutMag2")

		PIST F 0 A_PlaySound("RELO1")
        PI2R CDE 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		PI2R F 4 A_FireCustomMissile("EmptyPistolClipSpawn",225,0,-10,-20)
	PutMag2:
		PI2R F 4
		PI2R GH 1
		PI2R A 0 A_PlaySound("prel")
		PI2R IJKLMN 2
		PI2R OPQR 1
		PIST F 0 A_Takeinventory("PistolUnloaded",1)
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,"InsertBullets2")//15+1 effect
		Goto InsertBullets

	TurboReload:
		PI2G A 0 A_Takeinventory("PistolUnloaded",1)
		TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAA 0
        Goto InsertBullets2

	InsertBullets:
		TNT1 AAAA 0
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",30,15)
		PI2G A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		PI2G A 0 A_Giveinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_Giveinventory("BDPistolAmmo",1)
		PI2G A 0 A_Takeinventory("Clip1",1)
		Goto InsertBullets

		TNT1 AAAAAAAAAA 0
		PI2G A 1 A_Takeinventory("Reloading",1)

		PI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready
		TNT1 AAAA 0
		PI2G A 1 A_Takeinventory("Reloading",1)

		PI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready

	InsertBullets2:
		TNT1 AAAA 0
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",32,15)
		PI2G A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		PI2G A 0 A_Giveinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_Giveinventory("BDPistolAmmo",1)
		PI2G A 0 A_Takeinventory("Clip1",1)
		Goto InsertBullets2

		TNT1 AAAAAAAAAA 0
		PI2G A 1 A_Takeinventory("Reloading",1)
		PI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready
		TNT1 AAAA 0
		PI2G A 1 A_Takeinventory("Reloading",1)

		PI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready

	Unload:
		PI2G A 1 A_WeaponReady
		PI2G A 0 A_Takeinventory("Unloading",1)
		PI2G A 0 A_Takeinventory("ADSmode",1)
		PI2G A 0 A_JumpIfInventory("BDPistolAmmo",1,3)
        Goto UnloadLeft
        TNT1 AAA 0
		PI2G A 0 A_Takeinventory("Zoomed",1)
        PI2G A 0 A_ZoomFactor(1.0)
		PI2G A 0 A_GiveInventory ("Pumping", 1)
		PI2G A 0 A_Takeinventory("Reloading",1)
		PISR RQPO 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		PISR A 0 A_PlaySound("prel")
		PISR NMLKJI 2 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		PISR HG 1
		PISR F 4

		PI2R RQPO 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		PI2R A 0 A_PlaySound("prel")
		PI2R NMLKJI 2 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		PI2R GH 1
		PI2R F 4
		PI2G A 0 A_Giveinventory("PistolUnloaded",1)
		Goto RemoveBullets

	UnloadLeft:
		TNT1 A 0
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,3)
        Goto Ready
        TNT1 AAA 0
		PI2G A 0 A_Takeinventory("Zoomed",1)
        PI2G A 0 A_ZoomFactor(1.0)
		PI2G A 0 A_GiveInventory ("Pumping", 1)
		PI2G A 0 A_Takeinventory("Reloading",1)
		PI2R RQPO 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		PI2R A 0 A_PlaySound("prel")
		PI2R NMLKJI 2 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		PI2R GH 1
		PI2R F 4
		PI2G A 0 A_Giveinventory("PistolUnloaded",1)
		Goto RemoveBullets

	RemoveBullets:
		TNT1 AAAA 0
		PI2G A 0 A_JumpIfInventory("BDDualPistolAmmo",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		PI2G A 0 A_Takeinventory("BDPistolAmmo",1)
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_Giveinventory("Clip1",1)
		Goto RemoveBullets

		TNT1 AAAAAAAAAA 0
		PI2G A 0 A_Takeinventory("Reloading",1)

		PI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready
		TNT1 AAAA 0
		PI2G A 0 A_Takeinventory("Reloading",1)

		PI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready

 	Spawn:
		PIST G -1
		Stop

	Steady:
		TNT1 A 1
		Goto Ready
	}
}

ACTOR BDDualPistolAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 32
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 32
   Inventory.Icon PISTH0
}