ACTOR Magazine : Ammo 18009
{
	Game Doom
	SpawnID 11
	Inventory.PickupMessage "Picked up a pistol Magazine."
	Inventory.Amount 15
	Inventory.MaxAmount 300
	Ammo.BackpackAmount 10
	Ammo.BackpackMaxAmount 600
	Inventory.Icon "CLIPA0"
	States
	{
	Spawn:
		CLIP A -1
		Stop
	}
}
Actor PISTOLupgrade : inventory
{
	height 6
	radius 20
	inventory.amount 1
	inventory.maxamount 12 // 4 * 3 = 12, 3 pieces equals one upgrade
	Inventory.PickupSound "pistol/select"
	Inventory.PickupMessage "You got a pistol upgrade piece."
	states
	{
		spawn:
			DEGT A 1
			tnt1 A 1
			loop
	}
}
actor PISupgrade_message : inventory
{
	inventory.amount 1
	inventory.maxamount 12
}


ACTOR Handgun : Rifle 18000
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 5
	Weapon.AmmoUse2 0
	weapon.slotnumber 2
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Magazine"
	Weapon.AmmoType2 "BDPistolAmmo"
	Obituary "%o was shot down by %k's pistol."
    AttackSound "None"
    Inventory.PickupSound "pistol/select"
	Inventory.Pickupmessage "You got a Pistol."
	+WEAPON.WIMPY_WEAPON
    +WEAPON.NOAUTOAIm
	+WEAPON.NO_AUTO_SWITCH
    +WEAPON.NOAUTOFIRE
    Scale 0.6
	States
	{
	PickUp:
	TNT1 A 0
	TNT1 A 0 A_Playsound("pistol/select")
	TNT1 A 0
	Stop
	lowhealth:
		tnt1 a 0 A_jumpifhealthlower(30,2)
		tnt1 a 4
		loop
		tnt1 a 0
		blsc a 4
		loop
	Ready:
		tnt1 a 0 //A_gunflash("lowhealth")
		tnt1 a 0
        TNT1 A 0 A_selectweapon("Impshield")
		TNT1 A 0 A_selectweapon("ZMANshield")
		TNT1 A 0 A_selectweapon("SGUYshield")
        TNT1 A 0 A_PlaySound("pistol/select")
		tnt1 a 0 A_JumpIfInventory("IsPlayingAsPurist",1,"selectvanilla")
        PISS AB 1
        TNT1 AAAAAAAA 0
        TNT1 A 0 //A_JumpIfInventory("BDPistolAmmo",1,2)
        //Goto Reload
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "MeatShield")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("ADSmode",1,"ready2")
		PISG A 1 A_WeaponReady
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",12,"pickup_upgrade5")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",11,"pickup_upg_piece11")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",10,"pickup_upg_piece10")
		
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",9,"pickup_upgrade4")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",8,"pickup_upg_piece8")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",7,"pickup_upg_piece7")
		
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",6,"pickup_upgrade3")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",5,"pickup_upg_piece5")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",4,"pickup_upg_piece4")
		
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",3,"pickup_upgrade2")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",2,"pickup_upg_piece2")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",1,"pickup_upg_piece1")
		goto Ready+13
		
		selectvanilla:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("ClassicBDPistol", 1)
		TNT1 A 0 A_TakeInventory("Handgun", 1)
		tnt1 a 0 A_selectweapon("ClassicBDPistol")
		TNT1 A 10
		Goto Ready2
		
		pickup_upg_piece1:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",1,3)
			tnt1 a 1 A_print("--you need 2 more pieces to upgrade to mach2--",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upg_piece2:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",2,3)
			tnt1 a 1 A_print("--you need 1 more piece to upgrade to mach2--",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upg_piece4:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",4,3)
			tnt1 a 1 A_print("--you need 2 more pieces to upgrade to mach3--",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upg_piece5:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",5,3)
			tnt1 a 1 A_print("--you need 1 more piece to upgrade to mach3--",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upg_piece7:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",7,3)
			tnt1 a 1 A_print("--you need 2 more pieces to upgrade to mach4--",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upg_piece8:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",8,3)
			tnt1 a 1 A_print("--you need 1 more piece to upgrade to mach4--",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upg_piece10:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",10,3)
			tnt1 a 1 A_print("--you need 2 more pieces to upgrade maximum--",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upg_piece11:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",11,3)
			tnt1 a 1 A_print("--you need 1 more piece to upgrade maximum--",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upgrade2:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",3,3)
			tnt1 a 1 A_print("*** UPGRADED to MACH 2! ***",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upgrade3:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",6,3)
			tnt1 a 1 A_print("*** UPGRADED to MACH 3! ***",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upgrade4:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",9,3)
			tnt1 a 1 A_print("*** UPGRADED to MACH 4! ***",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
		pickup_upgrade5:
			tnt1 a 0 A_jumpifinventory("PISupgrade_message",12,3)
			tnt1 a 1 A_print("*** UPGRADED to MACH 5! * MAXED out***",4)
			tnt1 a 0 A_giveinventory("PISupgrade_message",1)
			tnt1 a 0
			goto Ready+13
	Ready2:
		tnt1 a 1 A_jumpifinventory("ADSmode",1, "ready2_1")
        TNT1 A 1
        TNT1 A 0 A_PlaySound("pistol/select")
        PISS AB 1
        TNT1 AAAAAAAA 0
        TNT1 A 0 //A_JumpIfInventory("BDPistolAmmo",1,2)
        //Goto Reload
        TNT1 AAAA 0
	ready2_1:
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "MeatShield")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SISG A 1 A_WeaponReady
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",12,"pickup_upgrade5")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",9,"pickup_upgrade4")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",6,"pickup_upgrade3")
		tnt1 a 0 A_jumpifinventory("PISTOLupgrade",3,"pickup_upgrade2")
		Goto Ready2 +9
	Deselect:
	tnt1 a 0 A_takeinventory("ADSmode",1)
        PISS BA 1
		TNT1 A 1 A_Lower
		Wait
	Select:
	
	TNT1 A 0 A_Takeinventory("FistsSelected",1)
	TNT1 A 0 A_Takeinventory("SawSelected",1)
	TNT1 A 0 A_Takeinventory("ShotgunSelected",1)
	TNT1 A 0 A_Takeinventory("SSGSelected",1)
	TNT1 A 0 A_Takeinventory("MinigunSelected",1)
	TNT1 A 0 A_Takeinventory("PlasmaGunSelected",1)
	TNT1 A 0 A_Takeinventory("RocketLauncherSelected",1)
    TNT1 A 0 A_Takeinventory("GrenadeLauncherSelected",1)
	TNT1 A 0 A_Takeinventory("BFGSelected",1)
	TNT1 A 0 A_Takeinventory("BFG10kSelected",1)
	TNT1 A 0 A_Takeinventory("RailGunSelected",1)
	TNT1 A 0 A_Takeinventory("SubMachineGunSelected",1)
	TNT1 A 0 A_Takeinventory("RevenantLauncherSelected",1)
	TNT1 A 0 A_Takeinventory("LostSoulSelected",1)
	TNT1 A 0 A_Takeinventory("FlameCannonSelected",1)
	TNT1 A 0 A_Takeinventory("HasBarrel",1)
	
		TNT1 A 0 A_Raise
		Wait
    Fire:
	tnt1 aaaaa 0 A_custommissile("Alerter",0,0,random(-5,5),0,random(-5,5))
	tnt1 a 0 A_jumpifinventory("PISTOLupgrade",12,"Fire_up5")
	tnt1 a 0 A_jumpifinventory("PISTOLupgrade",9,"Fire_up4")
	tnt1 a 0 A_jumpifinventory("PISTOLupgrade",6,"Fire_up3")
	tnt1 a 0 A_jumpifinventory("PISTOLupgrade",3,"Fire_up2")
	TNT1 A 0 A_JumpIfInventory("ADSmode",1,"Fire2")
	tnt1 a 0 A_alertmonsters
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("pistol/loud")
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		PISF A 1 BRIGHT A_FireBullets (5, 5, 1, 10, "HitPuff",0,2500)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        PISF B 1 A_setpitch(-0.6 + pitch)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		PISF C 1 A_WeaponReady(1)
		PISG A 4 A_WeaponReady(1)
		PISG A 1 A_refire
		Goto Ready+12
	Fire2:
	tnt1 a 0 A_jumpifinventory("PISTOLupgrade",12,"Fire2_up5")
	tnt1 a 0 A_jumpifinventory("PISTOLupgrade",9,"Fire2_up4")
	tnt1 a 0 A_jumpifinventory("PISTOLupgrade",6,"Fire2_up3")
	tnt1 a 0 A_jumpifinventory("PISTOLupgrade",3,"Fire2_up2")
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		tnt1 a 0
        TNT1 A 0 A_PlaySound("pistol/silence")
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SISF A 1 BRIGHT A_FireBullets (2, 2, 1, 6, "HitPuff",0,1000)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        SISF B 1
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		SISF C 1 A_WeaponReady(1)
		SISG A 7 A_WeaponReady(1)
		Goto Ready2 +6
		
	Fire_up2:
	TNT1 A 0 A_JumpIfInventory("ADSmode",1,"Fire2")
	tnt1 a 0 A_alertmonsters
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("pistol/loud")
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		PISF A 1 BRIGHT A_FireBullets (5, 5, 1, random(10,13), "HitPuff",0,3000)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        PISF B 1 A_setpitch(-0.6 + pitch)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		PISF C 1 A_WeaponReady(1)
		PISG A 7 A_WeaponReady(1)
		Goto Ready+12
	Fire2_up2:
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		tnt1 a 0
        TNT1 A 0 A_PlaySound("pistol/silence")
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SISF A 1 BRIGHT A_FireBullets (2, 2, 1, 10, "HitPuff",0,1500)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        SISF B 1
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		SISF C 1 A_WeaponReady(1)
		SISG A 7 A_WeaponReady(1)
		Goto Ready2 +6
		
	Fire_up3:
	TNT1 A 0 A_JumpIfInventory("ADSmode",1,"Fire2")
	tnt1 a 0 A_alertmonsters
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("pistol/loud")
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		PISF A 1 BRIGHT A_FireBullets (5, 5, 1, 17, "HitPuff",0,3500)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        PISF B 1 A_setpitch(-0.6 + pitch)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		PISF C 1 A_WeaponReady(1)
		PISG A 7 A_WeaponReady(1)
		Goto Ready+12
	Fire2_up3:
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		tnt1 a 0
        TNT1 A 0 A_PlaySound("pistol/silence")
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SISF A 1 BRIGHT A_FireBullets (2, 2, 1, 13, "HitPuff",0,2000)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        SISF B 1
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		SISF C 1 A_WeaponReady(1)
		SISG A 7 A_WeaponReady(1)
		Goto Ready2 +6
		
	Fire_up4:
	TNT1 A 0 A_JumpIfInventory("ADSmode",1,"Fire2")
	tnt1 a 0 A_alertmonsters
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("pistol/loud")
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		PISF A 1 BRIGHT A_FireBullets (5, 5, 1, 24, "HitPuff",0,4000)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        PISF B 1 A_setpitch(-0.6 + pitch)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		PISF C 1 A_WeaponReady(1)
		PISG A 7 A_WeaponReady(1)
		Goto Ready+12
	Fire2_up4:
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
		tnt1 a 0
        TNT1 A 0 A_PlaySound("pistol/silence")
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SISF A 1 BRIGHT A_FireBullets (2, 2, 1, 17, "HitPuff",0,2500)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        SISF B 1
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		SISF C 1 A_WeaponReady(1)
		SISG A 7 A_WeaponReady(1)
		Goto Ready2 +6
		
	Fire_up5:
	TNT1 A 0 A_JumpIfInventory("ADSmode",1,"Fire2")
	tnt1 a 0 A_alertmonsters
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("pistol/loud")
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		PISF A 1 BRIGHT A_FireBullets (5, 5, 1, 30, "HitPuff",0,4500)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        PISF B 1 A_setpitch(-0.6 + pitch)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		PISF C 1 A_WeaponReady(1)
		PISG A 7 A_WeaponReady(1)
		Goto Ready+12
	Fire2_up5:
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("pistol/silence")
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SISF A 1 BRIGHT A_FireBullets (2, 2, 1, 23, "HitPuff",0,3000)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        SISF B 1
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		SISF C 1 A_WeaponReady(1)
		SISG A 7 A_WeaponReady(1)
		Goto Ready2 +6
	NoAmmo:
	PISG A 1
	Goto Ready+10
	
    Reload:
	TNT1 A 0 A_JumpIfInventory("ADSmode",1,"Reload2")
		PISG A 1 A_WeaponReady
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",15,38)
        TNT1 A 0 A_JumpIfInventory("Magazine",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_Playsound("pistol/reload")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		RIFR C 0 A_FireCustomMissile("EmptyPISTOLClipSpawn",-5,0,8,-4)
        PISR ABCCDDEEEEFGHIJKLLMMN 1
		
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAA 0
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",15,15)
		TNT1 A 0 A_JumpIfInventory("Magazine",1,3)
		Goto Ready+12
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDPistolAmmo",1)
		TNT1 A 0 A_Takeinventory("Magazine",1)
		Goto Reload+38
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+12
		TNT1 AAAA 0
				TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+12
	
	Reload2:
		SISG A 1 A_WeaponReady
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",15,26)
        TNT1 A 0 A_JumpIfInventory("Magazine",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_Playsound("pistol/reload")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		RIFR C 0 A_FireCustomMissile("EmptyPISTOLClipSpawn",-5,0,8,-4)
        D3GR A 3 
        D3GR BCDEFG 3
		
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAA 0
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",15,15)
		TNT1 A 0 A_JumpIfInventory("Magazine",1,3)
		Goto Ready2 +6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDPistolAmmo",1)
		TNT1 A 0 A_Takeinventory("Magazine",1)
		Goto Reload2 +28
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready2 +6
		TNT1 AAAA 0
				TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready2 +6
 	Spawn:
		DEGT A -1
		Stop
		
    DoKick:
	    TNT1 A 0
		tnt1 a 0 A_jumpifinventory("ADSmode",1, "SDoKick")
        TNT1 A 0 A_ZoomFactor(1.0)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		
		PISK BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        PISK H 4
		KICK A 0 A_Takeinventory("Kicking",1)
		PISK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+12
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		PISK ABCDEFG 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        PISK H 3
		KICK A 0 A_Takeinventory("Kicking",1)
		PISK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+12
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		Goto Ready+12
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		Goto Ready+12
	SDoKick:
	    TNT1 A 0
        TNT1 A 0 A_ZoomFactor(1.0)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SBerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		
		SISK BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        SISK H 4
		KICK A 0 A_Takeinventory("Kicking",1)
		SISK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+12
    SBerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		SISK ABCDEFG 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        SISK H 3
		KICK A 0 A_Takeinventory("Kicking",1)
		SISK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+12
Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Taunting",1)
		TNT1 A 0 A_JumpIfInventory("RealismMode", 1, "CheckGrab")
        TNT1 A 10
		FUCK A 1
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 1 A_PlaySound("FUCK", 2)
        FUCK CD 1 A_AlertMonsters
		FUCK E 15 A_Takeinventory("Taunting",1)
        FUCK DCBA 1
        TNT1 A 10
		Goto Ready+1
	Salute:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		TNT1 A 0 A_ALertMonsters
		SALU ABCDEDCDEDCDEDCBA 4
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+1
	meatshield:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		PUNG BCD 1
        TNT1 A 0 A_PlaySound("skeleton/swing")
		PUNG A 0 A_FireCustomMissile("MeleeStrikegrab", 0, 0, 0, -9)
		PUNG E 1
		PUNG DCB 1
        PUNG AA 1
		TNT1 A 0 A_Refire("meatshield")
		tnt1 a 0 A_weaponready
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+1
	altfire:
		tnt1 a 0 A_print("Silencer Attached",2)
		tnt1 a 0 A_jumpifinventory("ADSmode",1, "RemoveSilencer")
		tnt1 a 0 A_Giveinventory("ADSmode",1)
		tnt1 a 0 A_jumpifinventory("ADSmode",1, "AttachSilencer")
	AttachSilencer:
	tnt1 a 0 A_PlaySound("PISATCH")
		tnt1 a 3
		PISS A 1 A_print("Silencer Attached",2)
		PISS B 1
		PISS C 1
		PISS D 1
		goto ready2 +6
	RemoveSilencer:
		tnt1 a 0 A_PlaySound("PISATCH")
		SISS D 1 A_print("silencer detached",2)
		SISS C 1
		SISS B 1
		SISS A 1
		tnt1 a 3 A_takeinventory("ADSmode",1)
		goto Ready+12
	
	TossGrenade:	
		TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
		Goto NoGrenade
		GRTH ABCD 1
		TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
		TNT1 A 0 A_PLaySound ("GRNPIN")
		GRTH EEFG 1
		TNT1 A 0 A_PLaySound ("GRNTOSS")
		GRTH HI 1
		TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
		TNT1 A 0 A_FireCustomMissile("HandGrenade", random(-2,2), 0, 0, 0, 0, 0)
	    TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
		GRTH JKLM 1
		TNT1 A 1 
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		Goto Ready+1	
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left.")
		Goto Ready+12
	}
}
ACTOR BDPistolAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 15
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 15
   Inventory.Icon "TNT1A0"
}