Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.LiftExit


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
//=============================================================================
// LiftExit.
//=============================================================================
class LiftExit extends NavigationPoint
    placeable
    native;

#exec Texture Import File=Textures\Lift_exit.pcx Name=S_LiftExit Mips=Off MASKED=1

var() name LiftTag;
var Mover MyLift;
var() byte SuggestedKeyFrame;   // mover keyframe associated with this exit - optional
var byte KeyFrame;
var(LiftJump) bool bLiftJumpExit;
var(LiftJump) bool bNoDoubleJump;

function PostBeginPlay()
{
    Super.PostBeginPlay();

    if ( bLiftJumpExit && (MyLift != None) )
    {
        if ( Level.Game.GameDifficulty < 4 )
            ExtraCost = 10000000;
        MyLift.bJumpLift = true;
    }
}

function bool CanBeReachedFromLiftBy(Pawn Other)
{
    local float RealJumpZ;
    
    if ( bLiftJumpExit )
    {
        if ( (MyLift.Velocity.Z < 100) || (MyLift.KeyNum == 0)  )
            return false;
        RealJumpZ = Other.JumpZ;
        if ( !bNoDoubleJump )
            Other.JumpZ = Other.JumpZ * 1.5;
        Other.JumpZ += MyLift.Velocity.Z;
        Other.bWantsToCrouch = false;
        Other.Controller.MoveTarget = self;
        Other.Controller.Destination = Location;
        Other.bNoJumpAdjust = true;
        Other.Velocity = SuggestFallVelocity(Location + vect(0,0,100), Other.Location, Other.JumpZ, Other.GroundSpeed);
        Other.Acceleration = vect(0,0,0);
        Other.SetPhysics(PHYS_Falling);
        Other.Controller.SetFall();
        Other.DestinationOffset = CollisionRadius;
        Other.JumpZ = RealJumpZ;
        if ( !bNoDoubleJump )
            Other.Controller.SetDoubleJump();
        return true;
    }
    
    return ( (Location.Z < Other.Location.Z + Other.CollisionHeight)
             && Other.LineOfSightTo(self) );
}

event bool SuggestMovePreparation(Pawn Other)
{
    local Controller C;
    
    if ( (MyLift == None) || (Other.Controller == None) )
        return false;
    if ( Other.Physics == PHYS_Flying )
    {
        if ( Other.AirSpeed > 0 )
            Other.Controller.MoveTimer = 2+ VSize(Location - Other.Location)/Other.AirSpeed;
        return false;
    }
    if ( (Other.Base == MyLift)
            || ((LiftCenter(Other.Anchor) != None) && (LiftCenter(Other.Anchor).MyLift == MyLift)
                && (Other.ReachedDestination(Other.Anchor))) )
    {
        // if pawn is on the lift, see if it can get off and go to this lift exit
        if ( CanBeReachedFromLiftBy(Other) )
            return false;

        // make pawn wait on the lift
        Other.DesiredRotation = rotator(Location - Other.Location);
        Other.Controller.WaitForMover(MyLift);
        return true;
    }
    else
    {
        for ( C=Level.ControllerList; C!=None; C=C.nextController )
            if ( (C.Pawn != None) && (C.PendingMover == MyLift) && C.SameTeamAs(Other.Controller) && C.Pawn.ReachedDestination(self) )
            {
                Other.DesiredRotation = rotator(Location - Other.Location);
                Other.Controller.WaitForMover(MyLift);
                return true;
            }
    }
    return false;
}

defaultproperties
{
     SuggestedKeyFrame=255
     bNeverUseStrafing=True
     bForceNoStrafing=True
     bSpecialMove=True
     Texture=Texture'Engine.S_LiftExit'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 23/10/2006 20:25:18.000 - Creation time: Wed 7/2/2007 19:16:43.203 - Created with UnCodeX