diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-11-08 20:31:08 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-11-08 20:31:15 +0100 |
commit | d668454c484348c0eb23e26c40fd213d443e2480 (patch) | |
tree | 3ae3941b30bbb576dce1b11ec36b8964e7cde4a8 /rules.js | |
parent | bc4f9c520a403e7dea42e9c9d9198afab8a8f858 (diff) | |
download | maria-d668454c484348c0eb23e26c40fd213d443e2480.tar.gz |
Pretty political shift buttons.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -4891,11 +4891,20 @@ states.political_shift = { prompt() { let info = event_shift[current_political_effect()] prompt("Shift " + TRACK_NAME[info.track] + ".") - if (info.condition === undefined || info.condition()) - view.actions.shift = info.amount + if (info.condition === undefined || info.condition()) { + if (info.track === "saxony") + view.actions.shift_saxony = info.amount + if (info.track === "russia") + view.actions.shift_russia = info.amount + if (info.track === "italy") + view.actions.shift_italy = info.amount + } view.actions.pass = 1 view.pc = game.pc }, + shift_italy(n) { this.shift(n) }, + shift_russia(n) { this.shift(n) }, + shift_saxony(n) { this.shift(n) }, shift(n) { push_undo() let info = event_shift[current_political_effect()] @@ -5079,10 +5088,10 @@ states.saxony_shift_battle = { inactive: "shift Saxony marker", prompt() { prompt(`Shift Saxony marker ${game.count} to the right.`) - view.actions.shift = [ 1 ] + view.actions.shift_saxony = [ 1 ] view.actions.pass = 1 }, - shift(_) { + shift_saxony(_) { log("Saxony marker " + game.count + " right.") let save_saxony = game.saxony game.saxony = Math.max(1, Math.min(5, game.saxony + game.count)) @@ -5107,12 +5116,12 @@ states.saxony_shift_supply = { inactive: "shift Saxony marker", prompt() { prompt(`Shift Saxony marker up to ${game.count} to the right.`) - view.actions.shift = [] + view.actions.shift_saxony = [] for (let i = 1; i <= game.count; ++i) - view.actions.shift.push(i) + view.actions.shift_saxony.push(i) view.actions.pass = 1 }, - shift(n) { + shift_saxony(n) { log("Saxony marker " + n + " right.") let save_saxony = game.saxony game.saxony = Math.max(1, Math.min(5, game.saxony + n)) |