Skip to content

Commit 7f51691

Browse files
authored
Merge pull request #8571 from filipesilva/issue-8568
fix: read-write share should only offer to host 4 cards
2 parents 1bc3695 + 3583d42 commit 7f51691

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

src/clj/game/cards/programs.clj

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,22 +2858,15 @@
28582858

28592859
(defcard "Read-Write Share"
28602860
(let [ab {:interactive (req true)
2861+
:req (req (< (count (:hosted card)) 4))
28612862
:prompt "Host a card from your grip to draw a card?"
28622863
:choices {:req (req (and (runner? target)
28632864
(in-hand? target)))}
28642865
:skippable true
28652866
:msg "host a card facedown from the Grip and draw a card"
28662867
:async true
28672868
:effect (req (host state side (get-card state card) target {:facedown true})
2868-
(wait-for (draw state side 1)
2869-
(if (>= (count (:hosted (get-card state card))) 5)
2870-
(continue-ability
2871-
state side
2872-
{:msg "trash itself"
2873-
:async true
2874-
:effect (req (trash state side eid card))}
2875-
card nil)
2876-
(effect-completed state side eid))))}]
2869+
(draw state side eid 1))}]
28772870
{:on-install ab
28782871
:events [(assoc ab :event :runner-turn-begins)]
28792872
:abilities [{:fake-cost [(->c :trash-can)]

test/clj/game/cards/programs_test.clj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7498,6 +7498,25 @@
74987498
(card-ability state :runner (get-program state 0) 0)
74997499
(is-deck? state :runner ["Corroder" "Rezeki"])))
75007500

7501+
(deftest read-write-share-limit-4-hosted-8568
7502+
(do-game
7503+
(new-game {:runner {:hand ["Read-Write Share" "Sure Gamble" "Sure Gamble" "Sure Gamble" "Sure Gamble"]
7504+
:deck [(qty "Sure Gamble" 10)]}})
7505+
(take-credits state :corp)
7506+
(play-from-hand state :runner "Read-Write Share")
7507+
(click-card state :runner (first (:hand (get-runner))))
7508+
(is (= 1 (count (:hosted (get-program state 0)))) "1 hosted card")
7509+
(dotimes [i 3]
7510+
(take-credits state :runner)
7511+
(take-credits state :corp)
7512+
(start-turn state :runner)
7513+
(click-card state :runner (first (:hand (get-runner))))
7514+
(is (= (+ 2 i) (count (:hosted (get-program state 0)))) (str (+ 2 i) " hosted cards")))
7515+
(take-credits state :runner)
7516+
(take-credits state :corp)
7517+
(start-turn state :runner)
7518+
(is (no-prompt? state :runner) "No prompt to host a 5th card")))
7519+
75017520
(deftest reaver
75027521
;; Reaver - Draw a card the first time you trash an installed card each turn
75037522
(do-game

0 commit comments

Comments
 (0)