From 966fad7af35dbec79f9324040f73cd021e2bb627 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 19 Nov 2016 16:59:21 +0000 Subject: [PATCH] Add upgrade rules and update d2k. --- .../UtilityCommands/UpgradeRules.cs | 21 +++++++++++++++++++ mods/d2k/rules/defaults.yaml | 5 +++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 636f2c55ba..7718eca762 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -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("", 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); } diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index 368100b356..dcdaceff41 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -159,11 +159,12 @@ Voiced: VoiceSet: VehicleVoice AutoCarryable: - CarryableUpgrades: notmobile - WithDecorationCarryable: + CarriedCondition: notmobile + WithDecoration@CARRYALL: Image: pips Sequence: pickup-indicator Offset: -12, -12 + RequiresCondition: carryall-reserved ^Tank: Inherits: ^Vehicle