Added WithAttackAnimation trait

Interacts with WithUnitBody.

Upgrade rule for RenderUnitReload -> RenderSprites + WithUnitBody + WithAttackAnimation

Use WithAttackAnimation for RA V2 launcher
Remove RenderUnitReload
This commit is contained in:
reaperrr
2015-05-11 02:16:37 +02:00
parent b21ca9b7e7
commit 4d79cce491
6 changed files with 102 additions and 57 deletions

View File

@@ -1045,6 +1045,27 @@ namespace OpenRA.Mods.Common.UtilityCommands
if (rru != null)
rru.Key = "-WithFacingSpriteBody";
}
// For RenderUnitReload
var rur = node.Value.Nodes.Where(x => x.Key == "RenderUnitReload");
if (rur.Any())
{
rur.Do(x => x.Key = "RenderSprites");
node.Value.Nodes.Add(new MiniYamlNode("AutoSelectionSize", ""));
node.Value.Nodes.Add(new MiniYamlNode("WithFacingSpriteBody", "", new List<MiniYamlNode>
{
new MiniYamlNode("Sequence", "idle")
}));
node.Value.Nodes.Add(new MiniYamlNode("WithAttackAnimation", "", new List<MiniYamlNode>
{
new MiniYamlNode("AimSequence", "aim"),
new MiniYamlNode("ReloadPrefix", "empty-")
}));
var rrur = node.Value.Nodes.FirstOrDefault(n => n.Key == "-RenderUnitReload");
if (rrur != null)
rrur.Key = "-WithFacingSpriteBody";
}
}
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);