From 9b856bb5d402aa5f97e1c9c133dddbc6251e889d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 15 Dec 2023 03:05:08 +0100 Subject: separate skip action state (for stick shifting after reaction) --- cards.css | 1 + rules.js | 28 +++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/cards.css b/cards.css index e9da81e..b105627 100644 --- a/cards.css +++ b/cards.css @@ -10,6 +10,7 @@ border: 1px solid black; border-radius: 8px; box-shadow: 1px 2px 8px #0008; + overflow: clip; } .card.scenario { diff --git a/rules.js b/rules.js index c1f9f36..6067a1d 100644 --- a/rules.js +++ b/rules.js @@ -1342,12 +1342,29 @@ function goto_roll_phase() { } } +states.skip_action = { + prompt() { + view.prompt = "Skipped action phase; roll the dice in your pool." + + if (can_shift_any_infantry() || can_shift_any_cavalry()) + view.actions.shift = 1 + + view.actions.roll = 1 + view.actions.end_turn = 0 + }, + shift() { + push_undo() + game.state = "shift_from" + }, + roll() { + clear_undo() + roll_dice_in_pool() + }, +} + states.roll = { prompt() { - if (game.reacted === player_index()) - view.prompt = "Skipped action phase; roll the dice in your pool." - else - view.prompt = "Roll the dice in your pool." + view.prompt = "Roll the dice in your pool." view.actions.roll = 1 view.actions.end_turn = 0 }, @@ -1863,7 +1880,7 @@ states.s25_stony_hill = { function goto_action_phase() { if (game.reacted === player_index()) { - end_action_phase() + game.state = "skip_action" } else { if (can_take_any_action()) game.state = "action" @@ -2075,6 +2092,7 @@ states.shift_to = { }, next() { // TODO: skip action phase? + log(`Shifted ${get_shift_sticks(game.target2)} sticks from C${game.selected} to C${game.target2}.`) end_action_phase() }, } -- cgit v1.2.3