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

DruidsRPGcvs.DruidEnergyVampire


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
class DruidEnergyVampire extends RPGAbility
    config(UT2004RPG) 
    abstract;

static simulated function int Cost(RPGPlayerDataObject Data, int CurrentLevel)
{
    local int x;
    local bool ok;

    for (x = 0; x < Data.Abilities.length && !ok; x++)
        if (Data.Abilities[x] == class'ClassAdrenalineMaster')
            ok = true;
    if(!ok)
    {
        if(CurrentLevel > 0)
            log("Warning:"@data.Name@"has"@default.class@"Level"@CurrentLevel@"but does not have an associated Class to allow them to purchase it");
        return 0;
    }

    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 AdrenalineBonus;

    if(Instigator.Weapon != None && Instigator.Weapon.isA('RW_Rage'))
        return; //no vamp for rage weapons

    if (Damage < 1 || !bOwnedByInstigator || DamageType == class'DamTypeRetaliation' || Injured == Instigator || Instigator == None || Injured == None ||  UnrealPlayer(Instigator.Controller) == None || Instigator.Controller.Adrenaline >= Instigator.Controller.AdrenalineMax || Instigator.InCurrentCombo() || HasActiveArtifact(Instigator))
        return;
    
    if (Damage > Injured.Health)
        AdrenalineBonus = Injured.Health;
    else
        AdrenalineBonus = Damage;
    AdrenalineBonus *= 0.01 * AbilityLevel;

    if (Instigator.Controller.Adrenaline + AdrenalineBonus >= Instigator.Controller.AdrenalineMax)
        UnrealPlayer(Instigator.Controller).ClientDelayedAnnouncementNamed('Adrenalin', 15);

    Instigator.Controller.Adrenaline = FMin(Instigator.Controller.Adrenaline + AdrenalineBonus, Instigator.Controller.AdrenalineMax);
}

static function bool HasActiveArtifact(Pawn Instigator)
{
    return class'ActiveArtifactInv'.static.hasActiveArtifact(Instigator);
}

defaultproperties
{
     AbilityName="Energy Leech"
     Description="Whenever you damage another player, you gain 1% of the damage as adrenaline. Each level increases this by 1%. (Max Level: 5) You must be an Adrenaline Master to purchase this skill.|Cost (per level): 2,8,14,20,26"
     StartingCost=2
     CostAddPerLevel=6
     MaxLevel=5
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sun 15/10/2006 18:09:26.000 - Creation time: Wed 7/2/2007 19:16:37.656 - Created with UnCodeX