{:events{:corp-install{:optional{:req(req(and(ice?target)(=(card->serverstatecard)(card->serverstatetarget)))):prompt"Rez ICE with rez cost lowered by 3?":priority2:yes-ability{:effect(effect(rez-cost-bonus-3)(reztarget))}}}}}
{:events{:successful-run{:interactive(reqtrue):req(reqthis-server):trace{:base4:effect(req(max-accessstateside0)(when-not(:replace-access(get-in@state[:run:run-effect]))(let[ashcard](swap!stateupdate-in[:run:run-effect]#(assoc%:replace-access{:mandatorytrue:effect(effect(handle-access[ash])):cardash}))))):msg"prevent the Runner from accessing cards other than Ash 2X3ZB9CY"}}}}
{:abilities[{:label"Host a piece of bioroid ICE":cost[:click1]:prompt"Choose a piece of bioroid ICE to host on Awakening Center":choices{:req#(and(ice?%)(has-subtype?%"Bioroid")(in-hand?%))}:msg"host a piece of bioroid ICE":effect(effect(trigger-event:corp-installtarget)(hostcardtarget{:facedowntrue}))}{:req(req(andthis-server(=(get-in@state[:run:position])0))):label"Rez a hosted piece of bioroid ICE":prompt"Choose a piece of bioroid ICE to rez":choices(req(:hostedcard)):msg(msg"lower the rez cost of "(:titletarget)" by 7 [Credits] and force the Runner to encounter it"):effect(effect(rez-cost-bonus-7)(reztarget)(update!(dissoc(get-cardstatetarget):facedown))(register-events{:run-ends{:effect(req(doseq[c(:hostedcard)](when(:rezzedc)(trashstatesidec)))(unregister-eventsstatesidecard))}}card))}]:events{:run-endsnil}}
{:events{:successful-run{:interactive(reqtrue):req(reqthis-server):trace{:base5:msg"give the Runner 1 tag":delayed-completiontrue:effect(effect(tag-runner:runnereid1)):unsuccessful{:effect(effect(system-msg"trashes Bernice Mai from the unsuccessful trace")(trashcard))}}}}}
{:events{:pass-ice{:req(req(andthis-server(=(:positionrun)1))); trigger when last ice passed
:msg"start a Psi game":psi{:not-equal{:msg"end the run":effect(effect(end-run))}}}:run{:req(req(andthis-server(=(:positionrun)0))); trigger on unprotected server
:msg"start a Psi game":psi{:not-equal{:msg"end the run":effect(effect(end-run))}}}}:abilities[{:msg"start a Psi game":psi{:not-equal{:msg"end the run":effect(effect(end-run))}}}]}
{:abilities[{:label"[Trash]: Add strength to a rezzed ICE protecting this server":choices:credit:prompt"How many credits?":effect(req(let[boosttarget](resolve-abilitystateside{:choices{:req#(and(ice?%)(rezzed?%))}:msg(msg"add "boost" strength to "(:titletarget)):effect(req(update!stateside(assoccard:troubleshooter-targettarget:troubleshooter-amountboost))(trashstateside(get-cardstatecard))(update-ice-strengthstatesidetarget))}cardnil)))}]:events{:pre-ice-strengthnil:runner-turn-endsnil:corp-turn-endsnil}:trash-effect{:effect(req(register-eventsstateside(let[ct{:effect(req(unregister-eventsstatesidecard)(update!stateside(dissoccard:troubleshooter-target))(update-ice-strengthstateside(:troubleshooter-targetcard)))}]{:pre-ice-strength{:req(req(=(:cidtarget)(:cid(:troubleshooter-targetcard)))):effect(effect(ice-strength-bonus(:troubleshooter-amountcard)target))}:runner-turn-endsct:corp-turn-endsct})card))}}
(letfn[(dhq[ni]{:req(req(pos?i)):prompt"Choose a card in HQ to add to the bottom of R&D":choices{:req#(and(=(:side%)"Corp")(in-hand?%))}:msg"add a card to the bottom of R&D":effect(req(movestatesidetarget:deck)(when(<ni)(resolve-abilitystateside(dhq(incn)i)cardnil)))})]{:access{:effect(req(let[n(count(:handcorp))](show-wait-promptstate:runner"Corp to finish using Disposable HQ")(resolve-abilitystateside{:optional{:prompt"Use Disposable HQ to add cards to the bottom of R&D?":yes-ability{:msg"add cards in HQ to the bottom of R&D":effect(effect(resolve-ability(dhq1n)cardnil))}:end-effect(effect(clear-wait-prompt:runner))}}cardnil)))}})
{:events{:unsuccessful-run{:req(req(=(first(:servertarget))(second(:zonecard)))):delayed-completiontrue:msg"do 1 net damage":effect(effect(damageeid:net1{:cardcard}))}}:abilities[{:cost[:credit2]:label"Move to another server":delayed-completiontrue:effect(effect(continue-ability{:prompt"Choose a server":choices(butlast(server-liststateside)):msg(msg"move to "target):effect(req(let[c(movestatesidecard(conj(server->zonestatetarget):content))](unregister-eventsstatesidecard)(register-eventsstateside(:events(card-defc))c)))}cardnil))}]}
{:abilities[{:req(reqthis-server):label"Force the Runner to lose all [Credits] from spending or losing a [Click]":msg(msg"force the Runner to lose all "(:creditrunner)" [Credits]"):once:per-run:effect(effect(lose:runner:credit:all))}]}
{:abilities[{:label"[Trash], remove a tag: Trash a program":req(req(andthis-server(pos?(get-in@state[:runner:tag]))(not(empty?(filter#(is-type?%"Program")(all-installedstate:runner)))))):msg(msg"remove 1 tag"):effect(req(resolve-abilitystatesidetrash-programcardnil)(trashstatesidecard{:cause:ability-cost})(losestate:runner:tag1))}]}
{:events{:successful-run{:msg(msg" gain a [Click] next turn"):req(req(andthis-server(or(<(:creditrunner)6)(zero?(:clickrunner))))):effect(req(swap!stateupdate-in[:corp:extra-click-temp](fnilinc0)))}}}
{:abilities[{:req(reqthis-server):label"[Trash]: Start a Psi game":msg"start a Psi game":psi{:not-equal{:prompt"Choose a rezzed piece of ICE to resolve one of its subroutines":choices{:req#(and(ice?%)(rezzed?%))}:msg(msg"resolve a subroutine on "(:titletarget))}}:effect(effect(trashcard))}]}
{:abilities[{:req(reqthis-server):label"Swap the ICE being approached with a piece of ICE from HQ":prompt"Choose a piece of ICE":choices{:req#(and(ice?%)(in-hand?%))}:once:per-run:msg(msg"swap "(card-strstatecurrent-ice)" with a piece of ICE from HQ"):effect(req(let[hqicetargetccurrent-ice](resolve-abilitystateside{:effect(req(let[newice(assochqice:zone(:zonec))cndx(ice-indexstatec)ices(get-in@state(cons:corp(:zonec)))newices(applyconj(subvecices0cndx)newice(subvecicescndx))](swap!stateassoc-in(cons:corp(:zonec))newices)(swap!stateupdate-in[:corp:hand](fn[coll](remove-once#(not=(:cid%)(:cidhqice))coll)))(trigger-eventstateside:corp-installnewice)(movestatesidec:hand)))}cardnil)))}]}
{:abilities[{:req(reqthis-server):label"Swap the ICE just passed with another piece of ICE protecting this server":effect(req(let[passed-ice(nth(get-in@state(vec(concat[:corp:servers](:serverrun)[:ices])))(:positionrun))ice-zone(:zonepassed-ice)](resolve-abilitystate:corp{:prompt(msg"Select a piece of ICE to swap with "(:titlepassed-ice)):choices{:req#(and(=ice-zone(:zone%))(ice?%))}:effect(req(let[fndx(ice-indexstatepassed-ice)sndx(ice-indexstatetarget)fnew(assocpassed-ice:zone(:zonetarget))snew(assoctarget:zone(:zonepassed-ice))](swap!stateupdate-in(cons:corpice-zone)#(assoc%fndxsnew))(swap!stateupdate-in(cons:corpice-zone)#(assoc%sndxfnew))(update-ice-strengthstatesidefnew)(update-ice-strengthstatesidesnew)))}cardnil)(system-msgstateside(str"uses Mumbad City Grid to swap "(card-strstatepassed-ice)" with "(card-strstatetarget)))))}]}
{:implementation"Only forces trash if runner has no Imps and enough credits in the credit pool":access{:req(reqinstalled):effect(req(let[trash-cost(trash-coststatesidecard)slow-trash(any-flag-fn?state:runner:slow-trashtrue)](if(and(can-pay?state:runnernil:credittrash-cost)(notslow-trash))(do(toaststate:runner"You have been forced to trash Mumbad Virtual Tour""info")(swap!stateassoc-in[:runner:register:force-trash]true))(toaststate:runner(str"You must trash Mumbad Virtual Tour, if able, using any available means ""(Whizzard, Imp, Ghost Runner, Net Celebrity...)")))))}:trash-effect{:when-inactivetrue:effect(req(swap!stateassoc-in[:runner:register:force-trash]false))}}
{:events{:successful-run{:interactive(reqtrue):delayed-completiontrue:req(req(andthis-server(<(:creditrunner)6)(<(count(:handrunner))2)(not-empty(:handcorp)))):effect(req(show-wait-promptstate:runner"Corp to use Nihongai Grid")(let[top5(take5(:deckcorp))](if(pos?(counttop5))(continue-abilitystateside{:optional{:prompt"Use Nihongai Grid to look at top 5 cards of R&D and swap one with a card from HQ?":yes-ability{:delayed-completiontrue:prompt"Choose a card to swap with a card from HQ":choicestop5:effect(req(let[rdctarget](continue-abilitystateside{:delayed-completiontrue:prompt(msg"Choose a card in HQ to swap for "(:titlerdc)):choices{:reqin-hand?}:msg"swap a card from the top 5 of R&D with a card in HQ":effect(req(let[hqctargetnewrdc(assochqc:zone[:deck])deck(vec(get-in@state[:corp:deck]))rdcndx(first(keep-indexed#(when(=(:cid%2)(:cidrdc))%1)deck))newdeck(seq(applyconj(subvecdeck0rdcndx)target(subvecdeckrdcndx)))](swap!stateassoc-in[:corp:deck]newdeck)(swap!stateupdate-in[:corp:hand](fn[coll](remove-once#(not=(:cid%)(:cidhqc))coll)))(movestatesiderdc:hand)(clear-wait-promptstate:runner)(effect-completedstatesideeid)))}cardnil)))}:no-ability{:effect(req(clear-wait-promptstate:runner)(effect-completedstatesideeidcard))}}}cardnil)(do(clear-wait-promptstate:runner)(effect-completedstatesideeidcard)))))}}}
{:implementation"Installation restriction not enforced":effect(req(prevent-run-on-serverstatecard(second(:zonecard)))):events{:runner-turn-begins{:effect(req(prevent-run-on-serverstatecard(second(:zonecard))))}:successful-run{:req(req(=target:hq)):effect(req(trashstate:corpcard)(enable-run-on-serverstatecard(second(:zonecard)))(system-msgstate:corp(str"trashes Off the Grid")))}}:leave-play(req(enable-run-on-serverstatecard(second(:zonecard))))}
(let[ohg{:req(req(or(=(:zonecard)(:zonetarget))(=(central->zone(:zonetarget))(butlast(:zonecard))))):effect(effect(register-persistent-flag!card:can-steal(fn[state_card](if-not(some#(=(:title%)(:titlecard))(:scoredrunner))((constantlyfalse)(toaststate:runner"Cannot steal due to Old Hollywood Grid.""warning"))true))))}]{:trash-effect{:req(req(and(=:servers(first(:previous-zonecard)))(:run@state))):effect(effect(register-events{:pre-steal-cost(assocohg:req(req(or(=(:zonetarget)(:previous-zonecard))(=(central->zone(:zonetarget))(butlast(:previous-zonecard)))))):run-ends{:effect(effect(unregister-eventscard))}}(assoccard:zone'(:discard))))}:events{:pre-steal-costohg:post-access-card{:effect(effect(clear-persistent-flag!target:can-steal))}}})
{:msg"prevent the Runner from jacking out unless they trash an installed program":effect(req(whenthis-server(prevent-jack-outstateside))):events{:run{:req(reqthis-server):msg"prevent the Runner from jacking out unless they trash an installed program":effect(effect(prevent-jack-out))}:runner-trash{:req(req(andthis-server(is-type?target"Program"))):effect(req(swap!stateupdate-in[:run]dissoc:cannot-jack-out))}}}
{:access{:req(req(installed?card)):delayed-completiontrue:effect(effect(show-wait-prompt:runner"Corp to use Prisec")(continue-ability{:optional{:prompt"Pay 2 [Credits] to use Prisec ability?":end-effect(effect(clear-wait-prompt:runner)):yes-ability{:cost[:credit2]:msg"do 1 meat damage and give the Runner 1 tag":delayed-completiontrue:effect(req(when-completed(damagestateside:meat1{:cardcard})(tag-runnerstate:runnereid1)))}}}cardnil))}}
{:events{:run{:req(reqthis-server):effect(effect(lose:runner:click1)):msg"force the Runner to spend an additional [Click]"}:runner-turn-begins{:req(req(>(:click-per-turnrunner)1)):effect(req(enable-run-on-serverstatecard(second(:zonecard))))}:runner-spent-click{:req(req(<=1(:clickrunner))):effect(req(prevent-run-on-serverstatecard(second(:zonecard))))}:leave-play(req(enable-run-on-serverstatecard(second(:zonecard))))}}
{:abilities[{:req(reqthis-server):label"[Trash]: Trace X - Do 3 net damage":effect(req(let[serv(card->serverstatecard)cards(concat(:icesserv)(:contentserv))](trashstatesidecard)(doseq[ccards](trashstatesidec))(resolve-abilitystateside{:trace{:base(req(dec(countcards))):effect(effect(damageeid:net3{:cardcard})):msg"do 3 net damage"}}cardnil)))}]}
{:events{:rez{:req(req(and(=(second(:zonetarget))(second(:zonecard)))(not(and(is-type?target"Upgrade")(is-central?(second(:zonetarget)))))(not=(:cidtarget)(:cidcard))(seq(filter#(and(not(rezzed?%))(not(is-type?%"Agenda")))(all-installedstate:corp))))):effect(effect(resolve-ability{:optional{:prompt(msg"Rez another card with Surat City Grid?"):yes-ability{:prompt"Choose a card to rez":choices{:req#(and(not(rezzed?%))(not(is-type?%"Agenda")))}:msg(msg"rez "(:titletarget)", lowering the rez cost by 2 [Credits]"):effect(effect(rez-cost-bonus-2)(reztarget))}}}cardnil))}}}
{:abilities[{:label"Reveal and trash a copy of the ICE just passed from HQ":req(req(andthis-server(>(count(get-run-icesstate))(:positionrun))(:rezzed(get-in(:ices(card->serverstatecard))[(:positionrun)])))):effect(req(let[icename(:title(get-in(:ices(card->serverstatecard))[(:positionrun)]))](resolve-abilitystateside{:prompt"Choose a copy of the ICE just passed":choices{:req#(and(in-hand?%)(ice?%)(=(:title%)icename))}:effect(req(trashstateside(assoctarget:seentrue))(swap!stateupdate-in[:run]#(assoc%:position(inc(:positionrun))))):msg(msg"trash a copy of "(:titletarget)" from HQ and force the Runner to encounter it again")}cardnil)))}]}
{:events{:pre-resolve-damage{:once:per-run:req(req(andthis-server(=target:net)(>(lasttargets)0)(can-pay?state:corpnil[:credit2]))):effect(req(swap!stateassoc-in[:damage:damage-replace]true)(damage-deferstateside:net(lasttargets))(show-wait-promptstate:runner"Corp to use Tori Hanzō")(resolve-abilitystateside{:optional{:prompt(str"Pay 2 [Credits] to do 1 brain damage with Tori Hanzō?"):player:corp:yes-ability{:msg"do 1 brain damage instead of net damage":effect(req(swap!stateupdate-in[:damage]dissoc:damage-replace)(clear-wait-promptstate:runner)(paystate:corpcard:credit2)(damagestatesideeid:brain1{:cardcard}))}:no-ability{:effect(req(swap!stateupdate-in[:damage]dissoc:damage-replace)(clear-wait-promptstate:runner)(damagestatesideeid:net(get-defer-damagestateside:netnil){:cardcard}))}}}cardnil))}:prevented-damage{:req(req(andthis-server(=target:net)(>(lasttargets)0))):effect(req(swap!stateassoc-in[:per-run(:cidcard)]true))}}}
{:abilities[{:label"[Trash]: Prevent a subroutine on a Bioroid from being broken":req(req(and(=(butlast(:zonecurrent-ice))(butlast(:zonecard)))(has-subtype?current-ice"Bioroid"))):effect(effect(trashcard)):msg(msg"prevent a subroutine on "(:titlecurrent-ice)" from being broken")}]}
{:implementation"Bypass prevention is not implemented":events{:pre-expose{:req(req(=(take2(:zonetarget))(take2(:zonecard)))):msg"prevent 1 card from being exposed":effect(effect(expose-prevent1))}}}
{:implementation"Activation is manual":abilities[{:req(reqthis-server):label"Reduce Runner's maximum hand size by 1 until start of next Corp turn":msg"reduce the Runner's maximum hand size by 1 until the start of the next Corp turn":effect(req(update!stateside(assoccard:times-used(inc(getcard:times-used0))))(losestate:runner:hand-size-modification1))}]:trash-effect{:req(req(and(=:servers(first(:previous-zonecard)))(:run@state))):effect(req(when-let[n(:times-usedcard)](register-eventsstateside{:corp-turn-begins{:msg(msg"increase the Runner's maximum hand size by "n):effect(effect(gain:runner:hand-size-modificationn)(unregister-eventscard)(update!(dissoccard:times-used)))}}(assoccard:zone'(:discard)))))}:events{:corp-turn-begins{:req(req(:times-usedcard)):msg(msg"increase the Runner's maximum hand size by "(:times-usedcard)):effect(effect(gain:runner:hand-size-modification(:times-usedcard))(update!(dissoccard:times-used)))}}}
{:events{:successful-run{:interactive(reqtrue):delayed-completiontrue:req(req(andthis-server(some#(has-subtype?%"Icebreaker")(all-installedstate:runner)))):effect(req(show-wait-promptstate:runner"Corp to use Will-o'-the-Wisp")(continue-abilitystateside{:optional{:prompt"Trash Will-o'-the-Wisp?":choices{:req#(has-subtype?%"Icebreaker")}:yes-ability{:delayed-completiontrue:prompt"Choose an icebreaker used to break at least 1 subroutine during this run":choices{:req#(has-subtype?%"Icebreaker")}:msg(msg"add "(:titletarget)" to the bottom of the Runner's Stack"):effect(effect(trashcard)(move:runnertarget:deck)(clear-wait-prompt:runner)(effect-completedeidcard))}:no-ability{:effect(effect(clear-wait-prompt:runner)(effect-completedeidcard))}}}cardnil))}}}