summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-07-27 17:30:13 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-21 00:28:20 +0200
commiteaa39d34fc8f20b5e996aa896f338d765456ad60 (patch)
tree81474030af1fb26b10bf8ea537994ecd2b5dcad3 /play.js
parente78db48e0bf7aab788731f1856af49f2e7d3f27a (diff)
downloadwashingtons-war-eaa39d34fc8f20b5e996aa896f338d765456ad60.tar.gz
manual arnold. attrition fix.
Diffstat (limited to 'play.js')
-rw-r--r--play.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/play.js b/play.js
index 9fee8e5..7e6852b 100644
--- a/play.js
+++ b/play.js
@@ -437,7 +437,7 @@ function get_static_xy(s) {
let x, y
if (s >= 66) {
x = data.spaces[s].x
- y = data.spaces[s].y
+ y = data.spaces[s].y + 60
} else {
x = data.spaces[s].x - 20
y = data.spaces[s].y + 15
@@ -568,7 +568,7 @@ function on_update() {
if (s === NOWHERE)
continue
- let pos = ui.layout_static[s]
+ let pos = (s < 66) ? ui.layout_static[s] : get_static_xy(s)
if (view.move && view.move.who === g)
pos = ui.layout_move
if (view.react && view.react.who === g)
@@ -576,6 +576,9 @@ function on_update() {
let [ x, y ] = pos
+ if (s >= 66)
+ y -= 60
+
if (view.move && view.move.who === g) {
ui.generals[g].classList.add("selected")
} else if (view.react && view.react.who === g) {
@@ -587,13 +590,13 @@ function on_update() {
let offset = general_offset(g)
x += offset * (45 + 9)
} else {
+ let wrap = (s === 66 ? 3 : 4)
let total = general_total(g)
let offset = general_offset(g)
- let off_x = offset % 3
- let off_y = offset / 3 | 0
- let ctr_x = total > 3 ? 3 : total
+ let off_x = offset % wrap
+ let off_y = offset / wrap | 0
+ let ctr_x = total > wrap ? wrap : total
off_x -= (ctr_x - 1) / 2
- // off_y -= (total / 3 | 0) / 2
x += off_x * (45 + 9)
y += off_y * (45 + 9)
y -= 15