Barotrauma Client Doc
Barotrauma.AIObjectiveGoTo Class Reference
Inheritance diagram for Barotrauma.AIObjectiveGoTo:
Barotrauma.AIObjective

Public Member Functions

 AIObjectiveGoTo (ISpatialEntity target, Character character, AIObjectiveManager objectiveManager, bool repeat=false, bool getDivingGearIfNeeded=true, float priorityModifier=1, float closeEnough=0)
 
void ForceAct (float deltaTime)
 
Hull GetTargetHull ()
 
override void Reset ()
 
- Public Member Functions inherited from Barotrauma.AIObjective
IEnumerable< AIObjectiveGetSubObjectivesRecursive (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 SpeakAfterOrderReceived ()
 
Sprite GetSprite ()
 

Static Public Member Functions

static Hull GetTargetHull (ISpatialEntity target)
 
- Static Public Member Functions inherited from Barotrauma.AIObjective
static Sprite GetSprite (Identifier identifier, Identifier option, Entity targetEntity)
 

Public Attributes

Func< bool > requiredCondition
 Doesn't allow the objective to complete if this condition is false More...
 
Func< PathNode, bool > endNodeFilter
 
Func< float > PriorityGetter
 
bool IsFollowOrder
 
bool IsWaitOrder
 
bool Mimic
 
EventAction SourceEventAction
 Which event action created this objective (if any) More...
 
float ExtraDistanceWhileSwimming
 
float ExtraDistanceOutsideSub
 
float? OverridePriority = null
 
- Public Attributes inherited from Barotrauma.AIObjective
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

override float GetPriority ()
 
override void Act (float deltaTime)
 
override bool CheckObjectiveSpecific ()
 
override void OnAbandon ()
 
override void OnCompleted ()
 
- Protected Member Functions inherited from Barotrauma.AIObjective
void HandleNonAllowed ()
 
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...
 
bool CanEquip (Item item, bool allowWearing)
 

Properties

override Identifier Identifier = "go to".ToIdentifier() [get, set]
 
override bool KeepDivingGearOn [get]
 
bool SpeakIfFails = true [get, set]
 
bool DebugLogWhenFails = true [get, set]
 
bool UsePathingOutside = true [get, set]
 
float CloseEnoughMultiplier [get, set]
 
float CloseEnough [get, set]
 Display units More...
 
bool IgnoreIfTargetDead [get, set]
 
bool AllowGoingOutside [get, set]
 
bool AlwaysUseEuclideanDistance = true [get, set]
 
bool UseDistanceRelativeToAimSourcePos = false [get, set]
 If true, the distance to the destination is calculated from the character's AimSourcePos (= shoulder) instead of the collider's position More...
 
override bool AbandonWhenCannotCompleteSubjectives [get]
 
override bool AllowOutsideSubmarine [get]
 
override bool AllowInAnySub [get]
 
Identifier DialogueIdentifier = "dialogcannotreachtarget".ToIdentifier() [get, set]
 
LocalizedString TargetName [get, set]
 
ISpatialEntity Target [get]
 
Func< bool > SpeakCannotReachCondition [get, set]
 
Gap TargetGap [get]
 
bool? IsCloseEnough [get]
 
- Properties inherited from Barotrauma.AIObjective
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< AIObjectiveSubObjectives [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]
 

Additional Inherited Members

- Static Protected Member Functions inherited from Barotrauma.AIObjective
static bool CanEquip (Character character, Item item, bool allowWearing)
 
- Protected Attributes inherited from Barotrauma.AIObjective
readonly List< AIObjectivesubObjectives = new List<AIObjective>()
 
- Events inherited from Barotrauma.AIObjective
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...
 

Detailed Description

Definition at line 9 of file AIObjectiveGoTo.cs.

Constructor & Destructor Documentation

◆ AIObjectiveGoTo()

Barotrauma.AIObjectiveGoTo.AIObjectiveGoTo ( ISpatialEntity  target,
Character  character,
AIObjectiveManager  objectiveManager,
bool  repeat = false,
bool  getDivingGearIfNeeded = true,
float  priorityModifier = 1,
float  closeEnough = 0 
)

Definition at line 149 of file AIObjectiveGoTo.cs.

Member Function Documentation

◆ Act()

override void Barotrauma.AIObjectiveGoTo.Act ( float  deltaTime)
protectedvirtual

Implements Barotrauma.AIObjective.

Definition at line 193 of file AIObjectiveGoTo.cs.

◆ CheckObjectiveSpecific()

override bool Barotrauma.AIObjectiveGoTo.CheckObjectiveSpecific ( )
protectedvirtual

Implements Barotrauma.AIObjective.

Definition at line 761 of file AIObjectiveGoTo.cs.

◆ ForceAct()

void Barotrauma.AIObjectiveGoTo.ForceAct ( float  deltaTime)

◆ GetPriority()

override float Barotrauma.AIObjectiveGoTo.GetPriority ( )
protectedvirtual

Reimplemented from Barotrauma.AIObjective.

Definition at line 109 of file AIObjectiveGoTo.cs.

◆ GetTargetHull() [1/2]

Hull Barotrauma.AIObjectiveGoTo.GetTargetHull ( )

◆ GetTargetHull() [2/2]

static Hull Barotrauma.AIObjectiveGoTo.GetTargetHull ( ISpatialEntity  target)
static

Definition at line 664 of file AIObjectiveGoTo.cs.

◆ OnAbandon()

override void Barotrauma.AIObjectiveGoTo.OnAbandon ( )
protectedvirtual

Reimplemented from Barotrauma.AIObjective.

Definition at line 800 of file AIObjectiveGoTo.cs.

◆ OnCompleted()

override void Barotrauma.AIObjectiveGoTo.OnCompleted ( )
protectedvirtual

Reimplemented from Barotrauma.AIObjective.

Definition at line 820 of file AIObjectiveGoTo.cs.

◆ Reset()

override void Barotrauma.AIObjectiveGoTo.Reset ( )
virtual

Reimplemented from Barotrauma.AIObjective.

Definition at line 837 of file AIObjectiveGoTo.cs.

Member Data Documentation

◆ endNodeFilter

Func<PathNode, bool> Barotrauma.AIObjectiveGoTo.endNodeFilter

Definition at line 25 of file AIObjectiveGoTo.cs.

◆ ExtraDistanceOutsideSub

float Barotrauma.AIObjectiveGoTo.ExtraDistanceOutsideSub

Definition at line 43 of file AIObjectiveGoTo.cs.

◆ ExtraDistanceWhileSwimming

float Barotrauma.AIObjectiveGoTo.ExtraDistanceWhileSwimming

Definition at line 42 of file AIObjectiveGoTo.cs.

◆ IsFollowOrder

bool Barotrauma.AIObjectiveGoTo.IsFollowOrder

Definition at line 29 of file AIObjectiveGoTo.cs.

◆ IsWaitOrder

bool Barotrauma.AIObjectiveGoTo.IsWaitOrder

Definition at line 30 of file AIObjectiveGoTo.cs.

◆ Mimic

bool Barotrauma.AIObjectiveGoTo.Mimic

Definition at line 31 of file AIObjectiveGoTo.cs.

◆ OverridePriority

float? Barotrauma.AIObjectiveGoTo.OverridePriority = null

Definition at line 105 of file AIObjectiveGoTo.cs.

◆ PriorityGetter

Func<float> Barotrauma.AIObjectiveGoTo.PriorityGetter

Definition at line 27 of file AIObjectiveGoTo.cs.

◆ requiredCondition

Func<bool> Barotrauma.AIObjectiveGoTo.requiredCondition

Doesn't allow the objective to complete if this condition is false

Definition at line 24 of file AIObjectiveGoTo.cs.

◆ SourceEventAction

EventAction Barotrauma.AIObjectiveGoTo.SourceEventAction

Which event action created this objective (if any)

Definition at line 40 of file AIObjectiveGoTo.cs.

Property Documentation

◆ AbandonWhenCannotCompleteSubjectives

override bool Barotrauma.AIObjectiveGoTo.AbandonWhenCannotCompleteSubjectives
get

Definition at line 95 of file AIObjectiveGoTo.cs.

◆ AllowGoingOutside

bool Barotrauma.AIObjectiveGoTo.AllowGoingOutside
getset

Definition at line 86 of file AIObjectiveGoTo.cs.

◆ AllowInAnySub

override bool Barotrauma.AIObjectiveGoTo.AllowInAnySub
get

Definition at line 98 of file AIObjectiveGoTo.cs.

◆ AllowOutsideSubmarine

override bool Barotrauma.AIObjectiveGoTo.AllowOutsideSubmarine
get

Definition at line 97 of file AIObjectiveGoTo.cs.

◆ AlwaysUseEuclideanDistance

bool Barotrauma.AIObjectiveGoTo.AlwaysUseEuclideanDistance = true
getset

Definition at line 88 of file AIObjectiveGoTo.cs.

◆ CloseEnough

float Barotrauma.AIObjectiveGoTo.CloseEnough
getset

Display units

Definition at line 59 of file AIObjectiveGoTo.cs.

◆ CloseEnoughMultiplier

float Barotrauma.AIObjectiveGoTo.CloseEnoughMultiplier
getset

Definition at line 45 of file AIObjectiveGoTo.cs.

◆ DebugLogWhenFails

bool Barotrauma.AIObjectiveGoTo.DebugLogWhenFails = true
getset

Definition at line 34 of file AIObjectiveGoTo.cs.

◆ DialogueIdentifier

Identifier Barotrauma.AIObjectiveGoTo.DialogueIdentifier = "dialogcannotreachtarget".ToIdentifier()
getset

Definition at line 100 of file AIObjectiveGoTo.cs.

◆ Identifier

override Identifier Barotrauma.AIObjectiveGoTo.Identifier = "go to".ToIdentifier()
getset

Definition at line 11 of file AIObjectiveGoTo.cs.

◆ IgnoreIfTargetDead

bool Barotrauma.AIObjectiveGoTo.IgnoreIfTargetDead
getset

Definition at line 85 of file AIObjectiveGoTo.cs.

◆ IsCloseEnough

bool? Barotrauma.AIObjectiveGoTo.IsCloseEnough
get

Definition at line 729 of file AIObjectiveGoTo.cs.

◆ KeepDivingGearOn

override bool Barotrauma.AIObjectiveGoTo.KeepDivingGearOn
get

Definition at line 13 of file AIObjectiveGoTo.cs.

◆ SpeakCannotReachCondition

Func<bool> Barotrauma.AIObjectiveGoTo.SpeakCannotReachCondition
getset

Definition at line 107 of file AIObjectiveGoTo.cs.

◆ SpeakIfFails

bool Barotrauma.AIObjectiveGoTo.SpeakIfFails = true
getset

Definition at line 33 of file AIObjectiveGoTo.cs.

◆ Target

ISpatialEntity Barotrauma.AIObjectiveGoTo.Target
get

Definition at line 103 of file AIObjectiveGoTo.cs.

◆ TargetGap

Gap Barotrauma.AIObjectiveGoTo.TargetGap
get

Definition at line 701 of file AIObjectiveGoTo.cs.

◆ TargetName

LocalizedString Barotrauma.AIObjectiveGoTo.TargetName
getset

Definition at line 101 of file AIObjectiveGoTo.cs.

◆ UseDistanceRelativeToAimSourcePos

bool Barotrauma.AIObjectiveGoTo.UseDistanceRelativeToAimSourcePos = false
getset

If true, the distance to the destination is calculated from the character's AimSourcePos (= shoulder) instead of the collider's position

Definition at line 93 of file AIObjectiveGoTo.cs.

◆ UsePathingOutside

bool Barotrauma.AIObjectiveGoTo.UsePathingOutside = true
getset

Definition at line 35 of file AIObjectiveGoTo.cs.