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

UnrealShare.ShellCase


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

#exec MESH IMPORT MESH=Shell ANIVFILE=MODELS\shell_a.3D DATAFILE=MODELS\shell_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=Shell X=0 Y=0 Z=0 YAW=64 ROLL=128
#exec MESH SEQUENCE MESH=Shell SEQ=All  STARTFRAME=0  NUMFRAMES=1
#exec TEXTURE IMPORT NAME=Autom1 FILE=MODELS\automag.PCX
#exec MESHMAP SCALE MESHMAP=Shell X=0.011 Y=0.011 Z=0.022
#exec MESHMAP SETTEXTURE MESHMAP=Shell NUM=1 TEXTURE=Autom1

#exec AUDIO IMPORT FILE="Sounds\automag\shell2.WAV" NAME="Shell2" GROUP="AutoMag"
#exec AUDIO IMPORT FILE="Sounds\General\Drip.WAV" NAME="Drip1" GROUP="General"

var bool bHasBounced;

simulated function PlayLanded()
{
    if ( (Level.NetMode != NM_DedicatedServer) && !Region.Zone.bWaterZone )
        PlaySound(sound 'shell2');  
}

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

    if ( bHasBounced && ((FRand() < 0.85) || (Velocity.Z > -50)) )
        bBounce = false;
    PlayLanded();
    RealHitNormal = HitNormal;
    HitNormal = Normal(HitNormal + 0.4 * VRand());
    if ( (HitNormal Dot RealHitNormal) < 0 )
        HitNormal *= -0.5; 
    Velocity = 0.5 * (Velocity - 2 * HitNormal * (Velocity Dot HitNormal));
    RandSpin(100000);
    bHasBounced = True;
}

simulated function ZoneChange( Zoneinfo NewZone )
{
    if (NewZone.bWaterZone && !Region.Zone.bWaterZone) 
    {
        Velocity=0.2*Velocity;  
        PlaySound(sound 'Drip1');           
        bHasBounced=True;
    }
}


simulated function Landed( vector HitNormal )
{
    local rotator RandRot;

    PlayLanded();
    SetPhysics(PHYS_None);
    RandRot = Rotation;
    RandRot.Pitch = 0;
    RandRot.Roll = 0;
    SetRotation(RandRot);
}

function Eject(Vector Vel)
{
    Velocity = Vel + Instigator.Velocity*0.5;
    RandSpin(100000);
    if (Instigator.HeadRegion.Zone.bWaterZone) 
    {
        Velocity = Velocity * (0.2+FRand()*0.2);
        bHasBounced=True;
    }
}

defaultproperties
{
     MaxSpeed=1000.000000
     Physics=PHYS_Falling
     RemoteRole=ROLE_SimulatedProxy
     LifeSpan=3.000000
     Mesh=Mesh'UnrealShare.Shell'
     bUnlit=True
     bNoSmooth=True
     bMeshCurvy=False
     bCollideActors=False
     bBounce=True
     bFixedRotationDir=True
     NetPriority=2.000000
     bNetOptional=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.505 - Created with UnCodeX