diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-08-12 21:28:35 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-08-12 21:28:35 +0200 |
commit | ca43b789e4ad9ffd866cd10ab57f0e26bc87860d (patch) | |
tree | f10d06d47918c5242f16adb3c2f6874ca98269c8 /rules.js | |
parent | 6f2230d57630d51aaa3a1929c686f5e2a48d79d1 (diff) | |
download | time-of-crisis-ca43b789e4ad9ffd866cd10ab57f0e26bc87860d.tar.gz |
Fix battle victory when attacker is eliminated but did more hits total.
Oops!
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4509,7 +4509,7 @@ states.combat_victory = { let ae = is_attacker_eliminated() if (de && ae) prompt("Combat: There is no winner.") - else if (de || game.combat.dtaken + game.combat.staken + game.combat.cavalry > game.combat.ataken) + else if (!ae && (de || game.combat.dtaken + game.combat.staken + game.combat.cavalry > game.combat.ataken)) prompt("Combat: You win the battle!") else prompt("Combat: Defenders win the battle!") @@ -4528,7 +4528,7 @@ function goto_combat_victory() { let ae = is_attacker_eliminated() if (de && ae) goto_combat_no_victory() - else if (de || game.combat.dtaken + game.combat.staken + game.combat.cavalry > game.combat.ataken) + else if (!ae && (de || game.combat.dtaken + game.combat.staken + game.combat.cavalry > game.combat.ataken)) goto_combat_victory_attacker() else goto_combat_victory_defender() |