Skip to content

Commit c7b20ff

Browse files
authored
Merge pull request #8565 from NBKelly/vp-release-fixes
Vp release fixes
2 parents 387c100 + d9865c5 commit c7b20ff

File tree

14 files changed

+89
-41
lines changed

14 files changed

+89
-41
lines changed

src/clj/game/cards/events.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@
453453
{:prompt (str "Choose a card (" n " remaining)")
454454
:choices chosen-cards
455455
:async true
456+
:waiting-prompt true
456457
:effect (req (let [target-card target]
457458
(continue-ability
458459
state side

src/clj/game/cards/operations.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@
678678
:effect (req (continue-ability state side (interact cards (remove-card remaining target) to-trash to-add (conj to-top target)) card nil))}))]
679679
{:on-play {:msg (msg (if (= 1 (count (:deck corp)))
680680
"trash the top card of R&D"
681-
(str "look at the top " (count (:deck corp)) " cards of R&D")))
681+
(str "look at the top " (min 5 (count (:deck corp))) " cards of R&D")))
682682
:change-in-game-state {:req (req (seq (:deck corp)))}
683683
:async true
684684
:effect (req (if (= 1 (count (:deck corp)))
@@ -2408,7 +2408,9 @@
24082408
{:on-play {:change-in-game-state {:req (req (seq (filter (every-pred rezzed? ice?)
24092409
(all-installed state :corp))))}
24102410
:waiting-prompt true
2411-
:prompt "Choose any number of ice to derez"
2411+
:prompt (msg "choose " (quantify (min (count (filter (every-pred rezzed? ice?)
2412+
(all-installed state :corp)))
2413+
2) "piece") " of ice to derez")
24122414
:choices {:req (req (and (rezzed? target)
24132415
(ice? target)
24142416
(installed? target)))

src/clj/game/core/access.clj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,15 +627,14 @@
627627

628628
(defn access-helper-rd
629629
[state {:keys [chosen random-access-limit] :as access-amount} already-accessed {:keys [no-root] :as args}]
630-
(let [current-available (set (concat (if-not (any-effects state :runner :disable-random-accesses true? {:server :rd}) (map :cid (get-in @state [:corp :deck])) [])
631-
(map :cid (root-content state :rd))))
632-
already-accessed-fn (fn [card] (contains? already-accessed (:cid card)))
630+
(let [already-accessed-fn (fn [card] (contains? already-accessed (:cid card)))
633631

634632
deck (access-cards-from-rd state)
635633
card-to-access (first (drop-while already-accessed-fn deck))
636634

637635
card-from "Card from deck"
638636
card-from-button (when (and (pos? random-access-limit)
637+
(not (any-effects state :runner :disable-random-accesses true?))
639638
card-to-access)
640639
[card-from])
641640
root (root-content state :rd already-accessed-fn)
@@ -815,10 +814,8 @@
815814
[state {:keys [chosen random-access-limit] :as access-amount}
816815
already-accessed {:keys [no-root access-first] :as args}]
817816
(let [hand (when (not (or (:prevent-hand-access (:run @state))
818-
(any-effects state :runner :disable-random-accesses true? {:server :hq})))
817+
(any-effects state :runner :disable-random-accesses true?)))
819818
(get-in @state [:corp :hand]))
820-
current-available (set (concat (map :cid hand)
821-
(map :cid (root-content state :hq))))
822819

823820
already-accessed-fn (fn [card] (contains? already-accessed (:cid card)))
824821

src/clj/game/core/actions.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,14 @@
241241
(effect-completed state side eid)))
242242
243243
(defn resolve-bad-pub-choice
244-
[state side {:keys [eid] :as args}]
244+
[state side {:keys [eid shift-key-held] :as args}]
245245
(if (pos? (bad-publicity-available state side))
246246
(let [prompt (or (first-prompt-by-eid state side eid)
247247
(first (get-in @state [side :prompt])))
248248
card (:card prompt)
249249
prompt-eid eid
250250
effect (:effect prompt)]
251+
(swap! state assoc-in [side :shift-key-select] shift-key-held)
251252
(if (:offer-bad-pub? prompt)
252253
(do (remove-from-prompt-queue state side prompt)
253254
(when effect (effect :bad-publicity))

src/clj/game/core/diffs.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
(mapv
259259
(fn [choice]
260260
(if (-> choice :value :cid)
261-
(update choice :value #(not-empty (card-summary % state side)))
261+
(update choice :value #(not-empty (select-keys % [:cid :title :printed-title])))
262262
choice)))
263263
(not-empty))
264264
choices)))

src/clj/game/core/pick_counters.clj

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,25 +202,36 @@
202202
(not can-use-bad-pub?)))
203203
{:async true
204204
:effect pay-rest}
205-
(if (and pre-chosen (in-coll? (map :cid provider-cards) (:cid pre-chosen)))
205+
(if (and pre-chosen (or (in-coll? (map :cid provider-cards) (:cid pre-chosen))
206+
(= pre-chosen :bad-publicity)))
206207
{:async true
207-
:effect (req (let [target pre-chosen
208-
pay-credits-type (-> target card-def :interactions :pay-credits :type)
209-
pay-function (if (= :custom pay-credits-type)
210-
(-> target card-def :interactions :pay-credits :custom)
211-
(take-counters-of-type pay-credits-type))
212-
custom-ability ^:ignore-async-check {:async true
213-
:effect pay-function}
214-
neweid (make-eid state outereid)
215-
providing-card target]
216-
(wait-for (resolve-ability state side neweid custom-ability providing-card [card])
217-
(continue-ability state side
218-
(pick-credit-providing-cards
219-
provider-func eid target-count stealth-target
220-
(update selected-cards (:cid providing-card)
221-
#(assoc % :card providing-card :number (+ (:number % 0) async-result)))
222-
target)
223-
card targets))))}
208+
:effect (req
209+
(if (= target :bad-publicity)
210+
(continue-ability
211+
state side
212+
(pick-credit-providing-cards
213+
provider-func eid target-count stealth-target selected-cards (when (and (should-auto-repeat? state side)
214+
(> bad-pub-available 1))
215+
target)
216+
uses (dec bad-pub-available) (inc bad-pub-spent))
217+
card targets)
218+
(let [target pre-chosen
219+
pay-credits-type (-> target card-def :interactions :pay-credits :type)
220+
pay-function (if (= :custom pay-credits-type)
221+
(-> target card-def :interactions :pay-credits :custom)
222+
(take-counters-of-type pay-credits-type))
223+
custom-ability ^:ignore-async-check {:async true
224+
:effect pay-function}
225+
neweid (make-eid state outereid)
226+
providing-card target]
227+
(wait-for (resolve-ability state side neweid custom-ability providing-card [card])
228+
(continue-ability state side
229+
(pick-credit-providing-cards
230+
provider-func eid target-count stealth-target
231+
(update selected-cards (:cid providing-card)
232+
#(assoc % :card providing-card :number (+ (:number % 0) async-result)))
233+
target uses bad-pub-available bad-pub-spent)
234+
card targets)))))}
224235
{:async true
225236
:prompt (str "Choose a credit providing card ("
226237
counter-count (when (and target-count (pos? target-count))

src/cljs/nr/gameboard/board.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,8 @@
18711871
(concat [(when offer-bad-pub?
18721872
;; TODO - translate this
18731873
[:button {:key "Bad Pub"
1874-
:on-click #(send-command "bad-pub-choice" {:eid (prompt-eid (:side @game-state))})}
1874+
:on-click #(send-command "bad-pub-choice" {:eid (prompt-eid (:side @game-state))
1875+
:shift-key-held (.-shiftKey %)})}
18751876
(str "Bad Publicity (" offer-bad-pub? " available)")])]
18761877
(doall (for [{:keys [idx uuid value]} choices
18771878
:when (not= value "Hide")]

test/clj/game/cards/events_test.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
(is (changed? [(:credit (get-runner)) -1]
5151
(click-prompt state :runner "New Angeles City Hall")
5252
(click-prompt state :runner "Yes")
53-
(select-bad-pub state 1))
53+
(select-bad-pub state nil))
5454
"Spent 1 + 1 from bad pub")
5555
(is (= 2 (:credit (get-runner))) "Runner has 2 credits left")
5656
(click-prompt state :runner "Yes")
@@ -6653,11 +6653,11 @@
66536653
;; Trashable execs
66546654
(run-empty-server state :remote2)
66556655
(click-prompt state :runner "Pay 6 [Credits] to trash")
6656-
(select-bad-pub state 1)
6656+
(select-bad-pub state nil)
66576657
(is (empty? (:scored (get-runner))) "Chairman Hiro not added to runner's score area")
66586658
(run-empty-server state "R&D")
66596659
(click-prompt state :runner "Pay 5 [Credits] to trash")
6660-
(select-bad-pub state 1)
6660+
(select-bad-pub state nil)
66616661
(is (empty? (:scored (get-runner))) "Director Haas not added to runner's score area")
66626662
(take-credits state :runner)
66636663
;; Trash RM, make sure everything works again

test/clj/game/cards/hardware_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@
13261326
(click-card state :corp "Hostile Takeover")
13271327
(run-continue state)
13281328
(card-ability state :runner (get-program state 0) 2)
1329-
(select-bad-pub state 1)
1329+
(select-bad-pub state nil)
13301330
(card-ability state :runner (get-program state 0) 2)
13311331
(card-ability state :runner (get-program state 0) 0)
13321332
(click-prompt state :runner "Gain 2 [Credits]")

test/clj/game/cards/ice_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8160,7 +8160,7 @@
81608160
(run-continue state)
81618161
(card-ability state :runner (get-program state 0) 0)
81628162
(click-prompt state :runner "End the run")
8163-
(select-bad-pub state 1)
8163+
(select-bad-pub state nil)
81648164
(run-continue state)
81658165
(click-prompt state :corp "Yes")
81668166
(click-card state :corp "Ice Wall")

0 commit comments

Comments
 (0)