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

UT2004RPG.AbilityCounterShove


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
class AbilityCounterShove extends RPGAbility
    abstract;

static simulated function int Cost(RPGPlayerDataObject Data, int CurrentLevel)
{
    if (Data.Defense < 50)
        return 0;
    else
        return Super.Cost(Data, CurrentLevel);
}

static function HandleDamage(int Damage, Pawn Injured, Pawn Instigator, out vector Momentum, class<DamageType> DamageType, bool bOwnedByInstigator, int AbilityLevel)
{
    local float MomentumMod;

    if (bOwnedByInstigator || DamageType == class'DamTypeRetaliation' || Injured == Instigator || Instigator == None)
        return;

    //negative values to reverse direction
    if (AbilityLevel < 5)
        MomentumMod = - (0.25 * AbilityLevel);
    else
        MomentumMod = -1.50;

    Instigator.TakeDamage(0, Injured, Instigator.Location, (Momentum * Injured.Mass) * MomentumMod, class'DamTypeRetaliation');
}

defaultproperties
{
    AbilityName="CounterShove"
    Description="Whenever you are damaged by another player, 25% of the momentum per level (or 150% at level 5) is also done to the player who hurt you. Will not CounterShove a CounterShove. You must have a Damage Reduction of at least 50 to purchase this ability. (Max Level: 5)"
    StartingCost=15
    CostAddPerLevel=0
    MaxLevel=5
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 24/7/2006 19:49:20.000 - Creation time: Wed 7/2/2007 19:16:32.015 - Created with UnCodeX