
class PainPills extends TournamentPickUp;

#exec mesh import mesh=PillBottle anivfile=Models\PillBottle_a.3d datafile=Models\PillBottle_d.3d x=0 y=0 z=0 mlod=0
#exec mesh origin mesh=PillBottle x=0 y=0 z=0
#exec mesh sequence mesh=PillBottle seq=All startframe=0 numframes=1

#exec meshmap new meshmap=PillBottle mesh=PillBottle
#exec meshmap scale meshmap=PillBottle x=0.02636 y=0.02636 z=0.05273

#exec TEXTURE IMPORT NAME=GrungyWhite 	FILE=Textures\GrungyWhite.BMP GROUP=Skins
#exec TEXTURE IMPORT NAME=OxyPills 		FILE=Textures\OxyPills.BMP 	GROUP=Skins
#exec TEXTURE IMPORT NAME=PBOrange 		FILE=Textures\PBOrange.BMP 	GROUP=Skins

#exec AUDIO IMPORT FILE="Sounds\bottlewithpills.WAV" NAME="bottlewithpills"

var() int HealingAmount;

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

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

		if (Charge>0)
      	Charge -= 1;
		if (Charge<=0)
         UsedUp();
		if (Owner != none)
		{
      	P = Pawn(Owner);
      	HealMax = P.default.health;
      	if (P.Health < HealMax)
      	{
         	P.Health += HealingAmount;
         	if (P.Health > HealMax)
					P.Health = HealMax;
      	}
   	}
   }
   function BeginState()
   {
      bActive = true;
      PlaySound(ActivateSound,,4.0);
      SetTimer(1.0,True);
   }
}

state DeActivated
{
Begin:
}

defaultproperties
{
	bCanHaveMultipleCopies=false
	MultiSkins(0)=Texture'GrungyWhite'
	MultiSkins(1)=Texture'OxyPills'
	MultiSkins(2)=Texture'PBOrange'
	HealingAmount=1
	ExpireMessage="Pills used up"
	bAutoActivate=True
	bActivatable=True
	PickupMessage="You got some painkillers"
	ItemName="Painkillers"
	Charge=10
	MaxDesireability=1.200000
	ActivateSound=none
	bRotatingPickup=False
	DrawType=DT_Mesh
	Mesh=Mesh'PillBottle'
	RespawnTime=30.00
  	PickupViewMesh=Mesh'PillBottle'
	PickupSound=Sound'bottlewithpills'
	CollisionRadius=8.0
	CollisionHeight=10.0
	RemoteRole=ROLE_DumbProxy
	Physics=PHYS_Falling
}
