class Mana : Ammo
{
	Default
	{
		Inventory.PickupMessage "I wonder how did you pick up THAT, nutty mortal.";
		Inventory.MaxAmount 100;
		Inventory.InterHubAmount 100;
		Ammo.BackpackAmount 0;
		Ammo.BackpackMaxAmount 100;
		Inventory.Icon "PTN4A0";
		+INVENTORY.UNDROPPABLE
		+INVENTORY.IGNORESKILL
		//+INVENTORY.INVBAR
	}
}
class MinorManaPot : CustomInventory
{
	Default
	{
		Inventory.MaxAmount 0;
		Inventory.PickupSound "Pot/Pickup";
		Inventory.PickupMessage "Obtained a mana vial.";
		+INVENTORY.AUTOACTIVATE
		-INVENTORY.INVBAR
		//+INVENTORY.ALWAYSPICKUP
	}
	
	States
	{
	Spawn:
		PTN4 AABBCCDDEE 1 {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("BlueParticle",
					frandom(3.0,-3.0),frandom(3.0,-3.0),frandom(15.0,2.0),
					frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),
					frandom(0.0,360.0),SXF_CLIENTSIDE,64);
			}
		}
		Loop;
	Pickup:
		TNT1 A 0 {
			if(GetCVar("GC_ManaAlwaysPick") || GetCvar("sv_unlimited_pickup"))
			{
				A_GiveInventory("Mana",25 + CountInv("PowerBooster") * 1);
				return true;
			}
			if(A_JumpIfInventory("Mana",0,"Null"))
			{
				return false;
			}
			else
			{
				A_GiveInventory("Mana",25 + CountInv("PowerBooster") * 1);
				return true;
			}
		}
		Stop;
	}
}

class MajorManaPot : MinorManaPot
{
	Default
	{
		Inventory.PickupMessage "Picked up a mana potion.";
	}
	
	States
	{
	Spawn:

		PTN3 AABBCCDDEEFF 1  {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("BlueParticle",
					frandom(5.0,-5.0),frandom(5.0,-5.0),frandom(15.0,2.0),
					frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),
					frandom(0.0,360.0),SXF_CLIENTSIDE,64);
			}
		}
		Loop;
	Pickup:
		TNT1 A 0 {
			if(GetCVar("GC_ManaAlwaysPick") || GetCvar("sv_unlimited_pickup"))
			{
				A_GiveInventory("Mana",50 + CountInv("PowerBooster") * 2);
				return true;
			}
			if(A_JumpIfInventory("Mana",0,"Null"))
			{
				return false;
			}
			else
			{
				A_GiveInventory("Mana",50 + CountInv("PowerBooster") * 2);
				return true;
			}
		}
		Stop;
	}
}

class MinorManaPod : MinorManaPot
{
	Default
	{
		Inventory.PickupSound "Capsule/Pickup";
		Inventory.PickupMessage "Obtained a mana capsule.";
	}
	
	States
	{
	Spawn:
		MPOD A 1 NoDelay {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("BlueParticle",
					frandom(3.0,-3.0),frandom(3.0,-3.0),7+frandom(10.0,0.0),
					frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),
					frandom(0.0,360.0),SXF_CLIENTSIDE,128);
			}
		}
		Loop;
	}
}

class MajorManaPod : MajorManaPot
{
	Default
	{
		Inventory.PickupSound "Capsule/Pickup";
		Inventory.PickupMessage "Picked up a mana pod.";
		Scale 0.9;
	}
	
	States
	{
	Spawn:
		MPOD B 1 NoDelay {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("BlueParticle",
					frandom(5.0,-5.0),frandom(5.0,-5.0),15+frandom(25.0,0.0),
					frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),
					frandom(0.0,360.0),SXF_CLIENTSIDE,64);
			}
		}
		Loop;
	}
}