diff options
-rw-r--r-- | data.js | 56 | ||||
-rw-r--r-- | play.css | 23 | ||||
-rw-r--r-- | play.js | 44 | ||||
-rw-r--r-- | rules.ts | 64 | ||||
-rw-r--r-- | tools/gendata.js | 30 |
5 files changed, 115 insertions, 102 deletions
@@ -149,34 +149,34 @@ ways:[ [], ], lords:[ -{"side":"York","name":"York","full_name":"Richard Plantagenet","title":"Duke of York","seat":38,"marshal":2,"influence":5,"lordship":3,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_york"}, -{"side":"York","name":"March","full_name":"Edward Plantagenet","title":"Earl of March","seat":9,"marshal":0,"influence":2,"lordship":2,"command":2,"valour":3,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":2,"militia":1},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_march"}, -{"side":"York","name":"Edward IV","full_name":"Edward Plantagenet","title":"King of England","seat":30,"marshal":2,"influence":5,"lordship":3,"command":2,"valour":4,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_edward_iv"}, -{"side":"York","name":"Salisbury","full_name":"Richard Neville","title":"Earl of Salisbury","seat":50,"marshal":0,"influence":3,"lordship":3,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_salisbury"}, -{"side":"York","name":"Rutland","full_name":"Edmund Plantagenet","title":"Earl of Rutland","seat":18,"marshal":0,"influence":2,"lordship":2,"command":1,"valour":1,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":2,"militia":1},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_rutland"}, -{"side":"York","name":"Pembroke","full_name":"William Herbert","title":"Earl of Pembroke","seat":6,"marshal":0,"influence":2,"lordship":2,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":3,"militia":2},"assets":{"cart":1,"prov":1,"coin":2},"ships":0,"id":"lord_pembroke"}, -{"side":"York","name":"Devon","full_name":"Humpfrey Stafford","title":"Earl of Devon","seat":21,"marshal":0,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":2,"militia":1},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_devon"}, -{"side":"York","name":"Northumberland Y1","full_name":"Henry Percy","title":"Northumberland","seat":4,"marshal":0,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":4},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_northumberland_y1"}, -{"side":"York","name":"Northumberland Y2","full_name":"Henry Percy","title":"Northumberland","seat":4,"marshal":0,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_northumberland_y2"}, -{"side":"York","name":"Gloucester 1","full_name":"Richard Plantagenet","title":"Duke of Gloucester","seat":27,"marshal":1,"influence":2,"lordship":2,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_gloucester_1"}, -{"side":"York","name":"Gloucester 2","full_name":"Richard Plantagenet","title":"Duke of Gloucester","seat":27,"marshal":1,"influence":5,"lordship":3,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3,"militia":4},"assets":{"cart":2,"prov":2,"coin":4},"ships":0,"id":"lord_gloucester_2"}, -{"side":"York","name":"Richard III","full_name":"Richard Plantagenet","title":"King of England","seat":30,"marshal":2,"influence":5,"lordship":3,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":2,"militia":4},"assets":{"cart":2,"prov":2,"coin":4},"ships":0,"id":"lord_richard_iii"}, -{"side":"York","name":"Norfolk","full_name":"John Howard","title":"Duke of Norfolk","seat":14,"marshal":0,"influence":3,"lordship":3,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_norfolk"}, -{"side":"York","name":"Warwick Y","full_name":"Richard Neville","title":"Earl of Warwick","seat":51,"marshal":1,"influence":5,"lordship":3,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3},"assets":{"prov":2,"coin":2},"ships":2,"id":"lord_warwick_y"}, -{"side":"Lancaster","name":"Henry VI","full_name":"Henry VI","title":"King of England","seat":30,"marshal":2,"influence":5,"lordship":2,"command":2,"valour":0,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":4},"assets":{"cart":2,"prov":2,"coin":4},"ships":0,"id":"lord_henry_vi"}, -{"side":"Lancaster","name":"Margaret","full_name":"Margaret d'Anjou","title":"Queen of England","seat":30,"marshal":2,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3},"assets":{"cart":2,"prov":2,"coin":2},"ships":2,"id":"lord_margaret"}, -{"side":"Lancaster","name":"Somerset 1","full_name":"Henry Beaufort","title":"Duke of Somerset","seat":25,"marshal":2,"influence":5,"lordship":2,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2},"assets":{"cart":2,"prov":2,"coin":1},"ships":0,"id":"lord_somerset_1"}, -{"side":"Lancaster","name":"Somerset 2","full_name":"Edmund Beaufort","title":"Duke of Somerset","seat":25,"marshal":0,"influence":3,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_somerset_2"}, -{"side":"Lancaster","name":"Exeter 1","full_name":"Henry Holland","title":"Duke of Exeter","seat":21,"marshal":0,"influence":2,"lordship":1,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_exeter_1"}, -{"side":"Lancaster","name":"Exeter 2","full_name":"Henry Holland","title":"Duke of Exeter","seat":21,"marshal":0,"influence":2,"lordship":1,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_exeter_2"}, -{"side":"Lancaster","name":"Buckingham","full_name":"Humphrey Stafford","title":"Duke of Buckingham","seat":41,"marshal":0,"influence":3,"lordship":3,"command":1,"valour":1,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":2,"militia":1},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_buckingham"}, -{"side":"Lancaster","name":"Northumberland L","full_name":"Henry Percy","title":"Earl of Northumberland","seat":4,"marshal":0,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":1},"ships":0,"id":"lord_northumberland_l"}, -{"side":"Lancaster","name":"Clarence","full_name":"George Plantagenet","title":"Duke of Clarence","seat":50,"marshal":0,"influence":1,"lordship":2,"command":1,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":1,"prov":2,"coin":2},"ships":0,"id":"lord_clarence"}, -{"side":"Lancaster","name":"Jasper Tudor 1","full_name":"Jasper Tudor","title":"Earl of Pembroke","seat":5,"marshal":0,"influence":2,"lordship":2,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":3,"militia":1},"assets":{"cart":1,"prov":2,"coin":2},"ships":0,"id":"lord_jasper_tudor_1"}, -{"side":"Lancaster","name":"Jasper Tudor 2","full_name":"Jasper Tudor","title":"Earl of Pembroke","seat":6,"marshal":0,"influence":2,"lordship":3,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_jasper_tudor_2"}, -{"side":"Lancaster","name":"Henry Tudor","full_name":"Henry Tudor","title":"","seat":30,"marshal":2,"influence":5,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":4},"ships":2,"id":"lord_henry_tudor"}, -{"side":"Lancaster","name":"Oxford","full_name":"John de Vere","title":"Earl of Oxford","seat":28,"marshal":0,"influence":2,"lordship":2,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_oxford"}, -{"side":"Lancaster","name":"Warwick L","full_name":"Richard Neville","title":"Earl of Warwick","seat":51,"marshal":1,"influence":5,"lordship":3,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3},"assets":{"cart":2,"prov":2,"coin":2},"ships":2,"id":"lord_warwick_l"}, +{"side":"York","name":"York","short_name":"York","full_name":"Richard Plantagenet","title":"Duke of York","seat":38,"marshal":2,"influence":5,"lordship":3,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_york"}, +{"side":"York","name":"March","short_name":"March","full_name":"Edward Plantagenet","title":"Earl of March","seat":9,"marshal":0,"influence":2,"lordship":2,"command":2,"valour":3,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":2,"militia":1},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_march"}, +{"side":"York","name":"Edward IV","short_name":"Edward IV","full_name":"Edward Plantagenet","title":"King of England","seat":30,"marshal":2,"influence":5,"lordship":3,"command":2,"valour":4,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_edward_iv"}, +{"side":"York","name":"Salisbury","short_name":"Salisbury","full_name":"Richard Neville","title":"Earl of Salisbury","seat":50,"marshal":0,"influence":3,"lordship":3,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_salisbury"}, +{"side":"York","name":"Rutland","short_name":"Rutland","full_name":"Edmund Plantagenet","title":"Earl of Rutland","seat":18,"marshal":0,"influence":2,"lordship":2,"command":1,"valour":1,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":2,"militia":1},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_rutland"}, +{"side":"York","name":"Pembroke","short_name":"Pembroke","full_name":"William Herbert","title":"Earl of Pembroke","seat":6,"marshal":0,"influence":2,"lordship":2,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":3,"militia":2},"assets":{"cart":1,"prov":1,"coin":2},"ships":0,"id":"lord_pembroke"}, +{"side":"York","name":"Devon","short_name":"Devon","full_name":"Humpfrey Stafford","title":"Earl of Devon","seat":21,"marshal":0,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":2,"militia":1},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_devon"}, +{"side":"York","name":"Northumberland Y1","short_name":"Northumberland","full_name":"Henry Percy","title":"Northumberland","seat":4,"marshal":0,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":4},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_northumberland_y1"}, +{"side":"York","name":"Northumberland Y2","short_name":"Northumberland","full_name":"Henry Percy","title":"Northumberland","seat":4,"marshal":0,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_northumberland_y2"}, +{"side":"York","name":"Gloucester 1","short_name":"Gloucester","full_name":"Richard Plantagenet","title":"Duke of Gloucester","seat":27,"marshal":1,"influence":2,"lordship":2,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_gloucester_1"}, +{"side":"York","name":"Gloucester 2","short_name":"Gloucester","full_name":"Richard Plantagenet","title":"Duke of Gloucester","seat":27,"marshal":1,"influence":5,"lordship":3,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3,"militia":4},"assets":{"cart":2,"prov":2,"coin":4},"ships":0,"id":"lord_gloucester_2"}, +{"side":"York","name":"Richard III","short_name":"Richard III","full_name":"Richard Plantagenet","title":"King of England","seat":30,"marshal":2,"influence":5,"lordship":3,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":2,"militia":4},"assets":{"cart":2,"prov":2,"coin":4},"ships":0,"id":"lord_richard_iii"}, +{"side":"York","name":"Norfolk","short_name":"Norfolk","full_name":"John Howard","title":"Duke of Norfolk","seat":14,"marshal":0,"influence":3,"lordship":3,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_norfolk"}, +{"side":"York","name":"Warwick Y","short_name":"Warwick","full_name":"Richard Neville","title":"Earl of Warwick","seat":51,"marshal":1,"influence":5,"lordship":3,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3},"assets":{"prov":2,"coin":2},"ships":2,"id":"lord_warwick_y"}, +{"side":"Lancaster","name":"Henry VI","short_name":"Henry VI","full_name":"Henry VI","title":"King of England","seat":30,"marshal":2,"influence":5,"lordship":2,"command":2,"valour":0,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":4},"assets":{"cart":2,"prov":2,"coin":4},"ships":0,"id":"lord_henry_vi"}, +{"side":"Lancaster","name":"Margaret","short_name":"Margaret","full_name":"Margaret d'Anjou","title":"Queen of England","seat":30,"marshal":2,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3},"assets":{"cart":2,"prov":2,"coin":2},"ships":2,"id":"lord_margaret"}, +{"side":"Lancaster","name":"Somerset 1","short_name":"Somerset","full_name":"Henry Beaufort","title":"Duke of Somerset","seat":25,"marshal":2,"influence":5,"lordship":2,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2},"assets":{"cart":2,"prov":2,"coin":1},"ships":0,"id":"lord_somerset_1"}, +{"side":"Lancaster","name":"Somerset 2","short_name":"Somerset","full_name":"Edmund Beaufort","title":"Duke of Somerset","seat":25,"marshal":0,"influence":3,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_somerset_2"}, +{"side":"Lancaster","name":"Exeter 1","short_name":"Exeter","full_name":"Henry Holland","title":"Duke of Exeter","seat":21,"marshal":0,"influence":2,"lordship":1,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2},"assets":{"cart":1,"prov":1,"coin":1},"ships":0,"id":"lord_exeter_1"}, +{"side":"Lancaster","name":"Exeter 2","short_name":"Exeter","full_name":"Henry Holland","title":"Duke of Exeter","seat":21,"marshal":0,"influence":2,"lordship":1,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_exeter_2"}, +{"side":"Lancaster","name":"Buckingham","short_name":"Buckingham","full_name":"Humphrey Stafford","title":"Duke of Buckingham","seat":41,"marshal":0,"influence":3,"lordship":3,"command":1,"valour":1,"forces":{"retinue":1,"men_at_arms":1,"longbowmen":2,"militia":1},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_buckingham"}, +{"side":"Lancaster","name":"Northumberland L","short_name":"Northumberland","full_name":"Henry Percy","title":"Earl of Northumberland","seat":4,"marshal":0,"influence":4,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":1},"ships":0,"id":"lord_northumberland_l"}, +{"side":"Lancaster","name":"Clarence","short_name":"Clarence","full_name":"George Plantagenet","title":"Duke of Clarence","seat":50,"marshal":0,"influence":1,"lordship":2,"command":1,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":1,"prov":2,"coin":2},"ships":0,"id":"lord_clarence"}, +{"side":"Lancaster","name":"Jasper Tudor 1","short_name":"Jasper Tudor","full_name":"Jasper Tudor","title":"Earl of Pembroke","seat":5,"marshal":0,"influence":2,"lordship":2,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":3,"militia":1},"assets":{"cart":1,"prov":2,"coin":2},"ships":0,"id":"lord_jasper_tudor_1"}, +{"side":"Lancaster","name":"Jasper Tudor 2","short_name":"Jasper Tudor","full_name":"Jasper Tudor","title":"Earl of Pembroke","seat":6,"marshal":0,"influence":2,"lordship":3,"command":3,"valour":2,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_jasper_tudor_2"}, +{"side":"Lancaster","name":"Henry Tudor","short_name":"Henry Tudor","full_name":"Henry Tudor","title":"","seat":30,"marshal":2,"influence":5,"lordship":2,"command":2,"valour":1,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":4},"ships":2,"id":"lord_henry_tudor"}, +{"side":"Lancaster","name":"Oxford","short_name":"Oxford","full_name":"John de Vere","title":"Earl of Oxford","seat":28,"marshal":0,"influence":2,"lordship":2,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":2,"longbowmen":2,"militia":2},"assets":{"cart":2,"prov":2,"coin":2},"ships":0,"id":"lord_oxford"}, +{"side":"Lancaster","name":"Warwick L","short_name":"Warwick","full_name":"Richard Neville","title":"Earl of Warwick","seat":51,"marshal":1,"influence":5,"lordship":3,"command":2,"valour":2,"forces":{"retinue":1,"men_at_arms":3,"longbowmen":3},"assets":{"cart":2,"prov":2,"coin":2},"ships":2,"id":"lord_warwick_l"}, ], vassals:[ {"service":3,"name":"Westmoreland","seat":2,"influence":0}, @@ -24,13 +24,9 @@ header.your_turn { background-color: orange; } #log .card_tip { font-style: italic; } #log .card_tip:hover { text-decoration: underline; } #log .lord_tip:hover { cursor: pointer; text-decoration: underline; } -#log .lord_vassal:hover { cursor: pointer; text-decoration: underline; } +#log .vassal_tip:hover { cursor: pointer; text-decoration: underline; } #log .locale_tip:hover { cursor: pointer; text-decoration: underline; } -.action { - cursor: pointer; -} - #log { font-variant-numeric: tabular-nums; } @@ -186,10 +182,6 @@ body.Lancaster #plan_actions .york { display: none } z-index: 4; } -#battle_grid .mat.ambushed .background { - filter: grayscale(50%) -} - .court_body .mat.hidden .background { filter: grayscale(100%) } @@ -359,6 +351,9 @@ body.shift .exhausted { .unit { background-size: contain; background-repeat: no-repeat; +} + +.unit.shape { width: 43px; height: 35px; filter: drop-shadow(0px 2px 2px #0004); @@ -380,7 +375,15 @@ body.shift .exhausted { margin: 0 2px; } -.unit.action { +.unit.retinue.action { + box-shadow: 0 0 0 2px white; +} + +.unit.vassal.action { + box-shadow: 0 0 0 2px white; +} + +.unit.shape.action { filter: drop-shadow(2px 0px 0px white) drop-shadow(0px 2px 0px white) @@ -208,6 +208,7 @@ const MERCENARIES = 6 const force_type_count = 7 const force_action_name = [ "retinue", "vassal", "men_at_arms", "longbowmen", "militia", "burgundians", "mercenaries" ] +const force_class_name = [ "retinue", "vassal", "shape men_at_arms", "shape longbowmen", "shape militia", "shape burgundians", "shape mercenaries" ] const routed_force_action_name = [ "routed_retinue", "routed_vassal", "routed_men_at_arms", "routed_longbowmen", "routed_militia", "routed_burgundians", "routed_mercenaries" ] const COIN = 1 @@ -309,7 +310,7 @@ function get_locale_tip(id) { let list = [] for (let lord = 0; lord < data.lords.length; ++lord) { if (data.lords[lord].seat === id) - list.push(data.lords[lord].name) + list.push(data.lords[lord].short_name) } if (list.length > 0) tip += " - " + list.join(", ") @@ -320,7 +321,7 @@ function on_focus_cylinder(evt) { let lord = evt.target.my_id let info = data.lords[lord] let loc = get_lord_locale(lord) - let tip = info.name + let tip = info.short_name on_focus(tip) } @@ -355,25 +356,6 @@ function is_lord_on_left_or_right(lord) { return false } -function is_lord_ambushed(lord) { - if (view.battle) { - // ambush & 2 = attacker played ambush - // ambush & 1 = defender played ambush - if (view.battle.attacker === "York") { - if ((view.battle.ambush & 1) && is_york_lord(lord)) - return is_lord_on_left_or_right(lord) - if ((view.battle.ambush & 2) && is_lancaster_lord(lord)) - return is_lord_on_left_or_right(lord) - } else { - if ((view.battle.ambush & 1) && is_lancaster_lord(lord)) - return is_lord_on_left_or_right(lord) - if ((view.battle.ambush & 2) && is_york_lord(lord)) - return is_lord_on_left_or_right(lord) - } - } - return false -} - function get_lord_locale(lord) { return map_get(view.pieces.locale, lord, -1) } @@ -1083,26 +1065,26 @@ function add_vassal(parent, vassal, lord, routed) { if (routed) { 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), + "action unit " + force_class_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), routed_force_action_name[VASSAL], vassal ) else elt = get_cached_element( - "unit " + force_action_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), + "unit " + force_class_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), routed_force_action_name[VASSAL], vassal ) } else { 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), + "action unit " + force_class_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), force_action_name[VASSAL], vassal ) else elt = get_cached_element( - "unit " + force_action_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), + "unit " + force_class_name[VASSAL] + " vassal_" + clean_name(data.vassals[vassal].name), force_action_name[VASSAL], vassal ) @@ -1114,14 +1096,14 @@ function add_force(parent, type, lord, routed) { let elt if (routed) { if (is_action(routed_force_action_name[type], lord)) - elt = get_cached_element("action unit " + force_action_name[type], routed_force_action_name[type], lord) + elt = get_cached_element("action unit " + force_class_name[type], routed_force_action_name[type], lord) else - elt = get_cached_element("unit " + force_action_name[type], routed_force_action_name[type], lord) + elt = get_cached_element("unit " + force_class_name[type], routed_force_action_name[type], lord) } else { if (is_action(force_action_name[type], lord)) - elt = get_cached_element("action unit " + force_action_name[type], force_action_name[type], lord) + elt = get_cached_element("action unit " + force_class_name[type], force_action_name[type], lord) else - elt = get_cached_element("unit " + force_action_name[type], force_action_name[type], lord) + elt = get_cached_element("unit " + force_class_name[type], force_action_name[type], lord) } parent.appendChild(elt) } @@ -1251,8 +1233,6 @@ function update_lord(ix) { ui.lord_cylinder[ix].classList.toggle("command", is_lord_command(ix)) ui.lord_mat[ix].classList.toggle("command", is_lord_command(ix)) - ui.lord_mat[ix].classList.toggle("ambushed", is_lord_ambushed(ix)) - ui.seat[ix].classList.toggle("hide", !is_lord_in_game(ix)) } @@ -1779,7 +1759,7 @@ function sub_locale_name(match, p1) { function sub_lord_name(match, p1) { let x = p1 | 0 - let n = data.lords[x].name + let n = data.lords[x].short_name return `<span class="lord_tip" onclick="on_click_lord_tip(${x})">${n}</span>` } @@ -405,7 +405,9 @@ function make_list(first, last) { return list } -const lord_name = data.lords.map(lord => lord.name) +const lord_name = data.lords.map(lord => lord.short_name) +const locale_name = data.locales.map(locale => locale.name) +const vassal_name = data.vassals.map(vassal => vassal.name) const lord_count = data.lords.length const vassal_count = data.vassals.length @@ -1417,7 +1419,7 @@ function get_force_name(lord: Lord, n: Force, x: Vassal = NOVASSAL) { if (n === RETINUE) return `${lord_name[lord]}'s Retinue` if (n === VASSAL) - return `Vassal ${data.vassals[x].name}` + return `Vassal ${vassal_name[x]}` return FORCE_TYPE_NAME[n] } @@ -2400,7 +2402,7 @@ states.pillage = { states.pillage_locale = { inactive: "Pillage", prompt() { - view.prompt = `Pillage: Choose Lord to Pillage ${data.locales[game.where].name}.` + view.prompt = `Pillage: Choose Lord to Pillage ${locale_name[game.where]}.` for (let x of all_friendly_lords()) { if (get_lord_locale(x) === game.where && is_lord_unfed(x)) { @@ -3167,7 +3169,7 @@ function can_levy_vassal(vassal: Vassal) { states.levy_vassal = { inactive: "Levy Vassal", prompt() { - view.prompt = `Levy Vassal ${data.vassals[game.vassal].name}. ` + view.prompt = `Levy Vassal ${vassal_name[game.vassal]}. ` let cost = get_levy_vassal_influence_cost() if (is_automatic_levy_vassal_success(game.command)) prompt_influence_check_success(cost) @@ -4259,7 +4261,7 @@ states.tax = { for (let loc of search_tax([], get_lord_locale(game.command), game.command)) gen_action_locale(loc) } else { - view.prompt = `Tax: Attempt to Tax ${data.locales[game.where].name}. ` + view.prompt = `Tax: Attempt to Tax ${locale_name[game.where]}. ` prompt_influence_check(game.command) } }, @@ -4480,7 +4482,7 @@ states.parley = { gen_action_locale(game.parley[i] as Locale) } else { let lord = game.command - view.prompt = "Parley at " + data.locales[game.where].name + "." + view.prompt = "Parley at " + locale_name[game.where] + "." if (is_automatic_parley_success(lord)) prompt_influence_check_success(get_parley_influence_cost()) else @@ -5160,7 +5162,7 @@ function take_spoils(type: Asset) { const battle_strike_positions = [ D1, D2, D3, A1, A2, A3 ] const battle_steps = [ - { name: "Archery", hits: count_archery_hits }, + { name: "Missiles", hits: count_archery_hits }, { name: "Melee", hits: count_melee_hits }, ] @@ -5241,7 +5243,7 @@ function count_lord_hits(lord: Lord) { } function format_strike_step() { - return battle_steps[game.battle.step].name + return battle_steps[game.battle.step] } function format_hits() { @@ -5747,7 +5749,7 @@ states.ravine = { }, lord(lord) { game.battle.ravine = lord - logi(`${data.lords[lord].name} ignored for Engage and Strike Round 1`) + logi(`${lord_name[lord]} ignored for Engage and Strike Round 1`) logevent(EVENT_LANCASTER_RAVINE) resume_battle_events() }, @@ -5866,7 +5868,7 @@ states.caltrops = { push_undo() game.battle.caltrops = lord resume_battle_events() - logi(`2 Hits added to ${data.lords[lord].name} each Melee round`) + logi(`2 Hits added to ${lord_name[lord]} each Melee round`) logevent(EVENT_YORK_CALTROPS) }, } @@ -5951,11 +5953,11 @@ states.suspicion_3 = { let other = game.other if (roll_influence_check(game.who, bonus)) { - log(`${data.lords[other].name} disbanded`) + log(`${lord_name[other]} disbanded`) remove_lord_from_battle(other) disband_lord(other) } else { - log(`${data.lords[other].name} stays`) + log(`${lord_name[other]} stays`) } game.who = NOBODY @@ -6027,7 +6029,7 @@ function goto_influence_check_for_trust_not_him() { states.for_trust_not_him_bribe = { inactive: `Influence check`, prompt() { - view.prompt = `Influence check : Success bribes ${data.vassals[game.vassal].name} ` + view.prompt = `Influence check : Success bribes ${vassal_name[game.vassal]} ` if (is_automatic_levy_vassal_success(game.who)) prompt_influence_check_success() else @@ -6165,9 +6167,9 @@ states.culverins_and_falconets = { if (is_event_in_play(EVENT_YORK_PATRICK_DE_LA_MOTE) && game.active === YORK) { logcap(EVENT_YORK_PATRICK_DE_LA_MOTE) die2 = roll_die() - logi(`${data.lords[lord].name} Artillery does ${die1} + ${die2} hits`) + logi(`${lord_name[lord]} Artillery does ${die1} + ${die2} hits`) } else { - logi(`${data.lords[lord].name} Artillery does ${die1} hits`) + logi(`${lord_name[lord]} Artillery does ${die1} hits`) } if (is_attacker()) @@ -7524,7 +7526,7 @@ states.warden_of_the_marches = { set_delete(game.battle.fled, lord) set_delete(game.battle.routed, lord) - logi(`Moved lord to ${data.locales[game.where].name}`) + logi(`Moved lord to ${locale_name[game.where]}`) // TODO: move this stuff to somewhere common? set_lord_locale(lord, game.where) @@ -8010,14 +8012,14 @@ function tides_calc() { for (let y of all_york_lords) { if (is_lord_on_map(y)) { domy += data.lords[y].influence - log(`Gain Lords Influence : Yorkists gain ${data.lords[y].influence} for ${data.lords[y].name}`) + log(`Gain Lords Influence : Yorkists gain ${lord_name[y].influence} for ${lord_name[y]}`) } } for (let l of all_lancaster_lords) { if (is_lord_on_map(l)) { doml += data.lords[l].influence - log(`Gain Lords Influence : Lancastrians gain ${data.lords[l].influence} for ${data.lords[l].name}`) + log(`Gain Lords Influence : Lancastrians gain ${lord_name[l].influence} for ${lord_name[l]}`) } } } @@ -10121,7 +10123,7 @@ function goto_lancaster_event_henrys_proclamation() { for (let vassal of all_vassals) { if (is_vassal_mustered_with_york_lord(vassal)) { set_vassal_lord_and_service(vassal, get_vassal_lord(vassal), current_turn()) - logi(`Vassal ${data.vassals[vassal].name} moved to current turn`) + logi(`Vassal ${vassal_name[vassal]} moved to current turn`) } } @@ -10350,7 +10352,7 @@ states.welsh_rebellion_remove_troops = { } } else { - view.prompt = `Remove ${game.count} Troops from ${data.lords[game.who].name}.` + view.prompt = `Remove ${game.count} Troops from ${lord_name[game.who]}.` if (get_lord_forces(game.who, BURGUNDIANS) > 0) gen_action_burgundians(game.who) if (get_lord_forces(game.who, MERCENARIES) > 0) @@ -10423,7 +10425,7 @@ states.welsh_rebellion_remove_favour = { locale(loc) { push_undo() remove_york_favour(loc) - logi(`Removed favour at ${data.locales[loc].name}`) + logi(`Removed favour at ${locale_name[loc]}`) game.count++ }, done() { @@ -10475,7 +10477,7 @@ states.aragne_1 = { vassal(v) { push_undo() set_add(game.event_aragne, v) - logi(`Vassal ${data.vassals[v].name} selected`) + logi(`Vassal ${vassal_name[v]} selected`) }, done() { push_undo() @@ -10513,7 +10515,7 @@ states.aragne_2 = { states.aragne_3 = { inactive: "L'Universelle Aragne", prompt() { - view.prompt = `L'Universelle Aragne: ${data.vassals[game.vassal].name}.` + view.prompt = `L'Universelle Aragne: ${vassal_name[game.vassal]}.` let lord = get_vassal_lord(game.vassal) prompt_influence_check(lord, 0, vassal_influence(game.vassal)) }, @@ -10588,7 +10590,7 @@ function goto_lancaster_event_french_war_loans() { if (is_lord_on_map(lord) && !is_lord_on_calendar(lord)) { add_lord_assets(lord, PROV, 1) add_lord_assets(lord, COIN, 1) - logi(`1 Coin and 1 Provender added to ${data.lords[lord].name}`) + logi(`1 Coin and 1 Provender added to ${lord_name[lord]}`) } } end_immediate_event() @@ -10627,7 +10629,7 @@ states.robins_rebellion = { locale(loc) { push_undo() shift_favour_toward(loc) - logi(`Placed/Removed favour at ${data.locales[loc].name}`) + logi(`Placed/Removed favour at ${locale_name[loc]}`) game.count++ }, done() { @@ -10675,7 +10677,7 @@ states.tudor_banners = { push_undo() remove_york_favour(loc) add_lancaster_favour(loc) - logi(`Placed Lancastrian favour at ${data.locales[loc].name}`) + logi(`Placed Lancastrian favour at ${locale_name[loc]}`) }, done() { end_immediate_event() @@ -10725,7 +10727,7 @@ states.tax_collectors_lord = { for (let loc of search_tax([], get_lord_locale(game.who), game.who)) gen_action_locale(loc) } else { - view.prompt = `Tax Collectors: Attempt to Tax ${data.locales[game.where].name}. ` + view.prompt = `Tax Collectors: Attempt to Tax ${locale_name[game.where]}. ` prompt_influence_check(game.who) } }, @@ -10779,7 +10781,7 @@ states.london_for_york = { locale(loc) { push_undo() add_york_favour(LONDON_FOR_YORK) - logi(`Second marker placed at ${data.locales[loc].name}`) + logi(`Second marker placed at ${locale_name[loc]}`) logi(`Immune to Lancastrian parley unless aided by event`) end_immediate_event() }, @@ -10823,7 +10825,7 @@ states.she_wolf = { if (current_turn() < 16) set_vassal_lord_and_service(v, get_vassal_lord(v), get_vassal_service(v) + 1) set_add(game.event_she_wolf, v) - logi(`Vassal ${data.vassals[v].name} shifted one calendar box`) + logi(`Vassal ${vassal_name[v]} shifted one calendar box`) }, done() { delete game.event_she_wolf @@ -10862,7 +10864,7 @@ function goto_york_event_charles_the_bold() { if (is_lord_on_map(lord) && !is_lord_on_calendar(lord)) { add_lord_assets(lord, PROV, 1) add_lord_assets(lord, COIN, 1) - logi(`1 Coin and 1 Provender added to ${data.lords[lord].name}`) + logi(`1 Coin and 1 Provender added to ${lord_name[lord]}`) } } end_immediate_event() @@ -11323,7 +11325,7 @@ states.sun_in_splendour = { muster_lord(LORD_EDWARD_IV, loc) // TODO: remove_lord_from_exile(LORD_EDWARD_IV) ? // TODO: muster to exile box ? - logi(`Mustered Edward IV at ${data.locales[loc].name}`) + logi(`Mustered Edward IV at ${locale_name[loc]}`) game.state = "muster" }, diff --git a/tools/gendata.js b/tools/gendata.js index e5a274d..1ba4750 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -815,6 +815,7 @@ let lords = [ { side: "York", name: "York", + short_name: "York", full_name: "Richard Plantagenet", title: "Duke of York", seat: locmap["Ely"], @@ -840,7 +841,8 @@ let lords = [ { side: "York", - name:"March", + name: "March", + short_name: "March", full_name:"Edward Plantagenet", title:"Earl of March", seat: locmap["Ludlow"], @@ -866,6 +868,7 @@ let lords = [ { side: "York", name: "Edward IV", + short_name: "Edward IV", full_name: "Edward Plantagenet", title: "King of England", seat: locmap["London"], @@ -891,6 +894,7 @@ let lords = [ { side: "York", name: "Salisbury", + short_name: "Salisbury", full_name: "Richard Neville", title: "Earl of Salisbury", seat: locmap["York"], @@ -915,6 +919,7 @@ let lords = [ { side: "York", name: "Rutland", + short_name: "Rutland", full_name: "Edmund Plantagenet", title: "Earl of Rutland", seat: locmap["Canterbury"], @@ -940,6 +945,7 @@ let lords = [ { side: "York", name: "Pembroke", + short_name: "Pembroke", full_name: "William Herbert", title: "Earl of Pembroke", seat: locmap["Pembroke"], @@ -964,6 +970,7 @@ let lords = [ { side: "York", name: "Devon", + short_name: "Devon", full_name: "Humpfrey Stafford", title: "Earl of Devon", seat: locmap["Exeter"], @@ -989,6 +996,7 @@ let lords = [ { side: "York", name: "Northumberland Y1", + short_name: "Northumberland", full_name: "Henry Percy", title: "Northumberland", seat: locmap["Carlisle"], @@ -1014,6 +1022,7 @@ let lords = [ { side: "York", name: "Northumberland Y2", + short_name: "Northumberland", full_name: "Henry Percy", title: "Northumberland", seat: locmap["Carlisle"], @@ -1039,6 +1048,7 @@ let lords = [ { side: "York", name: "Gloucester 1", + short_name: "Gloucester", full_name: "Richard Plantagenet", title: "Duke of Gloucester", seat: locmap["Gloucester"], @@ -1063,6 +1073,7 @@ let lords = [ { side: "York", name: "Gloucester 2", + short_name: "Gloucester", full_name: "Richard Plantagenet", title: "Duke of Gloucester", seat: locmap["Gloucester"], @@ -1088,6 +1099,7 @@ let lords = [ { side: "York", name: "Richard III", + short_name: "Richard III", full_name: "Richard Plantagenet", title: "King of England", seat: locmap["London"], @@ -1113,6 +1125,7 @@ let lords = [ { side: "York", name: "Norfolk", + short_name: "Norfolk", full_name: "John Howard", title: "Duke of Norfolk", seat: locmap["Arundel"], @@ -1138,6 +1151,7 @@ let lords = [ { side: "York", name: "Warwick Y", + short_name: "Warwick", full_name: "Richard Neville", title: "Earl of Warwick", seat: locmap["Calais"], @@ -1161,6 +1175,7 @@ let lords = [ { side: "Lancaster", name: "Henry VI", + short_name: "Henry VI", full_name: "Henry VI", title: "King of England", seat: locmap["London"], @@ -1186,6 +1201,7 @@ let lords = [ { side: "Lancaster", name: "Margaret", + short_name: "Margaret", full_name: "Margaret d'Anjou", title: "Queen of England", seat: locmap["London"], @@ -1210,6 +1226,7 @@ let lords = [ { side: "Lancaster", name: "Somerset 1", + short_name: "Somerset", full_name: "Henry Beaufort", title: "Duke of Somerset", seat: locmap["Wells"], @@ -1234,6 +1251,7 @@ let lords = [ { side: "Lancaster", name: "Somerset 2", + short_name: "Somerset", full_name: "Edmund Beaufort", title: "Duke of Somerset", seat: locmap["Wells"], @@ -1258,6 +1276,7 @@ let lords = [ { side: "Lancaster", name: "Exeter 1", + short_name: "Exeter", full_name: "Henry Holland", title: "Duke of Exeter", seat: locmap["Exeter"], @@ -1282,6 +1301,7 @@ let lords = [ { side: "Lancaster", name: "Exeter 2", + short_name: "Exeter", full_name: "Henry Holland", title: "Duke of Exeter", seat: locmap["Exeter"], @@ -1306,6 +1326,7 @@ let lords = [ { side: "Lancaster", name: "Buckingham", + short_name: "Buckingham", full_name: "Humphrey Stafford", title: "Duke of Buckingham", seat: locmap["Coventry"], @@ -1330,6 +1351,7 @@ let lords = [ { side: "Lancaster", name: "Northumberland L", + short_name: "Northumberland", full_name: "Henry Percy", title: "Earl of Northumberland", seat: locmap["Carlisle"], @@ -1355,6 +1377,7 @@ let lords = [ { side: "Lancaster", name: "Clarence", + short_name: "Clarence", full_name: "George Plantagenet", title: "Duke of Clarence", seat: locmap["York"], @@ -1380,6 +1403,7 @@ let lords = [ { side: "Lancaster", name: "Jasper Tudor 1", + short_name: "Jasper Tudor", full_name: "Jasper Tudor", title: "Earl of Pembroke", seat: locmap["Harlech"], @@ -1404,6 +1428,7 @@ let lords = [ { side: "Lancaster", name: "Jasper Tudor 2", + short_name: "Jasper Tudor", full_name: "Jasper Tudor", title: "Earl of Pembroke", seat: locmap["Pembroke"], @@ -1427,6 +1452,7 @@ let lords = [ { side: "Lancaster", name: "Henry Tudor", + short_name: "Henry Tudor", full_name: "Henry Tudor", title: "", seat: locmap["London"], @@ -1452,6 +1478,7 @@ let lords = [ { side: "Lancaster", name: "Oxford", + short_name: "Oxford", full_name: "John de Vere", title: "Earl of Oxford", seat: locmap["Oxford"], @@ -1477,6 +1504,7 @@ let lords = [ { side: "Lancaster", name: "Warwick L", + short_name: "Warwick", full_name: "Richard Neville", title: "Earl of Warwick", seat: locmap["Calais"], |