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
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
//=============================================================================
// ShellCase.
//=============================================================================
class ShellCase extends 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 PostBeginPlay()
{
    Super.PostBeginPlay();
    SetTimer(0.1, false);
}

simulated function Timer()
{
    LightType = LT_None;
}

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

    if ( bHasBounced && ((FRand() < 0.85) || (Velocity.Z > -50)) )
        bBounce = false;
    if ( !Region.Zone.bWaterZone )
        PlaySound(sound 'shell2');
    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;

    if ( !Region.Zone.bWaterZone )
        PlaySound(sound 'shell2');  
    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
     bNetOptional=True
     bReplicateInstigator=False
     Physics=PHYS_Falling
     RemoteRole=ROLE_SimulatedProxy
     LifeSpan=3.000000
     Mesh=LodMesh'UnrealShare.Shell'
     bUnlit=True
     bNoSmooth=True
     bCollideActors=False
     LightType=LT_Steady
     LightEffect=LE_NonIncidence
     LightBrightness=250
     LightHue=28
     LightSaturation=128
     LightRadius=7
     bBounce=True
     bFixedRotationDir=True
     NetPriority=2.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: za 22-4-2006 13:06:32.000 - Creation time: za 22-4-2006 13:07:27.328 - Created with UnCodeX