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

ACTOR RiotShield : BrutalWeapon
{
	Game Doom
	+BLOODSPLATTER
	Weapon.SelectionOrder 3400
	Weapon.KickBack 200
	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 got the Riot Shield"
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
    +WEAPON.NOAUTOFIRE
    +WEAPON.NO_AUTO_SWITCH
    +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_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 1
		TNT1 A 1 A_Raise
		TNT1 AAAAAAAAAA 0 A_Raise
		Goto SelectAnimation

// New Draw Animation
	SelectAnimation:
		TNT1 A 1
		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, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        	RSWT F 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        	RSWT E 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 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,"FireMode") 
		Loop

	ReadyShield:
		TNT1 A 0 A_WeaponReady
	   	RSWT A 1 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 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,"FireMode")
		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")
		Goto ReadyShield

	NoAmmo:
		RSWG A 1
		Goto Ready

// Fire Mode Related
	FireMode:
		TNT1 A 0 A_TakeInventory("StartDualWield", 1)
		TNT1 A 0 A_PlaySound("CLIPINSS",1)
		TNT1 A 0 A_JumpIfInventory("PistolBurstFire",1,"SemiFireMode")
		TNT1 A 0 A_GiveInventory("PistolBurstFire",1)
		TNT1 A 0 A_Print("Burst Fire Mode")
		Goto Ready
	SemiFireMode:
		TNT1 A 0 A_Takeinventory("PistolBurstFire",1)
		TNT1 A 0 A_Print("Semi-Auto Fire Mode")
		Goto Ready

	Fire:
		TNT1 A 0 A_JumpIfInventory("ShieldModeA",1,"ShieldMeele"/*"ShieldCantAction"*/) // Detects Shield
		TNT1 A 0 A_JumpIfInventory("PistolBurstFire",1,"BurstFire") // Burst Firing Mode
// Semi-Automatic Fire
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        	Goto Reload
        	TNT1 AAAA 0
		TNT1 A 0 A_AlertMonsters
		RIFF A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))
        	TNT1 A 0 A_PlaySound("pfire", 1)
		TNT1 A 0 A_TakeInventory("BDPistolAmmo", 1)
		TNT1 A 0 A_TakeInventory("BDDualPistolAmmo", 1)
		TNT1 A 0 A_ZoomFactor(0.98)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-5,0,0,0)
		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)
		RSWF B 1
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,10,-4)
		RSWF C 1
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "FireEndTactical")
		RSWF C 1 A_WeaponReady(1)
		RSWG A 7 A_WeaponReady(1)
		TNT1 A 0 A_REfire
		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

// Burst Fire
	BurstFire:
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        	Goto Reload
        	TNT1 AAAA 0
		TNT1 A 0 A_AlertMonsters
		RIFF A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))
        	TNT1 A 0 A_PlaySound("pfire", 1)
		TNT1 A 0 A_TakeInventory("BDPistolAmmo", 1)
		TNT1 A 0 A_TakeInventory("BDDualPistolAmmo", 1)
		TNT1 A 0 A_ZoomFactor(0.98)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-5,0,0,0)
		RSWF A 1 BRIGHT A_FireBullets (1.8, 1.8, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		RSWF B 1
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,10,-4)
		RSWF C 1
		//RSWG A 1
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        	Goto Reload
        	TNT1 AAAA 0
		TNT1 A 0 A_AlertMonsters
		RIFF A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))
        	TNT1 A 0 A_PlaySound("pfire", 1)
		TNT1 A 0 A_TakeInventory("BDPistolAmmo", 1)
		TNT1 A 0 A_TakeInventory("BDDualPistolAmmo", 1)
		TNT1 A 0 A_ZoomFactor(0.98)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-5,0,0,0)
		RSWF A 1 BRIGHT A_FireBullets (2, 2, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		RSWF B 1
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,10,-4)
		RSWF C 1
		//RSWG A 1
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",1,2)
        	Goto Reload
        	TNT1 AAAA 0
		TNT1 A 0 A_AlertMonsters
		RIFF A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))
        	TNT1 A 0 A_PlaySound("pfire", 1)
		TNT1 A 0 A_TakeInventory("BDPistolAmmo", 1)
		TNT1 A 0 A_TakeInventory("BDDualPistolAmmo", 1)
		TNT1 A 0 A_ZoomFactor(0.98)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-5,0,0,0)
		RSWF A 1 BRIGHT A_FireBullets (2, 2, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer", random(-1,1), 0, 0, 0)
		RSWF B 1
		TNT1 A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,10,-4)
		RSWF C 1
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "FireEndTactical")
		RSWF C 1 A_WeaponReady(1)
		RSWG A 7 A_WeaponReady(1)
		TNT1 A 0 A_REfire
		Goto Ready
		
// COD4-Like Shield Meele Function
	ShieldMeele:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT A 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT EBC 1
		TNT1 A 0 A_PlaySound("skeleton/swing")
		TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "ShieldMeeleBerserk")
		TNT1 A 0 A_Custompunch(random(20,40),1,1,"KickAttack", 150)
		RSWT C 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT D 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT E 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT F 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT A 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT A 1 A_Weaponready(1)
		Goto ReadyShield	
		
	ShieldMeeleBerserk:
		TNT1 A 0 A_Custompunch(random(30,50),1,1,"SuperKickAttack", 150)
		RSWT C 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT D 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT E 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT F 1
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWT A 1 A_Weaponready(1)
		Goto ReadyShield	

// Old Holding Shield Function
/*
	AltFire:
		TNT1 A 0		
		RSWB ABCDEF 1 A_WeaponReady
		TNT1 A 0 A_Giveinventory("ShieldModeA",1)
	AltHold:
		RSWB F 1 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
		RSWB F 1 A_Refire
		TNT1 A 0 A_Takeinventory("ShieldModeA",1)
		RSWB FEDCBA 1 A_WeaponReady
	   	RSWF C 1 A_WeaponReady
		Goto Ready
*/

// New Shield Functions
	AltFire:
		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, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT E 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT F 1 
		Goto ReadyShield

	UnShield:
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT F 1 
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 0, 0, 0, 0,SXF_NOCHECKPOSITION)
        RSWT E 1 
		TNT1 A 0 A_Takeinventory("ShieldModeA",1)
		TNT1 A 0 A_SpawnItemEx("RiotShieldProtection", 20, 0, 15, 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")
        	RSWF CB 2 
        	TNT1 A 0 A_PlaySound("Reload")
        	RSWR AB 1
		RSWR CDEE 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 1)
		TNT1 A 0 A_FireCustomMissile("EmptyPistolClipSpawn",-5,0,8,-4)
		RSWR F 4
		TNT1 A 0 A_PlaySound("prel")
		RSWR F 32
		RSWR GGHIJ 1
        	RSWR K 2
        	RSWF C 2 
		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 Animation
	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

// Sprinting Functions

	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)//Makes player slower.
		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)//Makes player slower.
		Goto Ready

	}
}

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

// Riot Shield Protection Functions
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
//Radius 20
  +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	
        }
}