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

UT2004RPG.VampireMarker


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
/* this actor item is associated with players that have the Vampire ability. After the ability has healed them,
 * this actor is notified and in Tick() handles capping the player's health to the max amount allowed.
 * the cap is done this way so that other abilities (such as Retaliation) that drain health from the attacker
 * will be properly countered by Vampire even if the health gain/loss crosses the cap boundary.
 * without this, Vampire would act first, the health would be capped, then Retaliation would take some away
 * regardless of whether Vampire actually had any effect
 */
class VampireMarker extends Actor;

var Controller PlayerOwner;
var int HealthRestored; // health restored by vampire activation(s) this tick

function Tick(float DeltaTime)
{
    if (PlayerOwner == None)
    {
        Destroy();
    }
    else if (HealthRestored > 0)
    {
        if (PlayerOwner.Pawn != None && PlayerOwner.Pawn.Health > PlayerOwner.Pawn.HealthMax + 50)
        {
            PlayerOwner.Pawn.Health -= Min(PlayerOwner.Pawn.Health - PlayerOwner.Pawn.HealthMax - 50, HealthRestored);
        }
        HealthRestored = 0;
    }
}

defaultproperties
{
    bHidden=true
    RemoteRole=ROLE_None
}

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