From 46422bacaa4b3d05e3f6a359cde0fb7447a778c1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 20 Jan 2023 14:25:55 +0100 Subject: Pleskau - Enemy Lords Removed. --- play.html | 12 +++++++++--- play.js | 23 ++++++++++++++++------- rules.js | 17 +++++++++++++++-- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/play.html b/play.html index 2d9f745..173dfec 100644 --- a/play.html +++ b/play.html @@ -542,6 +542,8 @@ body.shift .mustered_vassals { .marker.ravaged.russian { background-image: url(images/marker_ravaged_russian.png) } .marker.siege.teutonic { background-image: url(images/marker_siege_teutonic.png) } .marker.siege.russian { background-image: url(images/marker_siege_russian.png) } +.marker.enemy_lords_removed.teutonic { background-image: url(images/marker_enemy_lords_removed_teutonic.png) } +.marker.enemy_lords_removed.russian { background-image: url(images/marker_enemy_lords_removed_russian.png) } .marker.victory.teutonic { background-image: url(images/marker_victory_teutonic.png) } .marker.victory.russian { background-image: url(images/marker_victory_russian.png) } .marker.victory.half.teutonic { background-image: url(images/marker_victory_half_teutonic.png) } @@ -806,7 +808,10 @@ body.shift .mustered_vassals { #vp2.stack.half ~ #vp1.stack:not(.half) { transform: translate(-12px,-30px); } #vp2.stack:not(.half) ~ #vp1.stack.half { transform: translate(12px,-30px); } -.marker.victory, .marker.turn { +.marker.russian.enemy_lords_removed { transform: translate(-12px,18px); } +.marker.teutonic.enemy_lords_removed { transform: translate(12px,18px); } + +.marker.victory, .marker.turn, .marker.enemy_lords_removed { position: absolute; } @@ -933,6 +938,7 @@ body.shift .mustered_vassals { } .marker.russian, +.marker.teutonic.enemy_lords_removed, .service_marker.russian.lord { background-color: #fff; border-color: #eee #ccc #ccc #eee; @@ -1244,11 +1250,11 @@ body.shift .mustered_vassals {
+
+
-
-
diff --git a/play.js b/play.js index 9a9a94f..540ad2c 100644 --- a/play.js +++ b/play.js @@ -378,9 +378,8 @@ function is_p2_locale(loc) { } function count_vp1() { - let vp = 0 - for (let loc of view.pieces.castles1) - vp += 2 + let vp = view.pieces.elr1 << 1 + vp += view.pieces.castles1.length << 1 for (let loc of view.pieces.conquered) if (is_p2_locale(loc)) vp += data.locales[loc].vp << 1 @@ -391,9 +390,9 @@ function count_vp1() { } function count_vp2() { - let vp = view.pieces.veche_vp * 2 - for (let loc of view.pieces.castles2) - vp += 2 + let vp = view.pieces.elr2 << 1 + vp += view.pieces.veche_vp << 1 + vp += view.pieces.castles2.length << 1 for (let loc of view.pieces.conquered) if (is_p1_locale(loc)) vp += data.locales[loc].vp << 1 @@ -567,7 +566,8 @@ const ui = { capabilities2: document.getElementById("capabilities2"), command: document.getElementById("command"), turn: document.getElementById("turn"), - end: document.getElementById("end"), + elr1: document.getElementById("elr1"), + elr2: document.getElementById("elr2"), vp1: document.getElementById("vp1"), vp2: document.getElementById("vp2"), court1_header: document.getElementById("court1_header"), @@ -1569,6 +1569,15 @@ function on_update() { ui.vp2.className = `marker circle victory russian v${vp2>>1}` } + if (view.pieces.elr1) + ui.elr1.classList = `marker circle enemy_lords_removed teutonic ${view.pieces.elr1}` + else + ui.elr1.classList = `marker circle enemy_lords_removed teutonic hide` + if (view.pieces.elr2) + ui.elr2.classList = `marker circle enemy_lords_removed russian ${view.pieces.elr2}` + else + ui.elr2.classList = `marker circle enemy_lords_removed russian hide` + update_plan() update_cards() diff --git a/rules.js b/rules.js index 4f36d2f..a849084 100644 --- a/rules.js +++ b/rules.js @@ -2,6 +2,8 @@ // TODO: Bridge - kn, sgt, 1x lh, maa, militia, serf, lh, ah +// PLESKAU: Enemy Lords Removed marker and VP + // TODO: feed x2 marker // TODO: end marker @@ -1672,6 +1674,10 @@ exports.setup = function (seed, scenario, options) { function setup_pleskau() { game.turn = 1 << 1 + // Count Enemy Lords Removed in this scenario + game.pieces.elr1 = 0 + game.pieces.elr2 = 0 + // Remove all No Event cards in this scenario game.no1 = 0 game.no2 = 0 @@ -9666,6 +9672,13 @@ function disband_lord(lord, permanently = false) { set_lord_service(lord, NEVER) } + if (game.scenario === "Pleskau" || game.scenario === "Pleskau (Quickstart)") { + if (is_russian_lord(lord)) + game.pieces.elr1 ++ + else + game.pieces.elr2 ++ + } + remove_lieutenant(lord) // Smerdi - serfs go back to card @@ -9925,7 +9938,7 @@ function goto_end_campaign() { } function count_vp1() { - let vp = 0 + let vp = game.pieces.elr1 << 1 vp += game.pieces.castles1.length << 1 for (let loc of game.pieces.conquered) if (is_p2_locale(loc)) @@ -9937,7 +9950,7 @@ function count_vp1() { } function count_vp2() { - let vp = 0 + let vp = game.pieces.elr2 << 1 vp += game.pieces.veche_vp << 1 vp += game.pieces.castles2.length << 1 for (let loc of game.pieces.conquered) -- cgit v1.2.3