summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js40
1 files changed, 35 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 94420fc..c819442 100644
--- a/rules.js
+++ b/rules.js
@@ -1503,8 +1503,13 @@ states.skip_action = {
if (can_shift())
view.actions.shift = 1
- view.actions.roll = 1
- view.actions.end_turn = 0
+ if (count_dice_in_pool() > 0) {
+ view.actions.roll = 1
+ view.actions.end_turn = 0
+ } else {
+ view.actions.roll = 0
+ view.actions.end_turn = 1
+ }
},
shift() {
push_undo()
@@ -1515,6 +1520,11 @@ states.skip_action = {
goto_roll_phase()
roll_dice_in_pool()
},
+ end_turn() {
+ goto_roll_phase()
+ roll_dice_in_pool()
+ end_roll_phase()
+ },
}
states.roll = {
@@ -1845,6 +1855,15 @@ function has_any_cubes_on_card(c) {
return get_cubes(c) >= 1
}
+function count_dice_in_pool() {
+ let n = 0
+ let p = player_index()
+ for (let i = 0; i < 6; ++i)
+ if (get_dice_location(p * 6 + i) < 0)
+ ++n
+ return n
+}
+
function count_dice_on_card(c) {
let n = 0
for (let i = 0; i < 12; ++i)
@@ -2185,8 +2204,14 @@ states.action = {
inactive: "take an action",
prompt() {
view.prompt = "Take an action."
- view.actions.roll = 1
- view.actions.end_turn = 0
+
+ if (count_dice_in_pool() > 0) {
+ view.actions.roll = 1
+ view.actions.end_turn = 0
+ } else {
+ view.actions.roll = 0
+ view.actions.end_turn = 1
+ }
let p = player_index()
for (let c of game.front[p]) {
@@ -2305,7 +2330,12 @@ states.action = {
}
throw new Error("missing rule for special action: " + card_name(c))
- }
+ },
+ end_turn() {
+ goto_roll_phase()
+ roll_dice_in_pool()
+ end_roll_phase()
+ },
}
function can_shift() {