From e8b02e17173feec741bd4475a299aa664346a41f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 12 Nov 2023 01:53:17 +0100 Subject: Show last used border, border limits, and main attack. Optimize border state representation (use maps instead of objects). --- tools/borders.svg | 359 +++++++++++++++++++++++++++++++++++++++++++++++++++ tools/genborders.js | 53 ++++++++ tools/makeborders.js | 32 +++++ 3 files changed, 444 insertions(+) create mode 100644 tools/borders.svg create mode 100644 tools/genborders.js create mode 100644 tools/makeborders.js (limited to 'tools') diff --git a/tools/borders.svg b/tools/borders.svg new file mode 100644 index 0000000..0e05b74 --- /dev/null +++ b/tools/borders.svg @@ -0,0 +1,359 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/genborders.js b/tools/genborders.js new file mode 100644 index 0000000..9c50721 --- /dev/null +++ b/tools/genborders.js @@ -0,0 +1,53 @@ +const fs = require("fs") + +const { round, floor, ceil } = Math + +let output = {} +let mode, name, x, y, w, h, cx, cy, rx, ry + +function flush() { + if (mode === 'circle') { + output[name] = { x: cx, y: cy } + } + x = y = w = h = cx = cy = rx = ry = 0 + name = null +} + +for (let line of fs.readFileSync("tools/borders.svg", "utf-8").split("\n")) { + line = line.trim() + if (line.startsWith(" + +`) + +for (let id = 0; id < data.BORDERS.length; ++id) { + if (data.BORDERS[id]) { + let a = (id / 100) | 0 + let b = id % 100 + let x = (data.AREAS[a].x + data.AREAS[b].x) >> 1 + let y = (data.AREAS[a].y + data.AREAS[b].y) >> 1 + let label = data.AREAS[a].name + " / " + data.AREAS[b].name + print(``) + + } +} + +print(``) -- cgit v1.2.3