Add support for multiple explosions to CreateEffectWarhead

Have the engine pick one explosion at random from the provided list.
This commit is contained in:
Pavel Penev
2016-01-02 16:47:56 +02:00
parent c22281876c
commit 7e3ec91d30
35 changed files with 292 additions and 279 deletions

View File

@@ -3432,6 +3432,18 @@ namespace OpenRA.Mods.Common.UtilityCommands
node.Value.Nodes.RemoveAll(x => x.Key == "Charges");
}
// Enhance CreateEffectWarhead
if (engineVersion < 20160131)
{
if (node.Key.StartsWith("Warhead") && node.Value.Value == "CreateEffect")
{
// Add support for multiple explosions to CreateEffectWarhead
var explosionNode = node.Value.Nodes.FirstOrDefault(x => x.Key == "Explosion");
if (explosionNode != null)
explosionNode.Key = "Explosions";
}
}
UpgradeWeaponRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}