From dbad03467fce3103ae0e05b345434a61860a9db8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 12 Apr 2025 14:39:15 +0200 Subject: More icons. --- events.txt | 2 +- icons/Cavalry.png | Bin 0 -> 2019 bytes icons/Flags_BK.png | Bin 0 -> 2182 bytes icons/Flags_DS.png | Bin 0 -> 1717 bytes icons/Flags_MI.png | Bin 0 -> 1398 bytes icons/Flags_VE.png | Bin 0 -> 2165 bytes icons/Influence_BK.png | Bin 0 -> 1119 bytes icons/Influence_VE.png | Bin 0 -> 1417 bytes icons/Resources.png | Bin 0 -> 2164 bytes images/Flags_MI.png | Bin 10278 -> 5375 bytes play.css | 6 ++-- play.js | 17 ++++++---- rules.js | 65 ++++++++++++++++++++------------------- tools/gencode.js | 1 - tools/log_icons/Cavalry.png | Bin 0 -> 9800 bytes tools/log_icons/Flags_BK.png | Bin 0 -> 7582 bytes tools/log_icons/Flags_DS.png | Bin 0 -> 7673 bytes tools/log_icons/Flags_MI.png | Bin 0 -> 5375 bytes tools/log_icons/Flags_VE.png | Bin 0 -> 8995 bytes tools/log_icons/Influence_BK.png | Bin 0 -> 4618 bytes tools/log_icons/Influence_VE.png | Bin 0 -> 6109 bytes tools/log_icons/Resources.png | Bin 0 -> 7044 bytes 22 files changed, 49 insertions(+), 42 deletions(-) create mode 100644 icons/Cavalry.png create mode 100644 icons/Flags_BK.png create mode 100644 icons/Flags_DS.png create mode 100644 icons/Flags_MI.png create mode 100644 icons/Flags_VE.png create mode 100644 icons/Influence_BK.png create mode 100644 icons/Influence_VE.png create mode 100644 icons/Resources.png create mode 100644 tools/log_icons/Cavalry.png create mode 100644 tools/log_icons/Flags_BK.png create mode 100644 tools/log_icons/Flags_DS.png create mode 100644 tools/log_icons/Flags_MI.png create mode 100644 tools/log_icons/Flags_VE.png create mode 100644 tools/log_icons/Influence_BK.png create mode 100644 tools/log_icons/Influence_VE.png create mode 100644 tools/log_icons/Resources.png diff --git a/events.txt b/events.txt index 127cbf7..716f67f 100644 --- a/events.txt +++ b/events.txt @@ -799,7 +799,7 @@ SHADED 36 SUCC 0 force_current DS - loge "Power struggle in Delhi." + log_succ DS "Power struggle in Delhi." flip_dynasty log_succ DS "The Sultanate reimposes its dominance." campaign diff --git a/icons/Cavalry.png b/icons/Cavalry.png new file mode 100644 index 0000000..cf891d7 Binary files /dev/null and b/icons/Cavalry.png differ diff --git a/icons/Flags_BK.png b/icons/Flags_BK.png new file mode 100644 index 0000000..16f5c55 Binary files /dev/null and b/icons/Flags_BK.png differ diff --git a/icons/Flags_DS.png b/icons/Flags_DS.png new file mode 100644 index 0000000..561dadb Binary files /dev/null and b/icons/Flags_DS.png differ diff --git a/icons/Flags_MI.png b/icons/Flags_MI.png new file mode 100644 index 0000000..259b2bb Binary files /dev/null and b/icons/Flags_MI.png differ diff --git a/icons/Flags_VE.png b/icons/Flags_VE.png new file mode 100644 index 0000000..43a4c07 Binary files /dev/null and b/icons/Flags_VE.png differ diff --git a/icons/Influence_BK.png b/icons/Influence_BK.png new file mode 100644 index 0000000..88c2d52 Binary files /dev/null and b/icons/Influence_BK.png differ diff --git a/icons/Influence_VE.png b/icons/Influence_VE.png new file mode 100644 index 0000000..dfd6369 Binary files /dev/null and b/icons/Influence_VE.png differ diff --git a/icons/Resources.png b/icons/Resources.png new file mode 100644 index 0000000..7d9f0ae Binary files /dev/null and b/icons/Resources.png differ diff --git a/images/Flags_MI.png b/images/Flags_MI.png index f9d2eb0..89e66f1 100644 Binary files a/images/Flags_MI.png and b/images/Flags_MI.png differ diff --git a/play.css b/play.css index e48465f..77745f0 100644 --- a/play.css +++ b/play.css @@ -183,9 +183,11 @@ img.f { #log img.d { height: 15px; vertical-align: -4px; margin: 0px 1px; } #log img.c { height: 15px; vertical-align: -3px; margin: 0px 1px;} -#log img.f { height: 16px; vertical-align: -2px; } #log img.h { height: 17px; vertical-align: -2px; margin: -1px 2px; } -#log img.i { height: 34px; vertical-align: -3px; margin: -10px; } + +#log img.f { height: 16px; vertical-align: -3px; } +#log img.i { height: 14px; vertical-align: -3px; } +#log img.m { height: 16px; vertical-align: -3px; } #log .adice { font-size: 14px; diff --git a/play.js b/play.js index 3b28218..6ceac1b 100644 --- a/play.js +++ b/play.js @@ -1387,12 +1387,15 @@ const ICONS = { CDS: '', CMI: '', - FDS: '', - FBK: '', - FVE: '', - FMI: '', - IBK: '', - IVE: '', + FDS: '', + FBK: '', + FVE: '', + FMI: '', + IBK: '', + IVE: '', + + CAV: '', + RES: '', A1: '\u2776', A2: '\u2777', @@ -1447,6 +1450,8 @@ function on_log(text) { text = text.replace(/\bFMI\b/g, sub_icon) text = text.replace(/\bIBK\b/g, sub_icon) text = text.replace(/\bIVE\b/g, sub_icon) + text = text.replace(/\bCAV\b/g, sub_icon) + text = text.replace(/\bRES\b/g, sub_icon) text = text.replace(/\b[AD][1-6]\b/g, sub_icon) diff --git a/rules.js b/rules.js index 43d07b7..87a7fb6 100644 --- a/rules.js +++ b/rules.js @@ -522,7 +522,7 @@ function goto_cavalry(n, next) { } push_summary() game.state = "cavalry" - // Removing automatic cavalry tokens attribution + // Removing automatic cavalry attribution // while (game.cav.n > 0 && n_available_cavalry() > 0) { // let c = find_cavalry(AVAILABLE) // log_summary_cavalry(c) @@ -753,7 +753,7 @@ states.main_phase = { } states.cavalry = { - inactive: "Gain Cavalry tokens", + inactive: "Gain Cavalry", prompt() { if (game.cav.n > 0) { view.prompt = `Gain Cavalry: Take ${game.cav.n} Cavalry token${game.cav.n > 1 ? "s" : ""}.` @@ -761,7 +761,7 @@ states.cavalry = { if (can_take) view.prompt = `Gain Cavalry: Take ${game.cav.n} Cavalry token${game.cav.n > 1 ? "s" : ""}.` else { - view.prompt = "Gain Cavalry: No more Cavalry tokens available." + view.prompt = "Gain Cavalry: No more Cavalry available." view.actions.end_cavalry = 1 } } else { @@ -783,7 +783,7 @@ states.cavalry = { states.compromising_gifts = { inactive: "Compromising Gifts", prompt() { - view.prompt = "Compromising Gifts: Reduce your Influence by one to gain two Resources and two Cavalry tokens." + view.prompt = "Compromising Gifts: Reduce your Influence by one to gain two Resources and two Cavalry." gen_action_influence(game.current) view.actions.end_gifts = 1 @@ -1403,12 +1403,12 @@ function goto_attack_cavalry(curr) { ) if (d_hit !== -1) { - log(`${faction_flags[curr]} used Cavalry.`) + log(`${faction_flags[curr]} used CAV`) attack_use_cavalry(d_hit + (curr === game.cmd.attacker ? 0 : 4), MI) } else { let d_hit2 = dices.findIndex(d => d === 2) if (d_hit2 !== -1 && curr === game.cmd.attacker) { - log(`${faction_flags[curr]} used Cavalry.`) + log(`${faction_flags[curr]} used CAV`) attack_use_cavalry(d_hit2 + (curr === game.cmd.attacker ? 0 : 4), MI) } } @@ -1437,7 +1437,7 @@ states.attack_cavalry = { push_undo() if (!game.cmd.cavalry) { log_br() - log(`${faction_flags[game.current]} used Cavalry.`) + log(`${faction_flags[game.current]} used CAV`) game.cmd.cavalry = true } attack_use_cavalry(d, game.current) @@ -3719,7 +3719,7 @@ function action_ask_cavalry() { states.ask_cavalry = { disable_negotiation: true, prompt() { - view.prompt = "Negotiate: Ask another faction for Cavalry tokens?" + view.prompt = "Negotiate: Ask another faction for Cavalry?" if (!is_player_ds() && n_cavalry(DS) > 0) { gen_action_faction_cavalry(DS) gen_action_faction(DS) @@ -3745,10 +3745,10 @@ states.ask_cavalry = { } states.give_cavalry = { - inactive: "Transfer Cavalry tokens", + inactive: "Transfer Cavalry", disable_negotiation: true, prompt() { - view.prompt = `Negotiate: ${faction_name[game.transfer.current]} asked for Cavalry tokens.` + view.prompt = `Negotiate: ${faction_name[game.transfer.current]} asked for Cavalry.` if (n_cavalry(game.current) >= 1) gen_action_faction_cavalry(game.current) if (game.transfer.count > 0) { @@ -3788,7 +3788,7 @@ function action_transfer_cavalry() { states.transfer_cavalry = { disable_negotiation: true, prompt() { - view.prompt = "Transfer Cavalry tokens to another faction." + view.prompt = "Transfer Cavalry to another faction." if (n_cavalry(game.current) >= 1) { if (!is_player_ds()) gen_action_faction(DS) @@ -3911,16 +3911,16 @@ function log_action(msg) { function log_transfer(msg) { log_br() - log(".n " + msg) + log(".i " + msg) log_br() } function log_transfer_resources(from, to, n) { - log_transfer(`${faction_short[from]} gave ${n} Resources to ${faction_short[to]}.`) + log_transfer(`${faction_short[from]} gave ${n} RES to ${faction_short[to]}.`) } function log_transfer_cavalry(from, to, n) { - log_transfer(`${faction_short[from]} gave ${n} Cavalry tokens to ${faction_short[to]}.`) + log_transfer(`${faction_short[from]} gave ${n} CAV to ${faction_short[to]}.`) } function log_space(s, action) { @@ -4006,27 +4006,27 @@ function log_summary_remove_from(p) { function log_summary_cavalry(c) { let from = game.cavalry[c] if (from !== AVAILABLE) - log_summary(faction_flags[game.current] + " +% Cavalry from " + faction_flags[from] + ".") + log_summary(faction_flags[game.current] + " +% CAV from " + faction_flags[from] + ".") else - log_summary(faction_flags[game.current] + " +% Cavalry from supply.") + log_summary(faction_flags[game.current] + " +% CAV from supply.") } function log_summary_resources(faction) { - log_summary(faction_flags[faction] + " +% Resources.") + log_summary(faction_flags[faction] + " +% RES") } function logi_resources(faction, n) { if (n > 0) - logi(faction_flags[faction] + " +" + n + " Resources.") + logi(faction_flags[faction] + " +" + n + " RES") else - logi(faction_flags[faction] + " " + n + " Resources." ) + logi(faction_flags[faction] + " " + n + " RES" ) } function log_resources(faction, n) { if (n > 0) - log(faction_flags[faction] + " +" + n + " Resources.") + log(faction_flags[faction] + " +" + n + " RES") else - log(faction_flags[faction] + " " + n + " Resources.") + log(faction_flags[faction] + " " + n + " RES") } function format_unit_count(faction, type, n) { @@ -4676,6 +4676,7 @@ function vm_log_br() { function vm_log_succ() { log_h2(faction_short[vm_operand(1)]) log(".i " + vm_operand(2)) + log_br() vm_next() } @@ -5150,7 +5151,7 @@ function vm_spend_cavalry() { for (let i = 0; i < n; ++i) { game.cavalry[find_cavalry(game.current)] = AVAILABLE } - log(`${faction_flags[game.current]} spent ${n} Cavalry token.`) + log(`${faction_flags[game.current]} spent ${n} CAV`) vm_next() } @@ -5230,7 +5231,7 @@ states.vm_steal = { let n = Math.min(vm_operand(3), game.resources[f]) add_resources(game.current, n) add_resources(f, -n) - log(`${faction_flags[game.current]} stole ${n} Resources from ${faction_flags[f]}.`) + log(`${faction_flags[game.current]} stole ${n} RES from ${faction_flags[f]}.`) vm_next() }, skip() { @@ -5250,7 +5251,7 @@ function vm_cav_resources() { states.vm_cav_resources = { prompt() { if (game.vm.count === 0) { - event_prompt("No Cavalry token nor Resource to gain.") + event_prompt("No Cavalry nor Resources to gain.") view.actions.skip = 1 } else { event_prompt(`Gain ${game.vm.count} Resource${game.vm.count > 1 ? "s": ""} or Cavalry token${game.vm.count > 1 ? "s": ""}.`) @@ -5294,7 +5295,7 @@ states.vm_steal_cavalry = { let f2 = vm_operand(2) let n = Math.min(vm_operand(3), n_cavalry(f2)) if (n == 0) { - event_prompt(`${faction_name[f2]} has no Cavalry tokens.`) + event_prompt(`${faction_name[f2]} has no Cavalry.`) view.actions.skip = 1 } else { event_prompt(`Steal ${n} Cavalry token from ${faction_name[f2]}.`) @@ -5308,7 +5309,7 @@ states.vm_steal_cavalry = { c = find_cavalry(f2) set_cavalry_faction(c, game.current) } - log(`${faction_flags[game.current]} stole ${n} Cavalry token from ${faction_flags[f2]}.`) + log(`${faction_flags[game.current]} stole ${n} CAV from ${faction_flags[f2]}.`) vm_next() }, skip() { @@ -5491,7 +5492,7 @@ states.vm_flip_dynasty = { }, dynasty_card() { game.succ += 1 - log("Dawn of the Tughlaq Dynasty, Rebel Commands are now available.") + log("Rebel Commands are now available.") vm_next() } } @@ -5779,7 +5780,7 @@ states.shaded_6_2 = { let n = Math.min(game.resources[f], 3) add_resources(f, -n) add_resources(DS, n) - log(`${faction_flags[game.current]} stole ${n} Resources from ${faction_flags[f]}.`) + log(`${faction_flags[game.current]} stole ${n} RES from ${faction_flags[f]}.`) vm_next() } } @@ -5863,7 +5864,7 @@ states.shaded_29 = { }, next() { if (game.cmd.count < 3) { - log(`${faction_flags[game.current]} spent ${3-game.cmd.count} Resources.`) + log(`${faction_flags[game.current]} spent ${3-game.cmd.count} RES`) upop_summary() } else { game.summary = null @@ -6937,17 +6938,17 @@ CODE[36 * 2 + 1] = [ // SUCC 0 CODE[0 * 2 + 74] = [ [ vm_force_current, DS ], - [ vm_log, ".i Power struggle in Delhi." ], + [ vm_log_succ, DS, "Power struggle in Delhi." ], [ vm_flip_dynasty ], [ vm_log_succ, DS, "The Sultanate reimposes its dominance." ], [ vm_campaign ], [ vm_force_current, BK ], - [ vm_prompt, "Gain Cavalry tokens equal to Influence and Forts." ], + [ vm_prompt, "Gain Cavalry equal to Influence and Forts." ], [ vm_log_succ, BK, "Military labor market thrives." ], [ vm_gain_cavalry, ()=>(game.inf[BK] + count_pieces_on_map(BK, DISC)) ], [ vm_force_current, VE ], [ vm_prompt, "Gain resources equal to Influence and Temples." ], - [ vm_log_succ, VE, "Temple towns emerge anew" ], + [ vm_log_succ, VE, "Temple towns emerge anew." ], [ vm_resources, false, VE, ()=>(game.inf[VE] + count_pieces_on_map(VE, DISC)) ], [ vm_return ], ] diff --git a/tools/gencode.js b/tools/gencode.js index 70ef3c2..427fec6 100644 --- a/tools/gencode.js +++ b/tools/gencode.js @@ -143,7 +143,6 @@ for (let line of fs.readFileSync("events.txt", "utf-8").split("\n")) { break case "log": - case "loge": case "prompt": emit([ line[0], line.slice(1).join(" ") ]) break diff --git a/tools/log_icons/Cavalry.png b/tools/log_icons/Cavalry.png new file mode 100644 index 0000000..83ab64c Binary files /dev/null and b/tools/log_icons/Cavalry.png differ diff --git a/tools/log_icons/Flags_BK.png b/tools/log_icons/Flags_BK.png new file mode 100644 index 0000000..e1132c8 Binary files /dev/null and b/tools/log_icons/Flags_BK.png differ diff --git a/tools/log_icons/Flags_DS.png b/tools/log_icons/Flags_DS.png new file mode 100644 index 0000000..4d1173d Binary files /dev/null and b/tools/log_icons/Flags_DS.png differ diff --git a/tools/log_icons/Flags_MI.png b/tools/log_icons/Flags_MI.png new file mode 100644 index 0000000..89e66f1 Binary files /dev/null and b/tools/log_icons/Flags_MI.png differ diff --git a/tools/log_icons/Flags_VE.png b/tools/log_icons/Flags_VE.png new file mode 100644 index 0000000..e94ec29 Binary files /dev/null and b/tools/log_icons/Flags_VE.png differ diff --git a/tools/log_icons/Influence_BK.png b/tools/log_icons/Influence_BK.png new file mode 100644 index 0000000..679e9c0 Binary files /dev/null and b/tools/log_icons/Influence_BK.png differ diff --git a/tools/log_icons/Influence_VE.png b/tools/log_icons/Influence_VE.png new file mode 100644 index 0000000..3a11212 Binary files /dev/null and b/tools/log_icons/Influence_VE.png differ diff --git a/tools/log_icons/Resources.png b/tools/log_icons/Resources.png new file mode 100644 index 0000000..2a0393a Binary files /dev/null and b/tools/log_icons/Resources.png differ -- cgit v1.2.3