Add starting cash option.

This commit is contained in:
Paul Chote
2013-08-17 12:59:27 +12:00
parent 3fd64dfe52
commit 271ce5275c
28 changed files with 100 additions and 17 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}