ACTOR Rifle : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.SelectionOrder 900
	Weapon.AmmoType1 "Clip2"
	Weapon.AmmoType2 "RifleAmmo"
	Obituary "%o was shot down by %k's assault rifle."
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "$GOTRIFLE"
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOALERT
	+FORCEXYBILLBOARD
	Tag "Assault Rifle"
	DropItem "RifleSpawner"
	States
	{
	TacticalWarning:
		TNT1 A 4
		Goto LetsGetStarted

	WarmUp:
		RIFG A 0
		RIFG A 0 A_TakeInventory("JustStartedGame", 1)
		RIFG A 0 A_JumpIfInventory("IsTacticalClass", 1, "TacticalWarning")

	LetsGetStarted:
		TNT1 A 5 A_WeaponReady
		PUNS ABCD 1 A_WeaponReady
		RIFG A 0 A_PlaySound("Knuckled")
		PUNS E 7 A_WeaponReady
		PUNS FGFE 3 A_WeaponReady
		PUNS DCB 1 A_WeaponReady
		TNT1 A 5 A_WeaponReady
		R2RL ABCDE 1 A_WeaponReady
        R2RL E 1 A_WeaponReady
		RIFR HIKL 1 A_WeaponReady
		RIFG A 0 A_PlaySound("Reload",6)
		RIFR M 1 A_WeaponReady
		RIFR NOPQRST 1 A_WeaponReady
		Goto Ready3

	StartSprint:
		RIFG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		SHTN A 0 A_Takeinventory("Zoomed",1)
        SHTN A 0 A_ZoomFactor(1.0)
		SHTN A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(0)
		SHTN A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.

	Sprinting:
		RISP A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		RISP A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		RISP A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		RISP A 1 offset(0,38) A_SetPitch(pitch -0.5)
		RISP A 1 offset(3,36) A_SetPitch(pitch -0.5)
		RISP A 1 offset(6,34) A_SetPitch(pitch -0.5)
		RISP A 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 2)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        SMGG A 0 A_JumpIfInventory("Reloading",1,"Reload")

		RISP A 1 offset(9,34) A_SetPitch(pitch +0.5)
		RISP A 1 offset(6,36) A_SetPitch(pitch +0.5)
		RISP A 1 offset(3,38) A_SetPitch(pitch +0.5)
		RISP A 1 offset(0,38) A_SetPitch(pitch +0.5)
		RISP A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		RISP A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		RISP A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 2)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        SMGG A 0 A_JumpIfInventory("Reloading",1,"Reload")

		PLAY A 0 ACS_NamedExecuteAlways("BDSprint", 0, 0, 0, 0)//Makes player faster.
		SMGG A 0 A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint

	StopSprint:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, 2)
		TNT1 A 0 A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		RISP A 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		Goto Ready3

	StopSprintTired:
		RISP A 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		RIFG A 0 A_PlaySound("Tired", 2)
		Goto Ready3

	SelectAnimation:
        TNT1 A 1 A_JumpIfInventory("GoFatality", 1, "Steady")
		RIFG A 0 A_JumpIfInventory("JustStartedGame",1,"WarmUp")
        RIFG A 0 A_PlaySound("CLIPIN")
		RIFG A 0 A_Takeinventory("BDWeaponACtion",1)
		RIFS ABC 1
		RIFG A 0 A_Takeinventory("StartDualWield",1)
		Goto Ready3

	Ready:
	Ready3:
		RIFG A 0 A_JumpIfInventory("Zoomed",1,"Ready2")
		RIFG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		RIFG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
	    RIFG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        RIFG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RIFG A 0 A_JumpIfInventory("Unloading",1,"Unload")
		RIFG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		RIFG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		RIFG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		RIFG A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		RIFG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RIFG A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Loop

	Ready2:
		TNT1 A 0
		RIFG A 0 A_JumpIfInventory("UseScope",1,"Ready4")
		RI2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		RI2G A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
        RI2G A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        RI2G A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RI2G A 0 A_JumpIfInventory("Unloading",1,"Unload")
		RI2G A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		RI2G A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		RI2G A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		RI2G A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Loop

    Ready4:
		TNT1 A 0
		RI3G A 1 BRIGHT A_WeaponReady(WRF_ALLOWRELOAD)
		RI3G A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
        RI3G A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        RI3G A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RI3G A 0 A_JumpIfInventory("Unloading",1,"Unload")
		RI3G A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		RI3G A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		RI3G A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		RI3G A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Loop

	Deselect:
		RIFG A 0
		RIFG A 0 A_Takeinventory("Zoomed",1)
		RIFG A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_TakeInventory("TossGrenade", 1)
		RIFG A 0 A_TakeInventory("Kicking",1)
        RIFG A 0 A_TakeInventory("Taunting",1)
        RIFG A 0 A_TakeInventory("Reloading",1)
		RIFG A 0 A_TakeInventory("Unloading",1)
		RIFG A 0 A_TakeInventory("Salute1", 1)
		RIFG A 0 A_TakeInventory("Salute2", 1)
		RIFG A 0 A_Takeinventory("RifleSelected",1)
		MGN1 A 0 A_Takeinventory("RandomHeadExploder", 1)
        RIFG A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_SetCrosshair(0)
		RIFS CBA 1
		TNT1 AAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Wait

	Select:
		RIFG A 0
		RIFG A 0 A_Takeinventory("StartDualWield",1)
		RIFG A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_TakeInventory("FistsSelected", 1)
		TNT1 A 0 A_TakeInventory("ShotgunSelected", 1)
		TNT1 A 0 A_TakeInventory("MinigunSelected", 1)
		TNT1 A 0 A_TakeInventory("SSGSelected", 1)
		TNT1 A 0 A_TakeInventory("RocketLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("GrenadeLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("PlasmaGunSelected", 1)
		TNT1 A 0 A_TakeInventory("RailGunSelected", 1)
		TNT1 A 0 A_TakeInventory("RevenantLauncherSelected", 1)
		TNT1 A 0 A_TakeInventory("SubMachineGunSelected", 1)
		TNT1 A 0 A_TakeInventory("BFG10KSelected", 1)
		TNT1 A 0 A_TakeInventory("BFGSelected", 1)
		TNT1 A 0 A_TakeInventory("FlameCannonSelected", 1)
		TNT1 A 0 A_TakeInventory("SawSelected", 1)
		RIFG A 0 A_Takeinventory("HasBarrel",1)
		RIFG A 0 A_TakeInventory("TossGrenade", 1)
		RIFG A 0 A_TakeInventory("DualRifles", 1)
		MGN1 A 0 A_GiveInventory("RandomHeadExploder", 1)
		RIFG A 0 A_GunFlash
		TNT1 A 1 A_Raise
		TNT1 AAAAAAAAAAAA 0 A_Raise
		Goto SelectAnimation

    Fire:
		RIFG A 0
        RIFG A 0 A_JumpIfInventory("RifleAmmo",1,1)
        Goto NoAmmo
        RIFG A 0

		RIFG A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
		RIFF A 1 BRIGHT
		RIFG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		RIFF B 1 A_FireBullets (0.6, 0.7, -1, 18, "HitPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
		RIFG A 0 A_AlertMonsters
		RIFF A 0 A_FireCustomMissile("DistantFireSoundRifle", random(-1,1), 0, 0, -12, 0, random(-1,1))
		RIFG A 0 A_Takeinventory("DoubleRifleAmmo",1)
        RIFG A 0 A_PlaySound("weapons/rifle", 1)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,0,0,0,random(-1,1))
		RIFG A 0 A_Takeinventory("RifleAmmo",1)
		RIFF C 1 A_FireCustomMissile("RifleCaseSpawn",5,0,5,-8)
		TNT1 A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 2)//tactical mode has muzzle climb
		RIFG A 0 A_SetPitch(pitch-0.4)
		RIFG A 1
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, 2)//Tactical mode skips a frame, fires faster
		RIFG A 1
		RIFG A 1 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready3

	Fire2:
		RI2G A 0
		RIFG A 0 A_JumpIfInventory("UseScope",1,"Fire3")
		RI2F A 1 BRIGHT
		RI2G A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		RI2F B 1 A_FireBullets (0.3, 0.4, 1, 18, "HitPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(1.29)
        RIFG A 0 A_AlertMonsters
		RIFF A 0 A_FireCustomMissile("DistantFireSoundRifle", random(-1,1), 0, 0, -12, 0, random(-1,1))
		RIFG A 0 A_Takeinventory("DoubleRifleAmmo",1)
        RIFG A 0 A_PlaySound("weapons/rifle", 1)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",0,0,0,0,0,0)
		RIFG A 0 A_Takeinventory("RifleAmmo",1)
		RI2F C 1 A_FireCustomMissile("RifleCaseSpawn",5,0,5,0)
		TNT1 A 0 A_ZoomFactor(1.3)
		RI2G A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 2)
		RI2G A 0 A_SetPitch(pitch-0.3)
		RI2G A 1
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, 2)//Tactical mode skips a frame, fires faster
		RI2G A 1
		RI2F A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")//If still pressing alt fire, it means its holding aim
		RI2G A 1 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready2

     Fire3:
		RI3G A 0
		RI3F A 1 BRIGHT
		RI3G A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		RI3F B 1 BRIGHT A_FireBullets (0.1, 0.2, 1, 18, "HitPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(3.99)
        RIFG A 0 A_AlertMonsters
		RIFF A 0 A_FireCustomMissile("DistantFireSoundRifle", random(-1,1), 0, 0, -12, 0, random(-1,1))
		RIFG A 0 A_Takeinventory("DoubleRifleAmmo",1)
        RIFG A 0 A_PlaySound("weapons/rifle", 1)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",0,0,0,0,0,0)
		RIFG A 0 A_Takeinventory("RifleAmmo",1)
		RI3F C 1 BRIGHT A_FireCustomMissile("RifleCaseSpawn",5,0,5,0)
		TNT1 A 0 A_ZoomFactor(4.0)
		RI3G A 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 2)
		RI3G A 0 A_SetPitch(pitch-0.2)
		RI3G A 1 BRIGHT
		TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, 2)//Tactical mode skips a frame, fires faster
		RI3G A 1 BRIGHT
		RI3F A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAimScope")//If still pressing alt fire, it means its holding aim
		RI3G A 1 BRIGHT A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready4

	AltFire:
        RI2G A 0
		RI2G A 0 A_Giveinventory("GoSpecial",1)
		RI2G A 0 A_JumpIfInventory("UseScope",1,"Altfire2")
		RI2G A 0 A_JumpIfInventory("Zoomed",1,"NoAim")
		RI2G A 0 A_Giveinventory("Zoomed",1)
		RI2G A 0 A_Giveinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(41)
        RIFZ ABC 1
		RI2G A 0 A_ZoomFactor(1.3)

		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1
		RI2G A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")
        Goto Ready2

	   HoldAim:
		RI2G A 0
	    RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		RI3G A 0 A_JumpIfInventory("StartDualWield",1,"RaiseScope")
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		RI3G A 0 A_JumpIfInventory("StartDualWield",1,"RaiseScope")
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		RI3G A 0 A_JumpIfInventory("StartDualWield",1,"RaiseScope")
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		RI3G A 0 A_JumpIfInventory("StartDualWield",1,"RaiseScope")
		RI2G A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")

       NoAim:
		RIFG A 0
		RIFG A 0 A_Takeinventory("Zoomed",1)
		RIFG A 0 A_Takeinventory("ZoomHold",1)
        RIFG A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(0)
		RIFZ CBA 1
        Goto Ready3

	RaiseScope:
        RI3G A 0
		RI3G A 0 A_Takeinventory("StartDualWield",1)
		RI3G A 0 A_Giveinventory("UseScope",1)
		RIFG A 0 A_SetCrosshair(41)
        RIFZ DEF 1
		RI3G A 0 A_ZoomFactor(4.0)

		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT
		RI3G A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAimScope")
        Goto Ready4

    AltFire2:
        RI3G A 0
		RI3G A 0 A_Giveinventory("GoSpecial",1)
		RI3G A 0 A_JumpIfInventory("Zoomed",1,"NoAim2")
		RI3G A 0 A_Giveinventory("Zoomed",1)
		RI3G A 0 A_Giveinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(41)
        RIFZ ABC 1
		RI3G A 0 A_ZoomFactor(1.3)
		RIFZ DEF 1
		RI3G A 0 A_ZoomFactor(4.0)

		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT
		RI3G A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAimScope")
        Goto Ready4

	   HoldAimScope:
	    RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT A_WeaponReady(WRF_ALLOWRELOAD)
		RI3G A 0 A_JumpIfInventory("StartDualWield",1,"LowerScope")
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT A_WeaponReady(WRF_ALLOWRELOAD)
		RI3G A 0 A_JumpIfInventory("StartDualWield",1,"LowerScope")
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT A_WeaponReady(WRF_ALLOWRELOAD)
		RI3G A 0 A_JumpIfInventory("StartDualWield",1,"LowerScope")
		RI3G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI3G A 1 BRIGHT A_WeaponReady(WRF_ALLOWRELOAD)
		RI3G A 0 A_JumpIfInventory("StartDualWield",1,"LowerScope")
		RI3G A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAimScope")

       NoAim2:
		RIFG A 0
		RIFG A 0 A_Takeinventory("Zoomed",1)
		RIFG A 0 A_Takeinventory("ZoomHold",1)
        RIFG A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_SetCrosshair(0)
		RIFZ FEDCBA 1
        Goto Ready3

	LowerScope:
        RI2G A 0
		RI2G A 0 A_Takeinventory("StartDualWield",1)
		RI2G A 0 A_TakeInventory("UseScope",1)
		RIFG A 0 A_SetCrosshair(41)
        RIFZ FED 1
		RI2G A 0 A_ZoomFactor(1.3)

		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1
		RI2G A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		RI2G A 1
		RI2G A 0 A_JumpIfInventory("FiredSecondary",1,"HoldAim")
        Goto Ready2

	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_SetCrosshair(0)
		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("ExecuteDownedEnemy", 1, "DoExecution")
		RIFG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		RIFG A 5 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOPRIMARY)
		RIFG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RIFG A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, 2)
		RIFG A 0 A_JumpIfInventory("Clip2",1,"Reload")
		RIFG A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Goto Ready3

    Reload:
		RIFG A 1
		RIFG A 0 A_Takeinventory("Reloading",1)
		RIFG A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_Takeinventory("Zoomed",1)
		RIFG A 0 A_SetCrosshair(0)
		RIFG A 0 A_JumpIfInventory("RifleAmmo",31,"Ready")
        RIFG A 0 A_JumpIfInventory("Clip2",1,3)
        Goto Ready
        TNT1 AAA 0
		RIFG A 0 A_GiveInventory ("Pumping", 1)
		RIFG A 0 A_Takeinventory("Reloading",1)
		RIFG A 0 A_JumpIfInventory("TurboReload",1,"TurboReload")
		RIFG A 0 A_JumpIfInventory("RifleUnloaded", 1, "PutMag")
		RIFG A 0 A_PlaySound("RELO1")
		RIFG A 0 A_FireCustomMissile("EmptyClipSpawn",0,0,0,-20)
        RIFR ABCDEF 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        RIFR G 8 A_JumpIfInventory("Kicking",1,"DoKick")
	PutMag:
		RIFR G 8 A_JumpIfInventory("Kicking",1,"DoKick")
		RIFR HIJKLM 1
		RIFR N 1 A_PlaySound("RELO2")
		RIFR OPQRST 1
		RIFG A 0 A_Takeinventory("RifleUnloaded",1)
		RIFG A 0 A_JumpIfInventory("RifleAmmo",1,"InsertBullets2")//30+1 effect
		Goto InsertBullets

	TurboReload:
		RIFG A 0 A_Takeinventory("RifleUnloaded",1)
		RIFG A 0 A_JumpIfInventory("Clip2",1,1)
		Goto Ready
		RIFG A 0
        Goto InsertBullets2

	InsertBullets:
		TNT1 AAAA 0
		RIFG A 0 A_JumpIfInventory("RifleAmmo",30,15)
		RIFG A 0 A_JumpIfInventory("Clip2",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		RIFG A 0 A_Giveinventory("RifleAmmo",1)
		RIFG A 0 A_Giveinventory("DoubleRifleAmmo",1)
		RIFG A 0 A_Takeinventory("Clip2",1)
		Goto InsertBullets

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

		RIFG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready
		TNT1 AAAA 0
		RIFG A 1 A_Takeinventory("Reloading",1)

		RIFG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready

	InsertBullets2:
		TNT1 AAAA 0
		RIFG A 0 A_JumpIfInventory("RifleAmmo",31,15)
		RIFG A 0 A_JumpIfInventory("Clip2",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		RIFG A 0 A_Giveinventory("RifleAmmo",1)
		RIFG A 0 A_Giveinventory("DoubleRifleAmmo",1)
		RIFG A 0 A_Takeinventory("Clip2",1)
		Goto InsertBullets2

		TNT1 AAAAAAAAAA 0
		RIFG A 1 A_Takeinventory("Reloading",1)
		RIFG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready
		TNT1 AAAA 0
		RIFG A 1 A_Takeinventory("Reloading",1)

		RIFG A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
        Goto Ready

	Unload:
		RIFG A 1 A_WeaponReady
		RIFG A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_Takeinventory("Unloading",1)
		RIFG A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_Takeinventory("Zoomed",1)
		RIFG A 0 A_SetCrosshair(0)
        RIFG A 0 A_JumpIfInventory("RifleAmmo",1,3)
        Goto Ready
        TNT1 AAA 0
		RIFR TSRQPO 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		RIFR N 1 A_PlaySound("RELO1")
		RIFR MLKJIH 1
		RIFR G 8
		RIFG A 0 A_GiveInventory("RifleUnloaded", 1)

	RemoveBullets:
		TNT1 AAAA 0
		RIFG A 0 A_JumpIfInventory("RifleAmmo",1,3)
		Goto FinishUnload
        TNT1 AAAAAA 0
		RIFG A 0 A_Takeinventory("RifleAmmo",1)
		RIFG A 0 A_Takeinventory("DoubleRifleAmmo",1)
		RIFG A 0 A_Giveinventory("Clip2",1)
		Goto RemoveBullets

	FInishUnload:
		RIFG A 0 A_GiveInventory("RifleUnloaded", 1)
		RIFG A 0 A_Takeinventory("Unloading",1)
		Goto Ready3

 	Spawn:
		RIFL A -1
		Stop

	DualWield:
		RIFG A 0
		RIFG A 1 A_Takeinventory("StartDualWield",1)
		RIFG A 0 A_JumpIfInventory("IsTacticalClass", 1, "NoDual")//Tactical mode cant dual
		RIFG A 0 A_JumpIfInventory("HasDualRifle", 1, "GetDual")
		RIFG A 0 A_Print("You must have two identical weapons to dual wield.")
		Goto Ready

	NoDual:
		RIFG A 1
		RIFG A 0 A_Print("You can't dual wield rifles when playing in Tactical Mode.",1)
		Goto Ready

	 GetDual:
		RIFG A 0 A_Takeinventory("Zoomed",1)
		RIFG A 0 A_Takeinventory("ADSmode",1)
		RIFG A 0 A_TakeInventory("TossGrenade", 1)
		RIFG A 0 A_TakeInventory("Kicking",1)
        RIFG A 0 A_TakeInventory("Taunting",1)
        RIFG A 0 A_TakeInventory("Reloading",1)
		RIFG A 0 A_TakeInventory("Unloading",1)
		RIFG A 0 A_TakeInventory("Salute1", 1)
		RIFG A 0 A_TakeInventory("Salute2", 1)
		RIFG A 0 A_GiveInventory("DualRifles",1)
        RIFG A 0 A_ZoomFactor(1.0)
		RIFG A 0 A_SetCrosshair(0)
		RIFG A 0 A_SelectWEapon("DualRifles")
		Goto Ready

	Execution2:
		RIFG A 0
		RIFG A 0 A_ZoomFactor(1.0)
		RIBB A 1 A_Stop
        RIBB B 1 A_PlaySound("skeleton/swing")
		TNT1 A 0 A_GiveInventory("Punching",1)
		RIBB C 1 A_FireCustomMissile("ExecutionAttackMelee", 0, 0, 0, 0)
		RIBB D 6 A_Stop
		RIBB CBA 2 A_Stop

		RIBB A 1 A_Stop
        RIBB B 1 A_PlaySound("skeleton/swing")
		TNT1 A 0 A_GiveInventory("Punching",1)
		RIBB C 1 A_FireCustomMissile("ExecutionAttackMelee", 0, 0, 0, 0)
		RIBB D 6 A_Stop
		RIBB CBA 2 A_Stop

		RIBB A 1 A_Stop
        RIBB B 1 A_PlaySound("skeleton/swing")
		TNT1 A 0 A_GiveInventory("Punching",1)
		RIBB C 1 A_FireCustomMissile("ExecutionAttackKick", 0, 0, 0, 0)
		RIBB D 6 A_Stop
		RIBB CBA 2 A_Stop
		TNT1 A 5 A_Stop
		Goto FinishExecution
	}
}

ACTOR RifleAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 31
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 31
   Inventory.Icon "RIFLA0"
}

ACTOR MeatshieldGunAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 30
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 30
}

ACTOR MeatAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 100
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 100
}