From 4cc5104fded307c9fd5ab4b2e046b477df0157ea Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Mon, 3 Aug 2020 10:47:03 +0300 Subject: [PATCH] Unhardcode AI's MinimumRefineryCount numbers. --- .../Traits/BotModules/BaseBuilderBotModule.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/BotModules/BaseBuilderBotModule.cs b/OpenRA.Mods.Common/Traits/BotModules/BaseBuilderBotModule.cs index 2330f839b3..f91fb36e5f 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/BaseBuilderBotModule.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/BaseBuilderBotModule.cs @@ -67,6 +67,12 @@ namespace OpenRA.Mods.Common.Traits [Desc("Increase maintained excess power by ExcessPowerIncrement for every N base buildings.")] public readonly int ExcessPowerIncreaseThreshold = 1; + [Desc("Number of refineries to build before building a barracks.")] + public readonly int InititalMinimumRefineryCount = 1; + + [Desc("Number of refineries to build additionally after building a barracks.")] + public readonly int AdditionalMinimumRefineryCount = 1; + [Desc("Additional delay (in ticks) between structure production checks when there is no active production.", "StructureProductionRandomBonusDelay is added to this.")] public readonly int StructureProductionInactiveDelay = 125; @@ -270,9 +276,7 @@ namespace OpenRA.Mods.Common.Traits { get { - // Unless we have no barracks (higher priority), require a 2nd refinery. - // TODO: Possibly unhardcode this, at least the targeted minimum of 2 (the fallback can probably stay at 1). - return AIUtils.CountBuildingByCommonName(Info.BarracksTypes, player) > 0 ? 2 : 1; + return AIUtils.CountBuildingByCommonName(Info.BarracksTypes, player) > 0 ? Info.InititalMinimumRefineryCount + Info.AdditionalMinimumRefineryCount : Info.InititalMinimumRefineryCount; } }