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

Public Member Functions

 AIObjectiveDecontainItem (Character character, Item targetItem, AIObjectiveManager objectiveManager, ItemContainer sourceContainer=null, ItemContainer targetContainer=null, float priorityModifier=1)
 
 AIObjectiveDecontainItem (Character character, Identifier itemIdentifier, AIObjectiveManager objectiveManager, ItemContainer sourceContainer, ItemContainer targetContainer=null, float priorityModifier=1)
 
 AIObjectiveDecontainItem (Character character, Identifier[] itemIdentifiers, AIObjectiveManager objectiveManager, ItemContainer sourceContainer, ItemContainer targetContainer=null, float priorityModifier=1)
 
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 ()
 

Public Attributes

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

Properties

override Identifier Identifier = "decontain item".ToIdentifier() [get, set]
 
override bool AllowWhileHandcuffed [get]
 
AIObjectiveGetItem GetItemObjective [get]
 
AIObjectiveContainItem ContainObjective [get]
 
Item TargetItem [get]
 
ItemContainer TargetContainer [get]
 
bool Equip [get, set]
 
bool TakeWholeStack [get, set]
 
bool DropIfFails = true [get, set]
 If true drops the item when containing the item fails. In both cases abandons the objective. Note that has no effect if the target container was not defined (always drops) -> completes when the item is dropped. More...
 
bool RemoveExistingWhenNecessary [get, set]
 
Func< Item, bool > RemoveExistingPredicate [get, set]
 
int? RemoveExistingMax [get, set]
 
string AbandonGetItemDialogueIdentifier [get, set]
 
Func< bool > AbandonGetItemDialogueCondition [get, set]
 
- 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 Public Member Functions inherited from Barotrauma.AIObjective
static Sprite GetSprite (Identifier identifier, Identifier option, Entity targetEntity)
 
- 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 AIObjectiveDecontainItem.cs.

Constructor & Destructor Documentation

◆ AIObjectiveDecontainItem() [1/3]

Barotrauma.AIObjectiveDecontainItem.AIObjectiveDecontainItem ( Character  character,
Item  targetItem,
AIObjectiveManager  objectiveManager,
ItemContainer  sourceContainer = null,
ItemContainer  targetContainer = null,
float  priorityModifier = 1 
)

Definition at line 48 of file AIObjectiveDecontainItem.cs.

◆ AIObjectiveDecontainItem() [2/3]

Barotrauma.AIObjectiveDecontainItem.AIObjectiveDecontainItem ( Character  character,
Identifier  itemIdentifier,
AIObjectiveManager  objectiveManager,
ItemContainer  sourceContainer,
ItemContainer  targetContainer = null,
float  priorityModifier = 1 
)

Definition at line 56 of file AIObjectiveDecontainItem.cs.

◆ AIObjectiveDecontainItem() [3/3]

Barotrauma.AIObjectiveDecontainItem.AIObjectiveDecontainItem ( Character  character,
Identifier[]  itemIdentifiers,
AIObjectiveManager  objectiveManager,
ItemContainer  sourceContainer,
ItemContainer  targetContainer = null,
float  priorityModifier = 1 
)

Definition at line 59 of file AIObjectiveDecontainItem.cs.

Member Function Documentation

◆ Act()

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

Implements Barotrauma.AIObjective.

Definition at line 73 of file AIObjectiveDecontainItem.cs.

◆ CheckObjectiveSpecific()

override bool Barotrauma.AIObjectiveDecontainItem.CheckObjectiveSpecific ( )
protectedvirtual

◆ OnAbandon()

override void Barotrauma.AIObjectiveDecontainItem.OnAbandon ( )
protectedvirtual

Reimplemented from Barotrauma.AIObjective.

Definition at line 152 of file AIObjectiveDecontainItem.cs.

◆ Reset()

override void Barotrauma.AIObjectiveDecontainItem.Reset ( )
virtual

Reimplemented from Barotrauma.AIObjective.

Definition at line 145 of file AIObjectiveDecontainItem.cs.

Member Data Documentation

◆ GetItemPriority

Func<Item, float> Barotrauma.AIObjectiveDecontainItem.GetItemPriority

Definition at line 14 of file AIObjectiveDecontainItem.cs.

Property Documentation

◆ AbandonGetItemDialogueCondition

Func<bool> Barotrauma.AIObjectiveDecontainItem.AbandonGetItemDialogueCondition
getset

Definition at line 46 of file AIObjectiveDecontainItem.cs.

◆ AbandonGetItemDialogueIdentifier

string Barotrauma.AIObjectiveDecontainItem.AbandonGetItemDialogueIdentifier
getset

Definition at line 45 of file AIObjectiveDecontainItem.cs.

◆ AllowWhileHandcuffed

override bool Barotrauma.AIObjectiveDecontainItem.AllowWhileHandcuffed
get

Definition at line 12 of file AIObjectiveDecontainItem.cs.

◆ ContainObjective

AIObjectiveContainItem Barotrauma.AIObjectiveDecontainItem.ContainObjective
get

Definition at line 26 of file AIObjectiveDecontainItem.cs.

◆ DropIfFails

bool Barotrauma.AIObjectiveDecontainItem.DropIfFails = true
getset

If true drops the item when containing the item fails. In both cases abandons the objective. Note that has no effect if the target container was not defined (always drops) -> completes when the item is dropped.

Definition at line 40 of file AIObjectiveDecontainItem.cs.

◆ Equip

bool Barotrauma.AIObjectiveDecontainItem.Equip
getset

Definition at line 31 of file AIObjectiveDecontainItem.cs.

◆ GetItemObjective

AIObjectiveGetItem Barotrauma.AIObjectiveDecontainItem.GetItemObjective
get

Definition at line 25 of file AIObjectiveDecontainItem.cs.

◆ Identifier

override Identifier Barotrauma.AIObjectiveDecontainItem.Identifier = "decontain item".ToIdentifier()
getset

Definition at line 11 of file AIObjectiveDecontainItem.cs.

◆ RemoveExistingMax

int? Barotrauma.AIObjectiveDecontainItem.RemoveExistingMax
getset

Definition at line 44 of file AIObjectiveDecontainItem.cs.

◆ RemoveExistingPredicate

Func<Item, bool> Barotrauma.AIObjectiveDecontainItem.RemoveExistingPredicate
getset

Definition at line 43 of file AIObjectiveDecontainItem.cs.

◆ RemoveExistingWhenNecessary

bool Barotrauma.AIObjectiveDecontainItem.RemoveExistingWhenNecessary
getset

Definition at line 42 of file AIObjectiveDecontainItem.cs.

◆ TakeWholeStack

bool Barotrauma.AIObjectiveDecontainItem.TakeWholeStack
getset

Definition at line 33 of file AIObjectiveDecontainItem.cs.

◆ TargetContainer

ItemContainer Barotrauma.AIObjectiveDecontainItem.TargetContainer
get

Definition at line 29 of file AIObjectiveDecontainItem.cs.

◆ TargetItem

Item Barotrauma.AIObjectiveDecontainItem.TargetItem
get

Definition at line 28 of file AIObjectiveDecontainItem.cs.