Skip to content

Commit 9908406

Browse files
committed
async fixes
1 parent 4f78162 commit 9908406

File tree

7 files changed

+22
-15
lines changed

7 files changed

+22
-15
lines changed

src/clj/game/core/commands.clj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@
324324
(or (installed? target)
325325
(in-hand? target))))}
326326
:msg (msg "score " (card-str state target {:visible true}) ", ignoring all restrictions")
327+
:async true
327328
:effect (effect (score eid target {:no-req true :ignore-turn true}))}
328329
(make-card {:title "the '/score' command"}) nil)))
329330

@@ -408,6 +409,7 @@
408409
state side
409410
{:prompt "Choose a card to trash"
410411
:choices {:card #(f %)}
412+
:async true
411413
:effect (effect (trash eid target {:unpreventable true}))}
412414
nil nil)))
413415

src/clj/game/core/costs.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,7 @@
10001000
:choices {:card #(and (agenda? %)
10011001
(is-scored? state side %)
10021002
(pos? (get-counters % :agenda)))}
1003+
:async true
10031004
:effect (req (let [title (:title target)
10041005
target (update! state side (update-in target [:counter :agenda] - (value cost)))]
10051006
(wait-for (trigger-event-sync state side :agenda-counter-spent target)

src/clj/game/core/pick_counters.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@
111111
pay-function (if (= :custom pay-credits-type)
112112
(-> target card-def :interactions :pay-credits :custom)
113113
(take-counters-of-type pay-credits-type))
114-
custom-ability {:async true
115-
:effect pay-function}
114+
custom-ability ^:ignore-async-check {:async true
115+
:effect pay-function}
116116
neweid (make-eid state outereid)
117117
providing-card target]
118118
(wait-for (resolve-ability state side neweid custom-ability providing-card [card])
@@ -169,8 +169,8 @@
169169
(if (or (not (pos? target-count)) ; there is a limit
170170
(<= target-count counter-count) ; paid everything
171171
(zero? (count provider-cards))) ; no more additional credit sources found
172-
{:async true
173-
:effect pay-rest}
172+
{:async true
173+
:effect pay-rest}
174174
{:async true
175175
:prompt (str "Choose a credit providing card ("
176176
counter-count (when (and target-count (pos? target-count))
@@ -185,8 +185,8 @@
185185
pay-function (if (= :custom pay-credits-type)
186186
(-> target card-def :interactions :pay-credits :custom)
187187
(take-counters-of-type pay-credits-type))
188-
custom-ability {:async true
189-
:effect pay-function}
188+
custom-ability ^:ignore-async-check {:async true
189+
:effect pay-function}
190190
neweid (make-eid state outereid)
191191
providing-card target]
192192
(wait-for (resolve-ability state side neweid custom-ability providing-card [card])

src/clj/game/core/prompts.clj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
{:keys [waiting-prompt prompt-type show-discard cancel-effect end-effect targets]}]
2929
(let [prompt (if (string? message) message (message state side eid card targets))
3030
choices (choice-parser choices)
31-
newitem {:eid eid
32-
:msg prompt
33-
:choices choices
34-
:effect f
35-
:card card
36-
:prompt-type (or prompt-type :other)
37-
:show-discard show-discard
38-
:cancel-effect cancel-effect
39-
:end-effect end-effect}]
31+
newitem ^:ignore-async-check {:eid eid
32+
:msg prompt
33+
:choices choices
34+
:effect f
35+
:card card
36+
:prompt-type (or prompt-type :other)
37+
:show-discard show-discard
38+
:cancel-effect cancel-effect
39+
:end-effect end-effect}]
4040
(when (or (#{:waiting :run} prompt-type)
4141
(:number choices)
4242
(:card-title choices)

src/clj/game/core/runs.clj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@
593593
state :runner
594594
{:prompt "Choose a breach replacement ability"
595595
:choices (if mandatory titles (conj titles (str "Breach " (zone->name (:server (:run @state))))))
596+
:async true
596597
:effect (req (let [chosen (some #(when (= target (get-in % [:card :title])) %) handlers)
597598
ability (:ability chosen)
598599
card (:card chosen)]
@@ -630,6 +631,7 @@
630631
state :runner eid
631632
{:prompt (str "You are prevented from breaching " (zone->name server) " this run.")
632633
:choices ["OK"]
634+
:async true
633635
:effect (effect (system-msg :runner (str "is prevented from breaching " (zone->name server) " this run."))
634636
(handle-end-run eid))}
635637
nil nil)

src/clj/game/core/sabotage.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
(defn sabotage-ability
4343
[n]
4444
(let [choosing-ab (fn [forced-hq]
45+
^:ignore-async-check
4546
{:waiting-prompt true
4647
:player :corp
4748
:prompt (choosing-prompt-req n)

src/clj/game/core/turns.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
:choices {:card in-hand?
118118
:max (- cur-hand-size (max (hand-size state side) 0))
119119
:all true}
120+
:async true
120121
:effect (req (system-msg state side
121122
(str "discards "
122123
(if (= :runner side)

0 commit comments

Comments
 (0)