summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js23
1 files changed, 15 insertions, 8 deletions
diff --git a/play.js b/play.js
index c6475f1..e48a0fd 100644
--- a/play.js
+++ b/play.js
@@ -177,7 +177,7 @@ function is_unit_fired(u) {
}
function is_unit_revealed(u) {
- let reinf = hexdeploy + view.month
+ let reinf = hexmonth + view.month
if (player === AXIS)
return is_axis_unit(u) || set_has(view.revealed, u) || unit_hex(u) > reinf
else if (player === ALLIED)
@@ -256,6 +256,10 @@ function is_setup_hex(hex) {
return hex === DEPLOY
}
+function is_month_hex(hex) {
+ return hex >= hexmonth
+}
+
function focus_stack(stack, hex) {
if (ui.focus !== stack) {
console.log("FOCUS STACK", stack, hex)
@@ -453,7 +457,7 @@ const HIGHWAY = 4
const map_w = 25
const map_h = 9
-const hexdeploy = map_w * map_h
+const hexmonth = map_w * map_h
let hexnext = [ 1, map_w, map_w-1, -1, -map_w, -(map_w-1) ]
@@ -584,13 +588,13 @@ function build_hexes() {
}
for (let month = 1; month <= 10; ++month) {
- ui.hex_y[map_w * map_h + month] = 24 + 37
- ui.hex_x[map_w * map_h + month] = 1840 + 37 + (month-1) * 81
+ ui.hex_y[map_w * map_h + month] = 25 + 24
+ ui.hex_x[map_w * map_h + month] = 25 + 1956 + (month-1) * 70
ui.months[month] = document.getElementById("month" + month)
}
for (let month = 11; month <= 20; ++month) {
- ui.hex_y[map_w * map_h + month] = 24 + 37 // + 81
- ui.hex_x[map_w * map_h + month] = 1840 + 37 + (month-11) * 81
+ ui.hex_y[map_w * map_h + month] = 25 + 24
+ ui.hex_x[map_w * map_h + month] = 25 + 1956 + (month-11) * 70
ui.months[month] = document.getElementById("month" + month)
}
@@ -693,7 +697,10 @@ function layout_stack(stack, hex, start_x, start_y, wrap, xdir) {
y = start_y - 25 + (i % wrap) * 56
z = 200
} else {
- if (stack.length <= 1) {
+ if (is_month_hex(hex)) {
+ x = start_x - 25 + i * 3
+ y = start_y - 25 + i * 3
+ } else if (stack.length <= 1) {
x = start_x - 25 + i * 11
y = start_y - 25 + i * 14
} else if (stack.length <= 4) {
@@ -764,7 +771,7 @@ function update_map() {
else
hex = 171
}
- if (hex >= hexdeploy + view.month + 10)
+ if (hex >= hexmonth + view.month + 10)
hex = 0
if (is_setup_hex(hex)) {
if (player === "Axis" && !is_axis_unit(u))