Skip to content

Commit 046bd04

Browse files
authored
Merge pull request #8067 from NoahTheDuke/nb/fix-light-the-fire
Fix Light The Fire, validate lingering effects
2 parents 9b19f84 + 865eb34 commit 046bd04

File tree

5 files changed

+36
-12
lines changed

5 files changed

+36
-12
lines changed

src/clj/game/cards/resources.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,8 @@
22332233
:duration :end-of-run
22342234
:req (req (and run
22352235
(some #{:content} (:zone target))
2236-
(some #{run-server} (:zone target))))}]
2236+
(some #{(first (:server (:run @state)))} (:zone target))))
2237+
:value true}]
22372238
{:abilities [{:action true
22382239
:label "Run a remote server"
22392240
:cost [(->c :click 1) (->c :trash-can) (->c :brain 1)]
@@ -2244,7 +2245,7 @@
22442245
:async true
22452246
:effect (effect
22462247
(register-events card [successful-run-event])
2247-
(register-lingering-effect card [disable-card-effect])
2248+
(register-lingering-effect card disable-card-effect)
22482249
(make-run eid target card))}]}))
22492250

22502251
(defcard "Logic Bomb"

src/clj/game/core/actions.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@
8787
;; while resolving another ability or promppt
8888
blocking-prompt?
8989
(not= side (to-keyword (:side card)))
90-
(any-effects state side :prevent-paid-ability true? card [ability ability-idx]))]
90+
;; prevention/disabling abilities
91+
(any-effects state side :prevent-paid-ability true? card [ability ability-idx])
92+
(some? (is-disabled-reg? state card)))]
9193
(when blocking-prompt?
92-
(toast state side (str "You cannot play abilities while other abilities are resolving.")
93-
"warning"))
94+
(toast state side "You cannot play abilities while other abilities are resolving." "warning"))
9495
(when-not cannot-play
9596
(do-play-ability state side eid (assoc args :ability-idx ability-idx :ability ability))))))
9697

src/clj/game/core/effects.clj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,11 @@
153153

154154
(defn register-lingering-effect
155155
[state _ card ability]
156+
(assert (contains? ability :type))
157+
(assert (contains? ability :value))
156158
(let [ability (assoc
157-
(select-keys ability [:type :duration :req :value])
159+
(select-keys ability [:type :req :value])
160+
:duration (:duration ability true)
158161
:card card
159162
:lingering true
160163
:uuid (uuid/v1))]

test/clj/game/cards/resources_test.clj

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3628,8 +3628,8 @@
36283628
(play-and-score state "Nisei MK II")
36293629
(play-from-hand state :corp "Vanilla" "HQ")
36303630
(play-from-hand state :corp "Ichi 1.0" "HQ")
3631-
(rez state corp (get-ice state :hq 0))
3632-
(rez state corp (get-ice state :hq 1))
3631+
(rez state :corp (get-ice state :hq 0))
3632+
(rez state :corp (get-ice state :hq 1))
36333633
(take-credits state :corp)
36343634
(play-from-hand state :runner "John Masanori")
36353635
(run-on state :hq)
@@ -4154,6 +4154,25 @@
41544154
(click-prompt state :runner "Server 1"))
41554155
"Spent 8 credits to make a run on the server"))))
41564156

4157+
(deftest light-the-fire-spin-doctor
4158+
;; Light the Fire!
4159+
(do-game
4160+
(new-game {:corp {:hand ["Spin Doctor"]
4161+
:deck [(qty "Hedge Fund" 10)]
4162+
:discard ["Ice Wall" "Fire Wall" "Tyrant"]}
4163+
:runner {:hand ["Light the Fire!" (qty "Sure Gamble" 4)]
4164+
:credits 100}})
4165+
(play-from-hand state :corp "Spin Doctor" "New remote")
4166+
(let [spin (get-content state :remote1 0)]
4167+
(rez state :corp spin)
4168+
(take-credits state :corp)
4169+
(play-from-hand state :runner "Light the Fire!")
4170+
(card-ability state :runner (get-resource state 0) 0)
4171+
(click-prompt state :runner "Server 1")
4172+
(card-ability state :corp spin 0)
4173+
(is (no-prompt? state :corp) "Corp is making no decisions")
4174+
(is (refresh spin) "Corp is making no decisions"))))
4175+
41574176
(deftest logic-bomb
41584177
;; Logic Bomb
41594178
(do-game

test/clj/game/test_framework.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,8 @@
803803
(get-in @state [:runner :play-area pos])))
804804

805805
(defn rez-impl
806-
([state card] (rez-impl state card nil))
807-
([state card {:keys [expect-rez] :or {expect-rez true}}]
806+
([state side card] (rez-impl state side card nil))
807+
([state _side card {:keys [expect-rez] :or {expect-rez true}}]
808808
(let [card (get-card state card)]
809809
(is' (installed? card) (str (:title card) " is installed"))
810810
(is' (not (rezzed? card)) (str (:title card) " is unrezzed"))
@@ -816,8 +816,8 @@
816816
(is' (not (rezzed? (get-card state card))) (str (:title card) " is still unrezzed")))))))
817817

818818
(defmacro rez
819-
[state _ card & opts]
820-
`(error-wrapper (rez-impl ~state ~card ~@opts)))
819+
[state side card & opts]
820+
`(error-wrapper (rez-impl ~state ~side ~card ~@opts)))
821821

822822
(defn derez-impl
823823
[state side card]

0 commit comments

Comments
 (0)