diff --git a/src/clj/game/cards/identities.clj b/src/clj/game/cards/identities.clj index 88c38e6264..93b4aeb11c 100644 --- a/src/clj/game/cards/identities.clj +++ b/src/clj/game/cards/identities.clj @@ -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" diff --git a/test/clj/game_test/cards/identities.clj b/test/clj/game_test/cards/identities.clj index f8be2a86f2..03f5a79fc6 100644 --- a/test/clj/game_test/cards/identities.clj +++ b/test/clj/game_test/cards/identities.clj @@ -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"