diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-02-27 12:55:45 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-02-27 12:55:45 +0100 |
commit | 9a894d97b62a72d42bf77b12178b1127ad67065c (patch) | |
tree | 6b9007d588c909f36bb552f1035e9bd30365bd81 | |
parent | c88062f639e0df2f3a88064f553d25ec2f1b45b0 (diff) | |
download | red-flag-over-paris-9a894d97b62a72d42bf77b12178b1127ad67065c.tar.gz |
Use multi-active state instead of "Both".
-rw-r--r-- | rules.js | 24 |
1 files changed, 9 insertions, 15 deletions
@@ -979,7 +979,7 @@ function start_round() { game.red_objective = [ game.objective_deck.pop(), game.objective_deck.pop() ] game.blue_objective = [ game.objective_deck.pop(), game.objective_deck.pop() ] - game.active = "Both" + game.active = [ COMMUNE, VERSAILLES ] game.state = "choose_objective_card" } @@ -1005,11 +1005,11 @@ states.choose_objective_card = { if (typeof game.red_objective === "number" && typeof game.blue_objective === "number") end_choose_objective_card() else if (typeof game.red_objective === "number") - game.active = VERSAILLES + game.active = [ VERSAILLES ] else if (typeof game.blue_objective === "number") - game.active = COMMUNE + game.active = [ COMMUNE ] else - game.active = "Both" + game.active = [ COMMUNE, VERSAILLES ] }, } @@ -2355,18 +2355,18 @@ function goto_final_crisis() { game.blue_final = 0 game.blue_set_aside = [] - game.active = "Both" + game.active = [ COMMUNE, VERSAILLES ] game.state = "final_crisis_discard" resume_final_crisis_discard() } function resume_final_crisis_discard() { if (game.red_hand.length > game.round && game.blue_hand.length > game.round) - game.active = "Both" + game.active = [ COMMUNE, VERSAILLES ] else if (game.red_hand.length > game.round) - game.active = COMMUNE + game.active = [ COMMUNE ] else if (game.blue_hand.length > game.round) - game.active = VERSAILLES + game.active = [ VERSAILLES ] else { clear_undo() game.round = 4 @@ -3794,12 +3794,6 @@ function draw_strategy_card() { // === VIEW === -exports.dont_snap = function(state) { - if (state.state === "choose_objective_card" && state.active !== "Both") - return true - return false -} - exports.view = function (state, player) { game = state @@ -3859,7 +3853,7 @@ exports.view = function (state, player) { if (game.state === "game_over") { view.prompt = game.victory - } else if (player === "Observer" || (game.active !== player && game.active !== "Both")) { + } else if (game.active !== player && !game.active.includes(player)) { if (states[game.state]) { let inactive = states[game.state].inactive view.prompt = `Waiting for ${game.active} to ${inactive}...` |