Barotrauma Client Doc
|
Public Member Functions | |
void | InitMentalStateManager () |
void | InitShipCommandManager () |
HumanAIController (Character c) | |
override void | Update (float deltaTime) |
bool | FindSuitableContainer (Item containableItem, out Item suitableContainer) |
override void | OnHealed (Character healer, float healAmount) |
override void | OnAttacked (Character attacker, AttackResult attackResult) |
void | AddCombatObjective (AIObjectiveCombat.CombatMode mode, Character target, float delay=0, Func< AIObjective, bool > abortCondition=null, Action onAbort=null, Action onCompleted=null, bool allowHoldFire=false) |
void | SetOrder (Order order, bool speak=true) |
void | SetForcedOrder (Order order) |
void | ClearForcedOrder () |
override void | SelectTarget (AITarget target) |
override void | Reset () |
override bool | Escape (float deltaTime) |
bool | AllowCampaignInteraction () |
bool | NeedsDivingGear (Hull hull, out bool needsSuit) |
void | AskToRecalculateHullSafety (Hull hull) |
float | GetHullSafety (Hull hull, Character character, IEnumerable< Hull > visibleHulls=null) |
bool | IsInHostileFaction () |
bool | IsTrueForAnyCrewMember (Func< Character, bool > predicate, bool onlyActive=true, bool onlyConnectedSubs=false) |
Including the player characters in the same team. More... | |
bool | IsItemOperatedByAnother (ItemComponent target, out Character other) |
bool | IsItemRepairedByAnother (Item target, out Character other) |
bool | IsFriendly (Character other, bool onlySameTeam=false) |
bool | IsTrueForAnyBotInTheCrew (Func< HumanAIController, bool > predicate) |
bool | IsTrueForAllBotsInTheCrew (Func< HumanAIController, bool > predicate) |
int | CountBotsInTheCrew (Func< HumanAIController, bool > predicate=null) |
override void | DebugDraw (Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch) |
Public Member Functions inherited from Barotrauma.AIController | |
bool | HasValidPath (bool requireNonDirty=true, bool requireUnfinished=true, Func< WayPoint, bool > nodePredicate=null) |
Is the current path valid, using the provided parameters. More... | |
AIController (Character c) | |
void | FaceTarget (ISpatialEntity target) |
virtual bool | SteerThroughGap (Structure wall, WallSection section, Vector2 targetWorldPos, float deltaTime) |
virtual bool | SteerThroughGap (Gap gap, Vector2 targetWorldPos, float deltaTime, float maxDistance=-1) |
bool | CanPassThroughHole (Structure wall, int sectionIndex, int requiredHoleCount) |
bool | TakeItem (Item item, CharacterInventory targetInventory, bool equip, bool wear=false, bool dropOtherIfCannotMove=true, bool allowSwapping=false, bool storeUnequipped=false, IEnumerable< Identifier > targetTags=null) |
void | UnequipEmptyItems (Item parentItem, bool avoidDroppingInSea=true) |
void | UnequipContainedItems (Item parentItem, Func< Item, bool > predicate=null, bool avoidDroppingInSea=true, int? unequipMax=null) |
void | ReequipUnequipped () |
void | ResetEscape () |
virtual void | DebugDraw (SpriteBatch spriteBatch) |
Static Public Member Functions | |
static bool | FindSuitableContainer (Character character, Item containableItem, List< Item > ignoredItems, ref int itemIndex, out Item suitableContainer) |
static bool | IsBallastFloraNoticeable (Character character, Hull hull) |
static void | ReportProblem (Character reporter, Order order, Hull targetHull=null) |
static bool | HasDivingGear (Character character, float conditionPercentage=0, bool requireOxygenTank=true) |
static bool | HasDivingSuit (Character character, float conditionPercentage=0, bool requireOxygenTank=true) |
Check whether the character has a diving suit in usable condition plus some oxygen. More... | |
static bool | HasDivingMask (Character character, float conditionPercentage=0, bool requireOxygenTank=true) |
Check whether the character has a diving mask in usable condition plus some oxygen. More... | |
static bool | HasItem (Character character, Identifier tagOrIdentifier, out IEnumerable< Item > items, Identifier containedTag=default, float conditionPercentage=0, bool requireEquipped=false, bool recursive=true, Func< Item, bool > predicate=null) |
Note: uses a single list for matching items. The item is reused each time when the method is called. So if you use the method twice, and then refer to the first items, you'll actually get the second. To solve this, create a copy of the collection or change the code so that you first handle the first items and only after that query for the next items. More... | |
static void | StructureDamaged (Structure structure, float damageAmount, Character character) |
static void | ItemTaken (Item item, Character thief) |
static void | ApplyStealingReputationLoss (Item item) |
static void | PropagateHullSafety (Character character, Hull hull) |
Updates the hull safety for all ai characters in the team. The idea is that the crew communicates (magically) via radio about the threats. The safety levels need to be calculated for each bot individually, because the formula takes into account things like current orders. There's now a cached value per each hull, which should prevent too frequent calculations. More... | |
static void | RefreshTargets (Character character, Order order, Hull hull) |
static void | RemoveTargets< T1, T2 > (Character caller, T2 target) |
static float | GetHullSafety (Hull hull, IEnumerable< Hull > visibleHulls, Character character, bool ignoreWater=false, bool ignoreOxygen=false, bool ignoreFire=false, bool ignoreEnemies=false) |
static bool | IsFriendly (Character me, Character other, bool onlySameTeam=false) |
static bool | IsActive (Character c) |
static bool | IsTrueForAllBotsInTheCrew (Character character, Func< HumanAIController, bool > predicate) |
static bool | IsTrueForAnyBotInTheCrew (Character character, Func< HumanAIController, bool > predicate) |
static int | CountBotsInTheCrew (Character character, Func< HumanAIController, bool > predicate=null) |
static bool | IsItemTargetedBySomeone (ItemComponent target, CharacterTeamType team, out Character operatingCharacter) |
Static Public Member Functions inherited from Barotrauma.AIController | |
static void | UnequipEmptyItems (Character character, Item parentItem, bool avoidDroppingInSea=true) |
static void | UnequipContainedItems (Character character, Item parentItem, Func< Item, bool > predicate, bool avoidDroppingInSea=true, int? unequipMax=null) |
Public Attributes | |
bool | AutoFaceMovement = true |
Resets each frame More... | |
readonly HashSet< Hull > | UnreachableHulls = new HashSet<Hull>() |
readonly HashSet< Hull > | UnsafeHulls = new HashSet<Hull>() |
readonly List< Item > | IgnoredItems = new List<Item>() |
Public Attributes inherited from Barotrauma.AIController | |
bool | Enabled |
readonly Character | Character |
Static Public Attributes | |
static bool | DebugAI |
static bool | DisableCrewAI |
const float | HULL_SAFETY_THRESHOLD = 40 |
const float | HULL_LOW_OXYGEN_PERCENTAGE = 30 |
Protected Member Functions | |
void | ReportProblems () |
Protected Member Functions inherited from Barotrauma.AIController | |
void | ResetAITarget () |
bool | IsWallDisabled (Structure wall) |
bool | UpdateEscape (float deltaTime, bool canAttackDoors) |
virtual void | OnStateChanged (AIState from, AIState to) |
virtual void | OnTargetChanged (AITarget previousTarget, AITarget newTarget) |
Properties | |
float | SortTimer [get, set] |
float | ReportRange = float.PositiveInfinity [get, set] |
How far other characters can hear reports done by this character (e.g. reports for fires, intruders). Defaults to infinity. More... | |
float | AimSpeed [get, set] |
float | AimAccuracy [get, set] |
bool | UseOutsideWaypoints [get] |
Waypoints that are not linked to a sub (e.g. main path). More... | |
IndoorsSteeringManager | PathSteering [get] |
HumanoidAnimController | AnimController [get] |
AIObjectiveManager | ObjectiveManager [get] |
float | CurrentHullSafety = 100 [get] |
MentalStateManager | MentalStateManager [get] |
override bool | IsMentallyUnstable [get] |
ShipCommandManager | ShipCommandManager [get] |
Properties inherited from Barotrauma.AIController | |
AITarget | SelectedAiTarget [get, protected set] |
SteeringManager | SteeringManager [get] |
Vector2 | Steering [get, set] |
Vector2 | SimPosition [get] |
Vector2 | WorldPosition [get] |
Vector2 | Velocity [get] |
virtual bool | CanEnterSubmarine [get] |
virtual bool | CanFlip [get] |
virtual bool | IsMentallyUnstable [get] |
IEnumerable< Hull > | VisibleHulls [get] |
Returns hulls that are visible to the character, including the current hull. Note that this is not an accurate visibility check, it only checks for open gaps between the adjacent and linked hulls. More... | |
bool | IsCurrentPathNullOrUnreachable [get] |
bool | IsCurrentPathUnreachable [get] |
bool | IsCurrentPathFinished [get] |
bool | IsSteeringThroughGap [get, protected set] |
bool | IsTryingToSteerThroughGap [get, protected set] |
Gap | EscapeTarget [get] |
Properties inherited from Barotrauma.ISteerable | |
Vector2 | Steering [get, set] |
Vector2 | Velocity [get] |
Vector2 | SimPosition [get] |
Vector2 | WorldPosition [get] |
Additional Inherited Members | |
Protected Attributes inherited from Barotrauma.AIController | |
AITarget | _lastAiTarget |
AITarget | _previousAiTarget |
AITarget | _selectedAiTarget |
SteeringManager | steeringManager |
readonly float | colliderWidth |
readonly float | minGapSize |
readonly float | colliderLength |
readonly float | avoidLookAheadDistance |
bool | allGapsSearched |
readonly HashSet< Gap > | unreachableGaps = new HashSet<Gap>() |
Definition at line 11 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
Barotrauma.HumanAIController.HumanAIController | ( | Character | c | ) |
Definition at line 168 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
void Barotrauma.HumanAIController.AddCombatObjective | ( | AIObjectiveCombat.CombatMode | mode, |
Character | target, | ||
float | delay = 0 , |
||
Func< AIObjective, bool > | abortCondition = null , |
||
Action | onAbort = null , |
||
Action | onCompleted = null , |
||
bool | allowHoldFire = false |
||
) |
Definition at line 1535 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
bool Barotrauma.HumanAIController.AllowCampaignInteraction | ( | ) |
Definition at line 1645 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 1915 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
void Barotrauma.HumanAIController.AskToRecalculateHullSafety | ( | Hull | hull | ) |
void Barotrauma.HumanAIController.ClearForcedOrder | ( | ) |
Definition at line 1594 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 2287 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
int Barotrauma.HumanAIController.CountBotsInTheCrew | ( | Func< HumanAIController, bool > | predicate = null | ) |
override void Barotrauma.HumanAIController.DebugDraw | ( | Microsoft.Xna.Framework.Graphics.SpriteBatch | spriteBatch | ) |
Definition at line 10 of file BarotraumaClient/ClientSource/Characters/AI/HumanAIController.cs.
|
virtual |
Implements Barotrauma.AIController.
|
static |
Definition at line 903 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
bool Barotrauma.HumanAIController.FindSuitableContainer | ( | Item | containableItem, |
out Item | suitableContainer | ||
) |
float Barotrauma.HumanAIController.GetHullSafety | ( | Hull | hull, |
Character | character, | ||
IEnumerable< Hull > | visibleHulls = null |
||
) |
Definition at line 2151 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 2169 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
|
static |
Check whether the character has a diving mask in usable condition plus some oxygen.
|
static |
Check whether the character has a diving suit in usable condition plus some oxygen.
|
static |
Note: uses a single list for matching items. The item is reused each time when the method is called. So if you use the method twice, and then refer to the first items, you'll actually get the second. To solve this, create a copy of the collection or change the code so that you first handle the first items and only after that query for the next items.
Definition at line 1701 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
void Barotrauma.HumanAIController.InitMentalStateManager | ( | ) |
Definition at line 143 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
void Barotrauma.HumanAIController.InitShipCommandManager | ( | ) |
Definition at line 159 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
|
static |
Definition at line 1121 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 2198 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
bool Barotrauma.HumanAIController.IsFriendly | ( | Character | other, |
bool | onlySameTeam = false |
||
) |
bool Barotrauma.HumanAIController.IsInHostileFaction | ( | ) |
Definition at line 2234 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
bool Barotrauma.HumanAIController.IsItemOperatedByAnother | ( | ItemComponent | target, |
out Character | other | ||
) |
Definition at line 2397 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
Definition at line 2466 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 2361 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 2259 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
bool Barotrauma.HumanAIController.IsTrueForAllBotsInTheCrew | ( | Func< HumanAIController, bool > | predicate | ) |
|
static |
Definition at line 2273 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
bool Barotrauma.HumanAIController.IsTrueForAnyBotInTheCrew | ( | Func< HumanAIController, bool > | predicate | ) |
bool Barotrauma.HumanAIController.IsTrueForAnyCrewMember | ( | Func< Character, bool > | predicate, |
bool | onlyActive = true , |
||
bool | onlyConnectedSubs = false |
||
) |
Including the player characters in the same team.
Definition at line 2305 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
Definition at line 1829 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
bool Barotrauma.HumanAIController.NeedsDivingGear | ( | Hull | hull, |
out bool | needsSuit | ||
) |
Definition at line 1661 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
virtual |
Reimplemented from Barotrauma.AIController.
Definition at line 1190 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
virtual |
Reimplemented from Barotrauma.AIController.
Definition at line 1177 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Updates the hull safety for all ai characters in the team. The idea is that the crew communicates (magically) via radio about the threats. The safety levels need to be calculated for each bot individually, because the formula takes into account things like current orders. There's now a cached value per each hull, which should prevent too frequent calculations.
Definition at line 1935 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 1956 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
T1 | : | AIObjectiveLoop<T2> |
Definition at line 2029 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 1136 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
protected |
Definition at line 998 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
virtual |
Reimplemented from Barotrauma.AIController.
Definition at line 1604 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
virtual |
Reimplemented from Barotrauma.AIController.
Definition at line 1599 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
void Barotrauma.HumanAIController.SetForcedOrder | ( | Order | order | ) |
Definition at line 1588 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
void Barotrauma.HumanAIController.SetOrder | ( | Order | order, |
bool | speak = true |
||
) |
Definition at line 1583 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 1734 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
virtual |
Reimplemented from Barotrauma.AIController.
Definition at line 178 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
bool Barotrauma.HumanAIController.AutoFaceMovement = true |
Resets each frame
Definition at line 26 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 13 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 14 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 37 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
static |
Definition at line 36 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
Definition at line 43 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
Definition at line 41 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
Definition at line 42 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
getset |
Definition at line 84 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
getset |
Definition at line 77 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
get |
Definition at line 104 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
get |
Definition at line 108 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
get |
Definition at line 152 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
get |
Definition at line 141 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
get |
Definition at line 106 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
get |
Definition at line 103 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
getset |
How far other characters can hear reports done by this character (e.g. reports for fires, intruders). Defaults to infinity.
Definition at line 74 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
get |
Definition at line 157 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
getset |
Definition at line 18 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.
|
get |
Waypoints that are not linked to a sub (e.g. main path).
Definition at line 101 of file BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs.