summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-10-10 16:39:03 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-10-10 16:39:03 +0100
commit0d09d30e9d34100c60b54e7a264b7430cf756347 (patch)
treed596ad1f871152ef74d88b366334291994c427aa
parente43c00ffe5a00483da67898fb8abcf87cce5d419 (diff)
download1989-dawn-of-freedom-0d09d30e9d34100c60b54e7a264b7430cf756347.tar.gz
Added permanently removed view
-rw-r--r--play.css4
-rw-r--r--play.html9
-rw-r--r--play.js14
-rw-r--r--rules.js2
4 files changed, 26 insertions, 3 deletions
diff --git a/play.css b/play.css
index c6693d2..a3c3606 100644
--- a/play.css
+++ b/play.css
@@ -141,7 +141,7 @@ header.your_turn { background-color: orange; }
display: flex;
}
-#discard_panel {
+#discard_panel, #removed_panel {
min-width: 200px;
width: auto;
display: inline-block;
@@ -149,7 +149,7 @@ header.your_turn { background-color: orange; }
border-radius: 5px;
}
-#discard_panel.hide {
+#discard_panel.hide, #removed_panel.hide {
display: none;
}
diff --git a/play.html b/play.html
index 718ee38..a9026e6 100644
--- a/play.html
+++ b/play.html
@@ -93,6 +93,7 @@
</details>
<button onclick="toggle_pieces()"><img src="images/earth-africa-europe.svg"></button>
<button onclick="toggle_discard()"><img src="images/bin.png"></button>
+ <button onclick="toggle_removed()"><img src="images/remove.png"></button>
</div>
</header>
@@ -208,6 +209,14 @@
</div>
</section>
+<!-- PERMANENTLY REMOVED -->
+<section id = "sec_removed">
+ <div id="removed_panel" class="panel hide">
+ <div id="removed_header" class="panel_header">Permanently Removed Events</div>
+ <div id="removed" class="panel_body"></div>
+ </div>
+</section>
+
<!-- POWERSTRUGGLE -->
<section id = "sec_power">
<div id="ceausescu_panel" class="panel hide">
diff --git a/play.js b/play.js
index 2c4d482..7ae8644 100644
--- a/play.js
+++ b/play.js
@@ -557,6 +557,16 @@ if(view.discard) {
}
}
+// UPDATE PERMANENTLY REMOVED CARDS
+document.getElementById("removed").replaceChildren()
+for (let c of view.strategy_removed) {
+ let discard_card = ui.cards[c]
+ document.getElementById("removed").appendChild(discard_card)
+ discard_card.classList.add('discard_card')
+ discard_card.classList.remove('selected')
+}
+
+
// PLAYED CARD PANEL
if (view.played_card > 0) {
document.getElementById("played_card_panel").classList.remove("hide")
@@ -841,6 +851,10 @@ function toggle_discard() {
document.getElementById("discard_panel").classList.toggle("hide")
}
+function toggle_removed() {
+ document.getElementById("removed_panel").classList.toggle("hide")
+}
+
function check_dem_control(demInfl, comInfl, space) {
if ((demInfl - comInfl) >= space.stability) {
return true
diff --git a/rules.js b/rules.js
index 1b07a3d..e7c2a56 100644
--- a/rules.js
+++ b/rules.js
@@ -170,7 +170,7 @@ exports.view = function(state, player) {
the_tyrant_is_gone: game.the_tyrant_is_gone,
strategy_deck: game.strategy_deck.length,
- //strategy_discard: game.strategy_discard,
+ strategy_removed: game.strategy_removed,
discard: game.discard,
show_opp_hand: game.view_opp_hand,