summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-24 11:10:46 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-07 18:39:37 +0200
commit09b39d01d8ebf54d92e328547e7cd95fccff8fdb (patch)
treebe591837ab97068c555485c7aa29d7f174b4d12b /play.js
parent9d313786f1646e3136a6050ab6dec40714ea1481 (diff)
downloadtime-of-crisis-09b39d01d8ebf54d92e328547e7cd95fccff8fdb.tar.gz
Fix Damnatio and Rival Emperor when bonus no combat victory.
Diffstat (limited to 'play.js')
-rw-r--r--play.js28
1 files changed, 22 insertions, 6 deletions
diff --git a/play.js b/play.js
index 27dade3..d7e3b8e 100644
--- a/play.js
+++ b/play.js
@@ -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"