AI preset curves and expandable optimisation (#1346)

* AI preset curves and expandable optimisation

Added preset curves for considerations to use just to avoid repeating the same variables all over the shop.

Moved common considerations for expanded actions onto the expandable action e.g. you need a free hand to be able to PickUpGloves so we'll just check it the once rather than for each action.

* FIX PRAGMA

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-08-12 06:01:55 +10:00
committed by GitHub
parent c00a08f504
commit b34bd7c188
43 changed files with 409 additions and 127 deletions

View File

@@ -79,6 +79,11 @@ namespace Content.Server.GameObjects.EntitySystems.AI.LoadBalancer
switch (action)
{
case ExpandableUtilityAction expandableUtilityAction:
if (!expandableUtilityAction.IsValid(_request.Context))
{
break;
}
foreach (var expanded in expandableUtilityAction.GetActions(_request.Context))
{
actions.Push(expanded);
@@ -86,7 +91,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.LoadBalancer
break;
case UtilityAction utilityAction:
consideredTaskCount++;
var bonus = (float) utilityAction.Bonus;
var bonus = utilityAction.Bonus;
if (bonus < cutoff)
{