Skip to content

Commit 9a45976

Browse files
authored
Merge pull request #8536 from NBKelly/optional-check-yes-is-valid
option check yes-ability is valid
2 parents 3df6a3f + 8fe5779 commit 9a45976

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/clj/game/cards/assets.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2891,7 +2891,7 @@
28912891
(defcard "Shattered Remains"
28922892
(advance-ambush 1 {:async true
28932893
:waiting-prompt true
2894-
:req (req (pos? (get-counters (get-card state card) :advancement)))
2894+
:change-in-game-state {:req (req (pos? (get-counters (get-card state card) :advancement)))}
28952895
:prompt (msg "Choose " (quantify (get-counters (get-card state card) :advancement) "piece") " of hardware to trash")
28962896
:msg (msg "trash " (enumerate-cards targets))
28972897
:choices {:max (req (get-counters (get-card state card) :advancement))

src/clj/game/core/optional.clj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
(let [autoresolve-fn (:autoresolve ability)
3333
autoresolve-answer (when autoresolve-fn
3434
(autoresolve-fn state side eid card targets))
35-
choices [(when (can-pay? state side eid card (:title card) (:cost (:yes-ability ability)))
35+
choices [(when (and (can-pay? state side eid card (:title card) (:cost (:yes-ability ability)))
36+
(if-let [yesreq (-> ability :yes-ability :req)]
37+
(yesreq state side eid card targets)
38+
true))
3639
"Yes")
3740
"No"]]
3841
(case autoresolve-answer

test/clj/game/cards/assets_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5220,7 +5220,7 @@
52205220
(take-credits state :corp)
52215221
(run-empty-server state :remote1)
52225222
(click-prompt state :corp "Yes")
5223-
(is (no-prompt? state :corp) "Corp shouldn't get Shattered Remains ability prompt when no counters")
5223+
(is (no-prompt? state :corp) "NCIGS because no counters, but you paid a credit to do that")
52245224
(click-prompt state :runner "No action")
52255225
(run-empty-server state :remote2)
52265226
(let [credits (:credit (get-corp))]

0 commit comments

Comments
 (0)