



ACTOR HellishMissileLauncher : BrutalWeapon
{
	Height 20
	Weapon.SelectionOrder 1800
	Weapon.AmmoUse1 1
	Weapon.AmmoGive 4
	Weapon.AmmoType1 "MiniHellRocketAmmo"
    Inventory.PickupSound "BFGREADY"
    //+WEAPON.NOAUTOAIM
	Inventory.PickupMessage "You got the Revenant's Hellish Missile Launcher (Slot 8)"
	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")
		RVCG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		Goto Ready3
		
	CheckSprint:
		RVCG A 1 A_WeaponReady(WRF_NOFIRE)
		RVCG A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		RVCG A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	StartSprint:
		RVCG A 1 A_WeaponReady(WRF_NOFIRE)
		RVCG A 0 A_Takeinventory("Zoomed",1)
		RVCG A 0 A_Takeinventory("ADSmode",1)
		RVCG A 0 A_ZoomFactor(1.0)
		RVCG A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		RVCG A 0 offset(-9,32) 
		RVCG A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		RVCG 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.
		RVCG A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		RVCG A 0 offset(-9,32) A_GiveInventory("UsedStamina", 4)
		RVCG A 0 offset(-9,32)
		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)
		RVCG A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		RVCG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        RVCG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        RVCG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		RVCG A 0 offset(-9,32) A_GiveInventory("UsedStamina", 4)
		RVCG A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		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)
		RVCG A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		RVCG A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint
		
	StopSprintTired:
		RVCG A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		RVCG A 0 A_PlaySound("Tired", 2)
		RVCG A 0 A_TakeInventory("UsedStamina", 2)
		RVCG A 5 A_WeaponReady
		RVCG A 0 A_TakeInventory("UsedStamina", 2)
		RVCG A 5 A_WeaponReady
		RVCG A 0 A_TakeInventory("UsedStamina", 2)
		RVCG A 5 A_WeaponReady
		RVCG A 0 A_TakeInventory("UsedStamina", 2)
		RVCG A 5 A_WeaponReady
		RVCG A 0 A_TakeInventory("UsedStamina", 2)
		RVCG A 5 A_WeaponReady
		Goto Ready
	StopSprint:
		RVCG A 1
		RVCG A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready
		
	Deselect:
		RVCG A   1 A_Lower
		RVCG A 0 A_TakeInventory("TossGrenade", 1)
		Loop
	Select:
		RVCG A 0 A_Giveinventory("GoSpecial",1)
		RVCG A 0 A_Takeinventory("FistsSelected",1)
		RVCG A 0 A_Takeinventory("SawSelected",1)
		RVCG A 0 A_Takeinventory("ShotgunSelected",1)
		RVCG A 0 A_Takeinventory("SSGSelected",1)
		RVCG A 0 A_Takeinventory("MinigunSelected",1)
		RVCG A 0 A_Takeinventory("PlasmaGunSelected",1)
		RVCG A 0 A_Takeinventory("RocketLauncherSelected",1)
		RVCG A 0 A_Takeinventory("GrenadeLauncherSelected",1)
		RVCG A 0 A_Takeinventory("BFGSelected",1)
		RVCG A 0 A_Takeinventory("BFG10kSelected",1)
		RVCG A 0 A_Takeinventory("RailGunSelected",1)
		RVCG A 0 A_Takeinventory("SubMachineGunSelected",1)
		RVCG A 0 A_Giveinventory("RevenantLauncherSelected",1)
		RVCG A 0 A_Takeinventory("LostSoulSelected",1)
		RVCG A 0 A_Takeinventory("FlameCannonSelected",1)
		RVCG A 0 A_Takeinventory("HasBarrel",1)
		RVCG A 0 A_TakeInventory("TossGrenade", 1)
		RVCG A 0 A_GunFlash
		RVCG AAA 1 A_Raise
		RVCG A 0 A_PlaySound("BFGREADY")
        TNT1 AAA 0
		TNT1 AAAAAAAAAA 0 A_RAise
		Goto SelectAnimation
		
	SelectAnimation:
		TNT1 A 1
		RVCG A 0 A_GunFlash
		GOto Ready
		
    Spawn:
        FATB D 1
        Loop
		
	Fire:
		RVCG A 0
		RVCG A 0 A_PlaySOund("RLANSHOT", 1)
		RVCG A 0 A_ZoomFactor(0.97)
		RVCG A 0 A_JumpIfInventory("RevenantRocketFire1823", 1, "OpenFire2")
	    RVCG A 0 BRIGHT A_FireCustomMissile("Alerter", 0, 0, -1, 0)
        RVCG B 1 BRIGHT A_FireCustomMissile("revenantseekermissiles2", 0, 1, -15, 0)
		RVCG A 0 A_ZoomFactor(1.0)
		RVCG CDE 1
		RVCG A 3
		RVCG A 0 A_GiveInventory("RevenantRocketFire1823", 1)
		Goto Ready+6
		
	OpenFire2:
	    //RVCG A 0 BRIGHT A_FireCustomMissile("Alerter")
	    RVCG F 1 BRIGHT A_FireCustomMissile("revenantseekermissiles2", 0, 1, 15, 0)
		RVCG A 0 A_ZoomFactor(1.0)
		RVCG GHI 1
		RVCG A 3
		RVCG A 0 A_TakeInventory("RevenantRocketFire1823", 1)
		Goto Ready+6
		
		
		
	AltFire:
		RVCG A 1
		TNT1 A 0 A_JumpIfInventory("MiniHellRocketAmmo", 1, 3)
		Goto Ready
		RVCG AA 1
		TNT1 AA 0
		TNT1 A 0 A_TakeInventory("MiniHellRocketAmmo", 1)
		RVCG A 0 A_PlaySOund("RLANSHOT", 1)
		RVCG A 0 A_ZoomFactor(0.97)
		RVCG A 0 A_JumpIfInventory("RevenantRocketFire1823", 1, "AltOpenFire2")
	    RVCG A 0 BRIGHT A_FireCustomMissile("Alerter", 0, 0, -1, 0)
        RVCG B 1 BRIGHT A_FireCustomMissile("revenantseekermissiles3", 0, 1, -15, 0)
		RVCG A 0 A_ZoomFactor(1.0)
		RVCG CDE 1
		RVCG A 3
		RVCG A 0 A_GiveInventory("RevenantRocketFire1823", 1)
		Goto Ready+6
		
	AltOpenFire2:
	    //RVCG A 0 BRIGHT A_FireCustomMissile("Alerter")
	    RVCG F 1 BRIGHT A_FireCustomMissile("revenantseekermissiles3", 0, 1, 15, 0)
		RVCG A 0 A_ZoomFactor(1.0)
		RVCG GHI 1
		RVCG A 3
		RVCG A 0 A_TakeInventory("RevenantRocketFire1823", 1)
		Goto Ready+6	
	}
}

ACTOR revenantseekermissiles2: revenantseekermissiles
{
	Damage (random(50, 50))
	Speed 30
	Radius 2
	Height 2
	+SCREENSEEKER
	-GHOST
	-THRUGHOST
	Damagetype "ExplosiveImpact"
	States
	{
	Xdeath:	
	Death:
		RVCG A 0
		BFE1 A 0 Bright A_Explode(20, 120, 1)
		Goto Explodez
	}
}

ACTOR revenantseekermissiles3: revenantseekermissiles2
{
	-SCREENSEEKER
	-SEEKERMISSILE
	Damagetype "ExplosiveImpact"
}

ACTOR RevenantMissileFriendAttackSummon
{
    Radius 1
    Height 1
    Speed 0
	Mass 999999999999999999
    Health 1
    gravity 0.5
	Decal BloodSuper
	+NOCLIP
	MONSTER
	+FRIENDLY
	+LOOKALLAROUND
	-SHOOTABLE
	+MISSILEMORE
	+MISSILEEVENMORE
    States
    {
    Spawn:
	    RVCG A 0 A_Look
	    TNT1 AAA 0 A_Chase
	    TNT1 AAAAAA 1 A_Chase
		Stop
	Missile:	
		TNT1 A 1 A_FaceTarget
		RVCG A 0 A_CustomMissile("revenantseekermissiles2")
        Stop
    }
}
