Making News + Employee Strike credits refill
Small problem, but..
Steps to reproduce:
- Corp - play as NBN: Making News
- Spend the corp's recurring credits
- Runner - play Employee Strike
- Begin corp's turn.
Expected: The recurring credits don't refill until the text box is no longer blank Actual: The recurring credits refill.
I presume that this happens with Whizzard and Cerebral Static, and probably with any unique cards that have recurring credits (though I can't think of one off the top of my head.)
This block of card-init is probably where the fix lies. There would need to be a (not (:disabled card)) in here somewhere.
EDIT: Maybe not. Tried a bunch of things...whiffed.
I have a hack to disable the ID - but not re-enable yet. I think this is by nature a bit ugly due to how :recurring is handled on card-init.
Right now I did it via unregister events - but needs to be moved and cleaned up - but putting onto (disable-identity) and likely (enable-identity)
(defn unregister-events
"Removes all event handlers defined for the given card."
[state side card]
(let [cdef (card-def card)]
(unset-prop state side card :rec-counter) <--- remove existing recurring credit
;; Combine normal events and derezzed events. Any merge conflicts should not matter
;; as they should cause all relevant events to be removed anyway.
(doseq [e (merge (:events cdef) (:derezzed-events cdef) (if (= side :corp) {:corp-phase-12 true} {:runner-phase-12 true}))] <-- remove the function call at start of turn
(swap! state update-in [:events (first e)]
#(remove (fn [effect] (= (get-in effect [:card :cid]) (:cid card))) %))))
(unregister-suppress state side card)