(1137f730e) Instead of forcing the looping objectives to use the average, let them decide the method of evaluating the targets. Use the highest priority for now.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:11:32 +03:00
parent 759e4aee0d
commit de8a23f687
16 changed files with 115 additions and 24 deletions
@@ -51,7 +51,7 @@ namespace Barotrauma
}
protected override bool Filter(PowerContainer battery) => true;
protected override float Average(PowerContainer battery) => 100 - battery.ChargePercentage;
protected override float TargetEvaluation() => targets.Max(t => 100 - t.ChargePercentage);
protected override IEnumerable<PowerContainer> GetList() => batteryList;
protected override AIObjective ObjectiveConstructor(PowerContainer battery) => new AIObjectiveOperateItem(battery, character, Option, false) { IsLoop = true };
}