diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-24 11:10:46 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:37 +0200 |
commit | 09b39d01d8ebf54d92e328547e7cd95fccff8fdb (patch) | |
tree | be591837ab97068c555485c7aa29d7f174b4d12b /play.js | |
parent | 9d313786f1646e3136a6050ab6dec40714ea1481 (diff) | |
download | time-of-crisis-09b39d01d8ebf54d92e328547e7cd95fccff8fdb.tar.gz |
Fix Damnatio and Rival Emperor when bonus no combat victory.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 28 |
1 files changed, 22 insertions, 6 deletions
@@ -969,9 +969,22 @@ function on_update() { ui.legacy[pi].classList.toggle("legacy_40", false) } - let y = 30 + let n = 0 + for (let k = 0; k < player_count; ++k) { + let k_legacy = view.legacy[k] + if (k_legacy > 80) + k_legacy -= 40 + if (k_legacy > 40) + k_legacy -= 40 + if (legacy === k_legacy) + ++n + } + + let y = (n === 1) ? 50 : (n === 2) ? 40 : 30 for (let k = 0; k < pi; ++k) { let k_legacy = view.legacy[k] + if (k_legacy > 80) + k_legacy -= 40 if (k_legacy > 40) k_legacy -= 40 if (legacy === k_legacy) @@ -982,12 +995,15 @@ function on_update() { ui.legacy[pi].style.left = Math.round(43 + legacy * 60.2) + "px" ui.legacy[pi].style.top = 2 + y + "px" - y = 30 - for (let k = 0; k < pi; ++k) { - let k_turns = view.emperor_turns[k] - if (turns === k_turns) + n = 0 + for (let k = 0; k < player_count; ++k) + if (turns === view.emperor_turns[k]) + ++n + + y = (n === 1) ? 50 : (n === 2) ? 40 : 30 + for (let k = 0; k < pi; ++k) + if (turns === view.emperor_turns[k]) y += 20 - } show(ui.emperor_turns[pi]) ui.emperor_turns[pi].style.left = Math.round(41 + turns * 60.2) + "px" |