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

UnrealGame.WillowWhisp


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
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
class WillowWhisp extends xEmitter;

var     vector      WayPoints[11];
var     int         NumPoints;
var     int         Position;
var     vector      Destination;
var     bool        bHeadedRight;
var     float       LifeLeft;

replication
{
    reliable if ( Role == ROLE_Authority )
        NumPoints,WayPoints;
}

function PostBeginPlay()
{
    local int i,start;
    local Controller C;
    local Actor HitActor;
    local Vector HitLocation,HitNormal;
    
    Super.PostBeginPlay();
    
    C = Controller(Owner);
    if ( C.Pawn == None )
        return;
    SetLocation(C.Pawn.Location);

    WayPoints[0] = C.Pawn.Location + C.Pawn.CollisionHeight * Vect(0,0,1) + 200 * vector(C.Rotation);
    HitActor = Trace(HitLocation, HitNormal,WayPoints[0], C.Pawn.Location,false);
    if ( HitActor != None )
        WayPoints[0] = HitLocation;
    NumPoints++;
    
    if ( (C.RouteCache[i] != None) && C.ActorReachable(C.RouteCache[1]) )
        start = 1;
    for ( i=start; i<start+10; i++ )
    {
        if ( C.RouteCache[i] == None )
            break;
        else
        {
            WayPoints[NumPoints] = C.RouteCache[i].Location + C.Pawn.CollisionHeight * Vect(0,0,1);
            NumPoints++;
        }
    }
    Velocity = 500 * Normal(WayPoints[0] - Location) + C.Pawn.Velocity;
}

simulated function PostNetBeginPlay()
{
    if ( (Level.NetMode == NM_Standalone) || (Level.NetMode == NM_Client) )
    {
        bHidden = false;
        StartNextPath();
    }
    else if ( (Level.NetMode == NM_ListenServer) && (Viewport(PlayerController(Owner).Player) != None) )
    {
        bHidden = false;
        RemoteRole = ROLE_None;
        StartNextPath();
    }
    else
        LifeSpan = 0.5;
}

simulated function StartNextPath()
{
    if ( Position >= NumPoints )
    {
        mregen = false;
        LifeSpan = 1.5;
        LifeLeft = 1.5;
        Velocity = vect(0,0,0);
        Acceleration = vect(0,0,0);
        return;
    }
    bHeadedRight = false;
    Destination = WayPoints[Position];
    Acceleration = 1200 * Normal(Destination - Location);
    Velocity *= 0.5;
    Velocity.Z = 0.5 * (Velocity.Z + Acceleration.Z);
    SetRotation(rotator(Acceleration));
    Position++;
}

auto state Pathing
{
    simulated function Tick(float DeltaTime)
    {
        if ( LifeLeft > 0 )
        {
            LifeLeft -= DeltaTime;
            if ( LifeLeft <= 0 )
            {
                Destroy();
                return;
            }
            return;
        }
        Acceleration = 1200 * Normal(Destination - Location);
        Velocity = Velocity + DeltaTime * Acceleration; // force double acceleration
        if ( !bHeadedRight )
            bHeadedRight = ( (Velocity Dot Acceleration) > 0 );
        else if ( Velocity Dot Acceleration < 0 )
            StartNextPath();
        if ( VSize(Destination - Location) < 80 )
            StartNextPath();
    }
}

defaultproperties
{
     mStartParticles=0
     mMaxParticles=150
     mLifeRange(0)=1.250000
     mLifeRange(1)=1.250000
     mRegenRange(0)=90.000000
     mRegenRange(1)=90.000000
     mSpeedRange(0)=0.000000
     mSpeedRange(1)=0.000000
     mMassRange(0)=-0.030000
     mMassRange(1)=-0.010000
     mRandOrient=Wahr
     mSpinRange(0)=-75.000000
     mSpinRange(1)=75.000000
     mSizeRange(0)=15.000000
     mSizeRange(1)=20.000000
     mGrowthRate=13.000000
     mColorRange(1)=(B=210,G=210)
     mAttenFunc=ATF_ExpInOut
     mRandTextures=Wahr
     bHidden=Wahr
     Physics=PHYS_Projectile
     RemoteRole=ROLE_SimulatedProxy
     LifeSpan=10.000000
     Skins(0)=Texture'Engine.S_Pawn'
     Style=STY_Alpha
     bIgnoreOutOfWorld=Wahr
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:40.000 - Creation time: Mo 16.4.2007 11:20:57.562 - Created with UnCodeX