From 4aa97ec7763b0761ea186d4e2beea086f567aae7 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Mon, 8 Dec 2014 09:32:19 +0100 Subject: [PATCH] Allow support powers to start with a full charge when created --- OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs | 4 ++++ .../Traits/SupportPowers/SupportPowerManager.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs index 4505370ee7..99ef3918cf 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs @@ -20,6 +20,10 @@ namespace OpenRA.Mods.Common.Traits public readonly string LongDesc = ""; public readonly bool AllowMultiple = false; public readonly bool OneShot = false; + + [Desc("If set to true, the support power will be fully charged when it becomes available. " + + "Normal rules apply for subsequent charges.")] + public readonly bool StartFullyCharged = false; public readonly string[] Prerequisites = { }; public readonly string BeginChargeSound = null; diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPowerManager.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPowerManager.cs index 672f0b97ef..85f123158e 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPowerManager.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPowerManager.cs @@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits Powers.Add(key, new SupportPowerInstance(key, this) { Instances = new List(), - RemainingTime = t.Info.ChargeTime * 25, + RemainingTime = t.Info.StartFullyCharged ? 0 : t.Info.ChargeTime * 25, TotalTime = t.Info.ChargeTime * 25, });