Skip to content

Commit

Permalink
Add fake prompt to Hayley ability to hide information
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahTheDuke committed Aug 11, 2019
1 parent d21d1f0 commit 551da83
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
27 changes: 17 additions & 10 deletions src/clj/game/cards/identities.clj
Original file line number Diff line number Diff line change
Expand Up @@ -548,22 +548,29 @@
{:events {:runner-install
{:silent (req (not (and (first-event? state side :runner-install)
(some #(is-type? % (:type target)) (:hand runner)))))
:req (req (and (first-event? state side :runner-install)
(some #(is-type? % (:type target)) (:hand runner))))
:req (req (first-event? state side :runner-install))
:once :per-turn
:async true
:effect
(req (let [itarget target
type (:type itarget)]
card-type (:type itarget)]
(show-wait-prompt state :corp "Runner to use Hayley's ability")
(continue-ability
state side
{:optional {:prompt (msg "Install another " type " from your Grip?")
:yes-ability
{:prompt (msg "Select another " type " to install from your Grip")
:choices {:req #(and (is-type? % type)
(in-hand? %))}
:msg (msg "install " (:title target))
:effect (effect (runner-install (assoc eid :source card :source-type :runner-install) target nil))}}}
(if (some #(is-type? % (:type itarget)) (:hand runner))
{:optional
{:prompt (msg "Install another " card-type " from your Grip?")
:yes-ability
{:prompt (msg "Select another " card-type " to install from your Grip")
:choices {:req #(and (is-type? % card-type)
(in-hand? %))}
:msg (msg "install " (:title target))
:effect (effect (runner-install (assoc eid :source card :source-type :runner-install) target nil))}
:end-effect (effect (clear-wait-prompt :corp))}}
{:prompt (str "You have no " card-type "s in hand")
:choices ["Carry on!"]
:prompt-type :bogus
:effect (effect (clear-wait-prompt :corp))})
card nil)))}}}

"Hoshiko Shiro"
Expand Down
15 changes: 14 additions & 1 deletion test/clj/game_test/cards/identities.clj
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,20 @@
"Used 2 credits from Sahasrara to install Corroder"
(click-card state :runner rara)
(click-card state :runner rara)))
(is (empty? (:hand (get-runner))) "Installed Sahasrara and Corroder."))))
(is (empty? (:hand (get-runner))) "Installed Sahasrara and Corroder.")))
(testing "Fake prompt when nothing to install"
(do-game
(new-game {:runner {:id "Hayley Kaplan: Universal Scholar"
:hand ["Corroder" (qty "Fan Site" 2)]}})
(take-credits state :corp)
(play-from-hand state :runner "Corroder")
(is (= :waiting (-> (get-corp) :prompt first :prompt-type)) "Corp has a wait prompt")
(is (= :bogus (-> (get-runner) :prompt first :prompt-type)) "Runner has a bogus prompt to fake out the corp")
(click-prompt state :runner "Carry on!")
(is (= 2 (count (:hand (get-runner)))) "Installed Corroder and Cache.")
(play-from-hand state :runner "Fan Site")
(is (empty? (:prompt (get-corp))) "No Hayley wait prompt if not first install this turn.")
(is (empty? (:prompt (get-runner))) "No Hayley prompt if not first install this turn."))))

(deftest hyoubu-institute-absolute-clarity
(testing "ID abilities"
Expand Down

0 comments on commit 551da83

Please sign in to comment.