diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 2e23c7453a..87cd0e5a92 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -1404,28 +1404,29 @@ namespace OpenRA.Mods.Common.UtilityCommands { // Common code for making each trait Action addTrait = (type, newType, values) => - { - var upgradeTypes = trait.Value.Nodes.FirstOrDefault(n => n.Key == type + "Upgrade"); - var modifier = trait.Value.Nodes.FirstOrDefault(n => n.Key == type + "Modifier"); - - if (upgradeTypes == null || !string.IsNullOrEmpty(upgradeTypes.Value.Value) || modifier == null || !string.IsNullOrEmpty(modifier.Value.Value)) { - var yaml = new MiniYaml(null); - if (modifier == null) - modifier = new MiniYamlNode("Modifier", new MiniYaml(values)); - else - modifier.Key = "Modifier"; - yaml.Nodes.Add(modifier); + var upgradeTypes = trait.Value.Nodes.FirstOrDefault(n => n.Key == type + "Upgrade"); + var modifier = trait.Value.Nodes.FirstOrDefault(n => n.Key == type + "Modifier"); - if (upgradeTypes == null) - upgradeTypes = new MiniYamlNode("UpgradeTypes", new MiniYaml(type.ToLowerInvariant())); - else - upgradeTypes.Key = "UpgradeTypes"; - yaml.Nodes.Add(upgradeTypes); + if (upgradeTypes == null || !string.IsNullOrEmpty(upgradeTypes.Value.Value) || modifier == null || + !string.IsNullOrEmpty(modifier.Value.Value)) + { + var yaml = new MiniYaml(null); + if (modifier == null) + modifier = new MiniYamlNode("Modifier", new MiniYaml(values)); + else + modifier.Key = "Modifier"; + yaml.Nodes.Add(modifier); - node.Value.Nodes.Add(new MiniYamlNode((newType ?? type) + "Multiplier@EXPERIENCE", yaml)); - } - }; + if (upgradeTypes == null) + upgradeTypes = new MiniYamlNode("UpgradeTypes", new MiniYaml(type.ToLowerInvariant())); + else + upgradeTypes.Key = "UpgradeTypes"; + yaml.Nodes.Add(upgradeTypes); + + node.Value.Nodes.Add(new MiniYamlNode((newType ?? type) + "Multiplier@EXPERIENCE", yaml)); + } + }; // Execute common code for each trait addTrait("Firepower", null, "110, 115, 120, 130"); @@ -1505,6 +1506,24 @@ namespace OpenRA.Mods.Common.UtilityCommands } } + // Rename the `Country` trait to `Faction` + if (engineVersion < 20150714) + { + var split = node.Key.Split('@'); + if (split.Any() && split[0] == "Country") + { + node.Key = node.Key.Replace("Country", "Faction"); + + var race = node.Value.Nodes.FirstOrDefault(x => x.Key == "Race"); + if (race != null) + race.Key = "InternalName"; + + var randomRace = node.Value.Nodes.FirstOrDefault(x => x.Key == "RandomRaceMembers"); + if (randomRace != null) + randomRace.Key = "RandomFactionMembers"; + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/mods/cnc/rules/world.yaml b/mods/cnc/rules/world.yaml index 3cd793916c..caf99c322b 100644 --- a/mods/cnc/rules/world.yaml +++ b/mods/cnc/rules/world.yaml @@ -12,18 +12,18 @@ FogVariants: typea, typeb, typec, typed OverrideFullShroud: full OverrideFullFog: full - Country@Random: + Faction@Random: Name: Any - Race: Random - RandomRaceMembers: gdi, nod + InternalName: Random + RandomFactionMembers: gdi, nod Description: Select a random faction. - Country@gdi: + Faction@gdi: Name: GDI - Race: gdi + InternalName: gdi Description: Global Defense Initiative\nThe GDI is an international military branch of the United Nations tasked\nwith keeping world peace. Commanding the combined forces of the world's\nmost powerful nations, they possess an unmatched arsenal of high-tech weaponry. - Country@nod: + Faction@nod: Name: Nod - Race: nod + InternalName: nod Description: Brotherhood of Nod\nThe Brotherhood is a religious cult centered around their leader Kane\nand the alien substance Tiberium. They utilize stealth technology\nand guerilla tactics to defeat those who oppose them. ResourceType@green-tib: ResourceType: 1 diff --git a/mods/d2k/rules/world.yaml b/mods/d2k/rules/world.yaml index 443a8b2e56..e1c7c8bc61 100644 --- a/mods/d2k/rules/world.yaml +++ b/mods/d2k/rules/world.yaml @@ -14,26 +14,26 @@ OverrideFullShroud: full OverrideFullFog: full ShroudBlend: Multiply - Country@Random: + Faction@Random: Name: Any - Race: Random - RandomRaceMembers: atreides, harkonnen, ordos + InternalName: Random + RandomFactionMembers: atreides, harkonnen, ordos Description: Select a random House. - Country@Atreides: + Faction@Atreides: Name: Atreides - Race: atreides + InternalName: atreides Description: House Atreides\nThe noble Atreides, from the water world of Caladan,\nrely on their ornithopters to ensure air superiority.\nThey have allied themselves with the Fremen, the fearsome\nnative warriors of Dune that can move undetected in battle. - Country@Harkonnen: + Faction@Harkonnen: Name: Harkonnen - Race: harkonnen + InternalName: harkonnen Description: House Harkonnen\nThe evil Harkonnen will stop at nothing to gain control of the spice.\nThey rely on brute force and atomic weapons to achieve their goals:\nwealth, and the destruction of House Atreides. - Country@Ordos: + Faction@Ordos: Name: Ordos - Race: ordos + InternalName: ordos Description: House Ordos\nThe insidious Ordos of the icy planet Sigma Draconis IV\nare known for their wealth, greed and treachery.\nRelying heavily on mercenaries they often resort\nto sabotage and forbidden Ixian technologies. - Country@Corrino: + Faction@Corrino: Name: Corrino - Race: corrino + InternalName: corrino Selectable: false ResourceType@Spice: ResourceType: 1 diff --git a/mods/ra/rules/world.yaml b/mods/ra/rules/world.yaml index d359a4326f..d71a0f176e 100644 --- a/mods/ra/rules/world.yaml +++ b/mods/ra/rules/world.yaml @@ -12,57 +12,57 @@ FogVariants: shroud Index: 255, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 20, 40, 56, 65, 97, 130, 148, 194, 24, 33, 66, 132, 28, 41, 67, 134, 1, 2, 4, 8, 3, 6, 12, 9, 7, 14, 13, 11, 5, 10, 15, 255 UseExtendedIndex: true - Country@0: + Faction@0: Name: Allies - Race: allies + InternalName: allies Side: Allies Selectable: False - Country@1: + Faction@1: Name: England - Race: england + InternalName: england Side: Allies Description: England: Espionage\nSpecial Unit: British Spy\nSpecial Unit: Phase Transport - Country@2: + Faction@2: Name: France - Race: france + InternalName: france Side: Allies Description: France: Deception\nSpecial Ability: Can build fake structures\nSpecial Unit: Mobile Gap Generator - Country@3: + Faction@3: Name: Germany - Race: germany + InternalName: germany Side: Allies Description: Germany: Technology\nSpecial Ability: Advanced Chronoshift\nSpecial Unit: Chrono Tank - Country@4: + Faction@4: Name: Soviet - Race: soviet + InternalName: soviet Side: Soviet Selectable: False - Country@5: + Faction@5: Name: Russia - Race: russia + InternalName: russia Side: Soviet Description: Russia: Tesla Weapons\nSpecial Unit: Tesla Tank\nSpecial Unit: Shock Trooper - Country@6: + Faction@6: Name: Ukraine - Race: ukraine + InternalName: ukraine Side: Soviet Description: Ukraine: Demolitions\nSpecial Ability: Parabombs\nSpecial Unit: Demolition Truck - Country@random: + Faction@random: Name: Any - Race: Random - RandomRaceMembers: RandomAllies, RandomSoviet + InternalName: Random + RandomFactionMembers: RandomAllies, RandomSoviet Side: Random Description: A random country. - Country@randomallies: + Faction@randomallies: Name: Allies - Race: RandomAllies - RandomRaceMembers: england, france, germany + InternalName: RandomAllies + RandomFactionMembers: england, france, germany Side: Random Description: A random Allied country. - Country@randomsoviet: + Faction@randomsoviet: Name: Soviet - Race: RandomSoviet - RandomRaceMembers: russia, ukraine + InternalName: RandomSoviet + RandomFactionMembers: russia, ukraine Side: Random Description: A random Soviet country. ResourceType@ore: diff --git a/mods/ts/rules/world.yaml b/mods/ts/rules/world.yaml index 60747a2f31..952b6fd8ff 100644 --- a/mods/ts/rules/world.yaml +++ b/mods/ts/rules/world.yaml @@ -12,16 +12,16 @@ UseExtendedIndex: true ShroudPalette: shroud FogPalette: shroud - Country@Random: + Faction@Random: Name: Any - Race: Random - RandomRaceMembers: gdi, nod - Country@0: + InternalName: Random + RandomFactionMembers: gdi, nod + Faction@0: Name: GDI - Race: gdi - Country@1: + InternalName: gdi + Faction@1: Name: Nod - Race: nod + InternalName: nod ResourceType@Tiberium: ResourceType: 1 Palette: greentiberium