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

UT2004RPG.AbilityUltima


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

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

    if (Data.Attack < 250)
        return 0;
    for (x = 0; x < Data.Abilities.length; x++)
        if (Data.Abilities[x] == class'AbilityGhost')
            return 0;

    return Super.Cost(Data, CurrentLevel);
}

static function bool PreventDeath(Pawn Killed, Controller Killer, class<DamageType> DamageType, vector HitLocation, int AbilityLevel, bool bAlreadyPrevented)
{
    if (!bAlreadyPrevented && Killed.Location.Z > Killed.Region.Zone.KillZ && Killed.FindInventoryType(class'KillMarker') != None)
        Killed.spawn(class'UltimaCharger', Killed.Controller).ChargeTime = 4.0 / AbilityLevel;

    return false;
}

static function ScoreKill(Controller Killer, Controller Killed, bool bOwnedByKiller, int AbilityLevel)
{
    //ugh...I wish there was a faster way...
    if ( bOwnedByKiller && Killer.Pawn != None
         && (Killed.Pawn == None || Killed.Pawn.HitDamageType != class'DamTypeUltima')
         && Killer.Pawn.FindInventoryType(class'KillMarker') == None )
        Killer.Pawn.spawn(class'KillMarker', Killer.Pawn).GiveTo(Killer.Pawn);
}

defaultproperties
{
    AbilityName="Ultima"
    Description="This ability causes your body to release energy when you die. The energy will collect at a single point which will then cause a Redeemer-like nuclear explosion. Level 2 of this ability causes the energy to collect for the explosion in half the time. The ability will only trigger if you have killed at least one enemy during your life. You need to have a Damage Bonus stat of at least 250 to purchase this ability. You can't have both Ultima and Ghost at the same time. (Max Level: 2)"
    StartingCost=25
    CostAddPerLevel=0
    MaxLevel=2
}


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