(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
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Barotrauma.Items.Components;
using Barotrauma.Extensions;
@@ -66,7 +67,7 @@ namespace Barotrauma
return ignore;
}
protected override float Average(Item item) => 100 - item.ConditionPercentage;
protected override float TargetEvaluation() => targets.Max(t => 100 - t.ConditionPercentage);
protected override IEnumerable<Item> GetList() => Item.ItemList;
protected override AIObjective ObjectiveConstructor(Item item) => new AIObjectiveRepairItem(character, item);
}