XIII
Class XIIITeleportCheat

source: C:\XIII\XIII\Classes\XIIITeleportCheat.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.NavigationPoint
         |
         +--XIII.XIIITeleportCheat
Direct Known Subclasses:None

class XIIITeleportCheat
extends Engine.NavigationPoint

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 > InventoryGiven
           to say this is the last teleporter used
 XIIITeleportCheat NextXIIITeleportCheat
           to say this is the last teleporter used
 bool bLastUsed
           to say this is the last teleporter used


Function Summary
 void TeleportPlayer(XIIIPlayerPawn P)
     
//_____________________________________________________________________________



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class XIIITeleportCheat extends NavigationPoint
00005	    PlaceAble;
00006	
00007	var bool bLastUsed;    // to say this is the last teleporter used
00008	var() XIIITeleportCheat NextXIIITeleportCheat;
00009	var() array< class<Inventory> > InventoryGiven;
00010	
00011	//_____________________________________________________________________________
00012	function GiveSomething(class<Inventory> ItemClass, XIIIPawn P)
00013	{
00014	  local Inventory NewItem;
00015	
00016	  if( P.FindInventoryType(ItemClass)==None )
00017	  {
00018	    NewItem = Spawn(ItemClass,,,P.Location);
00019	    if( NewItem != None )
00020	      NewItem.GiveTo(P);
00021	  }
00022	  else if ( Class<Ammunition>(ItemClass) != none )
00023	  {
00024	    NewItem = P.FindInventoryType(ItemClass);
00025	    if (NewItem != None)
00026	      Ammunition(NewItem).AmmoAmount += Class<Ammunition>(ItemClass).default.AmmoAmount;
00027	  }
00028	}
00029	
00030	//_____________________________________________________________________________
00031	function TeleportPlayer(XIIIPlayerPawn P)
00032	{
00033	    local int i;
00034	    local Inventory Inv;
00035	
00036	    Log("Incoming Teleported Player "$P$" for "$self);
00037	    P.SetLocation(Location);
00038	    P.SetRotation(Rotation);
00039	    P.controller.SetRotation(Rotation);
00040	    TriggerEvent(Event, self, P);
00041	    for (i=0; i<InventoryGiven.Length; i++)
00042	    {
00043	      GiveSomething( InventoryGiven[i], P);
00044	    }
00045	}
00046	
00047	
00048	
00049	defaultproperties
00050	{
00051	     Texture=Texture'Engine.S_Teleport'
00052	     bDirectional=True
00053	}

End Source Code