(2f379083c) Change how some of the priorities are clamped.
This commit is contained in:
@@ -1058,6 +1058,8 @@ namespace Barotrauma
|
||||
|
||||
private bool IsProperlyLatchedOnSub => LatchOntoAI != null && LatchOntoAI.IsAttachedToSub && SelectedAiTarget?.Entity == wallTarget?.Structure;
|
||||
|
||||
private bool IsProperlyLatchedOnSub => LatchOntoAI != null && LatchOntoAI.IsAttachedToSub && SelectedAiTarget?.Entity == wallTarget?.Structure;
|
||||
|
||||
//goes through all the AItargets, evaluates how preferable it is to attack the target,
|
||||
//whether the Character can see/hear the target and chooses the most preferable target within
|
||||
//sight/hearing range
|
||||
|
||||
+1
@@ -32,6 +32,7 @@ namespace Barotrauma
|
||||
float dist = Math.Abs(character.WorldPosition.X - targetHull.WorldPosition.X) + Math.Abs(character.WorldPosition.Y - targetHull.WorldPosition.Y) * 2.0f;
|
||||
float distanceFactor = MathHelper.Lerp(1, 0.1f, MathUtils.InverseLerp(0, 10000, dist));
|
||||
float severityFactor = MathHelper.Lerp(0, 1, MathHelper.Clamp(targetHull.FireSources.Sum(fs => fs.Size.X) / targetHull.Size.X, 0, 1));
|
||||
// Devotion?
|
||||
return MathHelper.Lerp(0, 100, severityFactor * distanceFactor);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@ namespace Barotrauma
|
||||
return AIObjectiveManager.OrderPriority;
|
||||
}
|
||||
float basePriority = MathHelper.Clamp(Priority, 0, 10);
|
||||
return MathHelper.Clamp(basePriority + fireCount * 20, 0, 100);
|
||||
float max = MathHelper.Min(AIObjectiveManager.OrderPriority + 20, 100);
|
||||
return MathHelper.Clamp(basePriority + fireCount * 20, 0, max);
|
||||
}
|
||||
|
||||
public override bool IsCompleted() => false;
|
||||
|
||||
@@ -48,7 +48,7 @@ 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, 100);
|
||||
return MathHelper.Clamp(Priority + leakSize / dist, 0, MathHelper.Min(AIObjectiveManager.OrderPriority + 20, 100));
|
||||
}
|
||||
|
||||
public override bool IsDuplicate(AIObjective otherObjective)
|
||||
|
||||
+2
-1
@@ -37,7 +37,8 @@ namespace Barotrauma
|
||||
float successFactor = MathHelper.Lerp(0, 1, Item.Repairables.Average(r => r.DegreeOfSuccess(character)));
|
||||
float isSelected = character.SelectedConstruction == Item ? 50 : 0;
|
||||
float baseLevel = Math.Max(Priority + isSelected, 1);
|
||||
return MathHelper.Clamp(baseLevel * damagePriority * distanceFactor * successFactor, 0, 100);
|
||||
float max = MathHelper.Min(AIObjectiveManager.OrderPriority + 20, 100);
|
||||
return MathHelper.Clamp(baseLevel * damagePriority * distanceFactor * successFactor, 0, max);
|
||||
}
|
||||
|
||||
public override bool CanBeCompleted => !abandon;
|
||||
|
||||
@@ -2618,6 +2618,10 @@ namespace Barotrauma
|
||||
GameMain.GameSession?.CrewManager?.RemoveCharacter(this);
|
||||
#endif
|
||||
|
||||
#if CLIENT
|
||||
GameMain.GameSession?.CrewManager?.RemoveCharacter(this);
|
||||
#endif
|
||||
|
||||
#if CLIENT
|
||||
GameMain.GameSession?.CrewManager?.RemoveCharacter(this);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user