Skip to content

Commit

Permalink
Merge pull request #7273 from francescopellegrini/fix/docklands-crack…
Browse files Browse the repository at this point in the history
…down

fix Docklands Crackdown
  • Loading branch information
NoahTheDuke authored Feb 2, 2024
2 parents 36d3af2 + 6e33081 commit ab48806
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
30 changes: 15 additions & 15 deletions src/clj/game/cards/assets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -787,21 +787,21 @@
:on-trash executive-trash-effect})

(defcard "Docklands Crackdown"
{:abilities [{:cost [:click 2]
:keep-menu-open :while-2-clicks-left
:msg "place 1 power counter"
:effect (effect (add-counter card :power 1))}]
:static-abilities [{:type :install-cost
:req (req (and (pos? (get-counters card :power))
(not (get-in @state [:per-turn (:cid card)]))))
:value (req (get-counters card :power))}]
:events [{:event :runner-install
:silent (req true)
:req (req (and (pos? (get-counters card :power))
(not (get-in @state [:per-turn (:cid card)]))))
:msg (msg "increase the install cost of " (:title (:card context))
" by " (get-counters card :power) " [Credits]")
:effect (req (swap! state assoc-in [:per-turn (:cid card)] true))}]})
(letfn [(not-triggered? [state] (no-event? state :runner :runner-install))]
{:abilities [{:cost [:click 2]
:keep-menu-open :while-2-clicks-left
:msg "place 1 power counter in itself"
:effect (effect (add-counter card :power 1))}]
:static-abilities [{:type :install-cost
:req (req (and (runner? target)
(not-triggered? state)))
:value (req (get-counters card :power))}]
:events [{:event :runner-install
:silent (req true)
:req (req (and (pos? (get-counters card :power))
(not-triggered? state)))
:msg (msg "increase the install cost of " (:title (:card context))
" by " (get-counters card :power) " [Credits]")}]}))

(defcard "Dr. Vientiane Keeling"
{:static-abilities [(runner-hand-size+ (req (- (get-counters card :power))))]
Expand Down
20 changes: 16 additions & 4 deletions test/clj/game/cards/assets_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1566,15 +1566,27 @@
;; Docklands Crackdown
(letfn [(dlcd-test [number]
(do-game
(new-game {:corp {:deck ["Docklands Crackdown"]}
:runner {:deck ["Cache"]}})
(new-game {:corp {:hand ["Docklands Crackdown" (qty "Vanilla" 2)]}
:runner {:hand [(qty "Gachapon" 2)]}})
(play-from-hand state :corp "Docklands Crackdown" "New remote")
(let [dlcd (get-content state :remote1 0)]
(rez state :corp dlcd)
(core/add-counter state :corp dlcd :power number)
(take-credits state :corp)
(play-from-hand state :runner "Cache")
(is (= (- 4 number) (:credit (get-runner)))))))]
(take-credits state :runner)
(is (changed? [(:credit (get-corp)) 0]
(play-from-hand state :corp "Vanilla" "HQ"))
"No additional cost for installing the first Corp card")
(is (changed? [(:credit (get-corp)) 0]
(play-from-hand state :corp "Vanilla" "R&D"))
"No additional cost for installing the next Corp card")
(take-credits state :corp)
(is (changed? [(:credit (get-runner)) (- number)]
(play-from-hand state :runner "Gachapon"))
"Additional cost for installing the first Runner card")
(is (changed? [(:credit (get-runner)) 0]
(play-from-hand state :runner "Gachapon"))
"No additional cost for installing the next Runner card"))))]
(doall (map dlcd-test [0 1 2 3 4]))))

(deftest dr-vientiane-keeling
Expand Down

0 comments on commit ab48806

Please sign in to comment.