v1.5.7.0 (Summer Update)

This commit is contained in:
Regalis11
2024-06-18 16:49:51 +03:00
parent 4a63dacbce
commit 230d1b6e78
263 changed files with 7792 additions and 2845 deletions
@@ -13,7 +13,7 @@ namespace Barotrauma
public override bool KeepDivingGearOn => true;
public override bool KeepDivingGearOnAlsoWhenInactive => true;
public override bool PrioritizeIfSubObjectivesActive => true;
public override bool AllowWhileHandcuffed => false;
protected override bool AllowWhileHandcuffed => false;
private AIObjectiveGetItem getSingleItemObjective;
private AIObjectiveGetItems getAllItemsObjective;
@@ -22,7 +22,6 @@ namespace Barotrauma
private readonly Item targetItem;
private readonly ImmutableArray<Identifier> requiredItems;
private readonly ImmutableArray<Identifier> optionalItems;
private readonly HashSet<Item> items = new HashSet<Item>();
public bool KeepActiveWhenReady { get; set; }
public bool CheckInventory { get; set; }
public bool FindAllItems { get; set; }
@@ -61,12 +60,12 @@ namespace Barotrauma
{
if (!IsAllowed)
{
HandleNonAllowed();
HandleDisallowed();
return Priority;
}
Priority = objectiveManager.GetOrderPriority(this);
var subObjective = GetSubObjective();
if (subObjective != null && subObjective.IsCompleted)
if (subObjective is { IsCompleted: true })
{
Priority = 0;
}
@@ -113,20 +112,7 @@ namespace Barotrauma
},
onCompleted: () =>
{
if (KeepActiveWhenReady)
{
if (objectiveReference != null)
{
foreach (var item in objectiveReference.achievedItems)
{
if (item?.IsOwnedBy(character) != null)
{
items.Add(item);
}
}
}
}
else
if (!KeepActiveWhenReady)
{
IsCompleted = true;
}
@@ -165,22 +151,11 @@ namespace Barotrauma
if (!TryAddSubObjective(ref getSingleItemObjective, getItemConstructor,
onCompleted: () =>
{
if (KeepActiveWhenReady)
{
if (getSingleItemObjective != null)
{
var item = getSingleItemObjective?.TargetItem;
if (item?.IsOwnedBy(character) != null)
{
items.Add(item);
}
}
}
else
if (!KeepActiveWhenReady)
{
IsCompleted = true;
}
},
},
onAbandon: () => Abandon = true))
{
Abandon = true;
@@ -193,7 +168,6 @@ namespace Barotrauma
public override void Reset()
{
base.Reset();
items.Clear();
subObjectivesCreated = false;
getMultipleItemsObjective = null;
getSingleItemObjective = null;