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

Botpack.Razor2


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
//=============================================================================
// Razor2
// A human modified RazorBlade
//=============================================================================
class Razor2 extends Projectile;

#exec MESH IMPORT MESH=razorblade ANIVFILE=MODELS\razorblade_a.3D DATAFILE=MODELS\razorblade_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=razorblade X=0 Y=0 Z=0 YAW=-64
#exec MESH SEQUENCE MESH=razorblade SEQ=All    STARTFRAME=0   NUMFRAMES=30
#exec MESH SEQUENCE MESH=razorblade SEQ=Spin  STARTFRAME=0   NUMFRAMES=29
#exec MESHMAP SCALE MESHMAP=razorblade X=0.09 Y=0.09 Z=0.18
#exec TEXTURE IMPORT NAME=RazTrail FILE=MODELS\raztrail.PCX GROUP="Skins"
#exec TEXTURE IMPORT NAME=RazSkin FILE=MODELS\razorskin.PCX GROUP="Skins"
#exec MESHMAP SETTEXTURE MESHMAP=razorblade NUM=1 TEXTURE=RazSkin
#exec MESHMAP SETTEXTURE MESHMAP=razorblade NUM=2 TEXTURE=RazTrail

var int NumWallHits;
var bool bCanHitInstigator, bHitWater;

/////////////////////////////////////////////////////
auto state Flying
{
    simulated function ProcessTouch (Actor Other, Vector HitLocation)
    {
        if ( bCanHitInstigator || (Other != Instigator) ) 
        {
            if ( Role == ROLE_Authority )
            {
                if ( Other.bIsPawn && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight) 
                    && (!Instigator.IsA('Bot') || !Bot(Instigator).bNovice) )
                    Other.TakeDamage(3.5 * damage, instigator,HitLocation,
                        (MomentumTransfer * Normal(Velocity)), 'decapitated' );
                else             
                    Other.TakeDamage(damage, instigator,HitLocation,
                        (MomentumTransfer * Normal(Velocity)), 'shredded' );
            }
            if ( Other.bIsPawn )
                PlaySound(MiscSound, SLOT_Misc, 2.0);
            else
                PlaySound(ImpactSound, SLOT_Misc, 2.0);
            destroy();
        }
    }

    simulated function ZoneChange( Zoneinfo NewZone )
    {
        local Splash w;
        
        if (!NewZone.bWaterZone || bHitWater) Return;

        bHitWater = True;
        if ( Level.NetMode != NM_DedicatedServer )
        {
            w = Spawn(class'Splash',,,,rot(16384,0,0));
            w.DrawScale = 0.5;
            w.RemoteRole = ROLE_None;
        }
        Velocity=0.6*Velocity;
    }

    simulated function SetRoll(vector NewVelocity) 
    {
        local rotator newRot;   
    
        newRot = rotator(NewVelocity);  
        SetRotation(newRot);    
    }

    simulated function HitWall (vector HitNormal, actor Wall)
    {
        local vector Vel2D, Norm2D;

        bCanHitInstigator = true;
        PlaySound(ImpactSound, SLOT_Misc, 2.0);
        LoopAnim('Spin',1.0);
        if ( (Mover(Wall) != None) && Mover(Wall).bDamageTriggered )
        {
            if ( Role == ROLE_Authority )
                Wall.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), MyDamageType);
            Destroy();
            return;
        }
        NumWallHits++;
        SetTimer(0, False);
        MakeNoise(0.3);
        if ( NumWallHits > 6 )
            Destroy();

        if ( NumWallHits == 1 ) 
        {
            Spawn(class'WallCrack',,,Location, rotator(HitNormal));
            Vel2D = Velocity;
            Vel2D.Z = 0;
            Norm2D = HitNormal;
            Norm2D.Z = 0;
            Norm2D = Normal(Norm2D);
            Vel2D = Normal(Vel2D);
            if ( (Vel2D Dot Norm2D) < -0.999 )
            {
                HitNormal = Normal(HitNormal + 0.6 * Vel2D);
                Norm2D = HitNormal;
                Norm2D.Z = 0;
                Norm2D = Normal(Norm2D);
                if ( (Vel2D Dot Norm2D) < -0.999 )
                {
                    if ( Rand(1) == 0 )
                        HitNormal = HitNormal + vect(0.05,0,0);
                    else
                        HitNormal = HitNormal - vect(0.05,0,0);
                    if ( Rand(1) == 0 )
                        HitNormal = HitNormal + vect(0,0.05,0);
                    else
                        HitNormal = HitNormal - vect(0,0.05,0);
                    HitNormal = Normal(HitNormal);
                }
            }
        }
        Velocity -= 2 * (Velocity dot HitNormal) * HitNormal;  
        SetRoll(Velocity);
    }

    function SetUp()
    {
        local vector X;

        X = vector(Rotation);   
        Velocity = Speed * X;     // Impart ONLY forward vel
        if (Instigator.HeadRegion.Zone.bWaterZone)
            bHitWater = True;   
    }

    simulated function BeginState()
    {

        SetTimer(0.2, false);
        SetUp();

        if ( Level.NetMode != NM_DedicatedServer )
        {
            LoopAnim('Spin',1.0);
            if ( Level.NetMode == NM_Standalone )
                SoundPitch = 200 + 50 * FRand();
        }           
    }

    simulated function Timer()
    {
        bCanHitInstigator = true;
    }
}

defaultproperties
{
     speed=1300.000000
     MaxSpeed=1200.000000
     Damage=30.000000
     MomentumTransfer=15000
     SpawnSound=Sound'UnrealI.Razorjack.StartBlade'
     ImpactSound=Sound'UnrealI.Razorjack.BladeHit'
     MiscSound=Sound'UnrealI.Razorjack.BladeThunk'
     RemoteRole=ROLE_SimulatedProxy
     LifeSpan=6.000000
     AnimSequence=spin
     AmbientSound=Sound'UnrealI.Razorjack.RazorHum'
     Mesh=LodMesh'Botpack.RazorBlade'
     AmbientGlow=167
     bUnlit=True
     SoundRadius=12
     SoundVolume=255
     SoundPitch=200
     bBounce=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Do 19.5.2005 19:42:14.000 - Creation time: Fr 7.6.2013 13:15:54.977 - Created with UnCodeX