XIII
Class MultiplayerMedPickup

source: C:\XIII\XIII\Classes\MultiplayerMedPickup.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pickup
         |
         +--XIII.MultiplayerMedPickup
Direct Known Subclasses:AutoFullMedPick, AutoMedPick

class MultiplayerMedPickup
extends Engine.Pickup

//----------------------------------------------------------- // //-----------------------------------------------------------
States
Pickup
State Pickup Function Summary
 void Touch(Actor Other)
     
// When touched by an actor.
 bool ValidTouch(Actor Other)



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class MultiplayerMedPickup extends Pickup;
00005	
00006	//_____________________________________________________________________________
00007	event ParseDynamicLoading(LevelInfo MyLI)
00008	{
00009	    Log("ParseDynamicLoading Actor="$self);
00010	    (default.InventoryType).Static.StaticParseDynamicLoading(MyLI);
00011	//    MyLI.ForcedMeshes[MyLI.ForcedMeshes.Length] = mesh(DynamicLoadObject(class<Weapon>(default.InventoryType).default.MeshName, class'mesh'));
00012	}
00013	
00014	//_____________________________________________________________________________
00015	// ELR Let's override the TriggerEvent.
00016	auto state Pickup
00017	{
00018	    function bool ValidTouch( actor Other )
00019	    {
00020	      // make sure its a live player
00021	      if ( (Pawn(Other)==none) || !Pawn(Other).bCanPickupInventory || (Pawn(Other).Health <= 0) )
00022	        return false;
00023	      // make sure not touching through wall
00024	      if ( !FastTrace(Other.Location+Pawn(Other).EyeHeight*vect(0,0,1), Location) )
00025	        return false;
00026	      // make sure game will let player pick me up
00027	      if( Level.Game.PickupQuery(Pawn(Other), self) )
00028	      {
00029	        TriggerEvent(Event, self, Pawn(Other));
00030	        return true;
00031	      }
00032	      return false;
00033	    }
00034	
00035	    // When touched by an actor.
00036	    function Touch( actor Other )
00037	    {
00038	      local Inventory Copy;
00039	
00040	      // If touched by a player pawn, let him pick this up.
00041	      if( ValidTouch(Other) )
00042	      {
00043	        Copy = SpawnCopy(Pawn(Other));
00044	        AnnouncePickup(Pawn(Other));
00045	        Copy.PickupFunction(Pawn(Other));
00046	      }
00047	      // don't allow inventory to pile up (frame rate hit)
00048	      else if ( (Inventory != None) && (Pickup(Other) != none)
00049	        && (Pickup(Other).Inventory != None) )
00050	        Destroy();
00051	    }
00052	}
00053	
00054	
00055	
00056	defaultproperties
00057	{
00058	     RespawnTime=5.000000
00059	     PickupMessage="Got a XIII Item ::BUG:: (Message should be defined in sub-classes) !!"
00060	     hRespawnSound=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hRespawnGun'
00061	     CollisionRadius=34.000000
00062	     CollisionHeight=8.000000
00063	     MessageClass=Class'XIII.XIIIPickupMessage'
00064	}

End Source Code