netrunner icon indicating copy to clipboard operation
netrunner copied to clipboard

Making News + Employee Strike credits refill

Open PhantomOfAres opened this issue 9 years ago • 2 comments

Small problem, but..

Steps to reproduce:

  1. Corp - play as NBN: Making News
  2. Spend the corp's recurring credits
  3. Runner - play Employee Strike
  4. 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.)

PhantomOfAres avatar Mar 17 '17 23:03 PhantomOfAres

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.

JoelCFC25 avatar Mar 18 '17 01:03 JoelCFC25

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)

danhut avatar Mar 22 '17 12:03 danhut