diff --git a/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs b/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs index 688e6d03d4..4045d40cd5 100644 --- a/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs +++ b/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs @@ -24,9 +24,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Be sure to use lowercase. Default value is \"e1\".")] public readonly string[] ActorTypes = { "e1" }; - [Desc("Spawns actors only if the selling player's race is in this list." + - "Leave empty to allow all races by default.")] - public readonly string[] Races = { }; + [Desc("Spawns actors only if the selling player's faction is in this list." + + "Leave empty to allow all factions by default.")] + public readonly string[] Factions = { }; public object Create(ActorInitializer init) { return new EmitInfantryOnSell(init.Self, this); } } @@ -34,20 +34,20 @@ namespace OpenRA.Mods.Common.Traits public class EmitInfantryOnSell : INotifySold { readonly EmitInfantryOnSellInfo info; - readonly bool correctRace = false; + readonly bool correctFaction; public EmitInfantryOnSell(Actor self, EmitInfantryOnSellInfo info) { this.info = info; - var raceList = info.Races; - correctRace = raceList.Length == 0 || raceList.Contains(self.Owner.Faction.InternalName); + var factionsList = info.Factions; + correctFaction = factionsList.Length == 0 || factionsList.Contains(self.Owner.Faction.InternalName); } public void Selling(Actor self) { } void Emit(Actor self) { - if (!correctRace) + if (!correctFaction) return; var csv = self.Info.Traits.GetOrDefault(); diff --git a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs index b688cabee2..1b34ee0779 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs @@ -27,8 +27,8 @@ namespace OpenRA.Mods.Common.Traits [Desc("Group queues from separate buildings together into the same tab.")] public readonly string Group = null; - [Desc("Only enable this queue for certain factions")] - public readonly string[] Race = { }; + [Desc("Only enable this queue for certain factions.")] + public readonly string[] Factions = { }; [Desc("Should the prerequisite remain enabled if the owner changes?")] public readonly bool Sticky = true; @@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Traits [Sync] public bool CurrentDone { get { return QueueLength != 0 && queue[0].Done; } } [Sync] public bool Enabled { get; private set; } - public string Race { get; private set; } + public string Faction { get; private set; } public ProductionQueue(ActorInitializer init, Actor playerActor, ProductionQueueInfo info) { @@ -97,8 +97,8 @@ namespace OpenRA.Mods.Common.Traits playerPower = playerActor.Trait(); developerMode = playerActor.Trait(); - Race = init.Contains() ? init.Get() : self.Owner.Faction.InternalName; - Enabled = !info.Race.Any() || info.Race.Contains(Race); + Faction = init.Contains() ? init.Get() : self.Owner.Faction.InternalName; + Enabled = !info.Factions.Any() || info.Factions.Contains(Faction); CacheProduceables(playerActor); } @@ -123,8 +123,8 @@ namespace OpenRA.Mods.Common.Traits if (!Info.Sticky) { - Race = self.Owner.Faction.InternalName; - Enabled = !Info.Race.Any() || Info.Race.Contains(Race); + Faction = self.Owner.Faction.InternalName; + Enabled = !Info.Factions.Any() || Info.Factions.Contains(Faction); } // Regenerate the produceables and tech tree state @@ -371,7 +371,7 @@ namespace OpenRA.Mods.Common.Traits } var sp = self.TraitsImplementing().FirstOrDefault(p => p.Info.Produces.Contains(Info.Type)); - if (sp != null && !self.IsDisabled() && sp.Produce(self, self.World.Map.Rules.Actors[name], Race)) + if (sp != null && !self.IsDisabled() && sp.Produce(self, self.World.Map.Rules.Actors[name], Faction)) { FinishProduction(); return true; diff --git a/OpenRA.Mods.Common/Traits/World/MPStartUnits.cs b/OpenRA.Mods.Common/Traits/World/MPStartUnits.cs index 313746046d..25610ed0c6 100644 --- a/OpenRA.Mods.Common/Traits/World/MPStartUnits.cs +++ b/OpenRA.Mods.Common/Traits/World/MPStartUnits.cs @@ -21,8 +21,8 @@ namespace OpenRA.Mods.Common.Traits [Desc("Exposed via the UI to the player.")] public readonly string ClassName = "Unlabeled"; - [Desc("Only available when selecting this faction.", "Leave empty for no restrictions.")] - public readonly string[] Races = { }; + [Desc("Only available when selecting one of these factions.", "Leave empty for no restrictions.")] + public readonly string[] Factions = { }; [Desc("The mobile construction vehicle.")] public readonly string BaseActor = null; diff --git a/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs b/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs index 341c46a912..3c0c0daa5d 100644 --- a/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs +++ b/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits { var spawnClass = p.PlayerReference.StartingUnitsClass ?? w.LobbyInfo.GlobalSettings.StartingUnitsClass; var unitGroup = w.Map.Rules.Actors["world"].Traits.WithInterface() - .Where(g => g.Class == spawnClass && g.Races != null && g.Races.Contains(p.Faction.InternalName)) + .Where(g => g.Class == spawnClass && g.Factions != null && g.Factions.Contains(p.Faction.InternalName)) .RandomOrDefault(w.SharedRandom); if (unitGroup == null) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 249c854709..e07144ac3e 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -1736,6 +1736,30 @@ namespace OpenRA.Mods.Common.UtilityCommands node.Key = "Offset"; } + if (engineVersion < 20150811) + { + if (node.Key.StartsWith("ProductionQueue")) + { + var race = node.Value.Nodes.FirstOrDefault(x => x.Key == "Race"); + if (race != null) + race.Key = "Factions"; + } + + if (node.Key.StartsWith("EmitInfantryOnSell")) + { + var race = node.Value.Nodes.FirstOrDefault(x => x.Key == "Races"); + if (race != null) + race.Key = "Factions"; + } + + if (node.Key.StartsWith("MPStartUnits")) + { + var race = node.Value.Nodes.FirstOrDefault(x => x.Key == "Races"); + if (race != null) + race.Key = "Factions"; + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index 21753d330a..4d92ad6cc0 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -23,7 +23,7 @@ FACT: Facing: 108 ProductionQueue@GDIBuilding: Type: Building.GDI - Race: gdi + Factions: gdi Group: Building BuildSpeed: .4 LowPowerSlowdown: 2 @@ -31,7 +31,7 @@ FACT: ReadyAudio: ConstructionComplete ProductionQueue@NodBuilding: Type: Building.Nod - Race: nod + Factions: nod Group: Building BuildSpeed: .4 LowPowerSlowdown: 2 @@ -39,7 +39,7 @@ FACT: ReadyAudio: ConstructionComplete ProductionQueue@GDIDefense: Type: Defence.GDI - Race: gdi + Factions: gdi Group: Defence BuildSpeed: .4 LowPowerSlowdown: 3 @@ -47,7 +47,7 @@ FACT: ReadyAudio: ConstructionComplete ProductionQueue@NodDefense: Type: Defence.Nod - Race: nod + Factions: nod Group: Defence BuildSpeed: .4 LowPowerSlowdown: 3 @@ -420,13 +420,13 @@ HPAD: RallyPoint: ProductionQueue@GDI: Type: Aircraft.GDI - Race: gdi + Factions: gdi Group: Aircraft BuildSpeed: .4 LowPowerSlowdown: 3 ProductionQueue@Nod: Type: Aircraft.Nod - Race: nod + Factions: nod Group: Aircraft BuildSpeed: .4 LowPowerSlowdown: 3 diff --git a/mods/cnc/rules/world.yaml b/mods/cnc/rules/world.yaml index caf99c322b..f9a8019633 100644 --- a/mods/cnc/rules/world.yaml +++ b/mods/cnc/rules/world.yaml @@ -79,60 +79,60 @@ World: MPStartUnits@mcvonly: Class: none ClassName: MCV Only - Races: gdi, nod + Factions: gdi, nod BaseActor: mcv MPStartUnits@defaultgdia: Class: light ClassName: Light Support - Races: gdi + Factions: gdi BaseActor: mcv SupportActors: e1,e1,e1,e1,e1,e3,e3,jeep MPStartUnits@defaultgdib: Class: light ClassName: Light Support - Races: gdi + Factions: gdi BaseActor: mcv SupportActors: e1,e1,e1,e1,e1,e1,e3,apc MPStartUnits@defaultnoda: Class: light ClassName: Light Support - Races: nod + Factions: nod BaseActor: mcv SupportActors: e1,e1,e1,e1,e3,bggy,bike MPStartUnits@defaultnodb: Class: light ClassName: Light Support - Races: nod + Factions: nod BaseActor: mcv SupportActors: e1,e1,e1,e3,e3,e3,bggy MPStartUnits@defaultnodc: Class: light ClassName: Light Support - Races: nod + Factions: nod BaseActor: mcv SupportActors: e1,e1,e1,e1,e1,e1,e1,e3,bike MPStartUnits@heavynoda: Class: heavy ClassName: Heavy Support - Races: nod + Factions: nod BaseActor: mcv SupportActors: e1,e1,e1,e1,e3,e3,ltnk,ltnk,ftnk MPStartUnits@heavynodb: Class: heavy ClassName: Heavy Support - Races: nod + Factions: nod BaseActor: mcv SupportActors: e1,e1,e1,e1,e1,e3,e3,e3,ftnk,ftnk MPStartUnits@heavygdia: Class: heavy ClassName: Heavy Support - Races: gdi + Factions: gdi BaseActor: mcv SupportActors: e1,e1,e1,e1,e3,e3,jeep,mtnk,mtnk MPStartUnits@heavygdib: Class: heavy ClassName: Heavy Support - Races: gdi + Factions: gdi BaseActor: mcv SupportActors: e1,e1,e1,e1,e1,e2,e2,e2,e3,e3,apc,mtnk SpawnMPUnits: diff --git a/mods/d2k/rules/world.yaml b/mods/d2k/rules/world.yaml index 8f6988cf1d..7608919683 100644 --- a/mods/d2k/rules/world.yaml +++ b/mods/d2k/rules/world.yaml @@ -85,11 +85,11 @@ World: Class: none ClassName: MCV Only BaseActor: mcv - Races: atreides, ordos, harkonnen + Factions: atreides, ordos, harkonnen MPStartUnits@lightatreides: Class: light ClassName: Light Support - Races: atreides + Factions: atreides BaseActor: mcv SupportActors: rifle, rifle, rifle, bazooka, grenadier, trike, quad InnerSupportRadius: 3 @@ -97,7 +97,7 @@ World: MPStartUnits@lightharkonnen: Class: light ClassName: Light Support - Races: harkonnen + Factions: harkonnen BaseActor: mcv SupportActors: rifle, rifle, rifle, bazooka, bazooka, trike, quad InnerSupportRadius: 3 @@ -105,7 +105,7 @@ World: MPStartUnits@lightordos: Class: light ClassName: Light Support - Races: ordos + Factions: ordos BaseActor: mcv SupportActors: rifle, rifle, rifle, bazooka, engineer, raider, quad InnerSupportRadius: 3 @@ -113,7 +113,7 @@ World: MPStartUnits@heavyatreides: Class: heavy ClassName: Heavy Support - Races: atreides + Factions: atreides BaseActor: mcv SupportActors: rifle, rifle, rifle, bazooka, grenadier, trike, combata, missiletank InnerSupportRadius: 3 @@ -121,7 +121,7 @@ World: MPStartUnits@heavyharkonnen: Class: heavy ClassName: Heavy Support - Races: harkonnen + Factions: harkonnen BaseActor: mcv SupportActors: rifle, rifle, rifle, bazooka, engineer, quad, combath, siegetank InnerSupportRadius: 3 @@ -129,7 +129,7 @@ World: MPStartUnits@heavyordos: Class: heavy ClassName: Heavy Support - Races: ordos + Factions: ordos BaseActor: mcv SupportActors: rifle, rifle, rifle, bazooka, engineer, raider, combato, missiletank InnerSupportRadius: 3 diff --git a/mods/ra/rules/world.yaml b/mods/ra/rules/world.yaml index d71a0f176e..a899109488 100644 --- a/mods/ra/rules/world.yaml +++ b/mods/ra/rules/world.yaml @@ -123,12 +123,12 @@ World: MPStartUnits@mcvonly: Class: none ClassName: MCV Only - Races: allies, england, france, germany, soviet, russia, ukraine + Factions: allies, england, france, germany, soviet, russia, ukraine BaseActor: mcv MPStartUnits@lightallies: Class: light ClassName: Light Support - Races: allies, england, france, germany + Factions: allies, england, france, germany BaseActor: mcv SupportActors: e1,e1,e1,e3,e3,jeep,1tnk InnerSupportRadius: 3 @@ -136,7 +136,7 @@ World: MPStartUnits@lightsoviet: Class: light ClassName: Light Support - Races: soviet, russia, ukraine + Factions: soviet, russia, ukraine BaseActor: mcv SupportActors: e1,e1,e1,e3,e3,apc,ftrk InnerSupportRadius: 3 @@ -144,7 +144,7 @@ World: MPStartUnits@heavyallies: Class: heavy ClassName: Heavy Support - Races: allies, england, france, germany + Factions: allies, england, france, germany BaseActor: mcv SupportActors: e1,e1,e1,e3,e3,jeep,1tnk,2tnk,2tnk,2tnk InnerSupportRadius: 3 @@ -152,7 +152,7 @@ World: MPStartUnits@heavysoviet: Class: heavy ClassName: Heavy Support - Races: soviet, russia, ukraine + Factions: soviet, russia, ukraine BaseActor: mcv SupportActors: e1,e1,e1,e3,e3,apc,ftrk,3tnk,3tnk InnerSupportRadius: 3 diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index 0c3fb643e4..3d79b978c3 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -88,10 +88,10 @@ UseDeathTypeSuffix: false EmitInfantryOnSell@gdi: ActorTypes: e1, e1, e2, medic - Races: gdi + Factions: gdi EmitInfantryOnSell@nod: ActorTypes: e1, e1, e1, e3, e3 - Races: nod + Factions: nod MustBeDestroyed: RequiredForShortGame: true CaptureNotification: diff --git a/mods/ts/rules/world.yaml b/mods/ts/rules/world.yaml index 952b6fd8ff..9a2dd718ed 100644 --- a/mods/ts/rules/world.yaml +++ b/mods/ts/rules/world.yaml @@ -102,12 +102,12 @@ World: MPStartUnits@MCV: Class: none ClassName: MCV Only - Races: gdi, nod + Factions: gdi, nod BaseActor: mcv MPStartUnits@light.gdi: Class: light ClassName: Light - Races: gdi + Factions: gdi BaseActor: mcv SupportActors: e1,e1,e1,e2,e2 InnerSupportRadius: 3 @@ -115,7 +115,7 @@ World: MPStartUnits@light.nod: Class: light ClassName: Light - Races: nod + Factions: nod BaseActor: mcv SupportActors: e1,e1,e1,e3,e3 InnerSupportRadius: 3 @@ -123,7 +123,7 @@ World: MPStartUnits@med.gdi: Class: medium ClassName: Medium - Races: gdi + Factions: gdi BaseActor: mcv SupportActors: e1,e1,e2,jumpjet,smech InnerSupportRadius: 3 @@ -131,7 +131,7 @@ World: MPStartUnits@med.nod: Class: medium ClassName: Medium - Races: nod + Factions: nod BaseActor: mcv SupportActors: e1,e1,e3,cyborg,bggy InnerSupportRadius: 3 @@ -139,7 +139,7 @@ World: MPStartUnits@heavy.gdi: Class: heavy ClassName: Heavy - Races: gdi + Factions: gdi BaseActor: mcv SupportActors: e1,e2,e2,smech,mmch InnerSupportRadius: 3 @@ -147,7 +147,7 @@ World: MPStartUnits@heavy.nod: Class: heavy ClassName: Heavy - Races: nod + Factions: nod BaseActor: mcv SupportActors: e1,e3,bggy,bike,ttnk InnerSupportRadius: 3