Skip to content

Commit

Permalink
Merge branch 'master' into automata-release
Browse files Browse the repository at this point in the history
  • Loading branch information
NBKelly authored Aug 2, 2023
2 parents a4de13f + e9c68ba commit 2fbebbc
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 63 deletions.
Binary file removed resources/public/img/nisei-corp.png
Binary file not shown.
Binary file removed resources/public/img/nisei-runner.png
Binary file not shown.
Binary file modified resources/public/img/nsg-corp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/public/img/nsg-runner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/clj/game/cards/operations.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2524,7 +2524,6 @@
{:on-play
{:async true
:req (req (<= 2 (count-tags state)))
:msg "place up to 4 advancement counters"
:effect (effect (continue-ability (ability 4) card nil))}}))

(defcard "Shoot the Moon"
Expand Down
24 changes: 12 additions & 12 deletions src/clj/game/cards/resources.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1035,9 +1035,9 @@
:makes-run true
:prompt "Choose a server"
:choices (req runnable-servers)
:effect (req (wait-for (make-run state :runner (make-eid state eid) target card)
(effect-completed state side eid)))}]
:interactions {:pay-credits {:req (req this-card-run) ;;no clue why this doesn't work
:effect (req (make-run state :runner eid target card))}]
:interactions {:pay-credits {:req (req (and (get-in card [:special :run-id])
(= (get-in card [:special :run-id]) (:run-id run))))
:type :credit}}})

(defcard "Decoy"
Expand Down Expand Up @@ -1513,17 +1513,15 @@
(shard-constructor "Hades Shard" :archives "breach Archives"
(effect (breach-server eid [:archives] {:no-root true}))))

(defcard "Hannah \"Wheels\" Pilantra"
(defcard "Hannah \"Wheels\" Pilintra"
{:abilities [{:cost [:click 1]
:once :per-turn
:async true
:prompt "Choose a remote server"
:req (req (and
(some some? (:successful-run runner-reg))
(->> runnable-servers
(map unknown->kw)
(filter is-remote?)
not-empty)))
:req (req (->> runnable-servers
(map unknown->kw)
(filter is-remote?)
not-empty))
:choices (req (cancellable
(->> runnable-servers
(map unknown->kw)
Expand All @@ -1534,9 +1532,11 @@
:effect (req (gain-clicks state side 1)
(register-events
state side card
[{:event :unsuccessful-run
[{:event :run-ends
:duration :end-of-run
:req (req (first-event? state side :unsuccessful-run))
:unregister-once-resolved true
:req (req (and (:unsuccessful context)
(same-card? card (:source-card context))))
:async true
:msg "take 1 tag"
:effect (effect (gain-tags :runner eid 1))}])
Expand Down
2 changes: 1 addition & 1 deletion src/cljs/nr/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
(def icon-patterns
"A sequence of icon pattern pairs consisting of an regex, used to match icon
codes, and the span fragment that should replace it"
(letfn [(span-of [icon] [:span {:class (str "anr-icon " icon) :title (str " " icon) :aria-label (str icon) :role ("img") }])
(letfn [(span-of [icon] [:span {:class (str "anr-icon " icon) :title (str " " icon) :aria-label (str icon) :role "img" }])
(regex-of [icon-code] (re-pattern (str "(?i)" (regex-escape icon-code))))]
(->> {"[credit]" "credit"
"[credits]" "credit"
Expand Down
10 changes: 5 additions & 5 deletions test/clj/game/cards/agendas_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3308,7 +3308,7 @@
(new-game {:corp {:deck ["Rebranding Team" "Project Beale" "Museum of History" "Exchange of Information" "Exchange of Information"]}})
(play-from-hand state :corp "Rebranding Team" "New remote")
(take-credits state :corp)
(run-empty-server state "Remote 1")
(run-empty-server state "Server 1")
(click-prompt state :runner "Steal")
(is (not (has-subtype? (find-card "Museum of History" (:hand (get-corp))) "Advertisement")))
(take-credits state :runner)
Expand Down Expand Up @@ -3496,7 +3496,7 @@
(new-game {:corp {:deck ["Remote Data Farm" "Project Beale" "Exchange of Information" "Exchange of Information"]}})
(play-from-hand state :corp "Remote Data Farm" "New remote")
(take-credits state :corp)
(run-empty-server state "Remote 1")
(run-empty-server state "Server 1")
(click-prompt state :runner "Steal")
(is (= 5 (hand-size :corp)))
(take-credits state :runner)
Expand Down Expand Up @@ -3645,7 +3645,7 @@
(play-from-hand state :corp "SDS Drone Deployment" "New remote")
(take-credits state :corp)
(play-from-hand state :runner "Cache")
(run-empty-server state "Remote 1")
(run-empty-server state "Server 1")
(let [cache (get-program state 0)]
(is (= ["Pay to steal" "No action"] (prompt-buttons :runner)) "Runner should not be able to steal")
(click-prompt state :runner "Pay to steal")
Expand All @@ -3660,7 +3660,7 @@
(new-game {:corp {:hand ["SDS Drone Deployment"]}})
(play-from-hand state :corp "SDS Drone Deployment" "New remote")
(take-credits state :corp)
(run-empty-server state "Remote 1")
(run-empty-server state "Server 1")
(is (= ["No action"] (prompt-buttons :runner)) "Runner should not be able to steal")))

(deftest sds-drone-deployment-ensure-effect-is-async
Expand Down Expand Up @@ -3708,7 +3708,7 @@
(new-game {:corp {:deck ["Self-Destruct Chips" "Project Vitruvius" "Exchange of Information" "Exchange of Information"]}})
(play-from-hand state :corp "Self-Destruct Chips" "New remote")
(take-credits state :corp)
(run-empty-server state "Remote 1")
(run-empty-server state "Server 1")
(click-prompt state :runner "Steal")
(is (= 5 (hand-size :runner)))
(take-credits state :runner)
Expand Down
10 changes: 5 additions & 5 deletions test/clj/game/cards/events_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@
:hand [(qty "Ice Wall" 2)]}
:runner {:hand [(qty "Bravado" 2)]}})
(play-from-hand state :corp "Ice Wall" "HQ")
(play-from-hand state :corp "Ice Wall" "Server 1")
(play-from-hand state :corp "Ice Wall" "New remote")
(take-credits state :corp)
(is (not (core/can-run-server? state "Server 1")) "Runner can only run on centrals")
(play-from-hand state :runner "Bravado")
Expand Down Expand Up @@ -1163,13 +1163,13 @@
:corp {:id "Earth Station: SEA Headquarters" :hand ["PAD Campaign"]}})
(card-ability state :corp (get-in @state [:corp :identity]) 0)
(is (:flipped (get-in @state [:corp :identity])) "Earth station is on flip side")
(play-from-hand state :corp "PAD Campaign" "New Remote")
(play-from-hand state :corp "PAD Campaign" "New remote")
(take-credits state :corp)
(play-from-hand state :runner "Sure Gamble")
(changes-val-macro -6 (:credit (get-runner))
"Paid for earth station"
(play-from-hand state :runner "Cold Read")
(click-prompt state :runner "Server Remote"))
(click-prompt state :runner "Server 1"))
(is (no-prompt? state :runner) "waiting on earth station payment prompt")))

(deftest cold-read-pay-credits-prompt
Expand Down Expand Up @@ -4956,13 +4956,13 @@
:corp {:id "Earth Station: SEA Headquarters" :hand ["PAD Campaign"]}})
(card-ability state :corp (get-in @state [:corp :identity]) 0)
(is (:flipped (get-in @state [:corp :identity])) "Earth station is on flip side")
(play-from-hand state :corp "PAD Campaign" "New Remote")
(play-from-hand state :corp "PAD Campaign" "New remote")
(take-credits state :corp)
(play-from-hand state :runner "Sure Gamble")
(changes-val-macro -7 (:credit (get-runner))
"Paid for earth station"
(play-from-hand state :runner "Overclock")
(click-prompt state :runner "Server Remote"))
(click-prompt state :runner "Server 1"))
(is (no-prompt? state :runner) "waiting on earth station payment prompt")))

(deftest paper-tripping
Expand Down
2 changes: 1 addition & 1 deletion test/clj/game/cards/hardware_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3934,7 +3934,7 @@
(do-game
(new-game {:corp {:deck ["Data Mine"]}
:runner {:deck ["Ramujan-reliant 550 BMI" "Sure Gamble"]}})
(play-from-hand state :corp "Data Mine" "Server 1")
(play-from-hand state :corp "Data Mine" "New remote")
(let [dm (get-ice state :remote1 0)]
(take-credits state :corp)
(play-from-hand state :runner "Ramujan-reliant 550 BMI")
Expand Down
2 changes: 1 addition & 1 deletion test/clj/game/cards/ice_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@
;; Data Mine - do one net and trash
(do-game
(new-game {:corp {:deck ["Data Mine"]}})
(play-from-hand state :corp "Data Mine" "Server 1")
(play-from-hand state :corp "Data Mine" "New remote")
(take-credits state :corp)
(let [dm (get-ice state :remote1 0)]
(run-on state "Server 1")
Expand Down
2 changes: 1 addition & 1 deletion test/clj/game/cards/identities_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4661,7 +4661,7 @@
(do-game
(new-game {:corp {:id "Weyland Consortium: Because We Built It"
:hand ["Ice Wall"]}})
(play-from-hand state :corp "Ice Wall" "Server 1")
(play-from-hand state :corp "Ice Wall" "New remote")
(let [iw (get-ice state :remote1 0)
bwbi (get-in @state [:corp :identity])]
(changes-val-macro 0 (:credit (get-corp))
Expand Down
37 changes: 19 additions & 18 deletions test/clj/game/cards/resources_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1439,20 +1439,20 @@
(deftest debbie-downtown
(do-game
(new-game {:corp {:hand ["Rashida Jaheem"]}
:runner {:hand ["Carpe Diem" "Debbie \"Downtown\" Moreira"]}})))
;(take-credits state :corp)
;(play-from-hand state :runner "Debbie \"Downtown\" Moreira")
;(let [deb (get-resource state 0)]
; (play-from-hand state :runner "Carpe Diem")
;(click-prompt state :runner "No")
;(is (= 1 (get-counters (refresh deb) :credit)) "1 credit placed on Debbie")
;(card-ability state :runner (refresh deb) 1)
;(click-prompt state :runner "HQ")
;(run-continue state)
;(click-prompt state :runner "Pay 1 [Credits] to trash")
;(is (not (no-prompt? state :runner)) "Prompt to spend credits")
;(click-card state :runner (refresh deb))
;(is (no-prompt? state :runner) "Spent"))))
:runner {:hand ["Carpe Diem" "Debbie \"Downtown\" Moreira"]}})
(take-credits state :corp)
(play-from-hand state :runner "Debbie \"Downtown\" Moreira")
(let [deb (get-resource state 0)]
(play-from-hand state :runner "Carpe Diem")
(click-prompt state :runner "No")
(is (= 1 (get-counters (refresh deb) :credit)) "1 credit placed on Debbie")
(card-ability state :runner (refresh deb) 1)
(click-prompt state :runner "HQ")
(run-continue state)
(click-prompt state :runner "Pay 1 [Credits] to trash")
(is (not (no-prompt? state :runner)) "Prompt to spend credits")
(click-card state :runner (refresh deb))
(is (no-prompt? state :runner) "Spent"))))

(deftest decoy
;; Decoy - Trash to avoid 1 tag
Expand Down Expand Up @@ -2747,11 +2747,12 @@

(deftest hannah-wheels-basic-test
(do-game
(new-game {:runner {:hand ["Hannah \"Wheels\" Pilantra"]}
:corp {:hand ["Rashida Jaheem"]}})
(play-from-hand state :corp "Rashida Jaheem" "New Remote")
(new-game {:runner {:hand ["Hannah \"Wheels\" Pilintra"]}
:corp {:deck [(qty "Hedge Fund" 5)]
:hand ["Rashida Jaheem"]}})
(play-from-hand state :corp "Rashida Jaheem" "New remote")
(take-credits state :corp)
(play-from-hand state :runner "Hannah \"Wheels\" Pilantra")
(play-from-hand state :runner "Hannah \"Wheels\" Pilintra")
(let [wheels (get-resource state 0)]
(card-ability state :runner (refresh wheels) 0)
(click-prompt state :runner "Server 1")
Expand Down
32 changes: 16 additions & 16 deletions test/clj/game/cards/upgrades_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1308,8 +1308,8 @@
(do-game
(new-game {:corp {:credits 7 :hand ["Experiential Data" "Ice Wall" "Enigma"]}})
(play-from-hand state :corp "Ice Wall" "New remote")
(play-from-hand state :corp "Experiential Data" "Remote 1")
(play-from-hand state :corp "Enigma" "Remote 1")
(play-from-hand state :corp "Experiential Data" "Server 1")
(play-from-hand state :corp "Enigma" "Server 1")
(take-credits state :runner)
(let [iw (get-ice state :remote1 0)
ed (get-content state :remote1 0)
Expand All @@ -1329,7 +1329,7 @@
(do-game
(new-game {:corp {:hand ["Expo Grid" "Dedicated Response Team" "Breaking News"]}})
(play-from-hand state :corp "Dedicated Response Team" "New remote")
(play-from-hand state :corp "Expo Grid" "Remote 1")
(play-from-hand state :corp "Expo Grid" "Server 1")
(let [drt (get-content state :remote1 0)
expo (get-content state :remote1 1)]
(rez state :corp drt)
Expand All @@ -1339,7 +1339,7 @@
(take-credits state :runner)
(is (= (+ 1 total-corp-credits) (:credit (get-corp))) "Corp gains 1c")
;;Replace asset with agenda
(play-from-hand state :corp "Breaking News" "Remote 1")
(play-from-hand state :corp "Breaking News" "Server 1")
(click-prompt state :corp "OK")
(take-credits state :corp)
(take-credits state :runner)
Expand Down Expand Up @@ -1371,7 +1371,7 @@
(new-game {:corp {:hand ["Fractal Threat Matrix" "Najja 1.0"]}
:runner {:deck [(qty "Acacia" 7)]}})
(play-from-hand state :corp "Fractal Threat Matrix" "New remote")
(play-from-hand state :corp "Najja 1.0" "Remote 1")
(play-from-hand state :corp "Najja 1.0" "Server 1")
(take-credits state :corp)
(is (= 2 (count (:deck (get-runner)))))
(run-on state :remote1)
Expand Down Expand Up @@ -1555,12 +1555,12 @@
(do-game
(new-game {:corp {:credits 10 :hand ["Heinlein Grid" "Najja 1.0"]}})
(play-from-hand state :corp "Heinlein Grid" "New remote")
(play-from-hand state :corp "Najja 1.0" "Remote 1")
(play-from-hand state :corp "Najja 1.0" "Server 1")
(let [hg (get-content state :remote1 0)
najja (get-ice state :remote1 0)]
(rez state :corp hg)
(take-credits state :corp)
(run-on state "Remote 1")
(run-on state "Server 1")
(rez state :corp najja)
(run-continue state)
(card-side-ability state :runner najja 0)
Expand Down Expand Up @@ -2927,7 +2927,7 @@
(new-game {:corp {:hand ["Oaktown Grid" "PAD Campaign"]}
:runner {:credits 7}})
(play-from-hand state :corp "Oaktown Grid" "New remote")
(play-from-hand state :corp "PAD Campaign" "Remote 1")
(play-from-hand state :corp "PAD Campaign" "Server 1")
(let [og (get-content state :remote1 0)
pad (get-content state :remote1 1)]
(rez state :corp og)
Expand All @@ -2945,12 +2945,12 @@
(do-game
(new-game {:corp {:deck ["Hostile Takeover" "Oberth Protocol" "Oaktown Renovation"]}})
(play-and-score state "Hostile Takeover")
(play-from-hand state :corp "Oberth Protocol" "Server 1")
(play-from-hand state :corp "Oaktown Renovation" "Server 1")
(play-from-hand state :corp "Oberth Protocol" "New remote")
(play-from-hand state :corp "Oaktown Renovation" "Server 2")
(take-credits state :corp)
(take-credits state :runner)
(let [oberth (get-content state :remote1 0)
oak (get-content state :remote1 1) ]
(let [oberth (get-content state :remote2 0)
oak (get-content state :remote2 1) ]
(rez state :corp (refresh oberth))
(click-card state :corp (get-scored state :corp 0))
(advance state oak)
Expand Down Expand Up @@ -3487,7 +3487,7 @@
(do-game
(new-game {:corp {:hand ["Rutherford Grid" "Caduceus"]}})
(play-from-hand state :corp "Rutherford Grid" "New remote")
(play-from-hand state :corp "Caduceus" "Remote 1")
(play-from-hand state :corp "Caduceus" "Server 1")
(let [rg (get-content state :remote1 0)
caduceus (get-ice state :remote1 0)]
(rez state :corp rg)
Expand Down Expand Up @@ -4170,7 +4170,7 @@
:hand ["Corroder" "Dyson Mem Chip"]
:credits 100}})
(play-from-hand state :corp "Warroid Tracker" "New remote")
(play-from-hand state :corp "Launch Campaign" "Remote 1")
(play-from-hand state :corp "Launch Campaign" "Server 1")
(let [war (get-content state :remote1 0)]
(rez state :corp war)
(take-credits state :corp)
Expand All @@ -4197,7 +4197,7 @@
:runner {:hand ["Singularity" (qty "Akamatsu Mem Chip" 5)]
:credits 100}})
(play-from-hand state :corp "Warroid Tracker" "New remote")
(play-from-hand state :corp "PAD Campaign" "Remote 1")
(play-from-hand state :corp "PAD Campaign" "Server 1")
(take-credits state :corp)
(core/gain state :runner :click 10)
(dotimes [_ 5]
Expand Down Expand Up @@ -4269,7 +4269,7 @@
:hand ["Corroder" "Dyson Mem Chip"]
:credits 20}})
(play-from-hand state :corp "Warroid Tracker" "New remote")
(play-from-hand state :corp "Marilyn Campaign" "Remote 1")
(play-from-hand state :corp "Marilyn Campaign" "Server 1")
(play-from-hand state :corp "Marilyn Campaign" "New remote")
(take-credits state :corp)
(let [war (get-content state :remote1 0)
Expand Down
4 changes: 2 additions & 2 deletions test/clj/game/core/board_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
;; Ice
(play-from-hand state :corp "Ice Wall" "HQ")
(is (find-card "Ice Wall" (core/all-installed state :corp)))
(play-from-hand state :corp "Vanilla" "Server 1")
(play-from-hand state :corp "Vanilla" "New remote")
(is (find-card "Vanilla" (core/all-installed state :corp)))
;; Upgrades
;; Root
(play-from-hand state :corp "Research Station" "HQ")
(is (find-card "Research Station" (core/all-installed state :corp)))
;; Remotes
(play-from-hand state :corp "Embolus" "Server 1")
(play-from-hand state :corp "Embolus" "New remote")
(is (find-card "Embolus" (core/all-installed state :corp)))
;; Hosted Operations
(rez state :corp (get-ice state :hq 0))
Expand Down
4 changes: 4 additions & 0 deletions test/clj/game/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[clojure.java.io :as io]
[clojure.test :refer :all]
[game.core :as core]
[game.core.board :refer [server-list]]
[game.core.card :refer [get-card installed? rezzed? active? get-counters get-title]]
[game.core.ice :refer [active-ice?]]
[game.utils :as utils :refer [server-card]]
Expand Down Expand Up @@ -321,6 +322,9 @@
(let [card (find-card title (get-in @state [side :hand]))]
(ensure-no-prompts state)
(is' (some? card) (str title " is in the hand"))
(when server
(is' (some #{server} (concat (server-list state) ["New remote"]))
(str server " is not a valid server.")))
(when (some? card)
(is' (core/process-action "play" state side {:card card :server server}))
true)))
Expand Down

0 comments on commit 2fbebbc

Please sign in to comment.