ACTOR HellishMissileLauncher : BrutalWeapon
{
	Height 20
	Weapon.SelectionOrder 3100
	Weapon.AmmoUse1 0
	Weapon.AmmoGive 2
	Weapon.AmmoType1 "MiniHellRocketAmmo"
    Inventory.PickupSound "BFGREADY"
    +WEAPON.NOAUTOAIM
	+WEAPON.EXPLOSIVE
	Inventory.PickupMessage "You got the Revenant's Hellish Missile Launcher (Slot 8)"
	Tag "Hellish Missile Launcher"
	Scale 0.8
	DropItem "HMLSpawner"
	States
	{
	Steady:
	TNT1 A 1
	Goto Ready
	Ready:
	Ready3:
	Reload:
		RVCG A 1 A_WeaponReady
		RVCG A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        RVCG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        RVCG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		RVCG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		RVCG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		RVCG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		RVCG A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Goto Ready3

	StartSprint:
		RVCG A 1 A_WeaponReady
		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:
		RVCG A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		RVCG A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		RVCG A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		RVCG A 1 offset(0,38) A_SetPitch(pitch -0.5)
		RVCG A 1 offset(3,36) A_SetPitch(pitch -0.5)
		RVCG A 1 offset(6,34) A_SetPitch(pitch -0.5)
		RVCG A 1 offset(9,32) A_SetPitch(pitch -0.5)
		TNT1 A 0 A_GiveInventory("UsedStamina", 1)
		SMGG A 0 A_WeaponReady(WRF_NOBOB)
		SMGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SMGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")

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

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

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

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

	Deselect:
		RVCG A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_TakeInventory("Unloading", 1)
		TNT1 A 0 A_TakeInventory("Reloading", 1)
		TNT1 A 0 A_TakeInventory("StartDualWield",1)
		TNT1 AAAAAAAAAAAA 0 A_Lower
		RVCG AAAA 1 A_Lower
		Loop
	Select:
		RVCG 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_GiveInventory("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)
		RVCG A 0 A_Takeinventory("HasBarrel",1)
		RVCG A 0 A_TakeInventory("TossGrenade", 1)
		RVCG A 0 A_GunFlash
		RVCG AAAA 1 A_Raise
		RVCG A 0 A_PlaySound("BFGREADY")
		TNT1 AAAAAAAAAAAA 0 A_Raise
		Goto Ready

    Spawn:
        FATB D -1
        Stop

	Fire:
		RVCG A 0
		TNT1 A 0 A_JumpIfInventory("MiniHellRocketAmmo", 1, 1)
		Goto Ready
		TNT1 A 0 A_TakeInventory("MiniHellRocketAmmo", 1)
		RVCG A 0 A_PlaySOund("RLANSHOT", 1)
		RVCG A 0 A_ZoomFactor(0.99)
		RVCG A 0 A_JumpIfInventory("RevenantRocketFire1823", 1, "OpenFire2")
	    RVCG A 0 A_FireCustomMissile("Alerter")
		RVCG A 0 A_SpawnItemEx("PlayerMuzzle1",32,-15,28)
        RVCG B 3 BRIGHT A_FireCustomMissile("revenantseekermissiles2", 0, 0, -24, 0)
		RVCG A 0 A_GiveInventory("RevenantRocketFire1823", 1)
		RVCG A 0 A_ZoomFactor(1.0)
		RVCG C 3 BRIGHT
		RVCG DE 3
		RVCG A 0 A_Refire
		Goto Ready

	OpenFire2:
	    RVCG A 0 A_FireCustomMissile("Alerter")
		RVCG A 0 A_SpawnItemEx("PlayerMuzzle1",32,15,28)
	    RVCG F 3 BRIGHT A_FireCustomMissile("revenantseekermissiles2", 0, 0, 24, 0)
		RVCG A 0 A_TakeInventory("RevenantRocketFire1823", 1)
		RVCG A 0 A_ZoomFactor(1.0)
		RVCG G 3 BRIGHT
		RVCG HI 3
		RVCG A 0 A_Refire
		Goto Ready

	AltFire:
		RVCG A 0
		TNT1 A 0 A_JumpIfInventory("MiniHellRocketAmmo", 1, 1)
		Goto Ready
		TNT1 A 0 A_TakeInventory("MiniHellRocketAmmo", 1)
		RVCG A 0 A_PlaySOund("RLANSHOT", 1)
		RVCG A 0 A_ZoomFactor(0.99)
		RVCG A 0 A_JumpIfInventory("RevenantRocketFire1823", 1, "AltOpenFire2")
	    RVCG A 0 A_FireCustomMissile("Alerter")
		RVCG A 0 A_SpawnItemEx("PlayerMuzzle1",32,-15,28)
        RVCG B 2 BRIGHT A_FireCustomMissile("revenantseekermissiles3", 0, 0, -24, 0)
		RVCG A 0 A_GiveInventory("RevenantRocketFire1823", 1)
		RVCG A 0 A_ZoomFactor(1.0)
		RVCG C 2 BRIGHT
		RVCG DE 2
		RVCG A 0 A_Refire
		Goto Ready

	AltOpenFire2:
	    RVCG A 0 A_FireCustomMissile("Alerter")
		RVCG A 0 A_SpawnItemEx("PlayerMuzzle1",32,15,28)
	    RVCG F 2 BRIGHT A_FireCustomMissile("revenantseekermissiles3", 0, 0, 24, 0)
		RVCG A 0 A_TakeInventory("RevenantRocketFire1823", 1)
		RVCG A 0 A_ZoomFactor(1.0)
		RVCG G 2 BRIGHT
		RVCG HI 2
		RVCG A 0 A_Refire
		Goto Ready
	}
}

ACTOR revenantseekermissiles2: revenantseekermissiles
{
	Radius 2
	Height 4
	Damage (random(48, 48))
	Speed 25
	+SCREENSEEKER
	-GHOST
	-THRUGHOST
	+THRUSPECIES
	+DONTHARMSPECIES
	-NOBLOCKMAP
	+SHOOTABLE
	+NOBLOOD
	+NOTELEPORT
	Damagetype Explosive
	Species "Marines"
}

ACTOR MarineSeekerMissile : revenantseekermissiles2
{
	DamageType "FriendBullet"
}

ACTOR revenantseekermissiles3: revenantseekermissiles2
{
	Speed 50
	Damagetype Explosive
	+NOBLOCKMAP
	-SHOOTABLE
	States
	{
		Spawn:
	    FATB AA 1 BRIGHT A_SpawnItemEx("RocketFlare",-20,0)
		TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrail2", 2, 0, random (160, 210), 2, random (-30, 30))
		Loop
	}
}

ACTOR MarineSeekerMissile2 : revenantseekermissiles3
{
	DamageType "FriendBullet"
	+NOBLOCKMAP
	-SHOOTABLE
	States
	{
		Spawn:
	    FATB AA 1 BRIGHT A_SpawnItemEx("RocketFlare",-20,0)
		TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrail2", 2, 0, random (160, 210), 2, random (-30, 30))
		Loop
	}
}

ACTOR MiniHellRocketAmmo : Ammo
{
   Inventory.Amount 1
   Inventory.MaxAmount 50
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 100
   Inventory.Icon "HMLRA0"
   Inventory.Pickupsound "RCKCLIP"
   Inventory.PickupMessage "Picked up a Hellish Missile Launcher rocket."
   +INVENTORY.NOSCREENFLASH
   Scale 0.4
	States
	{
	Spawn:
		HMLR A -1
		Stop
	}
}