summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-01 23:20:57 +0100
committerTor Andersson <tor@ccxvii.net>2023-12-01 23:20:57 +0100
commit2de6fe355129a56e3473b872d318117ea27f2114 (patch)
tree1b9f0d30e95aef71e8bfbed4edffcbaaea705019 /rules.js
parent6b3c434728a5fd5e036aa65d74d7bcf25f882e7f (diff)
downloadwaterloo-campaign-1815-2de6fe355129a56e3473b872d318117ea27f2114.tar.gz
Don't roll for moves after pass in June 15 scenario.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index 21f56a6..c7438f1 100644
--- a/rules.js
+++ b/rules.js
@@ -1316,6 +1316,16 @@ function pass_movement() {
if (can_move_any()) {
let die = roll_die()
+ if (game.turn <= 2 && game.active === P1) {
+ game.remain = game.french_moves
+ return
+ }
+
+ if (game.turn === 2 && game.active === P2) {
+ game.remain = game.prussian_moves
+ return
+ }
+
let n = 0
for (let p of friendly_corps()) {
if (piece_is_not_in_enemy_zoc_or_zoi(p))
@@ -1350,12 +1360,7 @@ states.movement = {
let may_pass = 1
let remain = game.remain
- if (game.turn <= 2 && game.active === P1)
- remain = Math.min(remain, game.french_moves)
- if (game.turn === 2 && game.active === P2)
- remain = Math.min(remain, game.prussian_moves)
-
- if (game.remain > 0)
+ if (remain > 0)
prompt("Movement: " + remain + " moves remain.")
else
prompt("Movement.")