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

UT2k4AssaultFull.FX_BallTurret_Shield


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
//=============================================================================
// FX_BallTurret_Shield
//=============================================================================
// Created by Laurent Delayen
// © 2003, Epic Games, Inc.  All Rights Reserved
//=============================================================================

class FX_BallTurret_Shield extends Actor;

#exec OBJ LOAD FILE=XEffectMat.utx

var float           Brightness, DesiredBrightness;
var int             HitCount, OldHitCount;
var ShieldSparks    Sparks;


replication
{
    unreliable if ( Role == ROLE_Authority && !bHidden )
        HitCount; 
}


simulated function Destroyed()
{
    if ( Sparks != None )
        Sparks.Destroy();
}

simulated function Flash(int Drain)
{
    if ( Sparks == None )
        Sparks = Spawn(class'ShieldSparks');

    if ( Instigator != None && Instigator.IsFirstPerson() )
    {
        Sparks.SetLocation( Location + Vect(0,0,20) + VRand()*12.0 );
        Sparks.SetRotation( Rotation );
        Sparks.mStartParticles = 16;
    }
    else if ( EffectIsRelevant(Location, false) )
    {
        Sparks.SetLocation( Location + VRand()*8.0 );
        Sparks.SetRotation( Rotation );
        Sparks.mStartParticles = 16;
    }

    Brightness  = FMin(Brightness + Drain / 2, 250.0);
    Skins[0]    = Skins[1];

    SetTimer(0.2, false);
}

simulated function Timer()
{
    Skins[0] = default.Skins[0];
}

function SetBrightness(int b, bool bHit)
{
    DesiredBrightness = FMin(50+b*2, 250.0);
    if ( bHit )
    {
        HitCount++;
        Flash( 50 );
    }
}

simulated function PostNetReceive()
{
    if ( OldHitCount == -1 )
        OldHitCount = HitCount;
    else if ( HitCount != OldHitCount )
    {
        Flash( 50 );
        OldHitCount = HitCount;
    }
}

defaultproperties
{
     Brightness=250.000000
     DesiredBrightness=250.000000
     OldHitCount=-1
     DrawType=DT_StaticMesh
     StaticMesh=StaticMesh'WeaponStaticMesh.Shield'
     bHidden=True
     bTrailerSameRotation=True
     bReplicateInstigator=True
     Physics=PHYS_Trailer
     RemoteRole=ROLE_SimulatedProxy
     DrawScale3D=(X=40.000000,Y=15.000000,Z=15.000000)
     PrePivot=(X=-2.000000)
     Skins(0)=FinalBlend'XEffectMat.Shield.Shield3rdFB'
     Skins(1)=FinalBlend'XEffectMat.Shield.ShieldRip3rdFB'
     AmbientGlow=250
     bUnlit=True
     bNetNotify=True
}

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