summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index d7d6968..76acbaa 100644
--- a/rules.js
+++ b/rules.js
@@ -5249,17 +5249,18 @@ function max_emperor_turns(cutoff) {
return n
}
-function award_emperor_turns(amount, cutoff) {
+function award_emperor_turns(amount, n, cutoff) {
let x = max_emperor_turns(cutoff)
if (x > 0) {
for (let p = 0; p < get_player_count(); ++p) {
if (game.emperor_turns[p] === x) {
logi(PLAYER_NAME[p] + " +" + amount + " Legacy")
game.legacy[p] += amount
+ n += 1
}
}
}
- return x
+ return [n, x]
}
function vp_tie(p) {
@@ -5288,10 +5289,10 @@ function goto_game_end() {
log_h3("Emperor Turns:")
- let cutoff = award_emperor_turns(10, 1000)
- cutoff = award_emperor_turns(6, cutoff)
- cutoff = award_emperor_turns(3, cutoff)
- award_emperor_turns(0, cutoff)
+ let [n, cutoff] = award_emperor_turns(10, 0, 1000)
+ if (n < 2) [n, cutoff] = award_emperor_turns(6, n, cutoff)
+ if (n < 3) [n, cutoff] = award_emperor_turns(3, n, cutoff)
+ award_emperor_turns(0, n, cutoff)
log_h3("Final Score:")
game.current = game.first