summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-02-26 12:53:01 +0100
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:15 +0200
commit9486ef27037835a6e31eac843b04219eda4c919c (patch)
treed9d8b0321ff644da439be88154ee42e537775a81
parentbbb9a7bd3686f5a16e661a2a3e8e8c94f8e2bfe2 (diff)
downloadandean-abyss-9486ef27037835a6e31eac843b04219eda4c919c.tar.gz
Combined roles.
-rw-r--r--play.css4
-rw-r--r--play.html23
-rw-r--r--play.js18
-rw-r--r--rules.js3
4 files changed, 43 insertions, 5 deletions
diff --git a/play.css b/play.css
index 3b0e9d6..5958485 100644
--- a/play.css
+++ b/play.css
@@ -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; }
diff --git a/play.html b/play.html
index 63b6e3c..33d1584 100644
--- a/play.html
+++ b/play.html
@@ -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>
diff --git a/play.js b/play.js
index a870869..b13418c 100644
--- a/play.js
+++ b/play.js
@@ -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]
diff --git a/rules.js b/rules.js
index 49748e5..d8e921d 100644
--- a/rules.js
+++ b/rules.js
@@ -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,