Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aa bugfixes #7003

Merged
merged 9 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/clj/game/cards/events.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3386,8 +3386,15 @@
:req (req (let [zone (first (:zone (:card context)))]
(or (= :hand zone)
(= :deck zone))))
:msg "draw 2 cards"
:effect (effect (draw :runner eid 2))}})

NBKelly marked this conversation as resolved.
Show resolved Hide resolved
:effect (effect (continue-ability
{:optional {:prompt "Draw 2 cards?"
:waiting-prompt "Runner to use Steelskin Scarring"
:yes-ability {:msg "draw 2 cards"
:async true
:effect (effect (draw :runner eid 2))}
:no-ability {:msg "decline to draw"}}}
card nil))}})

(defcard "Stimhack"
{:makes-run true
Expand Down
3 changes: 2 additions & 1 deletion src/clj/game/cards/ice.clj
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@
:show-discard true
:choices {:card #(and (corp? %)
(not (operation? %))
(not (agenda? %))
(or (in-hand? %)
(in-discard? %)))}
:async true
Expand Down Expand Up @@ -3681,7 +3682,7 @@
(if (< 0 (count (filter ice? (:hand corp))))
{:optional
{:prompt (msg "Gain 4 [Credit] and swap " (:title card) " with an Ice in HQ?")
:no-ability {:msg "decline to use it's ability"}
:no-ability {:msg "decline to use its ability"}
:yes-ability {:prompt "Choose a piece of ice to swap Tatu-Bola with"
:choices (req (filter ice? (:hand corp)))
:async true
Expand Down
35 changes: 23 additions & 12 deletions src/clj/game/cards/programs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,8 @@
:abilities [(break-sub 2 2 "Barrier")]}))

(defcard "Bishop"
{:abilities [{:cost [:click 1]
{:implementation "additionally has Trojan subtype"
:abilities [{:cost [:click 1]
:label "Host on another piece of ice"
:effect (req (let [b (get-card state card)
hosted? (ice? (:host b))
Expand Down Expand Up @@ -680,7 +681,8 @@
(strength-pump 3 4 :end-of-run {:label "add 4 strength (using at least 1 stealth [Credits])" :cost-req (min-stealth 1)})]}))

(defcard "Botulus"
{:data {:counter {:virus 1}}
{:implementation "additionally has Trojan subtype"
:data {:counter {:virus 1}}
:hosting {:card #(and (ice? %)
(can-host? %))}
:events [{:event :runner-turn-begins
Expand Down Expand Up @@ -797,7 +799,8 @@
true))})]}))

(defcard "Chisel"
{:hosting {:card #(and (ice? %)
{:implementation "additionally has Trojan subtype"
:hosting {:card #(and (ice? %)
(can-host? %))}
:constant-effects [{:type :ice-strength
:req (req (same-card? target (:host card)))
Expand Down Expand Up @@ -1291,7 +1294,8 @@
(strength-pump 3 2)]}))

(defcard "Egret"
{:hosting {:card #(and (ice? %)
{:implementation "additionally has Trojan subtype"
:hosting {:card #(and (ice? %)
(can-host? %)
(rezzed? %))}
:on-install {:msg (msg "make " (card-str state (:host card))
Expand Down Expand Up @@ -1656,7 +1660,8 @@
:msg "gain [Click][Click][Click]"}]})

(defcard "Ika"
(auto-icebreaker {:abilities [{:label "Host on a piece of ice"
(auto-icebreaker {:implementation "additionally has Trojan subtype"
:abilities [{:label "Host on a piece of ice"
:prompt "Choose a piece of ice"
:cost [:credit 2]
:choices {:card #(and (ice? %)
Expand Down Expand Up @@ -1760,7 +1765,8 @@
(defcard "Knight"
(let [knight-req (req (and (same-card? current-ice (get-nested-host card))
(<= (get-strength current-ice) (get-strength card))))]
{:abilities [{:label "Host on a piece of ice"
{:implementation "additionally has Trojan subtype"
:abilities [{:label "Host on a piece of ice"
:async true
:effect (req (let [k (get-card state card)
hosted (ice? (:host k))
Expand Down Expand Up @@ -1788,7 +1794,8 @@
(break-sub 2 1 "All" {:req knight-req})]}))

(defcard "Kyuban"
{:hosting {:card #(and (ice? %)
{:implementation "additionally has Trojan subtype"
:hosting {:card #(and (ice? %)
(can-host? %))}
:events [{:event :pass-ice
:interactive (req true)
Expand Down Expand Up @@ -2295,7 +2302,8 @@
:abilities abilities)))

(defcard "Parasite"
{:hosting {:card #(and (ice? %)
{:implementation "additionally has Trojan subtype"
:hosting {:card #(and (ice? %)
(can-host? %)
(rezzed? %))}
:on-install
Expand Down Expand Up @@ -2331,7 +2339,7 @@
(strength-pump 2 2)))

(defcard "Pawn"
{:implementation "All abilities are manual"
{:implementation "Additionally has Trojan subtype. All abilities are manual"
:abilities [{:label "Host on the outermost piece of ice of a central server"
:cost [:click 1]
:prompt "Choose the outermost piece of ice of a central server"
Expand Down Expand Up @@ -2607,7 +2615,8 @@
:abilities [(set-autoresolve :auto-fire "RNG Key")]})

(defcard "Rook"
{:abilities [{:cost [:click 1]
{:implementation "additionally has Trojan subtype"
:abilities [{:cost [:click 1]
:label "Host on another ice"
:async true
:effect (req (let [r (get-card state card)
Expand Down Expand Up @@ -2945,7 +2954,8 @@
(when (and (rezzed? (get-card state (:host card)))
(<= 3 (get-virus-counters state (get-card state card))))
(derez state side (get-card state (:host card)))))]
{:hosting {:card #(and (ice? %)
{:implementation "additionally has Trojan subtype"
:hosting {:card #(and (ice? %)
(can-host? %))}
:on-install {:interactive (req true)
:effect action}
Expand Down Expand Up @@ -2994,7 +3004,8 @@
(unregister-events state side card)
(trash state :runner eid h {:cause-card card}))
(effect-completed state side eid))))]
{:hosting {:card #(and (ice? %)
{:implementation "additionally has Trojan subtype"
:hosting {:card #(and (ice? %)
(can-host? %))}
:on-install {:async true
:effect trash-if-5}
Expand Down
1 change: 1 addition & 0 deletions src/clj/game/cards/upgrades.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,7 @@
(defcard "Tranquility Home Grid"
{:install-req (req (remove #{"HQ" "R&D" "Archives"} targets))
:events [{:event :corp-install
:interactive (req true)
:req (req (and (or (asset? (:card context))
(agenda? (:card context))
(upgrade? (:card context)))
Expand Down
24 changes: 24 additions & 0 deletions test/clj/game/cards/events_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6379,6 +6379,7 @@
(do-game
(new-game {:runner {:hand ["Steelskin Scarring"] :deck [(qty "Sure Gamble" 45)]}})
(damage state :corp :net 1)
(click-prompt state :runner "Yes")
(is (= 2 (count (:hand (get-runner)))) "Drew 2 cards from steelskin"))
(do-game
(new-game {:runner {:hand ["Steelskin Scarring"] :deck [(qty "Sure Gamble" 45)]}
Expand All @@ -6389,6 +6390,7 @@
(play-from-hand state :corp "Kala Ghoda Real TV" "New remote")
(rez state :corp (get-content state :remote1 0))
(card-ability state :corp (get-content state :remote1 0) 1)
(click-prompt state :runner "Yes")
(is (= 2 (count (:hand (get-runner)))) "Drew 2 cards when steelskin gets trashed from stack"))
(do-game
(new-game {:runner {:hand ["Steelskin Scarring"] :deck [(qty "Sure Gamble" 45)]}})
Expand All @@ -6398,6 +6400,28 @@
"Drew 3 (+2 net cards) with steelskin"
(play-from-hand state :runner "Steelskin Scarring"))))

(deftest steelskin-scarring-waiting-prompts
(do-game
(new-game {:runner {:deck [(qty "Steelskin Scarring" 44)]
:hand [(qty "Steelskin Scarring" 2)]}})
(damage state :corp :net 1)
(is (= :waiting (prompt-type :corp)) "Corp is waiting for the runner")
(changes-val-macro
2 (count (:hand (get-runner)))
"Draw 2"
(click-prompt state :runner "Yes"))
(damage state :corp :net 1)
(is (= :waiting (prompt-type :corp)) "Corp is waiting for the runner")
(changes-val-macro
0 (count (:hand (get-runner)))
"Draw none (decline)"
(click-prompt state :runner "No"))
(is (no-prompt? state :corp) "Corp is not waiting anymore")
(is (= 2 (count (:hand (get-runner)))))
(damage state :corp :meat 2)
(is (= :waiting (prompt-type :corp)) "Corp is waiting for the runner to pick a steelskin")))


(deftest stimhack
;; Stimhack - Gain 9 temporary credits and take 1 brain damage after the run
(do-game
Expand Down
31 changes: 31 additions & 0 deletions test/clj/game/cards/upgrades_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3996,6 +3996,37 @@
(click-prompt state :corp "Server 1")
(click-prompt state :corp "Gain 2 [Credits]"))))

(deftest tranquility-home-grid-asa-interaction
(do-game
(new-game {:corp {:id "Asa Group: Security Through Vigilance"
:deck ["Ice Wall"]
:hand ["Tranquility Home Grid" "Vanilla" "Rashida Jaheem"]}})
(play-from-hand state :corp "Tranquility Home Grid" "New remote")
(click-prompt state :corp "Done")
(take-credits state :corp)
(take-credits state :runner)
(rez state :corp (get-content state :remote1 0))
(play-from-hand state :corp "Rashida Jaheem" "Server 1")
(click-prompt state :corp "Tranquility Home Grid")
(click-prompt state :corp "Draw 1 card")
(click-card state :corp "Ice Wall")))

(deftest tranquility-home-grid-a-teia-interaction
(do-game
(new-game {:corp {:id "A Teia: IP Recovery"
:deck ["Ice Wall"]
:hand ["Tranquility Home Grid" "Vanilla" "Rashida Jaheem"]}})
(play-from-hand state :corp "Tranquility Home Grid" "New remote")
(click-prompt state :corp "Done")
(take-credits state :corp)
(take-credits state :runner)
(rez state :corp (get-content state :remote1 0))
(play-from-hand state :corp "Rashida Jaheem" "Server 1")
(click-prompt state :corp "Tranquility Home Grid")
(click-prompt state :corp "Draw 1 card")
(click-card state :corp "Ice Wall")
(click-prompt state :corp "New remote")))

(deftest underway-grid
;; Underway Grid - prevent expose of cards in server
(do-game
Expand Down
Loading