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

DruidsRPGcvs.DruidVampire


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

var config int AdjustableStartingDamage;

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'ClassWeaponsMaster')
            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;
    }

    if (Data.Attack < default.AdjustableStartingDamage)
        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)
{
    if(Instigator.Weapon != None && Instigator.Weapon.isA('RW_Rage'))
        return; //no vamp for rage weapons
    LocalHandleDamage(Damage, Injured, Instigator, Momentum, DamageType, bOwnedByInstigator, float(AbilityLevel));
}

static function LocalHandleDamage(int Damage, Pawn Injured, Pawn Instigator, out vector Momentum, class<DamageType> DamageType, bool bOwnedByInstigator, Float AbilityLevel)
{
    local int Health;
    local Pawn P;

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

    if (Vehicle(Instigator) == None)
    {
        P = Instigator;
    }
    else
    {
        P = Vehicle(Instigator).Driver;
        if (P == None)
        {
            return;
        }
    }

    Health = int(float(Damage) * 0.05 * AbilityLevel);
    if (Health == 0 && Damage > 0)
    {
        Health = 1;
    }

    P.GiveHealth(Health, P.HealthMax + default.AdjustableStartingDamage);
}

defaultproperties
{
     AdjustableStartingDamage = 50
     Description = "Whenever you damage an opponent, you are healed for 5% of the damage per level (up to your starting health amount + 50). You can't gain health from self-damage and you can't gain health from damage caused by the Retaliation ability. You must have a Damage Bonus of at least 50 to purchase this ability. (Max Level: 10) You must be a Weapons Master to purchase this skill.|Cost (per level): 10,15,20,25,30,35,40,45,50"
}


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.921 - Created with UnCodeX