Skip to content

Commit

Permalink
chronos, ibrahim, engram, vera, focus group, snoop
Browse files Browse the repository at this point in the history
  • Loading branch information
NBKelly committed Nov 2, 2024
1 parent 62a4126 commit d117554
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 92 deletions.
52 changes: 21 additions & 31 deletions src/clj/game/cards/assets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[game.core.checkpoint :refer [fake-checkpoint]]
[game.core.damage :refer [damage damage-prevent]]
[game.core.def-helpers :refer [corp-recur corp-rez-toast defcard
reorder-choice trash-on-empty get-x-fn]]
reorder-choice trash-on-empty get-x-fn with-revealed-hand]]
[game.core.drawing :refer [draw first-time-draw-bonus max-draw
remaining-draws]]
[game.core.effects :refer [is-disabled-reg? register-lingering-effect update-disabled-cards]]
Expand Down Expand Up @@ -1344,18 +1344,21 @@

(defcard "Ibrahim Salem"
(let [trash-ability (fn [card-type]
{:req (req (seq (filter #(is-type? % card-type) (:hand runner))))
:prompt (str "Choose a " card-type " to trash")
:choices (req (filter #(is-type? % card-type) (:hand runner)))
:async true
:effect (effect (trash eid target {:cause-card card}))
:msg (msg "trash " (:title target) " from the grip")})
(with-revealed-hand :runner {:event-side :corp}
{:req (req (seq (filter #(is-type? % card-type) (:hand runner))))
:prompt (str "Choose a " card-type " to trash")
:choices {:card #(and (in-hand? %)
(runner? %)
(is-type? % card-type))}
:async true
:effect (effect (trash eid target {:cause-card card}))
:msg (msg "trash " (:title target) " from the grip")}))
choose-ability {:label "Trash 1 card in the grip of a named type"
:once :per-turn
:req (req (seq (:hand runner)))
:prompt "Choose a card type"
:choices ["Event" "Hardware" "Program" "Resource"]
:msg (msg "reveal " (enumerate-str (map :title (:hand runner))))
:msg (msg "choose " target)
:async true
:effect (effect (continue-ability (trash-ability target) card nil))}]
{:additional-cost [(->c :forfeit)]
Expand Down Expand Up @@ -3014,33 +3017,20 @@
:display-origin true}}))}]})

(defcard "Vera Ivanovna Shuyskaya"
(let [select-and-trash {:async true
:prompt "Choose a card to trash"
:waiting-prompt true
:choices (req (cancellable (:hand runner) :sorted))
:msg (msg "trash " (:title target) " from the grip")
:effect (effect (trash eid target {:cause-card card}))}
ability {:interactive (req true)
(let [ability {:interactive (req true)
:optional {:prompt "Reveal the grip and trash a card?"
:player :corp
:autoresolve (get-autoresolve :auto-fire)
:yes-ability
{:async true
:effect (req (wait-for (reveal state side (:hand runner))
(system-msg state :corp (str "reveal "
(quantify (count (:hand runner)) "card")
" from grip: "
(enumerate-str (map :title (:hand runner)))))
(continue-ability state side select-and-trash card nil)))}
:yes-ability (with-revealed-hand :runner {:event-side :corp}
{:prompt "Choose a card to trash"
:req (req (seq (:hand runner)))
:choices {:card (every-pred in-hand? runner?)}
:async true
:msg (msg "trash " (:title target) " from the Grip")
:effect (req (trash state side eid target {:cause-card card}))})
:no-ability {:effect (effect (system-msg (str "declines to use " (:title card))))}}}]
{:events [{:event :agenda-scored
:interactive (req true)
:async true
:effect (effect (continue-ability ability card nil))}
{:event :agenda-stolen
:interactive (req true)
:async true
:effect (effect (continue-ability ability card nil))}]
{:events [(assoc ability :event :agenda-scored)
(assoc ability :event :agenda-stolen)]
:abilities [(set-autoresolve :auto-fire "Vera Ivanovna Shuyskaya")]}))

(defcard "Victoria Jenkins"
Expand Down
21 changes: 10 additions & 11 deletions src/clj/game/cards/events.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4176,17 +4176,16 @@
{:trace
{:base 3
:req (req (some #{:hq :rd :archives} (:successful-run runner-reg)))
:unsuccessful
(with-revealed-hand :corp {:event-side :corp :forced true}
{:prompt "Shuffle up to 2 cards into HQ"
:player :runner
:choices {:req (req (and (corp? target)
(in-hand? target)))
:max (req (min 2 (count (:hand corp))))}
:msg (msg "shuffle " (enumerate-str (map :title targets)) " into R&D")
:effect (req (doseq [t targets]
(move state :corp t :deck))
(shuffle! state :corp :deck))})}}})
:unsuccessful (with-revealed-hand :corp {:event-side :corp :forced true}
{:prompt "Shuffle up to 2 cards into R&D"
:player :runner
:choices {:req (req (and (corp? target)
(in-hand? target)))
:max (req (min 2 (count (:hand corp))))}
:msg (msg "shuffle " (enumerate-str (map :title targets)) " into R&D")
:effect (req (doseq [t targets]
(move state :corp t :deck))
(shuffle! state :corp :deck))})}}})

(defcard "Wildcat Strike"
{:on-play (choose-one-helper
Expand Down
40 changes: 24 additions & 16 deletions src/clj/game/cards/ice.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[game.core.damage :refer [damage]]
[game.core.def-helpers :refer [combine-abilities corp-recur defcard
do-brain-damage do-net-damage offer-jack-out
reorder-choice get-x-fn]]
reorder-choice get-x-fn with-revealed-hand]]
[game.core.drawing :refer [draw maybe-draw draw-up-to]]
[game.core.effects :refer [get-effects is-disabled? is-disabled-reg? register-lingering-effect unregister-effects-for-card unregister-static-abilities update-disabled-cards]]
[game.core.eid :refer [complete-with-result effect-completed make-eid]]
Expand Down Expand Up @@ -1593,21 +1593,24 @@
state side card
[{:event :corp-reveal
:duration :end-of-encounter
:async true
:req (req (and
; all revealed cards are in grip
(every? in-hand? targets)
; entire grip was revealed
(= (count targets) (count (:hand runner)))
; there are cards with the named card type
(some #(is-type? % cardtype) targets)))
:prompt "Choose revealed card to trash"
:choices (req (concat (filter #(is-type? % cardtype) targets) ["Done"]))
:not-distinct true
:msg (msg "trash " (:title target) " from the grip")
:effect (req (if (= "Done" target)
(effect-completed state side eid)
(trash state side eid target {:cause :subroutine})))}])))}
:async true
:effect (req (continue-ability
state side
(with-revealed-hand :runner {:skip-reveal true}
{:prompt "Choose revealed card to trash"
:choices {:card #(and (runner? %)
(in-hand? %)
(is-type? % cardtype))}
:msg (msg "trash " (:title target) " from the Grip")
:effect (req (trash state side eid target {:cause :subroutine}))})
card nil))}])))}
:subroutines [sub
sub]}))

Expand Down Expand Up @@ -3801,15 +3804,20 @@
" from the grip")
:async true
:effect (effect (reveal eid (:hand runner)))}
:abilities [{:async true
:req (req (pos? (get-counters card :power)))
:abilities [{:req (req (pos? (get-counters card :power)))
:cost [(->c :power 1)]
:label "Reveal all cards in the grip and trash 1 card"
:msg (msg "reveal all cards in the grip and trash " (:title target))
:choices (req (cancellable (:hand runner) :sorted))
:prompt "Choose a card to trash"
:effect (effect (reveal (:hand runner))
(trash eid target {:cause :subroutine}))}]
:async true
:effect (req (continue-ability
state side
(with-revealed-hand :runner {:event-side :corp}
{:prompt "Choose a card to trash"
:req (req (seq (:hand runner)))
:choices {:card (every-pred in-hand? runner?)}
:async true
:msg (msg "trash " (:title target) " from the Grip")
:effect (req (trash state side eid target {:cause-card card}))})
card nil))}]
:subroutines [(trace-ability 3 gain-power-counter)]})

(defcard "Snowflake"
Expand Down
20 changes: 6 additions & 14 deletions src/clj/game/cards/identities.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
rez-additional-cost-bonus rez-cost]]
[game.core.damage :refer [chosen-damage corp-can-choose-damage? damage
enable-corp-damage-choice]]
[game.core.def-helpers :refer [corp-recur defcard offer-jack-out]]
[game.core.def-helpers :refer [corp-recur defcard offer-jack-out with-revealed-hand]]
[game.core.drawing :refer [draw]]
[game.core.effects :refer [register-lingering-effect is-disabled?]]
[game.core.eid :refer [effect-completed get-ability-targets is-basic-advance-action? make-eid]]
Expand Down Expand Up @@ -520,19 +520,11 @@
(pos? (count (:hand runner)))))
:waiting-prompt true
:prompt "Choose the first card to trash?"
:yes-ability
{:async true
:msg (msg "look at the grip ( "
(enumerate-str (map :title (sort-by :title (:hand runner))))
" ) and choose the card that is trashed")
:effect
(effect (continue-ability
{:prompt "Choose 1 card to trash"
:choices (req (:hand runner))
:not-distinct true
:msg (msg "choose " (:title target) " to trash")
:effect (req (chosen-damage state :corp target))}
card nil))}
:yes-ability (with-revealed-hand :runner {:no-event true}
{:prompt "Choose 1 card to trash"
:choices {:card (every-pred runner? in-hand?)}
:msg (msg "choose " (:title target) " to trash")
:effect (req (chosen-damage state :corp target))})
:no-ability
{:effect (req (system-msg state :corp (str "declines to use " (:title card))))}}}]})

Expand Down
20 changes: 7 additions & 13 deletions src/clj/game/cards/operations.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[game.core.cost-fns :refer [play-cost trash-cost]]
[game.core.costs :refer [total-available-credits]]
[game.core.damage :refer [damage damage-bonus]]
[game.core.def-helpers :refer [choose-one-helper corp-recur cost-option defcard do-brain-damage reorder-choice something-can-be-advanced? get-x-fn]]
[game.core.def-helpers :refer [choose-one-helper corp-recur cost-option defcard do-brain-damage reorder-choice something-can-be-advanced? get-x-fn with-revealed-hand]]
[game.core.drawing :refer [draw]]
[game.core.effects :refer [register-lingering-effect]]
[game.core.eid :refer [effect-completed make-eid make-result]]
Expand Down Expand Up @@ -1028,18 +1028,12 @@
:prompt "Choose one"
:choices ["Event" "Hardware" "Program" "Resource"]
:async true
:msg (msg "choose " target)
:effect (req (let [type target
numtargets (count (filter #(= type (:type %)) (:hand runner)))]
(system-msg
state :corp
(str "uses " (:title card) " to choose " target
" and reveal "
(enumerate-str (map :title (sort-by :title (:hand runner))))
" from the grip"))
(wait-for
(reveal state side (:hand runner))
(continue-ability
state :corp
(continue-ability
state side
(with-revealed-hand :runner {:event-side :corp}
(when (pos? numtargets)
{:async true
:prompt "How many credits do you want to pay?"
Expand All @@ -1056,8 +1050,8 @@
:choices {:card installed?}
:effect (effect (add-prop target :advance-counter c {:placed true}))}
card nil))
(effect-completed state side eid))))})
card nil))))}})
(effect-completed state side eid))))}))
card nil)))}})

(defcard "Foxfire"
{:on-play
Expand Down
17 changes: 12 additions & 5 deletions src/clj/game/core/def_helpers.clj
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,23 @@
You can set the side that triggers the reveal (event-side) and if it displays as a forced reveal
(forced) via the args"
([target-side abi] (with-revealed-hand target-side nil abi))
([target-side {:keys [event-side forced] :as args} abi]
([target-side {:keys [event-side forced skip-reveal] :as args} abi]
{:async true
:effect (req
(wait-for (reveal-loud state (or event-side side) card args (get-in @state [target-side :hand]))
(if (get-in @state [target-side :openhand])
:effect (req (if skip-reveal
(if (get-in @state [target-side :openhand])
(continue-ability state side abi card targets)
(do (reveal-hand state target-side)
(wait-for (resolve-ability state side abi card targets)
(conceal-hand state target-side)
(effect-completed state side eid))))))}))
(effect-completed state side eid))))
(wait-for
(reveal-loud state (or event-side side) card args (get-in @state [target-side :hand]))
(if (get-in @state [target-side :openhand])
(continue-ability state side abi card targets)
(do (reveal-hand state target-side)
(wait-for (resolve-ability state side abi card targets)
(conceal-hand state target-side)
(effect-completed state side eid)))))))}))

(defmacro defcard
[title ability]
Expand Down
6 changes: 4 additions & 2 deletions src/clj/game/core/revealing.clj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

(defn reveal-loud
"Trigger the event for revealing one or more cards, and also handle the log printout"
[state side eid card {:keys [forced and-then] :as args} & targets]
[state side eid card {:keys [forced and-then no-event] :as args} & targets]
(let [cards-by-zone (group-by #(select-keys % [:side :zone]) (flatten targets))
strs (map #(str (enumerate-str (map :title (get cards-by-zone %)))
" from " (name-zone (:side %) (:zone %)))
Expand All @@ -39,4 +39,6 @@
(string/capitalize (name side)) " to reveal "
(enumerate-str strs) follow-up))
(system-msg state side (str "uses " (:title card) " to reveal " (enumerate-str strs) follow-up)))
(reveal state side eid targets)))
(if-not no-event
(reveal state side eid targets)
(effect-completed state side eid))))

0 comments on commit d117554

Please sign in to comment.