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

UnrealShare.Book


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
//=============================================================================
// Book.
//=============================================================================
class Book expands Decoration;

#exec MESH IMPORT MESH=BookM ANIVFILE=MODELS\book_a.3D DATAFILE=MODELS\book_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=BookM X=0 Y=0 Z=0 YAW=64
#exec MESH SEQUENCE MESH=BookM SEQ=All    STARTFRAME=0   NUMFRAMES=1
#exec MESH SEQUENCE MESH=BookM SEQ=Still  STARTFRAME=0   NUMFRAMES=1
#exec TEXTURE IMPORT NAME=JBook1 FILE=MODELS\Book1.PCX GROUP=Skins
#exec TEXTURE IMPORT NAME=JBook2 FILE=MODELS\Book2.PCX GROUP=Skins
#exec TEXTURE IMPORT NAME=JBook3 FILE=MODELS\Book3.PCX GROUP=Skins
#exec TEXTURE IMPORT NAME=JBook4 FILE=MODELS\Book4.PCX GROUP=Skins
#exec MESHMAP SCALE MESHMAP=BookM X=0.02 Y=0.02 Z=0.04
#exec MESHMAP SETTEXTURE MESHMAP=BookM NUM=0 TEXTURE=JBook1

#exec AUDIO IMPORT FILE="Sounds\General\Chunkhit2.WAV" NAME="Chunkhit2" GROUP="General"

var bool bFirstHit;

Auto State Animate
{
    function HitWall (vector HitNormal, actor Wall)
    {
        local float speed;

        Velocity = 0.5*(( Velocity dot HitNormal ) * HitNormal * (-2.0) + Velocity);   // Reflect off Wall w/damping
        speed = VSize(Velocity);
        if (speed>500) PlaySound(PushSound, SLOT_Misc,1.0);         
        if (bFirstHit && speed<400) 
        {
            bFirstHit=False;
            bRotatetoDesired=True;
            bFixedRotationDir=False;
            DesiredRotation.Pitch=0;    
            DesiredRotation.Yaw=FRand()*65536;
            DesiredRotation.Roll=0;     
        }
        RotationRate.Yaw = RotationRate.Yaw*0.75;
        RotationRate.Roll = RotationRate.Roll*0.75;
        RotationRate.Pitch = RotationRate.Pitch*0.75;   
        If (speed < 30) 
            bBounce = False;
    }   

    function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
                        Vector momentum, name damageType)
    {
        SetPhysics(PHYS_Falling);
        bBounce = True;
        Momentum.Z = abs(Momentum.Z*4+3000);
        Velocity=Momentum*0.02;
        RotationRate.Yaw = 250000*FRand() - 125000;
        RotationRate.Pitch = 250000*FRand() - 125000;
        RotationRate.Roll = 250000*FRand() - 125000;    
        DesiredRotation = RotRand();
        bRotateToDesired=False;
        bFixedRotationDir=True;
        bFirstHit=True;
    }
}

defaultproperties
{
     bPushable=True
     PushSound=Sound'UnrealShare.General.Chunkhit2'
     bStatic=False
     DrawType=DT_Mesh
     Mesh=Mesh'UnrealShare.BookM'
     bMeshCurvy=False
     CollisionRadius=12.000000
     CollisionHeight=4.000000
     bCollideActors=True
     bCollideWorld=True
     bBlockActors=True
     bBlockPlayers=True
     Mass=1.000000
}

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