Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rez all to end screen #7814

Merged
merged 5 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/clj/game/core/commands.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions src/cljc/i18n/en.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,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"
Expand Down
15 changes: 14 additions & 1 deletion src/cljs/nr/gameboard/board.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -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 map-longest render-icons render-message]]
[nr.ws :as ws]
[reagent.core :as r]))

(declare stacked-card-view show-distinct-cards)
Expand Down Expand Up @@ -1301,6 +1302,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-in-game-decklists
Expand Down
4 changes: 4 additions & 0 deletions src/css/gameboard.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading