Skip to content

Commit 8fe5779

Browse files
committed
option check yes-ability is valid
1 parent 2357053 commit 8fe5779

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
@@ -2886,7 +2886,7 @@
28862886
(defcard "Shattered Remains"
28872887
(advance-ambush 1 {:async true
28882888
:waiting-prompt true
2889-
:req (req (pos? (get-counters (get-card state card) :advancement)))
2889+
:change-in-game-state {:req (req (pos? (get-counters (get-card state card) :advancement)))}
28902890
:prompt (msg "Choose " (quantify (get-counters (get-card state card) :advancement) "piece") " of hardware to trash")
28912891
:msg (msg "trash " (enumerate-cards targets))
28922892
: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)