diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-10-16 12:21:33 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-10-16 12:21:33 +0200 |
commit | 227dca6e6e4c2f2d5a16527507810bc373b758ec (patch) | |
tree | c1284345f1116e42d7e15c8e7bc6cde684f35df9 | |
parent | 55927b36e1f17183c6f63b3b106d838e5a0c15de (diff) | |
download | red-flag-over-paris-227dca6e6e4c2f2d5a16527507810bc373b758ec.tar.gz |
Add special panels for Karl Marx and Jules Ducatel events.
-rw-r--r-- | play.css | 3 | ||||
-rw-r--r-- | play.html | 14 | ||||
-rw-r--r-- | play.js | 22 | ||||
-rw-r--r-- | rules.js | 8 |
4 files changed, 43 insertions, 4 deletions
@@ -52,6 +52,9 @@ body.Versailles header.your_turn { background-color: hsl(199, 45%, 70%); } #red_objective_panel, #blue_objective_panel { min-width: 290px; max-width: 560px; } +#karl_marx_panel { min-width: 830px; } +#jules_ducatel_panel { min-width: 830px; } + #red_objective_header { background-color: hsl(358, 20%, 28%) } #blue_objective_header { background-color: hsl(199, 20%, 26%) } #red_objective { background-color: hsl(358, 10%, 36%) } @@ -61,6 +61,20 @@ </div> </div> + <div id="event_grid" class="panel_grid" style="display:none"> + + <div id="karl_marx_panel" class="panel hide"> + <div id="karl_marx_header" class="panel_header">Karl Marx</div> + <div id="karl_marx" class="panel_body"></div> + </div> + + <div id="jules_ducatel_panel" class="panel hide"> + <div id="jules_ducatel_header" class="panel_header">Jules Ducatel</div> + <div id="jules_ducatel" class="panel_body"></div> + </div> + + </div> + <div class="panel_grid"> <div id="hand_panel" class="panel hide"> @@ -527,6 +527,8 @@ function on_update() { ui.military_vp.className = `piece cylinder purple vp${5+view.military_vp}` ui.political_vp.className = `piece cylinder orange vp${5+view.political_vp}` + document.getElementById("karl_marx").replaceChildren() + document.getElementById("jules_ducatel").replaceChildren() document.getElementById("hand").replaceChildren() document.getElementById("final").replaceChildren() document.getElementById("discard").replaceChildren() @@ -546,6 +548,26 @@ function on_update() { if (view.discard) document.getElementById("discard").appendChild(ui.cards[view.discard]) + if (view.karl_marx || view.jules_ducatel) { + document.getElementById("event_grid").style.display = null + if (view.karl_marx) { + document.getElementById("karl_marx_panel").classList.remove("hide") + for (let c of view.karl_marx) + document.getElementById("karl_marx").appendChild(ui.cards[c]) + } else { + document.getElementById("karl_marx_panel").classList.add("hide") + } + if (view.jules_ducatel) { + document.getElementById("jules_ducatel_panel").classList.remove("hide") + for (let c of view.jules_ducatel) + document.getElementById("jules_ducatel").appendChild(ui.cards[c]) + } else { + document.getElementById("jules_ducatel_panel").classList.add("hide") + } + } else { + document.getElementById("event_grid").style.display = "none" + } + if (view.hand) { document.getElementById("hand_panel").classList.remove("hide") for (let c of view.hand) @@ -3415,7 +3415,7 @@ states.reveal_commune_hand = { inactive: "look at Commune player's hand", prompt() { event_prompt("Revealing Commune player's hand.") - view.hand = game.red_hand + view.jules_ducatel = game.red_hand view.actions.done = 1 }, done() { @@ -3478,7 +3478,7 @@ states.karl_marx_discard = { inactive: "discard a card", prompt() { event_prompt("Discard 2 cards, then play or discard the last card.") - view.hand = game.vm.cards + view.karl_marx = game.vm.cards for (let c of game.vm.cards) gen_action_card(c) }, @@ -3496,7 +3496,7 @@ states.karl_marx_play = { inactive: "play or discard a card", prompt() { event_prompt("Play or discard the last card.") - view.hand = game.vm.cards + view.karl_marx = game.vm.cards if (can_play_event(game.vm.cards[0])) view.actions.event = 1 else @@ -3543,7 +3543,7 @@ states.georges_vaysset = { inactive: "look at Commune player's hand, take a card, then give them a card", prompt() { event_prompt("Take a card from your opponent's hand.") - view.hand = game.red_hand + view.karl_marx = game.red_hand for (let c of game.red_hand) gen_action_card(c) }, |