Merge SpawnViceroid into LeavesHusk

This commit is contained in:
abcdefg30
2015-07-19 12:36:18 +02:00
parent 1bc84275fd
commit 538723f8fb
4 changed files with 64 additions and 66 deletions

View File

@@ -527,7 +527,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
if (depth == 2 && parentKey.StartsWith("DeathSounds") && node.Key == "InfDeaths")
node.Key = "DeathTypes";
if (depth == 2 && parentKey == "SpawnsViceroid" && node.Key == "InfDeath")
if (depth == 2 && parentKey == "SpawnViceroid" && node.Key == "InfDeath")
node.Key = "DeathType";
if (depth == 2 && parentKey == "Explodes" && node.Key == "InfDeath")
@@ -1409,7 +1409,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
var modifier = trait.Value.Nodes.FirstOrDefault(n => n.Key == type + "Modifier");
if (upgradeTypes == null || !string.IsNullOrEmpty(upgradeTypes.Value.Value) || modifier == null ||
!string.IsNullOrEmpty(modifier.Value.Value))
!string.IsNullOrEmpty(modifier.Value.Value))
{
var yaml = new MiniYaml(null);
if (modifier == null)
@@ -1687,6 +1687,27 @@ namespace OpenRA.Mods.Common.UtilityCommands
node.Key = "Sequences";
}
// SpawnViceroid was replaced by LeavesHusk
if (engineVersion < 20150719)
{
if (node.Key == "SpawnViceroid")
{
node.Key = "LeavesHusk";
var actor = node.Value.Nodes.FirstOrDefault(n => n.Key == "ViceroidActor");
if (actor != null)
actor.Key = "HuskActor";
// The default value of ViceroidActor was "vice"
else
node.Value.Nodes.Add(new MiniYamlNode("HuskActor", "vice"));
var probability = node.Value.Nodes.FirstOrDefault(n => n.Key == "Probability");
// The default value of Probability was 10
if (probability == null)
node.Value.Nodes.Add(new MiniYamlNode("Probability", "10"));
}
}
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}