Add starting cash option.
This commit is contained in:
@@ -29,6 +29,7 @@ namespace OpenRA
|
||||
public bool? Shroud;
|
||||
public bool? AllyBuildRadius;
|
||||
public bool? FragileAlliances;
|
||||
public int? StartingCash;
|
||||
public bool ConfigurableStartingUnits = true;
|
||||
public string[] Difficulties = { };
|
||||
|
||||
@@ -44,6 +45,8 @@ namespace OpenRA
|
||||
settings.Shroud = Shroud.Value;
|
||||
if (AllyBuildRadius.HasValue)
|
||||
settings.AllyBuildRadius = AllyBuildRadius.Value;
|
||||
if (StartingCash.HasValue)
|
||||
settings.StartingCash = StartingCash.Value;
|
||||
if (FragileAlliances.HasValue)
|
||||
settings.FragileAlliances = FragileAlliances.Value;
|
||||
}
|
||||
|
||||
@@ -95,6 +95,7 @@ namespace OpenRA.Network
|
||||
public bool Shroud = true;
|
||||
public bool Fog = true;
|
||||
public bool AllyBuildRadius = true;
|
||||
public int StartingCash = 5000;
|
||||
public string StartingUnitsClass = "none";
|
||||
public bool AllowVersionMismatch;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace OpenRA.Traits
|
||||
{
|
||||
public class PlayerResourcesInfo : ITraitInfo
|
||||
{
|
||||
public readonly int InitialCash = 10000;
|
||||
public readonly int InitialOre = 0;
|
||||
public readonly int[] SelectableCash = { 2500, 5000, 10000, 20000 };
|
||||
public readonly int DefaultCash = 5000;
|
||||
public readonly int AdviceInterval = 250;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PlayerResources(init.self, this); }
|
||||
@@ -34,8 +34,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
Owner = self.Owner;
|
||||
|
||||
Cash = info.InitialCash;
|
||||
Ore = info.InitialOre;
|
||||
Cash = self.World.LobbyInfo.GlobalSettings.StartingCash;
|
||||
AdviceInterval = info.AdviceInterval;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user