(b4d4f6802) Re-enable initiative.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:49:32 +03:00
parent c28106812d
commit b105ef71eb
11 changed files with 313 additions and 151 deletions
@@ -52,7 +52,6 @@ namespace Barotrauma
public override float GetPriority()
{
return 1;
float max = Math.Min(Math.Min(AIObjectiveManager.RunPriority, AIObjectiveManager.OrderPriority) - 1, 100);
float initiative = character.GetSkillLevel("initiative");
Priority = MathHelper.Lerp(1, max, MathUtils.InverseLerp(100, 0, initiative * Random));
@@ -74,6 +73,21 @@ namespace Barotrauma
}
}
public override void Update(float deltaTime)
{
if (objectiveManager.CurrentObjective == this)
{
if (randomTimer > 0)
{
randomTimer -= deltaTime;
}
else
{
SetRandom();
}
}
}
public override bool IsCompleted() => false;
public override bool CanBeCompleted => true;