/* FLARES */

Actor Flare : CustomInventory 20950
{
	+INVENTORY.INVBAR
        Inventory.InterHubAmount 20
        Inventory.MaxAmount 20
	Inventory.Icon "FLAFC0"
	Inventory.PickupMessage "You picked up a flare."
	States {
		Spawn:
			FLAF G -1
		stop
		Use:
			TNT1 A 0 A_PlaySound("Flare/Light")
			TNT1 A 0 A_SpawnItemEx ("FlareGreen", 56, 0, 28, 20, 0, 0, 0, 0)
		stop
	}
}

Actor FlareBox : CustomInventory 20951
{
  Radius 28
  Height 16
  Inventory.PickupMessage "You picked up a box of flares."
  States
  {
  Spawn:
			FLAF F -1
    Stop
  Pickup:
    TNT1 A 1 A_GiveInventory ("Flare", 5)
    Stop
  }
}

actor FlareGreen
{
	Radius 8
	Height 8
	MaxStepHeight 8
	+SLIDESONWALLS
	States {
		Spawn:
			FLAF A 0
			FLAF A 0 A_PlaySoundEx("Flare/Loop", "SoundSlot7", 1, -1)
			FLAF A 0 A_Jump(128, "Light2")
		Light1:
			FLAF AB 1 A_JumpIf(waterlevel > 0, "Death")
		Goto Light1
		Light2:
			FLAF AB 1 A_JumpIf(waterlevel > 0, "Death")
		Goto Light2
		Death:
			FLAF E -1
		Stop
	}
}

actor spentflare 30045
{
	Radius 8
	Height 8
	MaxStepHeight 8
	+SLIDESONWALLS
	States {
		Spawn:
		FLAF A 0 A_PlaySoundEx("Flare/Loop", "SoundSlot7", 1, -1)
			FLAF AB 1
loop
	}
}