//=============================================================================
// Dampener.
//=============================================================================
class Dampener expands PickUp;

#exec AUDIO IMPORT FILE="Sounds\Pickups\Dampndea.WAV" NAME="dampndea"       GROUP="Pickups"
#exec AUDIO IMPORT FILE="Sounds\Pickups\DAMPNER1.WAV" NAME="DampSnd"       GROUP="Pickups"

#exec TEXTURE IMPORT NAME=I_Dampener FILE=TEXTURES\HUD\i_Damp.PCX GROUP="Icons"

#exec MESH IMPORT MESH=Dampener ANIVFILE=MODELS\acoust_a.3D DATAFILE=MODELS\acoust_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=Dampener X=0 Y=0 Z=-50 YAW=64
#exec MESH SEQUENCE MESH=Dampener SEQ=All STARTFRAME=0  NUMFRAMES=1
#exec TEXTURE IMPORT NAME=Ainv1 FILE=MODELS\inv.PCX GROUP="Skins"
#exec MESHMAP SCALE MESHMAP=Dampener X=0.03 Y=0.03 Z=0.06
#exec MESHMAP SETTEXTURE MESHMAP=Dampener NUM=1 TEXTURE=Ainv1

//
// Player has activated the item.
//
// Count down the charge, turn acoustic damping on.  If charge runs out, remove from 
// inventory and destroy, resetting sound to normal
//
state Activated
{
	function Timer()
	{
		Charge -= 1;
		if (Charge<-0) {
			Pawn(Owner).SoundDampening = 1.0;
			Owner.PlaySound(DeActivateSound);						
			UsedUp();		
		}
	}
	function EndState()
	{
		Pawn(Owner).SoundDampening = 1.0;
		bActive = false;		
	}
Begin:
	SetTimer(0.1,True);
	Owner.PlaySound(ActivateSound);	
	Pawn(Owner).SoundDampening = 0.1;	
}

state DeActivated
{
Begin:
	Owner.PlaySound(DeActivateSound);
	Pawn(Owner).SoundDampening = 1.0;
}

