Skip to content

Commit

Permalink
Fix issue with Charlotte
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahTheDuke committed Mar 19, 2024
1 parent 7a573ce commit 0a8f7dd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/clj/game/cards/assets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -493,19 +493,23 @@

(defcard "Charlotte Caçador"
(let [ability {:label "Gain 4 [Credits] and draw 1 card"
:optional {:once :per-turn
:prompt "Remove 1 hosted advancement counter to gain 4 [Credits] and draw 1 card?"
:req (req (pos? (get-counters card :advancement)))
:yes-ability {:msg "remove 1 hosted advancement counter from itself to gain 4 [Credits] and draw 1 card"
:async true
:effect (req
(add-prop state :corp card :advance-counter -1)
(wait-for
(gain-credits state side 4)
(draw state side eid 1)))}}}
:interactive (req true)
:optional
{:once :per-turn
:prompt "Remove 1 hosted advancement counter to gain 4 [Credits] and draw 1 card?"
:req (req (pos? (get-counters card :advancement)))
:yes-ability
{:msg "remove 1 hosted advancement counter from itself to gain 4 [Credits] and draw 1 card"
:async true
:effect (req
(add-prop state :corp card :advance-counter -1)
(wait-for
(gain-credits state side 4)
(draw state side eid 1)))}}}
trash-ab {:cost [:advancement 1 :trash-can]
:label "Gain 3 [Credits]"
:msg (msg "gain 3 [Credits]")
:async true
:effect (req (gain-credits state :corp eid 3))}]
{:advanceable :always
:flags {:corp-phase-12 (req true)}
Expand Down
18 changes: 18 additions & 0 deletions test/clj/game/cards/assets_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,24 @@
"Corp gaind 3 credits")
(is (nil? (refresh cc)) "Charlotte Caçador got trashed"))))

(deftest charlotte-cacador-la-costa
(do-game
(new-game {:corp {:hand ["Charlotte Caçador" "La Costa Grid"]
:deck [(qty "Hedge Fund" 5)]
:credits 100}})
(play-from-hand state :corp "Charlotte Caçador" "New remote")
(play-from-hand state :corp "La Costa Grid" "Server 1")
(let [cc (get-content state :remote1 0)
lcg (get-content state :remote1 1)]
(advance state cc 2)
(rez state :corp cc)
(rez state :corp lcg)
(take-credits state :corp)
(take-credits state :runner)
(is (:corp-phase-12 @state) "Corp has opportunity to use Charlotte Caçador")
(end-phase-12 state :corp)
(is (some #{"Charlotte Caçador" "La Costa Grid"} (mapv :title (prompt-buttons :corp)))))))

(deftest chekist-scion
;; Chekist Scion
(do-game
Expand Down

0 comments on commit 0a8f7dd

Please sign in to comment.