Skip to content

Commit

Permalink
Merge pull request #7581 from NBKelly/nanuq-vs-keegan
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahTheDuke authored Aug 9, 2024
2 parents 90d1599 + 6f9b175 commit a061f85
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/clj/game/cards/assets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@
:max (req (get-counters (get-card state card) :advancement))}
:msg (msg "shuffle " (enumerate-str (map :title targets)) " into the stack")
:effect (req (doseq [c targets]
(move state :runner c :deck))
(move state :runner c :deck {:shuffled true}))
(shuffle! state :runner :deck)
(effect-completed state side eid))}))

Expand Down
23 changes: 17 additions & 6 deletions src/clj/game/cards/programs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[game.core.damage :refer [damage damage-prevent]]
[game.core.def-helpers :refer [breach-access-bonus defcard offer-jack-out trash-on-empty get-x-fn rfg-on-empty]]
[game.core.drawing :refer [draw]]
[game.core.effects :refer [any-effects register-lingering-effect unregister-effects-for-card update-disabled-cards]]
[game.core.effects :refer [any-effects is-disabled-reg? register-lingering-effect unregister-effects-for-card update-disabled-cards]]
[game.core.eid :refer [effect-completed make-eid]]
[game.core.engine :refer [ability-as-handler checkpoint dissoc-req not-used-once? pay
print-msg register-events register-once
Expand Down Expand Up @@ -2308,11 +2308,22 @@
:once :per-turn ;; prevents self triggering
:interactive (req true)
:effect (effect (move card :rfg))}]
(auto-icebreaker {:abilities [(break-sub 2 2 "All")
(strength-pump 1 1)]
:uninstall (effect (continue-ability self-rfg card nil))
:events [(assoc self-rfg :event :agenda-scored)
(assoc self-rfg :event :agenda-stolen)]})))
(auto-icebreaker
{:abilities [(break-sub 2 2 "All")
(strength-pump 1 1)]
:move-zone-replacement (req (let [old (:card context)
target-zone (:zone context)]
(when (and (:installed old)
;; if it's shuffled in, we're not allowed to move it
;; cursed ruling, the card should have been an
;; interrupt.
(not (:shuffled context))
(not (is-disabled-reg? state old))
(not (:facedown old))
(not= [:rfg] target-zone))
[:rfg])))
:events [(assoc self-rfg :event :agenda-scored)
(assoc self-rfg :event :agenda-stolen)]})))

(defcard "Nerve Agent"
{:events [{:event :successful-run
Expand Down
2 changes: 1 addition & 1 deletion src/clj/game/core/costs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@
:all true
:card (every-pred installed? (if (= :corp side) corp? runner?))}
:async true
:effect (req (let [cards (keep #(move state side % :deck) targets)]
:effect (req (let [cards (keep #(move state side % :deck {:shuffled true}) targets)]
(shuffle! state side :deck)
(complete-with-result
state side eid
Expand Down
10 changes: 8 additions & 2 deletions src/clj/game/core/moving.clj
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
(defn move
"Moves the given card to the given new zone."
([state side card to] (move state side card to nil))
([state side {:keys [zone host] :as card} to {:keys [front index keep-server-alive force suppress-event swap]}]
([state side {:keys [zone host] :as card} to {:keys [front index keep-server-alive force suppress-event shuffled swap]}]
(let [zone (if host (map to-keyword (:zone host)) zone)]
(if (fake-identity? card)
;; Make Fake-Identity cards "disappear"
Expand All @@ -194,7 +194,13 @@
(or force
(not (zone-locked? state (to-keyword (:side card)) (first (get-zone card))))))
(let [dest (if (sequential? to) (vec to) [to])
moved-card (get-moved-card state side card to)]
dest-replacement-fn (:move-zone-replacement (card-def card))
dest-replacement (when dest-replacement-fn
(dest-replacement-fn state side (make-eid state) card [{:card card
:target-zone dest
:shuffled shuffled}]))
dest (or dest-replacement dest)
moved-card (get-moved-card state side card (or (last dest-replacement) to))]
(update-effects state card moved-card)
(remove-old-card state side card)
(let [pos-to-move-to (cond index index
Expand Down
30 changes: 30 additions & 0 deletions test/clj/game/cards/programs_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5991,6 +5991,36 @@
(click-card state :runner (get-program state 0))
(is (= 3 (count (:rfg (get-runner)))) "Nanuq removed from the game when uninstalled")))

(deftest nanuq-vs-keegan-lane
(do-game
(new-game {:corp {:hand ["Keegan Lane"]}
:runner {:hand ["Nanuq"]}})
(play-from-hand state :corp "Keegan Lane" "HQ")
(take-credits state :corp)
(play-from-hand state :runner "Nanuq")
(run-on state :hq)
(gain-tags state :runner 1)
(rez state :corp (get-content state :hq 0))
(card-ability state :corp (get-content state :hq 0) 0)
(click-card state :corp "Nanuq")
(is (= 1 (count (:rfg (get-runner)))) "Nanuq in rfg")
(is (= 0 (count (:discard (get-runner)))) "Nanuq not in discard")))

(deftest nanuq-vs-degree-mill
;; note - if they're shuffled in, they don't get rfg'd...
(do-game
(new-game {:corp {:hand ["Degree Mill"]}
:runner {:deck ["PAD Tap" "Nanuq"]}})
(take-credits state :corp)
(play-from-hand state :runner "Nanuq")
(play-from-hand state :runner "PAD Tap")
(run-empty-server state :hq)
(click-prompt state :runner "Pay to steal")
(click-card state :runner "Nanuq")
(click-card state :runner "PAD Tap")
(is (= 2 (count (:deck (get-runner)))) "Both cards in deck")
(is (= 0 (count (:rfg (get-runner)))) "Nanuq not rfg'd")))

(deftest nfr
;; Nfr
(do-game
Expand Down

0 comments on commit a061f85

Please sign in to comment.