actor InfiniCellPickup : CustomInventory {
	Game Doom
	Inventory.PickupMessage "Picked up an energy infinicell."
	Inventory.PickupSound "misc/i_pkup"
	states {
	Spawn:
		TNT1 A -1 // Invisible, handed out by InfiniCell 
		stop
	Pickup:
		TNT1 A 0 A_TakeInventory("Cell", 99999)
		TNT1 A 0 A_GiveInventory("Cell", 20)
		TNT1 A 0 A_JumpIfInventory("Cell", 40, "Done")
		TNT1 A 0 A_GiveInventory("Cell", 20) // Skill 2-4
	Done:
		TNT1 A 0
		stop
	}
}

actor InfiniCellPackPickup : CustomInventory {
	Game Doom
	Inventory.PickupMessage "Picked up an energy infinicell pack."
	Inventory.PickupSound "misc/i_pkup"
	states {
	Spawn:
		TNT1 A -1 // Invisible, handed out by InfiniCellPack 
		stop
	Pickup:
		TNT1 A 0 A_TakeInventory("Cell", 99999)
		TNT1 A 0 A_GiveInventory("Cell", 100)
		TNT1 A 0 A_JumpIfInventory("Cell", 200, "Done")
		TNT1 A 0 A_GiveInventory("Cell", 100) // Skill 2-4
	Done:
		TNT1 A 0
		stop
	}
}

actor InfiniCell : CustomInventory 1999 {
	Game Doom
	states {
	Spawn:
		CELL A -1
		stop
	Pickup:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Cell", 40, "Nope")
		TNT1 A 0 A_SpawnItemEx("InfiniCellPickup")
	Nope:
		TNT1 A 0
		fail
	}
}

actor InfiniCellPack : CustomInventory 2000 {
	Game Doom
	states {
	Spawn:
		CELP A -1
		stop
	Pickup:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Cell", 200, "Nope")
		TNT1 A 0 A_SpawnItemEx("InfiniCellPackPickup")
	Nope:
		TNT1 A 0
		fail
	}
}