diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-05 15:01:22 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-05 15:07:16 +0200 |
commit | f4fcc3f927412c4a89b032a99db07019a9b63749 (patch) | |
tree | 7f3dc3c9b302a1f5f7abd9db1361719b71d781a5 | |
parent | 67605eed1194e81699268eb8b60d6cf9682b5a38 (diff) | |
download | plantagenet-f4fcc3f927412c4a89b032a99db07019a9b63749.tar.gz |
favicons
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 Binary files differdeleted file mode 100644 index 3d7b22c..0000000 --- a/favicons/favicon_henry_vi.png +++ /dev/null diff --git a/favicons/favicon_lancaster_buckingham.png b/favicons/favicon_lancaster_buckingham.png Binary files differnew file mode 100644 index 0000000..0d7bc82 --- /dev/null +++ b/favicons/favicon_lancaster_buckingham.png diff --git a/favicons/favicon_lancaster_clarence.png b/favicons/favicon_lancaster_clarence.png Binary files differnew file mode 100644 index 0000000..4472e99 --- /dev/null +++ b/favicons/favicon_lancaster_clarence.png diff --git a/favicons/favicon_lancaster_exeter.png b/favicons/favicon_lancaster_exeter.png Binary files differnew file mode 100644 index 0000000..2b61cf2 --- /dev/null +++ b/favicons/favicon_lancaster_exeter.png diff --git a/favicons/favicon_lancaster_henry_tudor.png b/favicons/favicon_lancaster_henry_tudor.png Binary files differnew file mode 100644 index 0000000..63f46de --- /dev/null +++ b/favicons/favicon_lancaster_henry_tudor.png diff --git a/favicons/favicon_lancaster_henry_vi.png b/favicons/favicon_lancaster_henry_vi.png Binary files differnew file mode 100644 index 0000000..d45f071 --- /dev/null +++ b/favicons/favicon_lancaster_henry_vi.png diff --git a/favicons/favicon_lancaster_jasper_tudor.png b/favicons/favicon_lancaster_jasper_tudor.png Binary files differnew file mode 100644 index 0000000..5d8e009 --- /dev/null +++ b/favicons/favicon_lancaster_jasper_tudor.png diff --git a/favicons/favicon_lancaster_margaret.png b/favicons/favicon_lancaster_margaret.png Binary files differnew file mode 100644 index 0000000..824c4b9 --- /dev/null +++ b/favicons/favicon_lancaster_margaret.png diff --git a/favicons/favicon_lancaster_northumberland.png b/favicons/favicon_lancaster_northumberland.png Binary files differnew file mode 100644 index 0000000..9036a3d --- /dev/null +++ b/favicons/favicon_lancaster_northumberland.png diff --git a/favicons/favicon_lancaster_oxford.png b/favicons/favicon_lancaster_oxford.png Binary files differnew file mode 100644 index 0000000..4b443a6 --- /dev/null +++ b/favicons/favicon_lancaster_oxford.png diff --git a/favicons/favicon_lancaster_somerset.png b/favicons/favicon_lancaster_somerset.png Binary files differnew file mode 100644 index 0000000..a80de6d --- /dev/null +++ b/favicons/favicon_lancaster_somerset.png diff --git a/favicons/favicon_lancaster_warwick.png b/favicons/favicon_lancaster_warwick.png Binary files differnew file mode 100644 index 0000000..510a79c --- /dev/null +++ b/favicons/favicon_lancaster_warwick.png diff --git a/favicons/favicon_march.png b/favicons/favicon_march.png Binary files differdeleted file mode 100644 index c6225ad..0000000 --- a/favicons/favicon_march.png +++ /dev/null diff --git a/favicons/favicon_margaret.png b/favicons/favicon_margaret.png Binary files differdeleted file mode 100644 index 3d9bc1c..0000000 --- a/favicons/favicon_margaret.png +++ /dev/null diff --git a/favicons/favicon_warwick.png b/favicons/favicon_warwick.png Binary files differdeleted file mode 100644 index 1baf53c..0000000 --- a/favicons/favicon_warwick.png +++ /dev/null diff --git a/favicons/favicon_york.png b/favicons/favicon_york.png Binary files differdeleted file mode 100644 index 0ffb8be..0000000 --- a/favicons/favicon_york.png +++ /dev/null diff --git a/favicons/favicon_york_devon.png b/favicons/favicon_york_devon.png Binary files differnew file mode 100644 index 0000000..ca98895 --- /dev/null +++ b/favicons/favicon_york_devon.png diff --git a/favicons/favicon_york_edward_iv.png b/favicons/favicon_york_edward_iv.png Binary files differnew file mode 100644 index 0000000..fed5bf4 --- /dev/null +++ b/favicons/favicon_york_edward_iv.png diff --git a/favicons/favicon_york_gloucester.png b/favicons/favicon_york_gloucester.png Binary files differnew file mode 100644 index 0000000..3549afd --- /dev/null +++ b/favicons/favicon_york_gloucester.png diff --git a/favicons/favicon_york_march.png b/favicons/favicon_york_march.png Binary files differnew file mode 100644 index 0000000..6c8cd48 --- /dev/null +++ b/favicons/favicon_york_march.png diff --git a/favicons/favicon_york_norfolk.png b/favicons/favicon_york_norfolk.png Binary files differnew file mode 100644 index 0000000..62d5713 --- /dev/null +++ b/favicons/favicon_york_norfolk.png diff --git a/favicons/favicon_york_northumberland.png b/favicons/favicon_york_northumberland.png Binary files differnew file mode 100644 index 0000000..47fcd05 --- /dev/null +++ b/favicons/favicon_york_northumberland.png diff --git a/favicons/favicon_york_pembroke.png b/favicons/favicon_york_pembroke.png Binary files differnew file mode 100644 index 0000000..9ada90c --- /dev/null +++ b/favicons/favicon_york_pembroke.png diff --git a/favicons/favicon_york_rutland.png b/favicons/favicon_york_rutland.png Binary files differnew file mode 100644 index 0000000..a6b1fd9 --- /dev/null +++ b/favicons/favicon_york_rutland.png diff --git a/favicons/favicon_york_salisbury.png b/favicons/favicon_york_salisbury.png Binary files differnew file mode 100644 index 0000000..2646f6c --- /dev/null +++ b/favicons/favicon_york_salisbury.png diff --git a/favicons/favicon_york_warwick.png b/favicons/favicon_york_warwick.png Binary files differnew file mode 100644 index 0000000..d533894 --- /dev/null +++ b/favicons/favicon_york_warwick.png diff --git a/favicons/favicon_york_york.png b/favicons/favicon_york_york.png Binary files differnew file mode 100644 index 0000000..6c69dc0 --- /dev/null +++ b/favicons/favicon_york_york.png @@ -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"> @@ -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" } @@ -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, |