diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -2726,6 +2726,18 @@ function can_move_general_to(p, from, to) { return true } +function can_force_march_to(p, here, next) { + if (is_enemy_controlled_fortress(next)) + return false + if (has_enemy_piece(next)) + return false + if (is_adjacent_to_enemy_piece(next)) + return false + if (!can_move_general_to(p, here, next)) + return false + return true +} + function move_general_to(to, is_force_march) { let pow = game.power let who = game.selected @@ -2844,7 +2856,7 @@ states.move_supply_train = { function can_force_march(who, here) { for (let next of data.cities.main_roads[here]) - if (can_move_general_to(who, here, next)) + if (can_force_march_to(who, here, next)) return true return false } @@ -2937,13 +2949,7 @@ function search_force_march(p, came_from, start, range) { for (let next of data.cities.main_roads[here]) { if (set_has(seen, next)) continue - if (is_enemy_controlled_fortress(next)) - continue - if (has_enemy_piece(next)) - continue - if (is_adjacent_to_enemy_piece(next)) - continue - if (!can_move_general_to(p, here, next)) + if (!can_force_march_to(p, here, next)) continue if (came_from) map_set(came_from, next, here) @@ -4783,6 +4789,7 @@ states.political_card_discard_or_execute = { discard() { push_undo() log("Discarded with no effect.") + array_remove_item(game.political, game.pc) game.state = "political_card_done" }, } @@ -6507,7 +6514,7 @@ states.reject_deal = { view.actions.undo = 0 }, resume() { - next_reject_cancel_subsidy() + next_reject_deal() }, } |