diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-02 18:39:25 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-12-10 18:13:09 +0100 |
commit | daf0e6956a392ffb54215156c193924d1b209ba2 (patch) | |
tree | 89486175153f95e39585be2f74aa6ad5d59a1f5b | |
parent | 86ed19aa0765a974cac5518f533afab496f334ec (diff) | |
download | plantagenet-daf0e6956a392ffb54215156c193924d1b209ba2.tar.gz |
More cutting.
-rw-r--r-- | data.js | 122 | ||||
-rw-r--r-- | play.css | 4 | ||||
-rw-r--r-- | play.html | 5 | ||||
-rw-r--r-- | play.js | 538 | ||||
-rw-r--r-- | rules.js | 46 | ||||
-rw-r--r-- | tools/gendata.js | 8 |
6 files changed, 177 insertions, 546 deletions
@@ -2,67 +2,67 @@ const data = { seaports:[1,5,6,15,17,19,20,21,22,24,26,35,37,51,56,57], strongholds:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60], locales:[ -{"name":"Bamburgh","type":"fortress","stronghold":1,"region":"North","ways":[[1,0]],"box":{"x":168,"y":84,"w":15,"h":12},"adjacent":[1],"adjacent_by_highway":[1],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[[1,0]],"roads":[],"paths":[]}, -{"name":"Newcastle","type":"city","stronghold":1,"region":"North","ways":[[0,0],[50,1],[3,22],[2,24],[56,71]],"box":{"x":173,"y":114,"w":18,"h":20},"adjacent":[0,2,3,50,56],"adjacent_by_highway":[0,50],"adjacent_by_road":[2,3,56],"adjacent_by_path":[],"highways":[[0,0],[50,1]],"roads":[[2,24],[3,22],[56,71]],"paths":[]}, -{"name":"Appleby","type":"town","stronghold":1,"region":"North","ways":[[4,23],[1,24],[48,65]],"box":{"x":146,"y":125,"w":15,"h":13},"adjacent":[1,4,48],"adjacent_by_highway":[],"adjacent_by_road":[1,4],"adjacent_by_path":[48],"highways":[],"roads":[[1,24],[4,23]],"paths":[[48,65]]}, -{"name":"Hexham","type":"town","stronghold":1,"region":"North","ways":[[4,21],[1,22]],"box":{"x":149,"y":108,"w":14,"h":12},"adjacent":[1,4],"adjacent_by_highway":[],"adjacent_by_road":[1,4],"adjacent_by_path":[],"highways":[],"roads":[[1,22],[4,21]],"paths":[]}, -{"name":"Carlisle","type":"town","stronghold":1,"region":"North","ways":[[3,21],[2,23]],"box":{"x":118,"y":115,"w":21,"h":16},"adjacent":[2,3],"adjacent_by_highway":[],"adjacent_by_road":[2,3],"adjacent_by_path":[],"highways":[],"roads":[[2,23],[3,21]],"paths":[]}, -{"name":"Harlech","type":"harlech","stronghold":1,"region":"Wales","ways":[[47,68],[6,69]],"box":{"x":79,"y":237,"w":17,"h":16},"adjacent":[6,47],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[6,47],"highways":[],"roads":[],"paths":[[6,69],[47,68]]}, -{"name":"Pembroke","type":"fortress","stronghold":1,"region":"Wales","ways":[[5,69],[7,70]],"box":{"x":55,"y":291,"w":15,"h":10},"adjacent":[5,7],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[5,7],"highways":[],"roads":[],"paths":[[5,69],[7,70]]}, -{"name":"Cardiff","type":"city","stronghold":1,"region":"Wales","ways":[[6,70]],"box":{"x":107,"y":300,"w":17,"h":17},"adjacent":[6],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[6],"highways":[],"roads":[],"paths":[[6,70]]}, -{"name":"Hereford","type":"city","stronghold":1,"region":"Wales","ways":[[27,12],[9,14]],"box":{"x":128,"y":269,"w":18,"h":17},"adjacent":[9,27],"adjacent_by_highway":[9,27],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[[9,14],[27,12]],"roads":[],"paths":[]}, -{"name":"Ludlow","type":"fortress","stronghold":1,"region":"Wales","ways":[[8,14],[10,45],[46,46]],"box":{"x":128,"y":253,"w":14,"h":9},"adjacent":[8,10,46],"adjacent_by_highway":[8],"adjacent_by_road":[10,46],"adjacent_by_path":[],"highways":[[8,14]],"roads":[[10,45],[46,46]],"paths":[]}, -{"name":"Shrewsbury","type":"city","stronghold":1,"region":"Wales","ways":[[47,27],[43,28],[9,45]],"box":{"x":134,"y":225,"w":20,"h":18},"adjacent":[9,43,47],"adjacent_by_highway":[],"adjacent_by_road":[9,43,47],"adjacent_by_path":[],"highways":[],"roads":[[9,45],[43,28],[47,27]],"paths":[]}, -{"name":"Salisbury","type":"city","stronghold":1,"region":"South","ways":[[12,18],[25,19],[15,54],[29,55],[20,56]],"box":{"x":162,"y":326,"w":19,"h":17},"adjacent":[12,15,20,25,29],"adjacent_by_highway":[12,25],"adjacent_by_road":[15,20,29],"adjacent_by_path":[],"highways":[[12,18],[25,19]],"roads":[[15,54],[20,56],[29,55]],"paths":[]}, -{"name":"Winchester","type":"city","stronghold":1,"region":"South","ways":[[13,17],[11,18],[15,53]],"box":{"x":190,"y":325,"w":18,"h":15},"adjacent":[11,13,15],"adjacent_by_highway":[11,13],"adjacent_by_road":[15],"adjacent_by_path":[],"highways":[[11,18],[13,17]],"roads":[[15,53]],"paths":[]}, -{"name":"Guildford","type":"city","stronghold":1,"region":"South","ways":[[30,16],[12,17]],"box":{"x":219,"y":321,"w":19,"h":15},"adjacent":[12,30],"adjacent_by_highway":[12,30],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[[12,17],[30,16]],"roads":[],"paths":[]}, -{"name":"Arundel","type":"town","stronghold":1,"region":"South","ways":[[19,51],[15,52]],"box":{"x":208,"y":343,"w":14,"h":12},"adjacent":[15,19],"adjacent_by_highway":[],"adjacent_by_road":[15,19],"adjacent_by_path":[],"highways":[],"roads":[[15,52],[19,51]],"paths":[]}, -{"name":"Southampton","type":"town","stronghold":1,"region":"South","ways":[[14,52],[12,53],[11,54]],"box":{"x":178,"y":352,"w":15,"h":12},"adjacent":[11,12,14],"adjacent_by_highway":[],"adjacent_by_road":[11,12,14],"adjacent_by_path":[],"highways":[],"roads":[[11,54],[12,53],[14,52]],"paths":[]}, -{"name":"Rochester","type":"city","stronghold":1,"region":"South","ways":[[30,47],[18,48]],"box":{"x":255,"y":305,"w":17,"h":17},"adjacent":[18,30],"adjacent_by_highway":[],"adjacent_by_road":[18,30],"adjacent_by_path":[],"highways":[],"roads":[[18,48],[30,47]],"paths":[]}, -{"name":"Dover","type":"town","stronghold":1,"region":"South","ways":[[18,49],[19,50]],"box":{"x":269,"y":331,"w":14,"h":11},"adjacent":[18,19],"adjacent_by_highway":[],"adjacent_by_road":[18,19],"adjacent_by_path":[],"highways":[],"roads":[[18,49],[19,50]],"paths":[]}, -{"name":"Canterbury","type":"city","stronghold":1,"region":"South","ways":[[16,48],[17,49]],"box":{"x":274,"y":310,"w":17,"h":17},"adjacent":[16,17],"adjacent_by_highway":[],"adjacent_by_road":[16,17],"adjacent_by_path":[],"highways":[],"roads":[[16,48],[17,49]],"paths":[]}, -{"name":"Hastings","type":"town","stronghold":1,"region":"South","ways":[[17,50],[14,51]],"box":{"x":255,"y":340,"w":14,"h":12},"adjacent":[14,17],"adjacent_by_highway":[],"adjacent_by_road":[14,17],"adjacent_by_path":[],"highways":[],"roads":[[14,51],[17,50]],"paths":[]}, -{"name":"Dorchester","type":"town","stronghold":1,"region":"England","ways":[[11,56],[25,57],[21,58]],"box":{"x":140,"y":351,"w":15,"h":13},"adjacent":[11,21,25],"adjacent_by_highway":[],"adjacent_by_road":[11,21,25],"adjacent_by_path":[],"highways":[],"roads":[[11,56],[21,58],[25,57]],"paths":[]}, -{"name":"Exeter","type":"city","stronghold":1,"region":"England","ways":[[20,58],[23,60],[22,61]],"box":{"x":95,"y":354,"w":16,"h":17},"adjacent":[20,22,23],"adjacent_by_highway":[],"adjacent_by_road":[20,22,23],"adjacent_by_path":[],"highways":[],"roads":[[20,58],[22,61],[23,60]],"paths":[]}, -{"name":"Plymouth","type":"town","stronghold":1,"region":"England","ways":[[21,61],[24,62]],"box":{"x":72,"y":363,"w":15,"h":13},"adjacent":[21,24],"adjacent_by_highway":[],"adjacent_by_road":[21,24],"adjacent_by_path":[],"highways":[],"roads":[[21,61],[24,62]],"paths":[]}, -{"name":"Launceston","type":"city","stronghold":1,"region":"England","ways":[[21,60],[24,63]],"box":{"x":59,"y":348,"w":17,"h":15},"adjacent":[21,24],"adjacent_by_highway":[],"adjacent_by_road":[21,24],"adjacent_by_path":[],"highways":[],"roads":[[21,60],[24,63]],"paths":[]}, -{"name":"Truro","type":"town","stronghold":1,"region":"England","ways":[[22,62],[23,63]],"box":{"x":45,"y":370,"w":14,"h":14},"adjacent":[22,23],"adjacent_by_highway":[],"adjacent_by_road":[22,23],"adjacent_by_path":[],"highways":[],"roads":[[22,62],[23,63]],"paths":[]}, -{"name":"Wells","type":"city","stronghold":1,"region":"England","ways":[[11,19],[20,57],[26,59]],"box":{"x":135,"y":325,"w":17,"h":17},"adjacent":[11,20,26],"adjacent_by_highway":[11],"adjacent_by_road":[20,26],"adjacent_by_path":[],"highways":[[11,19]],"roads":[[20,57],[26,59]],"paths":[]}, -{"name":"Bristol","type":"city","stronghold":1,"region":"England","ways":[[27,15],[25,59]],"box":{"x":134,"y":305,"w":16,"h":15},"adjacent":[25,27],"adjacent_by_highway":[27],"adjacent_by_road":[25],"adjacent_by_path":[],"highways":[[27,15]],"roads":[[25,59]],"paths":[]}, -{"name":"Gloucester","type":"city","stronghold":1,"region":"England","ways":[[28,11],[8,12],[46,13],[26,15]],"box":{"x":150,"y":282,"w":17,"h":16},"adjacent":[8,26,28,46],"adjacent_by_highway":[8,26,28,46],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[[8,12],[26,15],[28,11],[46,13]],"roads":[],"paths":[]}, -{"name":"Oxford","type":"city","stronghold":1,"region":"England","ways":[[30,10],[27,11],[40,43]],"box":{"x":186,"y":284,"w":18,"h":16},"adjacent":[27,30,40],"adjacent_by_highway":[27,30],"adjacent_by_road":[40],"adjacent_by_path":[],"highways":[[27,11],[30,10]],"roads":[[40,43]],"paths":[]}, -{"name":"Newbury","type":"town","stronghold":1,"region":"England","ways":[[11,55]],"box":{"x":175,"y":308,"w":17,"h":11},"adjacent":[11],"adjacent_by_highway":[],"adjacent_by_road":[11],"adjacent_by_path":[],"highways":[],"roads":[[11,55]],"paths":[]}, -{"name":"London","type":"london","stronghold":1,"region":"England","ways":[[31,9],[28,10],[13,16],[16,47]],"box":{"x":228,"y":300,"w":24,"h":18},"adjacent":[13,16,28,31],"adjacent_by_highway":[13,28,31],"adjacent_by_road":[16],"adjacent_by_path":[],"highways":[[13,16],[28,10],[31,9]],"roads":[[16,47]],"paths":[]}, -{"name":"St Albans","type":"town","stronghold":1,"region":"England","ways":[[32,7],[33,8],[30,9],[35,38]],"box":{"x":234,"y":282,"w":14,"h":10},"adjacent":[30,32,33,35],"adjacent_by_highway":[30,32,33],"adjacent_by_road":[35],"adjacent_by_path":[],"highways":[[30,9],[32,7],[33,8]],"roads":[[35,38]],"paths":[]}, -{"name":"Bedford","type":"town","stronghold":1,"region":"England","ways":[[31,7],[33,40]],"box":{"x":218,"y":270,"w":17,"h":12},"adjacent":[31,33],"adjacent_by_highway":[31],"adjacent_by_road":[33],"adjacent_by_path":[],"highways":[[31,7]],"roads":[[33,40]],"paths":[]}, -{"name":"Cambridge","type":"town","stronghold":1,"region":"England","ways":[[31,8],[38,20],[34,39],[32,40]],"box":{"x":234,"y":264,"w":14,"h":12},"adjacent":[31,32,34,38],"adjacent_by_highway":[31,38],"adjacent_by_road":[32,34],"adjacent_by_path":[],"highways":[[31,8],[38,20]],"roads":[[32,40],[34,39]],"paths":[]}, -{"name":"Bury St Edmunds","type":"town","stronghold":1,"region":"England","ways":[[38,33],[36,34],[35,37],[33,39]],"box":{"x":258,"y":258,"w":14,"h":12},"adjacent":[33,35,36,38],"adjacent_by_highway":[],"adjacent_by_road":[33,35,36,38],"adjacent_by_path":[],"highways":[],"roads":[[33,39],[35,37],[36,34],[38,33]],"paths":[]}, -{"name":"Ipswich","type":"town","stronghold":1,"region":"England","ways":[[36,36],[34,37],[31,38]],"box":{"x":284,"y":267,"w":15,"h":11},"adjacent":[31,34,36],"adjacent_by_highway":[],"adjacent_by_road":[31,34,36],"adjacent_by_path":[],"highways":[],"roads":[[31,38],[34,37],[36,36]],"paths":[]}, -{"name":"Norwich","type":"city","stronghold":1,"region":"England","ways":[[34,34],[37,35],[35,36]],"box":{"x":274,"y":232,"w":17,"h":16},"adjacent":[34,35,37],"adjacent_by_highway":[],"adjacent_by_road":[34,35,37],"adjacent_by_path":[],"highways":[],"roads":[[34,34],[35,36],[37,35]],"paths":[]}, -{"name":"Lynn","type":"fortress","stronghold":1,"region":"England","ways":[[38,32],[36,35]],"box":{"x":250,"y":233,"w":12,"h":10},"adjacent":[36,38],"adjacent_by_highway":[],"adjacent_by_road":[36,38],"adjacent_by_path":[],"highways":[],"roads":[[36,35],[38,32]],"paths":[]}, -{"name":"Ely","type":"city","stronghold":1,"region":"England","ways":[[39,4],[33,20],[37,32],[34,33]],"box":{"x":239,"y":247,"w":17,"h":17},"adjacent":[33,34,37,39],"adjacent_by_highway":[33,39],"adjacent_by_road":[34,37],"adjacent_by_path":[],"highways":[[33,20],[39,4]],"roads":[[34,33],[37,32]],"paths":[]}, -{"name":"Peterborough","type":"city","stronghold":1,"region":"England","ways":[[49,3],[38,4],[42,31],[40,41]],"box":{"x":216,"y":242,"w":17,"h":16},"adjacent":[38,40,42,49],"adjacent_by_highway":[38,49],"adjacent_by_road":[40,42],"adjacent_by_path":[],"highways":[[38,4],[49,3]],"roads":[[40,41],[42,31]],"paths":[]}, -{"name":"Northampton","type":"town","stronghold":1,"region":"England","ways":[[42,6],[39,41],[41,42],[28,43]],"box":{"x":196,"y":262,"w":16,"h":14},"adjacent":[28,39,41,42],"adjacent_by_highway":[42],"adjacent_by_road":[28,39,41],"adjacent_by_path":[],"highways":[[42,6]],"roads":[[28,43],[39,41],[41,42]],"paths":[]}, -{"name":"Coventry","type":"city","stronghold":1,"region":"England","ways":[[43,30],[40,42]],"box":{"x":178,"y":251,"w":17,"h":16},"adjacent":[40,43],"adjacent_by_highway":[],"adjacent_by_road":[40,43],"adjacent_by_path":[],"highways":[],"roads":[[40,42],[43,30]],"paths":[]}, -{"name":"Leicester","type":"town","stronghold":1,"region":"England","ways":[[45,5],[40,6],[43,29],[39,31]],"box":{"x":199,"y":236,"w":13,"h":12},"adjacent":[39,40,43,45],"adjacent_by_highway":[40,45],"adjacent_by_road":[39,43],"adjacent_by_path":[],"highways":[[40,6],[45,5]],"roads":[[39,31],[43,29]],"paths":[]}, -{"name":"Lichfield","type":"city","stronghold":1,"region":"England","ways":[[10,28],[42,29],[41,30],[46,44],[44,64]],"box":{"x":162,"y":236,"w":19,"h":16},"adjacent":[10,41,42,44,46],"adjacent_by_highway":[],"adjacent_by_road":[10,41,42,44,46],"adjacent_by_path":[],"highways":[],"roads":[[10,28],[41,30],[42,29],[44,64],[46,44]],"paths":[]}, -{"name":"Derby","type":"town","stronghold":1,"region":"England","ways":[[45,26],[43,64]],"box":{"x":173,"y":220,"w":16,"h":13},"adjacent":[43,45],"adjacent_by_highway":[],"adjacent_by_road":[43,45],"adjacent_by_path":[],"highways":[],"roads":[[43,64],[45,26]],"paths":[]}, -{"name":"Nottingham","type":"town","stronghold":1,"region":"England","ways":[[42,5],[49,25],[44,26]],"box":{"x":189,"y":220,"w":19,"h":10},"adjacent":[42,44,49],"adjacent_by_highway":[42],"adjacent_by_road":[44,49],"adjacent_by_path":[],"highways":[[42,5]],"roads":[[44,26],[49,25]],"paths":[]}, -{"name":"Worcester","type":"city","stronghold":1,"region":"England","ways":[[27,13],[43,44],[9,46]],"box":{"x":148,"y":257,"w":18,"h":16},"adjacent":[9,27,43],"adjacent_by_highway":[27],"adjacent_by_road":[9,43],"adjacent_by_path":[],"highways":[[27,13]],"roads":[[9,46],[43,44]],"paths":[]}, -{"name":"Chester","type":"city","stronghold":1,"region":"England","ways":[[10,27],[48,66],[50,67],[5,68]],"box":{"x":117,"y":208,"w":20,"h":16},"adjacent":[5,10,48,50],"adjacent_by_highway":[],"adjacent_by_road":[10],"adjacent_by_path":[5,48,50],"highways":[],"roads":[[10,27]],"paths":[[5,68],[48,66],[50,67]]}, -{"name":"Lancaster","type":"town","stronghold":1,"region":"England","ways":[[2,65],[47,66]],"box":{"x":128,"y":158,"w":18,"h":13},"adjacent":[2,47],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[2,47],"highways":[],"roads":[],"paths":[[2,65],[47,66]]}, -{"name":"Lincoln","type":"city","stronghold":1,"region":"England","ways":[[50,2],[39,3],[45,25],[57,74]],"box":{"x":201,"y":199,"w":20,"h":16},"adjacent":[39,45,50,57],"adjacent_by_highway":[39,50],"adjacent_by_road":[45,57],"adjacent_by_path":[],"highways":[[39,3],[50,2]],"roads":[[45,25],[57,74]],"paths":[]}, -{"name":"York","type":"city","stronghold":1,"region":"England","ways":[[1,1],[49,2],[47,67],[56,72],[57,73]],"box":{"x":182,"y":165,"w":19,"h":17},"adjacent":[1,47,49,56,57],"adjacent_by_highway":[1,49],"adjacent_by_road":[56,57],"adjacent_by_path":[47],"highways":[[1,1],[49,2]],"roads":[[56,72],[57,73]],"paths":[[47,67]]}, -{"name":"Calais","type":"calais","stronghold":1,"region":"England","ways":[],"box":{"x":293,"y":364,"w":17,"h":20},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, -{"name":"France","type":"exile","stronghold":1,"region":"England","ways":[],"box":{"x":232,"y":367,"w":28,"h":29},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, -{"name":"Scotland","type":"exile","stronghold":1,"region":"England","ways":[],"box":{"x":122,"y":79,"w":28,"h":30},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, -{"name":"Ireland","type":"exile","stronghold":1,"region":"England","ways":[],"box":{"x":22,"y":246,"w":28,"h":31},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, -{"name":"Burgundy","type":"exile","stronghold":1,"region":"England","ways":[],"box":{"x":258,"y":181,"w":28,"h":31},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, -{"name":"Scarborough","type":"town","stronghold":1,"region":"North","ways":[[1,71],[50,72]],"box":{"x":207,"y":142,"w":20,"h":15},"adjacent":[1,50],"adjacent_by_highway":[],"adjacent_by_road":[1,50],"adjacent_by_path":[],"highways":[],"roads":[[1,71],[50,72]],"paths":[]}, -{"name":"Ravenspur","type":"fortress","stronghold":1,"region":"England","ways":[[50,73],[49,74]],"box":{"x":218,"y":189,"w":18,"h":12},"adjacent":[49,50],"adjacent_by_highway":[],"adjacent_by_road":[49,50],"adjacent_by_path":[],"highways":[],"roads":[[49,74],[50,73]],"paths":[]}, -{"name":"English Channel","type":"sea","stronghold":1,"region":"England","ways":[],"box":{"x":150,"y":374,"w":44,"h":18},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, -{"name":"Irish Sea","type":"sea","stronghold":1,"region":"England","ways":[],"box":{"x":67,"y":176,"w":40,"h":24},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, -{"name":"North Sea","type":"sea","stronghold":1,"region":"England","ways":[],"box":{"x":286,"y":196,"w":25,"h":30},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, +{"name":"Bamburgh","type":"fortress","stronghold":1,"region":"North","ways":[[1,0]],"box":{"x":675,"y":338,"w":60,"h":45},"adjacent":[1],"adjacent_by_highway":[1],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[[1,0]],"roads":[],"paths":[]}, +{"name":"Newcastle","type":"city","stronghold":1,"region":"North","ways":[[0,0],[50,1],[3,22],[2,24],[56,71]],"box":{"x":694,"y":457,"w":70,"h":77},"adjacent":[0,2,3,50,56],"adjacent_by_highway":[0,50],"adjacent_by_road":[2,3,56],"adjacent_by_path":[],"highways":[[0,0],[50,1]],"roads":[[2,24],[3,22],[56,71]],"paths":[]}, +{"name":"Appleby","type":"town","stronghold":1,"region":"North","ways":[[4,23],[1,24],[48,65]],"box":{"x":584,"y":503,"w":57,"h":52},"adjacent":[1,4,48],"adjacent_by_highway":[],"adjacent_by_road":[1,4],"adjacent_by_path":[48],"highways":[],"roads":[[1,24],[4,23]],"paths":[[48,65]]}, +{"name":"Hexham","type":"town","stronghold":1,"region":"North","ways":[[4,21],[1,22]],"box":{"x":599,"y":433,"w":53,"h":47},"adjacent":[1,4],"adjacent_by_highway":[],"adjacent_by_road":[1,4],"adjacent_by_path":[],"highways":[],"roads":[[1,22],[4,21]],"paths":[]}, +{"name":"Carlisle","type":"town","stronghold":1,"region":"North","ways":[[3,21],[2,23]],"box":{"x":474,"y":460,"w":81,"h":63},"adjacent":[2,3],"adjacent_by_highway":[],"adjacent_by_road":[2,3],"adjacent_by_path":[],"highways":[],"roads":[[2,23],[3,21]],"paths":[]}, +{"name":"Harlech","type":"harlech","stronghold":1,"region":"Wales","ways":[[47,68],[6,69]],"box":{"x":316,"y":950,"w":67,"h":61},"adjacent":[6,47],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[6,47],"highways":[],"roads":[],"paths":[[6,69],[47,68]]}, +{"name":"Pembroke","type":"fortress","stronghold":1,"region":"Wales","ways":[[5,69],[7,70]],"box":{"x":223,"y":1165,"w":58,"h":37},"adjacent":[5,7],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[5,7],"highways":[],"roads":[],"paths":[[5,69],[7,70]]}, +{"name":"Cardiff","type":"city","stronghold":1,"region":"Wales","ways":[[6,70]],"box":{"x":430,"y":1202,"w":65,"h":65},"adjacent":[6],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[6],"highways":[],"roads":[],"paths":[[6,70]]}, +{"name":"Hereford","type":"city","stronghold":1,"region":"Wales","ways":[[27,12],[9,14]],"box":{"x":514,"y":1078,"w":71,"h":65},"adjacent":[9,27],"adjacent_by_highway":[9,27],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[[9,14],[27,12]],"roads":[],"paths":[]}, +{"name":"Ludlow","type":"fortress","stronghold":1,"region":"Wales","ways":[[8,14],[10,45],[46,46]],"box":{"x":514,"y":1014,"w":54,"h":34},"adjacent":[8,10,46],"adjacent_by_highway":[8],"adjacent_by_road":[10,46],"adjacent_by_path":[],"highways":[[8,14]],"roads":[[10,45],[46,46]],"paths":[]}, +{"name":"Shrewsbury","type":"city","stronghold":1,"region":"Wales","ways":[[47,27],[43,28],[9,45]],"box":{"x":538,"y":903,"w":78,"h":69},"adjacent":[9,43,47],"adjacent_by_highway":[],"adjacent_by_road":[9,43,47],"adjacent_by_path":[],"highways":[],"roads":[[9,45],[43,28],[47,27]],"paths":[]}, +{"name":"Salisbury","type":"city","stronghold":1,"region":"South","ways":[[12,18],[25,19],[15,54],[29,55],[20,56]],"box":{"x":648,"y":1306,"w":73,"h":66},"adjacent":[12,15,20,25,29],"adjacent_by_highway":[12,25],"adjacent_by_road":[15,20,29],"adjacent_by_path":[],"highways":[[12,18],[25,19]],"roads":[[15,54],[20,56],[29,55]],"paths":[]}, +{"name":"Winchester","type":"city","stronghold":1,"region":"South","ways":[[13,17],[11,18],[15,53]],"box":{"x":760,"y":1300,"w":71,"h":60},"adjacent":[11,13,15],"adjacent_by_highway":[11,13],"adjacent_by_road":[15],"adjacent_by_path":[],"highways":[[11,18],[13,17]],"roads":[[15,53]],"paths":[]}, +{"name":"Guildford","type":"city","stronghold":1,"region":"South","ways":[[30,16],[12,17]],"box":{"x":879,"y":1287,"w":74,"h":59},"adjacent":[12,30],"adjacent_by_highway":[12,30],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[[12,17],[30,16]],"roads":[],"paths":[]}, +{"name":"Arundel","type":"town","stronghold":1,"region":"South","ways":[[19,51],[15,52]],"box":{"x":832,"y":1372,"w":56,"h":48},"adjacent":[15,19],"adjacent_by_highway":[],"adjacent_by_road":[15,19],"adjacent_by_path":[],"highways":[],"roads":[[15,52],[19,51]],"paths":[]}, +{"name":"Southampton","type":"town","stronghold":1,"region":"South","ways":[[14,52],[12,53],[11,54]],"box":{"x":715,"y":1409,"w":60,"h":48},"adjacent":[11,12,14],"adjacent_by_highway":[],"adjacent_by_road":[11,12,14],"adjacent_by_path":[],"highways":[],"roads":[[11,54],[12,53],[14,52]],"paths":[]}, +{"name":"Rochester","type":"city","stronghold":1,"region":"South","ways":[[30,47],[18,48]],"box":{"x":1021,"y":1223,"w":65,"h":68},"adjacent":[18,30],"adjacent_by_highway":[],"adjacent_by_road":[18,30],"adjacent_by_path":[],"highways":[],"roads":[[18,48],[30,47]],"paths":[]}, +{"name":"Dover","type":"town","stronghold":1,"region":"South","ways":[[18,49],[19,50]],"box":{"x":1079,"y":1325,"w":53,"h":41},"adjacent":[18,19],"adjacent_by_highway":[],"adjacent_by_road":[18,19],"adjacent_by_path":[],"highways":[],"roads":[[18,49],[19,50]],"paths":[]}, +{"name":"Canterbury","type":"city","stronghold":1,"region":"South","ways":[[16,48],[17,49]],"box":{"x":1097,"y":1241,"w":66,"h":65},"adjacent":[16,17],"adjacent_by_highway":[],"adjacent_by_road":[16,17],"adjacent_by_path":[],"highways":[],"roads":[[16,48],[17,49]],"paths":[]}, +{"name":"Hastings","type":"town","stronghold":1,"region":"South","ways":[[17,50],[14,51]],"box":{"x":1021,"y":1360,"w":55,"h":46},"adjacent":[14,17],"adjacent_by_highway":[],"adjacent_by_road":[14,17],"adjacent_by_path":[],"highways":[],"roads":[[14,51],[17,50]],"paths":[]}, +{"name":"Dorchester","type":"town","stronghold":1,"region":"England","ways":[[11,56],[25,57],[21,58]],"box":{"x":562,"y":1406,"w":58,"h":49},"adjacent":[11,21,25],"adjacent_by_highway":[],"adjacent_by_road":[11,21,25],"adjacent_by_path":[],"highways":[],"roads":[[11,56],[21,58],[25,57]],"paths":[]}, +{"name":"Exeter","type":"city","stronghold":1,"region":"England","ways":[[20,58],[23,60],[22,61]],"box":{"x":381,"y":1417,"w":64,"h":66},"adjacent":[20,22,23],"adjacent_by_highway":[],"adjacent_by_road":[20,22,23],"adjacent_by_path":[],"highways":[],"roads":[[20,58],[22,61],[23,60]],"paths":[]}, +{"name":"Plymouth","type":"town","stronghold":1,"region":"England","ways":[[21,61],[24,62]],"box":{"x":291,"y":1455,"w":58,"h":50},"adjacent":[21,24],"adjacent_by_highway":[],"adjacent_by_road":[21,24],"adjacent_by_path":[],"highways":[],"roads":[[21,61],[24,62]],"paths":[]}, +{"name":"Launceston","type":"city","stronghold":1,"region":"England","ways":[[21,60],[24,63]],"box":{"x":239,"y":1392,"w":68,"h":60},"adjacent":[21,24],"adjacent_by_highway":[],"adjacent_by_road":[21,24],"adjacent_by_path":[],"highways":[],"roads":[[21,60],[24,63]],"paths":[]}, +{"name":"Truro","type":"town","stronghold":1,"region":"England","ways":[[22,62],[23,63]],"box":{"x":180,"y":1483,"w":56,"h":53},"adjacent":[22,23],"adjacent_by_highway":[],"adjacent_by_road":[22,23],"adjacent_by_path":[],"highways":[],"roads":[[22,62],[23,63]],"paths":[]}, +{"name":"Wells","type":"city","stronghold":1,"region":"England","ways":[[11,19],[20,57],[26,59]],"box":{"x":542,"y":1300,"w":68,"h":66},"adjacent":[11,20,26],"adjacent_by_highway":[11],"adjacent_by_road":[20,26],"adjacent_by_path":[],"highways":[[11,19]],"roads":[[20,57],[26,59]],"paths":[]}, +{"name":"Bristol","type":"city","stronghold":1,"region":"England","ways":[[27,15],[25,59]],"box":{"x":536,"y":1223,"w":63,"h":58},"adjacent":[25,27],"adjacent_by_highway":[27],"adjacent_by_road":[25],"adjacent_by_path":[],"highways":[[27,15]],"roads":[[25,59]],"paths":[]}, +{"name":"Gloucester","type":"city","stronghold":1,"region":"England","ways":[[28,11],[8,12],[46,13],[26,15]],"box":{"x":602,"y":1130,"w":68,"h":62},"adjacent":[8,26,28,46],"adjacent_by_highway":[8,26,28,46],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[[8,12],[26,15],[28,11],[46,13]],"roads":[],"paths":[]}, +{"name":"Oxford","type":"city","stronghold":1,"region":"England","ways":[[30,10],[27,11],[40,43]],"box":{"x":745,"y":1139,"w":70,"h":63},"adjacent":[27,30,40],"adjacent_by_highway":[27,30],"adjacent_by_road":[40],"adjacent_by_path":[],"highways":[[27,11],[30,10]],"roads":[[40,43]],"paths":[]}, +{"name":"Newbury","type":"town","stronghold":1,"region":"England","ways":[[11,55]],"box":{"x":703,"y":1232,"w":66,"h":44},"adjacent":[11],"adjacent_by_highway":[],"adjacent_by_road":[11],"adjacent_by_path":[],"highways":[],"roads":[[11,55]],"paths":[]}, +{"name":"London","type":"london","stronghold":1,"region":"England","ways":[[31,9],[28,10],[13,16],[16,47]],"box":{"x":912,"y":1202,"w":94,"h":72},"adjacent":[13,16,28,31],"adjacent_by_highway":[13,28,31],"adjacent_by_road":[16],"adjacent_by_path":[],"highways":[[13,16],[28,10],[31,9]],"roads":[[16,47]],"paths":[]}, +{"name":"St Albans","type":"town","stronghold":1,"region":"England","ways":[[32,7],[33,8],[30,9],[35,38]],"box":{"x":939,"y":1130,"w":54,"h":40},"adjacent":[30,32,33,35],"adjacent_by_highway":[30,32,33],"adjacent_by_road":[35],"adjacent_by_path":[],"highways":[[30,9],[32,7],[33,8]],"roads":[[35,38]],"paths":[]}, +{"name":"Bedford","type":"town","stronghold":1,"region":"England","ways":[[31,7],[33,40]],"box":{"x":874,"y":1082,"w":65,"h":48},"adjacent":[31,33],"adjacent_by_highway":[31],"adjacent_by_road":[33],"adjacent_by_path":[],"highways":[[31,7]],"roads":[[33,40]],"paths":[]}, +{"name":"Cambridge","type":"town","stronghold":1,"region":"England","ways":[[31,8],[38,20],[34,39],[32,40]],"box":{"x":939,"y":1059,"w":54,"h":45},"adjacent":[31,32,34,38],"adjacent_by_highway":[31,38],"adjacent_by_road":[32,34],"adjacent_by_path":[],"highways":[[31,8],[38,20]],"roads":[[32,40],[34,39]],"paths":[]}, +{"name":"Bury St Edmunds","type":"town","stronghold":1,"region":"England","ways":[[38,33],[36,34],[35,37],[33,39]],"box":{"x":1035,"y":1033,"w":54,"h":45},"adjacent":[33,35,36,38],"adjacent_by_highway":[],"adjacent_by_road":[33,35,36,38],"adjacent_by_path":[],"highways":[],"roads":[[33,39],[35,37],[36,34],[38,33]],"paths":[]}, +{"name":"Ipswich","type":"town","stronghold":1,"region":"England","ways":[[36,36],[34,37],[31,38]],"box":{"x":1138,"y":1068,"w":58,"h":43},"adjacent":[31,34,36],"adjacent_by_highway":[],"adjacent_by_road":[31,34,36],"adjacent_by_path":[],"highways":[],"roads":[[31,38],[34,37],[36,36]],"paths":[]}, +{"name":"Norwich","type":"city","stronghold":1,"region":"England","ways":[[34,34],[37,35],[35,36]],"box":{"x":1097,"y":928,"w":67,"h":62},"adjacent":[34,35,37],"adjacent_by_highway":[],"adjacent_by_road":[34,35,37],"adjacent_by_path":[],"highways":[],"roads":[[34,34],[35,36],[37,35]],"paths":[]}, +{"name":"Lynn","type":"fortress","stronghold":1,"region":"England","ways":[[38,32],[36,35]],"box":{"x":1000,"y":933,"w":47,"h":38},"adjacent":[36,38],"adjacent_by_highway":[],"adjacent_by_road":[36,38],"adjacent_by_path":[],"highways":[],"roads":[[36,35],[38,32]],"paths":[]}, +{"name":"Ely","type":"city","stronghold":1,"region":"England","ways":[[39,4],[33,20],[37,32],[34,33]],"box":{"x":959,"y":990,"w":65,"h":66},"adjacent":[33,34,37,39],"adjacent_by_highway":[33,39],"adjacent_by_road":[34,37],"adjacent_by_path":[],"highways":[[33,20],[39,4]],"roads":[[34,33],[37,32]],"paths":[]}, +{"name":"Peterborough","type":"city","stronghold":1,"region":"England","ways":[[49,3],[38,4],[42,31],[40,41]],"box":{"x":866,"y":968,"w":66,"h":62},"adjacent":[38,40,42,49],"adjacent_by_highway":[38,49],"adjacent_by_road":[40,42],"adjacent_by_path":[],"highways":[[38,4],[49,3]],"roads":[[40,41],[42,31]],"paths":[]}, +{"name":"Northampton","type":"town","stronghold":1,"region":"England","ways":[[42,6],[39,41],[41,42],[28,43]],"box":{"x":786,"y":1051,"w":64,"h":54},"adjacent":[28,39,41,42],"adjacent_by_highway":[42],"adjacent_by_road":[28,39,41],"adjacent_by_path":[],"highways":[[42,6]],"roads":[[28,43],[39,41],[41,42]],"paths":[]}, +{"name":"Coventry","type":"city","stronghold":1,"region":"England","ways":[[43,30],[40,42]],"box":{"x":713,"y":1005,"w":67,"h":63},"adjacent":[40,43],"adjacent_by_highway":[],"adjacent_by_road":[40,43],"adjacent_by_path":[],"highways":[],"roads":[[40,42],[43,30]],"paths":[]}, +{"name":"Leicester","type":"town","stronghold":1,"region":"England","ways":[[45,5],[40,6],[43,29],[39,31]],"box":{"x":796,"y":944,"w":49,"h":46},"adjacent":[39,40,43,45],"adjacent_by_highway":[40,45],"adjacent_by_road":[39,43],"adjacent_by_path":[],"highways":[[40,6],[45,5]],"roads":[[39,31],[43,29]],"paths":[]}, +{"name":"Lichfield","type":"city","stronghold":1,"region":"England","ways":[[10,28],[42,29],[41,30],[46,44],[44,64]],"box":{"x":651,"y":944,"w":74,"h":61},"adjacent":[10,41,42,44,46],"adjacent_by_highway":[],"adjacent_by_road":[10,41,42,44,46],"adjacent_by_path":[],"highways":[],"roads":[[10,28],[41,30],[42,29],[44,64],[46,44]],"paths":[]}, +{"name":"Derby","type":"town","stronghold":1,"region":"England","ways":[[45,26],[43,64]],"box":{"x":694,"y":883,"w":62,"h":49},"adjacent":[43,45],"adjacent_by_highway":[],"adjacent_by_road":[43,45],"adjacent_by_path":[],"highways":[],"roads":[[43,64],[45,26]],"paths":[]}, +{"name":"Nottingham","type":"town","stronghold":1,"region":"England","ways":[[42,5],[49,25],[44,26]],"box":{"x":756,"y":883,"w":73,"h":40},"adjacent":[42,44,49],"adjacent_by_highway":[42],"adjacent_by_road":[44,49],"adjacent_by_path":[],"highways":[[42,5]],"roads":[[44,26],[49,25]],"paths":[]}, +{"name":"Worcester","type":"city","stronghold":1,"region":"England","ways":[[27,13],[43,44],[9,46]],"box":{"x":594,"y":1030,"w":72,"h":64},"adjacent":[9,27,43],"adjacent_by_highway":[27],"adjacent_by_road":[9,43],"adjacent_by_path":[],"highways":[[27,13]],"roads":[[9,46],[43,44]],"paths":[]}, +{"name":"Chester","type":"city","stronghold":1,"region":"England","ways":[[10,27],[48,66],[50,67],[5,68]],"box":{"x":471,"y":835,"w":78,"h":64},"adjacent":[5,10,48,50],"adjacent_by_highway":[],"adjacent_by_road":[10],"adjacent_by_path":[5,48,50],"highways":[],"roads":[[10,27]],"paths":[[5,68],[48,66],[50,67]]}, +{"name":"Lancaster","type":"town","stronghold":1,"region":"England","ways":[[2,65],[47,66]],"box":{"x":514,"y":633,"w":70,"h":51},"adjacent":[2,47],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[2,47],"highways":[],"roads":[],"paths":[[2,65],[47,66]]}, +{"name":"Lincoln","type":"city","stronghold":1,"region":"England","ways":[[50,2],[39,3],[45,25],[57,74]],"box":{"x":805,"y":798,"w":78,"h":64},"adjacent":[39,45,50,57],"adjacent_by_highway":[39,50],"adjacent_by_road":[45,57],"adjacent_by_path":[],"highways":[[39,3],[50,2]],"roads":[[45,25],[57,74]],"paths":[]}, +{"name":"York","type":"city","stronghold":1,"region":"England","ways":[[1,1],[49,2],[47,67],[56,72],[57,73]],"box":{"x":729,"y":661,"w":76,"h":65},"adjacent":[1,47,49,56,57],"adjacent_by_highway":[1,49],"adjacent_by_road":[56,57],"adjacent_by_path":[47],"highways":[[1,1],[49,2]],"roads":[[56,72],[57,73]],"paths":[[47,67]]}, +{"name":"Calais","type":"calais","stronghold":1,"region":"England","ways":[],"box":{"x":1172,"y":1456,"w":67,"h":79},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, +{"name":"France","type":"exile","stronghold":1,"region":"England","ways":[],"box":{"x":928,"y":1468,"w":109,"h":114},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, +{"name":"Scotland","type":"exile","stronghold":1,"region":"England","ways":[],"box":{"x":488,"y":316,"w":111,"h":118},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, +{"name":"Ireland","type":"exile","stronghold":1,"region":"England","ways":[],"box":{"x":88,"y":987,"w":110,"h":121},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, +{"name":"Burgundy","type":"exile","stronghold":1,"region":"England","ways":[],"box":{"x":1034,"y":726,"w":110,"h":121},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, +{"name":"Scarborough","type":"town","stronghold":1,"region":"North","ways":[[1,71],[50,72]],"box":{"x":829,"y":570,"w":78,"h":57},"adjacent":[1,50],"adjacent_by_highway":[],"adjacent_by_road":[1,50],"adjacent_by_path":[],"highways":[],"roads":[[1,71],[50,72]],"paths":[]}, +{"name":"Ravenspur","type":"fortress","stronghold":1,"region":"England","ways":[[50,73],[49,74]],"box":{"x":873,"y":759,"w":72,"h":45},"adjacent":[49,50],"adjacent_by_highway":[],"adjacent_by_road":[49,50],"adjacent_by_path":[],"highways":[],"roads":[[49,74],[50,73]],"paths":[]}, +{"name":"English Channel","type":"sea","stronghold":1,"region":"England","ways":[],"box":{"x":602,"y":1499,"w":173,"h":69},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, +{"name":"Irish Sea","type":"sea","stronghold":1,"region":"England","ways":[],"box":{"x":271,"y":705,"w":160,"h":93},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, +{"name":"North Sea","type":"sea","stronghold":1,"region":"England","ways":[],"box":{"x":1144,"y":787,"w":97,"h":117},"adjacent":[],"adjacent_by_highway":[],"adjacent_by_road":[],"adjacent_by_path":[],"highways":[],"roads":[],"paths":[]}, ], ways:[ {"type":"highway","locales":[0,1]}, @@ -715,13 +715,13 @@ body.shift .mustered_vassals { .locale { box-sizing: border-box; position: absolute; - border: 3px solid transparent; + border: 3px solid white; } .locale_name { box-sizing: border-box; position: absolute; - border: 3px solid transparent; + border: 3px solid white; } .locale.region { border-radius: 50% } @@ -76,11 +76,6 @@ </div> </div> -<div class="tuck_under_map"> -<div id="capabilities1"></div> -<div id="capabilities2"></div> -</div> - <div id="events_panel" class="panel hide"> <div id="events_header" class="panel_header">Events</div> <div id="events" class="panel_body"></div> @@ -169,25 +169,13 @@ function on_blur() { function get_locale_tip(id) { let loc = data.locales[id] let tip = loc.name - if (loc.name !== "Novgorod") { - if (loc.type === "traderoute") - tip += " - Trade Route" - else - tip += " - " + loc.type[0].toUpperCase() + loc.type.substring(1) - } if (data.seaports.includes(id)) tip += " - Seaport" let list = [] - if (loc.name === "Adsel" || loc.name === "Fellin" || loc.name === "Leal" || loc.name === "Wenden") - list.push("Commandery") - if (loc.name === "Novgorod") - list.push("Archbishopric") for (let lord = 0; lord < data.lords.length; ++lord) { if (data.lords[lord].seats.includes(id)) list.push(data.lords[lord].name) } - if (loc.name === "Pskov") - list.push("Yaroslav") if (list.length > 0) tip += " - " + list.join(", ") return tip @@ -204,33 +192,12 @@ function on_focus_cylinder(evt) { let tip = info.name if (loc >= CALENDAR) { - if (lord !== LORD_ALEKSANDR) - tip += ` - ${info.fealty} Fealty` - tip += ` - ${info.service} Service` + tip += ` - ${info.fealty} Fealty` } on_focus(tip) } -function on_focus_lord_service_marker(evt) { - let lord = evt.target.my_id - let info = data.lords[lord] - on_focus(`${info.full_name} - ${info.title}`) - if (expand_calendar !== view.pieces.service[lord]) { - expand_calendar = view.pieces.service[lord] - layout_calendar() - } -} - -function on_blur_lord_service_marker(evt) { - let id = evt.target.my_id - on_blur(evt) - if (expand_calendar === view.pieces.service[id]) { - expand_calendar = -1 - layout_calendar() - } -} - // === GAME STATE === function current_season() { @@ -274,7 +241,7 @@ function is_lord_ambushed(lord) { if (view.battle) { // ambush & 2 = attacker played ambush // ambush & 1 = defender played ambush - if (view.battle.attacker === "Teutons") { + if (view.battle.attacker === "York") { if ((view.battle.ambush & 1) && is_p1_lord(lord)) return is_lord_on_left_or_right(lord) if ((view.battle.ambush & 2) && is_p2_lord(lord)) @@ -318,25 +285,12 @@ function is_p2_locale(loc) { } function count_vp1() { - let vp = view.pieces.elr1 << 1 - for (let loc of view.pieces.conquered) - if (is_p2_locale(loc)) - vp += data.locales[loc].vp << 1 - for (let loc of view.pieces.ravaged) - if (is_p2_locale(loc)) - vp += 1 + let vp = 0 return vp } function count_vp2() { - let vp = view.pieces.elr2 << 1 - vp += view.pieces.veche_vp << 1 - for (let loc of view.pieces.conquered) - if (is_p1_locale(loc)) - vp += data.locales[loc].vp << 1 - for (let loc of view.pieces.ravaged) - if (is_p1_locale(loc)) - vp += 1 + let vp = 0 return vp } @@ -358,28 +312,13 @@ function is_vassal_mustered(vassal) { } function is_legate_selected() { - return player === "Teutons" && !!view.pieces.legate_selected + return player === "York" && !!view.pieces.legate_selected } function is_levy_phase() { return (view.turn & 1) === 0 } -function is_upper_lord(lord) { - return map_has(view.pieces.lieutenants, lord) -} - -function is_lower_lord(lord) { - for (let i = 1; i < view.pieces.lieutenants.length; i += 2) - if (view.pieces.lieutenants[i] === lord) - return true - return false -} - -function get_lower_lord(upper) { - return map_get(view.pieces.lieutenants, upper, -1) -} - function is_lord_in_battle(lord) { if (view.battle && view.battle.array) { for (let i = 0; i < 12; ++i) @@ -445,7 +384,7 @@ function lord_has_capability(lord, card_or_list) { } function attacker_has_trebuchets() { - if (view.battle.attacker === "Teutons") { + if (view.battle.attacker === "York") { for (let lord = first_p1_lord; lord <= last_p1_lord; ++lord) { if (get_lord_locale(lord) === view.battle.where && lord_has_unrouted_units(lord)) { if (lord_has_capability(lord, AOW_TEUTONIC_TREBUCHETS)) @@ -463,27 +402,23 @@ function count_siege_markers(loc) { // === BUILD UI === const original_boxes = { - "way crossroads": [ 375, 1179, 116, 37 ], - "way wirz": [ 324, 1132, 44, 88 ], - "way peipus-east": [ 558, 1049, 55, 120 ], - "way peipus-north": [ 513, 958, 90, 57 ], - "calendar summer box1": [ 10, 42, 150, 231 ], - "calendar summer box2": [ 163, 42, 150, 231 ], - "calendar winter box3": [ 328, 42, 150, 231 ], - "calendar winter box4": [ 481, 42, 150, 231 ], - "calendar winter box5": [ 647, 42, 150, 231 ], - "calendar winter box6": [ 799, 42, 150, 231 ], - "calendar rasputitsa box7": [ 965, 42, 150, 231 ], - "calendar rasputitsa box8": [ 1118, 42, 150, 231 ], - "calendar summer box9": [ 10, 280, 150, 231 ], - "calendar summer box10": [ 163, 280, 150, 231 ], - "calendar winter box11": [ 328, 280, 150, 231 ], - "calendar winter box12": [ 481, 280, 150, 231 ], - "calendar winter box13": [ 647, 280, 150, 231 ], - "calendar winter box14": [ 799, 280, 150, 231 ], - "calendar rasputitsa box15": [ 965, 280, 150, 231 ], - "calendar rasputitsa box16": [ 1118, 280, 150, 231 ], "calendar box0": [ 2, 16, 316, 22 ], + "calendar box1": [ 10, 42, 150, 231 ], + "calendar box2": [ 163, 42, 150, 231 ], + "calendar box3": [ 328, 42, 150, 231 ], + "calendar box4": [ 481, 42, 150, 231 ], + "calendar box5": [ 647, 42, 150, 231 ], + "calendar box6": [ 799, 42, 150, 231 ], + "calendar box7": [ 965, 42, 150, 231 ], + "calendar box8": [ 1118, 42, 150, 231 ], + "calendar box9": [ 10, 280, 150, 231 ], + "calendar box10": [ 163, 280, 150, 231 ], + "calendar box11": [ 328, 280, 150, 231 ], + "calendar box12": [ 481, 280, 150, 231 ], + "calendar box13": [ 647, 280, 150, 231 ], + "calendar box14": [ 799, 280, 150, 231 ], + "calendar box15": [ 965, 280, 150, 231 ], + "calendar box16": [ 1118, 280, 150, 231 ], "calendar box17": [ 957, 514, 316, 22 ], } @@ -517,7 +452,6 @@ const ui = { locale_name: [], locale_markers: [], lord_cylinder: [], - lord_service: [], lord_mat: [], lord_buttons: [], vassal_service: [], @@ -533,7 +467,6 @@ const ui = { lord_feed_x2: [], cards: [], boxes: {}, - ways: [], plan_panel: document.getElementById("plan_panel"), plan: document.getElementById("plan"), @@ -553,11 +486,9 @@ const ui = { hand_panel: document.getElementById("hand_panel"), hand: document.getElementById("hand"), - held1: document.querySelector("#role_Teutons .role_held"), - held2: document.querySelector("#role_Russians .role_held"), + held1: document.querySelector("#role_York .role_held"), + held2: document.querySelector("#role_Lancaster .role_held"), - capabilities1: document.getElementById("capabilities1"), - capabilities2: document.getElementById("capabilities2"), command: document.getElementById("command"), turn: document.getElementById("turn"), vp1: document.getElementById("vp1"), @@ -628,8 +559,8 @@ function build_plan() { ui.plan_cards.push(elt) ui.plan.appendChild(elt) } - for (let lord = 0; lord < 12; ++lord) { - let side = lord < 6 ? "teutonic" : "russian" + for (let lord = 0; lord < 24; ++lord) { + let side = lord < 12 ? "york" : "lancaster" elt = document.createElement("div") elt.className = `card ${side} cc_lord_${lord}` register_action(elt, "plan", lord) @@ -638,31 +569,25 @@ function build_plan() { } ui.plan_action_pass_p1 = elt = document.createElement("div") - elt.className = `card teutonic cc_pass` + elt.className = `card york cc_pass` register_action(elt, "plan", -1) ui.plan_actions.appendChild(elt) ui.plan_action_pass_p2 = elt = document.createElement("div") - elt.className = `card russian cc_pass` + elt.className = `card lancaster cc_pass` register_action(elt, "plan", -1) ui.plan_actions.appendChild(elt) } -function build_way(name, sel) { - let way = data.ways.findIndex(w => w.name === name) - ui.ways[way] = document.querySelector(sel) - register_action(ui.ways[way], "way", way) -} - const locale_size = { - region: [ 88, 56 ], - town: [ 80, 72 ], - traderoute: [ 90, 54 ], - fort: [ 96, 54 ], - castle: [ 96, 56 ], - city: [ 126, 80 ], - bishopric: [ 106, 72 ], - novgorod: [ 144, 86 ], + town: [ 100, 100 ], + city: [ 100, 100 ], + fortress: [ 100, 100 ], + harlech: [ 100, 100 ], + calais: [ 100, 100 ], + london: [ 150, 150 ], + exile: [ 150, 200 ], + sea: [ 100, 100 ], } function build_map() { @@ -672,65 +597,24 @@ function build_map() { data.locales.forEach((locale, ix) => { let region = clean_name(locale.region) let { x, y, w, h } = locale.box + console.log("LOC", locale, ix, x, y, w, h) let xc = Math.round(x + w / 2) let yc = Math.round(y + h / 2) let e - switch (locale.type) { - case "town": - locale_xy[ix] = [ xc, y - 24 ] - w = locale_size.town[0] - h = locale_size.town[1] - x = xc - w/2 - y = y - h + 16 - break - case "region": - xc += 2 - yc -= 3 - locale_xy[ix] = [ xc, yc - 24 ] - w = locale_size.region[0] - h = locale_size.region[1] - x = xc - w/2 - y = yc - h/2 - break - default: - locale_xy[ix] = [ xc, y - 36 ] - break - } + locale_xy[ix] = [ xc, yc ] // Main Area e = ui.locale[ix] = document.createElement("div") e.className = "locale " + locale.type + " " + region - if (locale.type !== "region" && locale.type !== "town") { - let ew = locale_size[locale.type][0] - let eh = locale_size[locale.type][1] - e.style.top = (y - eh) + "px" - e.style.left = (xc - ew/2) + "px" - e.style.width = (ew) + "px" - e.style.height = (eh) + "px" - } else { - e.style.left = x + "px" - e.style.top = y + "px" - e.style.width = w + "px" - e.style.height = h + "px" - } + e.style.left = x + "px" + e.style.top = y + "px" + e.style.width = w + "px" + e.style.height = h + "px" register_action(e, "locale", ix, "laden_march") register_tooltip(e, get_locale_tip(ix)) document.getElementById("locales").appendChild(e) - // Name Plate - if (locale.type !== 'region' && locale.type !== 'town') { - e = ui.locale_name[ix] = document.createElement("div") - e.className = "locale_name " + locale.type + " " + region - e.style.left = x + "px" - e.style.top = y + "px" - e.style.width = w + "px" - e.style.height = h + "px" - register_action(e, "locale", ix, "laden_march") - register_tooltip(e, get_locale_tip(ix)) - document.getElementById("locales").appendChild(e) - } - // Locale Markers e = ui.locale_markers[ix] = document.createElement("div") e.className = "locale_markers " + locale.type + " " + region @@ -749,29 +633,17 @@ function build_map() { register_tooltip(e, on_focus_cylinder) document.getElementById("pieces").appendChild(e) - e = ui.lord_service[ix] = document.createElement("div") - e.className = "service_marker lord image" + lord.image + " " + clean_name(lord.side) + " " + clean_name(lord.name) + " hide" - register_action(e, "service", ix, "service_bad") - register_tooltip(e, on_focus_lord_service_marker, on_blur_lord_service_marker) - document.getElementById("pieces").appendChild(e) - build_lord_mat(lord, ix, clean_name(lord.side), clean_name(lord.name)) }) data.vassals.forEach((vassal, ix) => { - let lord = data.lords[vassal.lord] let e = ui.vassal_service[ix] = document.createElement("div") - e.className = "service_marker vassal image" + vassal.image + " " + clean_name(lord.side) + " " + clean_name(vassal.name) + " hide" + e.className = "vassal v" + ix register_action(e, "vassal", ix) register_tooltip(e, data.vassals[ix].name) document.getElementById("pieces").appendChild(e) }) - register_action(ui.legate, "legate") - register_tooltip(ui.legate, "William of Modena") - - register_action(ui.veche, "veche") - for (let name in original_boxes) { let x = original_boxes[name][0] let y = original_boxes[name][1] @@ -810,20 +682,15 @@ function build_map() { for (let i = 0; i <= 17; ++i) register_action(ui.calendar[i], "calendar", i) - build_way("Crossroads", ".way.crossroads") - build_way("Peipus E", ".way.peipus-east") - build_way("Peipus W", ".way.peipus-north") - build_way("Wirz", ".way.wirz") - build_plan() - for (let i = 0; i < 12; ++i) + for (let i = 0; i < 6; ++i) register_action(ui.battle_grid_array[i], "array", i) for (let c = first_p1_card; c <= last_p1_card; ++c) - build_card("teutonic", c) + build_card("york", c) for (let c = first_p2_card; c <= last_p2_card; ++c) - build_card("russian", c) + build_card("lancaster", c) } // === UPDATE UI === @@ -864,30 +731,29 @@ function restart_cache() { function update_current_card_display() { if (typeof view.what === "number" && view.what >= 0) { if (view.what <= first_p1_card) - ui.command.className = `card teutonic aow_${view.what}` + ui.command.className = `card york aow_${view.what}` else - ui.command.className = `card russian aow_${view.what}` + ui.command.className = `card lancaster aow_${view.what}` } else if ((view.turn & 1) === 0) { - if (player === "Russians") - ui.command.className = `card russian aow_back` + if (player === "Lancaster") + ui.command.className = `card lancaster aow_back` else - ui.command.className = `card teutonic aow_back` + ui.command.className = `card york aow_back` } else if (view.command < 0) { - if (player === "Russians") - ui.command.className = `card russian cc_back` + if (player === "Lancaster") + ui.command.className = `card lancaster cc_back` else - ui.command.className = `card teutonic cc_back` + ui.command.className = `card york cc_back` } else { if (view.command < 6) - ui.command.className = `card russian cc_lord_${view.command}` + ui.command.className = `card lancaster cc_lord_${view.command}` else - ui.command.className = `card teutonic cc_lord_${view.command}` + ui.command.className = `card york cc_lord_${view.command}` } } function layout_locale_item(loc, e, is_upper) { locale_layout[loc].push([e, is_upper]) - e.classList.toggle("lieutenant", is_upper) } function layout_locale_cylinders(loc) { @@ -1010,24 +876,13 @@ function add_force(parent, type, lord, routed) { function add_asset(parent, type, n, lord) { let elt - if (lord === VECHE) { - if (is_action("veche_coin")) - elt = get_cached_element("action asset " + asset_action_name[type] + " x"+n, "veche_coin", undefined) - else - elt = get_cached_element("asset " + asset_action_name[type] + " x"+n) - } else { - if (is_action(asset_action_name[type], lord)) - elt = get_cached_element("action asset " + asset_action_name[type] + " x"+n, asset_action_name[type], lord) - else - elt = get_cached_element("asset " + asset_action_name[type] + " x"+n) - } + if (is_action(asset_action_name[type], lord)) + elt = get_cached_element("action asset " + asset_action_name[type] + " x"+n, asset_action_name[type], lord) + else + elt = get_cached_element("asset " + asset_action_name[type] + " x"+n) parent.appendChild(elt) } -function add_veche_vp(parent) { - parent.appendChild(get_cached_element("marker square conquered russian")) -} - function update_forces(parent, forces, lord_ix, routed) { parent.replaceChildren() for (let i = 0; i < force_type_count; ++i) { @@ -1064,6 +919,7 @@ function update_assets(id, parent, assets) { } function update_vassals(ready_parent, mustered_parent, lord_ix) { + /* TODO: vassals currently with lord for (let v of data.lords[lord_ix].vassals) { let e = ui.vassal_service[v] if (is_vassal_ready(v)) { @@ -1079,6 +935,7 @@ function update_vassals(ready_parent, mustered_parent, lord_ix) { } e.classList.toggle("action", is_action("vassal", v)) } + */ } function update_lord_mat(ix) { @@ -1107,53 +964,26 @@ function update_lord_mat(ix) { function update_lord(ix) { let locale = view.pieces.locale[ix] - let service = view.pieces.service[ix] if (locale < 0) { ui.lord_cylinder[ix].classList.add("hide") - ui.lord_service[ix].classList.add("hide") ui.lord_mat[ix].classList.remove("action") return } if (locale < 100) { - calendar_layout_service[service].push(ui.lord_service[ix]) - - if (!is_lower_lord(ix)) { - if (is_upper_lord(ix)) { - let lo = get_lower_lord(ix) - if (view.pieces.locale[lo] === locale) { - layout_locale_item(locale, ui.lord_cylinder[ix], 1) - layout_locale_item(locale, ui.lord_cylinder[lo], 0) - } else { - layout_locale_item(locale, ui.lord_cylinder[ix], 0) - } - } else { - layout_locale_item(locale, ui.lord_cylinder[ix], 0) - } - } - + layout_locale_item(locale, ui.lord_cylinder[ix]) ui.lord_cylinder[ix].classList.remove("hide") - ui.lord_service[ix].classList.remove("hide") update_lord_mat(ix) } else { let t = locale - 100 if (t > 17) t = 17 calendar_layout_cylinder[t].push(ui.lord_cylinder[ix]) ui.lord_cylinder[ix].classList.remove("hide") - ui.lord_service[ix].classList.add("hide") } ui.lord_cylinder[ix].classList.toggle("besieged", is_lord_besieged(ix)) ui.lord_buttons[ix].classList.toggle("action", is_action("lord", ix)) ui.lord_cylinder[ix].classList.toggle("action", is_action("lord", ix)) - ui.lord_service[ix].classList.toggle("action", is_action("service", ix) || is_action("service_bad", ix)) - ui.lord_service[ix].classList.toggle("bad", is_action("service_bad", ix)) - - if (ix === LORD_HERMANN) - ui.lord_cylinder[ix].classList.toggle("marshal", !is_lord_on_map(LORD_ANDREAS)) - if (ix === LORD_ANDREY) - ui.lord_cylinder[ix].classList.toggle("marshal", !is_lord_on_map(LORD_ALEKSANDR)) ui.lord_cylinder[ix].classList.toggle("selected", is_lord_selected(ix)) - ui.lord_service[ix].classList.toggle("selected", is_lord_selected(ix)) ui.lord_mat[ix].classList.toggle("selected", is_lord_selected(ix)) ui.lord_cylinder[ix].classList.toggle("command", is_lord_command(ix)) @@ -1163,81 +993,6 @@ function update_lord(ix) { ui.lord_mat[ix].classList.toggle("ambushed", is_lord_ambushed(ix)) } -function update_legate() { - if (view.pieces.legate === LEGATE_INDISPOSED) { - ui.legate.classList.add("hide") - } else { - ui.legate.classList.remove("hide") - ui.legate.classList.toggle("action", is_action("legate")) - ui.legate.classList.toggle("selected", is_legate_selected()) - if (view.pieces.legate === LEGATE_ARRIVED) { - ui.legate.style.top = "1356px" - ui.legate.style.left = "24px" - } else { - layout_locale_item(view.pieces.legate, ui.legate, 0) - } - } -} - -function update_smerdi() { - ui.smerdi.replaceChildren() - for (let i = 0; i < view.pieces.smerdi; ++i) - ui.smerdi.appendChild(get_cached_element("unit serfs")) -} - -function update_veche() { - ui.veche.replaceChildren() - - let n = view.pieces.veche_coin - while (n >= 4) { - add_asset(ui.veche, COIN, 4, VECHE) - n -= 4 - } - while (n >= 3) { - add_asset(ui.veche, COIN, 3, VECHE) - n -= 3 - } - while (n >= 2) { - add_asset(ui.veche, COIN, 2, VECHE) - n -= 2 - } - while (n >= 1) { - add_asset(ui.veche, COIN, 1, VECHE) - n -= 1 - } - - for (let i = 0; i < view.pieces.veche_vp; ++i) - add_veche_vp(ui.veche) -} - -function update_castle(elt, loc) { - if (loc === undefined) { - elt.classList.toggle("hide", true) - } else { - elt.classList.toggle("hide", false) - let [xc, yc] = locale_xy[loc] - if (is_town_locale(loc)) { - elt.style.top = (yc - 26) + "px" - elt.style.left = (xc - 49) + "px" - } else { - elt.style.top = (yc - 15) + "px" - elt.style.left = (xc - 49) + "px" - } - elt.style.zIndex = 0 - } -} - -function is_teutonic_siege_marker(loc) { - if (set_has(view.pieces.castles2, loc)) - return true - if (set_has(view.pieces.castles1, loc)) - return false - if (is_p1_locale(loc)) - return set_has(view.pieces.conquered, loc) - else - return !set_has(view.pieces.conquered, loc) -} - function update_locale(loc) { layout_locale_cylinders(loc) @@ -1257,38 +1012,14 @@ function update_locale(loc) { else ui.locale_markers[loc].appendChild(get_cached_element("marker circle battle")) - if (set_has(view.pieces.ravaged, loc)) { + if (set_has(view.pieces.exhausted, loc)) { let cn if (is_p1_locale(loc)) - cn = "marker small ravaged russian" + cn = "marker small exhausted lancaster" else - cn = "marker small ravaged teutonic" + cn = "marker small exhausted york" ui.locale_markers[loc].appendChild(get_cached_element(cn)) } - - if (set_has(view.pieces.conquered, loc)) { - let cn - if (is_p1_locale(loc)) - cn = "marker square conquered russian" - else - cn = "marker square conquered teutonic" - for (let i = 0; i < data.locales[loc].vp; ++i) - ui.locale_markers[loc].appendChild(get_cached_element(cn)) - } - - if (set_has(view.pieces.walls, loc)) - ui.locale_markers[loc].appendChild(get_cached_element("marker square walls")) - - let sieges = map_get(view.pieces.sieges, loc) - if (sieges > 0) { - let cn - if (is_teutonic_siege_marker(loc)) - cn = "marker square siege teutonic" - else - cn = "marker square siege russian" - for (let i = 0; i < sieges; ++i) - ui.locale_markers[loc].appendChild(get_cached_element(cn)) - } } function update_plan() { @@ -1300,21 +1031,21 @@ function update_plan() { if (i < view.plan.length) { let lord = view.plan[i] if (lord < 0) { - if (player === "Teutons") - ui.plan_cards[i].className = "card teutonic cc_pass" + if (player === "York") + ui.plan_cards[i].className = "card york cc_pass" else - ui.plan_cards[i].className = "card russian cc_pass" + ui.plan_cards[i].className = "card lancaster cc_pass" } else { if (lord < 6) - ui.plan_cards[i].className = "card teutonic cc_lord_" + lord + ui.plan_cards[i].className = "card york cc_lord_" + lord else - ui.plan_cards[i].className = "card russian cc_lord_" + lord + ui.plan_cards[i].className = "card lancaster cc_lord_" + lord } } else if (is_planning && i < max_plan_length()) { - if (player === "Teutons") - ui.plan_cards[i].className = "card teutonic cc_back" + if (player === "York") + ui.plan_cards[i].className = "card york cc_back" else - ui.plan_cards[i].className = "card russian cc_back" + ui.plan_cards[i].className = "card lancaster cc_back" } else { ui.plan_cards[i].className = "hide" } @@ -1386,16 +1117,6 @@ function update_cards() { ui.hand_panel.classList.add("hide") } - ui.capabilities1.replaceChildren() - for (let i = first_p1_card; i <= last_p1_card; ++i) - if (view.capabilities.includes(i)) - ui.capabilities1.appendChild(ui.cards[i]) - - ui.capabilities2.replaceChildren() - for (let i = first_p2_card; i <= last_p2_card; ++i) - if (view.capabilities.includes(i)) - ui.capabilities2.appendChild(ui.cards[i]) - for (let ix = 0; ix < data.lords.length; ++ix) { ui.lord_capabilities[ix].replaceChildren() ui.lord_events[ix].replaceChildren() @@ -1420,16 +1141,16 @@ function update_battle() { let array = view.battle.array // Pursuit marker points "up" towards the conceding side - if (view.battle.conceded === "Russians") { - if (view.battle.attacker === "Russians") - ui.pursuit.className = "marker rectangle pursuit teutonic" + if (view.battle.conceded === "Lancaster") { + if (view.battle.attacker === "Lancaster") + ui.pursuit.className = "marker rectangle pursuit york" else - ui.pursuit.className = "marker rectangle pursuit teutonic rotate" - } else if (view.battle.conceded === "Teutons") { - if (view.battle.attacker === "Teutons") - ui.pursuit.className = "marker rectangle pursuit russian" + ui.pursuit.className = "marker rectangle pursuit york rotate" + } else if (view.battle.conceded === "York") { + if (view.battle.attacker === "York") + ui.pursuit.className = "marker rectangle pursuit lancaster" else - ui.pursuit.className = "marker rectangle pursuit russian rotate" + ui.pursuit.className = "marker rectangle pursuit lancaster rotate" } else { ui.pursuit.className = "hide" } @@ -1448,12 +1169,12 @@ function update_battle() { } function update_court() { - let tcourt_hdr = (player === "Russians") ? ui.court2_header : ui.court1_header - let rcourt_hdr = (player === "Russians") ? ui.court1_header : ui.court2_header - tcourt_hdr.textContent = "Teutonic Lords" - rcourt_hdr.textContent = "Russian Lords" - let tcourt = (player === "Russians") ? ui.court2 : ui.court1 - let rcourt = (player === "Russians") ? ui.court1 : ui.court2 + let tcourt_hdr = (player === "Lancaster") ? ui.court2_header : ui.court1_header + let rcourt_hdr = (player === "Lancaster") ? ui.court1_header : ui.court2_header + tcourt_hdr.textContent = "York Lords" + rcourt_hdr.textContent = "Lancaster Lords" + let tcourt = (player === "Lancaster") ? ui.court2 : ui.court1 + let rcourt = (player === "Lancaster") ? ui.court1 : ui.court2 tcourt.replaceChildren() rcourt.replaceChildren() for (let lord = 0; lord < 6; ++lord) @@ -1478,34 +1199,17 @@ function on_update() { for (let ix = 0; ix < data.lords.length; ++ix) { if (view.pieces.locale[ix] < 0) { ui.lord_cylinder[ix].classList.add("hide") - ui.lord_service[ix].classList.add("hide") } else { ui.lord_cylinder[ix].classList.remove("hide") update_lord(ix) } } - for (let way = 0; way < ui.ways.length; ++way) { - if (is_action("way", way)) - ui.ways[way].classList.add("action") - else - ui.ways[way].classList.remove("action") - } - layout_calendar() - update_legate() - update_smerdi() - update_veche() - for (let loc = 0; loc < data.locales.length; ++loc) update_locale(loc) - update_castle(ui.castles[0], view.pieces.castles1[0]) - update_castle(ui.castles[1], view.pieces.castles1[1]) - update_castle(ui.castles[2], view.pieces.castles2[0]) - update_castle(ui.castles[3], view.pieces.castles2[1]) - update_current_card_display() if (view.turn & 1) @@ -1517,41 +1221,30 @@ function on_update() { let vp2 = count_vp2() if ((vp1 >> 1) === (vp2 >> 1)) { if (vp1 & 1) - ui.vp1.className = `marker circle victory teutonic stack v${vp1>>1} half` + ui.vp1.className = `marker circle victory york stack v${vp1>>1} half` else - ui.vp1.className = `marker circle victory teutonic stack v${vp1>>1}` + ui.vp1.className = `marker circle victory york stack v${vp1>>1}` if (vp2 & 1) - ui.vp2.className = `marker circle victory russian stack v${vp2>>1} half` + ui.vp2.className = `marker circle victory lancaster stack v${vp2>>1} half` else - ui.vp2.className = `marker circle victory russian stack v${vp2>>1}` + ui.vp2.className = `marker circle victory lancaster stack v${vp2>>1}` } else { if (vp1 & 1) - ui.vp1.className = `marker circle victory teutonic v${vp1>>1} half` + ui.vp1.className = `marker circle victory york v${vp1>>1} half` else - ui.vp1.className = `marker circle victory teutonic v${vp1>>1}` + ui.vp1.className = `marker circle victory york v${vp1>>1}` if (vp2 & 1) - ui.vp2.className = `marker circle victory russian v${vp2>>1} half` + ui.vp2.className = `marker circle victory lancaster v${vp2>>1} half` else - ui.vp2.className = `marker circle victory russian v${vp2>>1}` + ui.vp2.className = `marker circle victory lancaster v${vp2>>1}` } - if (view.pieces.elr1) - ui.elr1.classList = `marker circle enemy_lords_removed teutonic v${view.pieces.elr1}` - else - ui.elr1.classList = `marker circle enemy_lords_removed teutonic hide` - if (view.pieces.elr2) - ui.elr2.classList = `marker circle enemy_lords_removed russian v${view.pieces.elr2}` - else - ui.elr2.classList = `marker circle enemy_lords_removed russian hide` - ui.held1.textContent = `${view.held1} Held` ui.held2.textContent = `${view.held2} Held` update_plan() update_cards() - ui.veche.classList.toggle("action", is_action("veche")) - if (view.battle && view.battle.array) { ui.reserves_panel.classList.remove("hide") ui.battle_panel.classList.remove("hide") @@ -1667,9 +1360,9 @@ function on_update() { function on_focus_card_tip(c) { if (c <= first_p1_card) - ui.command.className = `card teutonic aow_${c}` + ui.command.className = `card york aow_${c}` else - ui.command.className = `card russian aow_${c}` + ui.command.className = `card lancaster aow_${c}` } function on_blur_card_tip() { @@ -1702,18 +1395,6 @@ function on_click_locale_tip(loc) { ui.locale[loc].scrollIntoView({ block:"center", inline:"center", behavior:"smooth" }) } -function on_focus_way_tip(way) { - ui.ways[way].classList.add("tip") -} - -function on_blur_way_tip(way) { - ui.ways[way].classList.remove("tip") -} - -function on_click_way_tip(way) { - ui.ways[way].scrollIntoView({ block:"center", inline:"center", behavior:"smooth" }) -} - function on_click_lord_tip(lord) { ui.lord_mat[lord].scrollIntoView({ block:"center", inline:"center", behavior:"smooth" }) } @@ -1730,12 +1411,6 @@ function sub_lord_name(match, p1) { return `<span class="lord_tip" onclick="on_click_lord_tip(${x})">${n}</span>` } -function sub_way_name(match, p1) { - let x = p1 | 0 - let n = data.ways[x].name - return `<span class="way_tip" onmouseenter="on_focus_way_tip(${x})" onmouseleave="on_blur_way_tip(${x})" onclick="on_click_way_tip(${x})">${n}</span>` -} - function on_log(text) { let p = document.createElement("div") @@ -1757,31 +1432,30 @@ function on_log(text) { text = text.replace(/E(\d+)/g, sub_card_event) text = text.replace(/L(\d+)/g, sub_lord_name) text = text.replace(/%(\d+)/g, sub_locale_name) - text = text.replace(/W(\d+)/g, sub_way_name) if (text.match(/^\.h1/)) { text = text.substring(4) p.className = "h1" } - else if (text.match(/^\.h2t/)) { + else if (text.match(/^\.h2y/)) { text = text.substring(5) - p.className = "h2 teutonic" + p.className = "h2 york" } - else if (text.match(/^\.h2r/)) { + else if (text.match(/^\.h2l/)) { text = text.substring(5) - p.className = "h2 russian" + p.className = "h2 lancaster" } else if (text.match(/^\.h2/)) { text = text.substring(4) p.className = "h2" } - else if (text.match(/^\.h3t/)) { + else if (text.match(/^\.h3y/)) { text = text.substring(5) - p.className = "h3 teutonic" + p.className = "h3 york" } - else if (text.match(/^\.h3r/)) { + else if (text.match(/^\.h3l/)) { text = text.substring(5) - p.className = "h3 russian" + p.className = "h3 lancaster" } else if (text.match(/^\.h3/)) { text = text.substring(4) @@ -763,8 +763,6 @@ function is_card_in_use(c) { return true if (set_has(game.events, c)) return true - if (set_has(game.capabilities, c)) - return true if (game.pieces.capabilities.includes(c)) return true return false @@ -799,8 +797,6 @@ function can_discard_card(c) { return true if (set_has(game.hand2, c)) return true - if (set_has(game.capabilities, c)) - return true if (game.pieces.capabilities.includes(c)) return true } @@ -1199,38 +1195,6 @@ function list_ways(from, to) { return ways return null } -/* -function is_upper_lord(lord) { - return map_has(game.pieces.lieutenants, lord) -} - -function is_lower_lord(lord) { - for (let i = 1; i < game.pieces.lieutenants.length; i += 2) - if (game.pieces.lieutenants[i] === lord) - return true - return false -} - -function get_lower_lord(upper) { - return map_get(game.pieces.lieutenants, upper, NOBODY) -} - -function set_lower_lord(upper, lower) { - map_set(game.pieces.lieutenants, upper, lower) -} - -function add_lieutenant(upper) { - map_set(game.pieces.lieutenants, upper, NOBODY) -} - -function remove_lieutenant(lord) { - for (let i = 0; i < game.pieces.lieutenants.length; i += 2) { - if (game.pieces.lieutenants[i] === lord || game.pieces.lieutenants[i + 1] === lord) { - array_remove_pair(game.pieces.lieutenants, i) - return - } - } -}*/ function group_has_capability(c) { for (let lord of game.group) @@ -1390,7 +1354,6 @@ exports.setup = function (seed, scenario, options) { turn: 0, events: [], // this levy/this campaign cards - capabilities: [], // global capabilities pieces: { locale: Array(lord_count).fill(NOWHERE), @@ -1400,6 +1363,7 @@ exports.setup = function (seed, scenario, options) { capabilities: Array(lord_count << 1).fill(NOTHING), moved: 0, vassals: Array(vassal_count).fill(VASSAL_UNAVAILABLE), + exhausted: [], favour: [], }, @@ -1504,12 +1468,11 @@ function is_leeward_battle_line_in_play () { if (is_archery_step()) { if (game.active === LANCASTER) return is_event_in_play(EVENT_LANCASTER_LEEWARD_BATTLE_LINE) - } if (game.active === YORK) return is_event_in_play(EVENT_YORK_LEEWARD_BATTLE_LINE) } return false - +} function is_marsh_in_play() { if (game.battle.round <= 2) { @@ -7469,8 +7432,8 @@ function gen_action_routed_serfs(lord) { gen_action("routed_serfs", lord) } -const P1_LORD_MASK = (1|2|4|8|16|32) -const P2_LORD_MASK = (1|2|4|8|16|32) << 6 +const P1_LORD_MASK = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 +const P2_LORD_MASK = P1_LORD_MASK << 6 exports.view = function (state, current) { load_state(state) @@ -7484,7 +7447,6 @@ exports.view = function (state, current) { scenario: (scenario_first_turn[game.scenario] << 5) + (scenario_last_turn[game.scenario]), turn: game.turn, events: game.events, - capabilities: game.capabilities, pieces: game.pieces, battle: game.battle, diff --git a/tools/gendata.js b/tools/gendata.js index 8595fcd..1ed9bdb 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -156,10 +156,10 @@ const scale = 1 function defloc(region, stronghold, type, name) { let [x, y, w, h] = boxes[name] - x = Math.floor(x * 75 / 300) - y = Math.floor(y * 75 / 300) - w = Math.ceil(w * 75 / 300) - h = Math.ceil(h * 75 / 300) + x = Math.floor(x) + y = Math.floor(y) + w = Math.ceil(w) + h = Math.ceil(h) locmap[name] = locales.length if (stronghold > 0) strongholds.push(locales.length) |