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 all 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
10 changes: 8 additions & 2 deletions src/clj/game/cards/events.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3386,8 +3386,14 @@
:req (req (let [zone (first (:zone (:card context)))]
(or (= :hand zone)
(= :deck zone))))
:msg "draw 2 cards"
:effect (effect (draw :runner eid 2))}})
: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
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
22 changes: 12 additions & 10 deletions src/clj/game/core/checkpoint.clj
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
(ns game.core.checkpoint
(:require
[game.core.agendas :refer [update-all-advancement-requirements update-all-agenda-points]]
[game.core.board :refer [get-remotes clear-empty-remotes]]
[game.core.ice :refer [update-all-ice update-all-icebreakers]]
[game.core.hand-size :refer [update-hand-size]]
[game.core.initializing :refer [update-all-card-labels]]
[game.core.link :refer [update-link]]
[game.core.memory :refer [update-mu]]
[game.core.subtypes :refer [update-all-subtypes]]
[game.core.tags :refer [update-tag-status]]))
[game.core.agendas :refer [update-all-advancement-requirements update-all-agenda-points]]
[game.core.actions :refer [generate-runnable-zones]]
[game.core.board :refer [get-remotes clear-empty-remotes]]
[game.core.ice :refer [update-all-ice update-all-icebreakers]]
[game.core.hand-size :refer [update-hand-size]]
[game.core.initializing :refer [update-all-card-labels]]
[game.core.link :refer [update-link]]
[game.core.memory :refer [update-mu]]
[game.core.subtypes :refer [update-all-subtypes]]
[game.core.tags :refer [update-tag-status]]))

(defn fake-checkpoint
[state]
Expand All @@ -27,4 +28,5 @@
(when (and (some true? changed)
(< i 10))
(recur (inc i)))))
(clear-empty-remotes state))
(clear-empty-remotes state)
(generate-runnable-zones state nil nil))
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 tucana-corp-scores
(do-game
(new-game {:corp {:deck ["Ice Wall" "Fire Wall"]
Expand Down
Loading