Skip to content

Commit

Permalink
Merge pull request #4355 from NoahTheDuke/nb/fix-warroid-tracker-again
Browse files Browse the repository at this point in the history
Fix Warroid Tracker async, spacing in traces
  • Loading branch information
NoahTheDuke authored Aug 12, 2019
2 parents 13ddf97 + d8a9d47 commit b50e4d4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/clj/game/cards/upgrades.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1350,14 +1350,15 @@
(second target-zone)))))
:trace {:base 4
:successful
{:effect
{:async true
:effect
(req (let [n (min 2 (count (all-installed state :runner)))]
(system-msg
state side
(str "uses Warroid Tracker "
(if (pos? n)
(str "to force the runner to trash "
(quantify n " installed card"))
(quantify n "installed card"))
"but there are no installed cards to trash")))
(if (pos? n)
(do (show-wait-prompt state :corp "Runner to choose cards to trash")
Expand Down
6 changes: 3 additions & 3 deletions src/clj/game/core/abilities.clj
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
strength)
trigger-trace (select-keys trace [:player :other :base :bonus :link :priority :ability :strength])]
(wait-for (pay-sync state other (make-eid state eid) card [:credit boost])
(system-msg state other (str " spends " boost
(system-msg state other (str "spends " boost
" [Credits] to increase " (if (corp-start? trace) "link" "trace")
" strength to " (if (corp-start? trace)
runner-strength
Expand Down Expand Up @@ -421,8 +421,8 @@
((fnil + 0 0) link boost))
trace (assoc trace :strength strength)]
(wait-for (pay-sync state player (make-eid state eid) card [:credit boost])
(system-msg state player (str " spends " boost
"[Credits] to increase " (if (corp-start? trace) "trace" "link")
(system-msg state player (str "spends " boost
" [Credits] to increase " (if (corp-start? trace) "trace" "link")
" strength to " strength))
(clear-wait-prompt state other)
(show-wait-prompt state player
Expand Down
28 changes: 27 additions & 1 deletion test/clj/game_test/cards/upgrades.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2330,4 +2330,30 @@
(take-credits state :corp)
(is (= 2 (count (:hand (get-runner)))) "MaxX draws 2 cards")
(is (empty? (:prompt (get-corp))) "Corp has no prompt")
(is (empty? (:prompt (get-runner))) "Runner has no prompt")))))
(is (empty? (:prompt (get-runner))) "Runner has no prompt"))))
(testing "Interactions with IG. Issue #4329"
(do-game
(new-game {:corp {:id "Industrial Genomics: Growing Solutions"
:deck [(qty "Hedge Fund" 3)]
:hand ["Warroid Tracker" "Launch Campaign" (qty "Sure Gamble" 2)]
:credits 100}
:runner {:deck [(qty "Sure Gamble" 10)]
:hand ["Corroder" "Dyson Mem Chip"]
:credits 100}})
(play-from-hand state :corp "Warroid Tracker" "New remote")
(play-from-hand state :corp "Launch Campaign" "Remote 1")
(let [war (get-content state :remote1 0)]
(core/rez state :corp war)
(take-credits state :corp)
(play-from-hand state :runner "Corroder")
(play-from-hand state :runner "Dyson Mem Chip")
(run-empty-server state :remote1)
(click-card state :runner "Launch Campaign")
(is (zero? (count (:discard (get-runner)))) "Before trashing anything")
(click-prompt state :runner "Pay 2 [Credits] to trash")
(click-prompt state :corp "0")
(click-prompt state :runner "0")
(click-card state :runner "Corroder")
(click-card state :runner "Dyson Mem Chip")
(click-prompt state :runner "Done")
(is (= 2 (count (:discard (get-runner)))) "Runner trashes 2 cards to Warriod Tracker")))))

0 comments on commit b50e4d4

Please sign in to comment.