home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Engine / Classes / LiftExit.uc < prev    next >
Text File  |  2003-06-23  |  2KB  |  62 lines

  1. //=============================================================================
  2. // LiftExit.
  3. //=============================================================================
  4. class LiftExit extends NavigationPoint
  5.     placeable
  6.     native;
  7.  
  8. #exec Texture Import File=Textures\Lift_exit.pcx Name=S_LiftExit Mips=Off MASKED=1
  9.  
  10. var() name LiftTag;
  11. var    Mover MyLift;
  12. var() byte SuggestedKeyFrame;    // mover keyframe associated with this exit - optional
  13. var byte KeyFrame;
  14.  
  15. event bool SuggestMovePreparation(Pawn Other)
  16. {
  17.     local Controller C;
  18.     
  19.     if ( (MyLift == None) || (Other.Controller == None) )
  20.         return false;
  21.     if ( Other.Physics == PHYS_Flying )
  22.     {
  23.         if ( Other.AirSpeed > 0 )
  24.             Other.Controller.MoveTimer = 2+ VSize(Location - Other.Location)/Other.AirSpeed;
  25.         return false;
  26.     }
  27.     if ( (Other.Base == MyLift)
  28.             || ((LiftCenter(Other.Anchor) != None) && (LiftCenter(Other.Anchor).MyLift == MyLift)
  29.                 && (Other.ReachedDestination(Other.Anchor))) )
  30.     {
  31.         // if pawn is on the lift, see if it can get off and go to this lift exit
  32.         if ( (Location.Z < Other.Location.Z + Other.CollisionHeight)
  33.              && Other.LineOfSightTo(self) )
  34.             return false;
  35.  
  36.         // make pawn wait on the lift
  37.         Other.DesiredRotation = rotator(Location - Other.Location);
  38.         Other.Controller.WaitForMover(MyLift);
  39.         return true;
  40.     }
  41.     else
  42.     {
  43.         for ( C=Level.ControllerList; C!=None; C=C.nextController )
  44.             if ( (C.Pawn != None) && (C.PendingMover == MyLift) && C.SameTeamAs(Other.Controller) && C.Pawn.ReachedDestination(self) )
  45.             {
  46.                 Other.DesiredRotation = rotator(Location - Other.Location);
  47.                 Other.Controller.WaitForMover(MyLift);
  48.                 return true;
  49.             }
  50.     }
  51.     return false;
  52. }
  53.  
  54. defaultproperties
  55. {
  56.     Texture=S_LiftExit
  57.     SuggestedKeyFrame=255
  58.     bSpecialMove=true
  59.     bNeverUseStrafing=true
  60.     bForceNoStrafing=true
  61. }
  62.