Cloud Icebreaker cost memory
shiv/crowbar/spike all cost memory even if you have >= 2 link.
I think we need a :runner-gain event, implementing it should be easy:
(defn gain [state side & args]
(doseq [r (partition 2 args)]
(trigger-event state side (if (= side :corp) :corp-gain :runner-gain) r)
(swap! state update-in [side (first r)] #(+ (or % 0) (last r)))))
But how to handle the event in the card?
A start could be something like this
:runner-gain {:req (req (and
(= (first target) :link)
(>= 2 (:link runner))))
:effect (effect (gain :memory (:memoryunits target)))}
but we would need to keep track of the fact if we already added the bonus to the runner's memory.
I don't know if it's save to alter the memory cost of the card itself.
Thoughts?
You can use (add-watch). Have a look at Cerebral Imaging, Rachel Beckman or Ekomind as examples of implementation.
Thanks,I'll have a look.
add-watch works, but I think we could use an event system for gaining things, so I like this idea. Just make sure to apply the event logic to lose and change as well, and consider passing three parameters to the event: what was changed, what the new value is, what the old value was. We could use that system to simplify the cards that use add-watch (which is less efficient, as it triggers on every single state change).
As for the cloud breakers, you will need to make sure you remember whether you have applied the memory gain or not, so the next time link is gained you don't reapply the bonus. We traditionally have been putting card-specific state values in :special inside of a card's data (see Wyrm or Security Testing).
Not sure how to handle the "even if not installed" portion, however.
Implemented with #600 except the "even if not installed" part, but I don't think it matters