From 5f23b20f6f9acf40a778912458b889f518ff1aa7 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 16 Nov 2022 20:28:22 +0100 Subject: Fix delay hits being skipped when a battle ends early after harrying. --- rules.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rules.js b/rules.js index 89fb28c..9543e7c 100644 --- a/rules.js +++ b/rules.js @@ -2822,6 +2822,10 @@ function resume_field_battle() { game.active = game.attacker[game.where] if (is_friendly_field(game.where)) { + if (game.delay_hits && game.hits > 0) { + game.active = enemy(save_active) + return goto_field_battle_hits() + } print_retreat_summary() log("Field battle won by " + game.active + ".") game.show_field = 0 @@ -2829,6 +2833,10 @@ function resume_field_battle() { } if (is_enemy_field(game.where)) { + if (game.delay_hits && game.hits > 0) { + game.active = enemy(save_active) + return goto_field_battle_hits() + } game.active = enemy(game.active) print_retreat_summary() log("Field battle won by " + game.active + ".") @@ -2837,12 +2845,20 @@ function resume_field_battle() { } if (is_enemy_battle_field()) { + if (game.delay_hits && game.hits > 0) { + game.active = enemy(save_active) + return goto_field_battle_hits() + } print_retreat_summary() log("Attacking main force was eliminated.") return next_combat_round() } if (is_friendly_battle_field()) { + if (game.delay_hits && game.hits > 0) { + game.active = enemy(save_active) + return goto_field_battle_hits() + } print_retreat_summary() log("Defending main force was eliminated.") log("Battlefield control changed.") -- cgit v1.2.3