Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 |
//This holds and maintains the list of the local player's enemy pawns for use in MedicAwarenessInteraction //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 class MedicAwarenessEnemyList 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("MedicAwarenessEnemyList spawned with no local PlayerController!"); } simulated function Timer() { local Pawn P, PlayerDriver; 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; // Near as I can tell GetTeamNum() returns 255 if there aren't any teams. foreach DynamicActors(class'Pawn', P) { if ((P != PlayerOwner.Pawn && P.GetTeamNum() == PlayerOwner.GetTeamNum() && PlayerOwner.GetTeamNum() != 255) || P.Instigator == PlayerOwner.Pawn) Enemies[Enemies.length] = P; } foreach DynamicActors(class'FriendlyMonsterEffect',FME) { // First case: covers all friendly monsters in team games; or // Second case: covers our own monsters in DeathMatch if ((FME.MasterPRI.Team != None && FME.MasterPRI.Team == PlayerOwner.PlayerReplicationInfo.Team && PlayerOwner.GetTeamNum() != 255) || FME.MasterPRI == PlayerOwner.PlayerReplicationInfo) Enemies[Enemies.length] = Pawn(FME.Base); } } defaultproperties { bHidden=True RemoteRole=ROLE_None bGameRelevant=True bBlockZeroExtentTraces=False bBlockNonZeroExtentTraces=False } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |