diff --git a/src/clj/game/cards/programs.clj b/src/clj/game/cards/programs.clj index 0f18e05e57..a4c6f75eb3 100644 --- a/src/clj/game/cards/programs.clj +++ b/src/clj/game/cards/programs.clj @@ -2858,6 +2858,7 @@ (defcard "Read-Write Share" (let [ab {:interactive (req true) + :req (req (< (count (:hosted card)) 4)) :prompt "Host a card from your grip to draw a card?" :choices {:req (req (and (runner? target) (in-hand? target)))} @@ -2865,15 +2866,7 @@ :msg "host a card facedown from the Grip and draw a card" :async true :effect (req (host state side (get-card state card) target {:facedown true}) - (wait-for (draw state side 1) - (if (>= (count (:hosted (get-card state card))) 5) - (continue-ability - state side - {:msg "trash itself" - :async true - :effect (req (trash state side eid card))} - card nil) - (effect-completed state side eid))))}] + (draw state side eid 1))}] {:on-install ab :events [(assoc ab :event :runner-turn-begins)] :abilities [{:fake-cost [(->c :trash-can)] diff --git a/test/clj/game/cards/programs_test.clj b/test/clj/game/cards/programs_test.clj index 443412aa78..529d13eb37 100644 --- a/test/clj/game/cards/programs_test.clj +++ b/test/clj/game/cards/programs_test.clj @@ -7480,6 +7480,25 @@ (card-ability state :runner (get-program state 0) 0) (is-deck? state :runner ["Corroder" "Rezeki"]))) +(deftest read-write-share-limit-4-hosted-8568 + (do-game + (new-game {:runner {:hand ["Read-Write Share" "Sure Gamble" "Sure Gamble" "Sure Gamble" "Sure Gamble"] + :deck [(qty "Sure Gamble" 10)]}}) + (take-credits state :corp) + (play-from-hand state :runner "Read-Write Share") + (click-card state :runner (first (:hand (get-runner)))) + (is (= 1 (count (:hosted (get-program state 0)))) "1 hosted card") + (dotimes [i 3] + (take-credits state :runner) + (take-credits state :corp) + (start-turn state :runner) + (click-card state :runner (first (:hand (get-runner)))) + (is (= (+ 2 i) (count (:hosted (get-program state 0)))) (str (+ 2 i) " hosted cards"))) + (take-credits state :runner) + (take-credits state :corp) + (start-turn state :runner) + (is (no-prompt? state :runner) "No prompt to host a 5th card"))) + (deftest reaver ;; Reaver - Draw a card the first time you trash an installed card each turn (do-game