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

UT2004RPG.AbilityAmmoRegen


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

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

static simulated function ModifyPawn(Pawn Other, int AbilityLevel)
{
    local AmmoRegenInv R;
    local Inventory Inv;

    if (Other.Role != ROLE_Authority)
        return;

    //remove old one, if it exists
    //might happen if player levels up this ability while still alive
    Inv = Other.FindInventoryType(class'AmmoRegenInv');
    if (Inv != None)
        Inv.Destroy();

    R = Other.spawn(class'AmmoRegenInv', Other,,,rot(0,0,0));
    R.RegenAmount = AbilityLevel;
    R.GiveTo(Other);
}

defaultproperties
{
    AbilityName="Resupply"
    Description="Adds 1 ammo per level to each ammo type you own every 3 seconds. Does not give ammo to superweapons or the translocator. You must have a Max Ammo stat of at least 50 to purchase this ability. (Max Level: 4)"
    StartingCost=15
    CostAddPerLevel=5
    MaxLevel=4
}

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