Skip to content

Commit

Permalink
Merge pull request #7832 from NBKelly/info-bounty-no-mark
Browse files Browse the repository at this point in the history
Info bounty no mark
  • Loading branch information
NoahTheDuke authored Oct 29, 2024
2 parents 863467f + 9f6567b commit 9728003
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/clj/game/cards/resources.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1745,12 +1745,13 @@
:async true
:interactive (req true)
:once :per-turn
:req (req (first-event? state side :run-ends #(is-mark? state (target-server (first %)))))
:effect
(req (if (first-event? state side :end-breach-server #(is-mark? state (:from-server (first %))))
(do (system-msg state :runner (str "uses " (:title card) " to gain 2 [Credits]"))
(gain-credits state :runner eid 2))
(effect-completed state side eid)))}]})
:req (req (and (:marked-server context)
(first-event? state side :run-ends #(:marked-server (first %)))
(let [run-server (first (:server context))
evs (mapcat rest (filter #(= :end-breach-server (first %)) (:events context)))]
(some #(= run-server (:from-server (first %))) evs))))
:msg (msg "gain 2 [Credits]")
:effect (req (gain-credits state side eid 2))}]})

(defcard "Inside Man"
{:recurring 2
Expand Down
3 changes: 2 additions & 1 deletion src/clj/game/core/runs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,8 @@
(swap! state assoc-in [:end-run :ended] true)
(when (get-current-encounter state)
(queue-event state :end-of-encounter {:ice (get-current-ice state)}))
(let [run (:run @state)
(let [marked? (is-mark? state (get-in @state [:run :server 0]))
run (if marked? (assoc (:run @state) :marked-server true) (:run @state))
run-eid (:eid run)]
(swap! state assoc-in [:runner :register :last-run] run)
(swap! state update-in [:runner :credit] - (get-in @state [:runner :run-credit]))
Expand Down
30 changes: 30 additions & 0 deletions test/clj/game/cards/resources_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3285,6 +3285,36 @@
"Gained 2 credits when finished breaching mark")
(click-prompt state :runner "No action")))

(deftest info-bounty-cheating-out-creds
(do-game
(new-game {:corp {:hand ["Hedge Fund"]
:deck [(qty "Hedge Fund" 10)]}
:runner {:deck ["Info Bounty" "Virtuoso"]
:credits 10}})
(take-credits state :corp)
(core/set-mark state :hq)
(run-empty-server state :hq)
(click-prompt state :runner "No action")
(play-from-hand state :runner "Info Bounty")
(run-on state :rd)
(is (changed? [(:credit (get-runner)) 0]
(run-jack-out state))
"Didn't gain 2")))

(deftest info-bounty-correctly-getting-creds
(do-game
(new-game {:corp {:hand ["Hedge Fund"]
:deck [(qty "Hedge Fund" 10)]}
:runner {:deck ["Info Bounty" "Virtuoso"]
:credits 10}})
(take-credits state :corp)
(core/set-mark state :hq)
(play-from-hand state :runner "Info Bounty")
(is (changed? [(:credit (get-runner)) 2]
(run-empty-server state :hq)
(click-prompt state :runner "No action")
"Did gain 2"))))

(deftest inside-man-pay-credits-prompt
;; Pay-credits prompt
(do-game
Expand Down

0 comments on commit 9728003

Please sign in to comment.