public virtual float Score(IAIContext context, BasePlayer option) { PlayerTargetContext playerTargetContext = context as PlayerTargetContext; if (playerTargetContext != null && PlayerDetectionChance.Evaluate(playerTargetContext.Self, playerTargetContext.Dot[playerTargetContext.CurrentOptionsIndex], option)) { return(this.score); } return(0.0f); }
public static bool Evaluate(IAIAgent self, float dot, BasePlayer option) { NPCPlayerApex nPCPlayerApex = self as NPCPlayerApex; if (nPCPlayerApex == null) { return(true); } if (Time.time > nPCPlayerApex.NextDetectionCheck) { nPCPlayerApex.NextDetectionCheck = Time.time + 2f; bool flag = UnityEngine.Random.@value < PlayerDetectionChance.FovDetection(dot, option); bool flag1 = UnityEngine.Random.@value < PlayerDetectionChance.NoiseLevel(option); bool flag2 = UnityEngine.Random.@value < PlayerDetectionChance.LightDetection(option); nPCPlayerApex.LastDetectionCheckResult = flag | flag1 | flag2; } return(nPCPlayerApex.LastDetectionCheckResult); }
public static bool Evaluate(IAIAgent self, float dot, BasePlayer option) { NPCPlayerApex npcPlayerApex = self as NPCPlayerApex; if (!Object.op_Inequality((Object)npcPlayerApex, (Object)null)) { return(true); } if ((double)Time.get_time() > (double)npcPlayerApex.NextDetectionCheck) { npcPlayerApex.NextDetectionCheck = Time.get_time() + 2f; bool flag1 = (double)Random.get_value() < (double)PlayerDetectionChance.FovDetection(dot, option); bool flag2 = (double)Random.get_value() < (double)PlayerDetectionChance.NoiseLevel(option); bool flag3 = (double)Random.get_value() < (double)PlayerDetectionChance.LightDetection(option); npcPlayerApex.LastDetectionCheckResult = flag1 | flag2 | flag3; } return(npcPlayerApex.LastDetectionCheckResult); }