diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-25 19:00:33 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-30 21:59:25 +0200 |
commit | 309621812e00007c49c9f5976b0e76457c266501 (patch) | |
tree | 55d16d0e5a43298356ff0c7c879c306d6550b08e | |
parent | ad7314ef1ebc20d353caa26cd65e8424097f6ad2 (diff) | |
download | friedrich-309621812e00007c49c9f5976b0e76457c266501.tar.gz |
kustrin
-rw-r--r-- | rules.js | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -393,9 +393,8 @@ function forbid_play_value_10_or_more() { function must_reach_positive_score() { if (game.fx === NEXT_TURN_IF_FRIEDRICH_IS_INVOLVED_IN_COMBAT_PRUSSIA_MUST_REACH_A_POSITIVE_SCORE) { - if (game.power === P_PRUSSIA) { + if (game.power === P_PRUSSIA) return (game.pos[GEN_FRIEDRICH] === game.attacker || game.pos[GEN_FRIEDRICH] === game.defender) - } } return false } @@ -1283,6 +1282,13 @@ function movement_range() { function goto_movement() { game.state = "movement" set_clear(game.moved) + + if (game.fx === NEXT_TURN_IF_FERMOR_STARTS_HIS_MOVE_IN_KUSTRIN_OR_IN_AN_ADJACENT_CITY_HE_MAY_NOT_MOVE) { + if (game.power === P_RUSSIA && set_has(data.cities.adjacent[KUSTRIN], game.pos[GEN_FERMOR])) { + // log("P" + GEN_FERMOR + " in S" + game.pos[GEN_FERMOR] + " may not move.") + set_add(game.moved, GEN_FERMOR) + } + } } function is_supreme_commander(p) { @@ -1346,10 +1352,10 @@ states.movement = { piece(p) { push_undo() - game.selected = [ p ] + game.selected = [] let here = game.pos[p] for (let other of all_power_generals[game.power]) - if (other > p && game.pos[other] === here) + if (other >= p && game.pos[other] === here && !set_has(game.moved, other)) game.selected.push(other) game.count = 0 @@ -1883,15 +1889,6 @@ states.move_general_OLD = { } } - if (game.count === 0) { - if (game.fx === NEXT_TURN_IF_FERMOR_STARTS_HIS_MOVE_IN_KUSTRIN_OR_IN_AN_ADJACENT_CITY_HE_MAY_NOT_MOVE) { - if (set_has(game.selected, GEN_FERMOR) && set_has(data.cities.adjacent[KUSTRIN], here)) { - prompt("Move " + format_selected() + ". Fermor may not move this turn.") - return - } - } - } - if (game.count < movement_range() + game.major) for (let next of data.cities.major_roads[here]) if (can_move_general_to(next)) |