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

DruidsRPGcvs.DruidAwarenessEnemyList


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
00081
00082
00083
//This holds and maintains the list of the local player's enemy pawns for use in AwarenessInteraction
//A seperate actor is used to prevent invalid pointer problems since Actor references
//in non-Actors don't get set to None automatically when the Actor is destroyed
// We just made a few changes to Mysterial's ... but they were in the biggest function
class DruidAwarenessEnemyList extends Actor;

var array<Pawn> Enemies;
var PlayerController PlayerOwner;

simulated function PostBeginPlay()
{
    Super.PostBeginPlay();

    PlayerOwner = Level.GetLocalPlayerController();
    if (PlayerOwner != None)
        SetTimer(2, true);
    else
        Warn("DruidAwarenessEnemyList spawned with no local PlayerController!");
}

simulated function Timer()
{
    local Pawn P, PlayerDriver;
    local bool GoodMonster;
    local FriendlyMonsterEffect FME;

    Enemies.length = 0;

    if (PlayerOwner.Pawn == None || PlayerOwner.Pawn.Health <= 0)
        return;

    if (Vehicle(PlayerOwner.Pawn) != None)
        PlayerDriver = Vehicle(PlayerOwner.Pawn).Driver;

    foreach DynamicActors(class'Pawn', P)
    {
        if (P.IsA('Monster'))
        {
// Assume bad monster.
            GoodMonster = False;
            foreach DynamicActors(class'FriendlyMonsterEffect', FME)
            {
// Skip it, not the one we're looking for.
                if (P != FME.Base)
                    continue;
// The one we're looking for, and it's ours.
                else if (FME.MasterPRI == PlayerOwner.PlayerReplicationInfo)
                {
                    GoodMonster = True;
                    break;
                }
// The one we're looking for, not ours, but on our team.
                else if(FME.MasterPRI.Team != None && FME.MasterPRI.Team == PlayerOwner.PlayerReplicationInfo.Team)
                {
                    GoodMonster = True;
                    break;
                }
// Gotta be a bad guy.
                else
                {
                    break;
                }
            }
// If we haven't found it related to an FME, or the FME says it's not friendly ...
            if (!GoodMonster)
                Enemies[Enemies.length] = P;
        }
        else if ( P != PlayerOwner.Pawn && P != PlayerDriver
             && (P.GetTeamNum() == 255 || P.GetTeamNum() != PlayerOwner.GetTeamNum())
             && (Vehicle(P) == None || (Vehicle(P).bDriving && P.GetVehicleBase() == None)) )
            Enemies[Enemies.length] = P;
    }
}

defaultproperties
{
     bHidden=True
     RemoteRole=ROLE_None
     bGameRelevant=True
     bBlockZeroExtentTraces=False
     bBlockNonZeroExtentTraces=False
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Thu 2/11/2006 16:13:44.000 - Creation time: Wed 7/2/2007 19:16:37.609 - Created with UnCodeX