Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Mr Li and Muertos Gang Member #4354

Merged
merged 1 commit into from
Aug 12, 2019
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
41 changes: 20 additions & 21 deletions src/clj/game/cards/resources.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1421,33 +1421,32 @@
:msg (msg "draw 2 cards")
:async true
:effect (req (wait-for (draw state side 2 nil)
(if-let [drawn (get-in @state [:runner :register :most-recent-drawn])]
(continue-ability
state side
(continue-ability
state side
(if-let [drawn (get-in @state [:runner :register :most-recent-drawn])]
{:prompt "Select 1 card to add to the bottom of the Stack"
:choices {:req #(and (in-hand? %)
(some (fn [c] (same-card? c %)) drawn))}
:msg (msg "add 1 card to the bottom of the Stack")
:effect (req (move state side target :deck))}
card nil)
(effect-completed state side eid))))}]}
:effect (req (move state side target :deck))})
card nil)))}]}

"Muertos Gang Member"
{:effect (req (resolve-ability
state :corp
{:prompt "Select a card to derez"
:choices {:req #(and (corp? %)
(not (agenda? %))
(:rezzed %))}
:effect (req (derez state side target))}
card nil))
:leave-play (req (resolve-ability
state :corp
{:prompt "Select a card to rez, ignoring the rez cost"
:choices {:req #(not (:rezzed %))}
:effect (req (rez state side target {:ignore-cost :rez-cost})
(system-msg state side (str "rezzes " (:title target) " at no cost")))}
card nil))
{:effect (effect (continue-ability
:corp
{:prompt "Select a card to derez"
:choices {:req #(and (corp? %)
(not (agenda? %))
(:rezzed %))}
:effect (effect (derez target))}
card nil))
:leave-play (effect (continue-ability
:corp
{:prompt "Select a card to rez, ignoring the rez cost"
:choices {:req (complement rezzed?)}
:effect (effect (rez target {:ignore-cost :rez-cost :no-msg true})
(system-say (str (:title card) " allows the Corp to rez " (:title target) " at no cost")))}
card nil))
:abilities [{:msg "draw 1 card"
:async true
:cost [:trash]
Expand Down
17 changes: 8 additions & 9 deletions src/clj/game/core/actions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@
([state side card] (rez state side (make-eid state) card nil))
([state side card args]
(rez state side (make-eid state) card args))
([state side eid {:keys [disabled] :as card} {:keys [ignore-cost no-warning force no-get-card paid-alt cached-bonus] :as args}]
([state side eid {:keys [disabled] :as card}
{:keys [ignore-cost no-warning force no-get-card paid-alt cached-bonus no-msg] :as args}]
(let [eid (eid-set-defaults eid :source nil :source-type :rez)
card (if no-get-card
card
Expand Down Expand Up @@ -549,14 +550,12 @@
(update! state side (-> h
(update-in [:zone] #(map to-keyword %))
(update-in [:host :zone] #(map to-keyword %)))))
(system-msg state side (str (build-spend-msg cost-str "rez" "rezzes")
(:title card)
(cond
paid-alt
" by paying its alternative cost"

ignore-cost
" at no cost")))
(when-not no-msg
(system-msg state side (str (build-spend-msg cost-str "rez" "rezzes")
(:title card)
(cond
paid-alt " by paying its alternative cost"
ignore-cost " at no cost"))))
(when (and (not no-warning) (:corp-phase-12 @state))
(toast state :corp "You are not allowed to rez cards between Start of Turn and Mandatory Draw.
Please rez prior to clicking Start Turn in the future." "warning"
Expand Down