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

UnrealShare.ExplodingWall


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
//=============================================================================
// ExplodingWall.
//=============================================================================
class ExplodingWall expands Effects;

#exec Texture Import File=models\exp001.pcx  Name=s_Exp Mips=Off Flags=2

var() float ExplosionSize;
var() float ExplosionDimensions;
var() float WallParticleSize;
var() float WoodParticleSize;
var() float GlassParticleSize;
var() int NumWallChunks;
var() int NumWoodChunks;
var() int NumGlassChunks;
var() texture WallTexture;
var() texture WoodTexture;
var() texture GlassTexture;
var() int Health;
var() name ActivatedBy[5];
var() sound BreakingSound;
var() bool bTranslucentGlass;
var() bool bUnlitGlass;

function PreBeginPlay()
{
    DrawType = DT_None;
    Super.PreBeginPlay();
}

Auto State Exploding
{
    singular function Trigger( actor Other, pawn EventInstigator )
    {
        Explode(EventInstigator, Vector(Rotation));
    }

    singular function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation,
                        Vector momentum, name damageType)
    {
        local int i;
        local bool bAbort;  

        if ( bOnlyTriggerable )
            return;
        
        if ( DamageType != 'All' )
        {
            bAbort = true;
            for ( i=0; i<5; i++ )    
                if (DamageType==ActivatedBy[i]) bAbort=False;
            if ( bAbort )
                return;
        }
        Health -= NDamage;
        if ( Health <= 0 )
            Explode(instigatedBy, Momentum);
    }

    function Explode( pawn EventInstigator, vector Momentum)
    {
        local int i;
        local Fragment s;
        local actor A;

        if( Event != '' )
            foreach AllActors( class 'Actor', A, Event )
                A.Trigger( Instigator, Instigator );

        Instigator = EventInstigator;
        if ( Instigator != None )
            MakeNoise(1.0);
        
        PlaySound(BreakingSound, SLOT_None,2.0);
    
        for (i=0 ; i<NumWallChunks ; i++) 
        {
            s = Spawn( class 'WallFragments',,,Location+ExplosionDimensions*VRand());
            if ( s != None )
            {
                s.CalcVelocity(vect(0,0,0),ExplosionSize);
                s.DrawScale = WallParticleSize;
                s.Skin = WallTexture;
            }
        }
        for (i=0 ; i<NumWoodChunks ; i++) 
        {
            s = Spawn( class 'WoodFragments',,,Location+ExplosionDimensions*VRand());
            if ( s != None )
            {
                s.CalcVelocity(vect(0,0,0),ExplosionSize);
                s.DrawScale = WoodParticleSize;
                s.Skin = WoodTexture;
            }
        }
        for (i=0 ; i<NumGlassChunks ; i++) 
        {
            s = Spawn( class 'GlassFragments', Owner,,Location+ExplosionDimensions*VRand());
            if ( s != None )
            {
                s.CalcVelocity(Momentum, ExplosionSize);
                s.DrawScale = GlassParticleSize;
                s.Skin = GlassTexture;
                s.bUnlit = bUnlitGlass;
                if (bTranslucentGlass) s.Style = STY_Translucent;
            }
        }
        Destroy();
    }
}

defaultproperties
{
     ExplosionSize=200.000000
     ExplosionDimensions=120.000000
     WallParticleSize=1.000000
     WoodParticleSize=1.000000
     GlassParticleSize=1.000000
     NumWallChunks=10
     NumWoodChunks=3
     ActivatedBy(0)=exploded
     bNetTemporary=False
     RemoteRole=ROLE_SimulatedProxy
     DrawType=DT_Sprite
     Texture=Texture'UnrealShare.s_Exp'
     DrawScale=0.300000
     CollisionRadius=32.000000
     CollisionHeight=32.000000
     bCollideActors=True
     bCollideWorld=True
     bProjTarget=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:51.758 - Created with UnCodeX