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

DeusEx.Cloud


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
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
//=============================================================================
// Cloud.
//=============================================================================
class Cloud extends DeusExProjectile;

var bool bFloating;
var float cloudRadius;
var float damageInterval;
var vector CloudLocation; //to make sure location is updated w/o making it dumb proxy

replication 
{
    reliable if ( Role == ROLE_Authority )
        CloudLocation;
}

auto simulated state Flying
{
    function HitWall(vector HitNormal, actor Wall)
    {
        // do nothing
        Velocity = vect(0,0,0);
    }
    function ProcessTouch (Actor Other, Vector HitLocation)
    {
        // do nothing
    }
}

event ZoneChange(ZoneInfo NewZone)
{
    Super.ZoneChange(NewZone);

    // clouds can't live underwater, so kill us quickly if we enter the water
    if ((NewZone.bWaterZone) && (LifeSpan > 2.0))
        LifeSpan = 2.0;
}

function Timer()
{
    local Actor A;
    local Vector offset, dist;
    local Pawn apawn;

    if ( Level.NetMode != NM_Standalone )
    {
        // Use PawnList for multiplayer
        apawn = Level.PawnList;
        while ( apawn != None )
        {
            dist = apawn.Location - Location;
            if ( VSize(dist) < cloudRadius )
            {
                offset = apawn.Location;
                apawn.TakeDamage( Damage, Instigator, offset, vect(0,0,0), damageType );                                                          
            }
            apawn = apawn.nextPawn;
        }
    }
    else
    {
        // check to see if anything has entered our effect radius
        // don't damage our owner
        foreach VisibleActors(class'Actor', A, cloudRadius)
            if (A != Owner)
            {
                // be sure to damage the torso
                offset = A.Location;
                A.TakeDamage(Damage, Instigator, offset, vect(0,0,0), damageType);
            }
    }
}

simulated function Tick(float deltaTime)
{
    local float value;
    local float sizeMult;
   local float NewDrawScale;

   if (Role == ROLE_Authority)
      CloudLocation = Location;
   else
      SetLocation(CloudLocation);

    // don't Super.Tick() becuase we don't want gravity to affect the stream
    time += deltaTime;

    value = 1.0+time;
    if (MinDrawScale > 0)
        sizeMult = MaxDrawScale/MinDrawScale;
    else
        sizeMult = 1;

   // DEUS_EX AMSD Update drawscale less often in mp, to reduce bandwidth hit.
   // Effect won't look quite as good for listen server client... but will otherwise
   // help tremendously (one gas grenade was 3k a sec in traffic).
   NewDrawScale = (-sizeMult/(value*value) + (sizeMult+1))*MinDrawScale;

    if (Level.Netmode == NM_Standalone)
   {
      DrawScale = NewDrawScale;
   }
   else if (Level.Netmode == NM_Client)
   {
      DrawScale = NewDrawScale;
   }
   else if (Level.Netmode == NM_DedicatedServer)
   {
      //Do nothing
   }
   else
   {
      //On a listen server, just start it full size.
      DrawScale = (-sizeMult/(50*50) + (sizeMult+1))*MinDrawScale;
   }

//      DrawScale = (-sizeMult/(value*value) + (sizeMult+1))*MinDrawScale;
   if (Role == ROLE_Authority)  
      ScaleGlow = FClamp(LifeSpan*0.5, 0.0, 1.0);

    // make it swim around a bit at random
    if (bFloating)
    {
        Acceleration = VRand() * 15;
        Acceleration.Z = 0;
    }
}

function BeginPlay()
{
    Super.BeginPlay();

    // set the cloud damage timer
    SetTimer(damageInterval, True);
}

defaultproperties
{
     cloudRadius=128.000000
     damageInterval=1.000000
     blastRadius=1.000000
     DamageType=PoisonGas
     AccurateRange=100
     maxRange=100
     maxDrawScale=5.000000
     bIgnoresNanoDefense=True
     ItemName="Gas Cloud"
     ItemArticle="a"
     speed=300.000000
     MaxSpeed=300.000000
     Damage=1.000000
     MomentumTransfer=100
     LifeSpan=1.000000
     DrawType=DT_Sprite
     Style=STY_Translucent
     Texture=None
     DrawScale=0.010000
     bUnlit=True
     CollisionRadius=16.000000
     CollisionHeight=16.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 8/11/2021 16:22:52.000 - Creation time: Mon 8/11/2021 16:31:23.665 - Created with UnCodeX