summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-01-20 00:47:47 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:39 +0100
commit8c0a10a78fd16ba484b4aff9ed6fd87e73116b38 (patch)
tree6c8502ef45d0df8802b1c766b8a0a425a2acc1fd
parentf315b4918cfc14eba5ad85dc41dfde1fc255ba49 (diff)
downloadnevsky-8c0a10a78fd16ba484b4aff9ed6fd87e73116b38.tar.gz
Moved/Fought markers. Feed x2 marker. End Campaign calendar tint.
-rw-r--r--images/almoravid_marker_feed_x2.pngbin0 -> 5112 bytes
-rw-r--r--images/almoravid_marker_feed_x3.pngbin0 -> 5467 bytes
-rw-r--r--images/marker_pleskau_blue.pngbin7301 -> 0 bytes
-rw-r--r--play.html27
-rw-r--r--play.js73
-rw-r--r--rules.js4
-rw-r--r--tools/build_counters2.sh2
-rw-r--r--tools/colors.mjs2
8 files changed, 77 insertions, 31 deletions
diff --git a/images/almoravid_marker_feed_x2.png b/images/almoravid_marker_feed_x2.png
new file mode 100644
index 0000000..6f179f7
--- /dev/null
+++ b/images/almoravid_marker_feed_x2.png
Binary files differ
diff --git a/images/almoravid_marker_feed_x3.png b/images/almoravid_marker_feed_x3.png
new file mode 100644
index 0000000..cf04b24
--- /dev/null
+++ b/images/almoravid_marker_feed_x3.png
Binary files differ
diff --git a/images/marker_pleskau_blue.png b/images/marker_pleskau_blue.png
deleted file mode 100644
index 962ffa4..0000000
--- a/images/marker_pleskau_blue.png
+++ /dev/null
Binary files differ
diff --git a/play.html b/play.html
index d2335cb..2d9f745 100644
--- a/play.html
+++ b/play.html
@@ -299,6 +299,15 @@ body.Teutons #plan_actions .russian { display: none }
display: none;
}
+.mat .moved_fought, .mat .feed_x2 {
+ position: absolute;
+ z-index: 5;
+}
+
+.mat .feed_x2 { left: 8px; top: 178px; }
+.mat .moved_fought.one { right: 72px; top: 12px; }
+.mat .moved_fought.two { right: 66px; top: 6px; }
+
body.shift .capabilities,
body.shift .events,
body.shift #capabilities1,
@@ -542,7 +551,8 @@ body.shift .mustered_vassals {
.marker.castle.russian { background-image: url(images/marker_castle_russian.png) }
.marker.castle.teutonic { background-image: url(images/marker_castle_teutonic.png) }
.marker.walls { background-image: url(images/marker_walls.a.png) }
-.marker.sea_trade_blocked { background-image: url(images/marker_sea_trade_blocked.a.png) }
+.marker.moved_fought { background-image: url(images/marker_moved_fought.png) }
+.marker.feed_x2 { background-image: url(images/almoravid_marker_feed_x2.png) }
.marker.number.teutonic.n1 { background-image: url(images/marker_1_teutonic.png) }
.marker.number.teutonic.n2 { background-image: url(images/marker_2_teutonic.png) }
@@ -574,15 +584,11 @@ body.shift .mustered_vassals {
}
.unit.knights, .unit.sergeants, .unit.light_horse, .unit.asiatic_horse {
- width: 24px;
- height: 28px;
width: 30px;
height: 35px;
}
.unit.men_at_arms, .unit.militia, .unit.serfs {
- width: 34px;
- height: 28px;
width: 43px;
height: 35px;
}
@@ -669,9 +675,6 @@ body.shift .mustered_vassals {
position: absolute;
}
-.box.calendar {
-}
-
.box.victory {
border-radius: 50%;
}
@@ -680,6 +683,10 @@ body.shift .mustered_vassals {
border-radius: 50%;
}
+.box.calendar.end {
+ background-color: #8884;
+}
+
.box.calendar.action {
border-color: white;
background-color: #fff6;
@@ -1036,6 +1043,8 @@ body.shift .mustered_vassals {
.marker.walls { background-color: #e3dedc; border-color: #fffefc #c3bebc #c3bebc #fffefc; box-shadow: 0 0 0 1px #686362, 1px 2px 4px #0008; }
.marker.russian.number { background-color: #c6992f; border-color: #e7b954 #a67a00 #a67a00 #e7b954; box-shadow: 0 0 0 1px #4d2400, 1px 2px 4px #0008; }
.marker.teutonic.number { background-color: #a02532; border-color: #c2474e #7e0017 #7e0017 #c2474e; box-shadow: 0 0 0 1px #1a0000, 1px 2px 4px #0008; }
+.marker.moved_fought { background-color: #0072bc; border-color: #3491dd #00549c #00549c #3491dd; box-shadow: 0 0 0 1px #00003f, 1px 2px 4px #0008; }
+.marker.feed_x2 { background-color: #0072bc; border-color: #3491dd #00549c #00549c #3491dd; box-shadow: 0 0 0 1px #00003f, 1px 2px 4px #0008; }
/* CARD IMAGES */
@@ -1238,6 +1247,8 @@ body.shift .mustered_vassals {
<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>
diff --git a/play.js b/play.js
index ace1c6c..9a9a94f 100644
--- a/play.js
+++ b/play.js
@@ -229,8 +229,24 @@ function is_russian_lord(lord) {
return lord >= first_p2_lord && lord <= last_p2_lord
}
-function is_lord_moved(lord) {
- return pack2_get(view.pieces.moved, lord) > 0
+function get_lord_moved(lord) {
+ return pack2_get(view.pieces.moved, lord)
+}
+
+function get_lord_forces(lord, n) {
+ return pack4_get(view.pieces.forces[lord], n)
+}
+
+function count_lord_all_forces(lord) {
+ return (
+ get_lord_forces(lord, KNIGHTS) +
+ get_lord_forces(lord, SERGEANTS) +
+ get_lord_forces(lord, LIGHT_HORSE) +
+ get_lord_forces(lord, ASIATIC_HORSE) +
+ get_lord_forces(lord, MEN_AT_ARMS) +
+ get_lord_forces(lord, MILITIA) +
+ get_lord_forces(lord, SERFS)
+ )
}
function is_veche_action() {
@@ -301,6 +317,10 @@ function is_legate_selected() {
return player === "Teutons" && !!view.pieces.legate_selected
}
+function is_levy_phase() {
+ return (view.turn & 1) === 0
+}
+
const force_type_count = 7
const force_type_name = [ "knights", "sergeants", "light_horse", "asiatic_horse", "men_at_arms", "militia", "serfs" ]
const force_type_tip = [ "knights", "sergeants", "light horse", "asiatic horse", "men-at-arms", "militia", "serfs" ]
@@ -456,22 +476,22 @@ const original_boxes = {
"way wirz": [1295,4526,175,350],
"way peipus-east": [2232,4197,220,480],
"way peipus-north": [2053,3830,361,228],
- "calendar summer box1": [40,168,590,916],
- "calendar summer box2": [650,168,590,916],
- "calendar winter box3": [1313,168,590,916],
- "calendar winter box4": [1922,168,590,916],
- "calendar winter box5": [2587,168,590,916],
- "calendar winter box6": [3196,168,590,916],
- "calendar rasputitsa box7": [3860,168,590,916],
- "calendar rasputitsa box8": [4470,168,590,916],
- "calendar summer box9": [40,1120,590,916],
- "calendar summer box10": [650,1120,590,916],
- "calendar winter box11": [1313,1120,590,916],
- "calendar winter box12": [1922,1120,590,916],
- "calendar winter box13": [2587,1120,590,916],
- "calendar winter box14": [3196,1120,590,916],
- "calendar rasputitsa box15": [3860,1120,590,916],
- "calendar rasputitsa box16": [4470,1120,590,916],
+ "calendar summer box1": [40,168,598,924],
+ "calendar summer box2": [650,168,598,924],
+ "calendar winter box3": [1313,168,598,924],
+ "calendar winter box4": [1922,168,598,924],
+ "calendar winter box5": [2587,168,598,924],
+ "calendar winter box6": [3196,168,598,924],
+ "calendar rasputitsa box7": [3860,168,598,924],
+ "calendar rasputitsa box8": [4470,168,598,924],
+ "calendar summer box9": [40,1120,598,924],
+ "calendar summer box10": [650,1120,598,924],
+ "calendar winter box11": [1313,1120,598,924],
+ "calendar winter box12": [1922,1120,598,924],
+ "calendar winter box13": [2587,1120,598,924],
+ "calendar winter box14": [3196,1120,598,924],
+ "calendar rasputitsa box15": [3860,1120,598,924],
+ "calendar rasputitsa box16": [4470,1120,598,924],
"calendar box0": [6,62,1265,89],
"calendar box17": [3827,2056,1265,86],
}
@@ -518,6 +538,9 @@ const ui = {
mustered_vassals: [],
lord_capabilities: [],
lord_events: [],
+ lord_moved1: [],
+ lord_moved2: [],
+ lord_feed_x2: [],
cards: [],
boxes: {},
ways: [],
@@ -544,6 +567,7 @@ const ui = {
capabilities2: document.getElementById("capabilities2"),
command: document.getElementById("command"),
turn: document.getElementById("turn"),
+ end: document.getElementById("end"),
vp1: document.getElementById("vp1"),
vp2: document.getElementById("vp2"),
court1_header: document.getElementById("court1_header"),
@@ -1085,6 +1109,9 @@ function update_lord_mat(ix) {
update_vassals(ui.ready_vassals[ix], ui.mustered_vassals[ix], ix)
update_forces(ui.forces[ix], view.pieces.forces[ix], ix, false)
update_forces(ui.routed[ix], view.pieces.routed[ix], ix, true)
+ ui.lord_moved1[ix].classList.toggle("hide", is_levy_phase() || get_lord_moved(ix) < 1)
+ ui.lord_moved2[ix].classList.toggle("hide", is_levy_phase() || get_lord_moved(ix) < 2)
+ ui.lord_feed_x2[ix].classList.toggle("hide", count_lord_all_forces(ix) <= 6)
}
function is_lord_command(ix) {
@@ -1136,7 +1163,6 @@ function update_lord(ix) {
ui.lord_service[ix].classList.add("hide")
}
ui.lord_cylinder[ix].classList.toggle("besieged", is_lord_besieged(ix))
- ui.lord_cylinder[ix].classList.toggle("moved", is_lord_moved(ix))
ui.lord_buttons[ix].classList.toggle("action", is_lord_action(ix))
ui.lord_cylinder[ix].classList.toggle("action", is_lord_action(ix))
ui.lord_service[ix].classList.toggle("action", is_service_action(ix) || is_service_bad_action(ix))
@@ -1155,7 +1181,6 @@ function update_lord(ix) {
ui.lord_mat[ix].classList.toggle("command", is_lord_command(ix))
ui.lord_mat[ix].classList.toggle("besieged", is_lord_besieged(ix))
- ui.lord_mat[ix].classList.toggle("moved", is_lord_moved(ix))
}
function update_legate() {
@@ -1569,8 +1594,11 @@ function on_update() {
update_court()
- for (let i = 0; i <= 17; ++i)
+ for (let i = 0; i <= 17; ++i) {
ui.calendar[i].classList.toggle("action", is_calendar_action(i))
+ if (i >= 1 && i <= 16)
+ ui.calendar[i].classList.toggle("end", i > view.end)
+ }
// Misc
action_button("lordship", "Lordship")
@@ -1671,6 +1699,9 @@ function build_lord_mat(lord, ix, side, name) {
ui.lord_buttons[ix] = build_div(bg, "shield", ix, on_click_cylinder)
ui.lord_capabilities[ix] = build_div(mat, "capabilities")
ui.lord_events[ix] = build_div(mat, "events")
+ ui.lord_moved1[ix] = build_div(mat, "marker square moved_fought one hide")
+ ui.lord_moved2[ix] = build_div(mat, "marker square moved_fought two hide")
+ ui.lord_feed_x2[ix] = build_div(mat, "marker small feed_x2")
ui.lord_mat[ix] = mat
}
diff --git a/rules.js b/rules.js
index a5383c3..4f36d2f 100644
--- a/rules.js
+++ b/rules.js
@@ -2,6 +2,9 @@
// TODO: Bridge - kn, sgt, 1x lh, maa, militia, serf, lh, ah
+// TODO: feed x2 marker
+// TODO: end marker
+
// FIXME: lift_sieges / besieged needs checking! (automatic after disband_lord, manual after move/sail, extra careful manual after battle)
// FIXME: remove_legate_if_endangered needs checking! (automatic after disband_lord, manual after move/sail, manual after battle)
@@ -10481,6 +10484,7 @@ exports.view = function (state, current) {
log: game.log,
turn: game.turn,
+ end: scenario_last_turn[game.scenario],
events: game.events,
capabilities: game.capabilities,
pieces: game.pieces,
diff --git a/tools/build_counters2.sh b/tools/build_counters2.sh
index ad7bc5d..b112e8a 100644
--- a/tools/build_counters2.sh
+++ b/tools/build_counters2.sh
@@ -19,7 +19,7 @@ marker2 cs_circle_1_1_2 marker_levy marker_campaign
marker2 cs_circle_1_1_3 marker_victory_teutonic marker_victory_half_teutonic
marker2 cs_circle_1_1_4 marker_victory_russian marker_victory_half_russian
marker2 cs_circle_1_1_5 marker_enemy_lords_removed_teutonic marker_pleskau_blue
-marker2 cs_circle_1_1_6 marker_enemy_lords_removed_russian makrer_pleskau_gray
+marker2 cs_circle_1_1_6 marker_enemy_lords_removed_russian marker_pleskau_gray
marker2 cs_sq_small_1_1_2 marker_ravaged_teutonic marker_ravaged_russian
diff --git a/tools/colors.mjs b/tools/colors.mjs
index 4af8545..9e668bb 100644
--- a/tools/colors.mjs
+++ b/tools/colors.mjs
@@ -42,11 +42,11 @@ const data = [
[".marker.walls", "e3dedc"],
[".marker.russian.number", "c6992f"],
[".marker.teutonic.number", "a02532"],
+[".marker.moved_fought", "0072bc"],
/*
[".unit", "ffd768"],
[".marker.supply_source", "e6dcb9"],
-[".marker.moved_fought", "0072bc"],
[".marker.pleskau_black", "324b5b"],
[".marker.pleskau_white", "e3dedc"],
*/