Skip to content

Commit f213919

Browse files
authored
Merge pull request #8160 from NBKelly/dewi-uses-ncigs
2 parents 2db1a6a + 10d0b54 commit f213919

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

src/clj/game/cards/identities.clj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,13 @@
667667
:code (str (subs (:code card) 0 5) "flip")))))}
668668
maybe-flip {:event :successful-run
669669
:skippable true
670+
:interactive (req true)
671+
:change-in-game-state
672+
{:silent true
673+
:req (req (or
674+
(and (:flipped card) (pos? (available-mu state)))
675+
(and (not (:flipped card)) (zero? (available-mu state)))))}
670676
:optional {:prompt (msg "Flip your ID (" (if (:flipped card) "draw 1 card)?" "gain 1 [Credits])?"))
671-
:interactive (req true)
672-
:req (req (or
673-
(and (:flipped card) (pos? (available-mu state)))
674-
(and (not (:flipped card)) (zero? (available-mu state)))))
675677
:yes-ability {:async true
676678
:effect (req
677679
(if (:flipped card)

test/clj/game/cards/identities_test.clj

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,35 @@
11791179
(click-prompt state :runner "Yes")
11801180
"Drew 1 card from the flip back"))))
11811181

1182+
(deftest dewi-is-interactive
1183+
(testing "flip dewi interactively"
1184+
(do-game
1185+
(new-game {:runner {:id "Dewi Subrotoputri: Pedagogical Dhalang"
1186+
:hand ["Endless Hunger" "Bahia Bands"]}})
1187+
(take-credits state :corp)
1188+
(play-from-hand state :runner "Bahia Bands")
1189+
(click-prompt state :runner "Archives")
1190+
(run-continue-until state :success)
1191+
(is (changed? [(:credit (get-runner)) 1]
1192+
(click-prompts state :runner "Bahia Bands" "Draw 2 cards" "Install a card from the grip, paying 1 [Credits] less" "Endless Hunger" "Yes"))
1193+
"Gained 1c/flipped from installing endless hunger")))
1194+
(testing "unflip dewi interactively"
1195+
(do-game
1196+
(new-game {:runner {:id "Dewi Subrotoputri: Pedagogical Dhalang"
1197+
:hand ["Endless Hunger" "Fermenter" "Bahia Bands"]
1198+
:deck [(qty "Ika" 5)]}})
1199+
(take-credits state :corp)
1200+
(play-from-hand state :runner "Endless Hunger")
1201+
(is (changed? [(:credit (get-runner)) 1]
1202+
(run-empty-server state :archives)
1203+
(click-prompt state :runner "Yes")))
1204+
(play-from-hand state :runner "Bahia Bands")
1205+
(click-prompt state :runner "Archives")
1206+
(run-continue-until state :success)
1207+
(is (changed? [(count (:hand (get-runner))) 2]
1208+
(click-prompts state :runner "Bahia Bands" "Draw 2 cards" "Install a card from the grip, paying 1 [Credits] less" "Fermenter" "Endless Hunger" "Yes"))
1209+
"Drew 1/flipped from installing endless hunger"))))
1210+
11821211
(deftest earth-station-sea-headquarters-front-side-additional-cost-to-run-hq
11831212
;; Additional cost to run HQ
11841213
(do-game

0 commit comments

Comments
 (0)