From 1eb8d0993cc75dd1b29efb446a7112854648a7f4 Mon Sep 17 00:00:00 2001 From: Artem Mikhalitsin Date: Thu, 28 Jul 2022 02:36:10 -0400 Subject: [PATCH 1/5] Add moon pool test --- test/clj/game/cards/assets_test.clj | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/clj/game/cards/assets_test.clj b/test/clj/game/cards/assets_test.clj index 20c4f6e92d..d20fb13ae3 100644 --- a/test/clj/game/cards/assets_test.clj +++ b/test/clj/game/cards/assets_test.clj @@ -3135,6 +3135,21 @@ (score state :corp (get-content state :remote3 0)) (is (= 1 (count (:scored (get-corp)))) "Hostile was scored"))) +(deftest moon-pool-rfg-when-no-cards-trashed-from-hq + (do-game + (new-game {:corp {:hand ["Moon Pool", (qty "Hedge Fund" 3)] + :discard ["Longevity Serum"]}}) + (play-from-hand state :corp "Moon Pool" "New remote") + (let [moon-pool (get-content state :remote1 0)] + (rez state :corp moon-pool) + (card-ability state :corp moon-pool 0) + (prompt-is-card? state :corp :moon-pool) + (click-prompt state :corp "Done") + (click-card state :corp "Longevity Serum") + (click-prompt state :corp "Done") + (no-prompt? state :corp) + (is (in-rfg? moon-pool))))) + (deftest mr-stone ;; Mr Stone (do-game From b00d2233169c54fca3fa890364d6243ded6e2eac Mon Sep 17 00:00:00 2001 From: Artem Mikhalitsin Date: Thu, 28 Jul 2022 13:39:07 -0400 Subject: [PATCH 2/5] RFG moon pool even if no cards discarded --- src/clj/game/cards/assets.clj | 35 ++++++++++++++++------------- test/clj/game/cards/assets_test.clj | 7 ++++-- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/clj/game/cards/assets.clj b/src/clj/game/cards/assets.clj index 74d8b17d8e..5ce5f7288c 100644 --- a/src/clj/game/cards/assets.clj +++ b/src/clj/game/cards/assets.clj @@ -1385,21 +1385,26 @@ (effect-completed state side eid))))) :cancel-effect (effect (system-msg "declines to use Moon Pool to reveal any cards in Archives") (effect-completed eid))}] - {:abilities [{:prompt "Trash up to 2 cards from HQ" - :label "Trash up to 2 cards from HQ" - :cost [:remove-from-game] - :async true - :choices {:card #(and (corp? %) - (in-hand? %)) - :max 2} - :msg (msg "trash " (count targets) " cards from HQ ") - :effect (req (wait-for (trash-cards state :corp targets {:cause-card card}) - (continue-ability - state side - moon-pool-reveal-ability - card nil))) - :cancel-effect (effect (system-msg "declines to use Moon Pool to trash any cards from HQ") - (continue-ability moon-pool-reveal-ability card nil))}]}))) + (let [moon-pool-discard-ability + {:prompt "Trash up to 2 cards from HQ" + :choices {:card #(and (corp? %) + (in-hand? %)) + :max 2} + :msg (msg "trash " (count targets) " cards from HQ ") + :effect (req (wait-for (trash-cards state :corp targets {:cause-card card}) + (continue-ability + state side + moon-pool-reveal-ability + card nil))) + :cancel-effect (effect (system-msg "declines to use Moon Pool to trash any cards from HQ") + (continue-ability moon-pool-reveal-ability card nil))}] + {:abilities [{:label "Trash up to 2 cards from HQ. Shuffle up to 2 cards from Archives into R&D" + :cost [:remove-from-game] + :async true + :effect (effect (continue-ability + moon-pool-discard-ability + card nil))}]})))) + (defcard "Mr. Stone" {:events [{:event :runner-gain-tag diff --git a/test/clj/game/cards/assets_test.clj b/test/clj/game/cards/assets_test.clj index d20fb13ae3..0ccb8083aa 100644 --- a/test/clj/game/cards/assets_test.clj +++ b/test/clj/game/cards/assets_test.clj @@ -3133,7 +3133,9 @@ (click-card state :corp "Hostile Takeover") (click-card state :corp "Hostile Takeover") (score state :corp (get-content state :remote3 0)) - (is (= 1 (count (:scored (get-corp)))) "Hostile was scored"))) + (is (= 1 (count (:scored (get-corp)))) "Hostile was scored") + (is (find-card "Moon Pool" (:rfg (get-corp))) "Moon Pool is rfg'd") + (is (nil? (get-content state :remote1 0))))) (deftest moon-pool-rfg-when-no-cards-trashed-from-hq (do-game @@ -3148,7 +3150,8 @@ (click-card state :corp "Longevity Serum") (click-prompt state :corp "Done") (no-prompt? state :corp) - (is (in-rfg? moon-pool))))) + (is (find-card "Moon Pool" (:rfg (get-corp))) "Moon Pool is rfg'd") + (is (nil? (get-content state :remote1 0)))))) (deftest mr-stone ;; Mr Stone From 2ab98fda24b57b789dbc50153265c407260a97dd Mon Sep 17 00:00:00 2001 From: Artem Mikhalitsin Date: Thu, 28 Jul 2022 14:02:08 -0400 Subject: [PATCH 3/5] Add async to moon pool trash ability --- src/clj/game/cards/assets.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/clj/game/cards/assets.clj b/src/clj/game/cards/assets.clj index 5ce5f7288c..fd69bc9dc6 100644 --- a/src/clj/game/cards/assets.clj +++ b/src/clj/game/cards/assets.clj @@ -1390,6 +1390,7 @@ :choices {:card #(and (corp? %) (in-hand? %)) :max 2} + :async true :msg (msg "trash " (count targets) " cards from HQ ") :effect (req (wait-for (trash-cards state :corp targets {:cause-card card}) (continue-ability From 1186025e9bcf8c2774318731c089dfcb8ab72ea4 Mon Sep 17 00:00:00 2001 From: Artem Mikhalitsin Date: Thu, 28 Jul 2022 14:10:25 -0400 Subject: [PATCH 4/5] Fix moon pool grammar mistake --- src/clj/game/cards/assets.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clj/game/cards/assets.clj b/src/clj/game/cards/assets.clj index fd69bc9dc6..b6915795cf 100644 --- a/src/clj/game/cards/assets.clj +++ b/src/clj/game/cards/assets.clj @@ -1371,7 +1371,7 @@ (in-discard? %) (not (faceup? %))) :max 2} - :msg (msg "to reveal " (str/join " and " (map :title targets)) " from Archives and shuffle them into R&D") + :msg (msg "reveal " (str/join " and " (map :title targets)) " from Archives and shuffle them into R&D") :effect (req (wait-for (reveal state side targets) (doseq [c targets] (move state side c :deck)) From 51063ae87084121dd0651d7e6a9f1bdcf3ec4945 Mon Sep 17 00:00:00 2001 From: Artem Mikhalitsin Date: Thu, 28 Jul 2022 14:21:10 -0400 Subject: [PATCH 5/5] Consolidate moon pool let blocks --- src/clj/game/cards/assets.clj | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/clj/game/cards/assets.clj b/src/clj/game/cards/assets.clj index b6915795cf..2cbd6bb04e 100644 --- a/src/clj/game/cards/assets.clj +++ b/src/clj/game/cards/assets.clj @@ -1384,8 +1384,8 @@ card nil) (effect-completed state side eid))))) :cancel-effect (effect (system-msg "declines to use Moon Pool to reveal any cards in Archives") - (effect-completed eid))}] - (let [moon-pool-discard-ability + (effect-completed eid))} + moon-pool-discard-ability {:prompt "Trash up to 2 cards from HQ" :choices {:card #(and (corp? %) (in-hand? %)) @@ -1399,13 +1399,12 @@ card nil))) :cancel-effect (effect (system-msg "declines to use Moon Pool to trash any cards from HQ") (continue-ability moon-pool-reveal-ability card nil))}] - {:abilities [{:label "Trash up to 2 cards from HQ. Shuffle up to 2 cards from Archives into R&D" - :cost [:remove-from-game] - :async true - :effect (effect (continue-ability - moon-pool-discard-ability - card nil))}]})))) - + {:abilities [{:label "Trash up to 2 cards from HQ. Shuffle up to 2 cards from Archives into R&D" + :cost [:remove-from-game] + :async true + :effect (effect (continue-ability + moon-pool-discard-ability + card nil))}]}))) (defcard "Mr. Stone" {:events [{:event :runner-gain-tag