# HG changeset patch # User Alys Brooks # Date 2021-07-30 21:25:39 # Node ID 31430809e9db438778f40895534b3c287e8237a5 # Parent beadd2a34f4b7951bdc185f2470abd9e5166c6e5 Add declining subsidy. diff --git a/isometric-park-fna/Engines/Spawners/GameSpawner.cs b/isometric-park-fna/Engines/Spawners/GameSpawner.cs --- a/isometric-park-fna/Engines/Spawners/GameSpawner.cs +++ b/isometric-park-fna/Engines/Spawners/GameSpawner.cs @@ -113,6 +113,12 @@ DifficultyLevel.Medium => 750M, DifficultyLevel.Easy => 1000M, }; + + this.simulation.SubsidyDelta = message.Difficulty switch { + DifficultyLevel.Hard => 0M, + DifficultyLevel.Medium => -10M, + DifficultyLevel.Easy => 0M, + }; Logging.Success("Spawned new game."); diff --git a/isometric-park-fna/Simulation.cs b/isometric-park-fna/Simulation.cs --- a/isometric-park-fna/Simulation.cs +++ b/isometric-park-fna/Simulation.cs @@ -61,7 +61,13 @@ public const int MAX_TREES_TO_PLANT = 25; public const int MAX_TREES_TO_CLEAR = 25; - public decimal Subsidy { get; set; } + public decimal Subsidy { get; set; + /* { + var dateSpan = DateTimeSpan.CompareDates(this.START_DATETIME, this.DateTime); + var months = (dateSpan.Years * 12) + dateSpan.Years; }*/ + } + + public decimal SubsidyDelta { get; set;} public int Tick { @@ -235,6 +241,7 @@ var oldSeason = this.Season; this.DateTime = this.DateTime.AddMonths(1); + this.Subsidy = Math.Max(0, this.Subsidy + this.SubsidyDelta); var newSeason = this.Season; var seasonChanged = oldSeason != newSeason;