Skip to content

Commit

Permalink
Expose end-effects in choice prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Bogart committed May 22, 2019
1 parent d36e6e8 commit 773bb15
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/clj/game/core/abilities.clj
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,13 @@

(defn- do-choices
"Handle a choices ability"
[state side {:keys [choices player priority cancel-effect not-distinct prompt eid prompt-type] :as ability}
[state side {:keys [cancel-effect choices eid end-effect not-distinct player priority
prompt prompt-type show-discard] :as ability}
card targets]
(let [s (or player side)
ab (dissoc ability :choices)
args {:priority priority :cancel-effect cancel-effect :prompt-type prompt-type}]
args {:priority priority :cancel-effect cancel-effect :prompt-type prompt-type
:show-discard show-discard :end-effect end-effect}]
(if (map? choices)
;; Two types of choices use maps: select prompts, and :number prompts.
(cond
Expand Down Expand Up @@ -319,9 +321,7 @@
(letfn [(wrap-function [args kw]
(let [f (kw args)] (if f (assoc args kw #(f state side (:eid ability) card [%])) args)))]
(show-prompt state side (:eid ability) card message choices #(resolve-ability state side ability card [%])
(-> args
(wrap-function :cancel-effect)
(wrap-function :end-effect))))))
(wrap-function args :cancel-effect)))))

(defn- add-to-prompt-queue
"Adds a newly created prompt to the current prompt queue"
Expand Down

0 comments on commit 773bb15

Please sign in to comment.