Merge pull request #9038 from penev92/bleed_rename

Some more renaming from "race" to "faction"
This commit is contained in:
Matthias Mailänder
2015-08-13 21:13:31 +02:00
11 changed files with 79 additions and 55 deletions

View File

@@ -24,9 +24,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Be sure to use lowercase. Default value is \"e1\".")] [Desc("Be sure to use lowercase. Default value is \"e1\".")]
public readonly string[] ActorTypes = { "e1" }; public readonly string[] ActorTypes = { "e1" };
[Desc("Spawns actors only if the selling player's race is in this list." + [Desc("Spawns actors only if the selling player's faction is in this list." +
"Leave empty to allow all races by default.")] "Leave empty to allow all factions by default.")]
public readonly string[] Races = { }; public readonly string[] Factions = { };
public object Create(ActorInitializer init) { return new EmitInfantryOnSell(init.Self, this); } public object Create(ActorInitializer init) { return new EmitInfantryOnSell(init.Self, this); }
} }
@@ -34,20 +34,20 @@ namespace OpenRA.Mods.Common.Traits
public class EmitInfantryOnSell : INotifySold public class EmitInfantryOnSell : INotifySold
{ {
readonly EmitInfantryOnSellInfo info; readonly EmitInfantryOnSellInfo info;
readonly bool correctRace = false; readonly bool correctFaction;
public EmitInfantryOnSell(Actor self, EmitInfantryOnSellInfo info) public EmitInfantryOnSell(Actor self, EmitInfantryOnSellInfo info)
{ {
this.info = info; this.info = info;
var raceList = info.Races; var factionsList = info.Factions;
correctRace = raceList.Length == 0 || raceList.Contains(self.Owner.Faction.InternalName); correctFaction = factionsList.Length == 0 || factionsList.Contains(self.Owner.Faction.InternalName);
} }
public void Selling(Actor self) { } public void Selling(Actor self) { }
void Emit(Actor self) void Emit(Actor self)
{ {
if (!correctRace) if (!correctFaction)
return; return;
var csv = self.Info.Traits.GetOrDefault<CustomSellValueInfo>(); var csv = self.Info.Traits.GetOrDefault<CustomSellValueInfo>();

View File

@@ -27,8 +27,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Group queues from separate buildings together into the same tab.")] [Desc("Group queues from separate buildings together into the same tab.")]
public readonly string Group = null; public readonly string Group = null;
[Desc("Only enable this queue for certain factions")] [Desc("Only enable this queue for certain factions.")]
public readonly string[] Race = { }; public readonly string[] Factions = { };
[Desc("Should the prerequisite remain enabled if the owner changes?")] [Desc("Should the prerequisite remain enabled if the owner changes?")]
public readonly bool Sticky = true; 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 CurrentDone { get { return QueueLength != 0 && queue[0].Done; } }
[Sync] public bool Enabled { get; private set; } [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) public ProductionQueue(ActorInitializer init, Actor playerActor, ProductionQueueInfo info)
{ {
@@ -97,8 +97,8 @@ namespace OpenRA.Mods.Common.Traits
playerPower = playerActor.Trait<PowerManager>(); playerPower = playerActor.Trait<PowerManager>();
developerMode = playerActor.Trait<DeveloperMode>(); developerMode = playerActor.Trait<DeveloperMode>();
Race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName; Faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
Enabled = !info.Race.Any() || info.Race.Contains(Race); Enabled = !info.Factions.Any() || info.Factions.Contains(Faction);
CacheProduceables(playerActor); CacheProduceables(playerActor);
} }
@@ -123,8 +123,8 @@ namespace OpenRA.Mods.Common.Traits
if (!Info.Sticky) if (!Info.Sticky)
{ {
Race = self.Owner.Faction.InternalName; Faction = self.Owner.Faction.InternalName;
Enabled = !Info.Race.Any() || Info.Race.Contains(Race); Enabled = !Info.Factions.Any() || Info.Factions.Contains(Faction);
} }
// Regenerate the produceables and tech tree state // Regenerate the produceables and tech tree state
@@ -371,7 +371,7 @@ namespace OpenRA.Mods.Common.Traits
} }
var sp = self.TraitsImplementing<Production>().FirstOrDefault(p => p.Info.Produces.Contains(Info.Type)); var sp = self.TraitsImplementing<Production>().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(); FinishProduction();
return true; return true;

View File

@@ -21,8 +21,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Exposed via the UI to the player.")] [Desc("Exposed via the UI to the player.")]
public readonly string ClassName = "Unlabeled"; public readonly string ClassName = "Unlabeled";
[Desc("Only available when selecting this faction.", "Leave empty for no restrictions.")] [Desc("Only available when selecting one of these factions.", "Leave empty for no restrictions.")]
public readonly string[] Races = { }; public readonly string[] Factions = { };
[Desc("The mobile construction vehicle.")] [Desc("The mobile construction vehicle.")]
public readonly string BaseActor = null; public readonly string BaseActor = null;

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
{ {
var spawnClass = p.PlayerReference.StartingUnitsClass ?? w.LobbyInfo.GlobalSettings.StartingUnitsClass; var spawnClass = p.PlayerReference.StartingUnitsClass ?? w.LobbyInfo.GlobalSettings.StartingUnitsClass;
var unitGroup = w.Map.Rules.Actors["world"].Traits.WithInterface<MPStartUnitsInfo>() var unitGroup = w.Map.Rules.Actors["world"].Traits.WithInterface<MPStartUnitsInfo>()
.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); .RandomOrDefault(w.SharedRandom);
if (unitGroup == null) if (unitGroup == null)

View File

@@ -1736,6 +1736,30 @@ namespace OpenRA.Mods.Common.UtilityCommands
node.Key = "Offset"; 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); UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
} }
} }

View File

@@ -23,7 +23,7 @@ FACT:
Facing: 108 Facing: 108
ProductionQueue@GDIBuilding: ProductionQueue@GDIBuilding:
Type: Building.GDI Type: Building.GDI
Race: gdi Factions: gdi
Group: Building Group: Building
BuildSpeed: .4 BuildSpeed: .4
LowPowerSlowdown: 2 LowPowerSlowdown: 2
@@ -31,7 +31,7 @@ FACT:
ReadyAudio: ConstructionComplete ReadyAudio: ConstructionComplete
ProductionQueue@NodBuilding: ProductionQueue@NodBuilding:
Type: Building.Nod Type: Building.Nod
Race: nod Factions: nod
Group: Building Group: Building
BuildSpeed: .4 BuildSpeed: .4
LowPowerSlowdown: 2 LowPowerSlowdown: 2
@@ -39,7 +39,7 @@ FACT:
ReadyAudio: ConstructionComplete ReadyAudio: ConstructionComplete
ProductionQueue@GDIDefense: ProductionQueue@GDIDefense:
Type: Defence.GDI Type: Defence.GDI
Race: gdi Factions: gdi
Group: Defence Group: Defence
BuildSpeed: .4 BuildSpeed: .4
LowPowerSlowdown: 3 LowPowerSlowdown: 3
@@ -47,7 +47,7 @@ FACT:
ReadyAudio: ConstructionComplete ReadyAudio: ConstructionComplete
ProductionQueue@NodDefense: ProductionQueue@NodDefense:
Type: Defence.Nod Type: Defence.Nod
Race: nod Factions: nod
Group: Defence Group: Defence
BuildSpeed: .4 BuildSpeed: .4
LowPowerSlowdown: 3 LowPowerSlowdown: 3
@@ -420,13 +420,13 @@ HPAD:
RallyPoint: RallyPoint:
ProductionQueue@GDI: ProductionQueue@GDI:
Type: Aircraft.GDI Type: Aircraft.GDI
Race: gdi Factions: gdi
Group: Aircraft Group: Aircraft
BuildSpeed: .4 BuildSpeed: .4
LowPowerSlowdown: 3 LowPowerSlowdown: 3
ProductionQueue@Nod: ProductionQueue@Nod:
Type: Aircraft.Nod Type: Aircraft.Nod
Race: nod Factions: nod
Group: Aircraft Group: Aircraft
BuildSpeed: .4 BuildSpeed: .4
LowPowerSlowdown: 3 LowPowerSlowdown: 3

View File

@@ -79,60 +79,60 @@ World:
MPStartUnits@mcvonly: MPStartUnits@mcvonly:
Class: none Class: none
ClassName: MCV Only ClassName: MCV Only
Races: gdi, nod Factions: gdi, nod
BaseActor: mcv BaseActor: mcv
MPStartUnits@defaultgdia: MPStartUnits@defaultgdia:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: gdi Factions: gdi
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e1,e1,e3,e3,jeep SupportActors: e1,e1,e1,e1,e1,e3,e3,jeep
MPStartUnits@defaultgdib: MPStartUnits@defaultgdib:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: gdi Factions: gdi
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e1,e1,e1,e3,apc SupportActors: e1,e1,e1,e1,e1,e1,e3,apc
MPStartUnits@defaultnoda: MPStartUnits@defaultnoda:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: nod Factions: nod
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e1,e3,bggy,bike SupportActors: e1,e1,e1,e1,e3,bggy,bike
MPStartUnits@defaultnodb: MPStartUnits@defaultnodb:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: nod Factions: nod
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e3,e3,e3,bggy SupportActors: e1,e1,e1,e3,e3,e3,bggy
MPStartUnits@defaultnodc: MPStartUnits@defaultnodc:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: nod Factions: nod
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e1,e1,e1,e1,e3,bike SupportActors: e1,e1,e1,e1,e1,e1,e1,e3,bike
MPStartUnits@heavynoda: MPStartUnits@heavynoda:
Class: heavy Class: heavy
ClassName: Heavy Support ClassName: Heavy Support
Races: nod Factions: nod
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e1,e3,e3,ltnk,ltnk,ftnk SupportActors: e1,e1,e1,e1,e3,e3,ltnk,ltnk,ftnk
MPStartUnits@heavynodb: MPStartUnits@heavynodb:
Class: heavy Class: heavy
ClassName: Heavy Support ClassName: Heavy Support
Races: nod Factions: nod
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e1,e1,e3,e3,e3,ftnk,ftnk SupportActors: e1,e1,e1,e1,e1,e3,e3,e3,ftnk,ftnk
MPStartUnits@heavygdia: MPStartUnits@heavygdia:
Class: heavy Class: heavy
ClassName: Heavy Support ClassName: Heavy Support
Races: gdi Factions: gdi
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e1,e3,e3,jeep,mtnk,mtnk SupportActors: e1,e1,e1,e1,e3,e3,jeep,mtnk,mtnk
MPStartUnits@heavygdib: MPStartUnits@heavygdib:
Class: heavy Class: heavy
ClassName: Heavy Support ClassName: Heavy Support
Races: gdi Factions: gdi
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e1,e1,e2,e2,e2,e3,e3,apc,mtnk SupportActors: e1,e1,e1,e1,e1,e2,e2,e2,e3,e3,apc,mtnk
SpawnMPUnits: SpawnMPUnits:

View File

@@ -85,11 +85,11 @@ World:
Class: none Class: none
ClassName: MCV Only ClassName: MCV Only
BaseActor: mcv BaseActor: mcv
Races: atreides, ordos, harkonnen Factions: atreides, ordos, harkonnen
MPStartUnits@lightatreides: MPStartUnits@lightatreides:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: atreides Factions: atreides
BaseActor: mcv BaseActor: mcv
SupportActors: rifle, rifle, rifle, bazooka, grenadier, trike, quad SupportActors: rifle, rifle, rifle, bazooka, grenadier, trike, quad
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -97,7 +97,7 @@ World:
MPStartUnits@lightharkonnen: MPStartUnits@lightharkonnen:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: harkonnen Factions: harkonnen
BaseActor: mcv BaseActor: mcv
SupportActors: rifle, rifle, rifle, bazooka, bazooka, trike, quad SupportActors: rifle, rifle, rifle, bazooka, bazooka, trike, quad
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -105,7 +105,7 @@ World:
MPStartUnits@lightordos: MPStartUnits@lightordos:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: ordos Factions: ordos
BaseActor: mcv BaseActor: mcv
SupportActors: rifle, rifle, rifle, bazooka, engineer, raider, quad SupportActors: rifle, rifle, rifle, bazooka, engineer, raider, quad
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -113,7 +113,7 @@ World:
MPStartUnits@heavyatreides: MPStartUnits@heavyatreides:
Class: heavy Class: heavy
ClassName: Heavy Support ClassName: Heavy Support
Races: atreides Factions: atreides
BaseActor: mcv BaseActor: mcv
SupportActors: rifle, rifle, rifle, bazooka, grenadier, trike, combata, missiletank SupportActors: rifle, rifle, rifle, bazooka, grenadier, trike, combata, missiletank
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -121,7 +121,7 @@ World:
MPStartUnits@heavyharkonnen: MPStartUnits@heavyharkonnen:
Class: heavy Class: heavy
ClassName: Heavy Support ClassName: Heavy Support
Races: harkonnen Factions: harkonnen
BaseActor: mcv BaseActor: mcv
SupportActors: rifle, rifle, rifle, bazooka, engineer, quad, combath, siegetank SupportActors: rifle, rifle, rifle, bazooka, engineer, quad, combath, siegetank
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -129,7 +129,7 @@ World:
MPStartUnits@heavyordos: MPStartUnits@heavyordos:
Class: heavy Class: heavy
ClassName: Heavy Support ClassName: Heavy Support
Races: ordos Factions: ordos
BaseActor: mcv BaseActor: mcv
SupportActors: rifle, rifle, rifle, bazooka, engineer, raider, combato, missiletank SupportActors: rifle, rifle, rifle, bazooka, engineer, raider, combato, missiletank
InnerSupportRadius: 3 InnerSupportRadius: 3

View File

@@ -123,12 +123,12 @@ World:
MPStartUnits@mcvonly: MPStartUnits@mcvonly:
Class: none Class: none
ClassName: MCV Only ClassName: MCV Only
Races: allies, england, france, germany, soviet, russia, ukraine Factions: allies, england, france, germany, soviet, russia, ukraine
BaseActor: mcv BaseActor: mcv
MPStartUnits@lightallies: MPStartUnits@lightallies:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: allies, england, france, germany Factions: allies, england, france, germany
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e3,e3,jeep,1tnk SupportActors: e1,e1,e1,e3,e3,jeep,1tnk
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -136,7 +136,7 @@ World:
MPStartUnits@lightsoviet: MPStartUnits@lightsoviet:
Class: light Class: light
ClassName: Light Support ClassName: Light Support
Races: soviet, russia, ukraine Factions: soviet, russia, ukraine
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e3,e3,apc,ftrk SupportActors: e1,e1,e1,e3,e3,apc,ftrk
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -144,7 +144,7 @@ World:
MPStartUnits@heavyallies: MPStartUnits@heavyallies:
Class: heavy Class: heavy
ClassName: Heavy Support ClassName: Heavy Support
Races: allies, england, france, germany Factions: allies, england, france, germany
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e3,e3,jeep,1tnk,2tnk,2tnk,2tnk SupportActors: e1,e1,e1,e3,e3,jeep,1tnk,2tnk,2tnk,2tnk
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -152,7 +152,7 @@ World:
MPStartUnits@heavysoviet: MPStartUnits@heavysoviet:
Class: heavy Class: heavy
ClassName: Heavy Support ClassName: Heavy Support
Races: soviet, russia, ukraine Factions: soviet, russia, ukraine
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e3,e3,apc,ftrk,3tnk,3tnk SupportActors: e1,e1,e1,e3,e3,apc,ftrk,3tnk,3tnk
InnerSupportRadius: 3 InnerSupportRadius: 3

View File

@@ -88,10 +88,10 @@
UseDeathTypeSuffix: false UseDeathTypeSuffix: false
EmitInfantryOnSell@gdi: EmitInfantryOnSell@gdi:
ActorTypes: e1, e1, e2, medic ActorTypes: e1, e1, e2, medic
Races: gdi Factions: gdi
EmitInfantryOnSell@nod: EmitInfantryOnSell@nod:
ActorTypes: e1, e1, e1, e3, e3 ActorTypes: e1, e1, e1, e3, e3
Races: nod Factions: nod
MustBeDestroyed: MustBeDestroyed:
RequiredForShortGame: true RequiredForShortGame: true
CaptureNotification: CaptureNotification:

View File

@@ -102,12 +102,12 @@ World:
MPStartUnits@MCV: MPStartUnits@MCV:
Class: none Class: none
ClassName: MCV Only ClassName: MCV Only
Races: gdi, nod Factions: gdi, nod
BaseActor: mcv BaseActor: mcv
MPStartUnits@light.gdi: MPStartUnits@light.gdi:
Class: light Class: light
ClassName: Light ClassName: Light
Races: gdi Factions: gdi
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e2,e2 SupportActors: e1,e1,e1,e2,e2
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -115,7 +115,7 @@ World:
MPStartUnits@light.nod: MPStartUnits@light.nod:
Class: light Class: light
ClassName: Light ClassName: Light
Races: nod Factions: nod
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e1,e3,e3 SupportActors: e1,e1,e1,e3,e3
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -123,7 +123,7 @@ World:
MPStartUnits@med.gdi: MPStartUnits@med.gdi:
Class: medium Class: medium
ClassName: Medium ClassName: Medium
Races: gdi Factions: gdi
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e2,jumpjet,smech SupportActors: e1,e1,e2,jumpjet,smech
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -131,7 +131,7 @@ World:
MPStartUnits@med.nod: MPStartUnits@med.nod:
Class: medium Class: medium
ClassName: Medium ClassName: Medium
Races: nod Factions: nod
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e1,e3,cyborg,bggy SupportActors: e1,e1,e3,cyborg,bggy
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -139,7 +139,7 @@ World:
MPStartUnits@heavy.gdi: MPStartUnits@heavy.gdi:
Class: heavy Class: heavy
ClassName: Heavy ClassName: Heavy
Races: gdi Factions: gdi
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e2,e2,smech,mmch SupportActors: e1,e2,e2,smech,mmch
InnerSupportRadius: 3 InnerSupportRadius: 3
@@ -147,7 +147,7 @@ World:
MPStartUnits@heavy.nod: MPStartUnits@heavy.nod:
Class: heavy Class: heavy
ClassName: Heavy ClassName: Heavy
Races: nod Factions: nod
BaseActor: mcv BaseActor: mcv
SupportActors: e1,e3,bggy,bike,ttnk SupportActors: e1,e3,bggy,bike,ttnk
InnerSupportRadius: 3 InnerSupportRadius: 3