3 using System.Collections.Generic;
18 private bool checkedDeconstructorExists;
21 : base(character, objectiveManager, priorityModifier)
28 if (!checkedDeconstructorExists)
30 if (character.Submarine ==
null ||
33 it.IsInteractable(character) &&
34 character.Submarine.IsEntityFoundOnThisSub(it, includingConnectedSubs:
true, allowDifferentTeam:
true, allowDifferentType:
true)))
36 character.Speak(TextManager.Get(
"orderdialogself.deconstructitem.nodeconstructor").Value, delay: 5.0f,
37 identifier:
"nodeconstructor".ToIdentifier(), minDurationBetweenSimilar: 30.0f);
40 checkedDeconstructorExists =
true;
47 checkedDeconstructorExists =
false;
52 if (
Targets.None()) {
return 0; }
53 if (objectiveManager.IsOrder(
this))
55 return objectiveManager.GetOrderPriority(
this);
62 if (target ==
null || target.
Removed) {
return false; }
101 if (item ==
null || item.
Removed) {
return false; }
107 allowUnloading:
true,
108 requireValidContainer:
false,
109 ignoreItemsMarkedForDeconstruction:
false);
115 foreach (var subObjective
in SubObjectives)
119 deconstructObjective.DropTarget();
static bool IsItemInsideValidSubmarine(Item item, Character character)
override bool IsValidTarget(Item target)
override AIObjective ObjectiveConstructor(Item item)
override bool IsValidTarget(Item target)
override bool AllowInFriendlySubs
override Identifier Identifier
override float GetTargetPriority()
Returns a priority value based on the current targets (e.g. high prio when there's lots of severe fir...
override void OnObjectiveCompleted(AIObjective objective, Item target)
override float IgnoreListClearInterval
override IEnumerable< Item > GetList()
List of all possible items of the specified type. Used for filtering the removed objectives.
override void OnDeselected()
AIObjectiveDeconstructItems(Character character, AIObjectiveManager objectiveManager, float priorityModifier=1)
override void OnSelected()
An objective that creates specific kinds of subobjectives for specific types of targets,...
Dictionary< T, AIObjective > Objectives
const float RunPriority
Objectives with a priority equal to or higher than this make the character run.
virtual AIController AIController
static readonly List< Character > CharacterList
List< FireSource > FireSources
static bool IsActive(Character c)
static bool IsFriendly(Character me, Character other, bool onlySameTeam=false)
static readonly List< Item > ItemList
static HashSet< Item > DeconstructItems
Items that have been marked for deconstruction
Entity GetRootInventoryOwner()