ACTOR DualRifles : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.SelectionOrder 900
	Weapon.AmmoType1 "Clip2"
	Weapon.AmmoType2 "dOUBLERifleAmmo"
	Obituary "%o was shot down by %k's assault rifle."
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "You got dual rifles! (Slot 2)"
    +WEAPON.NOAUTOAIM
	+WEAPON.NO_AUTO_SWITCH
	Tag "Dual Rifles"
	DropItem "RifleSpawner"
	States
	{

	TacticalWarning:
		TNT1 A 4
		DURI A 0 A_Print("Warning! You are playing on Tactical Mode. This mode is very different from the regular game (sprint is limited, guns have more recoil, etc.) and is only recommended for advanced players wanting a more tactical experience. If you want to play the original arcade-ish experience of Brutal Doom, restart the game as a different 'player class'.", 4)
		Goto LetsGetStarted
	WarmUp:
		DURI A 0
		DURI A 0 A_TakeInventory("JustStartedGame", 1)
		DURI A 0 A_JumpIfInventory("IsTacticalClass", 1, "TacticalWarning")

	LetsGetStarted:
		TNT1 A 5 A_WeaponReady
		PUNS ABCD 1 A_WeaponReady
		DURI 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
		DURI A 0 A_PlaySound("DryFire")
		RIFR M 1 A_WeaponReady
		RIFR NOPQRST 1 A_WeaponReady
		Goto Ready

	StartSprint:
		DURI 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:
		DURR A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		DURR A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		DURR A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		DURR A 1 offset(0,38) A_SetPitch(pitch -0.5)
		DURR A 1 offset(3,36) A_SetPitch(pitch -0.5)
		DURR A 1 offset(6,34) A_SetPitch(pitch -0.5)
		DURR A 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 3)
		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")

		DURR A 1 offset(9,34) A_SetPitch(pitch +0.5)
		DURR A 1 offset(6,36) A_SetPitch(pitch +0.5)
		DURR A 1 offset(3,38) A_SetPitch(pitch +0.5)
		DURR A 1 offset(0,38) A_SetPitch(pitch +0.5)
		DURR A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		DURR A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		DURR A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 3)
		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:
		DURI A 0 A_JumpIfInventory("PowerStrength", 1, 2)
		DURI A 0 A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		DURI A 1 ACS_NamedExecuteAlways("BDTacticalSpeed", 0, 0, 0, 0)//Makes player slower.
		Goto Ready

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

	SelectAnimation:
        TNT1 A 1 A_JumpIfInventory("GoFatality", 1, "Steady")
		DURI A 0 A_JumpIfInventory("JustStartedGame",1,"WarmUp")
        DURI A 0 A_PlaySound("CLIPIN")
		DURI A 0 A_Takeinventory("BDWeaponACtion",1)
        DURI A 1 Offset(0, 50)
		DURI A 1 Offset(0, 42)
		DURI A 1 Offset(0, 38)
		DURI A 1 Offset(0, 34)
		DURI A 0 A_Takeinventory("StartDualWield",1)
		Goto Ready

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


	DualWield:
		DURI A 1
		DURI A 0 A_GiveInventory("Rifle",1)
		DURI A 0 A_Takeinventory("StartDualWield",1)
		DURI A 0 A_SelectWEapon("Rifle")
		Goto Ready

	Deselect:
		DURI A 0
		DURI A 0 A_Takeinventory("Zoomed",1)
		DURI A 0 A_Takeinventory("ADSmode",1)
		DURI A 0 A_TakeInventory("TossGrenade", 1)
		DURI A 0 A_TakeInventory("Kicking",1)
        DURI A 0 A_TakeInventory("Taunting",1)
        DURI A 0 A_TakeInventory("Reloading",1)
		DURI A 0 A_TakeInventory("Unloading",1)
		DURI A 0 A_TakeInventory("Salute1", 1)
		DURI A 0 A_TakeInventory("Salute2", 1)
		DURI A 0 A_Takeinventory("RifleSelected",1)
		MGN1 A 0 A_TakeInventory("RandomHeadExploder", 1)
        DURI A 0 A_ZoomFactor(1.0)

		DURI A 1 Offset(0, 34)
		DURI A 1 Offset(0, 38)
		DURI A 1 Offset(0, 42)
		DURI A 1 Offset(0, 50)
		TNT1 AAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Wait

	Select:
		DURI A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_GiveInventory("HasDualRifle",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)
		DURI A 0 A_Takeinventory("HasBarrel",1)
		DURI A 0 A_TakeInventory("TossGrenade", 1)
		DURI A 0 A_TakeInventory("Rifle", 1)
		MGN1 A 0 A_GiveInventory("RandomHeadExploder", 1)
		DURI A 0 A_GunFlash
		TNT1 A 1 A_Raise
		TNT1 AAAAAAAAAAAA 0 A_Raise
		Goto SelectAnimation

    Fire:
        TNT1 A 0
		DRUI A 0 A_JumpIfInventory("RifleAmmo",1,1)
		Goto FireLeft
		RIFF A 0 A_FireCustomMissile("DistantFireSoundRifle", random(-1,1), 0, 0, -12, 0, random(-1,1))
        DURI A 0 A_PlaySound("weapons/rifle", 1)
		DURI A 0 A_SpawnItemEx("PlayerMuzzle1",32,6,28)
		DURI B 1 BRIGHT A_FireBullets (1.6, 1.2, -1, 18, "HitPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,8,0,0,random(-1,1))
        DURI A 0 A_SetPitch(-0.4 + pitch)
		DURI A 0 A_Takeinventory("RifleAmmo",1)
		DURI A 0 A_Takeinventory("DoubleRifleAmmo",1)
		DURI C 1 A_FireCustomMissile("RifleCaseSpawn",5,0,24,-8)
		TNT1 A 0 A_ZoomFactor(1.0)

		DURI A 0 A_JumpIfInventory("DoubleRifleAmmo",1,1)
        Goto NoAmmo
		RIFF A 0 A_FireCustomMissile("DistantFireSoundRifle", random(-1,1), 0, 0, -12, 0, random(-1,1))
        DURI A 0 A_PlaySound("weapons/rifle", 6)
		DURI A 0 A_SpawnItemEx("PlayerMuzzle1",32,-6,28)
		DURI D 1 BRIGHT A_FireBullets (1.6, 1.2, -1, 18, "HitPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
        DURI A 0 A_SetPitch(-0.4 + pitch)
		DURI A 0 A_Takeinventory("DoubleRifleAmmo",1)
		DURI E 1 A_FireCustomMissile("RifleCaseSpawn",5,0,-12,-8)
		TNT1 A 0 A_ZoomFactor(1.0)
		DURI A 1
		DURI A 1 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready

	FireLeft:
        TNT1 A 0
		DURI A 0 A_JumpIfInventory("DoubleRifleAmmo",1,1)
        Goto NoAmmo
		RIFF A 0 A_FireCustomMissile("DistantFireSoundRifle", random(-1,1), 0, 0, -12, 0, random(-1,1))
        DURI A 0 A_PlaySound("weapons/rifle", 6)
		DURI A 0 A_SpawnItemEx("PlayerMuzzle1",32,-6,28)
		DURI D 1 BRIGHT A_FireBullets (1.6, 1.2, -1, 18, "HitPuff", FBF_NORANDOM)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,-8,0,0,random(-1,1))
        DURI A 0 A_SetPitch(-0.4 + pitch)
		DURI A 0 A_Takeinventory("DoubleRifleAmmo",1)
		DURI E 1 A_FireCustomMissile("RifleCaseSpawn",5,0,-12,-8)
		TNT1 A 0 A_ZoomFactor(1.0)
		DURI A 3
		DURI A 1 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready


	NoAmmo:
		DURI 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("ExecuteDownedEnemy", 1, "DoExecution")
		RIFG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		DURI A 4 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, 2)
		RIFG A 0 A_JumpIfInventory("Clip2",1,"Reload")
		RIFG A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Goto Ready3

    Reload:
		DURI A 1
		DURI A 0 A_ZoomFactor(1.0)
		DURI A 0 A_Takeinventory("Reloading",1)
		DURI A 0 A_Takeinventory("ADSmode",1)
		DURI A 0 A_Takeinventory("Zoomed",1)
		DURI A 0 A_JumpIfInventory("DoubleRifleAmmo",62,"Ready")
        DURI A 0 A_JumpIfInventory("Clip2",1,3)
        Goto Ready
        TNT1 AAA 0
		DURI 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,10,-20)
        R2RL ABCDEF 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        R2RL G 8 A_JumpIfInventory("Kicking",1,"DoKick")
	PutMag:
		R2RL G 8 A_JumpIfInventory("Kicking",1,"DoKick")
		R2RL HIJKLM 1
		R2RL N 1 A_PlaySound("RELO2")
		R2RL O 4
		RIFG A 0 A_JumpIfInventory("RifleUnloaded", 1, "PutMag2")

		RIFG A 0 A_PlaySound("RELO1")
		RIFG A 0 A_FireCustomMissile("EmptyClipSpawn",225,0,-10,-20)
        R2RR ABCDEF 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        R2RR G 8 A_JumpIfInventory("Kicking",1,"DoKick")
	PutMag2:
		R2RR G 8 A_JumpIfInventory("Kicking",1,"DoKick")
		R2RR HIJKLM 1
		R2RR N 1 A_PlaySound("RELO2")
		R2RR O 4

		DURI A 0 A_Takeinventory("RifleUnloaded",1)
		DURI A 0 A_JumpIfInventory("DoubleRifleAmmo",1,"InsertBullets2")//30+1 effect
		Goto InsertBullets

	TurboReload:
		DURI A 0 A_Takeinventory("RifleUnloaded",1)
		DURI A 0 A_JumpIfInventory("Clip2",1,3)
		Goto Ready
		TNT1 AAA 0
        Goto InsertBullets2

	InsertBullets:
		TNT1 AAAA 0
		DURI A 0 A_JumpIfInventory("DoubleRifleAmmo",60,15)
		DURI A 0 A_JumpIfInventory("Clip2",1,3)
		Goto FinishReloading
        TNT1 AAAAAA 0
		DURI A 0 A_Giveinventory("RifleAmmo",1)
		DURI A 0 A_Giveinventory("DoubleRifleAmmo",1)
		DURI A 0 A_Takeinventory("Clip2",1)
		Goto InsertBullets

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

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

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

	InsertBullets2:
		TNT1 AAAA 0
		DURI A 0 A_JumpIfInventory("DoubleRifleAmmo",62,15)
		DURI A 0 A_JumpIfInventory("Clip2",1,3)
		Goto FinishReloading
        TNT1 AAAAAA 0
		DURI A 0 A_Giveinventory("RifleAmmo",1)
		DURI A 0 A_Giveinventory("DoubleRifleAmmo",1)
		DURI A 0 A_Takeinventory("Clip2",1)
		Goto InsertBullets2

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

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

	FinishReloading:
		DURI A 0
		DURI A 0 A_JumpIfInventory("FiredPrimary",1,"Fire")
		Goto Ready

	Unload:
		DURI A 1 A_WeaponReady
		DURI A 0 A_ZoomFactor(1.0)
		DURI A 0 A_Takeinventory("Unloading",1)
		DURI A 0 A_Takeinventory("ADSmode",1)
		DURI A 0 A_Takeinventory("Zoomed",1)
        DURI A 0 A_JumpIfInventory("RifleAmmo",1,3)
        Goto UnloadLeft
		TNT1 AAA 0
		R2RL O 4 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		R2RL N 1 A_PlaySound("RELO1")
		R2RL MLKJIH 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		R2RL G 8

		R2RR O 4 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		R2RR N 1 A_PlaySound("RELO1")
		R2RR MLKJIH 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		R2RR G 8
		DURI A 0 A_GiveInventory("RifleUnloaded", 1)
		Goto RemoveBullets

	UnloadLeft:
		TNT1 A 0
		DURI A 0 A_JumpIfInventory("DoubleRifleAmmo",1,3)
        Goto Ready
		TNT1 AAA 0
		R2RR O 4 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		R2RR N 1 A_PlaySound("RELO1")
		R2RR MLKJIH 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		A12R A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		R2RR G 8
		DURI A 0 A_GiveInventory("RifleUnloaded", 1)
		Goto RemoveBullets

	RemoveBullets:
		TNT1 A 0
		DURI A 0 A_JumpIfInventory("DoubleRifleAmmo",1,3)
		Goto Ready
        TNT1 AAA 0
		DURI A 0 A_Takeinventory("RifleAmmo",1)
		DURI A 0 A_Takeinventory("DoubleRifleAmmo",1)
		DURI A 0 A_Giveinventory("Clip2",1)
		Goto RemoveBullets

 	Spawn:
		RIFL A -1
		Stop
	}
}

	ACTOR DoubleRifleAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 62
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 62
   Inventory.Icon "RIFLB0"
}