Beispiel #1
0
        protected override float TargetEvaluation()
        {
            int totalLeaks = Targets.Count();

            if (totalLeaks == 0)
            {
                return(0);
            }
            int  otherFixers = HumanAIController.CountCrew(c => c != HumanAIController && c.ObjectiveManager.IsCurrentObjective <AIObjectiveFixLeaks>() && !c.Character.IsIncapacitated, onlyBots: true);
            bool anyFixers   = otherFixers > 0;

            if (objectiveManager.IsOrder(this))
            {
                float ratio = anyFixers ? totalLeaks / (float)otherFixers : 1;
                return(Targets.Sum(t => GetLeakSeverity(t)) * ratio);
            }
            else
            {
                int   secondaryLeaks = Targets.Count(l => l.IsRoomToRoom);
                int   leaks          = totalLeaks - secondaryLeaks;
                float ratio          = leaks == 0 ? 1 : anyFixers ? leaks / otherFixers : 1;
                if (anyFixers && (ratio <= 1 || otherFixers > 5 || otherFixers / (float)HumanAIController.CountCrew(onlyBots: true) > 0.75f))
                {
                    // Enough fixers
                    return(0);
                }
                return(Targets.Sum(t => GetLeakSeverity(t)) * ratio);
            }
        }
        protected override float TargetEvaluation()
        {
            if (!character.IsOnPlayerTeam)
            {
                return(Targets.None() ? 0 : 100);
            }
            int totalEnemies = Targets.Count();

            if (totalEnemies == 0)
            {
                return(0);
            }
            if (character.IsSecurity)
            {
                return(100);
            }
            if (objectiveManager.IsOrder(this))
            {
                return(100);
            }
            return(HumanAIController.IsTrueForAnyCrewMember(c => c.Character.IsSecurity && !c.Character.IsIncapacitated && c.Character.Submarine == character.Submarine) ? 0 : 100);
        }
Beispiel #3
0
 public override string ToString()
 {
     return
         (string.Format(
              "Test [{0}];Stubs [{1}];Variables [{2}];Mocks [{3}];Targets [{4}];TargetCalls [{5}];Asserts [{6}];Labels [{7}];",
              UnitTest.NameIdentifier, Stubs.Count(), Variables.Count(), Mocks.Count(), Targets.Count(), TargetCalls.Count(), Asserts.Count(), Labels.Count()));
 }