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

UnrealShare.SlithProjectile


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
//=============================================================================
// SlithProjectile.
//=============================================================================
class SlithProjectile expands Projectile;

#exec MESH IMPORT MESH=ngel ANIVFILE=MODELS\ngel_a.3D DATAFILE=MODELS\ngel_d.3D X=0 Y=0 Z=0 ZEROTEX=1
#exec MESH ORIGIN MESH=ngel X=-20 Y=0 Z=0 YAW=0 PITCH=-64 ROLL=0

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

#exec TEXTURE IMPORT NAME=Jflare FILE=MODELS\flare.PCX
#exec MESHMAP SCALE MESHMAP=ngel X=0.1 Y=0.1 Z=0.2
#exec MESHMAP SETTEXTURE MESHMAP=ngel NUM=0 TEXTURE=Jflare

#exec AUDIO IMPORT FILE="Sounds\slith\Slispt1.WAV" NAME="SliSpawn" GROUP="Slith"
#exec AUDIO IMPORT FILE="Sounds\slith\SliImp2.WAV" NAME="SliImpact" GROUP="Slith"

var rotator RandRot;
var vector SurfaceNormal;   
var bool bInAir;
var float DotProduct;
var int i;

function Timer()
{
    local GreenSmokePuff gsp;

    gsp = Spawn(class'GreenSmokePuff',,,Location+SurfaceNormal*9);
    if (i!=-1) 
    {
        if (LightBrightness > 10) LightBrightness -= 10;
        DrawScale = 0.9*DrawScale;
        gsp.DrawScale = DrawScale*5;
        i++;
        if (i>12) Explode(Location, vect(0,0,0));
    }
}

function Explode(vector HitLocation, vector HitNormal)
{
    local FlameBall f;

    HurtRadius(damage * DrawScale, DrawScale * 200, 'corroded', MomentumTransfer, HitLocation);
    Destroy();  
}
    
auto state Flying
{
    function ProcessTouch (Actor Other, vector HitLocation) 
    { 
        if ( Slith(Other) == None )
            Explode(HitLocation, vect(0,0,0)); 
    }

    singular function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
                            vector momentum, name damageType )
    {
        Explode(Location, vect(0,0,0));
    }

    function HitWall( vector HitNormal, actor Wall )
    {
        MakeNoise(0.6); 
        bInAir = False;
        PlaySound(ImpactSound); 
        SurfaceNormal = HitNormal;
        RandRot = rotator(HitNormal);
        RandRot.Roll += 32768;
        SetRotation(RandRot);   
        PlaySound(ImpactSound);     
        SetPhysics(PHYS_None);
        GoToState('OnSurface');
    }

    function BeginState()
    {   
        i=-1;
        if (FRand() < 0.5)
            DrawScale = 0.3 + 0.7 * FRand();
        Velocity = Vector(Rotation) * speed;    
        SetTimer(0.2,True);
        RotationRate.Yaw = Int(200000 * FRand()) - 100000;
        RotationRate.Pitch = Int(FRand() * (200000 - Abs(RotationRate.Yaw))) 
                                - (100000 - Abs(RotationRate.Yaw)/2);
        LoopAnim('Flying',0.4);
        SurfaceNormal = Vect(0,0,0);
        bInAir=True;
        PlaySound(SpawnSound);
        if( Region.zone.bWaterZone )
            Velocity=Velocity*0.7;
    }
}

state OnSurface
{
    function ProcessTouch (Actor Other, vector HitLocation)
    {
        Explode(HitLocation, vect(0,0,0));
    }
Begin:
    i=0;
    PlayAnim('Hit');
    FinishAnim();
    DotProduct = SurfaceNormal dot vect(0,0,-1);
    If( DotProduct > 0.7 )
    {
        PlayAnim('Drip',0.1);
        FinishAnim();
    }
    else if (DotProduct > -0.5)
    {
        PlayAnim('Slide',0.2);
        Finishanim();
    }
}

defaultproperties
{
     speed=750.000000
     Damage=40.000000
     MomentumTransfer=20000
     SpawnSound=Sound'UnrealShare.Slith.SliSpawn'
     ImpactSound=Sound'UnrealShare.Slith.SliImpact'
     bNetTemporary=False
     Mesh=Mesh'UnrealShare.ngel'
     DrawScale=0.500000
     bUnlit=True
     CollisionRadius=6.000000
     CollisionHeight=4.000000
     LightType=LT_Steady
     LightEffect=LE_NonIncidence
     LightBrightness=101
     LightHue=88
     LightSaturation=9
     LightRadius=4
     bBounce=True
     bFixedRotationDir=True
}

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