From 6a4624c1a541f19c0950ac8c863bed5e8f05b430 Mon Sep 17 00:00:00 2001 From: NB Kelly Date: Fri, 11 Oct 2024 18:19:02 +1300 Subject: [PATCH 1/4] extend rez-all command to (optionally) flip agendas faceup --- src/clj/game/core/commands.clj | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/clj/game/core/commands.clj b/src/clj/game/core/commands.clj index c53b3f596d..e93084c4dc 100644 --- a/src/clj/game/core/commands.clj +++ b/src/clj/game/core/commands.clj @@ -154,6 +154,16 @@ (rez-all state side eid (next cards))) (effect-completed state side eid))) +(defn rez-all-turn-agendas-faceup + [cards] + (let [agendas (filter (every-pred agenda? (complement :seen)) cards)] + (when (seq agendas) + {:optional + {:prompt "Turn all agendas faceup?" + :yes-ability {:effect (req (doseq [c agendas] + (update! state side (assoc c :seen true)))) + :msg (msg "turns all agendas faceup")}}}))) + (defn command-rezall [state side] (resolve-ability @@ -162,7 +172,12 @@ {:prompt "Rez all cards and turn cards in archives faceup?" :yes-ability {:async true :effect (req (swap! state update-in [:corp :discard] #(map (fn [c] (assoc c :seen true)) %)) - (rez-all state side eid (remove rezzed? (all-installed state side))))}}} + (wait-for + (rez-all state side (remove rezzed? (all-installed state side))) + (continue-ability + state side + (rez-all-turn-agendas-faceup (all-installed state side)) + card nil)))}}} (make-card {:title "/rez-all command"}) nil)) (defn command-roll [state side value] From 19f4f056106aa9bbe656c816977d6ebea8643540 Mon Sep 17 00:00:00 2001 From: NB Kelly Date: Fri, 11 Oct 2024 18:19:21 +1300 Subject: [PATCH 2/4] add reveal-hand and rez-all buttons to the end of game screen --- src/cljs/nr/gameboard/board.cljs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cljs/nr/gameboard/board.cljs b/src/cljs/nr/gameboard/board.cljs index d7e5f5e4e3..5061c0decd 100644 --- a/src/cljs/nr/gameboard/board.cljs +++ b/src/cljs/nr/gameboard/board.cljs @@ -13,7 +13,7 @@ [jinteki.cards :refer [all-cards]] [jinteki.utils :refer [add-cost-to-label is-tagged? select-non-nil-keys str->int] :as utils] - [nr.appstate :refer [app-state]] + [nr.appstate :refer [app-state current-gameid]] [nr.cardbrowser :refer [card-as-text]] [nr.end-of-game-stats :refer [build-game-stats]] [nr.gameboard.actions :refer [send-command]] @@ -28,6 +28,7 @@ [nr.translations :refer [tr tr-side tr-game-prompt]] [nr.utils :refer [banned-span checkbox-button cond-button get-image-path image-or-face render-icons render-message]] + [nr.ws :as ws] [reagent.core :as r])) (declare stacked-card-view show-distinct-cards) @@ -1291,6 +1292,18 @@ [:div (tr [:game.time-taken] time)] [:br] [build-game-stats (get-in @game-state [:stats :corp]) (get-in @game-state [:stats :runner])] + (when (not= :spectator (:side @game-state)) + [:br] + [:div {:class "end-of-game-buttons"} + (when (= :corp (:side @game-state)) + [:button#rez-all + {:on-click #(ws/ws-send! [:game/say {:gameid (current-gameid app-state) + :msg "/rez-all"}])} + (tr [:game.rez-all "Rez All"])]) + [:button#reveal-hand + {:on-click #(ws/ws-send! [:game/say {:gameid (current-gameid app-state) + :msg "/show-hand"}])} + (tr [:game.reveal-my-hand "Reveal My Hand"])]]) [:button.win-right {:on-click #(reset! win-shown true) :type "button"} "✘"]]))))) (defn build-start-box From 85e3fe3390232ba2925507bcdbb614938510783f Mon Sep 17 00:00:00 2001 From: NB Kelly Date: Fri, 11 Oct 2024 18:21:04 +1300 Subject: [PATCH 3/4] tr keys --- src/cljc/i18n/en.cljc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cljc/i18n/en.cljc b/src/cljc/i18n/en.cljc index c804d6beec..b8c7b5ba59 100644 --- a/src/cljc/i18n/en.cljc +++ b/src/cljc/i18n/en.cljc @@ -726,6 +726,8 @@ :end-turn "End Turn" :mandatory-draw "Mandatory Draw" :take-clicks "Take Clicks" + :rez-all "Rez All" + :reveal-my-hand "Reveal My Hand" :hq "HQ" :grip "Grip" :rfg "Removed from the game" From da9020eba13089e5b4a5173edec90b4b2dec6879 Mon Sep 17 00:00:00 2001 From: NB Kelly Date: Fri, 11 Oct 2024 19:35:19 +1300 Subject: [PATCH 4/4] make buttons look nice --- src/css/gameboard.styl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/css/gameboard.styl b/src/css/gameboard.styl index 28795c4ad5..8e3013a7bd 100644 --- a/src/css/gameboard.styl +++ b/src/css/gameboard.styl @@ -420,6 +420,10 @@ position: absolute width: 100% + .end-of-game-buttons + float: right + margin-top: 1em + .card-wrapper display: inline-block margin-right: 4px