Code: Select all
/* This is a destroyable mover. To use just create your mover brush and make it a BoomBoomMover.
Once it is placed it you can set a property in it called 'DamageThreshold'. Because bDamageTriggered is
set to TRUE it will cycle when it gets enough damage. However, this mover doesn't move. Instead it destroys in
a shower of fragments which carry the texture of the original mover. To make a larger effect raise the
ExplosionDimension setting.
Created by Titled, I just added some explanations and comments but no code alterations -gopo
*/
class BoomBoomMover extends Mover;
var() Texture WallTexture;
var() int ExplosionDimensions;
var() int DamScale;
function TakeDamage (int Damage, Pawn instigatedBy, Vector HitLocation, Vector Momentum, name DamageType)
{
local WallFragments S;
DamageThreshold -= Damage;
if ( DamageThreshold < 0 )
{
self.Trigger(self,instigatedBy);
}
if ( Damage > DamScale * FRand() )
{
// This will spawn fragments carrying the texture of the original boommover
S = Spawn(Class'WallFragments',,,HitLocation + ExplosionDimensions * VRand());
if ( S != None )
{
S.CalcVelocity(vect(0.00,0.00,0.00),128.0);
S.DrawScale = 1.0;
S.Skin = WallTexture;
}
// Remove this section if you use this, it serves no purpose
if ( (instigatedBy.PlayerReplicationInfo != None) && (FRand() > 0.89999998) )
{
TeamGamePlus(Level.Game).Teams[instigatedBy.PlayerReplicationInfo.Team].Score += 1;
instigatedBy.PlayerReplicationInfo.Score += 1;
}
// End remove
}
}
defaultproperties
{
MoverGlideType=0
MoveTime=0.00
bTriggerOnceOnly=True
bDamageTriggered=True
InitialState=TriggerOpenTimed
DamScale=0
ExplosionDimensions=250
}
Let me know if you want help. I'd get all over this if you were going to do the map end of it.