(8fd36f702) Add a separate value for run threshold. Increase the order priority from 50 to 70.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:09:15 +03:00
parent 3a3d55d780
commit 7c901d8d77
14 changed files with 106 additions and 29 deletions
@@ -1078,6 +1078,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
@@ -113,7 +113,7 @@ namespace Barotrauma
objectiveManager.DoCurrentObjective(deltaTime);
bool run = objectiveManager.GetCurrentPriority() > AIObjectiveManager.OrderPriority;
bool run = objectiveManager.GetCurrentPriority() > AIObjectiveManager.RunPriority;
if (ObjectiveManager.CurrentObjective is AIObjectiveGoTo goTo && goTo.Target != null)
{
if (Vector2.DistanceSquared(Character.SimPosition, goTo.Target.SimPosition) > 3 * 3)
@@ -8,7 +8,8 @@ namespace Barotrauma
class AIObjectiveManager
{
// TODO: expose
public const float OrderPriority = 50.0f;
public const float OrderPriority = 70;
public const float RunPriority = 50;
// Constantly increases the priority of the selected objective, unless overridden
public const float baseDevotion = 2;
@@ -2654,6 +2654,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