v1.4.4.1 (Blood in the Water Update)
This commit is contained in:
+8
-5
@@ -21,6 +21,11 @@ namespace Barotrauma
|
||||
private AIObjectiveDecontainItem decontainObjective;
|
||||
private int itemIndex = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Allows decontainObjective to be interrupted if this objective gets abandoned (e.g. due to the item no longer being eligible for cleanup)
|
||||
/// </summary>
|
||||
public override bool ConcurrentObjectives => true;
|
||||
|
||||
public AIObjectiveCleanupItem(Item item, Character character, AIObjectiveManager objectiveManager, float priorityModifier = 1)
|
||||
: base(character, objectiveManager, priorityModifier)
|
||||
{
|
||||
@@ -39,10 +44,8 @@ namespace Barotrauma
|
||||
float distanceFactor = 0.9f;
|
||||
if (!IsPriority && item.CurrentHull != character.CurrentHull)
|
||||
{
|
||||
float yDist = Math.Abs(character.WorldPosition.Y - item.WorldPosition.Y);
|
||||
yDist = yDist > 100 ? yDist * 5 : 0;
|
||||
float dist = Math.Abs(character.WorldPosition.X - item.WorldPosition.X) + yDist;
|
||||
distanceFactor = MathHelper.Lerp(0.9f, 0, MathUtils.InverseLerp(0, 5000, dist));
|
||||
distanceFactor = GetDistanceFactor(item.WorldPosition, verticalDistanceMultiplier: 5, maxDistance: 5000,
|
||||
factorAtMinDistance: 0.9f, factorAtMaxDistance: 0);
|
||||
}
|
||||
bool isSelected = character.HasItem(item);
|
||||
float selectedBonus = isSelected ? 100 - MaxDevotion : 0;
|
||||
@@ -116,7 +119,7 @@ namespace Barotrauma
|
||||
|
||||
protected override bool CheckObjectiveSpecific()
|
||||
{
|
||||
if (item.IgnoreByAI(character))
|
||||
if (item.IgnoreByAI(character) || Item.DeconstructItems.Contains(item))
|
||||
{
|
||||
Abandon = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user