3 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
28 public static float GetFireSeverity(
Hull hull) => MathHelper.Lerp(0, 1, MathUtils.InverseLerp(0, 500, hull.FireSources.Sum(fs => fs.Size.X)));
40 if (hull ==
null) {
return false; }
42 if (hull.
Submarine ==
null) {
return false; }
43 if (character.
Submarine ==
null) {
return false; }
46 foreach (var ballastFlora
in MapCreatures.Behavior.BallastFloraBehavior.EntityList)
48 if (ballastFlora.Parent?.Submarine != character.Submarine) {
continue; }
49 if (ballastFlora.Branches.Any(b => !b.Removed && b.Health > 0 && b.CurrentHull == hull))
IEnumerable< Hull > VisibleHulls
Returns hulls that are visible to the character, including the current hull. Note that this is not an...
override bool IsValidTarget(Hull hull)
override AIObjective ObjectiveConstructor(Hull target)
override void OnObjectiveCompleted(AIObjective objective, Hull target)
override IEnumerable< Hull > GetList()
List of all possible items of the specified type. Used for filtering the removed objectives.
override Identifier Identifier
override bool AllowInAnySub
AIObjectiveExtinguishFires(Character character, AIObjectiveManager objectiveManager, float priorityModifier=1)
override float GetTargetPriority()
Returns a priority value based on the current targets (e.g. high prio when there's lots of severe fir...
static float GetFireSeverity(Hull hull)
0-1 based on the horizontal size of all of the fires in the hull.
static bool IsValidTarget(Hull hull, Character character)
An objective that creates specific kinds of subobjectives for specific types of targets,...
BallastFloraBehavior BallastFlora
static readonly List< Hull > HullList
List< FireSource > FireSources
bool IsEntityFoundOnThisSub(MapEntity entity, bool includingConnectedSubs, bool allowDifferentTeam=false, bool allowDifferentType=false)