diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-05-23 21:04:38 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-05-24 21:52:29 +0200 |
commit | 0257e4fee8a824dec3730bbe5b99b242c96325a8 (patch) | |
tree | d4f93171ae9170b031e42633004cbe43c860d2dc | |
parent | 48d4d90e0c0a6838160012995fe2cdf3862cbb70 (diff) | |
download | red-flag-over-paris-0257e4fee8a824dec3730bbe5b99b242c96325a8.tar.gz |
Fix Final Crisis impossible events. Fix victory check.
-rw-r--r-- | rules.js | 33 |
1 files changed, 23 insertions, 10 deletions
@@ -2295,15 +2295,15 @@ states.final_crisis_events = { gen_action_card(c) }, card(c) { + push_undo() game.final_active = game.active discard_card(c) + game.what = c if (game.active === VERSAILLES && is_commune_card(c)) { - game.what = c game.active = COMMUNE game.state = "final_crisis_opponent_event" } else if (game.active === COMMUNE && is_versailles_card(c)) { - game.what = c game.active = VERSAILLES game.state = "final_crisis_opponent_event" } @@ -2313,12 +2313,23 @@ states.final_crisis_events = { if (can_play_event(c)) goto_play_event(c) else - log("Could not play.") + game.state = "final_crisis_cannot_play" } }, } -// TODO: - is this necessary? +states.final_crisis_cannot_play = { + inactive: "play an event", + prompt() { + view.prompt = card_names[game.what] + ": This event cannot be played." + view.actions.pass = 1 + }, + pass() { + log("Could not play.") + end_play_card() + }, +} + states.final_crisis_opponent_event = { inactive: "play an event", prompt() { @@ -2331,12 +2342,12 @@ states.final_crisis_opponent_event = { view.actions.pass = 1 }, event() { - log_h3(game.active + " - Event") + log_h3(enemy_player() + " - Opponent Event") logi("C" + game.what) goto_play_event(game.what) }, pass() { - log_h3(game.active + " - Pass") + log_h3(enemy_player() + " - Pass") logi("C" + game.what) end_play_card() }, @@ -2359,9 +2370,9 @@ function goto_final_victory() { log_br() - if (versailles_military_vp() > commune_military_vp()) + if (versailles_military_vp() >= commune_political_vp()) return goto_game_over(VERSAILLES, "Versailles won with Military VP!") - if (commune_political_vp() > versailles_political_vp()) + if (commune_political_vp() >= versailles_military_vp()) return goto_game_over(COMMUNE, "Commune won with Political VP!") let v = 0 @@ -2502,8 +2513,10 @@ states.vm_return = { inactive: "finish playing the event", prompt() { event_prompt("Done.") - // TODO: or end_event ? - view.actions.done = 1 + view.actions.end_event = 1 + }, + end_event() { + end_event() }, done() { end_event() |