diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 26 |
1 files changed, 15 insertions, 11 deletions
@@ -4362,24 +4362,28 @@ function log_conquest(conq) { } } -function goto_retroactive_conquest() { - delete game.combat - - let conq = [] - - map_for_each(game.retro, function (s, pow) { - if (pow === game.power && is_enemy_controlled_fortress(s)) { +function apply_retroactive_conquest(conq, major) { + map_for_each(game.retro, function (s, other) { + if (other === major && is_enemy_controlled_fortress(s)) { if (!is_protected_from_conquest(s)) { - set_control_of_fortress(s, pow) + set_control_of_fortress(s, other) conq.push(s) } } }) + game.retro = map_filter(game.retro, (_,other) => other !== major) +} - game.retro = map_filter(game.retro, (_,pow) => pow !== game.power) - +function goto_retroactive_conquest() { + delete game.combat + let conq = [] + if (is_two_player() && !is_intro() && (game.power === P_PRAGMATIC || game.power === P_AUSTRIA)) { + apply_retroactive_conquest(conq, P_AUSTRIA) + apply_retroactive_conquest(conq, P_PRAGMATIC) + } else { + apply_retroactive_conquest(conq, game.power) + } log_conquest(conq) - next_sequence_of_play() } |