diff --git a/src/clj/game/cards/resources.clj b/src/clj/game/cards/resources.clj index 79b392243b..4ab9c32775 100644 --- a/src/clj/game/cards/resources.clj +++ b/src/clj/game/cards/resources.clj @@ -1950,14 +1950,17 @@ {:req (req (= (zone->name (get-in @state [:run :server])) (:server-target (get-card state card)))) :once :per-turn + :silent (req true) :effect (req (let [st card] - (swap! state assoc-in [:run :run-effect :replace-access] - {:mandatory true - :effect (effect (resolve-ability - {:msg "gain 2 [Credits] instead of accessing" - :effect (effect (gain-credits 2) - (update! (dissoc st :server-target)))} - st nil))})))} + (swap! state assoc-in [:run :run-effect] + {:card st + :replace-access + {:mandatory true + :effect (effect (continue-ability + {:msg "gain 2 [Credits] instead of accessing" + :effect (effect (gain-credits 2) + (update! (dissoc st :server-target)))} + st nil))}})))} :runner-turn-ends {:effect (effect (update! (dissoc card :server-target)))}} :abilities [ability]}) diff --git a/test/clj/game_test/cards/identities.clj b/test/clj/game_test/cards/identities.clj index 543d57a9e6..f8be2a86f2 100644 --- a/test/clj/game_test/cards/identities.clj +++ b/test/clj/game_test/cards/identities.clj @@ -304,14 +304,12 @@ (do-game (new-game {:runner {:id "Alice Merchant: Clan Agitator" :deck ["Security Testing"]}}) - ; (trash-from-hand state :corp "Hostile Takeover") (take-credits state :corp) (play-from-hand state :runner "Security Testing") (take-credits state :runner) (take-credits state :corp) (click-prompt state :runner "Archives") (run-empty-server state "Archives") - (click-prompt state :runner "Alice Merchant: Clan Agitator") (click-prompt state :corp (find-card "Hedge Fund" (:hand (get-corp)))) (is (= 1 (-> (get-corp) :discard count)) "Alice ability should trash 1 card from HQ") (is (-> (get-corp) :discard first :seen not) "Discarded card should be facedown when access is replaced"))) diff --git a/test/clj/game_test/cards/resources.clj b/test/clj/game_test/cards/resources.clj index 0aa2fb537f..e04148bf1e 100644 --- a/test/clj/game_test/cards/resources.clj +++ b/test/clj/game_test/cards/resources.clj @@ -2842,7 +2842,32 @@ (run-empty-server state "Archives") (is (= 9 (:credit (get-runner))) "Gained 2 credits") (run-empty-server state "R&D") - (is (= 11 (:credit (get-runner))))))) + (is (= 11 (:credit (get-runner)))))) + (testing "with Paragon and other successful-run triggers" + (do-game + (new-game {:corp {:id "AgInfusion: New Miracles for a New World" + :deck [(qty "Hedge Fund" 5)] + :hand ["Ice Wall"]} + :runner {:deck ["Sure Gamble"] + :hand ["Diversion of Funds" + "Paragon" + "Security Testing"] + :credits 20}}) + (play-from-hand state :corp "Ice Wall" "HQ") + (take-credits state :corp) + (play-from-hand state :runner "Security Testing") + (play-from-hand state :runner "Paragon") + (take-credits state :runner) + (take-credits state :corp) + (click-prompt state :runner "Archives") + (play-from-hand state :runner "Diversion of Funds") + (card-ability state :corp (:identity (get-corp)) 0) + (click-prompt state :corp "Archives") + (let [credits (:credit (get-runner))] + (run-successful state) + (click-prompt state :runner "Yes") + (click-prompt state :runner "Yes") + (is (= (+ 3 credits) (:credit (get-runner))) "2 from Sec Testing, 1 from Paragon"))))) (deftest spoilers ;; Spoilers - Mill the Corp when it scores an agenda