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

UnrealShare.BioGel


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
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
//=============================================================================
// BioGel.
//=============================================================================
class BioGel expands Projectile;

#exec MESH IMPORT MESH=BioRGel ANIVFILE=MODELS\nGel_a.3D DATAFILE=MODELS\nGel_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=BioRGel X=-45 Y=0 Z=0 YAW=0 PITCH=-64 ROLL=0

#exec MESH SEQUENCE MESH=BioRGel SEQ=All     STARTFRAME=0   NUMFRAMES=56
#exec MESH SEQUENCE MESH=BioRGel SEQ=Flying  STARTFRAME=0   NUMFRAMES=13
#exec MESH SEQUENCE MESH=BioRGel SEQ=Still   STARTFRAME=13  NUMFRAMES=1
#exec MESH SEQUENCE MESH=BioRGel SEQ=Hit     STARTFRAME=14  NUMFRAMES=10
#exec MESH SEQUENCE MESH=BioRGel SEQ=Drip    STARTFRAME=24  NUMFRAMES=13
#exec MESH SEQUENCE MESH=BioRGel SEQ=Slide   STARTFRAME=37  NUMFRAMES=7
#exec MESH SEQUENCE MESH=BioRGel SEQ=Shrivel STARTFRAME=44  NUMFRAMES=12

#exec TEXTURE IMPORT NAME=Jflare FILE=MODELS\flare.PCX
#exec MESHMAP SCALE MESHMAP=BioRGel X=0.05 Y=0.05 Z=0.1
#exec MESHMAP SETTEXTURE MESHMAP=BioRGel NUM=1 TEXTURE=Jflare

#exec MESH NOTIFY MESH=BioRGel SEQ=Drip TIME=0.6 FUNCTION=DropDrip

#exec AUDIO IMPORT FILE="sounds\general\explg02.wav" NAME="Explg02" GROUP="General"
#exec AUDIO IMPORT FILE="..\Unreali\Sounds\BRifle\GelHit1.WAV" NAME="GelHit" GROUP="BioRifle"

var vector SurfaceNormal;   
var bool bOnGround;
var bool bCheckedSurface;
var int numBio;
var float wallTime;
var float BaseOffset;

function PostBeginPlay()
{
    SetTimer(3.0, false);
    Super.PostbeginPlay();
}
    
function Timer()
{
    local GreenGelPuff f;

    f = spawn(class'GreenGelPuff',,,Location + SurfaceNormal*8); 
    f.DrawScale = DrawScale*2.0;
    f.numBlobs = numBio;
    if ( numBio > 0 )
        f.SurfaceNormal = SurfaceNormal;    
    PlaySound (MiscSound,,3.0*DrawScale);   
    if ( (Mover(Base) != None) && Mover(Base).bDamageTriggered )
        Base.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), '');
    
    HurtRadius(damage * Drawscale, DrawScale * 120, 'corroded', MomentumTransfer * Drawscale, Location);
    Destroy();  
}
    
simulated function SetWall(vector HitNormal, Actor Wall)
{
    local vector TraceNorm, TraceLoc, Extent;
    local actor HitActor;
    local rotator RandRot;

    SurfaceNormal = HitNormal;
    RandRot = rotator(HitNormal);
    RandRot.Roll += 32768;
    SetRotation(RandRot);   
    if ( Mover(Wall) != None )
        SetBase(Wall);
}

singular function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
                        vector momentum, name damageType )
{
    if ( damageType == 'Corroded' )
        numBio = 3;
    GoToState('Exploding');
}

auto state Flying
{
    function ProcessTouch (Actor Other, vector HitLocation) 
    { 
        if ( Pawn(Other)!=Instigator || bOnGround) 
            Global.Timer(); 
    }

    simulated function HitWall( vector HitNormal, actor Wall )
    {
        SetPhysics(PHYS_None);      
        MakeNoise(0.3); 
        bOnGround = True;
        PlaySound(ImpactSound);
        SetWall(HitNormal, Wall);
        PlayAnim('Hit');
        GoToState('OnSurface');
    }


    simulated function ZoneChange( Zoneinfo NewZone )
    {
        local waterring w;
        
        if (!NewZone.bWaterZone) Return;
    
        if (!bOnGround) 
        {
            w = Spawn(class'WaterRing',,,,rot(16384,0,0));
            w.DrawScale = 0.1;
        }
        bOnGround = True;
        Velocity=0.1*Velocity;
    }

    function Timer()
    {
        GotoState('Exploding'); 
    }

    function BeginState()
    {   
        Velocity = Vector(Rotation) * Speed;
        Velocity.z += 120;
        if ( Level.NetMode != NM_DedicatedServer )
            RandSpin(100000);
        LoopAnim('Flying',0.4);
        bOnGround=False;
        PlaySound(SpawnSound);
        if( Region.zone.bWaterZone )
            Velocity=Velocity*0.7;
    }
}

state Exploding
{
    ignores Touch, TakeDamage;

    function BeginState()
    {
        SetTimer(0.1+FRand()*0.2, False);
    }
}

state OnSurface
{
    function ProcessTouch (Actor Other, vector HitLocation)
    {
        GotoState('Exploding');
    }

    simulated function CheckSurface()
    {
        local float DotProduct;

        DotProduct = SurfaceNormal dot vect(0,0,-1);
        If( DotProduct > 0.7 )
            PlayAnim('Drip',0.1);
        else if (DotProduct > -0.5) 
            PlayAnim('Slide',0.2);
    }

    function Timer()
    {
        if ( Mover(Base) != None )
        {
            WallTime -= 0.2;
            if ( WallTime < 0.15 )
                Global.Timer();
            else if ( VSize(Location - Base.Location) > BaseOffset + 4 )
                Global.Timer();
        }
        else
            Global.Timer();
    }

    function BeginState()
    {
        wallTime = DrawScale*3+1;
        
        if ( Mover(Base) != None )
        {
            BaseOffset = VSize(Location - Base.Location);
            SetTimer(0.2, true);
        }
        else 
            SetTimer(wallTime, false);
    }

    simulated function AnimEnd()
    {
        if ( !bCheckedSurface && (DrawScale > 1.0) )
            CheckSurface();

        bCheckedSurface = true;
    }
}

defaultproperties
{
     numBio=7
     speed=800.000000
     MaxSpeed=1500.000000
     Damage=40.000000
     MomentumTransfer=20000
     ImpactSound=Sound'UnrealShare.BioRifle.GelHit'
     MiscSound=Sound'UnrealShare.General.Explg02'
     bNetTemporary=False
     Physics=PHYS_Falling
     RemoteRole=ROLE_SimulatedProxy
     LifeSpan=12.000000
     AnimSequence=Flying
     Mesh=Mesh'UnrealShare.BioRGel'
     bUnlit=True
     CollisionRadius=2.000000
     CollisionHeight=2.000000
     bProjTarget=True
     LightType=LT_Steady
     LightEffect=LE_NonIncidence
     LightBrightness=70
     LightHue=91
     LightRadius=3
     bBounce=True
     Buoyancy=170.000000
}

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:51.181 - Created with UnCodeX