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

DruidsRPGcvs.DruidAwareness


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
00072
00073
00074
00075
00076
00077
00078
00079
00080
class DruidAwareness extends AbilityAwareness;

static simulated function int Cost(RPGPLayerDataObject Data, int CurrentLevel)
{
    local bool ok;
    local int x;

    for (x = 0; x < Data.Abilities.length && !ok; x++)
    {
        if (Data.Abilities[x] == class'ClassAdrenalineMaster')
            ok = true;
        if (Data.Abilities[x] == class'ClassWeaponsMaster')
            ok = true;
    }
    if (!ok && 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;
    }
    return Super.Cost(Data, CurrentLevel);
}

static simulated function ModifyPawn(Pawn Other, int AbilityLevel)
{
    local PlayerController PC;
    local int x;
    local DruidAwarenessInteraction Interaction;

    if (Other.Level.NetMode == NM_DedicatedServer)
        return;

    PC = PlayerController(Other.Controller);
    if (PC == None)
        return;

    for (x = 0; x < PC.Player.LocalInteractions.length; x++)
        if (DruidAwarenessInteraction(PC.Player.LocalInteractions[x]) != None)
        {
            Interaction = DruidAwarenessInteraction(PC.Player.LocalInteractions[x]);
            break;
        }
    if (Interaction == None)
        AddInteraction(PC,AbilityLevel);
    else
        if(Interaction.AbilityLevel != AbilityLevel)
        {
            Interaction.NotifyLevelChange();
            AddInteraction(PC,AbilityLevel);
        }
}

static simulated function AddInteraction(PlayerController PC,int AbilityLevel) //modified from MonsterPointsInv.uc
{
    local Player Player;
    local DruidAwarenessInteraction Interaction;

    Interaction = new class'DruidAwarenessInteraction';

    Player = PC.Player;
    if (Interaction != None)
    {
        Player.LocalInteractions.Length = Player.LocalInteractions.Length + 1;
        Player.LocalInteractions[Player.LocalInteractions.Length-1] = Interaction;
        Interaction.ViewportOwner = Player;

        // Initialize the Interaction
        Interaction.Initialize();
        Interaction.Master = Player.InteractionMaster;
        Interaction.AbilityLevel = AbilityLevel;
    }
    else
        Log("Could not create DruidAwarenessInteraction");

} // AddInteraction

defaultproperties
{
    Description="Informs you of your enemies' health with a display over their heads. At level 1 you get a small, dully-colored indicator (green, yellow, or red). At level 2 you get a larger colored health bar and a shield bar. You must be an Adrenaline Master or Weapons Master, and have at least 5 points in every stat to purchase this ability. (Max Level: 2)|Cost (per level): 20,25"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fri 3/11/2006 21:07:12.000 - Creation time: Wed 7/2/2007 19:16:37.593 - Created with UnCodeX