Merge pull request #12358 from reaperrr/cashtrickler-upgrade
Add upgrade support to CashTrickler and split off GivesCashOnCapture
This commit is contained in:
@@ -719,6 +719,33 @@ 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");
|
||||
}
|
||||
|
||||
var period = trickler.Value.Nodes.FirstOrDefault(n => n.Key == "Period");
|
||||
if (period != null)
|
||||
period.Key = "Interval";
|
||||
}
|
||||
}
|
||||
|
||||
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user