
class ZCustomInventory : CustomInventory
{

	action void A_D3DPlayDukeSound(String sound)
	{
		let inv = self.FindInventory("DukeTaunting");
		if (inv==null || inv.Amount==0) {
			self.A_PlaySound(sound,CHAN_VOICE); 
			self.A_GiveInventory("DukeTaunting",1);
		}
	}

}

class ZCustomInventoryWeapon : CustomInventory
{

	override void PlayPickupSound(Actor toucher)
	{
		super.PlayPickupSound(toucher);

		let inv = toucher.FindInventory("DukeTaunting");
		if (inv==null || inv.Amount==0) {
			toucher.A_PlaySound("duke/weaponup",CHAN_VOICE); 
			toucher.A_GiveInventory("DukeTaunting",1);
		}
	}

}

class ZCustomInventoryBackpack : CustomInventory
{

	action void A_D3DGiveBackpack(string backpack)
	{
		Inventory DualPistolClip = self.FindInventory("DualPistolClip");
		Inventory ShotgunShell = self.FindInventory("ShotgunShell");
		Inventory SSGShell = self.FindInventory("SSGShell");
		Inventory LaserTrip = self.FindInventory("LaserTrip");
		Inventory Pipebomb = self.FindInventory("Pipebomb");

		self.A_GiveInventory(backpack);

		if (!DualPistolClip) {
			DualPistolClip = self.FindInventory("DualPistolClip");
			if(DualPistolClip) self.RemoveInventory(DualPistolClip);
		}
		if (!ShotgunShell) {
			ShotgunShell = self.FindInventory("ShotgunShell");
			if(ShotgunShell) self.RemoveInventory(ShotgunShell);
		}
		if (!SSGShell) {
			SSGShell = self.FindInventory("SSGShell");
			if(SSGShell) self.RemoveInventory(SSGShell);
		}
		if (!LaserTrip) {
			self.GiveInventory("LaserTrip",1);
		}
		if (!Pipebomb) {
			self.GiveInventory("Pipebomb",1);
		}
	}

}