Rename PlayerReference.Race and LockRace to Faction and LockFaction
This commit is contained in:
@@ -37,7 +37,7 @@ namespace OpenRA
|
||||
"Neutral", new PlayerReference
|
||||
{
|
||||
Name = "Neutral",
|
||||
Race = firstRace,
|
||||
Faction = firstRace,
|
||||
OwnsWorld = true,
|
||||
NonCombatant = true
|
||||
}
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA
|
||||
"Creeps", new PlayerReference
|
||||
{
|
||||
Name = "Creeps",
|
||||
Race = firstRace,
|
||||
Faction = firstRace,
|
||||
NonCombatant = true,
|
||||
Enemies = Exts.MakeArray(playerCount, i => "Multi{0}".F(i))
|
||||
}
|
||||
@@ -58,7 +58,7 @@ namespace OpenRA
|
||||
var p = new PlayerReference
|
||||
{
|
||||
Name = "Multi{0}".F(index),
|
||||
Race = "Random",
|
||||
Faction = "Random",
|
||||
Playable = true,
|
||||
Enemies = new[] { "Creeps" }
|
||||
};
|
||||
|
||||
@@ -16,17 +16,17 @@ namespace OpenRA
|
||||
{
|
||||
public string Name;
|
||||
public string Palette;
|
||||
public bool OwnsWorld = false;
|
||||
public bool NonCombatant = false;
|
||||
public bool Playable = false;
|
||||
public bool Spectating = false;
|
||||
public string Bot = null;
|
||||
public string StartingUnitsClass = null;
|
||||
public bool AllowBots = true;
|
||||
public bool Playable = false;
|
||||
public bool Required = false;
|
||||
public bool OwnsWorld = false;
|
||||
public bool Spectating = false;
|
||||
public bool NonCombatant = false;
|
||||
|
||||
public bool LockRace = false;
|
||||
public string Race;
|
||||
public bool LockFaction = false;
|
||||
public string Faction;
|
||||
|
||||
// ColorRamp naming retained for backward compatibility
|
||||
public bool LockColor = false;
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace OpenRA
|
||||
Color = client.Color;
|
||||
PlayerName = client.Name;
|
||||
botType = client.Bot;
|
||||
Country = ChooseCountry(world, client.Race, !pr.LockRace);
|
||||
Country = ChooseCountry(world, client.Race, !pr.LockFaction);
|
||||
DisplayCountry = ChooseDisplayCountry(world, client.Race);
|
||||
}
|
||||
else
|
||||
@@ -108,8 +108,8 @@ namespace OpenRA
|
||||
Playable = pr.Playable;
|
||||
Spectating = pr.Spectating;
|
||||
botType = pr.Bot;
|
||||
Country = ChooseCountry(world, pr.Race, false);
|
||||
DisplayCountry = ChooseDisplayCountry(world, pr.Race);
|
||||
Country = ChooseCountry(world, pr.Faction, false);
|
||||
DisplayCountry = ChooseDisplayCountry(world, pr.Faction);
|
||||
}
|
||||
|
||||
PlayerActor = world.CreateActor("Player", new TypeDictionary { new OwnerInit(this) });
|
||||
|
||||
@@ -72,8 +72,8 @@ namespace OpenRA.Server
|
||||
if (pr == null)
|
||||
return;
|
||||
|
||||
if (pr.LockRace)
|
||||
c.Race = pr.Race;
|
||||
if (pr.LockFaction)
|
||||
c.Race = pr.Faction;
|
||||
if (pr.LockSpawn)
|
||||
c.SpawnPoint = pr.Spawn;
|
||||
if (pr.LockTeam)
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
td.Add(new FacingInit(facing));
|
||||
td.Add(new TurretFacingInit(facing));
|
||||
td.Add(new OwnerInit(owner.Name));
|
||||
td.Add(new RaceInit(owner.Race));
|
||||
td.Add(new RaceInit(owner.Faction));
|
||||
preview.SetPreview(actor, td);
|
||||
|
||||
var ios = actor.Traits.GetOrDefault<IOccupySpaceInfo>();
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace OpenRA.Mods.Common.Lint
|
||||
|
||||
var races = worldActor.Traits.WithInterface<CountryInfo>().Select(c => c.Race);
|
||||
foreach (var player in players.Values)
|
||||
if (!string.IsNullOrWhiteSpace(player.Race) && !races.Contains(player.Race))
|
||||
emitError("Invalid race {0} chosen for player {1}.".F(player.Race, player.Name));
|
||||
if (!string.IsNullOrWhiteSpace(player.Faction) && !races.Contains(player.Faction))
|
||||
emitError("Invalid race {0} chosen for player {1}.".F(player.Faction, player.Name));
|
||||
|
||||
if (worldActor.Traits.Contains<MPStartLocationsInfo>())
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
public HSLColor Color { get { return Player.Color; } }
|
||||
|
||||
[Desc("The player's race.")]
|
||||
public string Race { get { return Player.PlayerReference.Race; } }
|
||||
public string Race { get { return Player.PlayerReference.Faction; } }
|
||||
|
||||
[Desc("The player's spawnpoint ID.")]
|
||||
public int Spawn { get { return Player.SpawnPoint; } }
|
||||
|
||||
@@ -897,7 +897,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
PlayerReference = pr.Name,
|
||||
Closed = false,
|
||||
AllowBots = pr.AllowBots,
|
||||
LockRace = pr.LockRace,
|
||||
LockRace = pr.LockFaction,
|
||||
LockColor = pr.LockColor,
|
||||
LockTeam = pr.LockTeam,
|
||||
LockSpawn = pr.LockSpawn,
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Name = "Everyone",
|
||||
NonCombatant = true,
|
||||
Spectating = true,
|
||||
Race = "Random",
|
||||
Faction = "Random",
|
||||
Allies = w.Players.Where(p => !p.NonCombatant && p.Playable).Select(p => p.InternalName).ToArray()
|
||||
}));
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var pr = new PlayerReference
|
||||
{
|
||||
Name = "Multi{0}".F(index),
|
||||
Race = "Random",
|
||||
Faction = "Random",
|
||||
Playable = true,
|
||||
Enemies = new[] { "Creeps" }
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
this.worldRenderer = worldRenderer;
|
||||
|
||||
if (!actor.InitDict.Contains<RaceInit>())
|
||||
actor.InitDict.Add(new RaceInit(owner.Race));
|
||||
actor.InitDict.Add(new RaceInit(owner.Faction));
|
||||
|
||||
if (!actor.InitDict.Contains<OwnerInit>())
|
||||
actor.InitDict.Add(new OwnerInit(owner.Name));
|
||||
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Func<object, bool> saveInit = init =>
|
||||
{
|
||||
var race = init as RaceInit;
|
||||
if (race != null && race.Race == Owner.Race)
|
||||
if (race != null && race.Race == Owner.Faction)
|
||||
return false;
|
||||
|
||||
// TODO: Other default values will need to be filtered
|
||||
|
||||
@@ -500,7 +500,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
Name = section,
|
||||
OwnsWorld = section == "Neutral",
|
||||
NonCombatant = section == "Neutral",
|
||||
Race = race,
|
||||
Faction = race,
|
||||
Color = namedColorMapping[c]
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var td = new TypeDictionary();
|
||||
td.Add(new HideBibPreviewInit());
|
||||
td.Add(new OwnerInit(world.WorldActor.Owner));
|
||||
td.Add(new RaceInit(world.WorldActor.Owner.PlayerReference.Race));
|
||||
td.Add(new RaceInit(world.WorldActor.Owner.PlayerReference.Faction));
|
||||
|
||||
if (preview != null)
|
||||
preview.SetPreview(actor, td);
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
td.Add(new TurretFacingInit(92));
|
||||
td.Add(new HideBibPreviewInit());
|
||||
td.Add(new OwnerInit(selectedOwner.Name));
|
||||
td.Add(new RaceInit(selectedOwner.Race));
|
||||
td.Add(new RaceInit(selectedOwner.Faction));
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user