summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-01-27 16:45:35 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-27 16:45:35 +0100
commitc27e84935e3a711a8d68a8b1ce1c80c87e74bbe0 (patch)
tree9cea354ac353c56ed9e8be05441a4d68540e483f
parentc9e742fbddc7b728ad0ca1d9c63c78c88695b040 (diff)
downloadplantagenet-c27e84935e3a711a8d68a8b1ce1c80c87e74bbe0.tar.gz
Add "all_ports" array.
-rw-r--r--data.js1
-rw-r--r--rules.js3
-rw-r--r--tools/gendata.js3
3 files changed, 5 insertions, 2 deletions
diff --git a/data.js b/data.js
index 4a114f1..134ab69 100644
--- a/data.js
+++ b/data.js
@@ -10,6 +10,7 @@ sea_3:59,
port_1:[0,1,35,37,56,57],
port_2:[14,15,17,19,20,21,22,24,51],
port_3:[5,6,26],
+all_ports:[0,1,5,6,14,15,17,19,20,21,22,24,26,35,37,51,56,57],
way_exile_1:[0,1,35,37,55,56,57,60],
way_exile_2:[14,15,17,19,20,21,22,24,51,52,58],
way_exile_3:[5,6,26,54,59],
diff --git a/rules.js b/rules.js
index 7959bd0..bdaca89 100644
--- a/rules.js
+++ b/rules.js
@@ -598,7 +598,8 @@ const TURN_NAME = [
]
function find_ports(here) {
- if ((lord_has_capability(game.group, AOW_YORK_GREAT_SHIPS) || lord_has_capability(game.group, AOW_LANCASTER_GREAT_SHIPS))) return data.port_1.concat(data.port_2, data.port_3)
+ if ((lord_has_capability(game.group, AOW_YORK_GREAT_SHIPS) || lord_has_capability(game.group, AOW_LANCASTER_GREAT_SHIPS)))
+ return data.all_ports
if (here === data.sea_1) return data.port_1
if (here === data.sea_2) return data.port_2
if (here === data.sea_3) return data.port_3
diff --git a/tools/gendata.js b/tools/gendata.js
index 92cadd2..4fbf017 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -783,7 +783,7 @@ let exile_3 = locmap["Ireland"]
let port_1 = ["Bamburgh", "Newcastle", "Scarborough", "Ravenspur", "Lynn", "Ipswich"].map(name => locmap[name]).sort(cmpnum)
let port_2 = ["Dover", "Hastings", "Calais", "Arundel", "Southampton", "Dorchester", "Exeter", "Plymouth", "Truro"].map(name => locmap[name]).sort(cmpnum)
let port_3 = ["Bristol","Pembroke","Harlech"].map(name => locmap[name]).sort(cmpnum)
-
+let all_ports = [ ...port_1, ...port_2, ...port_3 ].sort(cmpnum)
let seaports = [
"English Channel", "Bamburgh", "Newcastle", "Scarborough", "Ravenspur", "Lynn", "Ipswich", "North Sea", "Burgundy", "Dover", "Hastings", "Calais", "France", "Arundel", "Southampton","Dorchester","Exeter","Plymouth","Truro","Bristol","Pembroke","Harlech", "Ireland", "Irish Sea"
@@ -1717,6 +1717,7 @@ print("sea_3:" + JSON.stringify(sea_3) + ",")
print("port_1:" + JSON.stringify(port_1) + ",")
print("port_2:" + JSON.stringify(port_2) + ",")
print("port_3:" + JSON.stringify(port_3) + ",")
+print("all_ports:" + JSON.stringify(all_ports) + ",")
print("way_exile_1:" + JSON.stringify(way_exile_1) + ",")
print("way_exile_2:" + JSON.stringify(way_exile_2) + ",")
print("way_exile_3:" + JSON.stringify(way_exile_3) + ",")