Barotrauma Client Doc
|
Public Member Functions | |
IEnumerable< AIObjective > | GetSubObjectivesRecursive (bool includingSelf=false) |
AIObjective | GetActiveObjective () |
AIObjective (Character character, AIObjectiveManager objectiveManager, float priorityModifier, Identifier option=default) | |
void | TryComplete (float deltaTime) |
Makes the character act according to the objective, or according to any subobjectives that need to be completed before this one More... | |
void | AddSubObjective (AIObjective objective, bool addFirst=false) |
void | RemoveSubObjective< T > (ref T objective) |
void | SortSubObjectives () |
bool | IsIgnoredAtOutpost () |
Returns true only when at a friendly outpost and when the order is set to be ignored there. Note that even if this returns false, the objective can be disallowed, because AllowInFriendlySubs is false. More... | |
float | CalculatePriority () |
Call this only when the priority needs to be recalculated. Use the cached Priority property when you don't need to recalculate. More... | |
virtual bool | IsDuplicate< T > (T otherObjective) |
virtual void | Update (float deltaTime) |
virtual void | OnSelected () |
virtual void | OnDeselected () |
virtual void | Reset () |
virtual void | SpeakAfterOrderReceived () |
Sprite | GetSprite () |
Static Public Member Functions | |
static Sprite | GetSprite (Identifier identifier, Identifier option, Entity targetEntity) |
Public Attributes | |
readonly Character | character |
readonly AIObjectiveManager | objectiveManager |
readonly Identifier | Option |
Func< AIObjective, bool > | AbortCondition |
Aborts the objective when this condition is true. More... | |
Protected Member Functions | |
void | HandleNonAllowed () |
virtual float | GetPriority () |
void | SyncRemovedObjectives< T1, T2 > (Dictionary< T1, T2 > dictionary, IEnumerable< T1 > collection) |
Checks if the subobjectives in the given collection are removed from the subobjectives. And if so, removes it also from the dictionary. More... | |
bool | TryAddSubObjective< T > (ref T objective, Func< T > constructor, Action onCompleted=null, Action onAbandon=null) |
Checks if the objective already is created and added in subobjectives. If not, creates it. Handles objectives that cannot be completed. If the objective has been removed form the subobjectives, a null value is assigned to the reference. Returns true if the objective was created and successfully added. More... | |
virtual void | OnCompleted () |
virtual void | OnAbandon () |
abstract void | Act (float deltaTime) |
abstract bool | CheckObjectiveSpecific () |
bool | CanEquip (Item item, bool allowWearing) |
Static Protected Member Functions | |
static bool | CanEquip (Character character, Item item, bool allowWearing) |
Protected Attributes | |
readonly List< AIObjective > | subObjectives = new List<AIObjective>() |
Properties | |
virtual float | Devotion [get] |
abstract Identifier | Identifier [get, set] |
virtual string | DebugTag [get] |
virtual bool | ForceRun [get] |
virtual bool | IgnoreUnsafeHulls [get] |
virtual bool | AbandonWhenCannotCompleteSubjectives [get] |
virtual bool | AllowSubObjectiveSorting [get] |
virtual bool | PrioritizeIfSubObjectivesActive [get] |
virtual bool | AllowMultipleInstances [get] |
Can there be multiple objective instaces of the same type? More... | |
virtual bool | ConcurrentObjectives [get] |
Run the main objective with all subobjectives concurrently? If false, the main objective will continue only when all the subobjectives have been removed (done). More... | |
virtual bool | KeepDivingGearOn [get] |
virtual bool | KeepDivingGearOnAlsoWhenInactive [get] |
virtual bool | AllowAutomaticItemUnequipping [get] |
There's a separate property for diving suit and mask: KeepDivingGearOn. More... | |
virtual bool | AllowOutsideSubmarine [get] |
virtual bool | AllowInFriendlySubs [get] |
virtual bool | AllowInAnySub [get] |
virtual bool | AllowWhileHandcuffed [get] |
float | CumulatedDevotion [get, set] |
virtual float | MaxDevotion [get] |
float | Priority [get, set] |
Final priority value after all calculations. More... | |
float | BasePriority [get, set] |
float | PriorityModifier = 1 [get] |
bool | ForceHighestPriority [get, set] |
bool | ForceWalk [get, set] |
bool | IgnoreAtOutpost [get, set] |
bool | Abandon [get, set] |
virtual bool | CanBeCompleted [get] |
virtual bool | IsLoop [get, set] |
When true, the objective is never completed, unless CanBeCompleted returns false. More... | |
IEnumerable< AIObjective > | SubObjectives [get] |
AIObjective | CurrentSubObjective [get] |
HumanAIController | HumanAIController [get] |
IndoorsSteeringManager | PathSteering [get] |
SteeringManager | SteeringManager [get] |
bool | IsAllowed [get] |
bool | IsCompleted [get, protected set] |
static Color | ObjectiveIconColor [get] |
Events | |
Action | Completed |
A single shot event. Automatically cleared after launching. Use OnCompleted method for implementing (internal) persistent behavior. More... | |
Action | Abandoned |
A single shot event. Automatically cleared after launching. Use OnAbandoned method for implementing (internal) persistent behavior. More... | |
Action | Selected |
A single shot event. Automatically cleared after launching. Use OnSelected method for implementing (internal) persistent behavior. More... | |
Action | Deselected |
A single shot event. Automatically cleared after launching. Use OnDeselected method for implementing (internal) persistent behavior. More... | |
Definition at line 10 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
Barotrauma.AIObjective.AIObjective | ( | Character | character, |
AIObjectiveManager | objectiveManager, | ||
float | priorityModifier, | ||
Identifier | option = default |
||
) |
Definition at line 162 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
protectedpure virtual |
Implemented in Barotrauma.AIObjectiveReturn, Barotrauma.AIObjectiveRescue, Barotrauma.AIObjectiveRepairItem, Barotrauma.AIObjectivePrepare, Barotrauma.AIObjectiveOperateItem, Barotrauma.AIObjectiveLoop< T >, Barotrauma.AIObjectiveLoadItem, Barotrauma.AIObjectiveIdle, Barotrauma.AIObjectiveGoTo, Barotrauma.AIObjectiveGetItems, Barotrauma.AIObjectiveGetItem, Barotrauma.AIObjectiveFixLeak, Barotrauma.AIObjectiveFindSafety, Barotrauma.AIObjectiveFindDivingGear, Barotrauma.AIObjectiveExtinguishFire, Barotrauma.AIObjectiveEscapeHandcuffs, Barotrauma.AIObjectiveDecontainItem, Barotrauma.AIObjectiveContainItem, Barotrauma.AIObjectiveCombat, Barotrauma.AIObjectiveCleanupItem, and Barotrauma.AIObjectiveCheckStolenItems.
void Barotrauma.AIObjective.AddSubObjective | ( | AIObjective | objective, |
bool | addFirst = false |
||
) |
Definition at line 186 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
float Barotrauma.AIObjective.CalculatePriority | ( | ) |
Call this only when the priority needs to be recalculated. Use the cached Priority property when you don't need to recalculate.
Definition at line 289 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
staticprotected |
Definition at line 512 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
protected |
|
protectedpure virtual |
Implemented in Barotrauma.AIObjectiveReturn, Barotrauma.AIObjectiveRescue, Barotrauma.AIObjectiveRepairItem, Barotrauma.AIObjectivePrepare, Barotrauma.AIObjectiveOperateItem, Barotrauma.AIObjectiveLoop< T >, Barotrauma.AIObjectiveLoadItem, Barotrauma.AIObjectiveIdle, Barotrauma.AIObjectiveGoTo, Barotrauma.AIObjectiveGetItems, Barotrauma.AIObjectiveGetItem, Barotrauma.AIObjectiveFixLeak, Barotrauma.AIObjectiveFindSafety, Barotrauma.AIObjectiveFindDivingGear, Barotrauma.AIObjectiveExtinguishFire, Barotrauma.AIObjectiveEscapeHandcuffs, Barotrauma.AIObjectiveDecontainItem, Barotrauma.AIObjectiveContainItem, Barotrauma.AIObjectiveCombat, Barotrauma.AIObjectiveCleanupItem, and Barotrauma.AIObjectiveCheckStolenItems.
AIObjective Barotrauma.AIObjective.GetActiveObjective | ( | ) |
Definition at line 156 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
protectedvirtual |
Reimplemented in Barotrauma.AIObjectiveReturn, Barotrauma.AIObjectiveRescue, Barotrauma.AIObjectiveRepairItem, Barotrauma.AIObjectivePrepare, Barotrauma.AIObjectiveOperateItem, Barotrauma.AIObjectiveLoop< T >, Barotrauma.AIObjectiveLoadItem, Barotrauma.AIObjectiveIdle, Barotrauma.AIObjectiveGoTo, Barotrauma.AIObjectiveFixLeak, Barotrauma.AIObjectiveFindSafety, Barotrauma.AIObjectiveExtinguishFire, Barotrauma.AIObjectiveEscapeHandcuffs, Barotrauma.AIObjectiveCombat, Barotrauma.AIObjectiveCleanupItem, and Barotrauma.AIObjectiveCheckStolenItems.
Definition at line 268 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
Sprite Barotrauma.AIObjective.GetSprite | ( | ) |
Definition at line 31 of file BarotraumaClient/ClientSource/Characters/AI/Objectives/AIObjective.cs.
|
static |
Definition at line 9 of file BarotraumaClient/ClientSource/Characters/AI/Objectives/AIObjective.cs.
IEnumerable<AIObjective> Barotrauma.AIObjective.GetSubObjectivesRecursive | ( | bool | includingSelf = false | ) |
Definition at line 114 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
protected |
Definition at line 262 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
virtual |
Reimplemented in Barotrauma.AIObjectiveOperateItem.
T | : | AIObjective | |
T | : | otherObjective.Option | |
T | : | Option |
bool Barotrauma.AIObjective.IsIgnoredAtOutpost | ( | ) |
Returns true only when at a friendly outpost and when the order is set to be ignored there. Note that even if this returns false, the objective can be disallowed, because AllowInFriendlySubs is false.
Definition at line 253 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
protectedvirtual |
Reimplemented in Barotrauma.AIObjectiveReturn, Barotrauma.AIObjectiveRescue, Barotrauma.AIObjectiveGoTo, Barotrauma.AIObjectiveGetItem, Barotrauma.AIObjectiveExtinguishFire, Barotrauma.AIObjectiveDecontainItem, and Barotrauma.AIObjectiveCombat.
Definition at line 409 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
protectedvirtual |
Reimplemented in Barotrauma.AIObjectiveRescue, Barotrauma.AIObjectiveGoTo, Barotrauma.AIObjectiveExtinguishFire, and Barotrauma.AIObjectiveCombat.
Definition at line 403 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
virtual |
Reimplemented in Barotrauma.AIObjectiveRescue, and Barotrauma.AIObjectiveIdle.
Definition at line 396 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
virtual |
Definition at line 389 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
void Barotrauma.AIObjective.RemoveSubObjective< T > | ( | ref T | objective | ) |
T | : | AIObjective |
Definition at line 200 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
virtual |
Reimplemented in Barotrauma.AIObjectiveReturn, Barotrauma.AIObjectiveRescue, Barotrauma.AIObjectiveRepairItem, Barotrauma.AIObjectivePrepare, Barotrauma.AIObjectiveOperateItem, Barotrauma.AIObjectiveLoop< T >, Barotrauma.AIObjectiveLoadItem, Barotrauma.AIObjectiveIdle, Barotrauma.AIObjectiveGoTo, Barotrauma.AIObjectiveGetItems, Barotrauma.AIObjectiveGetItem, Barotrauma.AIObjectiveFixLeak, Barotrauma.AIObjectiveFindSafety, Barotrauma.AIObjectiveFindDivingGear, Barotrauma.AIObjectiveExtinguishFire, Barotrauma.AIObjectiveEscapeHandcuffs, Barotrauma.AIObjectiveDecontainItem, Barotrauma.AIObjectiveContainItem, Barotrauma.AIObjectiveCombat, and Barotrauma.AIObjectiveCleanupItem.
Definition at line 415 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
void Barotrauma.AIObjective.SortSubObjectives | ( | ) |
Definition at line 212 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
virtual |
Definition at line 510 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
protected |
Checks if the subobjectives in the given collection are removed from the subobjectives. And if so, removes it also from the dictionary.
T2 | : | AIObjective |
Definition at line 328 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
protected |
Checks if the objective already is created and added in subobjectives. If not, creates it. Handles objectives that cannot be completed. If the objective has been removed form the subobjectives, a null value is assigned to the reference. Returns true if the objective was created and successfully added.
T | : | AIObjective |
Definition at line 347 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
void Barotrauma.AIObjective.TryComplete | ( | float | deltaTime | ) |
Makes the character act according to the objective, or according to any subobjectives that need to be completed before this one
Definition at line 173 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
virtual |
Reimplemented in Barotrauma.AIObjectiveLoop< T >, Barotrauma.AIObjectiveIdle, Barotrauma.AIObjectiveFindSafety, Barotrauma.AIObjectiveEscapeHandcuffs, and Barotrauma.AIObjectiveCombat.
Definition at line 308 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
Func<AIObjective, bool> Barotrauma.AIObjective.AbortCondition |
Aborts the objective when this condition is true.
Definition at line 132 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
readonly Character Barotrauma.AIObjective.character |
Definition at line 86 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
readonly AIObjectiveManager Barotrauma.AIObjective.objectiveManager |
Definition at line 87 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
readonly Identifier Barotrauma.AIObjective.Option |
Definition at line 88 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
protected |
Definition at line 45 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getset |
Definition at line 91 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 18 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
There's a separate property for diving suit and mask: KeepDivingGearOn.
Definition at line 39 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 42 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 41 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Can there be multiple objective instaces of the same type?
Definition at line 25 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 40 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 19 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 43 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getset |
Definition at line 59 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 104 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Run the main objective with all subobjectives concurrently? If false, the main objective will continue only when all the subobjectives have been removed (done).
Definition at line 31 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getsetprotected |
Definition at line 47 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 111 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 15 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 12 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getset |
Definition at line 66 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 16 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getset |
Definition at line 82 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getprotected |
Definition at line 152 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getset |
Definition at line 14 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getset |
Definition at line 84 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 17 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 235 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getprotected set |
Definition at line 429 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getset |
When true, the objective is never completed, unless CanBeCompleted returns false.
Definition at line 109 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 33 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 34 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getprotected |
Definition at line 53 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
staticget |
Definition at line 7 of file BarotraumaClient/ClientSource/Characters/AI/Objectives/AIObjective.cs.
|
getprotected |
Definition at line 153 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 20 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getset |
Final priority value after all calculations.
Definition at line 58 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 60 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
getprotected |
Definition at line 154 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
|
get |
Definition at line 110 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
Action Barotrauma.AIObjective.Abandoned |
A single shot event. Automatically cleared after launching. Use OnAbandoned method for implementing (internal) persistent behavior.
Definition at line 142 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
Action Barotrauma.AIObjective.Completed |
A single shot event. Automatically cleared after launching. Use OnCompleted method for implementing (internal) persistent behavior.
Definition at line 138 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
Action Barotrauma.AIObjective.Deselected |
A single shot event. Automatically cleared after launching. Use OnDeselected method for implementing (internal) persistent behavior.
Definition at line 150 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.
Action Barotrauma.AIObjective.Selected |
A single shot event. Automatically cleared after launching. Use OnSelected method for implementing (internal) persistent behavior.
Definition at line 146 of file BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs.