From de679761df9494f19717de8c9c57fc754d7d0dcd Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 23 May 2024 00:44:51 +0200 Subject: pause after discarding TC before merging with hand. --- rules.js | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 01f9c7f..7d7cb3a 100644 --- a/rules.js +++ b/rules.js @@ -864,7 +864,10 @@ function goto_tactical_cards() { else log("Drew " + n + " TC.") - game.state = "tactical_cards" + if (should_power_discard_tc() && game.draw.length > 0) + game.state = "tactical_cards_discard" + else + game.state = "tactical_cards_show" } function should_power_discard_tc() { @@ -875,24 +878,38 @@ function should_power_discard_tc() { return false } -states.tactical_cards = { +states.tactical_cards_discard = { prompt() { view.draw = game.draw - if (should_power_discard_tc() && game.draw.length > 0) { - prompt("Drew " + game.draw.length + " TCs. Discard one of them.") - for (let c of game.draw) - gen_action_card(c) - } else { - prompt("Drew " + game.draw.length + " TCs.") - view.actions.end_cards = 1 - } + prompt("Drew " + game.draw.length + " TCs. Discard one of them.") + for (let c of game.draw) + gen_action_card(c) }, card(c) { push_undo() log("Discarded 1 TC.") set_delete(game.draw, c) + game.state = "tactical_cards_discard_done" + }, +} + +states.tactical_cards_discard_done = { + prompt() { + view.draw = game.draw + prompt("Drew " + (game.draw.length+1) + " TCs. Discard one of them.") + view.actions.end_cards = 1 + }, + end_cards() { end_tactical_cards() }, +} + +states.tactical_cards_show = { + prompt() { + view.draw = game.draw + prompt("Drew " + game.draw.length + " TCs.") + view.actions.end_cards = 1 + }, end_cards() { end_tactical_cards() }, -- cgit v1.2.3