Skip to content

Commit 84ae472

Browse files
authored
Merge pull request #6071 from cardboardtech/IdentityDiffFix
Playable Abilities Fixes
2 parents 78f6dc2 + a0598f4 commit 84ae472

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

src/clj/game/cards/operations.clj

-1
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,6 @@
13051305
:leave-play (req (system-msg state :corp "trashes MCA Informant"))
13061306
:runner-abilities [{:label "Trash MCA Informant host"
13071307
:cost [:click 1 :credit 2]
1308-
:req (req (= :runner side))
13091308
:async true
13101309
:effect (effect (system-msg :runner (str "spends [Click] and 2 [Credits] to trash "
13111310
(card-str state (:host card))))

src/clj/game/core/diffs.clj

+12-14
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,14 @@
6767
(assoc :runner-abilities (abilities-playable? state side card :runner-abilities))))
6868

6969
(defn card-summary [card state side]
70-
(cond+
71-
[(not (is-public? card side))
72-
(prune-null-fields (private-card card))]
73-
[(:hosted card)
74-
(update card :hosted (partial mapv #(card-summary % state side)))]
75-
[:else
76-
(-> card
77-
(playable? state side)
78-
(card-abilities-playable? state side)
79-
(prune-null-fields))]))
70+
(if (not (is-public? card side))
71+
(prune-null-fields (private-card card))
72+
(-> (if (:hosted card)
73+
(update card :hosted (partial mapv #(card-summary % state side)))
74+
card)
75+
(playable? state side)
76+
(card-abilities-playable? state side)
77+
(prune-null-fields))))
8078

8179
(defn card-summary-vec [cards state side]
8280
(mapv #(card-summary % state side) cards))
@@ -137,7 +135,7 @@
137135
(defn player-summary
138136
[player state side same-side?]
139137
(-> (select-keys player (player-keys))
140-
(update :identity prune-null-fields)
138+
(update :identity card-summary state side)
141139
(update :basic-action-card card-abilities-playable? state side)
142140
(update :current card-summary-vec state side)
143141
(update :play-area card-summary-vec state side)
@@ -199,11 +197,11 @@
199197
:brain-damage])
200198

201199
(defn rig-summary
202-
[state]
200+
[state side]
203201
(let [runner (:runner @state)]
204202
(into {} (for [row [:hardware :facedown :program :resource]
205203
:let [cards (get-in runner [:rig row])]]
206-
[row (card-summary-vec cards state :runner)]))))
204+
[row (card-summary-vec cards state side)]))))
207205

208206
(defn runner-summary
209207
[state side]
@@ -223,7 +221,7 @@
223221
:hand (if (or runner-player? open-hands?) (card-summary-vec hand state :runner) [])
224222
:hand-count (count hand)
225223
:discard (prune-vec discard)
226-
:rig (rig-summary state))
224+
:rig (rig-summary state side))
227225
(cond-> (and runner-player? runnable-list) (assoc :runnable-list runnable-list)))))
228226

229227
(defn run-keys []

src/clj/game/core/initializing.clj

+6-4
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,16 @@
8080
(defn- corp-ability-init
8181
"Gets abilities associated with the card"
8282
[cdef]
83-
(for [ab (:corp-abilities cdef)]
84-
(assoc (select-keys ab [:cost]) :label (make-label ab))))
83+
(into [] (for [ab (:corp-abilities cdef)
84+
:let [ab (assoc (select-keys ab [:cost]) :label (make-label ab))]]
85+
(add-cost-label-to-ability ab))))
8586

8687
(defn- runner-ability-init
8788
"Gets abilities associated with the card"
8889
[cdef]
89-
(for [ab (:runner-abilities cdef)]
90-
(assoc (select-keys ab [:cost :break-cost]) :label (make-label ab))))
90+
(into [] (for [ab (:runner-abilities cdef)
91+
:let [ab (assoc (select-keys ab [:cost :break-cost]) :label (make-label ab))]]
92+
(add-cost-label-to-ability ab (or (:break-cost ab) (:cost ab))))))
9193

9294
(defn card-init
9395
"Initializes the abilities and events of the given card."

src/cljc/game/core/card.cljc

+1
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
(in-play-area? card)
263263
(in-current? card)
264264
(in-scored? card)
265+
(condition-counter? card)
265266
(and (corp? card)
266267
(installed? card)
267268
(rezzed? card))

0 commit comments

Comments
 (0)