diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 125 |
1 files changed, 45 insertions, 80 deletions
@@ -509,6 +509,9 @@ function init_ui() { register_action(ui.resources[DS], "resources", DS) register_action(ui.resources[BK], "resources", BK) register_action(ui.resources[VE], "resources", VE) + register_action(ui.tokens.token_bk_influence, "inf", BK) + register_action(ui.tokens.token_ve_influence, "inf", VE) + register_action(ui.tokens.token_mongol_cavalry, "token", 10) ui.this_card.onmouseenter = on_focus_this_event ui.this_card.onmouseleave = on_blur_event @@ -657,6 +660,13 @@ function layout_available(faction, type, xorig, yorig) { layout_pieces(list, xorig, yorig + 35, null, AVAILABLE) } +function layout_influence() { + let e = ui.tokens.token_bk_influence + e.style.left = 25 + 71 * view.inf[BK] + "px" + e = ui.tokens.token_ve_influence + e.style.left = 25 + 71 * view.inf[VE] + "px" +} + function layout_pieces(list, xorig, yorig, discs, s) { const dx = 17 const dy = 11 @@ -756,13 +766,12 @@ let sop_xy = [ function layout_sop() { let i, z let n_sop, offset - let order = data.card_order[view.deck[0]] for (let [sop, [x, y, dx, dy]] of sop_xy.entries()) { n_sop = view.cylinder.filter(v => v === sop).length i = 0 z = 1 - for (let faction of order) { + for (let faction of view.order) { if (view.cylinder[faction] === sop) { offset = n_sop === 1 ? 0 : (-1 + i * (2/(n_sop - 1))) * n_sop place_piece(ui.cylinder[faction], x + dx * offset, y + dy * offset, z) @@ -866,8 +875,8 @@ function on_update() { ui.header.classList.toggle("bk", view.current === BK) ui.header.classList.toggle("ve", view.current === VE) - ui.tokens.token_bk_influence.classList.toggle("action", is_action("bk_inf")) - ui.tokens.token_ve_influence.classList.toggle("action", is_action("ve_inf")) + ui.tokens.token_bk_influence.classList.toggle("action", is_action("inf", BK)) + ui.tokens.token_ve_influence.classList.toggle("action", is_action("inf", VE)) ui.resources[DS].classList.toggle("action", is_action("resources", DS)) ui.resources[BK].classList.toggle("action", is_action("resources", BK)) @@ -939,7 +948,7 @@ function on_update() { } // Action highlighting - if (s <= S_PUNJAB) { + if (s <= S_MONGOL_INVADERS) { ui.spaces[s].classList.toggle("action", is_action("space", s)) ui.spaces[s].classList.toggle("selected", view.where === s) } @@ -1011,6 +1020,9 @@ function on_update() { for (let i = 0; i < ui.pieces.length; ++i) ui.pieces[i].classList.toggle("selected", view.who === i) + // Influence + layout_influence() + // SOP buttons action_button("command_decree", "Command & Decree") action_button("event_command", "Event or Command") @@ -1039,6 +1051,13 @@ function on_update() { action_button("tax", "Tax") action_button("trade", "Trade") + // MI buttons + action_button("advance", "Advance") + action_button("end_advance", "End Advance") + action_button("amass", "Amass") + action_button("mi_attack", "Attack & Plunder") + action_button("end_gifts", "End Compromising Gifts") + action_button("next", "Next") action_button("undo", "Undo") @@ -1228,76 +1247,6 @@ return "ask_resources", "ask_shipment", ]) - - // Select Faction - action_button("govt", "Government") - action_button("farc", "FARC") - action_button("auc", "AUC") - action_button("cartels", "Cartels") - - confirm_action_button("choose_govt", "Government", "Choose GOVERNMENT to execute this event?") - confirm_action_button("choose_farc", "FARC", "Choose FARC to execute this event?") - confirm_action_button("choose_auc", "AUC", "Choose AUC to execute this event?") - confirm_action_button("choose_cartels", "Cartels", "Choose CARTELS to execute this event?") - - // Select Operation - action_button("train", "Train") - action_button("patrol", "Patrol") - action_button("sweep", "Sweep") - action_button("assault", "Assault") - action_button("rally", "Rally") - action_button("march", "March") - action_button("attack", "Attack") - action_button("terror", "Terror") - - // Select Special Activity - action_button("air_lift", "Air Lift") - action_button("air_strike", "Air Strike") - action_button("eradicate", "Eradicate") - action_button("extort", "Extort") - action_button("ambush", "Ambush") - action_button("assassinate", "Assassinate") - action_button("kidnap", "Kidnap") - action_button("cultivate", "Cultivate") - action_button("process", "Process") - action_button("bribe", "Bribe") - - // Train/Rally sub-actions - action_button("move", "Move") - action_button("flip", "Flip") - action_button("base", "Base") - action_button("civic", "Civic Action") - - action_button("support", "Support") - action_button("opposition", "Opposition") - - action_button("remove", "Remove") - action_button("roll", "Roll") - action_button("skip", "Skip") - action_button("next", "Next") - action_button("pass", "Pass") - - action_button("end_train", "End Train") - action_button("end_patrol", "End Patrol") - action_button("end_sweep", "End Sweep") - action_button("end_assault", "End Assault") - action_button("end_rally", "End Rally") - action_button("end_march", "End March") - action_button("end_attack", "End Attack") - action_button("end_terror", "End Terror") - - action_button("end_air_lift", "End Air Lift") - action_button("end_extort", "End Extort") - action_button("end_assassinate", "End Assassinate") - action_button("end_kidnap", "End Kidnap") - action_button("end_process", "End Process") - action_button("end_bribe", "End Bribe") - - action_button("end_event", "End Event") - - action_button("deny", "Deny") - action_button("done", "Done") - action_button("undo", "Undo") } /* TOOLTIPS */ @@ -1381,24 +1330,40 @@ function on_log(text) { text = text.replace(/</g, "<") text = text.replace(/>/g, ">") - if (text.match(/^\.h1/)) { + if (text.match(/^\.h1 Mongol Invaders/)) { + text = text.substring(19) + p.className = "h1 mi" + } + else if (text.match(/^\.h1/)) { text = text.substring(4) p.className = "h1" } else if (text.match(/^\.h2 Delhi Sultanate/)) { - text = text.substring(3) + text = text.substring(4) + p.className = "h2 ds" + } + else if (text.match(/^\.h2 ds/)) { + text = text.substring(6) p.className = "h2 ds" } else if (text.match(/^\.h2 Bahmani Kingdom/)) { - text = text.substring(3) + text = text.substring(4) + p.className = "h2 bk" + } + else if (text.match(/^\.h2 bk/)) { + text = text.substring(6) p.className = "h2 bk" } else if (text.match(/^\.h2 Vijayanagara Empire/)) { - text = text.substring(3) + text = text.substring(4) + p.className = "h2 ve" + } + else if (text.match(/^\.h2 ve/)) { + text = text.substring(6) p.className = "h2 ve" } else if (text.match(/^\.h2 Mongol Invaders/)) { - text = text.substring(3) + text = text.substring(4) p.className = "h2 mi" } else if (text.match(/^\.h2 /)) { |