Skip to content

Commit 865eb34

Browse files
committed
Fix light the fire, check if card is disabled in do-ability, tighten lingering effects up
1 parent e82f26f commit 865eb34

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
@@ -2149,7 +2149,8 @@
21492149
:duration :end-of-run
21502150
:req (req (and run
21512151
(some #{:content} (:zone target))
2152-
(some #{run-server} (:zone target))))}]
2152+
(some #{(first (:server (:run @state)))} (:zone target))))
2153+
:value true}]
21532154
{:abilities [{:action true
21542155
:label "Run a remote server"
21552156
:cost [(->c :click 1) (->c :trash-can) (->c :brain 1)]
@@ -2160,7 +2161,7 @@
21602161
:async true
21612162
:effect (effect
21622163
(register-events card [successful-run-event])
2163-
(register-lingering-effect card [disable-card-effect])
2164+
(register-lingering-effect card disable-card-effect)
21642165
(make-run eid target card))}]}))
21652166

21662167
(defcard "Logic Bomb"

src/clj/game/core/actions.clj

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

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
@@ -3579,8 +3579,8 @@
35793579
(play-and-score state "Nisei MK II")
35803580
(play-from-hand state :corp "Vanilla" "HQ")
35813581
(play-from-hand state :corp "Ichi 1.0" "HQ")
3582-
(rez state corp (get-ice state :hq 0))
3583-
(rez state corp (get-ice state :hq 1))
3582+
(rez state :corp (get-ice state :hq 0))
3583+
(rez state :corp (get-ice state :hq 1))
35843584
(take-credits state :corp)
35853585
(play-from-hand state :runner "John Masanori")
35863586
(run-on state :hq)
@@ -4085,6 +4085,25 @@
40854085
(click-prompt state :runner "Server 1"))
40864086
"Spent 8 credits to make a run on the server"))))
40874087

4088+
(deftest light-the-fire-spin-doctor
4089+
;; Light the Fire!
4090+
(do-game
4091+
(new-game {:corp {:hand ["Spin Doctor"]
4092+
:deck [(qty "Hedge Fund" 10)]
4093+
:discard ["Ice Wall" "Fire Wall" "Tyrant"]}
4094+
:runner {:hand ["Light the Fire!" (qty "Sure Gamble" 4)]
4095+
:credits 100}})
4096+
(play-from-hand state :corp "Spin Doctor" "New remote")
4097+
(let [spin (get-content state :remote1 0)]
4098+
(rez state :corp spin)
4099+
(take-credits state :corp)
4100+
(play-from-hand state :runner "Light the Fire!")
4101+
(card-ability state :runner (get-resource state 0) 0)
4102+
(click-prompt state :runner "Server 1")
4103+
(card-ability state :corp spin 0)
4104+
(is (no-prompt? state :corp) "Corp is making no decisions")
4105+
(is (refresh spin) "Corp is making no decisions"))))
4106+
40884107
(deftest logic-bomb
40894108
;; Logic Bomb
40904109
(do-game

test/clj/game/test_framework.clj

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

788788
(defn rez-impl
789-
([state card] (rez-impl state card nil))
790-
([state card {:keys [expect-rez] :or {expect-rez true}}]
789+
([state side card] (rez-impl state side card nil))
790+
([state _side card {:keys [expect-rez] :or {expect-rez true}}]
791791
(let [card (get-card state card)]
792792
(is' (installed? card) (str (:title card) " is installed"))
793793
(is' (not (rezzed? card)) (str (:title card) " is unrezzed"))
@@ -799,8 +799,8 @@
799799
(is' (not (rezzed? (get-card state card))) (str (:title card) " is still unrezzed")))))))
800800

801801
(defmacro rez
802-
[state _ card & opts]
803-
`(error-wrapper (rez-impl ~state ~card ~@opts)))
802+
[state side card & opts]
803+
`(error-wrapper (rez-impl ~state ~side ~card ~@opts)))
804804

805805
(defn derez-impl
806806
[state side card]

0 commit comments

Comments
 (0)