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

UnrealI.MagmaBurst


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
//=============================================================================
// MagmaBurst.
//=============================================================================
class MagmaBurst expands Rockslide;
    
// Spawns off a number of Magma elements, which all die out
// within a random amount of time.  This code modified from 
// Sparks.  MZM
                                // Reasonable defaults
var() int      MinSpawnedAtOnce;    // 1
var() int      MaxSpawnedAtOnce;    // 3
var() float    MinSpawnSpeed;       // 200
var() float    MaxSpawnSpeed;       // 300
var() float    MinBurnTime;     // 0.4
var() float    MaxBurnTime;     // 1.0
var() float    MinBrightness;       // 0.7	(values can only go from 0.0 -> 1.0)
var() float    MaxBrightness;       // 1.0    "							   "
var() rotator  SpawnCenterDir;
var() int      AngularDeviation;    // approx. 0x2000 -> 8192

function MoreMagma () 
{
    local vector    SpawnLoc;
    local Magma        TempMagma;
    local FlameBall TempFlame;
    local rotator  SpawnDir;

    SpawnLoc = Location - (CubeDimensions*0.5);
    SpawnLoc.X += FRand()*CubeDimensions.X;
    SpawnLoc.Y += FRand()*CubeDimensions.Y;
    SpawnLoc.Z += FRand()*CubeDimensions.Z;

    // Time to generate another Magma Rock.
    TempMagma = Spawn (class 'Magma', , '', SpawnLoc);
    
    // Spawn a lava burst as the magma flies out
    TempFlame = Spawn (class 'FlameBall', , '', SpawnLoc);

    SpawnDir = SpawnCenterDir;
    SpawnDir.Pitch += -AngularDeviation + Rand(AngularDeviation*2);
    SpawnDir.Yaw   += -AngularDeviation + Rand(AngularDeviation*2);
    TempMagma.SetRotation(SpawnDir);
    TempMagma.RotationRate = RotRand();
    TempMagma.Speed    = (MinSpawnSpeed + 
                           FRand()*(MaxSpawnSpeed-MinSpawnSpeed));

    TempMagma.BurnTime = MinBurnTime + FRand()*(MaxBurnTime-MinBurnTime);

    // 0=dark  1=bright
    TempMagma.InitialBrightness = MinBrightness + 
                                 FRand()*(MaxBrightness-MinBrightness);

    TempMagma.DrawScale = (MaxScaleFactor-MinScaleFactor)*FRand()+MinScaleFactor;
}


state() Active 
{
    function MakeRock()
    {
        local int i, NumSpawnedNow;

        NumSpawnedNow = Rand(MaxSpawnedAtOnce-MinSpawnedAtOnce+1)+MinSpawnedAtOnce;
        for (i=0; i<NumSpawnedNow; i++)
            MoreMagma();
    }
}


auto state() Triggered 
{
    function Trigger (actor Other, pawn EventInstigator) 
    {
        GotoState ('Active');
    }
}

defaultproperties
{
     MinSpawnedAtOnce=1
     MaxSpawnedAtOnce=4
     MinSpawnSpeed=200.000000
     MaxSpawnSpeed=1000.000000
     MinBurnTime=20.000000
     MaxBurnTime=25.000000
     MinBrightness=190.000000
     MaxBrightness=240.000000
     SpawnCenterDir=(Pitch=20000)
     AngularDeviation=36000
     CubeDimensions=(X=60.000000,Y=60.000000,Z=60.000000)
     MinBetweenTime=0.700000
     MaxBetweenTime=1.700000
     MinScaleFactor=0.600000
     MaxScaleFactor=1.300000
     Tag=MagmaTest1
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sun 21/2/2010 23:48:40.000 - Creation time: Sun 21/2/2010 23:49:52.304 - Created with UnCodeX