ACTOR "First aid kit" : CustomInventory Replaces Berserk 31046
{
    //$Category DN3D Health and Armor
	Inventory.PickupMessage "\cjPortable Medkit"
    Inventory.PickupSound "FirstAidKit/Pick"
	Inventory.Icon "MEDICON"
    Inventory.Amount 100
	Inventory.MaxAmount 100
	Inventory.InterHubAmount 100
	+INVENTORY.PERSISTENTPOWER
    +INVENTORY.INVBAR
	+COUNTITEM
    Scale 0.4
	Tag "First aid kit"
    States
    {
    Spawn:
        HEAL C -1 
        Stop
	Pickup:
	    TNT1 A 1 A_JumpIfInventory("First aid kit",100,"Nope")
		TNT1 A 1 ACS_Execute(548,0,0,0,0)
		Stop
	Nope:
	    TNT1 A 1
	    Fail
	Use:
	GiveCheck:
		TNT1 A 0 A_JumpIfInventory("First aid kit",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_GiveInventory("DoHealBackpack",1)
		TNT1 A 0 A_TakeInventory("Didheal",1)
		TNT1 A 0 A_PlaySound("FirstAidKit/Use",34)
		Fail	
	Give:
		TNT1 A 0 A_GiveInventory("DidHeal",1)
	GiveHealth:
		TNT1 A 0 A_TakeInventory("First aid kit",1)
		TNT1 A 0 A_GiveInventory("HealthBackpackAdd",1)
		Goto GiveCheck
	    }
}

ACTOR DidHeal : Inventory 
{
}

ACTOR HealthBackpackAdd : Health
{
	Inventory.Amount 1
}

ACTOR DoHealBackpack: Inventory
{
    Inventory.maxamount 1
}