From 03ebc48b354f2509c2a37dd5ed6a9ed10db6e2e8 Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Tue, 1 Apr 2025 19:16:50 -0400 Subject: RFoP style influence --- const.js | 7 +++++++ play.css | 2 ++ play.js | 12 +++++++++--- rules.js | 5 +++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/const.js b/const.js index a464d64..9f0dd5f 100644 --- a/const.js +++ b/const.js @@ -29,7 +29,14 @@ const PIECE_FACTION_TYPE_NAME = [ [ "Temple", "Raja", null ], [ null, null, "Invader" ] ] +const PIECE_FACTION_TYPE_SYMBOL = [ + [ null, "EDS", "CDS" ], + [ null, "EBK", null ], + [ null, "EVE", null ], + [ null, null, "CMI" ] +] const LAST_CAVALRY = 9 +const INF_TOKEN = [null, "IBK", "IVE"] // Sequence of Play options const ELIGIBLE = 0 diff --git a/play.css b/play.css index 19625de..b2df5fc 100644 --- a/play.css +++ b/play.css @@ -167,6 +167,8 @@ img.f { #log img.c { height: 15px; vertical-align: -3px } #log img.f { height: 16px; vertical-align: -2px } +#log img.h { height: 16px; vertical-align: -2px } +#log img.i { height: 34px; vertical-align: -3px; margin: -10px; } #log { font-variant-numeric: tabular-nums; } #log .italic { font-style: italic; } diff --git a/play.js b/play.js index 1568708..71b70d2 100644 --- a/play.js +++ b/play.js @@ -1363,17 +1363,21 @@ function sub_space(match, p1) { return `${n}` } -const E_DS = '' -const E_BK = '' -const E_VE = '' +const E_DS = '' +const E_BK = '' +const E_VE = '' const C_DS = '' const C_MI = '' + const F_DS = '' const F_BK = '' const F_VE = '' const F_MI = '' +const I_BK = '' +const I_VE = '' + function on_log(text) { let p = document.createElement("div") let sub_text = "" @@ -1396,6 +1400,8 @@ function on_log(text) { text = text.replace(/\bFBK\b/g, F_BK) text = text.replace(/\bFVE\b/g, F_VE) text = text.replace(/\bFMI\b/g, F_MI) + text = text.replace(/\bIBK\b/g, I_BK) + text = text.replace(/\bIVE\b/g, I_VE) if (text.match(/^\.h1 Mongol Invaders/)) { text = text.substring(19) diff --git a/rules.js b/rules.js index 44b3403..b51d206 100644 --- a/rules.js +++ b/rules.js @@ -3223,7 +3223,7 @@ function add_influence(faction) { return game.inf[faction]++ - log(faction_flags[faction] + " gained Influence.") + log(`Increased ${INF_TOKEN[faction]} to ${game.inf[faction]}.`) update_vp() if (faction === BK && game.inf[faction] === 2) @@ -3239,7 +3239,7 @@ function remove_influence(faction) { end_influence() } else { game.inf[faction]-- - log(faction_flags[faction] + " lost Influence.") + log(`Decreased ${INF_TOKEN[faction]} to ${game.inf[faction]}.`) update_vp() if (faction === BK && game.inf[faction] === 3) @@ -5718,6 +5718,7 @@ const PIECE_FACTION_TYPE_SYMBOL = [ [ null, null, "CMI" ] ] const LAST_CAVALRY = 9 +const INF_TOKEN = [null, "IBK", "IVE"] // Sequence of Play options const ELIGIBLE = 0 -- cgit v1.2.3