Skip to content

Commit

Permalink
Merge pull request mtgred#481 from NBKelly/midnight-sun-hb-echo
Browse files Browse the repository at this point in the history
Echo
  • Loading branch information
NoahTheDuke authored Jul 10, 2022
2 parents e8e4e57 + 4188d9e commit 2478bb0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/clj/game/cards/ice.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,15 @@
{:subroutines [(corp-recur)
(install-from-hq-or-archives-sub {:ignore-all-cost true})]})

(defcard "Echo"
{:events [{:event :rez
:req (req (and (has-subtype? (:card context) "Harmonic")
(ice? (:card context))))
:effect (effect (add-counter card :power 1))}
{:event :counter-added
:req (req (same-card? card target))
:effect (effect (reset-variable-subs card (get-counters card :power) end-the-run {:variable true :front true}))}]})

(defcard "Eli 1.0"
{:subroutines [end-the-run
end-the-run]
Expand Down
22 changes: 22 additions & 0 deletions test/clj/game/cards/ice_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,28 @@
(is (= "Fairchild" (:title (get-ice state :hq 1)))
"Fairchild is now installed in the outermost position protecting HQ")))))

(deftest echo
(do-game
(new-game {:corp {:deck [(qty "Echo" 3)] :credits 15}})
(play-from-hand state :corp "Echo" "HQ")
(play-from-hand state :corp "Echo" "HQ")
(play-from-hand state :corp "Echo" "HQ")
(let [e1 (get-ice state :hq 0)
e2 (get-ice state :hq 1)
e3 (get-ice state :hq 2)]
(rez state :corp e1)
(is (= 1 (get-counters (refresh e1) :power)) "Placed 1 counter on rezzed Echo")
(is (= 0 (get-counters (refresh e2) :power)) "Placed 0 counter on unrezzed Echo")
(rez state :corp e2)
(is (= 2 (get-counters (refresh e1) :power)) "Placed 2 counters on rezzed Echo")
(is (= 1 (get-counters (refresh e2) :power)) "Placed 1 counter on rezzed Echo")
(is (= 0 (get-counters (refresh e3) :power)) "Placed 0 counter on unrezzed Echo")
(rez state :corp e3)
(is (= 3 (get-counters (refresh e1) :power)) "Placed 3 counters on rezzed Echo")
(is (= 2 (get-counters (refresh e2) :power)) "Placed 2 counter on rezzed Echo")
(is (= 1 (get-counters (refresh e3) :power)) "Placed 1 counter on unrezzed Echo")
(is (= 3 (count (:subroutines (refresh e1)))) "Should have 3 subroutine"))))

(deftest endless-eula-runner-side-ability
;; Runner side ability
(do-game
Expand Down

0 comments on commit 2478bb0

Please sign in to comment.