Refactor SpiceBloom

- Remove SpiceBloom.RespawnDelay

It is basically redundant (giving the spice bloom spawner a longer
self-kill delay at yaml level has the same effect) and uses the savegame-blocking DelayedAction, so just removing it is the cleanest solution.

- Rename SpiceBloom GrowthDelay to Lifetime

- Refactor spicebloom.spawnpoint to not use SpiceBloom trait and make it visible in editor with corresponding tooltip.
This commit is contained in:
reaperrr
2016-11-04 23:48:13 +01:00
parent 0a53a2022e
commit 76f8fe02e2
3 changed files with 49 additions and 30 deletions

View File

@@ -781,6 +781,26 @@ namespace OpenRA.Mods.Common.UtilityCommands
if (node.Key.StartsWith("UpgradeOverlay", StringComparison.Ordinal))
RenameNodeKey(node, "WithColoredOverlay" + node.Key.Substring(14));
// Remove SpiceBloom.RespawnDelay to get rid of DelayedAction, and rename GrowthDelay to Lifetime
if (engineVersion < 20170203)
{
var spiceBloom = node.Value.Nodes.FirstOrDefault(n => n.Key == "SpiceBloom");
if (spiceBloom != null)
{
var respawnDelay = spiceBloom.Value.Nodes.FirstOrDefault(n => n.Key == "RespawnDelay");
if (respawnDelay != null)
{
spiceBloom.Value.Nodes.Remove(respawnDelay);
Console.WriteLine("RespawnDelay has been removed from SpiceBloom for technical reasons.");
Console.WriteLine("Increase self-kill delay of the spice bloom spawnpoint actor instead.");
}
var growthDelay = spiceBloom.Value.Nodes.FirstOrDefault(n => n.Key == "GrowthDelay");
if (growthDelay != null)
growthDelay.Key = "Lifetime";
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
}