Unstable 1.8.4.0

This commit is contained in:
Markus Isberg
2025-03-12 12:56:27 +00:00
parent a4c3e868e4
commit a4a3427e4e
627 changed files with 29860 additions and 10018 deletions
@@ -48,6 +48,8 @@ namespace Barotrauma
public int? RemoveMax { get; set; }
public bool MoveWholeStack { get; set; }
public bool AllowStealing { get; set; }
private int _itemCount = 1;
public int ItemCount
@@ -77,9 +79,8 @@ namespace Barotrauma
this.container = container;
}
protected override bool CheckObjectiveSpecific()
protected override bool CheckObjectiveState()
{
if (IsCompleted) { return true; }
if (container?.Item == null || !container.Item.HasAccess(character))
{
Abandon = true;
@@ -148,11 +149,11 @@ namespace Barotrauma
if (RemoveExisting || (RemoveExistingWhenNecessary && !CanBePut(container.Inventory, TargetSlot, ItemToContain)))
{
HumanAIController.UnequipContainedItems(container.Item, predicate: RemoveExistingPredicate, unequipMax: RemoveMax);
HumanAIController.UnequipContainedItems(container.Item, predicate: RemoveExistingPredicate, unequipMax: RemoveMax, allowDestroying: spawnItemIfNotFound);
}
else if (RemoveEmpty)
{
HumanAIController.UnequipEmptyItems(container.Item);
HumanAIController.UnequipEmptyItems(container.Item, allowDestroying: spawnItemIfNotFound);
}
Inventory originalInventory = ItemToContain.ParentInventory;
var slots = originalInventory?.FindIndices(ItemToContain);
@@ -196,6 +197,7 @@ namespace Barotrauma
{
TryAddSubObjective(ref goToObjective, () => new AIObjectiveGoTo(container.Item, character, objectiveManager, getDivingGearIfNeeded: AllowToFindDivingGear)
{
DialogueIdentifier = AIObjectiveGoTo.DialogCannotReachTarget,
TargetName = container.Item.Name,
AbortCondition = obj =>
container?.Item == null || container.Item.Removed || !container.Item.HasAccess(character) ||
@@ -232,7 +234,9 @@ namespace Barotrauma
return (RemoveEmpty ? container.CanBeContained(potentialItem) : container.Inventory.CanBePut(potentialItem)) && container.ShouldBeContained(potentialItem, out _);
},
ItemCount = ItemCount,
TakeWholeStack = MoveWholeStack
TakeWholeStack = MoveWholeStack,
ContainTarget = container,
AllowStealing = AllowStealing
}, onAbandon: () =>
{
Abandon = true;