diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-15 03:05:08 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-08 16:36:48 +0100 |
commit | 9b856bb5d402aa5f97e1c9c133dddbc6251e889d (patch) | |
tree | 0b4cb277f16b5044bfdc5a612d80a040aa8b6726 | |
parent | b83115ce40d88c789fbbd5a891057e14d4cf553b (diff) | |
download | table-battles-9b856bb5d402aa5f97e1c9c133dddbc6251e889d.tar.gz |
separate skip action state (for stick shifting after reaction)
-rw-r--r-- | cards.css | 1 | ||||
-rw-r--r-- | rules.js | 28 |
2 files changed, 24 insertions, 5 deletions
@@ -10,6 +10,7 @@ border: 1px solid black; border-radius: 8px; box-shadow: 1px 2px 8px #0008; + overflow: clip; } .card.scenario { @@ -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() }, } |