From 79bad8cdc623f9277507361e95f00bf60e1c229d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 17 May 2024 14:27:54 +0200 Subject: america/britain --- play.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 04ce045..5d649a1 100644 --- a/play.js +++ b/play.js @@ -19,8 +19,8 @@ const BOXES = data.BOXES const CONTINENTAL_CONGRESS_DISPERSED = data.space_index["Continental Congress Dispersed"] const BLOCKADE_ZONES = [ "Sea1", "Sea2", "Sea3", "Sea4", "Sea5", "Sea6", "Sea7" ] -const BRITISH = "British" -const AMERICAN = "American" +const P_BRITAIN = "Britain" +const P_AMERICA = "America" const space_count = 66 const general_count = data.generals.length @@ -370,7 +370,7 @@ build_map() function player_info(player, nc, nq) { let info = "" - if (player == AMERICAN) { + if (player == P_AMERICA) { if (view.pennsylvania_and_new_jersey_line_mutinies || view.congress === CONTINENTAL_CONGRESS_DISPERSED) info += "\u{1f6ab} " } @@ -383,8 +383,8 @@ function player_info(player, nc, nq) { function on_update() { let e - roles.American.stat.textContent = player_info(AMERICAN, view.a_cards, view.a_queue) - roles.British.stat.textContent = player_info(BRITISH, view.b_cards, view.b_queue) + roles.America.stat.textContent = player_info(P_AMERICA, view.a_cards, view.a_queue) + roles.Britain.stat.textContent = player_info(P_BRITAIN, view.b_cards, view.b_queue) if (!view.last_played) document.getElementById("last_played").className = "card show card_back" @@ -397,8 +397,8 @@ function on_update() { action_button("drop_british_cu", "Drop off British CU") action_button("drop_american_cu", "Drop off American CU") action_button("drop_french_cu", "Drop off French CU") - action_button("british_first", "British") - action_button("american_first", "American") + action_button("britain_first", "Britain") + action_button("america_first", "America") action_button("surrender", "Surrender") action_button("pass", "Next") action_button("undo", "Undo") @@ -416,21 +416,22 @@ function on_update() { e.classList.remove("ops_1") e.classList.remove("ops_2") e.classList.remove("ops_3") - e.classList.add("ops_" + view.played_british_reinforcements) + if (view.reinforcements[0] > 0) + e.classList.add("ops_" + CARDS[view.reinforcements[0]].count) e = document.getElementById("played_american_reinforcements_1") e.classList.remove("ops_1") e.classList.remove("ops_2") e.classList.remove("ops_3") - if (view.played_american_reinforcements.length >= 1) - e.classList.add("ops_" + view.played_american_reinforcements[0]) + if (view.reinforcements[1] > 0) + e.classList.add("ops_" + CARDS[view.reinforcements[1]].count) e = document.getElementById("played_american_reinforcements_2") e.classList.remove("ops_1") e.classList.remove("ops_2") e.classList.remove("ops_3") - if (view.played_american_reinforcements.length >= 2) - e.classList.add("ops_" + view.played_american_reinforcements[1]) + if (view.reinforcements[2] > 0) + e.classList.add("ops_" + CARDS[view.reinforcements[2]].count) let cards = view.hand for (let c = 1; c <= 110; ++c) { -- cgit v1.2.3