protected virtual bool EvaluatePlayer(BaseNpcContext context, IHTNAgent npc, ref NpcPlayerInfo player, float time) { if (player.Player.Family == npc.Family) { return(false); } List <NpcPlayerInfo> playersInRange = npc.AiDomain.NpcContext.PlayersInRange; bool flag = false; int num = 0; while (num < playersInRange.Count) { if (playersInRange[num].Player != player.Player) { num++; } else { flag = true; break; } } if (!flag) { playersInRange.Add(player); } return(true); }
protected virtual bool EvaluatePlayer( BaseNpcContext context, IHTNAgent npc, ref NpcPlayerInfo player, float time) { if (player.Player.Family == npc.Family) { return(false); } List <NpcPlayerInfo> playersInRange = npc.AiDomain.NpcContext.PlayersInRange; bool flag = false; for (int index = 0; index < playersInRange.Count; ++index) { if (Object.op_Equality((Object)playersInRange[index].Player, (Object)player.Player)) { flag = true; break; } } if (!flag) { playersInRange.Add(player); } return(true); }
protected virtual bool EvaluatePlayer(BaseNpcContext context, IHTNAgent npc, NpcPlayerInfo player, float time) { if (player.Player.Family == npc.Family) { return(false); } context.EnemyPlayersInRange.Add(player); return(true); }
public void Tick(IHTNAgent npc, float deltaTime, float time) { if (ConVar.AI.ignoreplayers) { return; } BaseNpcContext npcContext = npc.AiDomain.NpcContext; for (int i = 0; i < npcContext.PlayersOutsideDetectionRange.Count; i++) { NpcPlayerInfo item = npcContext.PlayersOutsideDetectionRange[i]; if (!npcContext.BaseMemory.ShouldRemoveOnPlayerForgetTimeout(time, item)) { this.EvaluatePlayer(npcContext, npc, ref item, time); } else { npcContext.PlayersOutsideDetectionRange.RemoveAt(i); i--; } } }
public void Tick(IHTNAgent npc, float deltaTime, float time) { if (AI.ignoreplayers) { return; } BaseNpcContext npcContext = npc.AiDomain.NpcContext; for (int index = 0; index < npcContext.PlayersOutsideDetectionRange.Count; ++index) { NpcPlayerInfo player = npcContext.PlayersOutsideDetectionRange[index]; if (npcContext.BaseMemory.ShouldRemoveOnPlayerForgetTimeout(time, player)) { npcContext.PlayersOutsideDetectionRange.RemoveAt(index); --index; } else { this.EvaluatePlayer(npcContext, npc, ref player, time); } } }
public void Tick(IHTNAgent npc, float deltaTime, float time) { if (ConVar.AI.ignoreplayers) { return; } BaseNpcContext npcContext = npc.AiDomain.NpcContext; npcContext.EnemyPlayersInRange.Clear(); for (int i = 0; i < npcContext.PlayersInRange.Count; i++) { NpcPlayerInfo item = npcContext.PlayersInRange[i]; if (!npcContext.BaseMemory.ShouldRemoveOnPlayerForgetTimeout(time, item)) { this.EvaluatePlayer(npcContext, npc, item, time); } else { npcContext.PlayersInRange.RemoveAt(i); i--; } } npcContext.EnemyPlayersInRange.Sort(EnemyPlayersInRangeSensor._comparer); }
public void Tick(IHTNAgent npc, float deltaTime, float time) { if (AI.ignoreplayers) { return; } BaseNpcContext npcContext = npc.AiDomain.NpcContext; npcContext.EnemyPlayersInRange.Clear(); for (int index = 0; index < npcContext.PlayersInRange.Count; ++index) { NpcPlayerInfo player = npcContext.PlayersInRange[index]; if (npcContext.BaseMemory.ShouldRemoveOnPlayerForgetTimeout(time, player)) { npcContext.PlayersInRange.RemoveAt(index); --index; } else { this.EvaluatePlayer(npcContext, npc, player, time); } } npcContext.EnemyPlayersInRange.Sort((IComparer <NpcPlayerInfo>)EnemyPlayersInRangeSensor._comparer); }