Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/clj/game/core/sabotage.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
(let [unknown-str (str (quantify (count unknown) (if (seq known) "unknown card" "card"))
(when public (str " (" (enumerate-cards unknown)")")))]
(if (seq known)
(str " " (enumerate-str (concat (map :title known)
(when (seq unknown)
[unknown-str])))
(str (enumerate-str (concat (map :title known)
(when (seq unknown)
[unknown-str])))
" from " from)
(str unknown-str " from " from))))

Expand All @@ -44,11 +44,11 @@
known-rd-cards (filter #(contains? (set (get-in @state [:breach :known-cids :deck] [])) (:cid %)) to-trash)
unknown-hq-cards (filter #(not (contains? (set (get-in @state [:breach :known-cids :hand] [])) (:cid %))) targets)
unknown-rd-cards (filter #(not (contains? (set (get-in @state [:breach :known-cids :deck] [])) (:cid %))) rnd-to-trash)
public-msg (str "trashes"
public-msg (str "trashes "
(when (pos? selected-hq) (cards-str known-hq-cards unknown-hq-cards "HQ" nil))
(when (and (pos? selected-hq) (pos? selected-rd)) " and ")
(when (pos? selected-rd) (cards-str known-rd-cards unknown-rd-cards "the top of R&D" nil)))
private-msg (str "trashes"
private-msg (str "trashes "
(when (pos? selected-hq) (cards-str known-hq-cards unknown-hq-cards "hq" true))
(when (and (pos? selected-hq) (pos? selected-rd)) " and ")
(when (pos? selected-rd) (cards-str known-rd-cards unknown-rd-cards "the top of R&D" true)))]
Expand Down
7 changes: 5 additions & 2 deletions test/clj/game/core/sabotage_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"3 cards from HQ trashed"))
(is (no-prompt? state :corp) "No Corp prompt open")
(is (no-prompt? state :runner) "No Runner prompt open")
(is (= 3 (count (:discard (get-corp)))) "Archives has 3 cards")))
(is (= 3 (count (:discard (get-corp)))) "Archives has 3 cards")
(is (last-log-contains? state "trashes 3 cards from HQ") "Has a space before the card count")))
(testing "Choosing only from R&D"
(do-game
(new-game {:corp {:deck [(qty "Hedge Fund" 15)]}})
Expand Down Expand Up @@ -68,7 +69,9 @@
"2 cards from HQ trashed"))
(is (no-prompt? state :corp) "No Corp prompt open")
(is (no-prompt? state :runner) "No Runner prompt open")
(is (= 3 (count (:discard (get-corp)))) "Archives has 3 cards")))
(is (= 3 (count (:discard (get-corp)))) "Archives has 3 cards")
(is (last-log-contains? state "trashes 2 cards from HQ and 1 card from the top of R&D")
"Has spaces before the HQ and R&D segments")))
(testing "Forced to trash some cards from HQ"
(do-game
(new-game {:corp {:deck [(qty "Hedge Fund" 7)]}})
Expand Down
Loading