3 using Microsoft.Xna.Framework;
5 using System.Collections.Generic;
20 private readonly List<Item> ignoredContainers =
new List<Item>();
22 private int itemIndex = 0;
44 float distanceFactor = 0.9f;
48 factorAtMinDistance: 0.9f, factorAtMaxDistance: 0);
51 float selectedBonus = isSelected ? 100 -
MaxDevotion : 0;
53 float reduction =
IsPriority ? 1 : isSelected ? 2 : 3;
56 if (decontainObjective ==
null)
65 protected override void Act(
float deltaTime)
70 if (suitableContainer !=
null)
85 TakeWholeStack = true,
92 HumanAIController.ReequipUnequipped();
104 ignoredContainers.Add(suitableContainer);
126 else if (item.ParentInventory !=
null && item.GetRootInventoryOwner() != character)
139 return !Abandon && IsCompleted;
145 ignoredContainers.Clear();
147 decontainObjective =
null;
152 if (item !=
null && character.HasItem(item))
154 item.Drop(character);
override float GetPriority()
override bool AllowWhileHandcuffed
override bool AllowAutomaticItemUnequipping
override bool CheckObjectiveState()
Should return whether the objective is completed or not.
override bool KeepDivingGearOn
override bool ConcurrentObjectives
Allows decontainObjective to be interrupted if this objective gets abandoned (e.g....
AIObjectiveCleanupItem(Item item, Character character, AIObjectiveManager objectiveManager, float priorityModifier=1)
override void Act(float deltaTime)
override Identifier Identifier
static bool IsValidContainer(Item container, Character character)
AIObjectiveContainItem ContainObjective
virtual bool CanBeCompleted
float Priority
Final priority value after all calculations.
readonly Character character
virtual float MaxDevotion
readonly List< AIObjective > subObjectives
readonly AIObjectiveManager objectiveManager
static float GetDistanceFactor(Vector2 selfPos, Vector2 targetWorldPos, float factorAtMaxDistance, float verticalDistanceMultiplier=3, float maxDistance=10000.0f, float factorAtMinDistance=1.0f)
Get a normalized value representing how close the target position is. The value is a rough estimation...
const float LowestOrderPriority
Maximum priority of an order given to the character (rightmost order in the crew list)
bool HasItem(Item item, bool requireEquipped=false, InvSlotType? slotType=null)
bool FindSuitableContainer(Item containableItem, out Item suitableContainer)
IEnumerable< InvSlotType > AllowedSlots
static HashSet< Item > DeconstructItems
Items that have been marked for deconstruction