summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-03-05 20:34:55 +0100
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:15 +0200
commit2d66908b20d43a39974f99a0ec74212eaa5031ed (patch)
tree12d8197c8110604fbfb61afac5ff21d400bedfed /tools
parent71c0e5bc691ce148515ebf4d6e2fba96c85c2ccb (diff)
downloadandean-abyss-2d66908b20d43a39974f99a0ec74212eaa5031ed.tar.gz
Patrol, Sweep & Assault.
TODO: LimOp Patrol - only move to one destination.
Diffstat (limited to 'tools')
-rw-r--r--tools/gendata.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/gendata.js b/tools/gendata.js
index 4fd79a2..4d773e9 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -156,7 +156,7 @@ function def_loc(type, econ, cities, depts) {
console.log("not a space: " + n)
let loc_spaces = loc_names.map(n => space_name.indexOf(n))
let ix = spaces.length
- spaces.push({ type, id: to_ascii(name), econ, adjacent: loc_spaces.filter(x=>x>0) })
+ spaces.push({ type, id: to_ascii(name), econ, adjacent: loc_spaces.filter(x => x >= 0) })
for (let loc of loc_spaces)
if (loc >= 0)
add(spaces[loc].adjacent, ix)
@@ -414,6 +414,14 @@ data.card_order = card_order
data.space_name = space_name
data.spaces = spaces
+data.adjacent_patrol = []
+for (let s = 0; s < spaces.length; ++s) {
+ let ap = data.adjacent_patrol[s] = []
+ for (let next of spaces[s].adjacent)
+ if ((next <= data.last_city) || (next >= data.first_loc && next <= data.last_loc))
+ ap.push(next)
+}
+
let pc_index = 0
let pc_first = data.first_piece = [ [ 0, 0, 0, 0, 0 ], [ 0, 0 ], [ 0, 0 ], [ 0, 0 ] ]
let pc_last = data.last_piece = [ [ -1, -1, -1, -1, -1 ], [ -1, -1 ], [ -1, -1 ], [ -1, -1 ] ]