diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-02-26 12:53:01 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-05-03 18:48:15 +0200 |
commit | 9486ef27037835a6e31eac843b04219eda4c919c (patch) | |
tree | d9d8b0321ff644da439be88154ee42e537775a81 | |
parent | bbb9a7bd3686f5a16e661a2a3e8e8c94f8e2bfe2 (diff) | |
download | andean-abyss-9486ef27037835a6e31eac843b04219eda4c919c.tar.gz |
Combined roles.
-rw-r--r-- | play.css | 4 | ||||
-rw-r--r-- | play.html | 23 | ||||
-rw-r--r-- | play.js | 18 | ||||
-rw-r--r-- | rules.js | 3 |
4 files changed, 43 insertions, 5 deletions
@@ -5,6 +5,10 @@ main { background-color: #777; } #role_Cartels, header.cartels.your_turn { background-color: darkseagreen; } #role_FARC, header.farc.your_turn { background-color: lightcoral; } +#role_Government_\+_AUC { background-image: linear-gradient(135deg, skyblue 30%, khaki 70%) } +#role_FARC_\+_Cartels { background-image: linear-gradient(135deg, lightcoral 30%, darkseagreen 70%) } +#role_AUC_\+_Cartels { background-image: linear-gradient(135deg, khaki 30%, darkseagreen 70%) } + #log { background-color: whitesmoke; } #log > div { padding-left: 20px; text-indent: -12px; } #log .h1 { background-color: silver; font-weight: bold; padding-top:4px; padding-bottom:4px; } @@ -44,22 +44,37 @@ <aside> <div id="roles"> - <div class="role" id="role_Government"> + <div class="role hide" id="role_Government"> <div class="role_name"><span>Government</span> <div class="role_user">-</div> </div> </div> - <div class="role" id="role_FARC"> + <div class="role hide" id="role_Government_+_AUC"> + <div class="role_name"><span>Government + AUC</span> + <div class="role_user">-</div> + </div> + </div> + <div class="role hide" id="role_FARC"> <div class="role_name"><span>FARC</span> <div class="role_user">-</div> </div> </div> - <div class="role" id="role_AUC"> + <div class="role hide" id="role_FARC_+_Cartels"> + <div class="role_name"><span>FARC + Cartels</span> + <div class="role_user">-</div> + </div> + </div> + <div class="role hide" id="role_AUC"> <div class="role_name"><span>AUC</span> <div class="role_user">-</div> </div> </div> - <div class="role" id="role_Cartels"> + <div class="role hide" id="role_AUC_+_Cartels"> + <div class="role_name"><span>AUC + Cartels</span> + <div class="role_user">-</div> + </div> + </div> + <div class="role hide" id="role_Cartels"> <div class="role_name"><span>Cartels</span> <div class="role_user">-</div> </div> @@ -7,6 +7,10 @@ const FARC = 1 const AUC = 2 const CARTELS = 3 +const GOVT_AUC = 4 +const FARC_CARTELS = 5 +const AUC_CARTELS = 6 + // Pieces const BASE = 0 const GUERRILLA = 1 @@ -49,6 +53,9 @@ let ui = { document.getElementById("role_FARC"), document.getElementById("role_AUC"), document.getElementById("role_Cartels"), + document.getElementById("role_Government_+_AUC"), + document.getElementById("role_FARC_+_Cartels"), + document.getElementById("role_AUC_+_Cartels"), ], spaces: [], control: [], @@ -616,10 +623,21 @@ function on_update() { ui.header.classList.toggle("cartels", view.current === CARTELS) ui.header.classList.toggle("farc", view.current === FARC) + ui.player[GOVT].classList.toggle("hide", view.scenario < 3) + ui.player[AUC].classList.toggle("hide", view.scenario < 4) + ui.player[CARTELS].classList.toggle("hide", view.scenario < 4) + ui.player[FARC].classList.toggle("hide", view.scenario < 3) + ui.player[GOVT_AUC].classList.toggle("hide", view.scenario !== 2) + ui.player[FARC_CARTELS].classList.toggle("hide", view.scenario !== 2) + ui.player[AUC_CARTELS].classList.toggle("hide", view.scenario !== 3) + ui.player[GOVT].classList.toggle("active", view.current === GOVT) ui.player[AUC].classList.toggle("active", view.current === AUC) ui.player[CARTELS].classList.toggle("active", view.current === CARTELS) ui.player[FARC].classList.toggle("active", view.current === FARC) + ui.player[GOVT_AUC].classList.toggle("active", view.current === GOVT || view.current === AUC) + ui.player[FARC_CARTELS].classList.toggle("active", view.current === FARC || view.current === CARTELS) + ui.player[AUC_CARTELS].classList.toggle("active", view.current === AUC || view.current === CARTELS) ui.tokens.president.style.left = [ 0, "254px", "337px", "420px" ][view.president] @@ -189,7 +189,7 @@ exports.setup = function (seed, scenario, options) { resources: [ 0, 0, 0, 0 ], shipments: [ AVAILABLE, AVAILABLE, AVAILABLE, AVAILABLE ], pieces: Array(153).fill(AVAILABLE), - underground: [ 0, 0, -1, -1 ], + underground: [ 0, -1, -1, -1 ], farc_control: 0, govt_control: 0, support: Array(23).fill(NEUTRAL), @@ -914,6 +914,7 @@ exports.view = function (state, role) { actions: null, log: game.log, + scenario: game.scenario, current: game.current, deck: [ this_card, next_card, deck_size ], president: game.president, |