Skip to content

Commit fce6661

Browse files
authored
Merge pull request #7968 from NBKelly/waiting-prompts-for-some-ice-subs
added waiting prompts to some subs, added CIGS checks for some too
2 parents 571b388 + c1dbec2 commit fce6661

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/clj/game/cards/ice.clj

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
(def end-the-run-if-tagged
153153
"ETR subroutine if tagged"
154154
{:label "End the run if the Runner is tagged"
155-
:req (req tagged)
155+
:change-in-game-state (req tagged)
156156
:msg "end the run"
157157
:async true
158158
:effect (effect (end-run :corp eid card))})
@@ -179,14 +179,9 @@
179179
(defn runner-pays
180180
"Ability to pay to avoid a subroutine by paying a resource"
181181
[cost]
182-
{:async true
183-
:effect (req (wait-for (pay state :runner (make-eid state eid) card cost)
184-
(when-let [payment-str (:msg async-result)]
185-
(system-msg state :runner
186-
(str payment-str
187-
" due to " (:title card)
188-
" subroutine")))
189-
(effect-completed state side eid)))})
182+
{:display-side :runner
183+
:cost cost
184+
:msg :cost})
190185

191186
(defn end-the-run-unless-runner-pays
192187
([cost] (end-the-run-unless-runner-pays cost "subroutine"))
@@ -333,7 +328,7 @@
333328
(def add-runner-card-to-grip
334329
"Add 1 installed Runner card to the grip"
335330
{:label "Add an installed Runner card to the grip"
336-
:req (req (not-empty (all-installed state :runner)))
331+
:change-in-game-state (req (seq (all-installed state :runner)))
337332
:waiting-prompt true
338333
:prompt "Choose a card"
339334
:choices {:card #(and (installed? %)
@@ -347,6 +342,8 @@
347342
{:prompt "Choose a program to trash"
348343
:label "Trash a program"
349344
:msg (msg "trash " (:title target))
345+
:waiting-prompt true
346+
:change-in-game-state (req (seq (filter program? (all-installed state :runner))))
350347
:choices {:card #(and (installed? %)
351348
(program? %))}
352349
:async true
@@ -358,6 +355,8 @@
358355
:label "Force the Runner to trash a program"
359356
:msg (msg "force the runner to trash " (:title target))
360357
:display-side :corp
358+
:waiting-prompt true
359+
:change-in-game-state (req (seq (filter program? (all-installed state :runner))))
361360
:choices {:card #(and (installed? %)
362361
(program? %))}
363362
:async true
@@ -370,6 +369,8 @@
370369
:msg (msg "trash " (:title target))
371370
:choices {:card #(and (installed? %)
372371
(hardware? %))}
372+
:waiting-prompt true
373+
:change-in-game-state (req (seq (filter hardware? (all-installed state :runner))))
373374
:async true
374375
:effect (effect (trash eid target {:cause :subroutine}))})
375376

@@ -379,6 +380,8 @@
379380
:msg (msg "trash " (:title target))
380381
:choices {:card #(and (installed? %)
381382
(resource? %))}
383+
:waiting-prompt true
384+
:change-in-game-state (req (seq (filter resource? (all-installed state :runner))))
382385
:async true
383386
:effect (effect (trash eid target {:cause :subroutine}))})
384387

@@ -387,6 +390,8 @@
387390
:prompt "Choose an installed card to trash"
388391
:label "Trash an installed Runner card"
389392
:msg (msg "trash " (:title target))
393+
:waiting-prompt true
394+
:change-in-game-state (req (seq (all-installed state :runner)))
390395
:choices {:card #(and (installed? %)
391396
(runner? %))}
392397
:effect (effect (trash eid target {:cause :subroutine}))})

test/clj/game/cards/ice_test.clj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@
506506
(rez state :corp ansel)
507507
(run-continue state :encounter-ice)
508508
(fire-subs state (refresh ansel))
509-
(click-prompt state :corp "Done")
509+
;;(click-prompt state :corp "Done")
510510
(click-prompt state :corp "Done")
511511
(is (last-log-contains? state "cannot steal or trash"))
512512
(run-continue-until state :success)
@@ -2374,7 +2374,7 @@
23742374
(card-subroutine state :corp fc1 1)
23752375
(is (= 1 (count (:choices (prompt-map :runner)))) "Only 1 choice in prompt")
23762376
(click-prompt state :runner "Trash an installed card")
2377-
(click-prompt state :runner "Done"))))
2377+
(is (no-prompt? state :runner) "no lingering prompt"))))
23782378

23792379
(deftest fairchild-2-0
23802380
;; Fairchild 2.0
@@ -8572,10 +8572,8 @@
85728572
(fire-subs state win)
85738573
(click-prompt state :corp "0")
85748574
(click-prompt state :runner "0")
8575-
(click-prompt state :corp "Done")
85768575
(click-prompt state :corp "0")
85778576
(click-prompt state :runner "0")
8578-
(click-prompt state :corp "Done")
85798577
(run-continue state :movement)
85808578
(run-jack-out state)
85818579
;Click 2 - Install Aumakua
@@ -8718,6 +8716,4 @@
87188716
(run-on state :hq)
87198717
(run-continue state)
87208718
(fire-subs state zed)
8721-
(click-prompt state :corp "Done")
8722-
(click-prompt state :corp "Done")
87238719
(is (= 0 (:brain-damage (get-runner))) "Runner took 0 core damage"))))

test/clj/game/cards/programs_test.clj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7892,7 +7892,6 @@
78927892
(fire-subs state (refresh ichi))
78937893
(is (= :select (prompt-type :corp)) "Corp has a prompt to choose program to delete")
78947894
(click-card state :corp "Sneakdoor Beta")
7895-
(click-prompt state :corp "Done")
78967895
(is (= "Sneakdoor Beta" (-> (get-runner) :discard first :title)) "Sneakdoor was trashed")
78977896
(click-prompt state :corp "0")
78987897
(click-prompt state :runner "1")

0 commit comments

Comments
 (0)