ACTOR M1911 : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 20
	Weapon.AmmoType2 "1911Ammo"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "clip1"
	Obituary "%o was shot down by %k's .45 1911."
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "You got the Colt M1911, Fuck yeah! (Slot 2)!"
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOALERT
	+WEAPON.NO_AUTO_SWITCH
	+WEAPON.WIMPY_WEAPON
    +FORCEXYBILLBOARD
	Weapon.SelectionOrder 500
	Inventory.Icon "COLTA0"
    Scale 1.0
	Tag "COLT M1911A1"
	States
	{
	
	NoAmmo:
		1911 A 1
		TNT1 A 0 A_PlaySound("DRYFIRE")
		Goto Ready3
	
	
	SelectAnimation:
        TNT1 A 0
        TNT1 A 0 A_PlaySound("CLIPIN")
        1911 A 1
		TNT1 A 0 A_GunFLash
        TNT1 AAAAAAAA 0
	Ready3:
	Ready:		
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		1911 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		loop
		
		
	CheckSprint:
		191P A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	StartSprint:
		191P A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		191P A 0 offset(-9,32) 
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		PLAY A 0 offset(-9,32) ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		TNT1 A 0 offset(-9,32) A_GiveInventory("UsedStamina", 3)
		TNT1 A 0 offset(-9,32)
		191P A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		191P A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		191P A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		191P A 1 offset(0,38) A_SetPitch(pitch -0.5)
		191P A 1 offset(3,36) A_SetPitch(pitch -0.5)
		191P A 1 offset(6,34) A_SetPitch(pitch -0.5)
		191P A 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 offset(-9,32) A_GiveInventory("UsedStamina", 3)
		TNT1 A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		191P A 1 offset(9,34) A_SetPitch(pitch +0.5)
		191P A 1 offset(6,36) A_SetPitch(pitch +0.5)
		191P A 1 offset(3,38) A_SetPitch(pitch +0.5)
		191P A 1 offset(0,38) A_SetPitch(pitch +0.5)
		191P A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		191P A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		191P A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		TNT1 A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint
		
	StopSprintTired:
		191P A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		TNT1 A 0 A_PlaySound("Tired", 2)
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		191P A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		191P A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		191P A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		191P A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		191P A 5 A_WeaponReady
		Goto Ready
	StopSprint:
		191P A 1
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready	
		
	Ready2:
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		191S B 1 A_WeaponReady(WRF_ALLOWRELOAD)
		Loop

	Deselect:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		1911 A 1
		TNT1 AAAAAAAAA 0 A_Lower
		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("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_Giveinventory("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_TakeInventory("TossGrenade", 1)
		TNT1 A 1 A_Raise
		TNT1 AAAAA 0 A_Raise
		Goto SelectAnimation
		
    Fire:
		TNT1 A 0 A_JumpIfInventory("1911Ammo",1,1)
        Goto Reload
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
		TNT1 A 0 A_PlaySound("45F", 6)
		TNT1 A 0 A_Takeinventory("1911Ammo",1)
		191F A 1 BRIGHT A_AlertMonsters
		191F B 2 A_FireBullets (1.9, 1.9, -1, 50, "WeakPuff", FBF_NORANDOM)
		191F A 0 A_FireCustomMissile("PistolCaseSpawn",-5,0,8,-4)
		TNT1 A 0 A_ZoomFactor(1.03)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		191F C 2 BRIGHT A_FireCustomMissile("DecorativeTracer", random(-2,2), 0, 0, -12, 0, random(-2,2))
		191F A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 2)//tactical mode has muzzle climb
		191F A 0 A_SetPitch(pitch-1.1)
        TNT1 A 0 A_ZoomFactor(1.0)
		1911 A 1
		Goto Ready3
		
	
	Fire2:
        TNT1 A 0 A_JumpIfInventory("1911Ammo",1,1)
        Goto Reload
		TNT1 A 0 A_PlaySound("45F", 6)
		TNT1 A 0 A_Takeinventory("1911Ammo",1)
		191S C 1 BRIGHT A_AlertMonsters
		191S C 1 A_FireBullets (1.1, 1.1, -1, 28, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.53)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		191S D 1 BRIGHT A_FireCustomMissile("DecorativeTracer", random(-2,2), 0, 0, -12, 0, random(-2,2))
		191S A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 2)//tactical mode has muzzle climb
		191S A 0 A_SetPitch(pitch-0.6)
		191S A 0 A_FireCustomMissile("PistolCaseSpawn",-5,0,8,-4)
        TNT1 A 0 A_ZoomFactor(1.5)
		191S D 1
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")//If still pressing alt fire, it means its holding aim
		191S B 1
		Goto Ready2
		
	AltFire:
        TNT1 A 0
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"NoAim")
		TNT1 A 0 A_Giveinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.5)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
        LUIS A 0
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		191S A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		191S A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		191S A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		LUIS B 0 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		TNT1 A 0 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		191S B 0 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		191S B 2 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")
        Goto Ready2
		
	   //HoldAim:	
	    TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		191S A 0 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		191S A 0 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		191S B 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")
		
	NoAim:	
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		191S B 1
        Goto Ready+6
		
		
	Reload:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		1911 A 1 A_WeaponReady
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("1911Ammo",7,"ready")
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_PlaySound("45R")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		191R N 3
		191R ABCD 1 
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
		TNT1 A 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)
        191R E 24
		191R FGHI 1
		191R J 3
		191R KL 1
		191R M 3
		191R N 3
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		//TNT1 A 0 A_JumpIfInventory("STGAmmo",1,"InsertBullets2")//30+1 effect
		
	InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("1911Ammo",7,15)
		TNT1 A 0 A_JumpIfInventory("clip1",1,3)
		Goto Ready+6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("1911Ammo",1)
		TNT1 A 0 A_Takeinventory("clip1",1)
		Goto InsertBullets
		
		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
	
		
	TurboReload:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("1911Ammo",7,15)
		TNT1 A 0 A_JumpIfInventory("clip1",1,3)
		Goto Ready+6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("1911Ammo",1)
		TNT1 A 0 A_Takeinventory("clip1",1)
		Goto TurboReload
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_ReFire
        Goto Ready	
		
	Unload:
		1911 A 1 A_WeaponReady
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_JumpIfInventory("1911Ammo",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_PlaySound("45R")
		191R N 3
		191R A 3
		191R BCDEN 1
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		
	RemoveBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("1911Ammo",1,3)
		Goto FinishUnload
        TNT1 AAAAAA 0
		TNT1 A 0 A_Takeinventory("1911Ammo",1)
		TNT1 A 0 A_Giveinventory("clip1",1)
		Goto RemoveBullets
	
	FInishUnload:
		191R N 2
		TNT1 A 0 A_PlaySound("DryFire")
		TNT1 A 0 A_GiveInventory("HasUnloaded", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		Goto Ready+6
		
 	Spawn:
		COLT A -1
		Stop
	}
}

ACTOR 1911Ammo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 7
   Ammo.BackpackAmount 0
   Inventory.Icon "COLTA0"
   Ammo.BackpackMaxAmount 7
}