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

UnrealI.RazorBlade


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
//=============================================================================
// RazorBlade.
//=============================================================================
class RazorBlade expands Projectile;
 
#exec MESH IMPORT MESH=razorb ANIVFILE=MODELS\razorb_a.3D DATAFILE=MODELS\razorb_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=razorb X=0 Y=0 Z=0 YAW=-64
#exec MESH SEQUENCE MESH=razorb SEQ=All    STARTFRAME=0   NUMFRAMES=15
#exec MESH SEQUENCE MESH=razorb SEQ=Spin  STARTFRAME=0   NUMFRAMES=15
#exec TEXTURE IMPORT NAME=Jrazor1 FILE=MODELS\razor.PCX 
#exec OBJ LOAD FILE=textures\FireEffect54.utx PACKAGE=UNREALI.Effect54
#exec MESHMAP SCALE MESHMAP=razorb X=0.04 Y=0.04 Z=0.08
#exec MESHMAP SETTEXTURE MESHMAP=razorb NUM=1 TEXTURE=Jrazor1
#exec MESHMAP SETTEXTURE MESHMAP=razorb NUM=0 TEXTURE=Unreali.Effect54.FireEffect54

#exec AUDIO IMPORT FILE="Sounds\Razor\fly15.WAV" NAME="RazorHum" GROUP="RazorJack"
#exec AUDIO IMPORT FILE="Sounds\Razor\bladehit.wav" NAME="BladeHit" GROUP="RazorJack"
#exec AUDIO IMPORT FILE="Sounds\Razor\bladethunk.wav" NAME="BladeThunk" GROUP="RazorJack"
#exec AUDIO IMPORT FILE="Sounds\Razor\start9b.WAV" NAME="StartBlade" GROUP="RazorJack"

var int NumWallHits;
var bool bCanHitInstigator, bHitWater;
var int CurPitch,PitchStart,YawStart,CurYaw;
var rotator CurRotation;

/////////////////////////////////////////////////////
auto state Flying
{
    function ProcessTouch (Actor Other, Vector HitLocation)
    {
        if ( bCanHitInstigator || (Other != Instigator) ) 
        {
            if ( Other.IsA('Pawn') && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight)
                && (instigator.IsA('PlayerPawn') || (instigator.skill > 1))
                && (!Other.IsA('ScriptedPawn') || !ScriptedPawn(Other).bIsBoss) )
                Other.TakeDamage(3.5 * damage, instigator,HitLocation,
                    (MomentumTransfer * Normal(Velocity)), 'decapitated' );
            else             
                Other.TakeDamage(damage, instigator,HitLocation,
                    (MomentumTransfer * Normal(Velocity)), 'shredded' );
            PlaySound(MiscSound, SLOT_Misc, 2.0);
            destroy();
        }
    }

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

        bHitWater = True;
        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)
    {
        
        bCanHitInstigator = true;
        if ( (RemoteRole == ROLE_DumbProxy) || (Level.Netmode != NM_DedicatedServer) )
            PlaySound(ImpactSound, SLOT_Misc, 2.0);
        if ( Level.NetMode != NM_Client )
        {
            if ( (Mover(Wall) != None) && Mover(Wall).bDamageTriggered )
            {
                Wall.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), '');
                Destroy();
                return;
            }
            NumWallHits++;
            SetTimer(0, False);
            MakeNoise(0.3);
            if ( NumWallHits > 5 )
                Destroy();
        }
        Velocity -= 2 * ( Velocity dot HitNormal) * HitNormal;  
        SetRoll(Velocity);
        LoopAnim('Spin',1.0);       
    }

    function BeginState()
    {
        local vector X;

        X = vector(Rotation);   
        Velocity = Speed * X;     // Impart ONLY forward vel
        LoopAnim('Spin',1.0);
        PlaySound(SpawnSound, SLOT_None,4.2);
        if ( Level.NetMode == NM_Standalone )
            SoundPitch = 200 + 50 * FRand();            

        if (Instigator.HeadRegion.Zone.bWaterZone)
            bHitWater = True;   
    }

Begin:
    Sleep(0.2);
    bCanHitInstigator = true;
}

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