diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-23 00:44:51 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-30 21:59:25 +0200 |
commit | de679761df9494f19717de8c9c57fc754d7d0dcd (patch) | |
tree | 9ca1dc19954ee3c4df02798542e9d18b89dedea8 | |
parent | c2eaf91e783a45ef21962e63ea1ad66aaf57c201 (diff) | |
download | friedrich-de679761df9494f19717de8c9c57fc754d7d0dcd.tar.gz |
pause after discarding TC before merging with hand.
-rw-r--r-- | play.css | 4 | ||||
-rw-r--r-- | play.js | 4 | ||||
-rw-r--r-- | rules.js | 37 |
3 files changed, 33 insertions, 12 deletions
@@ -375,7 +375,11 @@ TWOD.piece.cylinder { .card.action { box-shadow: 0 0 0 4px white; +} + +.card.action:hover { margin-top: -10px; + margin-bottom: 10px; } /* @@ -204,12 +204,12 @@ function make_tc_deck(n) { for (let suit = 0; suit <= 3; ++suit) { for (let value = 2; value <= 13; ++value) { let c = (n << 7) | (suit << 4) | value - ui.tc[c] = create_piece("card", c, "card tc " + suit_class[suit] + value) + ui.tc[c] = create_piece("card", c, "card tc deck_" + (n+1) + " " + suit_class[suit] + value) } } for (let value = 2; value <= 3; ++value) { let c = (n << 7) | (4 << 4) | value - ui.tc[c] = create_piece("card", c, "card tc R") + ui.tc[c] = create_piece("card", c, "card tc deck_" + (n+1) + " R") } } @@ -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() }, |