Gah - a solution with more questions. – EntropicLqd

Legacy:UTClassicGameRules

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 01:28, 13 August 2003 by Burtlo (Talk) (Wow that was a tough one. :P)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
UT2003 :: Actor >> Info >> GameRules >> UTClassicGameRules (Package: XGame)

The UTClassicGameRules augments the damage dealing process in the game by increasing the damage by 20%.

Properties

None

Methods

int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType ) 
Augments the damage dealing process by increasing the damage by 20%.

Known Subclases

None

Code Walkthrough.

I thought that these would be useful examples to further demonstrate writing a GameRules for your game.

class UTClassicGameRules extends GameRules;
 
function int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
{
    Damage = Damage * 1.2;
    if ( NextGameRules != None )
        return NextGameRules.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
    return Damage;
}

The block of code handles two things: Increases the NetDamage done by 20% and then allows the other GameRules modifiers to go first.

This GameRules allows all other GameRules to affect the NetDamage before it augments the damage in play. If you neglect giving the other GameRules a chance to augment NetDamage, then all other GameRules loaded after this GameRules will not have a chance to augment play.