summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-06 20:05:26 +0200
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:16:55 +0100
commit289e9eb5cc729bb8a9f17799de5d95b7d01e82f3 (patch)
tree4902bcb0283ebc7798768ea3a56cb4ff4d9e41ae
parent7c8e6250551a11250957cce4cc30256067c07c8c (diff)
downloadplantagenet-289e9eb5cc729bb8a9f17799de5d95b7d01e82f3.tar.gz
don't use 1-element arrays for vassal seat
-rw-r--r--data.js38
-rw-r--r--rules.js8
-rw-r--r--tools/gendata.js40
3 files changed, 43 insertions, 43 deletions
diff --git a/data.js b/data.js
index c3aa5f9..cd6f058 100644
--- a/data.js
+++ b/data.js
@@ -195,25 +195,25 @@ lords:[
{"side":"Lancaster","name":"Warwick L","full_name":"Richard Neville","title":"Earl of Warwick","seats":[51],"marshal":1,"influence":5,"lordship":3,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3},"assets":{"cart":2,"prov":2,"coin":2},"ships":2,"id":"lord_warwick_l"},
],
vassals:[
-{"service":3,"name":"Westmoreland","seat":[2],"influence":0},
-{"service":1,"name":"Stanley","seat":[44],"influence":0},
-{"service":1,"name":"Dudley","seat":[42],"influence":0},
-{"service":2,"name":"Shrewsbury","seat":[10],"influence":-1},
-{"service":3,"name":"Worcester","seat":[46],"influence":0},
-{"service":2,"name":"Oxford","seat":[28],"influence":0},
-{"service":1,"name":"Essex","seat":[31],"influence":0},
-{"service":3,"name":"Suffolk","seat":[35],"influence":1},
-{"service":3,"name":"Fauconberg","seat":[17],"influence":2},
-{"service":1,"name":"Norfolk","seat":[14],"influence":0},
-{"service":2,"name":"Devon","seat":[21],"influence":-1},
-{"service":1,"name":"Bonville","seat":[23],"influence":1},
-{"service":1,"name":"Beaumont","seat":[49],"influence":-2},
-{"service":0,"name":"Trollope","seat":[],"influence":0,"capability":"Andrew Trollope"},
-{"service":0,"name":"Clifford","seat":[],"influence":0,"capability":"My father's blood"},
-{"service":0,"name":"Edward","seat":[],"influence":0,"capability":"Edward"},
-{"service":0,"name":"Thomas Stanley","seat":[],"influence":0,"capability":"Thomas Stanley"},
-{"service":0,"name":"Montagu","seat":[],"influence":0,"capability":"Alice Montagu"},
-{"service":0,"name":"Hastings","seat":[],"influence":0,"capability":"Hastings"},
+{"service":3,"name":"Westmoreland","seat":2,"influence":0},
+{"service":1,"name":"Stanley","seat":44,"influence":0},
+{"service":1,"name":"Dudley","seat":42,"influence":0},
+{"service":2,"name":"Shrewsbury","seat":10,"influence":-1},
+{"service":3,"name":"Worcester","seat":46,"influence":0},
+{"service":2,"name":"Oxford","seat":28,"influence":0},
+{"service":1,"name":"Essex","seat":31,"influence":0},
+{"service":3,"name":"Suffolk","seat":35,"influence":1},
+{"service":3,"name":"Fauconberg","seat":17,"influence":2},
+{"service":1,"name":"Norfolk","seat":14,"influence":0},
+{"service":2,"name":"Devon","seat":21,"influence":-1},
+{"service":1,"name":"Bonville","seat":23,"influence":1},
+{"service":1,"name":"Beaumont","seat":49,"influence":-2},
+{"service":0,"name":"Trollope","seat":-1,"influence":0,"capability":"Andrew Trollope"},
+{"service":0,"name":"Clifford","seat":-1,"influence":0,"capability":"My father's blood"},
+{"service":0,"name":"Edward","seat":-1,"influence":0,"capability":"Edward"},
+{"service":0,"name":"Thomas Stanley","seat":-1,"influence":0,"capability":"Thomas Stanley"},
+{"service":0,"name":"Montagu","seat":-1,"influence":0,"capability":"Alice Montagu"},
+{"service":0,"name":"Hastings","seat":-1,"influence":0,"capability":"Hastings"},
],
cards:[
{"name":"Y1","event":"Leeward Battle Line","when":"hold","capability":"Culverins and falconets","this_lord":true,"lords":[0,1,2,3,4,5,6,7,8,9,10,11,12,13]},
diff --git a/rules.js b/rules.js
index 8c706f8..5d9db10 100644
--- a/rules.js
+++ b/rules.js
@@ -1257,7 +1257,7 @@ function setup_vassals(excludes = []) {
for (let x = first_vassal; x < last_vassal; x++) {
if (!excludes.includes(x) && data.vassals[x].capability === undefined) {
set_vassal_ready(x)
- set_vassal_on_map(x, data.vassals[x].seat[0])
+ set_vassal_on_map(x, data.vassals[x].seat)
}
}
}
@@ -4374,8 +4374,8 @@ function get_possible_taxable_locales(lord) {
// vassal seats
for_each_vassal_with_lord(lord, v => {
- if (is_possible_taxable_locale(data.vassals[v].seat[0]))
- locales.push(data.vassals[v].seat[0])
+ if (is_possible_taxable_locale(data.vassals[v].seat))
+ locales.push(data.vassals[v].seat)
})
// London
@@ -6596,7 +6596,7 @@ function goto_ready_vassals() {
for (let vassal = first_vassal; vassal <= last_vassal; vassal++) {
if (is_vassal_unavailable(vassal) && get_vassal_locale(vassal) === CALENDAR + current_turn()) {
set_vassal_ready(vassal)
- set_vassal_on_map(vassal, data.vassals[vassal].seat[0])
+ set_vassal_on_map(vassal, data.vassals[vassal].seat)
}
}
diff --git a/tools/gendata.js b/tools/gendata.js
index 424a111..3a7d178 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -1678,26 +1678,26 @@ lords.forEach(lord => {
lord.id = "lord_" + clean_name(lord.name)
})
-vassal(3, "Westmoreland", seats("Appleby"), 0)
-vassal(1, "Stanley", seats("Derby"), 0)
-vassal(1, "Dudley", seats("Leicester"), 0)
-vassal(2, "Shrewsbury", seats("Shrewsbury"), -1)
-vassal(3, "Worcester", seats("Worcester"), 0)
-vassal(2, "Oxford", seats("Oxford"), 0)
-vassal(1, "Essex", seats("St Albans"), 0)
-vassal(3, "Suffolk", seats("Ipswich"), 1)
-vassal(3, "Fauconberg", seats("Dover"), 2)
-vassal(1, "Norfolk", seats("Arundel"), 0)
-vassal(2, "Devon", seats("Exeter"), -1)
-vassal(1, "Bonville", seats("Launceston"), 1)
-vassal(1, "Beaumont", seats("Lincoln"), -2)
-
-vassal(0, "Trollope", seats(''), 0, "Andrew Trollope")
-vassal(0, "Clifford", seats(''), 0, "My father's blood")
-vassal(0, "Edward", seats(''), 0, "Edward")
-vassal(0, "Thomas Stanley", seats(''), 0, "Thomas Stanley")
-vassal(0, "Montagu", seats(''), 0, "Alice Montagu")
-vassal(0, "Hastings", seats(''), 0, "Hastings")
+vassal(3, "Westmoreland", locmap["Appleby"], 0)
+vassal(1, "Stanley", locmap["Derby"], 0)
+vassal(1, "Dudley", locmap["Leicester"], 0)
+vassal(2, "Shrewsbury", locmap["Shrewsbury"], -1)
+vassal(3, "Worcester", locmap["Worcester"], 0)
+vassal(2, "Oxford", locmap["Oxford"], 0)
+vassal(1, "Essex", locmap["St Albans"], 0)
+vassal(3, "Suffolk", locmap["Ipswich"], 1)
+vassal(3, "Fauconberg", locmap["Dover"], 2)
+vassal(1, "Norfolk", locmap["Arundel"], 0)
+vassal(2, "Devon", locmap["Exeter"], -1)
+vassal(1, "Bonville", locmap["Launceston"], 1)
+vassal(1, "Beaumont", locmap["Lincoln"], -2)
+
+vassal(0, "Trollope", -1, 0, "Andrew Trollope")
+vassal(0, "Clifford", -1, 0, "My father's blood")
+vassal(0, "Edward", -1, 0, "Edward")
+vassal(0, "Thomas Stanley", -1, 0, "Thomas Stanley")
+vassal(0, "Montagu", -1, 0, "Alice Montagu")
+vassal(0, "Hastings", -1, 0, "Hastings")
print("const data = {")
print("seaports:" + JSON.stringify(seaports) + ",")