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

drm async and target fix #7874

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
99 changes: 51 additions & 48 deletions src/clj/game/cards/operations.clj
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,26 @@
:effect (effect (damage-bonus :brain 1))}]})

(defcard "Digital Rights Management"
(let [end-effect
(req (system-msg state side "can not score agendas for the remainder of the turn")
(swap! state assoc-in [:corp :register :cannot-score]
(filter agenda? (all-installed state :corp)))
(register-events
state side card
[{:event :corp-install
:duration :until-corp-turn-begins
:async true
:req (req (agenda? (:card context)))
:effect (req
(register-turn-flag!
state side
(:card context) :can-score
(fn [state _ card]
(if (same-card? card (:card context))
((constantly false) (toast state :corp "Cannot score due to Digital Rights Management." "warning"))
true)))
(effect-completed state side eid))}])
(effect-completed state side eid))]
{:on-play
{:req (req (and (< 1 (:turn @state))
(not (some #{:hq} (:successful-run runner-reg-last)))))
Expand All @@ -720,54 +740,37 @@
:msg (msg (if (= "None" target)
"shuffle R&D"
(str "reveal " (:title target) " from R&D and add it to HQ")))
:effect (let [end-effect (req (system-msg state side "can not score agendas for the remainder of the turn")
(swap! state assoc-in [:corp :register :cannot-score]
(filter agenda? (all-installed state :corp)))
(register-events
state side card
[{:event :corp-install
:duration :until-corp-turn-begins
:async true
:req (req (agenda? (:card context)))
:effect (req
(register-turn-flag!
state side
(:card context) :can-score
(fn [state _ card]
(if (same-card? card (:card context))
((constantly false) (toast state :corp "Cannot score due to Digital Rights Management." "warning"))
true)))
(effect-completed state side eid))}])
(effect-completed state side eid))]
(req (wait-for
(resolve-ability
state side
(when-not (= "None" target)
{:async true
:effect (req (wait-for (reveal state side target)
(move state side target :hand)
(effect-completed state side eid)))})
card targets)
(shuffle! state side :deck)
(continue-ability
state side
{:prompt "Choose a card in HQ to install"
:choices {:card #(and (in-hand? %)
(corp? %)
(not (operation? %)))}
:effect (req (wait-for (resolve-ability
state side
(let [card-to-install target]
{:prompt "Choose a server"
:choices (remove #{"HQ" "R&D" "Archives"} (installable-servers state card-to-install))
:async true
:effect (effect (corp-install eid card-to-install target {:msg-keys {:install-source card
:display-origin true}}))})
target nil)
(end-effect state side eid card targets)))
:cancel-effect (effect (system-msg (str "declines to use " (:title card) " to install a card"))
(end-effect eid card targets))}
card nil))))}})
:async true
:effect (req (wait-for
(resolve-ability
state side
(when-not (= "None" target)
{:async true
:effect (req (wait-for (reveal state side target)
(move state side target :hand)
(effect-completed state side eid)))})
card targets)
(shuffle! state side :deck)
(continue-ability
state side
{:prompt "Choose a card in HQ to install"
:choices {:card #(and (in-hand? %)
(corp? %)
(not (operation? %)))}
:async true
:effect (req (wait-for (resolve-ability
state side
(let [card-to-install target]
{:prompt "Choose a server"
:choices (remove #{"HQ" "R&D" "Archives"} (installable-servers state card-to-install))
:async true
:effect (effect (corp-install eid card-to-install target {:msg-keys {:install-source card
:display-origin true}}))})
card nil)
(end-effect state side eid card targets)))
:cancel-effect (effect (system-msg (str "declines to use " (:title card) " to install a card"))
(end-effect eid card targets))}
card nil)))}}))

(defcard "Distract the Masses"
(let [shuffle-two {:async true
Expand Down
Loading