summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.css100
-rw-r--r--play.html49
-rw-r--r--play.js127
3 files changed, 33 insertions, 243 deletions
diff --git a/play.css b/play.css
index e9dab9f..6a4d7f6 100644
--- a/play.css
+++ b/play.css
@@ -2,8 +2,8 @@ main { background-color: dimgray; }
#roles { background-color: gray; }
header { background-color: silver; }
header.your_turn { background-color: orange; }
-#role_Teutons .role_name { background-color: hsl(210,30%,80%); }
-#role_Russians .role_name { background-color: hsl(35,40%,80%); }
+#role_York .role_name { background-color: whitesmoke; }
+#role_Lancaster .role_name { background-color: salmon; }
#turn_info { background-color: gainsboro; }
.role_held { float: right; }
@@ -15,10 +15,6 @@ header.your_turn { background-color: orange; }
#log .h5 { text-decoration: underline; }
#log .h1 { background-color: hsl(0,0%,80%); }
-#log .h2.teutonic { background-color: hsl(210,30%,85%); }
-#log .h2.russian { background-color: hsl(36,40%,85%); }
-#log .h3.teutonic { background-color: hsl(210,30%,90%); }
-#log .h3.russian { background-color: hsl(35,40%,90%); }
#log div { padding-left: 20px; text-indent: -12px; }
#log div.i { padding-left: 32px; text-indent: -12px; }
@@ -41,8 +37,8 @@ header.your_turn { background-color: orange; }
/* PANELS */
.panel {
- min-width: 1275px;
- max-width: 1275px;
+ min-width: 1350px;
+ max-width: 1350px;
margin: 12px auto 36px auto;
background-color: #555;
}
@@ -99,8 +95,8 @@ header.your_turn { background-color: orange; }
background-size: 93px 130px;
}
-body.Russians #plan_actions .teutonic { display: none }
-body.Teutons #plan_actions .russian { display: none }
+body.York #plan_actions .york { display: none }
+body.Lancaster #plan_actions .lancaster { display: none }
/* BATTLE GRID WITH LORD MATS */
@@ -119,7 +115,6 @@ body.Teutons #plan_actions .russian { display: none }
}
#battle_grid #grid_ga { height: auto; }
-#battle_grid #grid_sw { height: auto; }
.grid_array { background-repeat: no-repeat }
@@ -130,35 +125,9 @@ body.Teutons #plan_actions .russian { display: none }
#battle_grid {
background-repeat: no-repeat;
- background-position:
- 95% 350px,
- 85% 175px,
- 10% 300px,
- 90% 800px,
- 10% 850px,
- 40% 1000px;
- background-image:
- url(images/battlefield_buildings.png),
- url(images/battlefield_trees1.png),
- url(images/battlefield_hill1.png),
- url(images/battlefield_hill2.png),
- url(images/battlefield_trees2.png),
- url(images/battlefield_trees3.png);
}
#battle_grid.attacker {
- background-position:
- 10% 900px,
- 5% 725px,
- 90% 850px,
- 10% 250px,
- 90% 250px,
- 60% 100px;
-}
-
-#grid_rg1:empty:not(.action), #grid_rg2:empty:not(.action), #grid_rg3:empty:not(.action),
-#grid_sa1:empty:not(.action), #grid_sa2:empty:not(.action), #grid_sa3:empty:not(.action) {
- display: none;
}
#battle_header { grid-row: 1; grid-column: 1 / 4; }
@@ -193,13 +162,6 @@ body.Teutons #plan_actions .russian { display: none }
.defender #grid_d1 { grid-row: 3; grid-column: 1; }
.defender #grid_d2 { grid-row: 3; grid-column: 2; }
.defender #grid_d3 { grid-row: 3; grid-column: 3; }
-.defender #grid_rg1 { grid-row: 4; grid-column: 1; }
-.defender #grid_rg2 { grid-row: 4; grid-column: 2; }
-.defender #grid_rg3 { grid-row: 4; grid-column: 3; }
-.defender #grid_sw { grid-row: 5; grid-column: 2; }
-.defender #grid_sa1 { grid-row: 6; grid-column: 1; }
-.defender #grid_sa2 { grid-row: 6; grid-column: 2; }
-.defender #grid_sa3 { grid-row: 6; grid-column: 3; }
.attacker #grid_a1 { grid-row: 6; grid-column: 3; }
.attacker #grid_a2 { grid-row: 6; grid-column: 2; }
@@ -208,13 +170,6 @@ body.Teutons #plan_actions .russian { display: none }
.attacker #grid_d1 { grid-row: 4; grid-column: 3; }
.attacker #grid_d2 { grid-row: 4; grid-column: 2; }
.attacker #grid_d3 { grid-row: 4; grid-column: 1; }
-.attacker #grid_rg1 { grid-row: 3; grid-column: 3; }
-.attacker #grid_rg2 { grid-row: 3; grid-column: 2; }
-.attacker #grid_rg3 { grid-row: 3; grid-column: 1; }
-.attacker #grid_sw { grid-row: 2; grid-column: 2; }
-.attacker #grid_sa1 { grid-row: 1; grid-column: 3; }
-.attacker #grid_sa2 { grid-row: 1; grid-column: 2; }
-.attacker #grid_sa3 { grid-row: 1; grid-column: 1; }
.defender #pursuit.rotate,
.attacker #pursuit:not(.rotate)
@@ -493,7 +448,7 @@ body.shift .mustered_vassals {
.tuck_under_map {
margin: 0 auto 36px auto;
- width: 1275px;
+ width: 1350px;
min-height: 260px;
margin-top: -130px;
display: grid;
@@ -535,9 +490,6 @@ body.shift .mustered_vassals {
box-shadow: 0 0 0 1px #444, 0 0 0 4px yellow !important;
}
-.asset.boat.x1 { background-image: url(images/asset_boat_x1.png); }
-.asset.boat.x2 { background-image: url(images/asset_boat_x2.png) }
-.asset.boat.x4 { background-image: url(images/asset_boat_x4.png) }
.asset.cart.x1 { background-image: url(images/asset_cart_x1.png); }
.asset.cart.x2 { background-image: url(images/asset_cart_x2.png) }
.asset.cart.x4 { background-image: url(images/asset_cart_x4.png) }
@@ -545,10 +497,6 @@ body.shift .mustered_vassals {
.asset.coin.x2 { background-image: url(images/asset_coin_x2.png) }
.asset.coin.x3 { background-image: url(images/asset_coin_x3.png) }
.asset.coin.x4 { background-image: url(images/asset_coin_x4.png) }
-.asset.loot.x1 { background-image: url(images/asset_loot_x1.png); }
-.asset.loot.x2 { background-image: url(images/asset_loot_x2.png) }
-.asset.loot.x3 { background-image: url(images/asset_loot_x3.png) }
-.asset.loot.x4 { background-image: url(images/asset_loot_x4.png) }
.asset.prov.x1 { background-image: url(images/asset_prov_x1.png); }
.asset.prov.x2 { background-image: url(images/asset_prov_x2.png) }
.asset.prov.x3 { background-image: url(images/asset_prov_x3.png) }
@@ -556,9 +504,6 @@ body.shift .mustered_vassals {
.asset.ship.x1 { background-image: url(images/asset_ship_x1.png); }
.asset.ship.x2 { background-image: url(images/asset_ship_x2.png) }
.asset.ship.x4 { background-image: url(images/asset_ship_x4.png) }
-.asset.sled.x1 { background-image: url(images/asset_sled_x1.png); }
-.asset.sled.x2 { background-image: url(images/asset_sled_x2.png) }
-.asset.sled.x4 { background-image: url(images/asset_sled_x4.png) }
.marker {
border: 2px solid aqua;
@@ -671,7 +616,7 @@ body.shift .mustered_vassals {
justify-content: center;
align-items: center;
min-height: 260px;
- max-width: 1275px;
+ max-width: 1350px;
gap: 16px;
}
@@ -704,8 +649,8 @@ body.shift .mustered_vassals {
/* MAP */
#mapwrap {
- width: 1275px;
- height: 1650px;
+ width: 1350px;
+ height: 1725px;
box-shadow: 0px 1px 10px #0008;
z-index: 3;
}
@@ -713,14 +658,14 @@ body.shift .mustered_vassals {
#map {
background-repeat: no-repeat;
background-size: cover;
- width: 1275px;
- height: 1650px;
+ width: 1350px;
+ height: 1725px;
overflow: clip;
}
-#map { background-image: url(map75.jpg) }
+#map { background-image: url(map75.png) }
@media (min-resolution: 97dpi) {
-#map { background-image: url(map150.jpg) }
+#map { background-image: url(map150.png) }
}
.box {
@@ -749,6 +694,11 @@ body.shift .mustered_vassals {
background-color: #fff6;
}
+.box.calendar.box0.action,
+.box.calendar.box17.action {
+ z-index: 200;
+}
+
.box.way.action {
border-color: dodgerblue;
}
@@ -1071,8 +1021,6 @@ body.shift .mustered_vassals {
.card.russian { background-color: #e1d6c1; border-color: #fff7e1 #c1b6a1 #c1b6a1 #fff7e1; box-shadow: 0 0 0 1px #665c4a, 1px 2px 4px #0008; }
.service_marker.teutonic.vassal { background-color: #777474; border-color: #959292 #5a5858 #5a5858 #959292; box-shadow: 0 0 0 1px #0f0d0d, 1px 2px 4px #0008; }
.service_marker.russian.vassal { background-color: #f0ead8; border-color: #ffffed #cfc9b8 #cfc9b8 #ffffed; box-shadow: 0 0 0 1px #736e5e, 1px 2px 4px #0008; }
-.asset.sled { background-color: #e5dcc1; border-color: #fffde2 #c5bca1 #c5bca1 #fffde2; box-shadow: 0 0 0 1px #69614a, 1px 2px 4px #0008; }
-.asset.boat { background-color: #adceed; border-color: #cdefff #8eaecc #8eaecc #cdefff; box-shadow: 0 0 0 1px #38556f, 1px 2px 4px #0008; }
.asset.cart.x1 { background-color: #daba8b; border-color: #fbdaaa #ba9b6d #ba9b6d #fbdaaa; box-shadow: 0 0 0 1px #5f4315, 1px 2px 4px #0008; }
.asset.cart.x2 { background-color: #d1a973; border-color: #f2c992 #b18a55 #b18a55 #f2c992; box-shadow: 0 0 0 1px #563400, 1px 2px 4px #0008; }
.asset.cart.x4 { background-color: #c4975b; border-color: #e5b67a #a4793c #a4793c #e5b67a; box-shadow: 0 0 0 1px #4b2500, 1px 2px 4px #0008; }
@@ -1087,10 +1035,6 @@ body.shift .mustered_vassals {
.asset.ship.x1 { background-color: #79b7e4; border-color: #98d7ff #5a98c3 #5a98c3 #98d7ff; box-shadow: 0 0 0 1px #004066, 1px 2px 4px #0008; }
.asset.ship.x2 { background-color: #79b7e4; border-color: #98d7ff #5a98c3 #5a98c3 #98d7ff; box-shadow: 0 0 0 1px #004066, 1px 2px 4px #0008; }
.asset.ship.x4 { background-color: #5da9dd; border-color: #7dc9ff #3d8abc #3d8abc #7dc9ff; box-shadow: 0 0 0 1px #00335f, 1px 2px 4px #0008; }
-.asset.loot.x1 { background-color: #f0b64f; border-color: #ffd771 #cf9628 #cf9628 #ffd771; box-shadow: 0 0 0 1px #703d00, 1px 2px 4px #0008; }
-.asset.loot.x2 { background-color: #eda44c; border-color: #ffc46e #cb8526 #cb8526 #ffc46e; box-shadow: 0 0 0 1px #6c2c00, 1px 2px 4px #0008; }
-.asset.loot.x3 { background-color: #eb924a; border-color: #ffb26b #c97326 #c97326 #ffb26b; box-shadow: 0 0 0 1px #681800, 1px 2px 4px #0008; }
-.asset.loot.x4 { background-color: #e1884a; border-color: #ffa86a #bf6928 #bf6928 #ffa86a; box-shadow: 0 0 0 1px #5f0c00, 1px 2px 4px #0008; }
.marker.battle { background-color: #d0bf7d; border-color: #f1e09c #b09f5e #b09f5e #f1e09c; box-shadow: 0 0 0 1px #574700, 1px 2px 4px #0008; }
.marker.storm { background-color: #d0bf7d; border-color: #f1e09c #b09f5e #b09f5e #f1e09c; box-shadow: 0 0 0 1px #574700, 1px 2px 4px #0008; }
.marker.pursuit { background-color: #c6ab7f; border-color: #e7cb9e #a68c61 #a68c61 #e7cb9e; box-shadow: 0 0 0 1px #4e370a, 1px 2px 4px #0008; }
@@ -1235,18 +1179,18 @@ body.shift .mustered_vassals {
@media (min-width: 2800px) {
main { display: grid; gap: 0 12px; }
- main { grid-template-columns: 0 1275px auto 0; }
+ main { grid-template-columns: 0 1350px auto 0; }
#sec_map { grid-row: 1; grid-column: 2 }
#sec_battle { grid-row: 2; grid-column: 2 }
#sec_lords { grid-row: 1 / 3; grid-column: 3 }
}
@media (min-width: 3200px) {
- main { grid-template-columns: 36px 1275px auto 0; }
+ main { grid-template-columns: 36px 1350px auto 0; }
}
@media (min-width: 4100px) {
- main { grid-template-columns: 0 1275px 1fr 1275px 0; }
+ main { grid-template-columns: 0 1350px 1fr 1350px 0; }
#sec_map { grid-row: 1; grid-column: 2 }
#sec_lords { grid-row: 1; grid-column: 3 }
#sec_battle { grid-row: 1; grid-column: 4 }
diff --git a/play.html b/play.html
index cb1fd2b..c4144a6 100644
--- a/play.html
+++ b/play.html
@@ -4,7 +4,7 @@
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
<meta charset="utf-8">
-<title>NEVSKY</title>
+<title>PLANTAGENET</title>
<link rel="icon" href="favicon.png">
<link rel="stylesheet" href="/fonts/fonts.css">
<link rel="stylesheet" href="/common/play.css">
@@ -20,11 +20,10 @@
<div class="menu">
<div class="menu_title"><img src="/images/cog.svg"></div>
<div class="menu_popup">
- <a class="menu_item" target="_blanK" href="/nevsky/info/rules.html">Rules of Play</a>
- <a class="menu_item" target="_blanK" href="/nevsky/info/playbook.html">Background Book</a>
- <a class="menu_item" target="_blanK" href="/nevsky/info/pac.html">Reference Sheets</a>
- <a class="menu_item" target="_blanK" href="/nevsky/info/cards.html">Arts of War</a>
- <a class="menu_item" target="_blanK" href="/nevsky/info/lords.html">Lord Mats</a>
+ <a class="menu_item" target="_blanK" href="/plantagenet/info/rulebook.html">Rules of Play</a>
+ <a class="menu_item" target="_blanK" href="/plantagenet/info/playbook.html">Background Book</a>
+ <a class="menu_item" target="_blanK" href="/plantagenet/info/reference.html">Reference Sheets</a>
+ <a class="menu_item" target="_blanK" href="/plantagenet/info/cards.html">Arts of War</a>
<div class="resign menu_separator"></div>
<div class="resign menu_item" onclick="confirm_resign()">Resign</div>
</div>
@@ -38,21 +37,21 @@
<aside>
<div id="roles">
- <div class="role" id="role_Teutons">
+ <div class="role" id="role_York">
<div class="role_name">
- Teutons
+ York
<div class="role_held">0 Held</div>
<div class="role_user">-</div>
</div>
</div>
- <div class="role" id="role_Russians">
+ <div class="role" id="role_Lancaster">
<div class="role_name">
- Russians
+ Lancaster
<div class="role_held">0 Held</div>
<div class="role_user">-</div>
</div>
</div>
- <div class="card_info"><div id="command" class="card teutonic aow_back"></div></div>
+ <div class="card_info"><div id="command" class="card york aow_back"></div></div>
</div>
<div id="log"></div>
</aside>
@@ -65,29 +64,13 @@
<div id="mapwrap">
<div id="map">
-<div id="veche"></div>
-<div class="box veche_label" id="veche_label_top"></div>
-<div class="box veche_label" id="veche_label_bottom"></div>
-<div class="veche_border" id="veche_border_w"></div>
-<div class="veche_border" id="veche_border_e"></div>
-<div class="veche_border" id="veche_border_sw"></div>
-<div class="veche_border" id="veche_border_se"></div>
-
<div id="locales"></div>
<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="legate" class="hide"></div>
- <div id="smerdi" class="box"></div>
- <div id="castle11" class="hide marker rectangle castle teutonic"/></div>
- <div id="castle12" class="hide marker rectangle castle teutonic"/></div>
- <div id="castle21" class="hide marker rectangle castle russian"/></div>
- <div id="castle22" class="hide marker rectangle castle russian"/></div>
</div>
</div>
@@ -119,11 +102,6 @@
<div id="battle_grid">
<div id="grid_ga">
<div id="pursuit" class="marker rectangle pursuit russian hide"></div>
- <div id="battle_walls1" class="siegeworks"></div>
- <div id="battle_walls2" class="siegeworks"></div>
- <div id="garrison"></div>
- <div id="battle_walls3" class="siegeworks"></div>
- <div id="battle_walls4" class="siegeworks"></div>
</div>
<div class="grid_array att" id="grid_a1"></div>
<div class="grid_array att" id="grid_a2"></div>
@@ -131,13 +109,6 @@
<div class="grid_array def" id="grid_d1"></div>
<div class="grid_array def" id="grid_d2"></div>
<div class="grid_array def" id="grid_d3"></div>
- <div class="grid_array att" id="grid_rg1"></div>
- <div class="grid_array att" id="grid_rg2"></div>
- <div class="grid_array att" id="grid_rg3"></div>
- <div class="siegeworks" id="grid_sw"></div>
- <div class="grid_array def" id="grid_sa1"></div>
- <div class="grid_array def" id="grid_sa2"></div>
- <div class="grid_array def" id="grid_sa3"></div>
</div>
</div>
diff --git a/play.js b/play.js
index b3e2f56..1a57c7c 100644
--- a/play.js
+++ b/play.js
@@ -61,13 +61,6 @@ function set_has(set, item) {
function find_lord(name) { return data.lords.findIndex((x) => x.name === name) }
function find_card(name) { return data.cards.findIndex((x) => x.name === name) }
-const LORD_ANDREAS = find_lord("Andreas")
-const LORD_HERMANN = find_lord("Hermann")
-const LORD_ALEKSANDR = find_lord("Aleksandr")
-const LORD_ANDREY = find_lord("Andrey")
-const LORD_KNUD_ABEL = find_lord("Knud & Abel")
-const LORD_RUDOLF = find_lord("Rudolf")
-
const first_p1_lord = 0
const last_p1_lord = 5
const first_p2_lord = 6
@@ -96,7 +89,7 @@ const AOW_TEUTONIC_TREBUCHETS = T14
const EVENT_RUSSIAN_VALDEMAR = R11
const EVENT_RUSSIAN_DIETRICH_VON_GRUNINGEN = R17
-const A1 = 0, A2 = 1, A3 = 2, D1 = 3, D2 = 4, D3 = 5, SA1 = 6, SA2 = 7, SA3 = 8, RG1 = 9, RG2 = 10, RG3 = 11
+const A1 = 0, A2 = 1, A3 = 2, D1 = 3, D2 = 4, D3 = 5
const KNIGHTS = 0, SERGEANTS = 1, LIGHT_HORSE = 2, ASIATIC_HORSE = 3, MEN_AT_ARMS = 4, MILITIA = 5, SERFS = 6
const force_type_count = 7
@@ -216,13 +209,6 @@ function on_focus_cylinder(evt) {
tip += ` - ${info.service} Service`
}
- if (lord === LORD_KNUD_ABEL)
- if (is_event_in_play(EVENT_RUSSIAN_VALDEMAR))
- tip += ` - No Muster because of Valdemar!`
- if (lord === LORD_ANDREAS || lord === LORD_RUDOLF)
- if (is_event_in_play(EVENT_RUSSIAN_DIETRICH_VON_GRUNINGEN))
- tip += ` - No Muster because of Dietrich von GrĂ¼ningen!`
-
on_focus(tip)
}
@@ -281,10 +267,6 @@ function is_lord_on_left_or_right(lord) {
if (view.battle.array[A3] === lord) return true
if (view.battle.array[D1] === lord) return true
if (view.battle.array[D3] === lord) return true
- if (view.battle.array[SA1] === lord) return true
- if (view.battle.array[SA3] === lord) return true
- if (view.battle.array[RG1] === lord) return true
- if (view.battle.array[RG3] === lord) return true
return false
}
@@ -337,7 +319,6 @@ function is_p2_locale(loc) {
function count_vp1() {
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
@@ -350,7 +331,6 @@ function count_vp1() {
function count_vp2() {
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
@@ -427,17 +407,6 @@ function is_town_locale(loc) {
return data.locales[loc].type === "town"
}
-function has_castle_marker(loc) {
- return (
- set_has(view.pieces.castles1, loc) ||
- set_has(view.pieces.castles2, loc)
- )
-}
-
-function is_castle(loc) {
- return data.locales[loc].type === "castle" || has_castle_marker(loc)
-}
-
function is_bishopric(loc) {
return data.locales[loc].type === "bishopric"
}
@@ -565,9 +534,6 @@ const ui = {
cards: [],
boxes: {},
ways: [],
- smerdi: document.getElementById("smerdi"),
- legate: document.getElementById("legate"),
- veche: document.getElementById("veche"),
plan_panel: document.getElementById("plan_panel"),
plan: document.getElementById("plan"),
@@ -594,22 +560,12 @@ const ui = {
capabilities2: document.getElementById("capabilities2"),
command: document.getElementById("command"),
turn: document.getElementById("turn"),
- elr1: document.getElementById("elr1"),
- elr2: document.getElementById("elr2"),
vp1: document.getElementById("vp1"),
vp2: document.getElementById("vp2"),
court1_header: document.getElementById("court1_header"),
court2_header: document.getElementById("court2_header"),
court1: document.getElementById("court1"),
court2: document.getElementById("court2"),
- garrison: document.getElementById("garrison"),
- battle_walls: [
- document.getElementById("battle_walls1"),
- document.getElementById("battle_walls2"),
- document.getElementById("battle_walls3"),
- document.getElementById("battle_walls4"),
- ],
- battle_siegeworks: document.getElementById("grid_sw"),
battle_panel: document.getElementById("battle_panel"),
battle_header: document.getElementById("battle_header"),
pursuit: document.getElementById("pursuit"),
@@ -621,18 +577,6 @@ const ui = {
document.getElementById("grid_d1"),
document.getElementById("grid_d2"),
document.getElementById("grid_d3"),
- document.getElementById("grid_sa1"),
- document.getElementById("grid_sa2"),
- document.getElementById("grid_sa3"),
- document.getElementById("grid_rg1"),
- document.getElementById("grid_rg2"),
- document.getElementById("grid_rg3"),
- ],
- castles: [
- document.getElementById("castle11"),
- document.getElementById("castle12"),
- document.getElementById("castle21"),
- document.getElementById("castle22"),
],
}
@@ -873,7 +817,6 @@ function build_map() {
build_plan()
- register_action(ui.garrison, "garrison")
for (let i = 0; i < 12; ++i)
register_action(ui.battle_grid_array[i], "array", i)
@@ -1502,74 +1445,6 @@ function update_battle() {
ui.reserves.replaceChildren()
for (let lord of view.battle.reserves)
ui.reserves.appendChild(ui.lord_mat[lord])
-
- ui.garrison.classList.toggle("hide", !view.battle.storm)
- ui.garrison.classList.toggle("action", is_action("garrison"))
-
- ui.garrison.replaceChildren()
- if (view.battle.garrison) {
- for (let i = 0; i < view.battle.garrison.knights; ++i)
- add_force(ui.garrison, KNIGHTS, GARRISON, 0)
- for (let i = 0; i < view.battle.garrison.men_at_arms; ++i)
- add_force(ui.garrison, MEN_AT_ARMS, GARRISON, 0)
- }
-
- let here = view.battle.where
-
- let def_prot = 0
- let def_walls = 0
- let att_prot = 0
- let sally_prot = 0
-
- if (view.battle.storm) {
- if (is_bishopric(here) || is_castle(here))
- def_prot = 4
- else
- def_prot = 3
- if (attacker_has_trebuchets())
- def_prot--
- if (has_walls(here))
- def_walls++
- att_prot = count_siege_markers(view.battle.where)
- }
-
- if (view.battle.sally)
- def_prot = count_siege_markers(view.battle.where)
- else if (view.battle.array[SA2] >= 0)
- sally_prot = count_siege_markers(view.battle.where)
-
- let att_ui, def_ui
- if (player === view.battle.attacker) {
- att_ui = ui.battle_walls[3]
- def_ui = ui.battle_walls[2]
- } else {
- att_ui = ui.battle_walls[0]
- def_ui = ui.battle_walls[1]
- }
-
- for (let i = 0; i < 4; ++i)
- ui.battle_walls[i].replaceChildren()
-
- for (let i = 0; i < def_prot; ++i)
- if (view.battle.attacker === "Teutons")
- def_ui.appendChild(get_cached_element("marker square russian siege"))
- else
- def_ui.appendChild(get_cached_element("marker square teutonic siege"))
- for (let i = 0; i < def_walls; ++i)
- def_ui.appendChild(get_cached_element("marker square walls"))
-
- ui.battle_siegeworks.replaceChildren()
- for (let i = 0; i < sally_prot; ++i)
- if (view.battle.attacker === "Teutons")
- ui.battle_siegeworks.appendChild(get_cached_element("marker square russian siege"))
- else
- ui.battle_siegeworks.appendChild(get_cached_element("marker square teutonic siege"))
-
- for (let i = 0; i < att_prot; ++i)
- if (view.battle.attacker === "Teutons")
- att_ui.appendChild(get_cached_element("marker square teutonic siege"))
- else
- att_ui.appendChild(get_cached_element("marker square russian siege"))
}
function update_court() {