XIIIMP
Class MarioArmorAndMedKitPickUp

source: C:\XIII\XIIIMP\Classes\MarioArmorAndMedKitPickUp.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pickup
         |
         +--XIIIMP.MarioPickUp
            |
            +--XIIIMP.MarioArmorAndMedKitPickUp
Direct Known Subclasses:None

class MarioArmorAndMedKitPickUp
extends XIIIMP.MarioPickUp

//----------------------------------------------------------- // //-----------------------------------------------------------
States
Pickup
State Pickup Function Summary
 void InitItemList()
     
//_____________________________________________________________________________
 float BotDesireability(Pawn Bot)
     
//_____________________________________________________________________________
 Inventory SpawnCopy(Pawn Other)
     
//_____________________________________________________________________________
// Either give this inventory to player Other, or spawn a copy
// and give it to the player Other, setting up original to be respawned.
 void Touch(Actor Other)
     
// When touched by an actor.
    
 bool ValidTouch(Actor Other)
     
{
    



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class MarioArmorAndMedKitPickUp extends MarioPickUp;
00005	/*
00006	auto state Pickup
00007	{
00008	    function bool ValidTouch( actor Other )
00009	    {
00010	      // make sure its a live player
00011	      if ( (Pawn(Other)==none) || !Pawn(Other).bCanPickupInventory || (Pawn(Other).Health <= 0) )
00012	        return false;
00013	      // make sure not touching through wall
00014	      if ( !FastTrace(Other.Location+Pawn(Other).EyeHeight*vect(0,0,1), Location) )
00015	        return false;
00016	      // make sure game will let player pick me up
00017	      if( Level.Game.PickupQuery(Pawn(Other), self) )
00018	      {
00019	        TriggerEvent(Event, self, Pawn(Other));
00020	        return true;
00021	      }
00022	      return false;
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	        //::DBUG::
00036	          //PlayerController(Level.ControllerList).Player.Console.message(self$" After Announce pickup copy is "$copy$" InvItemName="$InvItemName$" ItemName="$copy.ItemName, 14.0);
00037	        Copy.PickupFunction(Pawn(Other));
00038	      }
00039	      // don't allow inventory to pile up (frame rate hit)
00040	      else if ( (Inventory != None) && (Pickup(Other) != none)
00041	        && (Pickup(Other).Inventory != None) )
00042	        Destroy();
00043	    }
00044	}
00045	
00046	//_____________________________________________________________________________
00047	// Either give this inventory to player Other, or spawn a copy
00048	// and give it to the player Other, setting up original to be respawned.
00049	function inventory SpawnCopy( pawn Other )
00050	{
00051	    local inventory Copy;
00052	
00053	    if ( Inventory != None )
00054	    {
00055	      Copy = Inventory;
00056	      Inventory = None;
00057	    }
00058	    else
00059	    {
00060	      Copy = spawn(InventoryType,Other,,,rot(0,0,0));
00061	      Copy.Charge = ProtectionLevel;
00062	    }
00063	
00064	    Copy.GiveTo( Other );
00065	
00066	    if( Level.Game.ShouldRespawn(self) )
00067	      StartSleeping();
00068	    else
00069	      Destroy();
00070	    return Copy;
00071	}
00072	*/
00073	//_____________________________________________________________________________
00074	
00075	function float BotDesireability( pawn Bot )
00076	{
00077	    return MaxDesireability;
00078	}
00079	
00080	//_____________________________________________________________________________
00081	
00082	function InitItemList()
00083	{
00084	    local MarioMutator MM;
00085	    local int Loop;
00086	
00087	    foreach DynamicActors(class'MarioMutator', MM)
00088	    {
00089	        ItemNumber = MM.ArmorAndMedKitNumber;
00090	
00091	        for( Loop=0;Loop<ItemNumber;Loop++)
00092	        {
00093	            RandomInventoryType[Loop]=MM.ArmorAndMedKitInventoryType[Loop];
00094	            RandomPickupMessage[Loop]=MM.ArmorAndMedKitPickupMessage[Loop];
00095	            RandomPickupSound[Loop]=MM.ArmorAndMedKitPickupSound[Loop];
00096	        }
00097	
00098	        break;
00099	    }
00100	
00101	    InitList=true;
00102	}
00103	
00104	//_____________________________________________________________________________
00105	
00106	
00107	
00108	defaultproperties
00109	{
00110	     MaxDesireability=1.000000
00111	     RespawnTime=20.000000
00112	     PickupMessage="Defensive Item"
00113	     StaticMesh=StaticMesh'MeshArmesPickup.MultiBoxMedkit'
00114	     DrawScale3D=(X=0.500000,Y=0.500000,Z=0.500000)
00115	     CollisionHeight=34.000000
00116	}

End Source Code