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

UnrealI.Magma


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
//=============================================================================
// Magma.
//=============================================================================
class Magma expands BigRock;

// Owner (spawner) specifies the velocity of the Magma (implicitly in
// Actor properties), the length of time it can burn for, the initial 
// brightness, as well as the damage caused.  Modified from Sparkbit
// and Rock.  MZM

var() float DelaySmoke;
var   float BurnTime;
var   float InitialBrightness;
var   float LastSmokeTime;
var   float PassedTime;

function Timer()
 {

    // The Magma should lose its brightness as it
    // burns away, but not linearly - the main brightness
    // decays in quadratic fashion but the actual brightness
    // is also randomly tweaked to give the appearance of
    // non-uniform burning.  The object also gives off
    // its own light.
    //
    local float tempBrightness;

    PassedTime += 0.15;
    // Spawn smoke if enough time has passed.
    if (PassedTime-LastSmokeTime >= DelaySmoke) 
    {
        //Spawn (class 'SmokeTrail', , '', Location+Vect(0,0,8));
        LastSmokeTime = PassedTime;
    }
    tempBrightness = InitialBrightness*(1-
                    ((PassedTime*(1-0.1+0.2*FRand()))/BurnTime) **2);
    tempBrightness = FClamp (tempBrightness, 0, 1);
        
    LightBrightness = tempBrightness * 90;
    AmbientGlow     = tempBrightness * 240;
}

auto state Flying
{
    simulated function HitWall (vector HitNormal, actor Wall)
    {
        InitialBrightness *= 1.5;
        Super.HitWall(HitNormal, Wall);
    }

Begin:
    SetTimer(0.15, true);
    if (Speed != 0) Velocity = Vector(Rotation) * Speed;
    RotationRate = RotRand();
    BurnTime = FMin(BurnTime, 0.1);
    SetPhysics (PHYS_Falling);
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: za 22-4-2006 12:52:32.000 - Creation time: za 22-4-2006 12:53:45.828 - Created with UnCodeX