home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Runtime / Classes / RTPlayerController.uc < prev   
Text File  |  2003-06-23  |  962b  |  48 lines

  1. //=============================================================================
  2. // RTPlayerController
  3. //=============================================================================
  4.  
  5. class RTPlayerController extends PlayerController;
  6.  
  7. replication
  8. {
  9.     reliable if(Role < ROLE_Authority)
  10.         Fly, Walk, ToggleFlyWalk;
  11. }
  12.  
  13. exec function Fly()
  14. {
  15.     if ( Pawn != None )
  16.     {
  17.         Pawn.UnderWaterTime = Pawn.Default.UnderWaterTime;    
  18.         ClientMessage("You feel much lighter");
  19.         Pawn.SetCollision(true, true , true);
  20.         Pawn.bCollideWorld = true;
  21.         GotoState('PlayerFlying');
  22.     }
  23. }
  24.  
  25. exec function Walk()
  26. {    
  27.     if ( Pawn != None )
  28.     {
  29.         Pawn.UnderWaterTime = Pawn.Default.UnderWaterTime;    
  30.         Pawn.SetCollision(true, true , true);
  31.         Pawn.SetPhysics(PHYS_Walking);
  32.         Pawn.bCollideWorld = true;
  33.         GotoState('PlayerWalking');
  34.     }
  35. }
  36.  
  37. exec function ToggleFlyWalk()
  38. {
  39.     if(IsInState('PlayerFlying'))
  40.         Walk();
  41.     else
  42.         Fly();
  43. }
  44.  
  45. defaultproperties
  46. {
  47.  
  48. }