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

DeusEx.SmokeTrail


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
//=============================================================================
// SmokeTrail.
//=============================================================================
class SmokeTrail expands Effects;

var() float RiseRate;
var() bool bGravity;
var float OrigLifeSpan;
var float OrigScale;
var vector OrigVel;
var bool bScale;
var bool bFade;
var bool bFrozen;

// this seems to have to be here to load the damn smokepuff texture
#exec OBJ LOAD FILE=Effects

auto simulated state Flying
{
    simulated function Tick(float deltaTime)
    {
        // if we are frozen, don't update
        if (bFrozen && (Owner != None))
        {
            LifeSpan += deltaTime;
            return;
        }

        Velocity.X = OrigVel.X + 2 - FRand() * 5;
        Velocity.Y = OrigVel.Y + 2 - FRand() * 5;

        if (bGravity)
            Velocity.Z += Region.Zone.ZoneGravity.Z * deltaTime * 0.2;
        else
            Velocity.Z = OrigVel.Z + (RiseRate * (OrigLifeSpan - LifeSpan)) * (FRand() * 0.2 + 0.9);

        if (bScale)
        {
            if ( Level.NetMode != NM_Standalone )
                DrawScale = FClamp(OrigScale * (1.0 + (OrigLifeSpan - LifeSpan)), 0.4, 4.0);
            else
                DrawScale = FClamp(OrigScale * (1.0 + (OrigLifeSpan - LifeSpan)), 0.01, 4.0);
        }
        if (bFade)
            ScaleGlow = LifeSpan / OrigLifeSpan;    // this actually sets the alpha from 1.0 to 0.0
    }
    simulated function BeginState()
    {
        Super.BeginState();

        OrigScale = DrawScale;
        OrigVel = Velocity;
        OrigLifeSpan = LifeSpan;
    }
}

defaultproperties
{
     RiseRate=2.000000
     bScale=True
     bFade=True
     Physics=PHYS_Projectile
     LifeSpan=1.000000
     DrawType=DT_Sprite
     Style=STY_Translucent
     Texture=FireTexture'Effects.Smoke.SmokePuff1'
     DrawScale=0.100000
}

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