diff --git a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs index 9db0dab1d7..3bc82fe340 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs @@ -47,8 +47,8 @@ namespace OpenRA.Mods.Common.Traits [Desc("Maximum number of items that can be queued across all actor types (0 = infinite).")] public readonly int QueueLimit = 0; - [Desc("The build time is multiplied with this value on low power.")] - public readonly int LowPowerSlowdown = 3; + [Desc("The build time is multiplied with this percentage on low power.")] + public readonly int LowPowerModifier = 300; [NotificationReference("Speech")] [Desc("Notification played when production is complete.", @@ -86,8 +86,8 @@ namespace OpenRA.Mods.Common.Traits public void RulesetLoaded(Ruleset rules, ActorInfo ai) { - if (LowPowerSlowdown <= 0) - throw new YamlException("Production queue must have LowPowerSlowdown of at least 1."); + if (LowPowerModifier <= 0) + throw new YamlException("Production queue must have LowPowerModifier of at least 1."); } } @@ -541,7 +541,7 @@ namespace OpenRA.Mods.Common.Traits get { return (pm == null || pm.PowerState == PowerState.Normal) ? RemainingTime : - RemainingTime * Queue.Info.LowPowerSlowdown; + RemainingTime * Queue.Info.LowPowerModifier / 100; } } @@ -590,8 +590,9 @@ namespace OpenRA.Mods.Common.Traits if (pm != null && pm.PowerState != PowerState.Normal) { - if (--Slowdown <= 0) - Slowdown = Queue.Info.LowPowerSlowdown; + Slowdown -= 100; + if (Slowdown < 0) + Slowdown = Queue.Info.LowPowerModifier + Slowdown; else return; } diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ProductionTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ProductionTooltipLogic.cs index aa326235dc..2b45328b0e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ProductionTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ProductionTooltipLogic.cs @@ -106,10 +106,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic } var buildTime = tooltipIcon.ProductionQueue == null ? 0 : tooltipIcon.ProductionQueue.GetBuildTime(actor, buildable); - var timeMultiplier = pm != null && pm.PowerState != PowerState.Normal ? tooltipIcon.ProductionQueue.Info.LowPowerSlowdown : 1; + var timeModifier = pm != null && pm.PowerState != PowerState.Normal ? tooltipIcon.ProductionQueue.Info.LowPowerModifier : 100; - timeLabel.Text = formatBuildTime.Update(buildTime * timeMultiplier); - timeLabel.TextColor = (pm != null && pm.PowerState != PowerState.Normal && tooltipIcon.ProductionQueue.Info.LowPowerSlowdown > 1) ? Color.Red : Color.White; + timeLabel.Text = formatBuildTime.Update((buildTime * timeModifier) / 100); + timeLabel.TextColor = (pm != null && pm.PowerState != PowerState.Normal && tooltipIcon.ProductionQueue.Info.LowPowerModifier > 100) ? Color.Red : Color.White; var timeSize = font.Measure(timeLabel.Text); costLabel.Text = cost.ToString();