diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -35,6 +35,8 @@ const BOTH = "Both" const CAESAR = "Caesar" const POMPEIUS = "Pompeius" +const PLAYER_MASK = { Caesar: 1, Pompeius: 2 } + const B_CAESAR = find_block("Caesar") const B_POMPEIUS = find_block("Pompeius") const B_CLEOPATRA = find_block("Cleopatra") @@ -238,7 +240,7 @@ function deal_cards(deck, n) { function reset_road_limits() { game.sea_moved = [] - game.sea_retreated = false + game.sea_retreated = 0 game.limits = [] } @@ -700,7 +702,7 @@ function can_block_continue(b, last_from) { } function can_sea_retreat(who, _from, to) { - if (game.sea_retreated) + if (game.sea_retreated & PLAYER_MASK[game.active]) return false if (BLOCKS[who].type === "navis") return false @@ -2299,7 +2301,7 @@ states.retreat = { if (is_sea(to) && !is_navis(game.who)) { push_undo() move_to(game.who, from, to) - game.sea_retreated = true + game.sea_retreated |= PLAYER_MASK[game.active] game.state = "sea_retreat" } else { move_to(game.who, from, to) |