summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-05-27 18:13:58 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:08:56 +0100
commitf641fd09c50adbb9370d39defe5de9d4b6b28891 (patch)
tree4e4db812c121d28a546480b916ba976227bace17 /rules.js
parenta05d40cf1a4c59f34bab26b296b3cd890fdf7b76 (diff)
downloadjulius-caesar-f641fd09c50adbb9370d39defe5de9d4b6b28891.tar.gz
caesar: Only show "End levy" when all levy points are spent.
Or there are no valid levy options.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index e2dceed..24c609c 100644
--- a/rules.js
+++ b/rules.js
@@ -1400,13 +1400,17 @@ states.levy = {
if (is_inactive_player(current))
return view.prompt = "Waiting for " + game.active + " to levy...";
view.prompt = "Choose an army to levy. "+game.levies+"LP left.";
+ let is_levy_possible = false;
if (game.levies > 0) {
for (let b in BLOCKS) {
- if (can_levy(b))
+ if (can_levy(b)) {
gen_action(view, 'block', b);
+ is_levy_possible = true;
+ }
}
}
- gen_action_pass(view, "End levy phase");
+ if (!is_levy_possible)
+ gen_action_pass(view, "End levy phase");
gen_action_undo(view);
},
block: function (who) {