コード例 #1
0
 private bool IsAllowedToWait()
 {
     if (CurrentOrder != null)
     {
         return(false);
     }
     if (CurrentObjective is AIObjectiveCombat || CurrentObjective is AIObjectiveFindSafety)
     {
         return(false);
     }
     if (character.AnimController.InWater)
     {
         return(false);
     }
     if (character.IsClimbing)
     {
         return(false);
     }
     if (character.AIController is HumanAIController humanAI)
     {
         if (humanAI.UnsafeHulls.Contains(character.CurrentHull))
         {
             return(false);
         }
     }
     if (AIObjectiveIdle.IsForbidden(character.CurrentHull))
     {
         return(false);
     }
     return(true);
 }
コード例 #2
0
        protected override void Act(float deltaTime)
        {
            updateGapListTimer -= deltaTime;

            if (updateGapListTimer <= 0.0f)
            {
                UpdateGapList();

                updateGapListTimer = UpdateGapListInterval;
            }

            if (objectiveList.Any())
            {
                objectiveList[objectiveList.Count - 1].TryComplete(deltaTime);

                if (!objectiveList[objectiveList.Count - 1].CanBeCompleted ||
                    objectiveList[objectiveList.Count - 1].IsCompleted())
                {
                    objectiveList.RemoveAt(objectiveList.Count - 1);
                }
            }
            else
            {
                if (idleObjective == null)
                {
                    idleObjective = new AIObjectiveIdle(character);
                }
                idleObjective.TryComplete(deltaTime);
            }
        }
コード例 #3
0
        protected override void Act(float deltaTime)
        {
            if (Timing.TotalTime > lastGapUpdate + UpdateGapListInterval || objectiveList == null)
            {
                UpdateGapList();
                lastGapUpdate = Timing.TotalTime;
            }

            if (objectiveList.Any())
            {
                if (!objectiveList[objectiveList.Count - 1].Leak.IsRoomToRoom)
                {
                    if (findDivingGear == null)
                    {
                        findDivingGear = new AIObjectiveFindDivingGear(character, true);
                    }

                    if (!findDivingGear.IsCompleted() && findDivingGear.CanBeCompleted)
                    {
                        findDivingGear.TryComplete(deltaTime);
                        return;
                    }
                }

                objectiveList[objectiveList.Count - 1].TryComplete(deltaTime);

                if (!objectiveList[objectiveList.Count - 1].CanBeCompleted ||
                    objectiveList[objectiveList.Count - 1].IsCompleted())
                {
                    objectiveList.RemoveAt(objectiveList.Count - 1);
                }
            }
            else
            {
                if (idleObjective == null)
                {
                    idleObjective = new AIObjectiveIdle(character);
                }
                idleObjective.TryComplete(deltaTime);
            }
        }