Allow support powers to start with a full charge when created

This commit is contained in:
Oliver Brakmann
2014-12-08 09:32:19 +01:00
parent 07d6a104a1
commit 4aa97ec776
2 changed files with 5 additions and 1 deletions

View File

@@ -20,6 +20,10 @@ namespace OpenRA.Mods.Common.Traits
public readonly string LongDesc = ""; public readonly string LongDesc = "";
public readonly bool AllowMultiple = false; public readonly bool AllowMultiple = false;
public readonly bool OneShot = 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[] Prerequisites = { };
public readonly string BeginChargeSound = null; public readonly string BeginChargeSound = null;

View File

@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits
Powers.Add(key, new SupportPowerInstance(key, this) Powers.Add(key, new SupportPowerInstance(key, this)
{ {
Instances = new List<SupportPower>(), Instances = new List<SupportPower>(),
RemainingTime = t.Info.ChargeTime * 25, RemainingTime = t.Info.StartFullyCharged ? 0 : t.Info.ChargeTime * 25,
TotalTime = t.Info.ChargeTime * 25, TotalTime = t.Info.ChargeTime * 25,
}); });