XIDMaps
Class Sanc02aMagneticCardPick

source: C:\XIII\XIDMaps\Classes\Sanc02aMagneticCardPick.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pickup
         |
         +--XIII.XIIIPickup
            |
            +--XIII.EventItemPick
               |
               +--XIDMaps.Sanc02aMagneticCardPick
Direct Known Subclasses:None

class Sanc02aMagneticCardPick
extends XIII.EventItemPick

//----------------------------------------------------------- // //-----------------------------------------------------------
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 Sanc02aMagneticCardPick extends EventItemPick;
00005	
00006	// for this class overide the validtouch to be able to give it to any basesoldier
00007	//_____________________________________________________________________________
00008	// ELR Let's override the TriggerEvent.
00009	auto state Pickup
00010	{
00011	    function bool ValidTouch( actor Other )
00012	    {
00013	      // make sure its a live player
00014	      if ( (Pawn(Other)==none) || (Pawn(Other).Health <= 0) )
00015	        return false;
00016	      // make sure not touching through wall only for other than player
00017	      if ( Pawn(Other).IsPlayerPawn() && !FastTrace(Other.Location+Pawn(Other).EyeHeight*vect(0,0,1), Location) )
00018	        return false;
00019	      // ELR Get rid of the line below for XIII Items !
00020	      if ( bCauseEventOnPick )
00021	        TriggerEvent(Event, self, Pawn(Other));
00022	      return true;
00023	    }
00024	
00025	    // When touched by an actor.
00026	    function Touch( actor Other )
00027	    {
00028	      local Inventory Copy;
00029	
00030	      // If touched by a player pawn, let him pick this up.
00031	      if( ValidTouch(Other) )
00032	      {
00033	        Copy = SpawnCopy(Pawn(Other));
00034	        AnnouncePickup(Pawn(Other));
00035	        Copy.PickupFunction(Pawn(Other));
00036	      }
00037	      // don't allow inventory to pile up (frame rate hit)
00038	      else if ( (Inventory != None) && (Pickup(Other) != none)
00039	        && (Pickup(Other).Inventory != None) )
00040	        Destroy();
00041	    }
00042	}
00043	
00044	
00045	
00046	defaultproperties
00047	{
00048	     FpsMeshToUse=SkeletalMesh'XIIIDeco.fpspasseM'
00049	     InvSelectItemSound=Sound'XIIIsound.Items.PassSel1'
00050	     InvActivateSound=Sound'XIIIsound.Items.PassFire1'
00051	     InventoryType=Class'XIDMaps.Sanc02aMagneticCard'
00052	     PickupMessage="Magnetic Card"
00053	     PickupSound=Sound'XIIIsound.Items.PassPick1'
00054	     Tag="EventItemPick"
00055	     Event="opensanc02a"
00056	     StaticMesh=StaticMesh'MeshObjetsPickup.magnetic_card'
00057	}

End Source Code