(40f4f67f8) Further changes to the calculations.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:06:49 +03:00
parent b7272e1c96
commit 2a0e289a59
19 changed files with 122 additions and 34 deletions
@@ -48,7 +48,9 @@ namespace Barotrauma
float leakSize = (leak.IsHorizontal ? leak.Rect.Height : leak.Rect.Width) * Math.Max(leak.Open, 0.1f);
float dist = Vector2.DistanceSquared(character.SimPosition, leak.SimPosition);
dist = Math.Max(dist / 100.0f, 1.0f);
return MathHelper.Clamp(Priority + leakSize / dist, 0, MathHelper.Min(AIObjectiveManager.OrderPriority + 20, 100));
float maxMultiplier = MathHelper.Min(PriorityModifier, 1);
float max = MathHelper.Min((AIObjectiveManager.OrderPriority + 20) * maxMultiplier, 90);
return MathHelper.Clamp(Priority + leakSize / dist, 0, max);
}
public override bool IsDuplicate(AIObjective otherObjective)