class GCS_StimpackGiver : CustomInventory
{
	Default
	{
		Inventory.PickupSound "Capsule/Pickup";
		Inventory.PickupMessage "Obtained a stimpack.";
		+FLOORCLIP
	}
	
	States
	{
	Spawn:
		STIM A 1 NoDelay {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("RedParticle",
					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;
	Pickup:
		TNT1 A 0 A_JumpIf(GetCVar("GC_AutoUse") == 2,"BringIt");
		TNT1 A 0 A_JumpIfInventory("GCS_Stimpack",0,"Nope");
		TNT1 A 0 A_GiveInventory("GCS_Stimpack",1);
		Stop;
	BringIt:
		TNT1 A 0 A_JumpIf(invoker.owner.Health < PlayerPawn(invoker.owner).MaxHealth, 1);
		Fail;
		TNT1 A 0 {
			A_PlaySound("Capsule/Use",3);
			A_GiveInventory("MediCaps",1);
		}
		Stop;
	Nope:
		TNT1 A 0 A_JumpIf(GetCVar("GC_AutoUse") == 1,"BringIt");
		Fail;
	}
}

class GCS_Stimpack : HealthPickup
{
	Default
	{
		Inventory.PickupSound "Capsule/Pickup";
		Inventory.UseSound "Capsule/Use";
		Inventory.PickupMessage "Obtained a stimpack.";
		Health 10;
		//Inventory.Amount 1;
		Inventory.MaxAmount 20;
		Inventory.InterHubAmount 20;
		HealthPickup.AutoUse 3;
		Inventory.Icon "ARTISTIM";
		Tag "Stimpack";
		+FLOORCLIP
		+INVENTORY.INVBAR
	}
	
	States
	{
	Spawn:
		STIM A 1 NoDelay {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("RedParticle",
					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 GCS_PodOrRejuvCaps : RandomSpawner
{
	Default
	{
		DropItem "GCS_MedipodGiver", 256, 15;
		DropItem "RejuvCaps", 256, 1;
	}
}
	
class GCS_MedipodGiver : CustomInventory
{
	Default
	{
		Inventory.PickupSound "Capsule/Pickup";
		Inventory.PickupMessage "Obtained a medpack.";
		+FLOORCLIP
	}
	
	States
	{
	Spawn:
		MEDI A 1 NoDelay {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("RedParticle",
					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;
	Pickup:
		TNT1 A 0 A_JumpIf(GetCVar("GC_AutoUse") == 2,"BringIt");
		TNT1 A 0 A_JumpIfInventory("GCS_Medipod",0,"Nope");
		TNT1 A 0 A_GiveInventory("GCS_Medipod",1);
		Stop;
	BringIt:
		TNT1 A 0 A_JumpIf(invoker.owner.Health < PlayerPawn(invoker.owner).MaxHealth, 1);
		Fail;
		TNT1 A 0 {
			A_PlaySound("Capsule/Use",3);
			A_GiveInventory("Medipod");
		}
		Stop;
	Nope:
		TNT1 A 0 A_JumpIf(GetCVar("GC_AutoUse") == 1,"BringIt");
		Fail;
	}
}
		
class GCS_Medipod : HealthPickup
{
	Default
	{
		Inventory.PickupSound "Capsule/Pickup";
		Inventory.UseSound "Capsule/Use";
		Inventory.PickupMessage "Obtained a medpack.";
		//Inventory.Amount 1;
		Health 25;
		Inventory.MaxAmount 15;
		Inventory.InterHubAmount 15;
		HealthPickup.AutoUse 3;
		Inventory.Icon "ARTIMEDI";
		Tag "Medpack";
		+FLOORCLIP
		+INVENTORY.INVBAR
	}
	
	States
	{
	Spawn:
		MEDI A 1 NoDelay {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("RedParticle",
					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;
	}
}

class GCS_MegahealthGiver : CustomInventory
{
	Default
	{
		Inventory.PickupSound "Capsule/Pickup";
		Inventory.PickupMessage "Picked up a keg'o'health.";
		+FLOORCLIP
	}
	
	States
	{
	Spawn:
		KEGH AAAAAAAAAABBBBBBBBBB 1 {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker"))){
				A_SpawnItemEx("RedParticle",
					frandom(15.0,-15.0),frandom(5.0,-5.0),15+frandom(12.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;
	Pickup:
		TNT1 A 0 A_JumpIf(GetCVar("GC_AutoUse") == 2,"BringIt");
		TNT1 A 0 A_JumpIfInventory("GCS_Megahealth",0,"Nope");
		TNT1 A 0 A_GiveInventory("GCS_Megahealth",1);
		Stop;
	BringIt:
		TNT1 A 0 A_JumpIf(invoker.owner.Health < PlayerPawn(invoker.owner).MaxHealth, 1);
		Fail;
		TNT1 A 0 {
			A_PlaySound("Capsule/Use",3);
			A_GiveInventory("GCS_KegOHealth");
		}
		Stop;
	Nope:
		TNT1 A 0 A_JumpIf(GetCVar("GC_AutoUse") == 1,"BringIt");
		Fail;
	}
}
		
class GCS_Megahealth : HealthPickup
{
	Default
	{
		Inventory.PickupSound "Capsule/Pickup2";
		Inventory.UseSound "Capsule/Use";
		Inventory.PickupMessage "Picked up a keg'o'health.";
		Health 200;
		Inventory.MaxAmount 5;
		Inventory.InterHubAmount 5;
		HealthPickup.AutoUse 2; //Added auto-use in all Strife skill levels, so uh, yeah - a lifesaver of sort.
		Inventory.Icon "ARTIKEGH";
		Tag "Keg'o'Health";
		+FLOORCLIP
		+INVENTORY.INVBAR
	}
	
	States
	{
	Spawn:
		KEGH AAAAAAAAAABBBBBBBBBB 1 {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("RedParticle",
					frandom(15.0,-15.0),frandom(5.0,-5.0),15+frandom(12.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;
	Use:
		TNT1 A 0 A_JumpIf(invoker.owner.Health < PlayerPawn(invoker.owner).MaxHealth, 1);
		Fail;
		TNT1 A 0 A_GiveInventory("GCS_KegOHealth");
		Stop;
	Nope:
		TNT1 A 0;
		Fail;
	}
}

class GCS_KegOHealth : Medikit
{
	Default
	{
		Inventory.Amount 200;
		Inventory.PickupSound "Capsule/Pickup";
		Inventory.PickupMessage "Picked up a keg'o'health.";
		Health.LowMessage 25, "That was a life-saving keg'o'health!";
		Scale 0.9;
		+FLOORCLIP
	}
	
	States
	{
	Spawn:
		KEGH AAAAAAAAAABBBBBBBBBB 1 {
			If(!(A_CheckSight("Null") || GetCVar("GC_PickupParticleChoker")))
			{
				A_SpawnItemEx("RedParticle",
					frandom(15.0,-15.0),frandom(5.0,-5.0),15+frandom(12.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;
	}
}