(d732f31b3) Enable initiative and courage. Implement initiative.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:28:59 +03:00
parent eadd063950
commit 9334b71939
8 changed files with 193 additions and 238 deletions
@@ -40,6 +40,18 @@ namespace Barotrauma
public override bool IsLoop { get => true; set => throw new System.Exception("Trying to set the value for IsLoop from: " + System.Environment.StackTrace); }
public override float GetPriority()
{
float max = Math.Min(AIObjectiveManager.OrderPriority - 1, 100);
Priority = MathHelper.Lerp(1, max, MathUtils.InverseLerp(100, 0, character.GetSkillLevel("initiative")));
return Priority;
}
public override bool IsCompleted() => false;
public override bool CanBeCompleted => true;
public override bool IsLoop { get => true; set => throw new System.Exception("Trying to set the value for IsLoop from: " + System.Environment.StackTrace); }
// TODO: take the initiative into account
public override float GetPriority() => 1;