Skip to content

maglectric derezzes cards in servers too #8097

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
merged 1 commit into from
Apr 25, 2025
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
9 changes: 6 additions & 3 deletions src/clj/game/cards/hardware.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
get-only-card-to-access]]
[game.core.actions :refer [play-ability]]
[game.core.board :refer [all-active all-active-installed all-installed]]
[game.core.card :refer [corp? event? facedown? get-card get-counters get-title
[game.core.card :refer [agenda? corp? event? facedown? get-card get-counters get-title
get-zone hardware? has-subtype? has-any-subtype? ice? in-deck? in-discard?
in-hand? in-scored? installed? is-type? program? resource? rezzed?
runner? virus-program? faceup?]]
Expand Down Expand Up @@ -1531,10 +1531,13 @@
{:events [{:event :successful-run
:prompt "Derez a card?"
:skippable true
;; not - agendas cannot be rezzed, but faceup agendas are marked as 'rezzed' for the
;; diff system, so this is just a safeguard
:req (req (and
(= :hq (target-server context))
(some rezzed? (all-installed state :corp))))
:choices {:card (every-pred installed? corp? rezzed? ice?)}
(some (every-pred rezzed? (complement agenda?))
(all-installed state :corp))))
:choices {:card (every-pred installed? corp? rezzed? (complement agenda?))}
:cost [(->c :trash-can 1)]
:async true
:effect (req (derez state side eid target))}]})
Expand Down
18 changes: 18 additions & 0 deletions test/clj/game/cards/hardware_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3230,6 +3230,24 @@
(is (not (rezzed? (get-ice state :rd 0))) "not rezzed")
(is (= "Maglectric Rapid (748 Mod)" (get-in @state [:runner :discard 0 :title])) "Trashed Maglectric Rapid (748 Mod)")))

(deftest maglectric-rapid-748-derez-installed-card-issue-8095
(do-game
(new-game {:corp {:hand ["PAD Campaign"]}
:runner {:hand ["Maglectric Rapid (748 Mod)"]}})
(play-from-hand state :corp "PAD Campaign" "New remote")
(take-credits state :corp)
(play-from-hand state :runner "Maglectric Rapid (748 Mod)")
(run-empty-server state :hq)
(is (no-prompt? state :runner) "no targets")
(rez state :corp (get-content state :remote1 0))
(run-empty-server state :hq)
(click-prompt state :runner "Done")
(run-empty-server state :hq)
(click-card state :runner "PAD Campaign")
(is (not (rezzed? (get-content state :remote1 0))) "not rezzed")
(is (= "Maglectric Rapid (748 Mod)" (get-in @state [:runner :discard 0 :title])) "Trashed Maglectric Rapid (748 Mod)")))


(deftest madani-test
(do-game
(new-game {:runner {:hand ["Madani" "Ika" "Fermenter" "Rezeki"]}})
Expand Down
Loading