From 3deaf7e3bfe4bbcfb81b90c92587e36f72c03362 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 21 Feb 2023 11:34:46 +0100 Subject: Darken turns before the start of the scenario too. --- play.js | 4 +++- rules.js | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/play.js b/play.js index d7e851b..f33e023 100644 --- a/play.js +++ b/play.js @@ -1682,10 +1682,12 @@ function on_update() { update_court() + let first_turn = view.scenario >> 5 + let last_turn = view.scenario & 31 for (let i = 0; i <= 17; ++i) { ui.calendar[i].classList.toggle("action", is_action("calendar", i)) if (i >= 1 && i <= 16) - ui.calendar[i].classList.toggle("end", i > view.end) + ui.calendar[i].classList.toggle("end", i < first_turn || i > last_turn) } // Misc diff --git a/rules.js b/rules.js index df37ad6..a345490 100644 --- a/rules.js +++ b/rules.js @@ -60,6 +60,16 @@ exports.scenarios = [ "Crusade on Novgorod", ] +const scenario_first_turn = { + "Pleskau": 1, + "Watland": 4, + "Peipus": 13, + "Return of the Prince": 9, + "Return of the Prince (Nicolle)": 9, + "Crusade on Novgorod": 1, + "Pleskau (Quickstart)": 1, +} + const scenario_last_turn = { "Pleskau": 2, "Watland": 8, @@ -11096,8 +11106,8 @@ exports.view = function (state, current) { log: game.log, reveal: 0, + scenario: (scenario_first_turn[game.scenario] << 5) + (scenario_last_turn[game.scenario]), turn: game.turn, - end: scenario_last_turn[game.scenario], events: game.events, capabilities: game.capabilities, pieces: game.pieces, -- cgit v1.2.3