summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-15 03:05:08 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit9b856bb5d402aa5f97e1c9c133dddbc6251e889d (patch)
tree0b4cb277f16b5044bfdc5a612d80a040aa8b6726
parentb83115ce40d88c789fbbd5a891057e14d4cf553b (diff)
downloadtable-battles-9b856bb5d402aa5f97e1c9c133dddbc6251e889d.tar.gz
separate skip action state (for stick shifting after reaction)
-rw-r--r--cards.css1
-rw-r--r--rules.js28
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()
},
}