Skip to content

Commit

Permalink
Merge pull request #4451 from NoahTheDuke/nb/swift
Browse files Browse the repository at this point in the history
Swift
  • Loading branch information
NoahTheDuke authored Aug 23, 2019
2 parents 0dadac2 + 7facab5 commit 07ad043
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/clj/game/cards/hardware.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,13 @@
(clear-wait-prompt state :corp))}}}
card nil))}}}

"Swift"
{:in-play [:memory 1]
:events {:play-event {:req (req (and (has-subtype? target "Run")
(first-event? state side :play-event #(has-subtype? (first %) "Run"))))
:msg "gain a [click]"
:effect (effect (gain :click 1))}}}

"The Gauntlet"
{:implementation "Requires Runner to manually (and honestly) set how many ICE were broken directly protecting HQ"
:in-play [:memory 2]
Expand Down
37 changes: 37 additions & 0 deletions test/clj/game_test/cards/hardware.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,43 @@
(click-prompt state :runner "Yes")
(is (= (:credit (get-runner)) (+ 2 credits)) "Runner gained 2 credits"))))

(deftest swift
(letfn [(laundry-archives [state]
(play-from-hand state :runner "Dirty Laundry")
(click-prompt state :runner "Archives")
(run-successful state))]
(testing "Installing Swift gives the runner +1[mu]"
(do-game
(new-game {:runner {:hand ["Swift"]}})
(take-credits state :corp)
(play-from-hand state :runner "Swift")
(is (= 5 (core/available-mu state))) "The runner has 5[mu]"))
(testing "Playing a run event must gain the runner a click"
(do-game
(new-game {:runner {:hand ["Swift", "Dirty Laundry"]}})
(take-credits state :corp)
(play-from-hand state :runner "Swift")
(laundry-archives state)
(is (= 3 (:click (get-runner))) "Gain a click after playing the run event")))
(testing "Playing a second run event must not gain the runner a click"
(do-game
(new-game {:runner {:hand ["Swift", (qty "Dirty Laundry" 2)]}})
(take-credits state :corp)
(play-from-hand state :runner "Swift")
(laundry-archives state)
(is (= 3 (:click (get-runner))) "Gain a click after playing the first run event")
(laundry-archives state)
(is (= 2 (:click (get-runner))) "Don't gain a click after playing the second run event")))
(testing "Playing a run event, installing Swift, then playing another run event must not gain the runner a click"
(do-game
(new-game {:runner {:hand ["Swift", (qty "Dirty Laundry" 2)]}})
(take-credits state :corp)
(laundry-archives state)
(is (= 3 (:click (get-runner))) "Gain a click after playing the first run event")
(play-from-hand state :runner "Swift")
(laundry-archives state)
(is (= 1 (:click (get-runner))) "Don't gain a click after playing the second run event")))))

(deftest the-gauntlet
(testing "Access additional cards on run on HQ, not with Gang Sign. Issue #2749"
(do-game
Expand Down

0 comments on commit 07ad043

Please sign in to comment.