ACTOR FlameCannon : BrutalWeapon
{
	Height 20
	Weapon.SelectionOrder 3300
	Weapon.AmmoUse 0
	Weapon.AmmoGive 50
	Weapon.AmmoType "Gas"
    Inventory.PickupSound "BFGREADY"
	+WEAPON.NOAUTOAIM
	+WEAPON.EXPLOSIVE
	Inventory.PickupMessage "You got the Mancubus Flame Cannon (Slot 9)"
	Tag "Mancubus Flame Cannon"
	DropItem "FlameCannonSpawner"
	States
	{
	Ready:
	Ready3:
	Reload:
		FLMG A 1 A_WeaponReady
		FLMG A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        FLMG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        FLMG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		FLMG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		FLMG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		FLMG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		FLMG A 0 A_JumpIfInventory("IsRunning",1,"StartSprint")
		Goto Ready3

	StartSprint:
		FLMG 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:
		FLMG A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		FLMG A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		FLMG A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		FLMG A 1 offset(0,38) A_SetPitch(pitch -0.5)
		FLMG A 1 offset(3,36) A_SetPitch(pitch -0.5)
		FLMG A 1 offset(6,34) A_SetPitch(pitch -0.5)
		FLMG 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")

		FLMG A 1 offset(9,34) A_SetPitch(pitch +0.5)
		FLMG A 1 offset(6,36) A_SetPitch(pitch +0.5)
		FLMG A 1 offset(3,38) A_SetPitch(pitch +0.5)
		FLMG A 1 offset(0,38) A_SetPitch(pitch +0.5)
		FLMG A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		FLMG A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		FLMG 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")

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

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

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

	DryFire:
	    FLMG A 10 A_PlaySound("weapons/empty")
		Goto Ready+6

	Deselect:
	    FLMG A 0 A_StopSound(CHAN_WEAPON)
		FLMG 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
		FLMG AAAA 1 A_Lower
		Loop
	Select:
		FLMG 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_GiveInventory("FlameCannonSelected", 1)
		TNT1 A 0 A_TakeInventory("SawSelected", 1)
		FLMG A 0 A_Takeinventory("HasBarrel",1)
		FLMG A 0 A_TakeInventory("TossGrenade", 1)
		FLMG A 0 A_GunFlash
		FLMG AAAA 1 A_Raise
		FLMG A 0 A_PlaySound("BFGREADY")
		TNT1 AAAAAAAAAAAA 0 A_Raise
		Goto Ready

    Spawn:
        MANA H -1
        Stop

	 Fire:
        FLMG A 0
		FLMG A 0 A_JumpIf(waterlevel > 1, "DryFire")
        FLMG A 0 A_JumpIfInventory("Gas", 16, "Fireball")
		FLMG A 0 A_StopSound(CHAN_WEAPON)
		Goto DryFire

	AltFire:
	    FLMG A 0
		FLMG A 0 A_JumpIf(waterlevel > 1, "DryFire")
        FLMG A 0 A_JumpIfInventory("Gas", 28, "Flamethrower")
		FLMG A 0 A_StopSound(CHAN_WEAPON)
		Goto DryFire

	Fireball:
		FLMG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		TNT1 A 0 A_FireCustomMissile("Alerter",0,0)
        FLMF A 1 BRIGHT A_FireCustomMissile("PlayerFireBall", 0, 1, 0, 0)
		FLMG A 0 A_ZoomFactor(0.99)
		FLMG A 0 A_TakeInventory("Gas", 16)
		FLMG A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        FLMF B 1 BRIGHT
		FLMG A 0 A_ZoomFactor(1.0)
		FLMF CCD 1 BRIGHT
		FLMG A 5
		Goto Ready

	Flamethrower:
        FLMG A 0 BRIGHT A_FireCustomMissile("FlamethrowerMissile", 0, 1, 0, 0, 0, 8)
		FLMG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		FLMG A 0 A_PlaySound("FLAMER", CHAN_WEAPON, 1, 1)
		TNT1 A 0 A_FireCustomMissile("Alerter",0,0)
		FLMG A 0 A_TakeInventory("Gas", 7)
		FLMF FG 1 BRIGHT

		FLMG A 0 BRIGHT A_FireCustomMissile("FlamethrowerMissileNoLight", 0, 1, 0, 0, 0, 8)
		FLMG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		FLMG A 0 A_PlaySound("FLAMER", CHAN_WEAPON, 1, 1)
		FLMG A 0 A_TakeInventory("Gas", 7)
		FLMF FG 1 BRIGHT

		FLMG A 0 BRIGHT A_FireCustomMissile("FlamethrowerMissile", 0, 1, 0, 0, 0, 8)
		FLMG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		FLMG A 0 A_PlaySound("FLAMER", CHAN_WEAPON, 1, 1)
		FLMG A 0 A_TakeInventory("Gas", 7)
		FLMF FG 1 BRIGHT

		FLMG A 0 BRIGHT A_FireCustomMissile("FlamethrowerMissileNoLight", 0, 1, 0, 0, 0, 8)
		FLMG A 0 A_SpawnItemEx("PlayerMuzzle1",32,0,28)
		FLMG A 0 A_PlaySound("FLAMER", CHAN_WEAPON, 1, 1)
		FLMG A 0 A_TakeInventory("Gas", 7)
		FLMF FG 1 BRIGHT
		FLMG A 0 A_PlaySound("FLAMSTOP", CHAN_WEAPON)
		FLMG A 14
		Goto Ready
	}
}

ACTOR PlayerFireBall: BigFireBall
{
Damage (random (100, 100))
Speed 50
+THRUSPECIES
+DONTHARMSPECIES
Damagetype "Fire"
Species "Marines"
States
{
	Spawn:
	    TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
		BLHD AB 4 BRIGHT
		TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "SpawnCheap")

	Spawn1:
		BLHD A 4 BRIGHT A_SpawnItem ("CoolandNewFlameTrailsMedium")
		TNT1 A 0 A_CustomMissile ("RocketSmokeTrail52", 2, 0, random (70, 110), 2, random (0, 360))
		BLHD B 4 BRIGHT A_SpawnItem ("CoolandNewFlameTrailsMedium")
		TNT1 A 0 A_CustomMissile ("RocketSmokeTrail52", 2, 0, random (70, 110), 2, random (0, 360))
		Loop

	SpawnCheap:
		BLHD AB 4 BRIGHT
		Loop

	Death:
		FLMG A 0
		FLMG A 0 A_Explode (8, 8, 1)
		TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DeathCheap")
		TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_SpawnItemEx ("DetectFloorCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_SpawnItemEx ("DetectCeilCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles", 0, 0, random (0, 360), 2, random (40, 90))
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles2", 0, 0, random (0, 360), 2, random (40, 90))
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles3", 10, 0, random (0, 360), 2, random (40, 90))
		EXPL A 0 A_CustomMissile ("FlamethrowerFireParticles", 6, 0, random (0, 360), 2, random (0, 90))
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece", random (-15, 15), random (-15, 15))
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-35, 35), random (-35, 35))
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-45, 45), random (-45, 35))
		TNT1 A 20 A_CustomMissile ("BigBlackSmoke", 0, 0, random (0, 360), 2, random (40, 160))
		Stop

		DeathCheap:
		XDeath:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles", 0, 0, random (0, 360), 2, random (40, 90))
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles2", 0, 0, random (0, 360), 2, random (40, 90))
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles3", 10, 0, random (0, 360), 2, random (40, 90))
		EXPL A 0 A_CustomMissile ("FlamethrowerFireParticles", 6, 0, random (0, 360), 2, random (0, 90))
		Stop
		}
}

ACTOR MarineFireBall : PlayerFireBall
{
	DamageType "FriendBullet"
}