diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-01 19:16:50 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-01 19:16:50 -0400 |
commit | 03ebc48b354f2509c2a37dd5ed6a9ed10db6e2e8 (patch) | |
tree | 1daab28161f0115fe58d74f6e8b04856d3c48998 | |
parent | 938716cb1ff0353c027b7ff5ec9165c2742e919d (diff) | |
download | vijayanagara-03ebc48b354f2509c2a37dd5ed6a9ed10db6e2e8.tar.gz |
RFoP style influence
-rw-r--r-- | const.js | 7 | ||||
-rw-r--r-- | play.css | 2 | ||||
-rw-r--r-- | play.js | 12 | ||||
-rw-r--r-- | rules.js | 5 |
4 files changed, 21 insertions, 5 deletions
@@ -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 @@ -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; } @@ -1363,17 +1363,21 @@ function sub_space(match, p1) { return `<span class="tip" onmouseenter="on_focus_space_tip(${x})" onmouseleave="on_blur_space_tip(${x})" onmousedown="on_click_space_tip(${x})">${n}</span>` } -const E_DS = '<img class="c" src="pieces/ds_governor.svg">' -const E_BK = '<img class="c" src="pieces/bk_amir.svg">' -const E_VE = '<img class="c" src="pieces/ve_raja.svg">' +const E_DS = '<img class="h" src="pieces/ds_governor.svg">' +const E_BK = '<img class="h" src="pieces/bk_amir.svg">' +const E_VE = '<img class="h" src="pieces/ve_raja.svg">' const C_DS = '<img class="c" src="pieces/ds_troop.svg">' const C_MI = '<img class="c" src="pieces/mongol_invader.svg">' + const F_DS = '<img class="f" src="images/Flags_DS.png">' const F_BK = '<img class="f" src="images/Flags_BK.png">' const F_VE = '<img class="f" src="images/Flags_VE.png">' const F_MI = '<img class="f" src="images/Flags_MI.png">' +const I_BK = '<img class="i" src="images/Influence_BK.png">' +const I_VE = '<img class="i" src="images/Influence_VE.png">' + 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) @@ -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 |