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

UT2004RPG.AbilityAdrenalineSurge


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

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

static function ScoreKill(Controller Killer, Controller Killed, bool bOwnedByKiller, int AbilityLevel)
{
    if (!bOwnedByKiller)
        return;

    if (Killed.Level.Game.IsA('Invasion') && Killed.Pawn != None && Killed.Pawn.IsA('Monster'))
    {
        Killer.AwardAdrenaline(float(Killed.Pawn.GetPropertyText("ScoringValue")) * 0.5 * AbilityLevel);
        return;
    }

    if ( !(!Killed.Level.Game.bTeamGame || ((Killer != None) && (Killer != Killed) && (Killed != None)
        && (Killer.PlayerReplicationInfo != None) && (Killed.PlayerReplicationInfo != None)
        && (Killer.PlayerReplicationInfo.Team != Killed.PlayerReplicationInfo.Team))) )
        return; //no bonus for team kills or suicides

    if (UnrealPlayer(Killer) != None && UnrealPlayer(Killer).MultiKillLevel > 0)
        Killer.AwardAdrenaline(Deathmatch(Killer.Level.Game).ADR_MajorKill * 0.5 * AbilityLevel);

    if (UnrealPawn(Killed.Pawn) != None && UnrealPawn(Killed.Pawn).spree > 4)
        Killer.AwardAdrenaline(Deathmatch(Killer.Level.Game).ADR_MajorKill * 0.5 * AbilityLevel);

    if ( Killer.PlayerReplicationInfo.Kills == 1 && TeamPlayerReplicationInfo(Killer.PlayerReplicationInfo) != None
         && TeamPlayerReplicationInfo(Killer.PlayerReplicationInfo).bFirstBlood )
        Killer.AwardAdrenaline(Deathmatch(Killer.Level.Game).ADR_MajorKill * 0.5 * AbilityLevel);

    if (Killer.bIsPlayer && Killed.bIsPlayer)
        Killer.AwardAdrenaline(Deathmatch(Killer.Level.Game).ADR_Kill * 0.5 * AbilityLevel);
}

defaultproperties
{
    AbilityName="Adrenal Surge"
    Description="For each level of this ability, you gain 50% more adrenaline from all kill related adrenaline bonuses. You must have a Damage Bonus of at least 50 and an Adrenaline Max stat at least 150 to purchase this ability. (Max Level: 2)"
    StartingCost=20
    CostAddPerLevel=5
    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:31.937 - Created with UnCodeX