ACTOR BrutalPistol : Weapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 15
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip"
	Weapon.AmmoType2 "BDPistolAmmo"
	Obituary "%o was shot down by %k's pistol."
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "You got the Pistol!"
	+WEAPON.WIMPY_WEAPON
    +WEAPON.NOAUTOAIM
    +WEAPON.NOAUTOFIRE
	+WEAPON.CHEATNOTWEAPON
    Scale 0.9
	States
	{
	PickUp:
	TNT1 A 0
	TNT1 A 0 A_Playsound("PICKUPONELINER")
	TNT1 A 0
	Stop
	
	Ready:
        TNT1 A 1 A_JumpIfInventory("GoFatality", 1, "Steady")
        TNT1 A 0 A_PlaySound("CLIPIN")
        PISS AB 1
        TNT1 AAAAAAAA 0
        TNT1 A 0 //A_JumpIfInventory("BDPistolAmmo",1,2)
        //Goto Reload
        TNT1 AAAA 0

        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, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		PISG A 1 A_WeaponReady
		Goto Ready+9
	Deselect:
        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 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("weapons/rifle")
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		PISF A 1 BRIGHT A_FireBullets (2, 2, -1, 11, "HitPuff")
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, -1, 0)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDPistolAmmo",1)
        PISF B 1
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		PISF C 1 A_WeaponReady(1)
		PISG A 7 A_WeaponReady(1)
		Goto Ready+6
		
	NoAmmo:
	PISG A 1
	Goto Ready+10
	
    Reload:
		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,26)

        TNT1 A 0 A_JumpIfInventory("Clip",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("Reload")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		RIFR C 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)
        PISR A 6 
        PISR BCDEFG 3
		
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAA 0
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",15,15)
		TNT1 A 0 A_JumpIfInventory("Clip",1,3)
		Goto Ready+6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDPistolAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip",1)
		Goto Reload+28
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+6
		TNT1 AAAA 0
				TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+6
 	Spawn:
		RIFL A -1
		Stop
        DoKick:
	    TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		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)
		KICK BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KICK H 4
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+6
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK ABCDEFG 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KICK H 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+6
	
	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 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6
		
	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 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6

    Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		FUCK A 2
        FUCK B 2 A_PlaySound("FUCK", 1)
        FUCK C 2 A_AlertMonsters
		FUCK D 15 A_Takeinventory("Taunting",1)
        FUCK CBA 5
        TNT1 A 5
		Goto Ready
	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
	}
}


ACTOR BDPistolAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 15
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 15
   Inventory.Icon RIF
}