// =============================================================================
//
// Brutal DOOM - Mutators
//
// Counter-Strike Styled Tactical Shield
// for Brutal DOOM v21
//
// -----------------------------
//
// Sprites By mryayayify
// Decorate Script By XV117
//
// =============================================================================

ACTOR RiotShield : BrutalWeapon
{
	Game Doom
	Weapon.SelectionOrder 1900
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType2 "BDPistolAmmo"
	Weapon.AmmoType1 "Clip1"
	Obituary "%o was shot down by %k's pistol"
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "You picked up the Riot Shield! (Slot 2)"
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+WEAPON.WIMPY_WEAPON
    +FORCEXYBILLBOARD
    Tag "Pistol + Riot Shield"
    Scale 1.0
	States
	{

   	Spawn:
	5L1D I 1
	5L1D I -1
    	Loop

	Select:
		TNT1 A 0 A_Takeinventory("StartDualWield",1)
		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 1
		TNT1 A 1 A_Raise
		TNT1 AAAAAAAAAA 0 A_Raise
		Goto SelectAnimation

// New Draw Animation
	SelectAnimation:
		TNT1 A 1
		TNT1 A 0 A_PlaySound("CLIPIN")
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		RSWR F 1 Offset(0,102)
		RSWR G 1 Offset(0,92)
		RSWR H 1 Offset(0,82)
		RSWR I 1 Offset(0,72)
		RSWR J 1 Offset(0,62)
		RSWR K 1 Offset(0,52)
		RSWF C 1 Offset(0,42)
		RSWG A 1 Offset(0,32)
        TNT1 A 0 A_GunFlash
		Goto Ready

// New Holster Animation
	Deselect:
		TNT1 A 0 A_JumpIfInventory("ShieldModeA",1,"DeselectShieldMode")
		RSWG A 1 Offset(0,32)
		RSWF C 1 Offset(0,42)
		RSWR K 1 Offset(0,52)
		RSWR J 1 Offset(0,62)
		RSWR I 1 Offset(0,72)
		RSWR H 1 Offset(0,82)
		RSWR G 1 Offset(0,92)
		RSWR F 1 Offset(0,102)
		TNT1 A 0 A_Lower
		TNT1 A 1 A_Lower
		Wait
	
	DeselectShieldMode:
		TNT1 A 0 A_Takeinventory("ShieldModeA",1)
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT F 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT E 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWB FEDCBA 1
		RSWG A 1 Offset(0,32)
		RSWF C 1 Offset(0,42)
		RSWR K 1 Offset(0,52)
		RSWR J 1 Offset(0,62)
		RSWR I 1 Offset(0,72)
		RSWR H 1 Offset(0,82)
		RSWR G 1 Offset(0,92)
		RSWR F 1 Offset(0,102)
		TNT1 A 0 A_Lower
		TNT1 A 1 A_Lower
		Wait

	Ready3:
	Ready:
		TNT1 A 0 A_JumpIfInventory("ShieldModeA",1,"ReadyShield")
	   	RSWG A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"DualWield") 
		Loop

	ReadyShield:
		TNT1 A 0 A_WeaponReady
	   	RSWT A 1 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"ShieldCantAction")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"ShieldCantAction")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"ShieldCantAction")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"ShieldCantAction")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "ShieldCantAction")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "ShieldCantAction")
		TNT1 A 0 A_JumpIfInventory("IsRunning",1,"AltFire")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"ShieldCantAction")
		TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		Loop

	ShieldCantAction:
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("Kicking",1)
        TNT1 A 0 A_Takeinventory("Taunting",1)
		TNT1 A 0 A_Takeinventory("TossGrenade",1)
		TNT1 A 0 A_Takeinventory("Salute1", 1)
		TNT1 A 0 A_Takeinventory("Salute2", 1)
		TNT1 A 0 A_Takeinventory("IsRunning",1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		TNT1 A 0 A_Print("You can not perform any action when using the shield.",1)
		Goto ReadyShield

	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("IsRunning",1,"CheckSprint")
		RIFG A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		RIFG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		RSWG A 5 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOFIRE)
		RIFG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RIFG A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, "Ready3")
		RIFG A 0 A_JumpIfInventory("Clip1",1,"Reload")
		RIFG A 0 A_JumpIfInventory("FiredPrimary",1,"NoAmmo2")
		Goto Ready3

// Fire Mode Related
	AltFire:
		TNT1 A 0 A_PlaySound("CLIPINSS",1)
		TNT1 A 0 A_JumpIfInventory("PistolBurstFire",1,"StopAlt")
		TNT1 A 0 A_GiveInventory("PistolBurstFire",1)
		TNT1 A 0 A_Print("Burst Fire")
		Goto Ready
	StopAlt:
		TNT1 A 0 A_Takeinventory("PistolBurstFire",1)
		TNT1 A 0 A_Print("Single Shot")
		Goto Ready

	Fire:
		TNT1 A 0 A_JumpIfInventory("ShieldModeA",1,"Shieldmelee")
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        Goto NoAmmo
        TNT1 AAAA 0
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_JumpIfInventory("PistolBurstFire",1,"BurstFire")
		TNT1 A 0 A_PlaySound("FARSHT", 6)
        TNT1 A 0 A_PlaySound("PFIRE", 1)
		TNT1 A 0 A_ZoomFactor(0.98)
		RSWG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		RSWF A 1 BRIGHT A_FireBullets (1.5, 1.5, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		TNT1 A 0 A_TakeInventory("BDPistolAmmo", 1)
		PIST F 0 A_TakeInventory("BDDualPistolAmmo",1)
		RSWF B 2
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-4)
		RSWF C 2
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "FireEndTactical")
		RSWG A 2
		RSWG A 0 A_Refire
		RSWG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RSWG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		RSWG A 3 A_WeaponReady(WRF_NOBOB | WRF_ALLOWRELOAD)
		RSWG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RSWG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		RSWG A 3 A_WeaponReady(WRF_NOBOB | WRF_ALLOWRELOAD)
		Goto Ready

	FireEndTactical:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("IsRunning", 1, "FireEndTactical2")
		RSWF C 1 A_WeaponReady(1)
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		RSWG A 7 A_WeaponReady(1)
		Goto Ready
		
	FireEndTactical2:
		TNT1 A 0
		PLAY A 0 ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
		TNT1 A 0 A_GiveInventory("UsedStamina", 4)
		RSWF C 1 A_WeaponReady(1)
		RSWG A 5 A_WeaponReady(1)
		Goto Sprinting

	BurstFire:
        TNT1 A 0
		PIST F 0 A_PlaySound("FARSHT", 6)
        PIST F 0 A_PlaySound("PFIRE", 1)
		PIST F 0 A_ZoomFactor(0.98)
		RSWG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		RSWF A 1 BRIGHT A_FireBullets (1.5, 1.5, -1, 14, "WeakPuff", FBF_NORANDOM)
		PIST F 0 A_ZoomFactor(1.0)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		PIST F 0 A_Takeinventory("BDPistolAmmo",1)
		PIST F 0 A_TakeInventory("BDDualPistolAmmo",1)
		PIST F 0 A_JumpIfInventory("BDPistolAmmo",1,1)
		Goto NoAmmo
        RSWF B 1
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-4)
		PIST F 0 A_PlaySound("FARSHT", 6)
        PIST F 0 A_PlaySound("PFIRE", 1)
		PIST F 0 A_ZoomFactor(0.98)
		RSWG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		RSWF A 1 BRIGHT A_FireBullets (3, 2.25, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_SetPitch(pitch-1)
		PIST F 0 A_ZoomFactor(1.0)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		PIST F 0 A_Takeinventory("BDPistolAmmo",1)
		PIST F 0 A_TakeInventory("BDDualPistolAmmo",1)
		PIST F 0 A_JumpIfInventory("BDPistolAmmo",1,1)
		Goto NoAmmo
        RSWF B 1
		TNT1 A 0 A_SetPitch(pitch-1)
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-4)
		PIST F 0 A_PlaySound("FARSHT", 6)
        PIST F 0 A_PlaySound("PFIRE", 1)
		PIST F 0 A_ZoomFactor(0.98)
		RSWG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		RSWF A 1 BRIGHT A_FireBullets (4.5, 3, -1, 14, "WeakPuff", FBF_NORANDOM)
		PIST F 0 A_ZoomFactor(1.0)
        RIFF A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		PIST F 0 A_Takeinventory("BDPistolAmmo",1)
		PIST F 0 A_TakeInventory("BDDualPistolAmmo",1)
		TNT1 A 0 A_SetPitch(pitch-1)
		PIST F 0 A_JumpIfInventory("BDPistolAmmo",1,1)
		Goto NoAmmo
        RSWF B 1
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-4)
		RSWF C 2
		RSWG AA 2
		PIST F 0 A_JumpIfInventory("Reloading",1,"Reload")
		PIST F 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		PIST F 0 A_JumpIfInventory("Reloading",1,"Reload")
		PIST F 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		RSWG A 2 A_WeaponReady(WRF_NOBOB | WRF_ALLOWRELOAD)
		Goto Ready	
		
// COD4-Like Shield Melee Function
	ShieldMelee:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT A 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT EBC 1
		TNT1 A 0 A_PlaySound("skeleton/swing")
		TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "ShieldMeleeBerserk")
		TNT1 A 0 A_Custompunch(random(28,28),1,0,"KickAttack")
		RSWT C 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT D 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT E 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT F 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT A 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT A 1 A_Weaponready(1)
		Goto ReadyShield	
		
	ShieldMeleeBerserk:
		TNT1 A 0 A_Custompunch(random(62,62),1,0,"SuperKickAttack")
		RSWT C 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT D 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT E 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT F 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT A 1 A_Weaponready(1)
		Goto ReadyShield	
	
	DualWield:
		TNT1 A 0 A_TakeInventory("StartDualWield", 1)
		TNT1 A 0 A_JumpIfInventory("ShieldModeA",1,"UnShield")
		TNT1 A 0 A_Giveinventory("ShieldModeA",1)
        RSWB ABCDEF 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT E 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT F 1 
		Goto ReadyShield

	UnShield:
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT F 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT E 1 
		TNT1 A 0 A_Takeinventory("ShieldModeA",1)
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 1, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWB FEDCBA 1
        Goto Ready
		
// New Reload Animation
	Reload:
		RSWG A 1 A_WeaponReady
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",16,"Ready")

		TNT1 A 0 A_JumpIfInventory("Clip1",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_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 1)
		TNT1 A 0 A_FireCustomMissile("EmptyPistolClipSpawn",-5,0,8,-4)
		TNT1 A 0 A_PlaySound("Reload")
		RSWF CB 1
		RSWR ABCDEFFF 1
		TNT1 A 0 A_PlaySound("prel")
		RSWR F 8
		RSWR GHIJK 1
		RSWF BC 1
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,"InsertBullets2")//15+1 effect
		
	TurboReload:
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		PISS BA 0
		Goto InsertBullets
		
	InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",15,15)
		TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDPistolAmmo",1)
		TNT1 A 0 A_Giveinventory("BDDualPistolAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip1",1)
		Goto InsertBullets
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		
		TNT1 A 0 A_Refire
        Goto Ready
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		
		TNT1 A 0 A_Refire
        Goto Ready
		
	InsertBullets2:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",16,15)
		TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDPistolAmmo",1)
		TNT1 A 0 A_Giveinventory("BDDualPistolAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip1",1)
		Goto InsertBullets2
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Refire
        Goto Ready
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		
		TNT1 A 0 A_Refire
        Goto Ready	

	Unload:
		RSWG A 1 A_WeaponReady
		TNT1 A 0 A_Takeinventory("Unloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",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_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		RSWF C 2 
		RSWR ABCDEEFFFF 1
		TNT1 A 0 A_PlaySound("prel")
		RSWR F 32
		RSWR EEDCB 1
		RSWR A 2
		RSWF BC 2 
		TNT1 A 0 A_Giveinventory("HasUnloaded",1)
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,"RemoveBullets")

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

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

		TNT1 A 0 A_Refire
		Goto Ready
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)

		TNT1 A 0 A_Refire
		Goto Ready

	CheckSprint:
		RSWG 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:
		RSWG A 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		RSWG 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", 2)
		TNT1 A 0 offset(-9,32)
		RSWG A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		RSWG A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		RSWG A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		RSWG A 1 offset(0,38) A_SetPitch(pitch -0.5)
		RSWG A 1 offset(3,36) A_SetPitch(pitch -0.5)
		RSWG A 1 offset(6,34) A_SetPitch(pitch -0.5)
		RSWG 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)
		RSWG A 1 offset(9,34) A_SetPitch(pitch +0.5)
		RSWG A 1 offset(6,36) A_SetPitch(pitch +0.5)
		RSWG A 1 offset(3,38) A_SetPitch(pitch +0.5)
		RSWG A 1 offset(0,38) A_SetPitch(pitch +0.5)
		RSWG A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		RSWG A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		RSWG 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:
		RSWG A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)
		TNT1 A 0 A_PlaySound("Tired", 2)
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		RSWG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		RSWG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		RSWG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		RSWG A 5 A_WeaponReady
		TNT1 A 0 A_TakeInventory("UsedStamina", 2)
		RSWG A 5 A_WeaponReady
		Goto Ready
	StopSprint:
		RSWG A 1
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)
		Goto Ready
	}
}

Actor ShieldModeA : Inventory //CS-Like Holding Riot Shield
{
   Inventory.MaxAmount 1
}

actor RiotShieldProtection
{
Speed 9
+NOTARGET
Health 99999
Radius 15
Height 55
BloodType "RiotShieldHit"
PainChance 0
+NOGRAVITY
+SHOOTABLE
+NOTELEPORT
-SOLID
+NODAMAGETHRUST
+NORADIUSDMG
+NOPAIN
States
{
Spawn:
XXXX A 3
Stop
 }
}

ACTOR RiotShieldHit: HitPuff
{
  renderstyle Translucent
  scale 0.15
  alpha 0.7
  +NOBLOCKMAP
  +NOGRAVITY
  +NOEXTREMEDEATH
  +FORCEXYBILLBOARD
  	states
        {
	Spawn:
	Death:
	XDeath:
	Melee:
		TNT1 A 0 A_PlaySound ("barrel/pain")
		TNT1 A 0
		TNT1 AB 1 bright A_SpawnItem ("YellowFlareSmall", 0)
		TNT1 A 0 A_Jump (128,3)
		TNT1 A 0 A_SpawnItem ("Sparks", 0)
		TNT1 AAAAAA 0 A_CustomMissile ("SparkX", 2, 0, random (0, 360), 2, random (30, 170))
		BPUF C 1 bright A_PlaySound("ricochet/hit")
		BPUF D 1 bright
		Stop	
        }
}