{:access{:delayed-completiontrue:req(req(not=(first(:zonecard)):discard)):effect(effect(show-wait-prompt:runner"Corp to decide to trigger Archangel")(continue-ability{:optional{:prompt"Pay 3 [Credits] to force Runner to encounter Archangel?":yes-ability{:cost[:credit3]:delayed-completiontrue:effect(effect(system-msg:corp"pays 3 [Credits] to force the Runner to encounter Archangel")(clear-wait-prompt:runner)(continue-ability:runner{:optional{:player:runner:prompt"You are encountering Archangel. Allow its subroutine to fire?":priority1:yes-ability{:delayed-completiontrue:effect(effect(play-subroutineeid{:cardcard:subroutine0}))}:no-ability{:effect(effect(effect-completedeid))}}}cardnil))}:no-ability{:effect(effect(system-msg:corp"declines to force the Runner to encounter Archangel")(clear-wait-prompt:runner))}}}cardnil))}:subroutines[(trace-ability6{:delayed-completiontrue:effect(effect(show-wait-prompt:runner"Corp to select Archangel target")(continue-ability{:choices{:req#(and(installed?%)(card-is?%:side:runner))}:label"Add 1 installed card to the Runner's Grip":msg"add 1 installed card to the Runner's Grip":effect(effect(clear-wait-prompt:runner)(move:runnertarget:handtrue)(system-msg(str"adds "(:titletarget)" to the Runner's Grip"))):cancel-effect(effect(clear-wait-prompt:runner)(effect-completedeid))}cardnil))})]}
{:flags{:untrashable-while-rezzedtrue}:subroutines[{:label"Look at the top 5 cards of R&D":prompt"Choose a card to install":prioritytrue:activatemsg"uses Architect to look at the top 5 cards of R&D":req(req(and(not(string?target))(not(is-type?target"Operation")))):not-distincttrue:choices(req(conj(take5(:deckcorp))"No install")):effect(effect(corp-install(movestatesidetarget:play-area)nil{:no-install-costtrue}))}{:label"Install a card from HQ or Archives":prompt"Choose a card to install from Archives or HQ":show-discardtrue:prioritytrue:choices{:req#(and(not(is-type?%"Operation"))(#{[:hand][:discard]}(:zone%))(=(:side%)"Corp"))}:effect(effect(corp-installtargetnil)):msg(msg(corp-install-msgtarget))}]}
{:subroutines[{:msg"give the Runner 1 tag":delayed-completiontrue:effect(effect(tag-runner:runnereid1)(register-events{:successful-run{:effect(effect(lose:runner:tag1)):msg"make the Runner lose 1 tag"}:run-ends{:effect(effect(unregister-eventscard))}}card))}]:events{:successful-runnil:run-endsnil}}
{:abilities[{:label"Move Builder to the outermost position of any server":cost[:click1]:prompt"Choose a server":choices(reqservers):msg(msg"move it to the outermost position of "target):effect(effect(movecard(conj(server->zonestatetarget):ices)))}]:subroutines[{:label"Place 1 advancement token on an ICE that can be advanced protecting this server":msg(msg"place 1 advancement token on "(card-strstatetarget)):choices{:req#(and(ice?%)(can-be-advanced?%))}:effect(effect(add-proptarget:advance-counter1{:placedtrue}))}]}
{:subroutines[(do-psi{:label"Move Bullfrog to another server":player:corp:prompt"Choose a server":choices(reqservers):msg(msg"move it to the outermost position of "target):effect(req(let[dest(server->zonestatetarget)](swap!stateupdate-in[:run]#(assoc%:position(count(get-incorp(conjdest:ices))):server(restdest))))(movestatesidecard(conj(server->zonestatetarget):ices)))})]}
{:effecttake-bad-pub:abilities[{:msg"gain 2 [Credits] if there is an installed AI":req(req(some#(has-subtype?%"AI")(all-installedstate:runner))):effect(effect(gain:credit2))}]:subroutines[(assoctrash-program:player:runner:msg"force the Runner to trash 1 program":label"The Runner trashes 1 program"){:msg"gain 2 [Credits] and end the run":effect(effect(gain:credit2)(end-run))}]}
{:subroutines[(trace-ability0(assoctrash-program:not-distincttrue:player:runner:msg"force the Runner to trash a program":label"Force the Runner to trash a program"))]}
{:subroutines[{:msg"make the Runner approach the outermost ICE":effect(req(let[srv(first(:serverrun))n(count(get-in@state[:corp:serverssrv:ices]))](swap!stateassoc-in[:run:position]n)(derezstatesidecard)))}]}
{:effecttake-bad-pub:subroutines[(trace-ability5{:label"Do 3 meat damage when this run is successful":msg"do 3 meat damage when this run is successful":effect(effect(register-events{:successful-run{:delayed-completiontrue:msg"do 3 meat damage":effect(effect(damageeid:meat3{:cardcard}))}:run-ends{:effect(effect(unregister-eventscard))}}card))})]:events{:successful-runnil:run-endsnil}}
{:subroutines[{:msg"make each player gain 2 [Credits]":effect(effect(gain:runner:credit2)(gain:corp:credit2))}(do-psi{:label"Do 1 net damage for each card in the Runner's grip":effect(effect(damageeid:net(count(get-in@state[:runner:hand])){:cardcard})):msg(msg(str"do "(count(get-in@state[:runner:hand]))" net damage"))})]}
(let[turn-end-ability{:effect(effect(derez:corpcard)(update!(assoc(get-cardstatecard):subtype"Mythic")))}]{:prompt"Choose one subtype":choices["Barrier""Code Gate""Sentry"]:msg(msg"make it gain "target" until the end of the turn"):effect(effect(update!(assoccard:subtype-targettarget:subtype(combine-subtypestrue(:subtypecard)target)))(update-ice-strengthcard)):events{:runner-turn-endsturn-end-ability:corp-turn-endsturn-end-ability}:subroutines[end-the-run]})
{:abilities[{:label"Trash the top 2 cards of the Runner's Stack":req(req(some#(has-subtype?%"AI")(all-installedstate:runner))):msg(msg(str"trash "(join", "(map:title(take2(:deckrunner))))" from the Runner's Stack")):effect(effect(mill:runner2))}]:subroutines[(do-net-damage2)end-the-run]}
{:subroutines[(do-net-damage2)]:access{:delayed-completiontrue:req(req(not=(first(:zonecard)):discard)):effect(effect(show-wait-prompt:corp"Runner to decide to break Chrysalis subroutine")(continue-ability:runner{:optional{:player:runner:prompt"You are encountering Chrysalis. Allow its subroutine to fire?":priority1:yes-ability{:effect(effect(clear-wait-prompt:corp)(play-subroutineeid{:cardcard:subroutine0}))}:no-ability{:effect(effect(clear-wait-prompt:corp)(effect-completedeid))}}}cardnil))}}
{:subroutines[{:label"Give +2 strength to next ICE Runner encounters":req(reqthis-server):prompt"Choose the ICE the Runner is encountering":choices{:req#(and(rezzed?%)(ice?%))}:msg(msg"give "(:titletarget)" +2 strength"):effect(req(let[ice(:cidtarget)](register-eventsstateside{:pre-ice-strength{:req(req(=(:cidtarget)ice)):effect(effect(ice-strength-bonus2target))}:run-ends{:effect(effect(unregister-eventscard))}}card)(update-all-icestateside)))}(do-net-damage3)]:events{:pre-ice-strengthnil:run-endsnil}}
{:subroutines[(do-psi{:label"Place 1 advancement token and end the run":player:corp:prompt"Choose a target for Clairvoyant Monitor":msg(msg"place 1 advancement token on "(card-strstatetarget)" and end the run"):choices{:reqinstalled?}:effect(effect(add-proptarget:advance-counter1{:placedtrue})(end-run))})]}
{:subroutines[{:label"Do 1 net damage for each unused memory unit the Runner has":msg(msg"do "(:memoryrunner)" net damage"):effect(effect(damageeid:net(:memoryrunner){:cardcard}))}]}
{:subroutines[{:label"install a card from Archives":msg(msg(corp-install-msgtarget)):prompt"Choose a card to install from Archives":show-discardtrue:prioritytrue:choices{:req#(and(not(is-type?%"Operation"))(=(:zone%)[:discard])(=(:side%)"Corp"))}:effect(effect(corp-installtargetnil))}]:strength-bonus(req(if(=(second(:zonecard)):archives)30))}
(letfn[(dh-trash[cards]{:prompt"Choose a card to trash":choicescards:delayed-completiontrue:msg(msg"trash "(:titletarget)):effect(req(do(trashstatesidetarget{:unpreventabletrue})(continue-abilitystateside(reorder-choice:runner:runner(remove-once#(not=%target)cards)'()(count(remove-once#(not=%target)cards))(remove-once#(not=%target)cards))cardnil)))})]{:subroutines[(trace-ability2{:delayed-completiontrue:label"Look at the top of Stack":msg"look at top X cards of Stack":effect(req(show-wait-promptstate:runner"Corp to rearrange the top cards of the Runner's Stack")(let[c(-target(secondtargets))from(takec(:deckrunner))](system-msgstate:corp(str"looks at the top "c" cards of Stack"))(if(<1c)(continue-abilitystateside(dh-trashfrom)cardnil)(do(system-msgstate:corp(str"trashes "(:title(firstfrom))))(trashstateside(firstfrom){:unpreventabletrue})(clear-wait-promptstate:runner)(effect-completedstatesideeidcard)))))})]})
{:subroutines[{:msg"do 1 net damage":effect(req(damagestate:runnereid:net1{:cardcard})(whencurrent-ice(no-actionstatesidenil)(continuestatesidenil))(trashstatesidecard))}]}
{:implementation"Encounter effect is manual":abilities[give-tag(power-counter-abilitygive-tag)]:runner-abilities[{:label"End the run":effect(req(end-runstate:runner)(system-msgstate:runner"chooses to end the run on encountering Data Raven"))}{:label"Take 1 tag":delayed-completiontrue:effect(req(system-msgstate:runner"chooses to take 1 tag on encountering Data Raven")(tag-runnerstate:runnereid1))}]:subroutines[(trace-ability3add-power-counter)]}
{:runner-abilities[{:label"Pay 3 [Credits]":effect(req(paystate:runnercard:credit3)(system-msgstate:runner"chooses to pay 3 [Credits] on encountering Data Ward"))}{:label"Take 1 tag":delayed-completiontrue:effect(req(system-msgstate:runner"chooses to take 1 tag on encountering Data Ward")(tag-runnerstate:runnereid1))}]:subroutines[{:label"End the run if the Runner is tagged":req(reqtagged):msg"end the run":effect(effect(end-run))}]}
{:abilities[{:msg"do 1 net damage and make the Runner lose 2 [Credits]":effect(req(when-completed(damagestateside:net1{:cardcard})(losestate:runner:credit2)))}]}
{:prompt"How many power counters?":choices:credit:msg(msg"add "target" power counters"):effect(effect(add-countercard:powertarget)(update-ice-strengthcard)):strength-bonus(req(get-incard[:counter:power]0)):subroutines[(trace-ability2{:label"Give the Runner 1 tag and end the run":msg"give the Runner 1 tag and end the run":delayed-completiontrue:effect(effect(tag-runner:runnereid1)(end-run))})]}
{:additional-cost[:forfeit]:subroutines[trash-program(do-brain-damage1){:label"Trash a console":effect(effect(trashtarget)):prompt"Choose a console to trash":msg(msg"trash "(:titletarget)):choices{:req#(has-subtype?%"Console")}}{:msg"trash all virtual resources":effect(req(doseq[c(filter#(has-subtype?%"Virtual")(all-installedstate:runner))](trashstatesidec)))}]:runner-abilities[(runner-break[:click1]1)]}
{:subroutines[{:label"Force the Runner to pay 1 [Credits] or trash an installed card":msg"force the Runner to pay 1 [Credits] or trash an installed card":player:runner:prompt"Choose one":choices["Pay 1 [Credits]""Trash an installed card"]:effect(req(if(=target"Pay 1 [Credits]")(do(paystatesidecard:credit1)(system-msgstateside"pays 1 [Credits]"))(resolve-abilitystate:runnertrash-installedcardnil)))}]:runner-abilities[(runner-break[:click1]1)]}
{:subroutines[{:label"Force the Runner to pay 2 [Credits] or trash an installed card":msg"force the Runner to pay 2 [Credits] or trash an installed card":player:runner:prompt"Choose one":choices["Pay 2 [Credits]""Trash an installed card"]:effect(req(if(=target"Pay 2 [Credits]")(do(paystatesidecard:credit2)(system-msgstateside"pays 2 [Credits]"))(resolve-abilitystate:runnertrash-installedcardnil)))}(do-brain-damage1)]:runner-abilities[(runner-break[:click2]2)]}
{:subroutines[{:label"Force the Runner to pay 3 [Credits] or trash an installed card":msg"force the Runner to pay 3 [Credits] or trash an installed card":player:runner:prompt"Choose one":choices["Pay 3 [Credits]""Trash an installed card"]:effect(req(if(=target"Pay 3 [Credits]")(do(paystatesidecard:credit3)(system-msgstateside"pays 3 [Credits]"))(resolve-abilitystate:runnertrash-installedcardnil)))}{:label"Do 1 brain damage or end the run":prompt"Choose one":choices["Do 1 brain damage""End the run"]:msg(msg(lower-casetarget)):effect(req(if(=target"Do 1 brain damage")(damagestatesideeid:brain1{:cardcard})(end-runstateside)))}]:runner-abilities[(runner-break[:click3]3)]}
{:subroutines[(trace-ability6{:label"Trash 1 hardware, do 2 meat damage, and end the run":msg"trash 1 hardware, do 2 meat damage, and end the run":delayed-completiontrue:effect(effect(continue-ability{:prompt"Choose a piece of hardware to trash":label"Trash a piece of hardware":msg(msg"trash "(:titletarget)):choices{:req#(is-type?%"Hardware")}:effect(req(when-completed(trashstatesidetarget{:cause:subroutine})(do(damagestatesideeid:meat2{:unpreventabletrue:cardcard})(end-runstateside)))):cancel-effect(effect(damageeid:meat2{:unpreventabletrue:cardcard})(end-run))}cardnil))})]}
{:implementation"Hand size is not restored if trashed or derezzed after firing":subroutines[{:req(req(:run@state)):label"Reduce Runner's maximum hand size by 2 until start of next Corp turn":msg"reduce the Runner's maximum hand size by 2 until the start of the next Corp turn":effect(effect(lose:runner:hand-size-modification2)(register-events{:corp-turn-begins{:msg"increase the Runner's maximum hand size by 2":effect(effect(gain:runner:hand-size-modification2)(unregister-eventscard))}}card))}]:events{:corp-turn-beginsnil}}
{:subroutines[{:label"Runner draws 3 cards and discards down to maximum hand size":msg"make the Runner draw 3 cards and discard down to their maximum hand size":effect(req(drawstate:runner3)(let[delta(-(count(get-in@state[:runner:hand]))(hand-sizestate:runner))](when(>delta0)(resolve-abilitystate:runner{:prompt(msg"Choose "delta" cards to discard"):player:runner:choices{:maxdelta:req#(in-hand?%)}:effect(req(doseq[ctargets](trashstate:runnerc))(system-msgstate:runner(str"trashes "(join", "(map:titletargets)))))}cardnil))))}]}
{:subroutines[(do-brain-damage1){:msg"do 1 brain damage and end the run":effect(effect(damageeid:brain1{:cardcard})(end-run))}end-the-run]:runner-abilities[(runner-break[:click2]2)]}
{:subroutines[(gain-credits2){:label"Pay 1 [Credits] to place 1 advancement token on a card that can be advanced":msg(msg"place 1 advancement token on "(card-strstatetarget)):choices{:reqcan-be-advanced?}:cost[:credit1]:effect(effect(add-proptarget:advance-counter1))}]:access{:delayed-completiontrue:req(req(not=(first(:zonecard)):discard)):effect(effect(show-wait-prompt:corp"Runner to decide to break Herald subroutines")(continue-ability:runner{:optional{:player:runner:prompt"You are encountering Heralds. Allow its subroutines to fire?":priority1:yes-ability{:effect(effect(clear-wait-prompt:corp)(play-subroutineeid{:cardcard:subroutine0}))}:no-ability{:effect(effect(clear-wait-prompt:corp)(effect-completedeid))}}}cardnil))}}
(let[ice-index(fn[statei](first(keep-indexed#(when(=(:cid%2)(:cidi))%1)(get-in@state(cons:corp(:zonei))))))]{:subroutines[{:label"Install a piece of Bioroid ICE from HQ or Archives":prompt"Install ICE from HQ or Archives?":choices["HQ""Archives"]:effect(req(let[frtarget](resolve-abilitystateside{:prompt"Choose a Bioroid ICE to install":choices(req(filter#(and(ice?%)(has-subtype?%"Bioroid"))((if(=fr"HQ"):hand:discard)corp))):effect(req(let[newice(assoctarget:zone(:zonecard):rezzedtrue)hndx(ice-indexstatecard)ices(get-in@state(cons:corp(:zonecard)))newices(applyconj(subvecices0hndx)newice(subveciceshndx))](swap!stateassoc-in(cons:corp(:zonecard))newices)(swap!stateupdate-in(cons:corp(:zonetarget))(fn[coll](remove-once#(not=(:cid%)(:cidtarget))coll)))(update!stateside(assoccard:howler-targetnewice))(card-initstatesidenewicefalse)(trigger-eventstateside:corp-installnewice)))}cardnil)))}]:events{:run-ends{:req(req(:howler-targetcard)):effect(effect(trashcard{:cause:self-trash})(derez(get-cardstate(:howler-targetcard))))}}})
{:subroutines[{:msg"prevent the Runner from accessing more than 1 card during this run":effect(effect(max-access1))}]:runner-abilities[(runner-break[:click1]1)]}
{:subroutines[trash-program(trace-ability1{:label"Give the Runner 1 tag and do 1 brain damage":msg"give the Runner 1 tag and do 1 brain damage":delayed-completiontrue:effect(req(when-completed(damagestate:runner:brain1{:cardcard})(tag-runnerstate:runnereid1)))})]:runner-abilities[(runner-break[:click1]1)]}
{:subroutines[trash-program(trace-ability3{:label"Give the Runner 1 tag and do 1 brain damage":msg"give the Runner 1 tag and do 1 brain damage":delayed-completiontrue:effect(req(when-completed(damagestate:runner:brain1{:cardcard})(tag-runnerstate:runnereid1)))})]:runner-abilities[(runner-break[:click2]2)]}
{:abilities[(assocgive-tag:req(req(not-empty(filter#(has-subtype?%"AI")(all-installedstate:runner)))):label"Give the Runner 1 tag if there is an installed AI")(tag-trace3){:label"End the run if the Runner is tagged":req(reqtagged):msg"end the run":effect(effect(end-run))}]}
{:expose{:msg"do 2 net damage":delayed-completiontrue:effect(effect(damageeid:net2{:cardcard}))}:subroutines[(assoctrash-installed:effect(req(trashstatesidetarget{:cause:subroutine})(whencurrent-ice(no-actionstatesidenil)(continuestatesidenil))(trashstatesidecard)))]}
{:subroutines[{:prompt"Choose a card in HQ to force access":choices{:reqin-hand?}:label"Force the Runner to access a card in HQ":msg(msg"force the Runner to access "(:titletarget)):effect(effect(handle-accesstargets)(trashcard))}]}
{:subroutines[(assoctrash-hardware:label"Force the Runner to trash an installed piece of hardware":player:runner:msg(msg"force the Runner to trash "(:titletarget)):effect(req(trashstatesidetarget)(whencurrent-ice(no-actionstatesidenil)(continuestatesidenil))(trashstatesidecard)))]}
{:subroutines[{:label"The Runner cannot draw cards for the remainder of this turn":msg"prevent the Runner from drawing cards":effect(effect(prevent-draw))}]}
{:subroutines[(trace-ability4{:label"Purge virus counters":msg"purge virus counters":effect(effect(purge))})(trace-ability3{:label"Trash a virus":prompt"Choose a virus to trash":msg(msg"trash "(:titletarget)):choices{:req#(and(installed?%)(has?%:subtype"Virus"))}:effect(effect(trashtarget{:cause:subroutine})(clear-wait-prompt:runner))})(trace-ability2{:label"Remove a virus in the Heap from the game":prompt"Choose a virus in the Heap to remove from the game":choices(req(cancellable(filter#(has?%:subtype"Virus")(:discardrunner)):sorted)):msg(msg"remove "(:titletarget)" from the game"):effect(effect(move:runnertarget:rfg))})(trace-ability1end-the-run)]}
{:delayed-completiontrue:effect(req(let[magnetcard](continue-abilitystateside{:req(req(some#(some(fn[h](card-is?h:type"Program"))(:hosted%))(remove-once#(not=(:cid%)(:cidmagnet))(all-installedstatecorp)))):prompt"Select a Program to host on Magnet":choices{:req#(and(card-is?%:type"Program")(ice?(:host%))(not=(:cid(:host%))(:cidmagnet)))}:effect(req(let[hosted(hoststatesidecardtarget)](unregister-eventsstatesidehosted)(update!stateside(dissochosted:abilities))))}cardnil))):events{:runner-install{:req(req(=(:cidcard)(:cid(:hosttarget)))):effect(req(doseq[c(get-incard[:hosted])](unregister-eventsstatesidec)(update!stateside(dissocc:abilities)))(update-ice-strengthstatesidecard))}}:subroutines[end-the-run]}
{:implementation"Encounter effect is manual":abilities[{:label"Place 1 advancement token on a card that can be advanced":msg(msg"place 1 advancement token on "(card-strstatetarget)):choices{:reqcan-be-advanced?}:cost[:credit1]:effect(effect(add-proptarget:advance-counter1))}]:subroutines[(tag-trace2)]}
{:advanceable:always:subroutines[{:label"Gain 1 [Credits] (Gain 3 [Credits])":msg(msg"gain "(if(>3(+(:advance-countercard0)(:extra-advance-countercard0)))13)" [Credits]"):effect(effect(gain:credit(if(>3(+(:advance-countercard0)(:extra-advance-countercard0)))13)))}{:label"Do 1 net damage (Do 3 net damage)":delayed-completiontrue:msg(msg"do "(if(>3(+(:advance-countercard0)(:extra-advance-countercard0)))13)" net damage"):effect(effect(damageeid:net(if(>3(+(:advance-countercard0)(:extra-advance-countercard0)))13){:cardcard}))}{:label"Give the Runner 1 tag (and end the run)":delayed-completiontrue:msg(msg"give the Runner 1 tag"(when(<=3(+(:advance-countercard0)(:extra-advance-countercard0)))" and end the run")):effect(req(tag-runnerstate:runnereid1)(when(<=3(+(:advance-countercard0)(:extra-advance-countercard0)))(end-runstateside)))}]}
{:subroutines[(do-psi{:label"Redirect the run to another server":player:corp:prompt"Choose a server":choices(reqservers):msg(msg"redirect the run to "target):effect(req(let[dest(server->zonestatetarget)](swap!stateupdate-in[:run]#(assoc%:position(count(get-incorp(conjdest:ices))):server(restdest)))))})]:runner-abilities[{:label"Add an installed card to the bottom of your Stack":prompt"Choose one of your installed cards":choices{:req#(and(installed?%)(=(:side%)"Runner"))}:effect(effect(movetarget:deck)(system-msg:runner(str"adds "(:titletarget)" to the bottom of their Stack")))}]}
{:subroutines[{:msg"install an ICE from HQ":choices{:req#(and(ice?%)(in-hand?%))}:prompt"Choose an ICE to install from HQ":effect(req(corp-installstatesidetarget(zone->name(first(:serverrun))){:no-install-costtrue}))}]}
{:effecttake-bad-pub:subroutines[(tag-trace1)(tag-trace2)(tag-trace3){:msg"end the run if the Runner is tagged":req(reqtagged):effect(effect(end-run))}]}
{:subroutines[(tag-trace3){:label"End the run if a Current is active":req(req(or(not(empty?(runner:current)))(not(empty?(corp:current))))):effect(effect(end-run)):msg"end the run"}]}
{:subroutines[{:label"Do 1 net damage for each rezzed NEXT ice":msg(msg"do "(next-ice-countcorp)" net damage"):effect(effect(damageeid:net(next-ice-countcorp){:cardcard}))}trash-program]}
{:implementation"Encounter effect is manual. Runner choice is not implemented":abilities[(gain-credits1)]:subroutines[end-the-run]:runner-abilities[(runner-break[:credit1]1)]}
{:implementation"Encounter effect is manual":abilities[{:req(req(andthis-server(=(dec(:positionrun))(ice-indexstatecard)))):label"Add 1 power counter":effect(effect(add-countercard:power1)(update-all-ice))}]:subroutines[end-the-run]:strength-bonus(req(get-incard[:counter:power]0))}
{:subroutines[{:label"Resolve a subroutine on another piece of rezzed bioroid ICE":choices{:req#(and(rezzed?%)(ice?%)(has-subtype?%"Bioroid"))}:msg(msg"resolve a subroutine on "(:titletarget))}]:runner-abilities[(runner-break[:click1]1)]}
{:subroutines[{:label"Give +3 strength to all ICE for the remainder of the run":msg"give +3 strength to all ICE for the remainder of the run":effect(effect(register-events{:pre-ice-strength{:effect(effect(ice-strength-bonus3target))}:run-ends{:effect(effect(unregister-eventscard))}}card)(update-all-ice))}]:events{:pre-ice-strengthnil:run-endsnil}}
{:subroutines[trash-program]:access{:delayed-completiontrue:req(req(and(not=(first(:zonecard)):discard)(some#(is-type?%"Program")(all-installedstate:runner)))):effect(effect(show-wait-prompt:corp"Runner to decide to break Sapper subroutine")(continue-ability:runner{:optional{:player:runner:prompt"Allow Sapper subroutine to fire?":priority1:yes-ability{:effect(req(clear-wait-promptstate:corp)(show-wait-promptstate:runner"Corp to trash a program with Sapper")(play-subroutinestate:corpeid{:cardcard:subroutine0}))}:no-ability{:effect(effect(clear-wait-prompt:corp)(effect-completedeid))}}}cardnil))}}
{:advanceable:always;; Could replace this with (tag-trace advance-counters).
:subroutines[{:label"Trace X - Give the Runner 1 tag":trace{:baseadvance-counters:delayed-completiontrue:effect(effect(tag-runner:runnereid1)):msg"give the Runner 1 tag"}}]}
{:subroutines[{:label"Give each other ICE encountered \"End the run\" for the remainder of the run":msg(msg"give each other ICE encountered \"[Subroutine] End the run\" after all its other subroutines for the remainder of the run")}]}
{:subroutines[{:label"Trace 4 - Add an installed program to the top of the Runner's Stack":trace{:base4:choices{:req#(and(installed?%)(is-type?%"Program"))}:msg(msg"add "(:titletarget)" to the top of the Runner's Stack"):effect(effect(move:runnertarget:deck{:fronttrue}))}}]:runner-abilities[(runner-break[:click1]1)]}
{:subroutines[{:label"Trace 4 - Add an installed program to the bottom of the Runner's Stack":trace{:base4:choices{:req#(and(installed?%)(is-type?%"Program"))}:msg(msg"add "(:titletarget)" to the bottom of the Runner's Stack"):effect(effect(move:runnertarget:deck))}}{:label"Give the Runner 1 tag":msg"give the Runner 1 tag":delayed-completiontrue:effect(effect(tag-runner:runnereid1))}]:runner-abilities[(runner-break[:click2]2)]}
{:effecttake-bad-pub:subroutines[(trace-ability1(do-net-damage1))(trace-ability2(do-net-damage2))(trace-ability3{:label"Do 3 net damage and end the run":msg"do 3 net damage and end the run":effect(effect(damageeid:net3{:cardcard})(end-run))})]}
{:subroutines[{:label"Rearrange the top 3 cards of R&D":msg"rearrange the top 3 cards of R&D":delayed-completiontrue:effect(req(show-wait-promptstate:runner"Corp to rearrange the top cards of R&D")(let[from(take3(:deckcorp))](if(pos?(countfrom))(continue-abilitystateside(reorder-choice:corp:runnerfrom'()(countfrom)from)cardnil)(do(clear-wait-promptstate:runner)(effect-completedstatesideeidcard)))))}{:label"Force the Runner to access the top card of R&D":effect(req(doseq[c(take(get-in@state[:runner:rd-access])(:deckcorp))](system-msgstate:runner(str"accesses "(:titlec)))(handle-accessstateside[c])))}]}
{:implementation"Encounter effect is manual":abilities[{:req(req(=current-icecard)):label"Reveal all cards in the Runner's Grip":msg(msg"reveal the Runner's Grip ( "(join", "(map:title(:handrunner)))" )")}{:req(req(>(get-incard[:counter:power]0)0)):counter-cost[:power1]:label"Hosted power counter: Reveal all cards in Grip and trash 1 card":msg(msg"look at all cards in Grip and trash "(:titletarget)" using 1 power counter"):choices(req(cancellable(:handrunner):sorted)):prompt"Choose a card to trash":effect(effect(trashtarget))}]:subroutines[(trace-ability3add-power-counter)]}
{:subroutines[{:label"Gain 5 [Credits] and trash Special Offer":effect(req(gainstate:corp:credit5)(whencurrent-ice(no-actionstatesidenil)(continuestatesidenil))(trashstatesidecard)(system-msgstateside(str"gains 5 [Credits] and trashes Special Offer")))}]}
{:subroutines[{:req(req(not=(:serverrun)[:discard])):msg"make the Runner continue the run on Archives":effect(req(swap!stateupdate-in[:run]#(assoc%:position(count(get-incorp[:servers:archives:ices])):server[:archives])))}]}
{:implementation"AI restriction not implemented":subroutines[(do-net-damage1){:prompt"Choose an AI program to trash":msg(msg"trash "(:titletarget)):label"Trash an AI program":effect(effect(trashtarget)):choices{:req#(and(installed?%)(is-type?%"Program")(has-subtype?%"AI"))}}]}
{:implementation"Encounter effect is manual":abilities[give-tag]:runner-abilities[{:label"Take 1 tag":delayed-completiontrue:effect(req(system-msgstate:runner"takes 1 tag on encountering Thoth")(tag-runnerstate:runnereid1))}]:subroutines[(trace-ability4{:label"Do 1 net damage for each Runner tag":delayed-completiontrue:msg(msg"do "(:tagrunner)" net damage"):effect(effect(damageeid:net(:tagrunner){:cardcard}))})(trace-ability4{:label"Runner loses 1 [Credits] for each tag":delayed-completiontrue:msg(msg"force the Runner to lose "(:tagrunner)" [Credits]"):effect(effect(lose:runner:credit(:tagrunner)))})]}
{:implementation"Encounter effect is manual":abilities[{:msg"make the Runner pay 3 [Credits], if able":effect(effect(pay:runnercard:credit3))}]:subroutines[end-the-run]}
{:implementation"Encounter effect is manual":abilities[(trace-ability2{:label"Force the Runner to lose [Click] or end the run":msg"force the Runner to lose [Click] or end the run":player:runner:prompt"Choose one":choices["Lose [Click]""End the run"]:effect(req(if-not(and(=target"Lose [Click]")(can-pay?state:runnernil[:click1]))(do(end-runstateside)(system-msgstateside"ends the run"))(do(losestateside:click1)(system-msgstateside"loses [Click]"))))})]}
{:implementation"AI restriction not implemented":subroutines[end-the-run]:strength-bonus(req(if(is-remote?(second(:zonecard)))30)):runner-abilities[(runner-break[:click3]1)]}
{:implementation"Encounter effect is manual":abilities[{:msg"force the Runner to lose 1 [Credits]":effect(effect(lose:runner:credit1))}]:subroutines[(tag-trace5)]}
{:subroutines[{:label"Force the Runner to lose credits":msg(msg"force the Runner to lose "(iftagged"all credits""1 [Credits]")):effect(req(iftagged(do(losestate:runner:credit:all)(whencurrent-ice(no-actionstatesidenil)(continuestatesidenil))(trashstatesidecard))(losestate:runner:credit1)))}]}
{:implementation"\"Resolve a subroutine...\" subroutine is not implemented":subroutines[(do-psi{:label"Make the Runner lose 2 [Credits]":msg"make the Runner lose 2 [Credits]":effect(effect(lose:runner:credit2))}){:msg"resolve a subroutine on a piece of rezzed psi ICE"}]}
{:subroutines[(trace-ability4{:label"Prevent the Runner from making another run":msg"prevent the Runner from making another run":effect(effect(prevent-run))})(trace-ability4end-the-run)]}
{:implementation"Program prevention is not implemented":subroutines[{:msg"prevent the Runner from using programs for the remainder of this run"}(trace-ability4(do-brain-damage1))]:runner-abilities[(runner-break[:click1]1)]}
{:subroutines[(trace-ability3{:label"The Runner loses 1 [Click] if able":msg"force the Runner to lose 1 [Click] if able":effect(effect(lose:runner:click1))})(trace-ability3end-the-run)]}
{:subroutines[(trace-ability5{:label"Reveal the Runner's Grip and trash cards":msg(msg"reveal all cards in the Runner's Grip: "(join", "(map:title(:handrunner)))". Cards with a play/install cost less than or equal to "(-target(secondtargets))" will be trashed"):effect(req(let[delta(-target(secondtargets))](doseq[c(:handrunner)](when(<=(:costc)delta)(resolve-abilitystateside{:msg(msg"trash "(:titlec)):effect(effect(trashc))}cardnil)))))})]}
(implementation-note"Program prevention is not implemented"(morph-ice"Code Gate""Barrier"{:msg"prevent the Runner from using a chosen program for the remainder of this run"}))
{:subroutines[{:msg"prevent the Runner from jacking out":effect(req(when(and(is-remote?(second(:zonecard)))(>(count(concat(:ices(card->serverstatecard))(:content(card->serverstatecard))))1))(prevent-jack-outstateside))(whencurrent-ice(no-actionstatesidenil)(continuestatesidenil))(trashstatesidecard))}]}
{:subroutines[(do-net-damage1){:msg"look at the top card of R&D":optional{:prompt(msg"Move "(:title(first(:deckcorp)))" to the bottom of R&D?"):yes-ability{:effect(effect(move(first(:deckcorp)):deck)(do(system-msgstateside"uses Yagura to move the top card of R&D to the bottom")))}:no-ability{:effect(req(system-msgstate:corp(str"does not use Yagura to move the top card of R&D to the bottom")))}}}]}