File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 11(ns game.core.hosting
22 (:require
3- [game.core.card :refer [assoc-host-zones corp? get-card program? rezzed? runner?]]
3+ [game.core.card :refer [active? assoc-host-zones corp? get-card program? installed ? rezzed? runner?]]
44 [game.core.card-defs :refer [card-def]]
55 [game.core.effects :refer [register-static-abilities unregister-static-abilities]]
66 [game.core.eid :refer [make-eid]]
2323 [card target]
2424 (when (and card target) (or (same-card? card target) (has-ancestor? (:host card) target))))
2525
26+ (defn handle-card-is-uninstalled
27+ " If a card is hosted (uninstalled) from being installed and active, then call it's `leave-play` fn"
28+ [state side card {:keys [installed] :as target}]
29+ (when-let [leave-play (:leave-play (card-def target))]
30+ (when (and (not installed)
31+ (installed? (get-card state target))
32+ (active? (get-card state target)))
33+ (leave-play state (keyword (clojure.string/lower-case (:side target))) (make-eid state) target nil ))))
34+
2635(defn host
2736 " Host the target onto the card."
2837 ([state side card target] (host state side card target nil ))
2938 ([state side card {:keys [zone cid host installed] :as target} {:keys [facedown no-mu]}]
3039 (when (not= cid (:cid card))
40+ (handle-card-is-uninstalled state side card target)
3141 (unregister-events state side target)
3242 (unregister-static-abilities state side target)
3343 (doseq [s [:runner :corp ]]
Original file line number Diff line number Diff line change 32773277 (click-prompt state :corp " 8" )
32783278 (is (= (+ credits 8 ) (:credit (get-corp ))) " Corp should gain 8 credits from Long-Term Investment ability" )))))
32793279
3280+ (deftest malia-icon-goes-away-with-cupellation
3281+ (do-game
3282+ (new-game {:corp {:hand [" Malia Z0L0K4" ]}
3283+ :runner {:hand [" Daily Casts" " Cupellation" ]}})
3284+ (play-from-hand state :corp " Malia Z0L0K4" " New remote" )
3285+ (take-credits state :corp )
3286+ (play-from-hand state :runner " Daily Casts" )
3287+ (rez state :corp (get-content state :remote1 0 ))
3288+ (click-card state :corp " Daily Casts" )
3289+ (is (:icon (refresh (get-resource state 0 ))) " Daily Cast has an icon" )
3290+ (play-from-hand state :runner " Cupellation" )
3291+ (run-empty-server state :remote1 )
3292+ (click-prompt state :runner " [Cupellation] 1 [Credits]: Host card" )
3293+ (is (not (:icon (refresh (get-resource state 0 )))) " Daily Cast does not have an icon anymore" )))
3294+
32803295(deftest malia-z0l0k4
32813296 ; ; Malia Z0L0K4 - blank an installed non-virtual runner resource
32823297 (do-game
You can’t perform that action at this time.
0 commit comments