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

UT2004RPG.ProjectileSpeedChanger


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
//hack to update projectile speed since neither Speed nor MaxSpeed is a replicated variable
//Used by RW_Force
class ProjectileSpeedChanger extends Actor;

var int Modifier;
var Projectile ModifiedProjectile;

replication
{
    reliable if (bNetInitial && Role == ROLE_Authority)
        Modifier, ModifiedProjectile;
}

simulated function PostBeginPlay()
{
    if (Level.NetMode == NM_Client)
        SetTimer(10, false);

    Super.PostBeginPlay();
}

simulated event Tick(float deltaTime)
{
    if (Role == ROLE_Authority)
    {
        if (ModifiedProjectile == None)
            Destroy();
        return;
    }
    else if (ModifiedProjectile == None)
    {
        //bNetTemporary projectiles don't always get hooked up, so find it
        if (Modifier == 0)
            return;
        foreach CollidingActors(class'Projectile', ModifiedProjectile, 200)
            if (ModifiedProjectile.MaxSpeed == ModifiedProjectile.default.MaxSpeed)
                break;
        if (ModifiedProjectile == None)
            return;
    }

    ModifiedProjectile.Velocity *= 1.0 + 0.2 * Modifier;
    ModifiedProjectile.Speed *= 1.0 + 0.2 * Modifier;
    ModifiedProjectile.MaxSpeed *= 1.0 + 0.2 * Modifier;
    Destroy();
}

simulated function Timer()
{
    Destroy();
}

defaultproperties
{
    bGameRelevant=true
    bHidden=true
    bNetTemporary=true
    RemoteRole=ROLE_SimulatedProxy
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 24/7/2006 19:49:22.000 - Creation time: Wed 7/2/2007 19:16:49.531 - Created with UnCodeX