Skip to content

Commit

Permalink
Merge Tithonium subs
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahTheDuke committed Aug 16, 2019
1 parent cd327c6 commit 51f97ca
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
27 changes: 20 additions & 7 deletions src/clj/game/cards/ice.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns game.cards.ice
(:require [game.core :refer :all]
[game.core.card :refer :all]
[game.core.eid :refer [make-eid effect-completed]]
[game.core.eid :refer [make-eid effect-completed complete-with-result]]
[game.core.card-defs :refer [card-def]]
[game.core.prompts :refer [show-wait-prompt clear-wait-prompt]]
[game.core.toasts :refer [toast]]
Expand Down Expand Up @@ -2695,13 +2695,26 @@
:cannot-host true
:subroutines [trash-program
trash-program
end-the-run
{:label "Trash a resource"
:msg (msg "trash " (:title target))
{:label "Trash a resource and end the run"
:async true
:choices {:req #(and (installed? %)
(resource? %))}
:effect (effect (trash target {:reason :subroutine}))}]}
:effect (req (wait-for
(resolve-ability
state side
{:req (req (pos? (count (filter resource? (all-installed state :runner)))))
:async true
:choices {:all true
:req #(and (installed? %)
(resource? %))}
:effect (req (wait-for (trash state side target {:cause :subroutine})
(complete-with-result state side eid target)))}
card nil)
(system-msg state side
(str "uses Tithonium to "
(if async-result
(str "trash " (:title async-result)
" and ends the run")
"end the run")))
(end-run state side eid card)))}]}

"TL;DR"
{:implementation "Subroutine-adding is manual"
Expand Down
6 changes: 3 additions & 3 deletions test/clj/game_test/cards/ice.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2351,12 +2351,12 @@
(card-ability state :runner (refresh pawn) 0)
(click-card state :runner (refresh ti))
(is (= 2 (count (:hosted (refresh ti)))) "2 cards on Tithonium")
(core/derez state :corp (refresh ti))
(is (= 2 (count (:hosted (refresh ti)))) "2 cards on Tithonium")
(run-on state "HQ")
(card-subroutine state :corp ti 3)
(card-subroutine state :corp ti 2)
(click-card state :corp (refresh wast))
(is (= 1 (count (:discard (get-runner)))) "1 card trashed")
(is (not (:run @state)) "Run ended")
(run-on state "HQ")
(card-subroutine state :corp ti 2)
(is (not (:run @state)) "Run ended")))))
(testing "Do not prompt for alt cost #2734"
Expand Down

0 comments on commit 51f97ca

Please sign in to comment.