diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-01-20 14:25:55 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 13:02:39 +0100 |
commit | 46422bacaa4b3d05e3f6a359cde0fb7447a778c1 (patch) | |
tree | 4224a11f12afe5714b3c2ffb60e56d44ed5b5fb9 | |
parent | 8c0a10a78fd16ba484b4aff9ed6fd87e73116b38 (diff) | |
download | nevsky-46422bacaa4b3d05e3f6a359cde0fb7447a778c1.tar.gz |
Pleskau - Enemy Lords Removed.
-rw-r--r-- | play.html | 12 | ||||
-rw-r--r-- | play.js | 23 | ||||
-rw-r--r-- | rules.js | 17 |
3 files changed, 40 insertions, 12 deletions
@@ -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 { <div id="boxes"></div> <div id="pieces"> + <div id="elr1" class="marker circle enemy_lords_removed teutonic hide"></div> + <div id="elr2" class="marker circle enemy_lords_removed russian hide"></div> <div id="turn" class="hide marker circle turn levy t1"></div> <div id="vp2" class="hide marker circle victory russian v0 stack"></div> <div id="vp1" class="hide marker circle victory teutonic v0 stack"></div> - <div id="elr2" class="marker circle enemy_lords_removed russian v9"></div> - <div id="elr1" class="marker circle enemy_lords_removed teutonic v10"></div> <div id="legate" class="hide"></div> <div id="smerdi" class="box"></div> <div id="castle11" class="hide marker rectangle castle teutonic"/></div> @@ -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() @@ -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) |