Skip to content

Commit

Permalink
Fixed Acme run-ends event. Fixed Acme triggering on non-ice rez.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwarwick committed Aug 19, 2018
1 parent 50a0d6a commit eb9ad12
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/clj/game/cards/identities.clj
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,16 @@
:events {:run {:effect (req (when (and (outermost? run-position run-ices)
(rezzed? current-ice))
(activate state card true)))}
:rez {:effect (req (when (outermost? run-position run-ices)
(activate state card true)))}
:rez {:effect (req (when (and (outermost? run-position run-ices)
(= (:cid current-ice) (:cid target)))
(activate state card true)))}
:derez {:effect (req (when (outermost? run-position run-ices)
(activate state card false)))}
:pass-ice {:effect (req (when (and (outermost? run-position run-ices)
(get-in card [:special :acme-active]))
(activate state card false)))}
:end-run {:effect (req (when (get-in card [:special :acme-active])
(activate state card false)))}}})
:run-ends {:effect (req (when (get-in card [:special :acme-active])
(activate state card false)))}}})

"Adam: Compulsive Hacker"
{:events {:pre-start-game
Expand Down
29 changes: 29 additions & 0 deletions test/clj/game_test/cards/identities.clj
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,35 @@
(run-on state :archives)
(is (core/is-tagged? state) "Runner is tagged when encountering outermost ice")
(run-continue state)
(is (not (core/is-tagged? state)) "Runner is not tagged when encountering second ice")))
(testing "Tag loss when runner jacks out"
(do-game
(new-game
(make-deck "Acme Consulting: The Truth You Need" ["Vanilla" (qty "Hedge Fund" 5)])
(default-runner))
(play-from-hand state :corp "Vanilla" "Archives")
(core/rez state :corp (get-ice state :archives 0))
(take-credits state :corp)
(run-on state :archives)
(is (core/is-tagged? state) "Runner is tagged when encountering outermost ice")
(run-jack-out state)
(is (not (core/is-tagged? state)) "Runner no longer tagged after jacking out")))
(testing "No tag gained when rezzing something other than ice"
(do-game
(new-game
(make-deck "Acme Consulting: The Truth You Need" ["Vanilla" "NGO Front"])
(default-runner))
(play-from-hand state :corp "Vanilla" "Archives")
(play-from-hand state :corp "NGO Front" "New remote")
(take-credits state :corp)
(run-on state :archives)
(is (not (core/is-tagged? state)) "Runner is not yet tagged when encountering outermost ice")
(core/rez state :corp (get-ice state :archives 0))
(is (= 1 (get-in @state [:runner :tag :additional])) "Runner gains 1 additional tag when ice rezzed")
(core/rez state :corp (get-content state :remote1 0))
(is (:rezzed (get-content state :remote1 0)) "NGO Front now rezzed")
(is (= 1 (get-in @state [:runner :tag :additional])) "Runner does not gain a tag when asset rezzed")
(run-continue state)
(is (not (core/is-tagged? state)) "Runner is not tagged when encountering second ice"))))

(deftest adam:-compulsive-hacker
Expand Down

0 comments on commit eb9ad12

Please sign in to comment.