
ACTOR FlameCannon : BrutalWeapon
{
	Height 20
	Weapon.SelectionOrder 5550
	Weapon.AmmoUse 0
	Weapon.AmmoGive 40
	Weapon.AmmoType "Gas"
    Inventory.PickupSound "BFGREADY"
     +WEAPON.NOAUTOAIM
	Inventory.PickupMessage "You got the Mancubus Flame Cannon (Slot 9)"
	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")
		FLMG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		Goto Ready3
		
	CheckSprint:
		FLMG A 1 A_WeaponReady(WRF_NOFIRE)
		FLMG A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		FLMG A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	StartSprint:
		FLMG A 1 A_WeaponReady(WRF_NOFIRE)
		FLMG A 0 A_Takeinventory("Zoomed",1)
		FLMG A 0 A_Takeinventory("ADSmode",1)
		FLMG A 0 A_ZoomFactor(1.0)
		FLMG A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		FLMG A 0 offset(-9,32) 
		FLMG A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		FLMG 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.
		FLMG A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		FLMG A 0 offset(-9,32) A_GiveInventory("UsedStamina", 8)
		FLMG A 0 offset(-9,32)
		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)
		FLMG A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		FLMG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        FLMG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        FLMG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		FLMG A 0 offset(-9,32) A_GiveInventory("UsedStamina", 8)
		FLMG A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		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)
		FLMG A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		FLMG A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint
		
	StopSprintTired:
		FLMG A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		FLMG A 0 A_PlaySound("Tired", 2)
		FLMG A 0 A_TakeInventory("UsedStamina", 2)
		FLMG A 5 A_WeaponReady
		FLMG A 0 A_TakeInventory("UsedStamina", 2)
		FLMG A 5 A_WeaponReady
		FLMG A 0 A_TakeInventory("UsedStamina", 2)
		FLMG A 5 A_WeaponReady
		FLMG A 0 A_TakeInventory("UsedStamina", 2)
		FLMG A 5 A_WeaponReady
		FLMG A 0 A_TakeInventory("UsedStamina", 2)
		FLMG A 5 A_WeaponReady
		Goto Ready
	StopSprint:
		FLMG A 1
		FLMG A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		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)
		FLMG A 1 A_Lower
		Loop
	Select:
		FLMG A 0 A_Giveinventory("GoSpecial",1)
		FLMG A 0 A_Takeinventory("FistsSelected",1)
		FLMG A 0 A_Takeinventory("SawSelected",1)
		FLMG A 0 A_Takeinventory("ShotgunSelected",1)
		FLMG A 0 A_Takeinventory("SSGSelected",1)
		FLMG A 0 A_Takeinventory("MinigunSelected",1)
		FLMG A 0 A_Takeinventory("PlasmaGunSelected",1)
		FLMG A 0 A_Takeinventory("RocketLauncherSelected",1)
		FLMG A 0 A_Takeinventory("GrenadeLauncherSelected",1)
		FLMG A 0 A_Takeinventory("BFGSelected",1)
		FLMG A 0 A_Takeinventory("BFG10kSelected",1)
		FLMG A 0 A_Takeinventory("RailGunSelected",1)
		FLMG A 0 A_Takeinventory("SubMachineGunSelected",1)
		FLMG A 0 A_Takeinventory("RevenantLauncherSelected",1)
		FLMG A 0 A_Takeinventory("LostSoulSelected",1)
		FLMG A 0 A_Giveinventory("FlameCannonSelected",1)
		FLMG A 0 A_Takeinventory("HasBarrel",1)
		FLMG A 0 A_TakeInventory("TossGrenade", 1)
		FLMG AAA 1 A_Raise
		
		FLMG A 0 A_PlaySound("BFGREADY")
        TNT1 AAA 0
		TNT1 AAAAAAAAA 0 A_Raise
		Goto SelectAnimation
		
	SelectAnimation:
		TNT1 A 1
		FLMG A 0 A_GunFlash
		Goto Ready
		
    Spawn:
        MANA H 1
        Loop
		
	 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:	
        FLMF A 1 BRIGHT A_FireCustomMissile("BigFireBallWithGravity", 0, 1, 0, -6)
		FLMG A 0 A_SetPitch(-4.0 + pitch)
		FLMG A 0 A_TakeInventory("Gas", 16)
		TNT1 AAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("Shotgunparticles2", random(-12,12), 0, 0, -2, 0, random(-9,9))
		FLMG A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        FLMF BC 1 BRIGHT 
        FLMF CD 1 A_SetPitch(+2.0 + pitch)
		FLMG A 5
		Goto Ready+2
	
 
		
	Flamethrower:
        FLMG A 0 BRIGHT A_FireCustomMissile("FlamethrowerMissile", 0, 1, 0, -12, 0, 8)
		TNT1 AAA 0 BRIGHT A_FireCustomMissile("Shotgunparticles2", random(-12,12), 0, 0, -2, 0, random(-9,9))
		FLMG A 0 A_PlaySound("FLAMER", CHAN_WEAPON, 1, 1)
		
		FLMG A 0 A_TakeInventory("Gas", 7)
		FLMF FG 1 BRIGHT A_SetAngle(random(1, -1) + angle)
		FLMG A 0 BRIGHT A_SetPitch(random(1, -1) + pitch)
		
		FLMG A 0 BRIGHT A_FireCustomMissile("FlamethrowerMissileNoLight", 0, 1, 0, -12, 0, 8)
		TNT1 AAA 0 BRIGHT A_FireCustomMissile("Shotgunparticles2", random(-12,12), 0, 0, -2, 0, random(-9,9))
		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, -12, 0, 8)
		FLMG A 0 BRIGHT A_FireCustomMissile("Shotgunparticles2", random(-12,12), 0, 0, -2, 0, random(-9,9))
		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, -12, 0, 8)
		FLMG A 0 BRIGHT A_FireCustomMissile("Shotgunparticles2", random(-12,12), 0, 0, -2, 0, random(-9,9))
		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+6
	}
}

ACTOR BigFireBallWithGravity: BigFireBall
{
Damage (random (100, 100))
Gravity 0.2
+NOGRAVITY
Speed 50
Damagetype "Fire"
States
{
	Death:
	FLMG A 0
    FLMG A 0 A_Explode (60, 150)
	Goto ExplosionEffect
}
}






ACTOR Flames
{
	Radius 6
	Height 8
	Speed 30
	Damage 1
	Projectile 
	+RANDOMIZE
	+FORCEXYBILLBOARD
    +RIPPER
    +BLOODLESSIMPACT 
	RenderStyle Add
    DamageType Flames
    Scale 2.0
	Alpha 1
	SeeSound "fatso/attack"
	DeathSound "fatso/shotx"
    Decal "BigScorch"
	States
	{
    Spawn:
        TNT1 C 6
        Goto See
	See:
        FLMG A 0 A_Explode (15, 40)
        FRFX C 2 BRIGHT A_SpawnItem("RedFlareMedium",0,0)
        FLMG A 0 A_Explode (15, 40)
        FRFX C 2 BRIGHT A_SpawnItem("RedFlareMedium",0,0)
        FLMG A 0 A_Explode (15, 40)
	    EXPL AA 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
        FLMG A 0 A_Explode (15, 40)
        FRFX FGHIJKLMNOPG 2 BRIGHT A_SpawnItem("RedFlareMedium",0,0)
		Goto Death
	Death:
	    EXPL AA 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
	    FLMG A 0 A_SpawnItem("RedFlareMedium",0,0)
		Stop
	}
}