Add upgrade rules and update d2k.

This commit is contained in:
Paul Chote
2016-11-19 16:59:21 +00:00
parent 81113e07a6
commit 966fad7af3
2 changed files with 24 additions and 2 deletions

View File

@@ -477,6 +477,27 @@ namespace OpenRA.Mods.Common.UtilityCommands
} }
} }
if (engineVersion < 20161119)
{
// Migrated carryalls over to new conditions system
var carryableUpgradesNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "CarryableUpgrades");
if (carryableUpgradesNode != null)
{
var conditions = FieldLoader.GetValue<string[]>("", carryableUpgradesNode.Value.Value);
if (conditions.Length > 1)
Console.WriteLine("Unable to automatically migrate {0}:{1} CarryableUpgrades to CarriedCondition. This must be corrected manually",
parent.Key, node.Key);
else
carryableUpgradesNode.Key = "CarriedCondition";
}
if (node.Key == "WithDecorationCarryable")
{
node.Key = "WithDecoration@CARRYALL";
node.Value.Nodes.Add(new MiniYamlNode("RequiresCondition", "carryall-reserved"));
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
} }

View File

@@ -159,11 +159,12 @@
Voiced: Voiced:
VoiceSet: VehicleVoice VoiceSet: VehicleVoice
AutoCarryable: AutoCarryable:
CarryableUpgrades: notmobile CarriedCondition: notmobile
WithDecorationCarryable: WithDecoration@CARRYALL:
Image: pips Image: pips
Sequence: pickup-indicator Sequence: pickup-indicator
Offset: -12, -12 Offset: -12, -12
RequiresCondition: carryall-reserved
^Tank: ^Tank:
Inherits: ^Vehicle Inherits: ^Vehicle