ACTOR HealthBackpackAdd : Health
{
	Inventory.Amount 1
}
ACTOR DidHeal : Inventory {}
ACTOR HealthBackpack : CustomInventory
{
	+INVBAR
	Inventory.Amount 100
	Inventory.MaxAmount 100
	Inventory.InterHubAmount 100
	Inventory.PickupMessage "You got a Health Backpack."
	Tag "Health Pack"
	Inventory.Icon "I_MBPK"
	States
	{
		Spawn:
		MBPK A -1
		Stop
		Use:
		GiveCheck:
		TNT1 A 0 A_JumpIfInventory("HealthBackpack", 1, "GiveCheck2")
		TNT1 A 0 A_JumpIfInventory("DidHeal", 1, "PlaySound")
		Fail
		GiveCheck2:
		TNT1 A 0 A_JumpIf(CallACS("Check max health") == TRUE, "Give")
		TNT1 A 0 A_JumpIfInventory("DidHeal", 1, "PlaySound")
		Fail
		PlaySound:
		TNT1 A 0 A_TakeInventory("Didheal", 1)
		TNT1 A 0 A_PlaySound("FKITUSE")
		Fail	
		Give:
		TNT1 A 0 A_GiveInventory("DidHeal", 1)
		GiveHealth:
		TNT1 A 0 A_TakeInventory("HealthBackpack", 1)
		TNT1 A 0 A_GiveInventory("HealthBackpackAdd", 1)
		Goto GiveCheck
	}
}