diff options
author | teisuru <31881306+teisuru@users.noreply.github.com> | 2023-08-22 16:21:38 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-12-10 18:16:55 +0100 |
commit | 00ae6d53325fdbe0cd42c0e1b6a0bafc9633a242 (patch) | |
tree | 0bf1c12a273a32484f1a6ac87bffd4aaa15c4a21 | |
parent | 13120044a829556a4b430539635c7c81741fed53 (diff) | |
download | plantagenet-00ae6d53325fdbe0cd42c0e1b6a0bafc9633a242.tar.gz |
boxes on map
-rw-r--r-- | data.js | 157 | ||||
-rw-r--r-- | play.js | 8 | ||||
-rw-r--r-- | tools/gendata.js | 231 |
3 files changed, 391 insertions, 5 deletions
@@ -268,5 +268,162 @@ cards:[ {"name":"L36","event":"Talbot to the Rescue","when":"hold","capability":"Chevaliers","this_lord":true,"lords":[23,24,25,26]}, {"name":"L37","event":"The Earl of Richmond","when":"this_levy","capability":"Madame La Grande","this_lord":true,"lords":[23,24,25,26]}, ], +favour:[ +{"name":"Bamburgh favour","box":{"x":637,"y":300,"w":60,"h":45}}, +{"name":"Newcastle favour","box":{"x":656,"y":419,"w":70,"h":77}}, +{"name":"Appleby favour","box":{"x":546,"y":465,"w":57,"h":52}}, +{"name":"Hexham favour","box":{"x":561,"y":395,"w":53,"h":47}}, +{"name":"Carlisle favour","box":{"x":436,"y":422,"w":81,"h":63}}, +{"name":"Harlech favour","box":{"x":278,"y":912,"w":67,"h":61}}, +{"name":"Pembroke favour","box":{"x":185,"y":1127,"w":58,"h":37}}, +{"name":"Cardiff favour","box":{"x":392,"y":1164,"w":65,"h":65}}, +{"name":"Hereford favour","box":{"x":476,"y":1040,"w":71,"h":65}}, +{"name":"Ludlow favour","box":{"x":476,"y":976,"w":54,"h":34}}, +{"name":"Shrewsbury favour","box":{"x":500,"y":865,"w":78,"h":69}}, +{"name":"Salisbury favour","box":{"x":610,"y":1268,"w":73,"h":66}}, +{"name":"Winchester favour","box":{"x":722,"y":1262,"w":71,"h":60}}, +{"name":"Guildford favour","box":{"x":841,"y":1249,"w":74,"h":59}}, +{"name":"Arundel favour","box":{"x":794,"y":1334,"w":56,"h":48}}, +{"name":"Southampton favour","box":{"x":677,"y":1371,"w":60,"h":48}}, +{"name":"Rochester favour","box":{"x":983,"y":1185,"w":65,"h":68}}, +{"name":"Dover favour","box":{"x":1041,"y":1287,"w":53,"h":41}}, +{"name":"Canterbury favour","box":{"x":1059,"y":1203,"w":66,"h":65}}, +{"name":"Hastings favour","box":{"x":983,"y":1322,"w":55,"h":46}}, +{"name":"Dorchester favour","box":{"x":524,"y":1368,"w":58,"h":49}}, +{"name":"Exeter favour","box":{"x":342,"y":1376,"w":64,"h":66}}, +{"name":"Plymouth favour","box":{"x":253,"y":1417,"w":58,"h":50}}, +{"name":"Launceston favour","box":{"x":201,"y":1354,"w":68,"h":60}}, +{"name":"Truro favour","box":{"x":142,"y":1445,"w":56,"h":53}}, +{"name":"Wells favour","box":{"x":504,"y":1262,"w":68,"h":66}}, +{"name":"Bristol favour","box":{"x":498,"y":1185,"w":63,"h":58}}, +{"name":"Gloucester favour","box":{"x":564,"y":1092,"w":68,"h":62}}, +{"name":"Oxford favour","box":{"x":707,"y":1101,"w":70,"h":63}}, +{"name":"Newbury favour","box":{"x":665,"y":1194,"w":66,"h":44}}, +{"name":"London favour","box":{"x":874,"y":1164,"w":94,"h":72}}, +{"name":"St Albans favour","box":{"x":901,"y":1092,"w":54,"h":40}}, +{"name":"Bedford favour","box":{"x":836,"y":1044,"w":65,"h":48}}, +{"name":"Cambridge favour","box":{"x":901,"y":1021,"w":54,"h":45}}, +{"name":"Bury St Edmunds favour","box":{"x":997,"y":995,"w":54,"h":45}}, +{"name":"Ipswich favour","box":{"x":1100,"y":1030,"w":58,"h":43}}, +{"name":"Norwich favour","box":{"x":1059,"y":890,"w":67,"h":62}}, +{"name":"Lynn favour","box":{"x":962,"y":895,"w":47,"h":38}}, +{"name":"Ely favour","box":{"x":921,"y":952,"w":65,"h":66}}, +{"name":"Peterborough favour","box":{"x":828,"y":930,"w":66,"h":62}}, +{"name":"Northampton favour","box":{"x":748,"y":1013,"w":64,"h":54}}, +{"name":"Coventry favour","box":{"x":675,"y":967,"w":67,"h":63}}, +{"name":"Leicester favour","box":{"x":758,"y":906,"w":49,"h":46}}, +{"name":"Lichfield favour","box":{"x":613,"y":906,"w":74,"h":61}}, +{"name":"Derby favour","box":{"x":656,"y":845,"w":62,"h":49}}, +{"name":"Nottingham favour","box":{"x":718,"y":845,"w":73,"h":40}}, +{"name":"Worcester favour","box":{"x":556,"y":992,"w":72,"h":64}}, +{"name":"Chester favour","box":{"x":433,"y":797,"w":78,"h":64}}, +{"name":"Lancaster favour","box":{"x":476,"y":595,"w":70,"h":51}}, +{"name":"Lincoln favour","box":{"x":767,"y":760,"w":78,"h":64}}, +{"name":"York favour","box":{"x":691,"y":623,"w":76,"h":65}}, +{"name":"Calais favour","box":{"x":1134,"y":1418,"w":67,"h":79}}, +{"name":"France favour","box":{"x":890,"y":1430,"w":109,"h":114}}, +{"name":"Scotland favour","box":{"x":450,"y":278,"w":111,"h":118}}, +{"name":"Ireland favour","box":{"x":50,"y":949,"w":110,"h":121}}, +{"name":"Burgundy favour","box":{"x":996,"y":688,"w":110,"h":121}}, +{"name":"Scarborough favour","box":{"x":791,"y":532,"w":78,"h":57}}, +{"name":"Ravenspur favour","box":{"x":835,"y":721,"w":72,"h":45}}, +], +deplete:[ +{"name":"Bamburgh deplete","box":{"x":647,"y":290,"w":60,"h":45}}, +{"name":"Newcastle deplete","box":{"x":668,"y":409,"w":70,"h":77}}, +{"name":"Appleby deplete","box":{"x":556,"y":455,"w":57,"h":52}}, +{"name":"Hexham deplete","box":{"x":571,"y":385,"w":53,"h":47}}, +{"name":"Carlisle deplete","box":{"x":446,"y":412,"w":81,"h":63}}, +{"name":"Harlech deplete","box":{"x":288,"y":902,"w":67,"h":61}}, +{"name":"Pembroke deplete","box":{"x":195,"y":1117,"w":58,"h":37}}, +{"name":"Cardiff deplete","box":{"x":382,"y":1154,"w":65,"h":65}}, +{"name":"Hereford deplete","box":{"x":466,"y":1030,"w":71,"h":65}}, +{"name":"Ludlow deplete","box":{"x":486,"y":966,"w":54,"h":34}}, +{"name":"Shrewsbury deplete","box":{"x":510,"y":855,"w":78,"h":69}}, +{"name":"Salisbury deplete","box":{"x":620,"y":1258,"w":73,"h":66}}, +{"name":"Winchester deplete","box":{"x":732,"y":1252,"w":71,"h":60}}, +{"name":"Guildford deplete","box":{"x":851,"y":1259,"w":74,"h":59}}, +{"name":"Arundel deplete","box":{"x":784,"y":1324,"w":56,"h":48}}, +{"name":"Southampton deplete","box":{"x":667,"y":1361,"w":60,"h":48}}, +{"name":"Rochester deplete","box":{"x":993,"y":1175,"w":65,"h":68}}, +{"name":"Dover deplete","box":{"x":1031,"y":1277,"w":53,"h":41}}, +{"name":"Canterbury deplete","box":{"x":1069,"y":1193,"w":66,"h":65}}, +{"name":"Hastings deplete","box":{"x":973,"y":1312,"w":55,"h":46}}, +{"name":"Dorchester deplete","box":{"x":514,"y":1358,"w":58,"h":49}}, +{"name":"Exeter deplete","box":{"x":352,"y":1366,"w":64,"h":66}}, +{"name":"Plymouth deplete","box":{"x":263,"y":1407,"w":58,"h":50}}, +{"name":"Launceston deplete","box":{"x":211,"y":1344,"w":68,"h":60}}, +{"name":"Truro deplete","box":{"x":132,"y":1435,"w":56,"h":53}}, +{"name":"Wells deplete","box":{"x":514,"y":1252,"w":68,"h":66}}, +{"name":"Bristol deplete","box":{"x":508,"y":1175,"w":63,"h":58}}, +{"name":"Gloucester deplete","box":{"x":574,"y":1082,"w":68,"h":62}}, +{"name":"Oxford deplete","box":{"x":697,"y":1091,"w":70,"h":63}}, +{"name":"Newbury deplete","box":{"x":655,"y":1184,"w":66,"h":44}}, +{"name":"London deplete","box":{"x":864,"y":1154,"w":94,"h":72}}, +{"name":"St Albans deplete","box":{"x":891,"y":1102,"w":54,"h":40}}, +{"name":"Bedford deplete","box":{"x":826,"y":1034,"w":65,"h":48}}, +{"name":"Cambridge deplete","box":{"x":911,"y":1031,"w":54,"h":45}}, +{"name":"Bury St Edmunds deplete","box":{"x":1007,"y":985,"w":54,"h":45}}, +{"name":"Ipswich deplete","box":{"x":1110,"y":1020,"w":58,"h":43}}, +{"name":"Norwich deplete","box":{"x":1069,"y":880,"w":67,"h":62}}, +{"name":"Lynn deplete","box":{"x":972,"y":885,"w":47,"h":38}}, +{"name":"Ely deplete","box":{"x":931,"y":942,"w":65,"h":66}}, +{"name":"Peterborough deplete","box":{"x":838,"y":920,"w":66,"h":62}}, +{"name":"Northampton deplete","box":{"x":758,"y":1003,"w":64,"h":54}}, +{"name":"Coventry deplete","box":{"x":685,"y":957,"w":67,"h":63}}, +{"name":"Leicester deplete","box":{"x":768,"y":896,"w":49,"h":46}}, +{"name":"Lichfield deplete","box":{"x":603,"y":896,"w":74,"h":61}}, +{"name":"Derby deplete","box":{"x":656,"y":835,"w":62,"h":49}}, +{"name":"Nottingham deplete","box":{"x":728,"y":835,"w":73,"h":40}}, +{"name":"Worcester deplete","box":{"x":546,"y":982,"w":72,"h":64}}, +{"name":"Chester deplete","box":{"x":443,"y":787,"w":78,"h":64}}, +{"name":"Lancaster deplete","box":{"x":486,"y":585,"w":70,"h":51}}, +{"name":"Lincoln deplete","box":{"x":777,"y":750,"w":78,"h":64}}, +{"name":"York deplete","box":{"x":701,"y":613,"w":76,"h":65}}, +{"name":"Calais deplete","box":{"x":1145,"y":1408,"w":67,"h":79}}, +{"name":"France deplete","box":{"x":890,"y":1420,"w":109,"h":114}}, +{"name":"Scotland deplete","box":{"x":450,"y":268,"w":111,"h":118}}, +{"name":"Ireland deplete","box":{"x":50,"y":939,"w":110,"h":121}}, +{"name":"Burgundy deplete","box":{"x":996,"y":678,"w":110,"h":121}}, +{"name":"Scarborough deplete","box":{"x":801,"y":522,"w":78,"h":57}}, +{"name":"Ravenspur deplete","box":{"x":845,"y":711,"w":72,"h":45}}, +], +seat:[ +{"name":"Arundel seat","box":{"x":850,"y":1330,"w":54,"h":56}}, +{"name":"Somerset seat","box":{"x":453,"y":1248,"w":54,"h":56}}, +{"name":"Pembroke seat","box":{"x":145,"y":1108,"w":54,"h":56}}, +{"name":"Devon seat","box":{"x":405,"y":1391,"w":54,"h":56}}, +{"name":"Exeter seat","box":{"x":405,"y":1391,"w":54,"h":56}}, +{"name":"Warwick seat","box":{"x":1118,"y":1385,"w":54,"h":56}}, +{"name":"Rutland seat","box":{"x":1113,"y":1181,"w":54,"h":56}}, +{"name":"Oxford seat","box":{"x":771,"y":1092,"w":54,"h":56}}, +{"name":"Jasper_Tudor2 seat","box":{"x":147,"y":1067,"w":54,"h":56}}, +{"name":"Jasper_Tudor1 seat","box":{"x":230,"y":888,"w":54,"h":56}}, +{"name":"March seat","box":{"x":432,"y":947,"w":54,"h":56}}, +{"name":"Northumberland seat","box":{"x":397,"y":405,"w":54,"h":56}}, +{"name":"Clarence seat","box":{"x":654,"y":593,"w":54,"h":56}}, +{"name":"Salisbury seat","box":{"x":653,"y":617,"w":54,"h":56}}, +{"name":"Gloucester seat","box":{"x":620,"y":1061,"w":54,"h":56}}, +{"name":"Richard_III seat","box":{"x":944,"y":1169,"w":54,"h":56}}, +{"name":"Edward_IV seat","box":{"x":944,"y":1169,"w":54,"h":56}}, +{"name":"Henry Tudor seat","box":{"x":944,"y":1144,"w":54,"h":56}}, +{"name":"Margaret seat","box":{"x":944,"y":1144,"w":54,"h":56}}, +{"name":"Henry_VI seat","box":{"x":944,"y":1144,"w":54,"h":56}}, +], +vassalbox:[ +{"name":"Lincoln vassal","box":{"x":726,"y":763,"w":54,"h":56}}, +{"name":"Launceston vassal","box":{"x":146,"y":1359,"w":54,"h":56}}, +{"name":"Exeter vassal","box":{"x":406,"y":1381,"w":54,"h":56}}, +{"name":"Arundel vassal","box":{"x":850,"y":1330,"w":54,"h":56}}, +{"name":"Dover vassal","box":{"x":1094,"y":1279,"w":54,"h":56}}, +{"name":"Ipswich vassal","box":{"x":1156,"y":1020,"w":54,"h":56}}, +{"name":"St Albans vassal","box":{"x":955,"y":1082,"w":54,"h":56}}, +{"name":"Oxford vassal","box":{"x":776,"y":1109,"w":54,"h":56}}, +{"name":"Worcester vassal","box":{"x":616,"y":999,"w":54,"h":56}}, +{"name":"Shrewsbury vassal","box":{"x":453,"y":881,"w":54,"h":56}}, +{"name":"Leicester vassal","box":{"x":704,"y":898,"w":54,"h":56}}, +{"name":"Derby vassal","box":{"x":605,"y":836,"w":54,"h":56}}, +{"name":"Appleby vassal","box":{"x":602,"y":466,"w":54,"h":56}}, +], } if (typeof module !== 'undefined') module.exports = data @@ -680,12 +680,12 @@ function build_map() { // Locale Markers e = ui.locale_markers[ix] = document.createElement("div") - e.className = "locale_markers " + locale.type + " " + region - x = locale_xy[ix][0] - 196/2 - y = locale_xy[ix][1] + 36 + e.className = "locale rose favour " + locale.name e.style.top = y + "px" e.style.left = x + "px" - e.style.width = 196 + "px" + e.style.width = w + "px" + e.style.height = h + "px" + e.style.border = "2px solid aqua" document.getElementById("pieces").appendChild(e) }) diff --git a/tools/gendata.js b/tools/gendata.js index 52da6d7..ae55965 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -172,6 +172,7 @@ const boxes = { "Southampton favour": [677,1371,60,48], "Dorchester favour": [524,1368,58,49], "Exeter favour": [342,1376,64,66], + "Ireland favour": [50,949,110,121], "Launceston favour": [201,1354,68,60], "Truro favour": [142,1445,56,53], "Lichfield favour": [613,906,74,61], @@ -300,7 +301,10 @@ var ways = [] var highways = [] var roads = [] var paths = [] - +var deplete = [] +var favour = [] +var seat = [] +var vassalbox = [] const scale = 1 @@ -316,8 +320,57 @@ function defloc(region, stronghold, type, name) { if (stronghold > 0) strongholds.push(locales.length) locales.push({ name, type, stronghold, region, ways: [], box: { x, y, w, h } }) +} +function defdepleted(name) { + let [x, y, w, h] = boxes[name] + x = Math.floor(x) + y = Math.floor(y) + w = Math.ceil(w) + h = Math.ceil(h) + locmap[name] = locales.length + deplete.push({ name, box: { x, y, w, h } }) } + +function deffavour(name) { + let [x, y, w, h] = boxes[name] + x = Math.floor(x) + y = Math.floor(y) + w = Math.ceil(w) + h = Math.ceil(h) + locmap[name] = locales.length + favour.push({ name, box: { x, y, w, h } }) +} + +function defseat(name) { + let [x, y, w, h] = boxes[name] + x = Math.floor(x) + y = Math.floor(y) + w = Math.ceil(w) + h = Math.ceil(h) + locmap[name] = locales.length + seat.push({ name, box: { x, y, w, h } }) +} +function defseat(name) { + let [x, y, w, h] = boxes[name] + x = Math.floor(x) + y = Math.floor(y) + w = Math.ceil(w) + h = Math.ceil(h) + locmap[name] = locales.length + seat.push({ name, box: { x, y, w, h } }) +} + +function defvassal(name) { + let [x, y, w, h] = boxes[name] + x = Math.floor(x) + y = Math.floor(y) + w = Math.ceil(w) + h = Math.ceil(h) + locmap[name] = locales.length + vassalbox.push({ name, box: { x, y, w, h } }) +} + function defway(type, list) { let ix = ways.length list = list.map(name=>locmap[name]).sort(cmpnum) @@ -340,6 +393,8 @@ function highway(locs) { return defway('highway', locs.split(", ")) } function road(locs) { return defway('road', locs.split(", ")) } function path(locs) { return defway('path', locs.split(", ")) } + +// LOCALES defloc("North", 1, "fortress", "Bamburgh") defloc("North", 1, "city", "Newcastle") defloc("North", 1, "town", "Appleby") @@ -406,6 +461,176 @@ defloc("England", 1, "sea", "English Channel") defloc("England", 1, "sea", "Irish Sea") defloc("England", 1, "sea", "North Sea") +// LOCALE DEPLETION + +defdepleted("Bamburgh deplete") +defdepleted("Newcastle deplete") +defdepleted("Appleby deplete") +defdepleted("Hexham deplete") +defdepleted("Carlisle deplete") + + +defdepleted("Harlech deplete") +defdepleted("Pembroke deplete") +defdepleted("Cardiff deplete") +defdepleted("Hereford deplete") +defdepleted("Ludlow deplete") +defdepleted("Shrewsbury deplete") + +defdepleted("Salisbury deplete") +defdepleted("Winchester deplete") +defdepleted("Guildford deplete") +defdepleted("Arundel deplete") +defdepleted("Southampton deplete") +defdepleted("Rochester deplete") +defdepleted("Dover deplete") +defdepleted("Canterbury deplete") +defdepleted("Hastings deplete") + +defdepleted("Dorchester deplete") +defdepleted("Exeter deplete") +defdepleted("Plymouth deplete") +defdepleted("Launceston deplete") +defdepleted("Truro deplete") +defdepleted("Wells deplete") +defdepleted("Bristol deplete") +defdepleted("Gloucester deplete") +defdepleted("Oxford deplete") +defdepleted("Newbury deplete") +defdepleted("London deplete") +defdepleted("St Albans deplete") +defdepleted("Bedford deplete") +defdepleted("Cambridge deplete") +defdepleted("Bury St Edmunds deplete") +defdepleted("Ipswich deplete") +defdepleted("Norwich deplete") +defdepleted("Lynn deplete") +defdepleted("Ely deplete") +defdepleted("Peterborough deplete") +defdepleted("Northampton deplete") +defdepleted("Coventry deplete") +defdepleted("Leicester deplete") +defdepleted("Lichfield deplete") +defdepleted("Derby deplete") +defdepleted("Nottingham deplete") +defdepleted("Worcester deplete") +defdepleted("Chester deplete") +defdepleted("Lancaster deplete") +defdepleted("Lincoln deplete") +defdepleted("York deplete") +defdepleted("Calais deplete") +defdepleted("France deplete") +defdepleted("Scotland deplete") +defdepleted("Ireland deplete") +defdepleted("Burgundy deplete") +defdepleted("Scarborough deplete") +defdepleted("Ravenspur deplete") + +// LOCALE FAVOUR + +deffavour("Bamburgh favour") +deffavour("Newcastle favour") +deffavour("Appleby favour") +deffavour("Hexham favour") +deffavour("Carlisle favour") + + +deffavour("Harlech favour") +deffavour("Pembroke favour") +deffavour("Cardiff favour") +deffavour("Hereford favour") +deffavour("Ludlow favour") +deffavour("Shrewsbury favour") + +deffavour("Salisbury favour") +deffavour("Winchester favour") +deffavour("Guildford favour") +deffavour("Arundel favour") +deffavour("Southampton favour") +deffavour("Rochester favour") +deffavour("Dover favour") +deffavour("Canterbury favour") +deffavour("Hastings favour") + +deffavour("Dorchester favour") +deffavour("Exeter favour") +deffavour("Plymouth favour") +deffavour("Launceston favour") +deffavour("Truro favour") +deffavour("Wells favour") +deffavour("Bristol favour") +deffavour("Gloucester favour") +deffavour("Oxford favour") +deffavour("Newbury favour") +deffavour("London favour") +deffavour("St Albans favour") +deffavour("Bedford favour") +deffavour("Cambridge favour") +deffavour("Bury St Edmunds favour") +deffavour("Ipswich favour") +deffavour("Norwich favour") +deffavour("Lynn favour") +deffavour("Ely favour") +deffavour("Peterborough favour") +deffavour("Northampton favour") +deffavour("Coventry favour") +deffavour("Leicester favour") +deffavour("Lichfield favour") +deffavour("Derby favour") +deffavour("Nottingham favour") +deffavour("Worcester favour") +deffavour("Chester favour") +deffavour("Lancaster favour") +deffavour("Lincoln favour") +deffavour("York favour") +deffavour("Calais favour") +deffavour("France favour") +deffavour("Scotland favour") +deffavour("Ireland favour") +deffavour("Burgundy favour") +deffavour("Scarborough favour") +deffavour("Ravenspur favour") + +//LOCALE SEAT + +defseat("Arundel seat") +defseat("Somerset seat") +defseat("Pembroke seat") +defseat("Devon seat") +defseat("Exeter seat") +defseat("Warwick seat") +defseat("Rutland seat") +defseat("Oxford seat") +defseat("Jasper_Tudor2 seat") +defseat("Jasper_Tudor1 seat") +defseat("March seat") +defseat("Northumberland seat") +defseat("Clarence seat") +defseat("Salisbury seat") +defseat("Gloucester seat") +defseat("Richard_III seat") +defseat("Edward_IV seat") +defseat("Henry Tudor seat") +defseat("Margaret seat") +defseat("Henry_VI seat") + +// VASSAL SEAT + +defvassal ("Lincoln vassal") +defvassal("Launceston vassal") +defvassal("Exeter vassal") +defvassal("Arundel vassal") +defvassal("Dover vassal") +defvassal("Ipswich vassal") +defvassal("St Albans vassal") +defvassal("Oxford vassal") +defvassal("Worcester vassal") +defvassal("Shrewsbury vassal") +defvassal("Leicester vassal") +defvassal("Derby vassal") +defvassal("Appleby vassal") + +//WAYS BETWEEN LOCALES highway("Bamburgh, Newcastle") highway("Newcastle, York") @@ -1449,6 +1674,10 @@ dumplist("ways", ways) dumplist("lords", lords) dumplist("vassals", vassals) dumplist("cards", cards) +dumplist("favour", favour) +dumplist("deplete",deplete) +dumplist("seat", seat) +dumplist("vassalbox", vassalbox) print("}") print("if (typeof module !== 'undefined') module.exports = data") |