summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-23 23:58:09 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-23 23:58:09 +0200
commit3664a02ae1a5ca368d6e9cb3a8e016177d528238 (patch)
treeff2a52de3fb259e6881cce952752f9017395bc75 /play.js
parentd1a4e47292f347556a6506c2b20f6adf8e69d619 (diff)
downloadmaria-3664a02ae1a5ca368d6e9cb3a8e016177d528238.tar.gz
annexation, expeditionary corps, set-aside markers
Diffstat (limited to 'play.js')
-rw-r--r--play.js26
1 files changed, 26 insertions, 0 deletions
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")