Convert GainsExperience to conditions.

This commit is contained in:
Paul Chote
2016-12-09 23:58:01 +00:00
parent f4e0b91e04
commit 736d66d2c2
7 changed files with 45 additions and 23 deletions

View File

@@ -675,6 +675,21 @@ namespace OpenRA.Mods.Common.UtilityCommands
ConvertUpgradesToCondition(parent, node, "UndeployedUpgrades", "UndeployedCondition");
ConvertUpgradesToCondition(parent, node, "DeployedUpgrades", "DeployedCondition");
}
if (node.Key == "GainsExperience")
{
var upgrades = node.Value.Nodes.FirstOrDefault(n => n.Key == "Upgrades");
if (upgrades != null)
{
upgrades.Key = "Conditions";
foreach (var n in upgrades.Value.Nodes)
{
var conditions = FieldLoader.GetValue<string[]>("", n.Value.Value);
if (conditions.Length > 1)
Console.WriteLine("Unable to automatically migrate multiple GainsExperience upgrades to a condition. This must be corrected manually");
}
}
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);