summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-24 23:34:12 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-24 23:34:12 +0200
commitf71897d6fa4e2c9d714167bdcc2c5a6b20a2d55d (patch)
treef3afb798b025bf21885bbbe9aac82bacedd56fa1
parentf0357af2ef6c3d4cc35e905bb85865f8f49dc750 (diff)
downloadtime-of-crisis-f71897d6fa4e2c9d714167bdcc2c5a6b20a2d55d.tar.gz
Cap military emperor legacy loss from pretenders at bonus legacy gained.
Per Errata, cannot lose more than the bonus gained from being emperor.
-rw-r--r--rules.js25
1 files 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