From 3664a02ae1a5ca368d6e9cb3a8e016177d528238 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 23 Oct 2024 23:58:09 +0200 Subject: annexation, expeditionary corps, set-aside markers --- play.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'play.js') diff --git a/play.js b/play.js index 5073ee0..578156b 100644 --- a/play.js +++ b/play.js @@ -51,6 +51,9 @@ const P_AUSTRIA = 3 const P_BAVARIA = 4 const P_SAXONY = 5 +const SET_ASIDE_FRANCE = 4 +const SET_ASIDE_PRUSSIA = 5 + const power_name = [ "France", "Prussia", "Pragmatic Army", "Austria", "Bavaria", "Saxony" ] const power_class = [ "france", "prussia", "pragmatic", "austria", "bavaria", "saxony" ] @@ -957,10 +960,15 @@ function layout_retro(s, pow) { function layout_victory_pool(pow, max, x, y) { let n = view.vp[pow] + let m = 0 if (pow === P_PRUSSIA) { + m = view.vp[SET_ASIDE_PRUSSIA] + n += m if (view.flags & F_SILESIA_ANNEXED) ++n } if (pow === P_FRANCE) { + m = view.vp[SET_ASIDE_FRANCE] + n += m if (view.flags & F_ITALY_FRANCE) ++n if (view.flags & F_EMPEROR_FRANCE) ++n } @@ -971,12 +979,25 @@ function layout_victory_pool(pow, max, x, y) { for (let i = 0; i < view.victory.length; i += 2) if (view.victory[i+1] === pow) ++n + for (let i = 0; i < max - n; ++i) { let e = ui.victory[pow][used_victory[pow]++] e.style.left = (x - 16 + (i%5) * 20) + "px" e.style.top = (y - 16 + (i/5|0) * 20) + "px" ui.markers_element.appendChild(e) } + + for (let i = 0; i < m; ++i) { + let e = ui.victory[pow][used_victory[pow]++] + if (pow === P_FRANCE) { + e.style.left = (x - 16 + i * 20) + "px" + e.style.top = (1635 - 16) + "px" + } else { + e.style.left = (x + 80 - 16 - i * 20) + "px" + e.style.top = (19 - 16) + "px" + } + ui.markers_element.appendChild(e) + } } function layout_elector(s, pow) { @@ -1207,6 +1228,11 @@ function on_update() { for (let pow of all_powers) action_button_with_argument("power", pow, power_name[pow]) + action_button("reduce", "Reduce") + action_button("offer", "Offer") + action_button("accept", "Accept") + action_button("deny", "Deny") + action_button("re_enter", "Re-enter") action_button("force_march", "Force march") -- cgit v1.2.3