From 98f7995d00c1f2f046223c3c3ab7ded2465de89f Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 4 Jan 2014 01:16:00 +0100 Subject: [PATCH] Un-hardcoded excess power factor and excess power minimum --- OpenRA.Mods.RA/AI/HackyAI.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/AI/HackyAI.cs b/OpenRA.Mods.RA/AI/HackyAI.cs index a5e8a46e68..acedd5831d 100644 --- a/OpenRA.Mods.RA/AI/HackyAI.cs +++ b/OpenRA.Mods.RA/AI/HackyAI.cs @@ -30,6 +30,10 @@ namespace OpenRA.Mods.RA.AI public readonly int RushInterval = 600; public readonly int AttackForceInterval = 30; + [Desc("By what factor should power output exceed power consumption.")] + public readonly float ExcessPowerFactor = 1.2f; + [Desc("By what minimum amount should power output exceed power consumption.")] + public readonly int MinimumExcessPower = 50; // Temporary hack to maintain previous rallypoint behavior. public readonly string RallypointTestBuilding = "fact"; public readonly string[] UnitQueues = { "Vehicle", "Infantry", "Plane", "Ship", "Aircraft" }; @@ -223,8 +227,8 @@ namespace OpenRA.Mods.RA.AI bool HasAdequatePower() { // note: CNC `fact` provides a small amount of power. don't get jammed because of that. - return playerPower.PowerProvided > 50 && - playerPower.PowerProvided > playerPower.PowerDrained * 1.2; + return playerPower.PowerProvided > Info.MinimumExcessPower && + playerPower.PowerProvided > playerPower.PowerDrained * Info.ExcessPowerFactor; } bool HasAdequateFact()