From f71897d6fa4e2c9d714167bdcc2c5a6b20a2d55d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 24 Jul 2023 23:34:12 +0200 Subject: Cap military emperor legacy loss from pretenders at bonus legacy gained. Per Errata, cannot lose more than the bonus gained from being emperor. --- rules.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/rules.js b/rules.js index 7db581b..d7d6968 100644 --- a/rules.js +++ b/rules.js @@ -4508,11 +4508,6 @@ function award_legacy_summary(p, reason, n) { } } -function award_combat_legacy(p, reason, n) { - award_legacy(p, reason, n) - game.combat_legacy += n -} - function goto_combat_no_victory() { log("Both sides eliminated.") game.combat.killed = 0 @@ -4542,10 +4537,12 @@ function goto_combat_victory_attacker() { if (game.combat.type === "barbarians") { let inflicted = game.combat.dtaken + game.combat.staken - if (game.emperor === ARMY + game.combat.attacker) - award_combat_legacy(game.current, "Military Emperor Victory", 4 + inflicted * 2) - else - award_combat_legacy(game.current, "Victory", 2 + inflicted) + if (game.emperor === ARMY + game.combat.attacker) { + award_legacy(game.current, "Military Emperor Victory", 4 + inflicted * 2) + game.combat_legacy += 2 + inflicted + } else { + award_legacy(game.current, "Victory", 2 + inflicted) + } // Surviving Barbarians go home (to active) let tribe = game.combat.target @@ -4555,10 +4552,12 @@ function goto_combat_victory_attacker() { set_barbarian_location(id, BARBARIAN_HOMELAND[tribe]) } } else { - if (game.emperor === ARMY + game.combat.attacker) - award_combat_legacy(game.current, "Military Emperor Victory", 4) - else - award_combat_legacy(game.current, "Victory", 2) + if (game.emperor === ARMY + game.combat.attacker) { + award_legacy(game.current, "Military Emperor Victory", 4) + game.combat_legacy += 2 + } else { + award_legacy(game.current, "Victory", 2) + } } // Defending Romans must retreat into province -- cgit v1.2.3