From 18283cc5115f7637a66321a832f46bae381e9681 Mon Sep 17 00:00:00 2001 From: Troy Nordine Date: Wed, 20 Sep 2023 15:03:12 -0500 Subject: added paying lords&vassals. fixed muster lord. + --- data.js | 38 +++++++------ play.css | 16 ++++++ play.js | 29 +++++----- rules.js | 165 +++++++++++++++++++++++++++++++++---------------------- tools/gendata.js | 54 +++++++++--------- 5 files changed, 175 insertions(+), 127 deletions(-) diff --git a/data.js b/data.js index 6a40af5..48bda89 100644 --- a/data.js +++ b/data.js @@ -413,30 +413,34 @@ deplete:[ {"name":"Ravenspur deplete","box":{"x":845,"y":711,"w":72,"h":45}}, ], seat:[ +{"name":"seat york lord_york","box":{"x":904,"y":930,"w":54,"h":56}}, +{"name":"seat york lord_march","box":{"x":432,"y":947,"w":54,"h":56}}, +{"name":"seat york lord_edward_iv","box":{"x":944,"y":1169,"w":54,"h":56}}, +{"name":"seat york lord_salisbury","box":{"x":653,"y":617,"w":54,"h":56}}, +{"name":"seat york lord_rutland","box":{"x":1113,"y":1181,"w":54,"h":56}}, +{"name":"seat york lord_pembroke","box":{"x":145,"y":1108,"w":54,"h":56}}, +{"name":"seat york lord_devon","box":{"x":313,"y":1340,"w":54,"h":56}}, +{"name":"seat york lord_northumberland_y1","box":{"x":397,"y":405,"w":54,"h":56}}, +{"name":"seat york lord_northumberland_y2","box":{"x":397,"y":405,"w":54,"h":56}}, +{"name":"seat york lord_gloucester_1","box":{"x":620,"y":1061,"w":54,"h":56}}, +{"name":"seat york lord_gloucester_2","box":{"x":944,"y":1169,"w":54,"h":56}}, +{"name":"seat york lord_richard_iii","box":{"x":944,"y":1169,"w":54,"h":56}}, +{"name":"seat york lord_norfolk","box":{"x":850,"y":1330,"w":54,"h":56}}, +{"name":"seat york lord_warwick_y","box":{"x":1118,"y":1385,"w":54,"h":56}}, {"name":"seat lancaster lord_henry_vi","box":{"x":944,"y":1144,"w":54,"h":56}}, {"name":"seat lancaster lord_margaret","box":{"x":944,"y":1144,"w":54,"h":56}}, -{"name":"seat lancaster lord_henry_tudor","box":{"x":944,"y":1144,"w":54,"h":56}}, -{"name":"seat york lord_edward_iii","box":{"x":944,"y":1169,"w":54,"h":56}}, -{"name":"seat york lord_gloucester_2","box":{"x":944,"y":1169,"w":54,"h":56}}, -{"name":"seat york lord_gloucester_1","box":{"x":620,"y":1061,"w":54,"h":56}}, -{"name":"seat york lord_salisbury","box":{"x":653,"y":617,"w":54,"h":56}}, -{"name":"seat lancaster lord_clarence","box":{"x":654,"y":593,"w":54,"h":56}}, -{"name":"seat lancaster lord_northumberland_l","box":{"x":397,"y":405,"w":54,"h":56}}, +{"name":"seat lancaster lord_somerset_1","box":{"x":453,"y":1248,"w":54,"h":56}}, +{"name":"seat lancaster lord_somerset_2","box":{"x":453,"y":1248,"w":54,"h":56}}, +{"name":"seat lancaster lord_exeter_1","box":{"x":405,"y":1391,"w":54,"h":56}}, +{"name":"seat lancaster lord_exeter_2","box":{"x":405,"y":1391,"w":54,"h":56}}, {"name":"seat lancaster lord_buckingham","box":{"x":715,"y":958,"w":54,"h":56}}, -{"name":"seat york lord_march","box":{"x":432,"y":947,"w":54,"h":56}}, +{"name":"seat lancaster lord_northumberland_l","box":{"x":397,"y":405,"w":54,"h":56}}, +{"name":"seat lancaster lord_clarence","box":{"x":654,"y":593,"w":54,"h":56}}, {"name":"seat lancaster lord_jasper_tudor_1","box":{"x":147,"y":1067,"w":54,"h":56}}, {"name":"seat lancaster lord_jasper_tudor_2","box":{"x":230,"y":888,"w":54,"h":56}}, +{"name":"seat lancaster lord_henry_tudor","box":{"x":944,"y":1144,"w":54,"h":56}}, {"name":"seat lancaster lord_oxford","box":{"x":771,"y":1092,"w":54,"h":56}}, -{"name":"seat york lord_rutland","box":{"x":1113,"y":1181,"w":54,"h":56}}, {"name":"seat lancaster lord_warwick_l","box":{"x":1118,"y":1385,"w":54,"h":56}}, -{"name":"seat lancaster lord_exeter_1","box":{"x":405,"y":1391,"w":54,"h":56}}, -{"name":"seat york lord_devon","box":{"x":313,"y":1340,"w":54,"h":56}}, -{"name":"seat york lord_pembroke","box":{"x":145,"y":1108,"w":54,"h":56}}, -{"name":"seat york lord_warwick_y","box":{"x":1118,"y":1385,"w":54,"h":56}}, -{"name":"seat lancaster lord_somerset_1","box":{"x":453,"y":1248,"w":54,"h":56}}, -{"name":"seat york lord_norfolk","box":{"x":850,"y":1330,"w":54,"h":56}}, -{"name":"seat york lord_northumberland_y1","box":{"x":397,"y":405,"w":54,"h":56}}, -{"name":"seat york lord_york","box":{"x":904,"y":930,"w":54,"h":56}}, ], vassalbox:[ {"name":"vassal vassal_westmorld","box":{"x":600,"y":470,"w":54,"h":56}}, diff --git a/play.css b/play.css index e3aa533..91a2af8 100644 --- a/play.css +++ b/play.css @@ -373,6 +373,15 @@ body.shift .exhausted { margin: 0 2px; } +.unit.vassal { + border: 2px solid #d1cfa1; + width: 46px; + height: 46px; + border-radius: 8px; + margin: 0 2px; +} + + .unit.action { filter: drop-shadow(2px 0px 0px white) @@ -909,3 +918,10 @@ body.shift .exhausted { .marker.vassal.vassal_edward { background-color: hsl(358,83%,91%); border-color: hsl(358,83%,100%) hsl(358,83%,81%) hsl(358,83%,81%) hsl(358,83%,100%); box-shadow: 0 0 0 1px hsl(358,83%,30%), 0px 1px 4px #0008; } .marker.vassal.vassal_thomas_stanley { background-color: hsl(358,83%,91%); border-color: hsl(358,83%,100%) hsl(358,83%,81%) hsl(358,83%,81%) hsl(358,83%,100%); box-shadow: 0 0 0 1px hsl(358,83%,30%), 0px 1px 4px #0008; } .marker.vassal.vassal_trollope { background-color: hsl(358,83%,91%); border-color: hsl(358,83%,100%) hsl(358,83%,81%) hsl(358,83%,81%) hsl(358,83%,100%); box-shadow: 0 0 0 1px hsl(358,83%,30%), 0px 1px 4px #0008; } +.unit.vassal { background-color: hsl(58,34%,73%); border-color: hsl(58,34%,83%) hsl(58,34%,63%) hsl(58,34%,63%) hsl(58,34%,83%); box-shadow: 0 0 0 1px hsl(58,34%,24%), 0px 1px 4px #0008; } +.unit.vassal.back { background-color: hsl(57,48%,75%); border-color: hsl(57,48%,85%) hsl(57,48%,65%) hsl(57,48%,65%) hsl(57,48%,85%); box-shadow: 0 0 0 1px hsl(57,48%,25%), 0px 1px 4px #0008; } +.unit.vassal.vassal_hastings { background-color: hsl(217,53%,88%); border-color: hsl(217,53%,98%) hsl(217,53%,78%) hsl(217,53%,78%) hsl(217,53%,98%); box-shadow: 0 0 0 1px hsl(217,53%,29%), 0px 1px 4px #0008; } +.unit.vassal.vassal_clifford { background-color: hsl(358,83%,91%); border-color: hsl(358,83%,100%) hsl(358,83%,81%) hsl(358,83%,81%) hsl(358,83%,100%); box-shadow: 0 0 0 1px hsl(358,83%,30%), 0px 1px 4px #0008; } +.unit.vassal.vassal_edward { background-color: hsl(358,83%,91%); border-color: hsl(358,83%,100%) hsl(358,83%,81%) hsl(358,83%,81%) hsl(358,83%,100%); box-shadow: 0 0 0 1px hsl(358,83%,30%), 0px 1px 4px #0008; } +.unit.vassal.vassal_thomas_stanley { background-color: hsl(358,83%,91%); border-color: hsl(358,83%,100%) hsl(358,83%,81%) hsl(358,83%,81%) hsl(358,83%,100%); box-shadow: 0 0 0 1px hsl(358,83%,30%), 0px 1px 4px #0008; } +.unit.vassal.vassal_trollope { background-color: hsl(358,83%,91%); border-color: hsl(358,83%,100%) hsl(358,83%,81%) hsl(358,83%,81%) hsl(358,83%,100%); box-shadow: 0 0 0 1px hsl(358,83%,30%), 0px 1px 4px #0008; } diff --git a/play.js b/play.js index ef9b28f..03c5a99 100644 --- a/play.js +++ b/play.js @@ -390,7 +390,7 @@ function is_vassal_ready(vassal) { function is_vassal_unavailable(vassal) { - return view.pieces.vassals[vassal] === VASSAL_UNAVAILABLE + return pack8_get(view.pieces.vassals[vassal], 0) === VASSAL_UNAVAILABLE } @@ -801,7 +801,7 @@ function build_map() { let xc = Math.round(x + w / 2) let yc = Math.round(y + h / 2) let small = 46 - e.className = "hide marker " + vassal.name + e.className = "hide unit " + vassal.name e.style.position = "absolute" e.style.top = y + "px" e.style.left = x + "px" @@ -810,13 +810,12 @@ function build_map() { e.style.backgroundSize = small + "px" register_action(e, "vassal", ix) register_tooltip(e, data.vassalbox[ix].name) -// e.classList.toggle("hide", !is_vassal_ready(ix)) document.getElementById("pieces").appendChild(e) }) data.vassals.forEach((vassal, ix) => { let e = ui.map_vassals[ix] = document.createElement("div") - e.className = "hide marker square " + vassal.name + e.className = "hide marker square vassal vassal_" + clean_name(vassal.name) e.style.position = "absolute" e.style.width = 46 + "px" e.style.height = 46 + "px" @@ -825,7 +824,6 @@ function build_map() { register_action(e, "vassal", ix) register_tooltip(e, data.vassals[ix].name) -// e.classList.toggle("hide", is_vassal_ready(ix)) document.getElementById("pieces").appendChild(e) }) @@ -1041,15 +1039,15 @@ function layout_track() { function add_vassal(parent, vassal, lord, routed) { let elt if (routed) { - if (is_action(routed_force_action_name[VASSAL], lord)) - elt = get_cached_element("action unit " + force_action_name[VASSAL] + " " + data.vassals[vassal].name, routed_force_action_name[VASSAL], lord) + if (is_action(routed_force_action_name[VASSAL], vassal)) + elt = get_cached_element("action unit " + force_action_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), routed_force_action_name[VASSAL], vassal) else - elt = get_cached_element("action unit " + force_action_name[VASSAL] + " " + data.vassals[vassal].name, routed_force_action_name[VASSAL], lord) + elt = get_cached_element("unit " + force_action_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), routed_force_action_name[VASSAL], vassal) } else { - if (is_action(routed_force_action_name[VASSAL], lord)) - elt = get_cached_element("action unit " + force_action_name[VASSAL] + " " + data.vassals[vassal].name, force_action_name[VASSAL], lord) + if (is_action(force_action_name[VASSAL], vassal)) + elt = get_cached_element("action unit " + force_action_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), force_action_name[VASSAL], vassal) else - elt = get_cached_element("action unit " + force_action_name[VASSAL] + " " + data.vassals[vassal].name, force_action_name[VASSAL], lord) + elt = get_cached_element("unit " + force_action_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), force_action_name[VASSAL], vassal) } parent.appendChild(elt) } @@ -1084,7 +1082,8 @@ function update_forces(parent, forces, lord_ix, routed) { for (let i = 0; i < force_type_count; ++i) { if (i === VASSAL) { get_vassals_with_lord(lord_ix) - .forEach(v => add_vassal(v, parent)) + .filter(v => (view.battle === 0 && routed === false) || (view.battle !== 0 && view.battle.routed_vassals[lord_ix].includes(v) === routed)) + .forEach(v => add_vassal(parent, v, lord_ix, routed)) } else { let n = pack4_get(forces, i) for (let k = 0; k < n; ++k) { @@ -1268,7 +1267,7 @@ function update_plan() { let is_planning = view.actions && view.actions.plan ui.plan_panel.classList.remove("hide") - for (let i = 0; i < 6; ++i) { + for (let i = 0; i < 7; ++i) { if (i < view.plan.length) { let lord = view.plan[i] if (lord < 0) { @@ -1420,8 +1419,8 @@ function update_vassals() { calendar_layout_vassal[get_vassal_locale(v) - CALENDAR].push(e) e.classList.remove("hide") e.classList.toggle("action", is_action("vassal", v)) - e.classList.add("vassal" + clean_name(info.name)) - e.classList.add("back", is_vassal_unavailable(v)) + e.classList.toggle("back", is_vassal_unavailable(v)) + ui.vassalbox[v].classList.add("hide") } else if (is_vassal_ready(v)) { let e = ui.vassalbox[v] e.classList.remove("hide") diff --git a/rules.js b/rules.js index f1b27b5..dcf7507 100644 --- a/rules.js +++ b/rules.js @@ -1127,6 +1127,10 @@ function get_vassals_with_lord(lord) { return results } +function get_lord_with_vassal(vassal) { + return pack8_get(game.pieces.vassals[vassal], 0) +} + function set_vassal_ready(vassal) { game.pieces.vassals[vassal] = pack8_set(game.pieces.vassals[vassal], 0, VASSAL_READY) } @@ -1240,13 +1244,16 @@ function is_lord_at_seat(lord) { return is_lord_seat(lord, get_lord_locale(lord)) } -function has_free_seat(lord) { - let result = false - for_each_seat(lord, seat => { - if (!result && is_friendly_locale(seat)) - result = true - }) - return result +function has_local_to_muster(lord) { + if (!has_enemy_lord(data.lords[lord].seats[0])) + return true + + for (let l = first_friendly_lord; l <= last_friendly_lord; l++) { + if (is_lord_on_map(l) && is_friendly_locale(get_lord_locale(l))) + return true + } + + return false } function has_york_lord(here) { @@ -1618,7 +1625,7 @@ function muster_lord(lord, locale) { set_lord_assets(lord, COIN, info.assets.coin | 0) set_lord_assets(lord, CART, info.assets.cart | 0) - set_lord_assets(lord, SHIP, info.assets.ship | 0) + set_lord_assets(lord, SHIP, info.ship | 0) muster_lord_forces(lord) } @@ -2550,7 +2557,7 @@ states.levy_muster_lord = { if (game.count > 0) { // Roll to muster Ready Lord at Seat for (let lord = first_friendly_lord; lord <= last_friendly_lord; ++lord) { - if (is_lord_ready(lord) && has_free_seat(lord)) + if (is_lord_ready(lord) && has_local_to_muster(lord)) gen_action_lord(lord) } @@ -2586,21 +2593,12 @@ states.levy_muster_lord = { lord(other) { clear_undo() - let die = roll_die() - let influence = data.lords[game.who].influence - if (die <= influence) { - log(`L${other} ${range(influence)}: ${HIT[die]}`) - push_state("muster_lord_at_seat") - game.who = other - } else { - log(`L${other} ${range(influence)}: ${MISS[die]}`) - resume_levy_muster_lord() - } + goto_levy_muster_lord_attempt(other) }, vassal(vassal) { push_undo() - goto_muster_vassal(vassal) + goto_levy_muster_vassal(vassal) }, take_ship() { @@ -2667,11 +2665,23 @@ states.levy_muster_lord = { states.muster_lord_at_seat = { inactive: "Muster", prompt() { - view.prompt = `Muster: Select Seat for ${lord_name[game.who]}.` - for_each_seat(game.who, seat => { - if (is_friendly_locale(seat)) + view.prompt = `Muster: Select Locale for ${lord_name[game.who]}.` + let found = false + + let seat = data.lords[game.who].seats[0] + if (!has_enemy_lord(seat)) { gen_action_locale(seat) - }) + found = true + } + + if (!found) { + for (let lord = first_friendly_lord; lord <= last_friendly_lord; lord++) { + if (is_lord_on_map(lord) && is_friendly_locale(data.lords[lord].seats[0])) { + gen_action_locale(data.lords[lord].seats[0]) + } + } + } + }, locale(loc) { push_undo() @@ -2687,43 +2697,55 @@ states.muster_lord_at_seat = { // TODO : IF SEAT WITH ENEMY LORD GOES WITH ANY FRIENDLY SEAT set_lord_moved(game.who, 1) muster_lord(game.who, loc) - game.state = "muster_lord_transport" - game.count = data.lords[game.who].assets.transport | 0 - resume_muster_lord_transport() + if (game.active === YORK) { + add_favoury_marker(loc) + remove_favourl_marker(loc) + } else { + add_favourl_marker(loc) + remove_favoury_marker(loc) + } + end_muster_lord_at_seat() }, } -function resume_muster_lord_transport() { - if (game.count === 0) - pop_state() - if (game.state === "levy_muster_lord") - resume_levy_muster_lord() +function goto_levy_muster_lord_attempt(lord) { + game.what = lord + push_state("levy_muster_lord_attempt") + init_influence_check(game.who) } -states.muster_lord_transport = { - inactive: "Muster", +function end_levy_muster_lord_attempt() { + pop_state() + clear_undo() + end_influence_check() + resume_levy_muster_lord() +} + +states.levy_muster_lord_attempt = { + inactive: "Levy Lord", prompt() { - view.prompt = `Muster: Select Transport for ${lord_name[game.who]}.` - view.prompt += ` ${game.count} left.` - if (data.lords[game.who].ships) { - if (can_add_transport(game.who, SHIP)) - view.actions.take_ship = 1 - } - if (can_add_transport(game.who, CART)) - view.actions.take_cart = 1 - }, - take_ship() { - push_undo() - add_lord_assets(game.who, SHIP, 1) - --game.count - resume_muster_lord_transport() - }, - take_cart() { - push_undo() - add_lord_assets(game.who, CART, 1) - --game.count - resume_muster_lord_transport() + view.prompt = `Levy Lord ${lord_name[game.what]}. ` + + prompt_influence_check() }, + spend1:add_influence_check_modifier_1, + spend3:add_influence_check_modifier_2, + check() { + let results = do_influence_check() + log(`Attempt to levy L${game.what} ${results.success ? "Successful" : "Failed"}: (${range(results.rating)}) ${results.success ? HIT[results.roll] : MISS[results.roll]}`) + + if (results.success) { + push_state("muster_lord_at_seat") + game.who = game.what + } else { + end_levy_muster_lord_attempt() + } + } +} + +function end_muster_lord_at_seat() { + pop_state() + end_levy_muster_lord_attempt() } function lord_has_capability_card(lord, c) { @@ -3421,23 +3443,24 @@ states.parley = { // 2) The other vassal marker is placed, face down, on the calendar, a number of boxes right to current turn + 6 - service // (a service 3 disbanding in turn 8 will come back turn 11) -function goto_muster_vassal(vassal) { +function goto_levy_muster_vassal(vassal) { game.what = vassal - push_state("levy_vassal") + push_state("levy_muster_vassal") init_influence_check(game.who) game.check.push({cost: 0, modifier: data.vassals[vassal].influence * (game.active === LANCASTER? -1 : 1), source: "vassal"}) } -function end_muster_vassal() { +function end_levy_muster_vassal() { pop_state() + clear_undo() end_influence_check() resume_levy_muster_lord() } -states.levy_vassal = { +states.levy_muster_vassal = { inactive: "Levy Vassal", prompt() { - view.prompt = `Levy Vassal V${game.what}. ` + view.prompt = `Levy Vassal ${data.vassals[game.what].name}. ` prompt_influence_check() }, @@ -3447,10 +3470,10 @@ states.levy_vassal = { let results = do_influence_check() log(`Attempt to levy V${game.what} ${results.success ? "Successful" : "Failed"}: (${range(results.rating)}) ${results.success ? HIT[results.roll] : MISS[results.roll]}`) - if (success) { - muster_vassal(game.who, game.what) + if (results.success) { + muster_vassal(game.what, game.who) } - end_muster_vassal() + end_levy_muster_vassal() } } @@ -5107,7 +5130,7 @@ function will_lord_rout(lord) { return false } -function rout_unit(lord, type) { +function rout_unit(lord, type, special) { if (type === VASSAL) { rout_vassal(lord, special) } else { @@ -5178,13 +5201,15 @@ function action_assign_hits(lord, type, special) { let protection = check_protection_capabilities(FORCE_PROTECTION[type]) let extra = "" - if (assign_hit_roll(get_force_name(lord, type), protection, extra)) { + if (assign_hit_roll(get_force_name(lord, type, special), protection, extra)) { if (get_lord_remaining_valour(lord) > 0) { game.state = "spend_valour" game.what = type + if (game.what === VASSAL) + game.where = special } else { - rout_unit(lord, type) + rout_unit(lord, type, special) finish_action_assign_hits(lord) } } else { @@ -5211,12 +5236,12 @@ function finish_action_assign_hits(lord) { states.spend_valour = { inactive: "Spend Valour", prompt() { - view.prompt = `Spend Valour: Reroll Hit on ${get_force_name(game.who, game.what)}?` + view.prompt = `Spend Valour: Reroll Hit on ${get_force_name(game.who, game.what, game.where)}?` gen_action("valour", game.who) view.actions.pass = 1 }, pass() { - rout_unit(game.who, game.what) + rout_unit(game.who, game.what, game.where) finish_action_assign_hits(game.who) }, valour() { @@ -5857,6 +5882,7 @@ function has_friendly_lord_who_must_pay_troops() { } function goto_pay_lords() { + clear_undo() for (let lord = first_friendly_lord; lord < last_friendly_lord; lord++) { if (is_lord_on_map(lord)) set_lord_unfed(lord, 1) @@ -5906,10 +5932,12 @@ states.pay_lords = { game.who = lord }, disband() { + push_undo() disband_lord(game.who) game.who = NOBODY }, pay() { + push_undo() reduce_influence(is_exile(get_lord_locale(game.who)) ? 2 : 1) set_lord_moved(game.who, 0) game.who = NOBODY @@ -5921,6 +5949,7 @@ states.pay_lords = { function goto_pay_vassals() { + clear_undo() let vassal_to_pay = false for (let v = first_vassal; v < last_vassal; v++) { @@ -5973,11 +6002,13 @@ states.pay_vassals = { game.what = v }, pay() { + push_undo() pay_vassal(game.what) reduce_influence(1) game.what = NOBODY }, disband() { + push_undo() disband_vassal(game.what) game.what = NOBODY }, diff --git a/tools/gendata.js b/tools/gendata.js index 4521bd3..2799504 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -265,7 +265,8 @@ const boxes = { "seat lancaster lord_henry_vi": [944,1144,54,56], "seat lancaster lord_margaret": [944,1144,54,56], "seat lancaster lord_henry_tudor": [944,1144,54,56], - "seat york lord_edward_iii": [944,1169,54,56], + "seat york lord_richard_iii": [944,1169,54,56], + "seat york lord_edward_iv": [944,1169,54,56], "seat york lord_gloucester_2": [944,1169,54,56], "seat york lord_gloucester_1": [620,1061,54,56], "seat york lord_salisbury": [653,617,54,56], @@ -280,11 +281,14 @@ const boxes = { "seat york lord_rutland": [1113,1181,54,56], "seat lancaster lord_warwick_l": [1118,1385,54,56], "seat lancaster lord_exeter_1": [405,1391,54,56], + "seat lancaster lord_exeter_2": [405,1391,54,56], "seat york lord_devon": [313,1340,54,56], "seat york lord_pembroke": [145,1108,54,56], "seat lancaster lord_somerset_1": [453,1248,54,56], + "seat lancaster lord_somerset_2": [453,1248,54,56], "seat york lord_norfolk": [850,1330,54,56], "seat york lord_northumberland_y1": [397,405,54,56], + "seat york lord_northumberland_y2": [397,405,54,56], "seat york lord_warwick_y": [1118,1385,54,56], "Ireland favour": [50,947,110,121], "seat york lord_york": [904,930,54,56], @@ -346,15 +350,6 @@ function deffavour(name) { 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) @@ -592,31 +587,34 @@ deffavour("Scarborough favour") deffavour("Ravenspur favour") //LOCALE SEAT - +defseat("seat york lord_york") +defseat("seat york lord_march") +defseat("seat york lord_edward_iv") +defseat("seat york lord_salisbury") +defseat("seat york lord_rutland") +defseat("seat york lord_pembroke") +defseat("seat york lord_devon") +defseat("seat york lord_northumberland_y1") +defseat("seat york lord_northumberland_y2") +defseat("seat york lord_gloucester_1") +defseat("seat york lord_gloucester_2") +defseat("seat york lord_richard_iii") +defseat("seat york lord_norfolk") +defseat("seat york lord_warwick_y") defseat("seat lancaster lord_henry_vi") defseat("seat lancaster lord_margaret") -defseat("seat lancaster lord_henry_tudor") -defseat("seat york lord_edward_iii") -defseat("seat york lord_gloucester_2") -defseat("seat york lord_gloucester_1") -defseat("seat york lord_salisbury") -defseat("seat lancaster lord_clarence") -defseat("seat lancaster lord_northumberland_l") +defseat("seat lancaster lord_somerset_1") +defseat("seat lancaster lord_somerset_2") +defseat("seat lancaster lord_exeter_1") +defseat("seat lancaster lord_exeter_2") defseat("seat lancaster lord_buckingham") -defseat("seat york lord_march") +defseat("seat lancaster lord_northumberland_l") +defseat("seat lancaster lord_clarence") defseat("seat lancaster lord_jasper_tudor_1") defseat("seat lancaster lord_jasper_tudor_2") +defseat("seat lancaster lord_henry_tudor") defseat("seat lancaster lord_oxford") -defseat("seat york lord_rutland") defseat("seat lancaster lord_warwick_l") -defseat("seat lancaster lord_exeter_1") -defseat("seat york lord_devon") -defseat("seat york lord_pembroke") -defseat("seat york lord_warwick_y") -defseat("seat lancaster lord_somerset_1") -defseat("seat york lord_norfolk") -defseat("seat york lord_northumberland_y1") -defseat("seat york lord_york") // VASSAL SEAT -- cgit v1.2.3