Skip to content

Commit

Permalink
Merge pull request #5068 from NoahTheDuke/nb/may-fixes
Browse files Browse the repository at this point in the history
May Fixes
  • Loading branch information
NoahTheDuke authored May 3, 2020
2 parents 011f5a7 + 754c5e6 commit 37b7225
Show file tree
Hide file tree
Showing 36 changed files with 811 additions and 561 deletions.
6 changes: 1 addition & 5 deletions src/clj/game/cards/agendas.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1679,11 +1679,7 @@
{:derezzed-events
[{:event :pre-agenda-scored
:req (req (and (same-card? target card)
(let [agenda-cids (->> (turn-events state :corp :corp-install)
(filter #(agenda? (first %)))
(map #(:cid (first %)))
(into #{}))]
(contains? agenda-cids (:cid card)))))
(= :this-turn (installed? target))))
:effect (effect (register-turn-flag!
card :can-score
(fn [state side other-card]
Expand Down
2 changes: 1 addition & 1 deletion src/clj/game/cards/assets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
(def executive-trash-effect
{:when-inactive true
:req (req (and (= side :runner)
(same-card? card (:access @state))))
(same-card? target (:access @state))))
:msg "add it to the Runner's score area as an agenda worth 2 agenda points"
:async true
:effect (req (as-agenda state :runner eid card 2))})
Expand Down
39 changes: 20 additions & 19 deletions src/clj/game/cards/events.clj
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@
:max (req (count (:hand runner)))}
:cancel-effect (effect (continue-ability (ec 0 []) card nil))
:async true
:effect (req (let [trash-cost (apply + (map :cost targets))
:effect (req (let [trash-cost (reduce + (keep :cost targets))
to-trash targets]
(wait-for (trash-cards state side to-trash {:unpreventable true})
(continue-ability state side (ec trash-cost to-trash) card nil))))}))
Expand All @@ -889,15 +889,15 @@
(->> (:events (:last-run runner-reg))
(filter #(= :pass-ice (first %)))
(map second)
(keep #(get-card state %))
(keep #(get-card state (first %)))
(filter (complement rezzed?))
seq)))
:prompt "Choose an unrezzed piece of ICE that you passed on your last run"
:choices {:req (req (some #(same-card? :installed-cid target %)
:choices {:req (req (some #(same-card? target %)
(->> (:events (:last-run runner-reg))
(filter #(= :pass-ice (first %)))
(map second)
(keep #(get-card state %))
(keep #(get-card state (first %)))
(filter (complement rezzed?)))))}
:msg (msg "trash " (card-str state target))
:effect (effect (trash eid target nil))})
Expand Down Expand Up @@ -1521,6 +1521,7 @@
:choices (req runnable-servers)
:effect (effect (make-run eid target nil card))
:events [{:event :encounter-ice
:req (req (first-run-event? state side :encounter-ice))
:once :per-run
:msg (msg "bypass " (:title target))
:effect (req (bypass-ice state))}]})
Expand Down Expand Up @@ -2690,21 +2691,21 @@
:choices (req (cancellable
(filter program? ((if (= where "Heap") :discard :deck) runner))))
:async true
:effect (effect (trigger-event :searched-stack nil)
(shuffle! :deck)
(register-events
card
(let [program target]
[{:event :runner-turn-ends
:duration :end-of-turn
:req (req (let [program (find-cid (:cid program) (all-installed state :runner))]
(get-in program [:special :test-run])))
:msg (msg "move " (:title program) " to the top of the stack")
:effect (effect (move (find-cid (:cid program) (all-installed state :runner))
:deck {:front true}))}]))
(runner-install (assoc eid :source card :source-type :runner-install)
(assoc-in target [:special :test-run] true)
{:ignore-all-cost true}))})
:effect (req (trigger-event state side :searched-stack nil)
(shuffle! state side :deck)
(wait-for (runner-install state side (make-eid state {:source card :source-type :runner-install})
target {:ignore-all-cost true})
(if async-result
(let [installed-card (update! state side (assoc-in async-result [:special :test-run] true))]
(register-events
state side installed-card
[{:event :runner-turn-ends
:duration :end-of-turn
:req (req (get-in (find-latest state installed-card) [:special :test-run]))
:msg (msg "move " (:title installed-card) " to the top of the stack")
:effect (effect (move (find-latest state installed-card) :deck {:front true}))}])
(effect-completed state side eid))
(effect-completed state side eid))))})
card nil))})

(define-card "The Maker's Eye"
Expand Down
80 changes: 44 additions & 36 deletions src/clj/game/cards/hardware.clj
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@
:abilities [(break-sub
[:trash] 2 "All"
{:req (req (if-let [boomerang-target (get-in card [:special :boomerang-target])]
(same-card? :installed-cid current-ice boomerang-target)
(same-card? current-ice boomerang-target)
true)) ; When eg. flipped by Assimilator
:additional-ability
{:effect (effect
(register-events
;; Boomerang is trashed at this point
(find-latest state card)
(find-card "Boomerang" (:discard (:runner @state)))
(let [server (:server run)]
[{:event :run-ends
:once :per-run
Expand Down Expand Up @@ -234,11 +234,15 @@
(= 1 (+ (event-count state side :runner-trash grip-or-stack-trash?)
(event-count state side :corp-trash grip-or-stack-trash?))))))
:prompt "Add a trashed card to the bottom of the stack"
:choices (req (conj (mapv #(assoc % :zone [:discard]) (sort-by :title (filter :cid targets))) "No action"))
:effect (req (when-not (= "No action" target)
(system-msg state side (str "uses Buffer Drive to add " (:title target)
" to the bottom of the stack"))
(move state side (get-card state (assoc target :zone [:discard])) :deck)))}]
:choices (req (conj (sort (map :title (filter :cid targets))) "No action"))
:async true
:effect (req (if (= "No action" target)
(effect-completed state side eid)
(do (system-msg state side
(str "uses Buffer Drive to add " target
" to the bottom of the stack"))
(move state side (find-card target (:discard (:runner @state))) :deck)
(effect-completed state side eid))))}]
{:events [(assoc triggered-ability :event :runner-trash)
(assoc triggered-ability :event :corp-trash)]
:abilities [{:label "Add a card from the heap to the top of the stack"
Expand Down Expand Up @@ -761,38 +765,42 @@
(continue-ability state side
(shuffle-next set-aside target to-shuffle)
card nil)))}))]
{:abilities [{:label "Set aside 6 cards and resolve effect"
{:abilities [{:label "Install a card from the top of the stack"
:cost [:trash]
:prompt (msg "The set aside cards are: " (join ", " (map :title (take 6 (:deck runner)))))
:msg (msg "set aside 6 cards and start resolving the effect")
:choices (req ["OK"])
:msg "install a card from the top of the stack"
:async true
:effect (req (let [set-aside (sort-by :title (take 6 (:deck runner)))]
(show-wait-prompt state :corp (str "Runner to resolve " (:title card)))
(continue-ability
state side
{:prompt "Choose a card to install"
:async true
:choices (req (concat (filter #(and (or (program? %)
(and (resource? %)
(has-subtype? % "Virtual")))
(can-pay? state side
(assoc eid :source card :source-type :runner-install)
% nil [:credit (install-cost state side % {:cost-bonus -2})]))
set-aside)
["No action"]))
:cancel-effect (effect (continue-ability (shuffle-next set-aside nil nil) card nil))
:effect (req (if (= "No action" target)
(continue-ability state side (shuffle-next set-aside nil nil) card nil)
(let [to-install target
set-aside (remove-once #(= % target) set-aside)
new-eid (assoc eid :source card :source-type :runner-install)]
(wait-for (runner-install state side new-eid target {:cost-bonus -2})
(continue-ability state side (shuffle-next set-aside nil nil) card nil)))))}
card nil)))}]}))
(show-wait-prompt state :corp "Runner to resolve Gachapon")
(wait-for
(resolve-ability state side
{:prompt (msg "The set aside cards are: " (join ", " (map :title set-aside)))
:choices ["OK"]}
card nil)
(continue-ability
state side
{:prompt "Choose a card to install"
:async true
:choices (req (concat
(filter #(and (or (program? %)
(and (resource? %)
(has-subtype? % "Virtual")))
(can-pay? state side
(assoc eid :source card :source-type :runner-install)
% nil [:credit (install-cost state side % {:cost-bonus -2})]))
set-aside)
["No action"]))
:cancel-effect (effect (continue-ability (shuffle-next set-aside nil nil) card nil))
:effect (req (if (= "No action" target)
(continue-ability state side (shuffle-next set-aside nil nil) card nil)
(let [to-install target
set-aside (remove-once #(= % target) set-aside)
new-eid (assoc eid :source card :source-type :runner-install)]
(wait-for (runner-install state side new-eid target {:cost-bonus -2})
(continue-ability state side (shuffle-next set-aside nil nil) card nil)))))}
card nil))))}]}))

(define-card "Gebrselassie"
{:abilities [{:msg (msg "host it on an installed non-AI icebreaker")
{:abilities [{:msg "host it on an installed non-AI icebreaker"
:cost [:click 1]
:choices {:card #(and (installed? %)
(has-subtype? % "Icebreaker")
Expand All @@ -816,7 +824,7 @@
:events [{:event :pump-breaker
:req (req (same-card? target (:host card)))
:effect (req (let [last-pump (assoc (second targets)
:duration :end-of-run
:duration :end-of-turn
:original-duration (:duration (last (:effects @state))))]
(swap! state assoc :effects
(->> (:effects @state)
Expand Down Expand Up @@ -1295,7 +1303,7 @@
;; Patchwork wasn't used in the traditional way
(not (get-in card [:special :patchwork]))
;; Check if Patchwork can trigger
(can-trigger? state side patchwork-ability card targets)))
(can-trigger? state side eid patchwork-ability card targets)))
:custom-amount 2
:custom (req (let [cost-type (str (when (= :play (:source-type eid)) "play")
(when (= :runner-install (:source-type eid)) "install"))
Expand Down
3 changes: 3 additions & 0 deletions src/clj/game/cards/ice.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,9 @@
{:front true})
(swap! state assoc-in [:run :position] 1)
(set-next-phase state :encounter-ice)
(set-current-ice state)
(update-all-ice state side)
(update-all-icebreakers state side)
(effect-completed state side eid)
(start-next-phase state side nil)))}}}]
:subroutines [{:label "End the run unless the Runner suffers 2 net damage"
Expand Down
Loading

0 comments on commit 37b7225

Please sign in to comment.