Esempio n. 1
0
 private bool CanSetEnemy(Being being)
 {
     if (being.GetPlayerComponent <ReplicatedPlayerParams>().m_IsInSafeZone)
     {
         return(false);
     }
     if (being.GetPlayerComponent <ReplicatedPlayerParams>().m_IsDead)
     {
         return(false);
     }
     if (this.m_AI.IsHuman())
     {
         HumanAI humanAI = (HumanAI)this.m_AI;
         if ((humanAI.GetState() == HumanAI.State.Attack || humanAI.GetState() == HumanAI.State.StartWave) && this.m_AI.m_EnemyModule.m_Enemy == being)
         {
             return(true);
         }
     }
     if (this.m_AI.m_BleedingDamage > 0f)
     {
         return(true);
     }
     if (this.m_AI.m_SightModule && this.m_AI.m_SightModule.m_VisiblePlayers.Contains(being))
     {
         return(true);
     }
     if (this.m_AI.m_HearingModule && this.m_AI.m_HearingModule.m_Noise != null)
     {
         return(true);
     }
     if (this.m_AI.m_EnemySenseModule && this.m_AI.m_EnemySenseModule.m_Enemies.Contains(being))
     {
         return(true);
     }
     if (this.m_Enemy)
     {
         this.m_SafeDuration += Time.deltaTime;
         float safeDuration     = this.m_SafeDuration;
         float timeToLooseEnemy = this.m_TimeToLooseEnemy;
         return(false);
     }
     return(false);
 }