1 using Microsoft.Xna.Framework;
3 using System.Collections.Generic;
14 private Hull PrioritizedHull {
get;
set; }
18 PrioritizedHull = prioritizedHull;
25 if (leak ==
null) {
return 0; }
26 float sizeFactor = MathHelper.Lerp(1, 10, MathUtils.InverseLerp(0, 200, leak.
Size));
27 float severity = sizeFactor * leak.
Open;
32 return MathHelper.Clamp(severity, 10, 100);
36 return MathHelper.Min(severity, 100);
43 if (totalLeaks == 0) {
return 0; }
45 bool anyFixers = otherFixers > 0;
46 if (objectiveManager.IsOrder(
this))
48 float ratio = anyFixers ? totalLeaks / (float)otherFixers : 1;
53 int secondaryLeaks =
Targets.Count(l => l.IsRoomToRoom);
54 int leaks = totalLeaks - secondaryLeaks;
55 float ratio = leaks == 0 ? 1 : anyFixers ? leaks / (float)otherFixers : 1;
67 =>
new AIObjectiveFixLeak(gap, character, objectiveManager, priorityModifier: PriorityModifier, isPriority: gap.FlowTargetHull == PrioritizedHull);
74 if (gap ==
null) {
return false; }
static float GetLeakSeverity(Gap leak)
override AIObjective ObjectiveConstructor(Gap gap)
override void OnObjectiveCompleted(AIObjective objective, Gap target)
static bool IsValidTarget(Gap gap, Character character)
override bool KeepDivingGearOn
AIObjectiveFixLeaks(Character character, AIObjectiveManager objectiveManager, float priorityModifier=1, Hull prioritizedHull=null)
override Identifier Identifier
override bool AllowInFriendlySubs
override bool IsValidTarget(Gap gap)
override IEnumerable< Gap > GetList()
List of all possible items of the specified type. Used for filtering the removed objectives.
override float GetTargetPriority()
Returns a priority value based on the current targets (e.g. high prio when there's lots of severe fir...
An objective that creates specific kinds of subobjectives for specific types of targets,...
static List< Gap > GapList
static int CountBotsInTheCrew(Character character, Func< HumanAIController, bool > predicate=null)
AIObjectiveManager ObjectiveManager
readonly List< MapEntity > linkedTo
bool IsEntityFoundOnThisSub(MapEntity entity, bool includingConnectedSubs, bool allowDifferentTeam=false, bool allowDifferentType=false)