//These are the various inventory items that all heroes
//can use
actor BarrelGrabber : CustomInventory 
{
	-INVBAR
	+AUTOACTIVATE
	Inventory.Amount 1
	Inventory.MaxAmount 1
	States
	{
	Use:
		TNT1 A 0
		TNT1 A 1 A_FireCustomMissile ("BarrelGrab",0,0)
		Stop
	}
}

ACTOR BarrelGrab : fastprojectile
{  
   +notimefreeze
   Radius 8
   Height 8
   PROJECTILE
   RENDERSTYLE Translucent
   speed 60
   damage (1)
   ALPHA 0.90
   +bright
   +dontblast
   +LOOKALLAROUND
   +FORCEXYBILLBOARD
   +thruspecies
   +bloodlessimpact
   -bloodsplatter
   species "friendly"
   damagetype "BarrelGrab"
   scale 0.75
   States
   {
   Spawn:
		BAL1 A 1
		Stop
   Death:
        TNT1 A 0
		TNT1 A 1
		Stop
	}
}




//==FLICKPUFF==

//This isn't actually an item exactly but
//a harmless hitscan attack to hit switches
//ensuring players never get stuck

actor flickpuff : bulletpuff
{
	renderstyle "normal"
	+FORCEXYBILLBOARD	
	+LOOKALLAROUND
	+BLOODLESSIMPACT
	+PUFFONACTORS
	states
	{
	spawn:
		TNT1 A 0
		TNT1 A 1
		stop
	}
}



//************************************************************************
//************************************************************************
//************************************************************************


//----------------------------------------------------------
//Subweapon locker thing
//----------------------------------------------------------

actor SubLocker : custominventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Inventory.InterHubAmount 1
	-invbar
	+undroppable
	+untossable
	states
	{
	spawn:
		TNT1 A 1
		loop
	use:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("IAmKustam",1,"KustamLock")
		TNT1 A 0 A_JumpIfInventory ("IAmDoomSlayer",1,"SlayerLock")
		TNT1 A 0 A_JumpIfInventory ("IAmLordBlaz",1,"BlazLock")
		fail
	BlazLock:
		TNT1 A 0 A_JumpIfInventory ("SubWeaponLocked",1, "BlazUnlock")
		TNT1 A 0 A_PlaySound ("SubWeapons/BlazLock",0)
		TNT1 A 1 A_GiveInventory ("SubWeaponLocked", 1)
		fail
	BlazUnlock:
		TNT1 A 0
		TNT1 A 0 A_PlaySound ("SubWeapons/BlazUnlock",0)
		TNT1 A 1 A_TakeInventory ("SubWeaponLocked", 999)
		fail
		
	SlayerLock:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("BombCasterAmmo",1,2)
		TNT1 A 0 A_Jump (256,"FailToLock")
		TNT1 A 0 A_JumpIfInventory ("SubWeaponLocked",1, "SlayerUnlock")
		TNT1 A 0 A_PlaySound ("SubWeapons/BlazLock",0)
		TNT1 A 1 A_GiveInventory ("SubWeaponLocked", 1)
		fail
	SlayerUnlock:
		TNT1 A 0
		TNT1 A 0 A_PlaySound ("SubWeapons/BlazUnlock",0)
		TNT1 A 1 A_TakeInventory ("SubWeaponLocked", 999)
		fail

	KustamLock:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("KustamSubAmmo",1,2)
		TNT1 A 0 A_Jump (256,"FailToLock")
		TNT1 A 0 A_JumpIfInventory ("SubWeaponLocked",1, "KustamUnlock")
		TNT1 A 0 A_PlaySound ("SubWeapons/BlazLock",0)
		TNT1 A 1 A_GiveInventory ("SubWeaponLocked", 1)
		fail
	KustamUnlock:
		TNT1 A 0
		TNT1 A 0 A_PlaySound ("SubWeapons/BlazUnlock",0)
		TNT1 A 1 A_TakeInventory ("SubWeaponLocked", 999)
		fail
	
	FailToLock:
		TNT1 A 0
		TNT1 A 1 A_PlaySound ("SubWeapons/noaltfire",0)
		Fail
	}
}


actor SubWeaponLocked : inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Inventory.InterHubAmount 1
	-invbar
	+undroppable
	+untossable
}





//==CHEATERS TOKEN==
//Used to tell players they
//shouldn't use the frickin
//"GIVE ALL" cheat

actor CheatersToken : custominventory
{
	states
	{
	spawn:
		TNT1 A 1
		stop
	Pickup:
		TNT1 A 0
		TNT1 A 120 A_Print ("Don't use this cheat! It breaks stuff!")
		stop
	}
}
