Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions C7Engine/C7GameData/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,14 @@ public void DoCorruptionCalculations(GameData gameData) {
}
}

// Call once at turn advance, decrement penalty turns of unhappiness for drafting / whipping
public void DecrementCityUnhappinessPenalties(GameData gameData) {
foreach (City c in cities) {
// TODO: Add drafting unhappiness decrement when implemented
c.turnsOfUnhappinessDueToPopRushing -= (c.turnsOfUnhappinessDueToPopRushing > 0) ? 1 : 0;
}
}

public void RecalculateCitizenMoods(GameData gameData, bool goIntoDisorderIfUnhappy = false) {
foreach (City c in cities) {
City.Mood cityMood = c.RecalculateCitizenMoods(gameData);
Expand Down
1 change: 1 addition & 0 deletions C7Engine/EntryPoints/TurnHandling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public static async Task AdvanceTurn() {
gameData.turn++;
foreach (Player player in gameData.players) {
player.MaybeSpawnBonusUnits(gameData);
player.DecrementCityUnhappinessPenalties(gameData);
player.RecalculateCitizenMoods(gameData, goIntoDisorderIfUnhappy: true);
player.DoCorruptionCalculations(gameData);

Expand Down
Loading