
class MedKit extends TournamentPickUp;

#exec mesh import mesh=medbag anivfile=Models\medbag_a.3d datafile=Models\medbag_d.3d x=0 y=0 z=0 mlod=0
#exec mesh origin mesh=medbag x=0 y=0 z=0 PITCH=64 ROLL=0 YAW=0
#exec mesh sequence mesh=medbag seq=All startframe=0 numframes=1

#exec meshmap new meshmap=medbag mesh=medbag
#exec meshmap scale meshmap=medbag x=0.03906 y=0.03906 z=0.07813

#exec TEXTURE IMPORT NAME=CamoH FILE=Textures\CamoH.BMP GROUP=Skins
#exec TEXTURE IMPORT NAME=CamoP FILE=Textures\CamoP.BMP GROUP=Skins
#exec TEXTURE IMPORT NAME=Zipper FILE=Textures\Zipper.BMP GROUP=Skins

#exec AUDIO IMPORT NAME=RegenHiss FILE=Sounds\RegenHiss.wav

var() int HealingAmount;

state Activated
{
   function endstate()
   {
      bActive = false;
      SetTimer(0.0, False);
   }

   function Timer()
   {
      local int HealMax;
      local Pawn P;

      Charge -= 1;

		if (Charge<=0)
         UsedUp();

      if ((Owner != None) && Owner.bIsPawn)
      {
      	P = Pawn(Owner);
      	HealMax = P.default.health;

      	if (P.Health < HealMax)
      	{
         	P.Health += HealingAmount;
         	if (P.Health > HealMax)
					P.Health = HealMax;
 				if (PlayerPawn(Owner) != none)
					PlayerPawn(Owner).ClientPlaySound(sound'RegenHiss', False);
      	}
      }
   }
   function BeginState()
   {
      bActive = true;
      PlaySound(ActivateSound,,4.0);
      SetTimer(1.0,True);
   }
}

state DeActivated
{
Begin:
}

defaultproperties
{
	bCanHaveMultipleCopies=false
  	MultiSkins(0)=Texture'zipper'
  	MultiSkins(1)=Texture'camoP'
  	MultiSkins(2)=Texture'CamoH'
	HealingAmount=2
   ExpireMessage="Medkit used up"
   bAutoActivate=True
   bActivatable=True
   PickupMessage="You picked up a Medkit"
   ItemName="Medkit"
   Charge=40
   MaxDesireability=1.200000
   ActivateSound=none
   bRotatingPickup=False
   DrawType=DT_Mesh
   Mesh=Mesh'medbag'
   RespawnTime=120.00
   PickupViewMesh=Mesh'medbag'
	PickupSound=Sound'Botpack.Pickups.UTHealth'
   CollisionRadius=20.0
   CollisionHeight=8.0
   RemoteRole=ROLE_DumbProxy
}
