Skip to content

Fix: Pay moon pool RFG cost even if no cards are discarded #6486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions src/clj/game/cards/assets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -1384,22 +1384,27 @@
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))}]
{:abilities [{:prompt "Trash up to 2 cards from HQ"
:label "Trash up to 2 cards from HQ"
(effect-completed eid))}
moon-pool-discard-ability
{:prompt "Trash up to 2 cards from HQ"
: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
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
: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))}]})))
:effect (effect (continue-ability
moon-pool-discard-ability
card nil))}]})))

(defcard "Mr. Stone"
{:events [{:event :runner-gain-tag
Expand Down
20 changes: 19 additions & 1 deletion test/clj/game/cards/assets_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3133,7 +3133,25 @@
(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
(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 (find-card "Moon Pool" (:rfg (get-corp))) "Moon Pool is rfg'd")
(is (nil? (get-content state :remote1 0))))))

(deftest mr-stone
;; Mr Stone
Expand Down