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

Botpack.UTChunk


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
//=============================================================================
// UTChunk.
//=============================================================================
class UTChunk extends Projectile;

var chunktrail trail;
var Texture AnimFrame[12];
var int Count;

#exec OBJ LOAD FILE=textures\ChunkGlow.utx PACKAGE=Botpack.ChunkGlow

    simulated function PostBeginPlay()
    {
        local rotator RandRot;

        if ( Level.NetMode != NM_DedicatedServer )
        {
            if ( !Region.Zone.bWaterZone )
                Trail = Spawn(class'ChunkTrail',self);
            SetTimer(0.1, true);
        }

        if ( Role == ROLE_Authority )
        {
            RandRot = Rotation;
            RandRot.Pitch += FRand() * 2000 - 1000;
            RandRot.Yaw += FRand() * 2000 - 1000;
            RandRot.Roll += FRand() * 2000 - 1000;
            Velocity = Vector(RandRot) * (Speed + (FRand() * 200 - 100));
            if (Region.zone.bWaterZone)
                Velocity *= 0.65;
        }
        Super.PostBeginPlay();
    }

    simulated function ProcessTouch (Actor Other, vector HitLocation)
    {
        if ( (Chunk(Other) == None) && ((Physics == PHYS_Falling) || (Other != Instigator)) )
        {
            speed = VSize(Velocity);
            If ( speed > 200 )
            {
                if ( Role == ROLE_Authority )
                    Other.TakeDamage(damage, instigator,HitLocation,
                        (MomentumTransfer * Velocity/speed), MyDamageType );
                if ( FRand() < 0.5 )
                    PlaySound(Sound 'ChunkHit',, 4.0,,200);
            }
            Destroy();
        }
    }

    simulated function Timer() 
    {
        Count++;
        Texture = AnimFrame[Count];
        if ( Count == 11 )
            SetTimer(0.0,false);
    }

    simulated function Landed( Vector HitNormal )
    {
        SetPhysics(PHYS_None);
    }

    simulated function HitWall( vector HitNormal, actor Wall )
    {
        local float Rand;
        local SmallSpark s;

        if ( (Mover(Wall) != None) && Mover(Wall).bDamageTriggered )
        {
            if ( Level.NetMode != NM_Client )
                Wall.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), MyDamageType);
            Destroy();
            return;
        }
        if ( Physics != PHYS_Falling ) 
        {
            SetPhysics(PHYS_Falling);
            if ( !Level.bDropDetail && (Level.Netmode != NM_DedicatedServer) && !Region.Zone.bWaterZone ) 
            {
                if ( FRand() < 0.5 )
                {
                    s = Spawn(Class'SmallSpark',,,Location+HitNormal*5,rotator(HitNormal));
                    s.RemoteRole = ROLE_None;
                }
                else
                    Spawn(class'WallCrack',,,Location, rotator(HitNormal));
            }
        }
        Velocity = 0.8*(( Velocity dot HitNormal ) * HitNormal * (-1.8 + FRand()*0.8) + Velocity);   // Reflect off Wall w/damping
        SetRotation(rotator(Velocity));
        speed = VSize(Velocity);
        if ( speed > 100 ) 
        {
            MakeNoise(0.3);
            Rand = FRand();
            if (Rand < 0.33)    PlaySound(sound 'Hit1', SLOT_Misc,0.6,,1000);   
            else if (Rand < 0.66) PlaySound(sound 'Hit3', SLOT_Misc,0.6,,1000);
            else PlaySound(sound 'Hit5', SLOT_Misc,0.6,,1000);
        }
    }

    simulated function zonechange(Zoneinfo NewZone)
    {
        if (NewZone.bWaterZone)
        {
            if ( Trail != None )
                Trail.Destroy();
            SetTimer(0.0, false);
            Texture = AnimFrame[11];
            Velocity *= 0.65;
        }
    }

defaultproperties
{
     AnimFrame(0)=Texture'Botpack.ChunkGlow.Chunk_a00'
     AnimFrame(1)=Texture'Botpack.ChunkGlow.Chunk_a01'
     AnimFrame(2)=Texture'Botpack.ChunkGlow.Chunk_a02'
     AnimFrame(3)=Texture'Botpack.ChunkGlow.Chunk_a03'
     AnimFrame(4)=Texture'Botpack.ChunkGlow.Chunk_a04'
     AnimFrame(5)=Texture'Botpack.ChunkGlow.Chunk_a05'
     AnimFrame(6)=Texture'Botpack.ChunkGlow.Chunk_a06'
     AnimFrame(7)=Texture'Botpack.ChunkGlow.Chunk_a07'
     AnimFrame(8)=Texture'Botpack.ChunkGlow.Chunk_a08'
     AnimFrame(9)=Texture'Botpack.ChunkGlow.Chunk_a09'
     AnimFrame(10)=Texture'Botpack.ChunkGlow.Chunk_a10'
     AnimFrame(11)=Texture'Botpack.ChunkGlow.Chunk_a11'
     speed=2500.000000
     MaxSpeed=2700.000000
     Damage=16.000000
     MomentumTransfer=10000
     MyDamageType=shredded
     RemoteRole=ROLE_SimulatedProxy
     LifeSpan=2.900000
     Texture=Texture'Botpack.ChunkGlow.Chunk_a00'
     DrawScale=0.400000
     AmbientGlow=255
     bUnlit=True
     bNoSmooth=True
     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:16:16.256 - Created with UnCodeX