Skip to content

Commit

Permalink
add Laser Pointer test
Browse files Browse the repository at this point in the history
  • Loading branch information
francescopellegrini committed Aug 10, 2023
1 parent d45044e commit 2ef86b1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/clj/game/cards/programs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1829,9 +1829,11 @@
:async true
:effect (effect (continue-ability
{:optional
{:prompt "Trash Laser Pointer to bypass?"
{:prompt (msg "Trash Laser Pointer to bypass "
(card-str state current-ice)
"?")
:yes-ability
{:msg (msg "trash itself to bypass the current ice")
{:msg (msg "bypass" (card-str state current-ice))
:effect (req
(wait-for (trash state :runner (make-eid state eid) card
{:unpreventable :true
Expand Down
38 changes: 38 additions & 0 deletions test/clj/game/cards/programs_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3984,6 +3984,44 @@
(core/purge state :corp)
(is (empty? (get-program state)) "Lamprey trashed by purge")))

(deftest laser-pointer
(do-game
(new-game {:runner {:hand [(qty "Laser Pointer" 3)]
:credits 10}
:corp {:hand ["Envelope" "Starlit Knight" "Rototurret"]
:credits 50}})
(play-from-hand state :corp "Envelope" "HQ")
(play-from-hand state :corp "Starlit Knight" "HQ")
(play-from-hand state :corp "Rototurret" "HQ")
(rez state :corp (get-ice state :hq 0))
(rez state :corp (get-ice state :hq 1))
(rez state :corp (get-ice state :hq 2))
(take-credits state :corp)
(play-from-hand state :runner "Laser Pointer")
(play-from-hand state :runner "Laser Pointer")
(play-from-hand state :runner "Laser Pointer")
(run-on state :hq)
(run-continue state)
(changes-val-macro
1 (count (:discard (get-runner)))
"Laser Pointer trashed"
(click-prompt state :runner "Yes"))
(is (= :movement (:phase (get-run))) "Runner bypassed Rototurret")
(run-continue state)
(run-continue state)
(changes-val-macro
1 (count (:discard (get-runner)))
"Laser Pointer trashed"
(click-prompt state :runner "Yes"))
(is (= :movement (:phase (get-run))) "Runner bypassed Starlit Knight")
(run-continue state)
(run-continue state)
(changes-val-macro
1 (count (:discard (get-runner)))
"Laser Pointer trashed"
(click-prompt state :runner "Yes"))
(is (= :movement (:phase (get-run))) "Runner bypassed Envelope")))

(deftest leech
;; Leech - Reduce strength of encountered piece of ice
(do-game
Expand Down

0 comments on commit 2ef86b1

Please sign in to comment.