Revamp CashTrickler.

Added upgrade support.
Decoupled the capture bonus to a separate trait.
This commit is contained in:
Zimmermann Gyula
2016-10-05 17:01:01 +02:00
committed by reaperrr
parent 2b92daa955
commit bc1e2a7058
5 changed files with 103 additions and 15 deletions

View File

@@ -720,6 +720,29 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
}
// Capture bonus was decoupled from CashTrickler to a separate trait.
if (engineVersion < 20170108 && depth == 0)
{
var trickler = node.Value.Nodes.FirstOrDefault(n => n.Key == "CashTrickler");
if (trickler != null)
{
var capture = trickler.Value.Nodes.FirstOrDefault(n => n.Key == "CaptureAmount");
if (capture != null)
{
var gcoc = new MiniYamlNode("GivesCashOnCapture", "");
gcoc.Value.Nodes.Add(capture);
trickler.Value.Nodes.Remove(capture);
var show = trickler.Value.Nodes.FirstOrDefault(n => n.Key == "ShowTicks");
if (show != null)
gcoc.Value.Nodes.Add(show);
node.Value.Nodes.Add(gcoc);
RenameNodeKey(capture, "Amount");
}
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
}