summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-05 15:01:22 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-05 15:07:16 +0200
commitf4fcc3f927412c4a89b032a99db07019a9b63749 (patch)
tree7f3dc3c9b302a1f5f7abd9db1361719b71d781a5
parent67605eed1194e81699268eb8b60d6cf9682b5a38 (diff)
downloadplantagenet-f4fcc3f927412c4a89b032a99db07019a9b63749.tar.gz
favicons
-rw-r--r--favicons/conv.sh6
-rw-r--r--favicons/favicon_henry_vi.pngbin11353 -> 0 bytes
-rw-r--r--favicons/favicon_lancaster_buckingham.pngbin0 -> 13033 bytes
-rw-r--r--favicons/favicon_lancaster_clarence.pngbin0 -> 9006 bytes
-rw-r--r--favicons/favicon_lancaster_exeter.pngbin0 -> 11006 bytes
-rw-r--r--favicons/favicon_lancaster_henry_tudor.pngbin0 -> 14157 bytes
-rw-r--r--favicons/favicon_lancaster_henry_vi.pngbin0 -> 10940 bytes
-rw-r--r--favicons/favicon_lancaster_jasper_tudor.pngbin0 -> 12588 bytes
-rw-r--r--favicons/favicon_lancaster_margaret.pngbin0 -> 11409 bytes
-rw-r--r--favicons/favicon_lancaster_northumberland.pngbin0 -> 10575 bytes
-rw-r--r--favicons/favicon_lancaster_oxford.pngbin0 -> 9959 bytes
-rw-r--r--favicons/favicon_lancaster_somerset.pngbin0 -> 14599 bytes
-rw-r--r--favicons/favicon_lancaster_warwick.pngbin0 -> 10941 bytes
-rw-r--r--favicons/favicon_march.pngbin14779 -> 0 bytes
-rw-r--r--favicons/favicon_margaret.pngbin11615 -> 0 bytes
-rw-r--r--favicons/favicon_warwick.pngbin14943 -> 0 bytes
-rw-r--r--favicons/favicon_york.pngbin14112 -> 0 bytes
-rw-r--r--favicons/favicon_york_devon.pngbin0 -> 9953 bytes
-rw-r--r--favicons/favicon_york_edward_iv.pngbin0 -> 14075 bytes
-rw-r--r--favicons/favicon_york_gloucester.pngbin0 -> 10762 bytes
-rw-r--r--favicons/favicon_york_march.pngbin0 -> 14604 bytes
-rw-r--r--favicons/favicon_york_norfolk.pngbin0 -> 12829 bytes
-rw-r--r--favicons/favicon_york_northumberland.pngbin0 -> 10419 bytes
-rw-r--r--favicons/favicon_york_pembroke.pngbin0 -> 13303 bytes
-rw-r--r--favicons/favicon_york_rutland.pngbin0 -> 9551 bytes
-rw-r--r--favicons/favicon_york_salisbury.pngbin0 -> 10870 bytes
-rw-r--r--favicons/favicon_york_warwick.pngbin0 -> 11019 bytes
-rw-r--r--favicons/favicon_york_york.pngbin0 -> 14409 bytes
-rw-r--r--play.html2
-rw-r--r--play.js83
-rw-r--r--rules.ts11
31 files changed, 84 insertions, 18 deletions
diff --git a/favicons/conv.sh b/favicons/conv.sh
new file mode 100644
index 0000000..b61ef19
--- /dev/null
+++ b/favicons/conv.sh
@@ -0,0 +1,6 @@
+for F in seat_*.png
+do
+ B=${F/seat/favicon}
+ echo $F $B
+ convert -background transparent $F -rotate 315 +repage -crop 270x270+125+150 +repage -colorspace RGB -resize 128x128! -colorspace sRGB $B
+done
diff --git a/favicons/favicon_henry_vi.png b/favicons/favicon_henry_vi.png
deleted file mode 100644
index 3d7b22c..0000000
--- a/favicons/favicon_henry_vi.png
+++ /dev/null
Binary files differ
diff --git a/favicons/favicon_lancaster_buckingham.png b/favicons/favicon_lancaster_buckingham.png
new file mode 100644
index 0000000..0d7bc82
--- /dev/null
+++ b/favicons/favicon_lancaster_buckingham.png
Binary files differ
diff --git a/favicons/favicon_lancaster_clarence.png b/favicons/favicon_lancaster_clarence.png
new file mode 100644
index 0000000..4472e99
--- /dev/null
+++ b/favicons/favicon_lancaster_clarence.png
Binary files differ
diff --git a/favicons/favicon_lancaster_exeter.png b/favicons/favicon_lancaster_exeter.png
new file mode 100644
index 0000000..2b61cf2
--- /dev/null
+++ b/favicons/favicon_lancaster_exeter.png
Binary files differ
diff --git a/favicons/favicon_lancaster_henry_tudor.png b/favicons/favicon_lancaster_henry_tudor.png
new file mode 100644
index 0000000..63f46de
--- /dev/null
+++ b/favicons/favicon_lancaster_henry_tudor.png
Binary files differ
diff --git a/favicons/favicon_lancaster_henry_vi.png b/favicons/favicon_lancaster_henry_vi.png
new file mode 100644
index 0000000..d45f071
--- /dev/null
+++ b/favicons/favicon_lancaster_henry_vi.png
Binary files differ
diff --git a/favicons/favicon_lancaster_jasper_tudor.png b/favicons/favicon_lancaster_jasper_tudor.png
new file mode 100644
index 0000000..5d8e009
--- /dev/null
+++ b/favicons/favicon_lancaster_jasper_tudor.png
Binary files differ
diff --git a/favicons/favicon_lancaster_margaret.png b/favicons/favicon_lancaster_margaret.png
new file mode 100644
index 0000000..824c4b9
--- /dev/null
+++ b/favicons/favicon_lancaster_margaret.png
Binary files differ
diff --git a/favicons/favicon_lancaster_northumberland.png b/favicons/favicon_lancaster_northumberland.png
new file mode 100644
index 0000000..9036a3d
--- /dev/null
+++ b/favicons/favicon_lancaster_northumberland.png
Binary files differ
diff --git a/favicons/favicon_lancaster_oxford.png b/favicons/favicon_lancaster_oxford.png
new file mode 100644
index 0000000..4b443a6
--- /dev/null
+++ b/favicons/favicon_lancaster_oxford.png
Binary files differ
diff --git a/favicons/favicon_lancaster_somerset.png b/favicons/favicon_lancaster_somerset.png
new file mode 100644
index 0000000..a80de6d
--- /dev/null
+++ b/favicons/favicon_lancaster_somerset.png
Binary files differ
diff --git a/favicons/favicon_lancaster_warwick.png b/favicons/favicon_lancaster_warwick.png
new file mode 100644
index 0000000..510a79c
--- /dev/null
+++ b/favicons/favicon_lancaster_warwick.png
Binary files differ
diff --git a/favicons/favicon_march.png b/favicons/favicon_march.png
deleted file mode 100644
index c6225ad..0000000
--- a/favicons/favicon_march.png
+++ /dev/null
Binary files differ
diff --git a/favicons/favicon_margaret.png b/favicons/favicon_margaret.png
deleted file mode 100644
index 3d9bc1c..0000000
--- a/favicons/favicon_margaret.png
+++ /dev/null
Binary files differ
diff --git a/favicons/favicon_warwick.png b/favicons/favicon_warwick.png
deleted file mode 100644
index 1baf53c..0000000
--- a/favicons/favicon_warwick.png
+++ /dev/null
Binary files differ
diff --git a/favicons/favicon_york.png b/favicons/favicon_york.png
deleted file mode 100644
index 0ffb8be..0000000
--- a/favicons/favicon_york.png
+++ /dev/null
Binary files differ
diff --git a/favicons/favicon_york_devon.png b/favicons/favicon_york_devon.png
new file mode 100644
index 0000000..ca98895
--- /dev/null
+++ b/favicons/favicon_york_devon.png
Binary files differ
diff --git a/favicons/favicon_york_edward_iv.png b/favicons/favicon_york_edward_iv.png
new file mode 100644
index 0000000..fed5bf4
--- /dev/null
+++ b/favicons/favicon_york_edward_iv.png
Binary files differ
diff --git a/favicons/favicon_york_gloucester.png b/favicons/favicon_york_gloucester.png
new file mode 100644
index 0000000..3549afd
--- /dev/null
+++ b/favicons/favicon_york_gloucester.png
Binary files differ
diff --git a/favicons/favicon_york_march.png b/favicons/favicon_york_march.png
new file mode 100644
index 0000000..6c8cd48
--- /dev/null
+++ b/favicons/favicon_york_march.png
Binary files differ
diff --git a/favicons/favicon_york_norfolk.png b/favicons/favicon_york_norfolk.png
new file mode 100644
index 0000000..62d5713
--- /dev/null
+++ b/favicons/favicon_york_norfolk.png
Binary files differ
diff --git a/favicons/favicon_york_northumberland.png b/favicons/favicon_york_northumberland.png
new file mode 100644
index 0000000..47fcd05
--- /dev/null
+++ b/favicons/favicon_york_northumberland.png
Binary files differ
diff --git a/favicons/favicon_york_pembroke.png b/favicons/favicon_york_pembroke.png
new file mode 100644
index 0000000..9ada90c
--- /dev/null
+++ b/favicons/favicon_york_pembroke.png
Binary files differ
diff --git a/favicons/favicon_york_rutland.png b/favicons/favicon_york_rutland.png
new file mode 100644
index 0000000..a6b1fd9
--- /dev/null
+++ b/favicons/favicon_york_rutland.png
Binary files differ
diff --git a/favicons/favicon_york_salisbury.png b/favicons/favicon_york_salisbury.png
new file mode 100644
index 0000000..2646f6c
--- /dev/null
+++ b/favicons/favicon_york_salisbury.png
Binary files differ
diff --git a/favicons/favicon_york_warwick.png b/favicons/favicon_york_warwick.png
new file mode 100644
index 0000000..d533894
--- /dev/null
+++ b/favicons/favicon_york_warwick.png
Binary files differ
diff --git a/favicons/favicon_york_york.png b/favicons/favicon_york_york.png
new file mode 100644
index 0000000..6c69dc0
--- /dev/null
+++ b/favicons/favicon_york_york.png
Binary files differ
diff --git a/play.html b/play.html
index 74a33e8..b0a9b7c 100644
--- a/play.html
+++ b/play.html
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
<meta charset="utf-8">
<title>PLANTAGENET</title>
-<link id="favicon" rel="icon" href="favicons/favicon_warwick.png">
+<link id="favicon" rel="icon" href="favicons/favicon_france.png">
<link rel="stylesheet" href="/fonts/fonts.css">
<link rel="stylesheet" href="/common/client.css">
<link rel="stylesheet" href="cards.css">
diff --git a/play.js b/play.js
index 1190305..1a6194d 100644
--- a/play.js
+++ b/play.js
@@ -256,6 +256,45 @@ function is_lord_selected(ix) {
return false
}
+const SCENARIO_IA = 0
+const SCENARIO_IB = 1
+const SCENARIO_IC = 2
+const SCENARIO_II = 3
+const SCENARIO_III = 4
+
+const scenario_end_marker = [
+ 16,
+ 2,
+ 8,
+ 16,
+ 10,
+]
+
+function scenario_victory_threshold() {
+ let turn = view.turn >> 1
+ switch (view.scenario) {
+ case SCENARIO_IA:
+ if (turn <= 5)
+ return 40
+ if (turn <= 10)
+ return 35
+ return 30
+ case SCENARIO_IB:
+ return 100 // no threshold
+ case SCENARIO_IC:
+ return 25
+ case SCENARIO_II:
+ if (turn <= 5)
+ return 40
+ if (turn <= 10)
+ return 35
+ return 30
+ case SCENARIO_III:
+ return 45
+ }
+ return 45
+}
+
// === BUILD UI ===
function is_action(action, arg) {
@@ -1320,18 +1359,44 @@ function show_track_marker(elt, pos) {
elt.style.top = y + "px"
}
+function update_lancaster_favicon() {
+ switch (view.scenario) {
+ default:
+ case SCENARIO_IA: return "favicons/favicon_lancaster_henry_vi.png"
+ case SCENARIO_IB: return "favicons/favicon_lancaster_somerset.png"
+ case SCENARIO_IC: return "favicons/favicon_lancaster_henry_vi.png"
+ case SCENARIO_II: return "favicons/favicon_lancaster_margaret.png"
+ case SCENARIO_III: return "favicons/favicon_lancaster_henry_tudor.png"
+ }
+}
+
+function update_york_favicon() {
+ switch (view.scenario) {
+ default:
+ case SCENARIO_IA: return "favicons/favicon_york_york.png"
+ case SCENARIO_IB: return "favicons/favicon_york_warwick.png"
+ case SCENARIO_IC: return "favicons/favicon_york_march.png"
+ case SCENARIO_II: return "favicons/favicon_york_edward_iv.png"
+ case SCENARIO_III: return "favicons/favicon_york_gloucester.png"
+ }
+}
+
+function update_observer_favicon() {
+ return "favicons/favicon_france.png"
+}
+
function on_update() {
restart_cache()
switch (player) {
case "York":
- ui.favicon.href = "favicons/favicon_york.png"
+ ui.favicon.href = update_york_favicon()
break
case "Lancaster":
- ui.favicon.href = "favicons/favicon_henry_vi.png"
+ ui.favicon.href = update_lancaster_favicon()
break
default:
- ui.favicon.href = "favicons/favicon_warwick.png"
+ ui.favicon.href = update_observer_favicon()
break
}
@@ -1385,10 +1450,11 @@ function on_update() {
ui.turn.style.left = (CALENDAR_XY[view.turn >> 1][0] + 91 - 52) + "px"
ui.turn.style.top = (CALENDAR_XY[view.turn >> 1][1] + 94) + "px"
- if (view.end < 16) {
+ let end = scenario_end_marker[view.scenario]
+ if (end < 16) {
ui.end.style.display = null
- ui.end.style.left = (CALENDAR_XY[view.end][0] + 91 - 52) + "px"
- ui.end.style.top = (CALENDAR_XY[view.end][1] + 94) + "px"
+ ui.end.style.left = (CALENDAR_XY[end][0] + 91 - 52) + "px"
+ ui.end.style.top = (CALENDAR_XY[end][1] + 94) + "px"
} else {
ui.end.style.display = "none"
}
@@ -1396,9 +1462,10 @@ function on_update() {
ui.held_york.textContent = `${view.held_y} Held`
ui.held_lancaster.textContent = `${view.held_l} Held`
- if (view.victory_check <= 45) {
+ let vc = scenario_victory_threshold()
+ if (vc <= 45) {
ui.victory_check.style.display = null
- show_track_marker(ui.victory_check, view.victory_check)
+ show_track_marker(ui.victory_check, vc)
} else {
ui.victory_check.style.display = "none"
}
diff --git a/rules.ts b/rules.ts
index ef7bb29..8ca0bd1 100644
--- a/rules.ts
+++ b/rules.ts
@@ -271,9 +271,8 @@ interface View {
actions: any,
log: string[],
- end: number,
+ scenario: number,
turn: number,
- victory_check: number,
influence: number,
events: Card[],
@@ -10022,7 +10021,6 @@ function setup_ItoIII() {
set_flag(FLAG_REBEL_IS_YORK)
game.active = YORK
- game.victory_check = 45
game.influence = 0
muster_lord(LORD_YORK, LOC_ELY)
muster_lord(LORD_MARCH, LOC_LUDLOW)
@@ -10071,7 +10069,6 @@ function setup_II_Y() {
game.scenario = "IIY. The Kingmaker"
clear_flag(FLAG_REBEL_IS_YORK)
game.active = LANCASTER
- game.victory_check = 45
game.influence = 0
for (let lord of all_lords) {
@@ -10194,7 +10191,6 @@ function setup_II_L() {
game.scenario = "IIL. Lancastrian Legitimacy Fades"
set_flag(FLAG_REBEL_IS_YORK)
game.active = YORK
- game.victory_check = 40
game.influence = 0
for (let lord of all_lords) {
@@ -10323,7 +10319,6 @@ function setup_III_Y() {
game.scenario = "IIIY. New Rivals"
clear_flag(FLAG_REBEL_IS_YORK)
game.active = LANCASTER
- game.victory_check = 45
game.influence = 0
if (!is_lord_in_play(LORD_YORK)) {
@@ -10520,7 +10515,6 @@ function setup_III_L() {
game.scenario = "IIIL. Yorkists Last Stand"
set_flag(FLAG_REBEL_IS_YORK)
game.active = YORK
- game.victory_check = 45
game.influence = 0
if (!is_lord_in_play(LORD_YORK)) {
@@ -12912,9 +12906,8 @@ exports.view = function (state, current) {
log: game.log,
reveal: 0,
- end: scenario_end_marker[game.scenario],
+ scenario: game.scenario,
turn: game.turn,
- victory_check: scenario_victory_threshold(),
influence: game.influence,
events: game.events,