
class DeadPlayerMarker extends Pickup;

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

#exec meshmap new meshmap=Tombstone mesh=Tombstone
#exec meshmap scale meshmap=Tombstone x=0.09375 y=0.09375 z=0.18750

#exec TEXTURE IMPORT NAME=TombstoneA FILE=Textures\TombstoneA.bmp GROUP="Items" FLAGS=2
#exec TEXTURE IMPORT NAME=TombstoneB FILE=Textures\TombstoneB.bmp GROUP="Items" FLAGS=2

#exec AUDIO IMPORT FILE="Sounds\Darkbell.wav" NAME="Darkbell"

var int LifeTime;
var int HealingAmount;

auto state Pickup
{
   function Touch(actor Other)
   {
      local int HealMax;
      local Pawn P;
      local int randm;

      if (ValidTouch(Other) && Other.IsA('PlayerPawn'))
      {
         P = Pawn(Other);
         HealMax = 100;

         P.Health += HealingAmount;
         if (P.Health > HealMax) P.Health = HealMax;
            PlayPickupMessage(P);
         PlaySound (PickupSound,,2.5);
         if (Level.Game.Difficulty > 1)
            Other.MakeNoise(0.1 * Level.Game.Difficulty);

         randm = Rand(4);
	 		switch(randm)
         {
	    		case 0:
	       		BroadcastMessage(P.PlayerReplicationInfo.PlayerName$" gained health from another's loss.", false);
	    			break;
	    		case 1:
	       		BroadcastMessage(P.PlayerReplicationInfo.PlayerName$" harvested a dead player's karma.", false);
	    			break;
	    		case 2:
	       		BroadcastMessage(P.PlayerReplicationInfo.PlayerName$" claimed someone's health for themselves.", false);
    	    		break;
	    		case 3:
	       		BroadcastMessage(P.PlayerReplicationInfo.PlayerName$" was refreshed by someone's death.", false);
	    			break;
         }
         Self.Destroy();
      }
      else if (ValidTouch(Other) && Other.IsA('Bot'))
      {
      	PlaySound (PickupSound,,2.5);
      	Self.Destroy();
      }
   }
}

function PlayPickupMessage(Pawn Other)
{
   Other.ClientMessage(PickupMessage$HealingAmount, 'Pickup');
}

defaultproperties
{
   LifeTime=200
   DrawType=DT_Mesh
   Mesh=Mesh'Tombstone'
	PickupMessage="You got a health bonus +"
	ItemName="Dead Player Marker"
   RespawnTime=0.000000
   PickupViewMesh=Mesh'Tombstone'
   PickupSound=Sound'Darkbell'
   bCollideWhenPlacing=True
   bRotatingPickup=False
   M_Activated=""
   M_Selected=""
   M_Deactivated=""
   PickupMessageClass=Class'Botpack.PickupMessagePlus'
   ItemMessageClass=Class'Botpack.ItemMessagePlus'
   bClientAnim=True
   HealingAmount=50
   CollisionRadius=16
   CollisionHeight=24
   MultiSkins(0)=Texture'TombstoneB'
   MultiSkins(1)=Texture'TombstoneA'
   DrawScale=0.5
	AmbientGlow=102
	LightType=LT_Steady
	LightBrightness=154
	LightHue=24
	LightSaturation=0
	LightRadius=15
	LightEffect=LE_SlowWave
}
