{:effect(effect(gain:credit3)):msg(msg"gain 3 [Credits]"):abilities[{:label"[Trash]: Install a non-agenda card from HQ":effect(effect(trashcard)(corp-installtargetnil)):msg(msg(corp-install-msgtarget)):prompt"Choose a non-agenda card to install from HQ":prioritytrue:req(req(not(:run@state))):choices{:req#(and(not(is-type?%"Operation"))(not(is-type?%"Agenda"))(=(:zone%)[:hand])(=(:side%)"Corp"))}}]}
(advance-ambush2{:req(req(<0(:advance-counter(get-cardstatecard)0))):delayed-completiontrue:effect(req(let[agg(get-cardstatecard)n(:advance-counteragg0)ab(->trash-program(assoc-in[:choices:max]n)(assoc:prompt(msg"Choose "n" program"(when(>n1)"s")" to trash"):delayed-completiontrue:effect(effect(trash-cardseidtargetsnil)):msg(msg"trash "(join", "(map:titletargets)))))](continue-abilitystatesideabaggnil)))})
{:abilities[{:label"[Trash]: Shuffle all cards in HQ into R&D":effect(req(trashstatesidecard)(do(show-wait-promptstate:corp"Runner to decide whether or not to prevent Alexa Belsky")(resolve-abilitystateside{:prompt"How many credits?":choices:credit:player:runner:msg(msg"shuffle "(-(count(:handcorp))(quottarget2))" card"(when-not(=1(-(count(:handcorp))(quottarget2)))"s")" in HQ into R&D"):effect(req(if(pos?(quottarget2))(do(doseq[c(take(-(count(:handcorp))(quottarget2))(shuffle(:handcorp)))](movestate:corpc:deck))(shuffle!state:corp:deck)(system-msgstate:runner(str"pays "target" [Credits] to prevent "(quottarget2)" random card"(when(>(quottarget2)1)"s")" in HQ from being shuffled into R&D")))(shuffle-into-deckstate:corp:hand))(clear-wait-promptstate:corp))}cardnil)))}]}
{:events{:corp-install{:effect(effect(add-countercard:power1))}}:abilities[{:cost[:click1]:label"Gain 2 [Credits] for each counter on Alix T4LB07":msg(msg"gain "(*2(get-incard[:counter:power]0))" [Credits]"):effect(effect(gain:credit(*2(get-incard[:counter:power]0)))(trashcard))}]}
{:implementation"Card swapping is manual":advanceable:always:abilities[{:label"Swap 1 card in HQ and Archives for each advancement token":effect(effect(trashcard)):msg(msg"swap "(:advance-countercard0)" cards in HQ and Archives")}]}
(let[ability{:label"Place 1 advancement token on Anson Rose (start of turn)":once:per-turn:effect(effect(add-propcard:advance-counter1{:placedtrue}))}]{:derezzed-events{:runner-turn-endscorp-rez-toast}:flags{:corp-phase-12(reqtrue)}:events{:corp-turn-beginsability:rez{:req(req(and(ice?target)(pos?(:advance-countercard0)))):delayed-completiontrue:effect(req(let[ice(get-cardstatetarget)icename(:titleice)](show-wait-promptstate:runner"Corp to use Anson Rose")(continue-abilitystateside{:optional{:prompt(msg"Move advancement tokens from Anson Rose to "icename"?"):yes-ability{:prompt"Choose how many advancement tokens to remove from Anson Rose":choices{:number(req(:advance-countercard))}:effect(effect(clear-wait-prompt:runner)(add-prop:corpice:advance-countertarget{:placedtrue})(add-prop:corpcard:advance-counter(-target){:placedtrue})(system-msg(str"uses Anson Rose to move "target" advancement tokens to "(card-strstateice))))}:no-ability{:effect(effect(clear-wait-prompt:runner))}}}cardnil)))}}:abilities[ability]})
(let[ability{:req(requnprotected):delayed-completiontrue:label"Do 1 net damage (start of turn)":once:per-turn:msg"do 1 net damage":effect(effect(damageeid:net1{:cardcard}))}]{:derezzed-events{:runner-turn-endscorp-rez-toast}:events{:corp-turn-beginsability}:abilities[ability]})
{:implementation"Removes 1 bad publicity rather than prevent it":abilities[{:label"Trace 3 - Avoid taking a bad publicity":trace{:base3:msg"avoid taking a bad publicity":effect(effect(lose:bad-publicity1))}}]}
{:abilities[{:cost[:click1]:req(req(and(<(:creditrunner)6)(<0(count(filter#(is-type?%"Operation")(:discardcorp)))))):label"Play an operation from Archives ignoring all costs and remove it from the game":prompt"Choose an operation to play":msg(msg"play "(:titletarget)" from Archives ignoring all costs and remove it from the game"):choices(req(cancellable(filter#(is-type?%"Operation")(:discardcorp)):sorted)):effect(effect(play-instantniltarget{:ignore-costtrue})(movetarget:rfg))}]}
{:effect(effect(lose:runner:hand-size-modification2)):leave-play(effect(gain:runner:hand-size-modification2)):trash-effect{:when-inactivetrue:req(req(:access@state)):msg"add it to the Runner's score area as an agenda worth 2 agenda points":effect(effect(as-agenda:runnercard2))}}
{:abilities[{:label"Add 1 power counter":effect(effect(add-countercard:power1)(system-msg(str"adds 1 power counter to Chief Slee")))}{:counter-cost[:power5]:cost[:click1]:delayed-completiontrue:msg"do 5 meat damage":effect(effect(damageeid:meat5{:cardcard}))}]}
{:derezzed-events{:runner-turn-endscorp-rez-toast}:flags{:corp-phase-12(req(>(:creditcorp)0))}:abilities[{:label"Move up to 3 [Credit] from credit pool to C.I. Fund":prompt"Choose how many [Credit] to move":once:per-turn:choices{:number(req(min(:creditcorp)3))}:effect(effect(lose:credittarget)(add-countercard:credittarget)):msg(msg"move "target" [Credit] to C.I. Fund")}{:label"Take all credits from C.I. Fund":cost[:credit2]:msg(msg"trash it and gain "(get-incard[:counter:credit]0)" [Credits]"):effect(effect(gain:credit(get-incard[:counter:credit]0))(trashcard{:cause:ability-cost}))}]:events{:corp-turn-begins{:req(req(>=(get-incard[:counter:credit]0)6)):effect(effect(add-countercard:credit2)(system-msg(str"adds 2 [Credit] to C.I. Fund")))}}}
{:derezzed-events{:runner-turn-endscorp-rez-toast}:flags{:corp-phase-12(req(and(some#(is-type?%"Operation")(:discardcorp))unprotected))}:abilities[{:label"Add 1 operation from Archives to HQ":prompt"Choose an operation in Archives to add to HQ":show-discardtrue:choices{:req#(and(is-type?%"Operation")(=(:zone%)[:discard]))}:effect(effect(movetarget:hand)):once:per-turn:msg(msg"add "(if(:seentarget)(:titletarget)"a facedown card")" to HQ")}]}
{:derezzed-events{:runner-turn-endscorp-rez-toast}:flags{:corp-phase-12(req(let[tokens(filter#(pos?(:advance-counter%0))(all-installedstate:corp))advanceable(filter#(can-be-advanced?%)(all-installedstate:corp))](when(and(not-emptytokens)(not-empty(clojure.set/difference(setadvanceable)(settokens))))true)))}:once:per-turn:abilities[{:label"Move an advancement token between ICE":choices{:req#(and(ice?%)(:advance-counter%))}:prioritytrue:effect(req(let[frtarget](resolve-abilitystateside{:prioritytrue:prompt"Move to where?":choices{:req#(and(ice?%)(not=(:cidfr)(:cid%))(can-be-advanced?%))}:effect(effect(add-prop:corptarget:advance-counter1)(add-prop:corpfr:advance-counter-1)(system-msg(str"uses Constellation Protocol to move an advancement token from "(card-strstatefr)" to "(card-strstatetarget))))}cardnil)cardnil))}]}
{:additional-cost[:forfeit]:derezzed-events{:runner-turn-endscorp-rez-toast}; not-empty doesn't work for the next line, because it does not return literal true; it returns the collection.
; flags need exact equality of value to work.
:flags{:corp-phase-12(req(and(pos?(count(filter#(card-is?%:type"Resource")(all-installedstate:runner))))(:rezzedcard)))}:abilities[{:label"Trash a resource":prompt"Choose a resource to trash with Corporate Town":choices{:req#(is-type?%"Resource")}:msg(msg"trash "(:titletarget)):effect(effect(trashtarget{:unpreventabletrue}))}]}
{:events{:pre-corp-draw{:msg"draw additional cards":once:per-turn:once-key:daily-business-show-draw-bonus:req(req(first-event?stateside:pre-corp-draw)):effect(req(let[dbs(count(filter#(and(="06086"(:code%))(rezzed?%))(all-installedstate:corp)))](draw-bonusstatesidedbs)))}:post-corp-draw{:once:per-turn:once-key:daily-business-show-put-bottom:delayed-completiontrue:effect(req(let[dbs(count(filter#(and(="06086"(:code%))(rezzed?%))(all-installedstate:corp)))drawn(get-in@state[:corp:register:most-recent-drawn])](continue-abilitystateside{:prompt(str"Choose "dbs" card"(when(>dbs1)"s")" to add to the bottom of R&D"):msg(msg"add "dbs" card"(when(>dbs1)"s")" to the bottom of R&D"):choices{:maxdbs:req#(some(fn[c](=(:cidc)(:cid%)))drawn)}:effect(req(doseq[ctargets](movestatesidec:deck)))}cardtargets)))}}}
{:in-play[:click1:click-per-turn1]:trash-effect{:when-inactivetrue:req(req(:access@state)):msg"add it to the Runner's score area as an agenda worth 2 agenda points":effect(effect(as-agenda:runnercard2))}}
{:abilities[{:cost[:click2]:msg"add 1 power counter":effect(effect(add-countercard:power1))}]:events{:pre-install{:req(req(and(not(zero?(get-incard[:counter:power])))(not(get-in@state[:per-turn(:cidcard)])))):effect(effect(install-cost-bonus[:credit(get-incard[:counter:power])]))}:runner-install{:silent(reqtrue):req(req(and(not(zero?(get-incard[:counter:power])))(not(get-in@state[:per-turn(:cidcard)])))):msg(msg"increase the install cost of "(:titletarget)" by "(get-incard[:counter:power])" [Credits]"):effect(req(swap!stateassoc-in[:per-turn(:cidcard)]true))}}}
{:derezzed-events{:runner-turn-endscorp-rez-toast}:flags{:corp-phase-12(req(some#(and(can-be-advanced?%)(in-server?%))(all-installedstate:corp)))}:abilities[{:cost[:credit1]:label"Place 1 advancement token on a card that can be advanced in a server":choices{:req#(and(can-be-advanced?%)(installed?%)(in-server?%))}; should be *in* a server
:effect(effect(add-proptarget:advance-counter1{:placedtrue})):once:per-turn:msg(msg"place 1 advancement token on "(card-strstatetarget))}]}
{:effect(effect(lose:bad-publicity1)):msg"remove 1 bad publicity":abilities[{:cost[:click1]:label"Trash a location":msg(msg"trash "(:titletarget)" and take 1 bad publicity"):choices{:req#(has-subtype?%"Location")}:effect(effect(trashcard)(trashtarget)(gain:bad-publicity1))}]}
{:abilities[{:cost[:click3]:choices{:req#(not(:rezzed%))}:label"Rez a card at no cost":msg(msg"rez "(:titletarget)" at no cost"):effect(effect(reztarget{:ignore-cost:all-costs}))}]}
{:derezzed-events{:runner-turn-endscorp-rez-toast}:flags{:corp-phase-12(req(some#(not(rezzed?%))(all-installedstate:corp)))}:abilities[{:choices{:req(complementrezzed?)}:label"Rez a card, lowering the cost by 1 [Credits]":msg(msg"rez "(:titletarget)):effect(effect(rez-cost-bonus-1)(reztarget{:no-warningtrue})(update!(assoccard:ebc-rezzed(:cidtarget))))}{:prompt"Choose an asset to add to HQ":msg(msg"add "(:titletarget)" to HQ"):activatemsg"searches R&D for an asset":choices(req(cancellable(filter#(is-type?%"Asset")(:deckcorp)):sorted)):cost[:credit1]:label"Search R&D for an asset":effect(effect(trashcard)(shuffle!:deck)(movetarget:hand))}]; A card rezzed by Executive Bootcamp is ineligible to receive the turn-begins event for this turn.
:suppress{:corp-turn-begins{:req(req(=(:cidtarget)(:ebc-rezzed(get-cardstatecard))))}}:events{:corp-turn-ends{:req(req(:ebc-rezzedcard)):effect(effect(update!(dissoccard:ebc-rezzed)))}}}
{:abilities[{:prompt"Choose an executive, sysop, or character to add to HQ":msg(msg"add "(:titletarget)" to HQ and shuffle R&D"):activatemsg"searches R&D for an executive, sysop, or character":choices(req(cancellable(filter#(or(has-subtype?%"Executive")(has-subtype?%"Sysop")(has-subtype?%"Character"))(:deckcorp)):sorted)):cost[:click1]:label"Search R&D for an executive, sysop, or character":effect(effect(movetarget:hand)(shuffle!:deck))}]}
{:advanceable:always:abilities[{:label"Remove 1 bad publicity for each advancement token on Exposé":msg(msg"remove "(:advance-countercard)" bad publicity"):effect(effect(trashcard)(lose:bad-publicity(:advance-countercard)))}]}
{:events{:access{:req(req(is-type?target"Agenda")):msg"add it to their score area as an agenda worth 1 agenda point":effect(effect(as-agenda:corpcard1))}}}
{:can-host(req(and(or(is-type?target"Asset")(is-type?target"Agenda"))(>2(count(:hostedcard))))):trash-cost-bonus(req(*3(count(:hostedcard)))):abilities[{:label"Install an asset or agenda on Full Immersion RecStudio":req(req(<(count(:hostedcard))2)):cost[:click1]:prompt"Choose an asset or agenda to install":choices{:req#(and(or(is-type?%"Asset")(is-type?%"Agenda"))(in-hand?%)(=(:side%)"Corp"))}:msg"install and host an asset or agenda":effect(req(corp-installstatesidetargetcard))}]}
{:msg"prevent the Runner from drawing more than 2 cards during their turn":effect(req(max-drawstate:runner2)(when(=0(remaining-drawsstate:runner))(prevent-drawstate:runner))):events{:runner-turn-begins{:effect(effect(max-draw:runner2))}}:leave-play(req(swap!stateupdate-in[:runner:register]dissoc:max-draw:cannot-draw))}
(advance-ambush0{:delayed-completiontrue:req(req(<0(:advance-counter(get-cardstatecard)0))):msg(msg"give the Runner "(:advance-counter(get-cardstatecard)0)" tag"(when(>(:advance-counter(get-cardstatecard)0)1)"s")):effect(effect(tag-runner:runnereid(:advance-counter(get-cardstatecard)0)))})
{:advanceable:always:abilities[{:label"Gain 4 [Credits] for each advancement token on GRNDL Refinery":cost[:click1]:msg(msg"gain "(*4(getcard:advance-counter0))" [Credits]"):effect(effect(trashcard)(gain:credit(*4(getcard:advance-counter0))))}]}
{:events{:runner-trash{:delayed-completiontrue:req(req(some#(card-is?%:side:corp)targets)):msg(msg(str"do "(count(filter#(card-is?%:side:corp)targets))" net damage")):effect(effect(damageeid:net(count(filter#(card-is?%:side:corp)targets)){:cardcard}))}}:abilities[{:msg"do 1 net damage":delayed-completiontrue:effect(effect(damageeid:net1{:cardcard}))}]}
(let[trash-ability(fn[type]{:req(req(seq(filter#(is-type?%type)(:handrunner)))):prompt(str"Choose a "type" to trash"):choices(req(filter#(is-type?%type)(:handrunner))):effect(effect(trashtarget)):msg(msg" trash "(:titletarget)" from the Runner's Grip")})choose-ability{:label"Trash 1 card in the Runner's Grip of a named type":once:per-turn:req(req(seq(:handrunner))):prompt"Choose a card type":choices["Event""Hardware""Program""Resource"]:msg(msg"reveal "(join", "(map:title(:handrunner)))" and trash a "target):effect(effect(resolve-ability(trash-abilitytarget)cardnil))}]{:additional-cost[:forfeit]:flags{:corp-phase-12(constantlytrue)}:derezzed-events{:runner-turn-endscorp-rez-toast}:abilities[choose-ability]})
{:abilities[{:cost[:click1]:label"Add an installed card to HQ":choices{:reqinstalled?}:msg(msg"move "(card-strstatetarget)" to HQ"):effect(effect(movetarget:hand))}]}
{:abilities[{:counter-cost[:power1]:label"Add strength to a rezzed ICE":choices{:req#(and(ice?%)(:rezzed%))}:req(req(<0(get-incard[:counter:power]0))):msg(msg"add strength to a rezzed ICE"):effect(req(update!stateside(update-incard[:it-targets(keyword(str(:cidtarget)))](fnilinc0)))(update-ice-strengthstatesidetarget))}{:cost[:click1]:msg"add 1 counter":effect(effect(add-countercard:power1))}]:events(let[it{:req(req(:it-targetscard)):effect(req(update!stateside(dissoccard:it-targets))(update-all-icestateside))}]{:pre-ice-strength{:req(req(get-incard[:it-targets(keyword(str(:cidtarget)))])):effect(effect(ice-strength-bonus(*(get-incard[:it-targets(keyword(str(:cidtarget)))])(inc(get-incard[:counter:power])))target))}:runner-turn-endsit:corp-turn-endsit})}
{:abilities[{:cost[:click1]:effect(effect(draw2)):msg"draw 2 cards"}{:label"Shuffle up to 3 cards from Archives into R&D":activatemsg"removes Jackson Howard from the game":effect(effect(rfg-and-shuffle-rd-effectcard3))}]}
{:flags{:corp-phase-12(reqtrue)}:abilities[{:msg"look at the top card of the Runner's Stack":effect(effect(prompt!card(str"The top card of the Runner's Stack is "(:title(first(:deckrunner))))["OK"]{}))}{:label"[Trash]: Trash the top card of the Runner's Stack":msg(msg"trash "(:title(first(:deckrunner)))" from the Runner's Stack"):effect(effect(mill:runner)(trashcard{:cause:ability-cost}))}]}
{:events{:rez{:effect(effect(add-countercard:power1))}}:abilities[{:req(req(seq(filter#(and(is-type?%"Agenda")(>=(get-incard[:counter:power]0)(:agendapoints%)))(:handcorp)))):label"X power counters: Reveal an agenda worth X points from HQ":effect(req(let[c(get-incard[:counter:power])](resolve-abilitystateside{:prompt"Choose an agenda in HQ to reveal":choices{:req#(and(is-type?%"Agenda")(>=c(:agendapoints%)))}:msg(msg"reveal "(:titletarget)" from HQ"):effect(req(let[title(:titletarget)pts(:agendapointstarget)](register-turn-flag!statesidecard:can-steal(fn[statesidecard](if(=(:titlecard)title)((constantlyfalse)(toaststate:runner"Cannot steal due to Lakshmi Smartfabrics.""warning"))true)))(add-counterstatesidecard:power(-pts))))}cardnil)))}]}
{:abilities[{:prompt"Choose an ICE":msg(msg"adds "(:titletarget)" to HQ"):choices(req(cancellable(filterice?(:deckcorp)):sorted)):label"Search R&D for a piece of ICE":cost[:click1:credit1]:effect(effect(shuffle!:deck)(movetarget:hand))}]}
{:effect(effect(draw3)):msg(msg"draw 3 cards"):abilities[{:label"Remove a tag to search R&D for an operation":prompt"Choose an operation to put on top of R&D":cost[:click1]:choices(req(let[ops(filter#(is-type?%"Operation")(:deckcorp))](if(empty?ops)["No Operation in R&D"]ops))):req(req(pos?(get-in@state[:runner:tag]))):effect(req(if(not=target"No Operation found")(let[c(movestate:corptarget:play-area)](shuffle!state:corp:deck)(movestate:corpc:deck{:fronttrue})(system-msgstateside(str"uses Lily Lockwell to put "(:titlec)" on top of R&D")))(do(shuffle!state:corp:deck)(system-msgstateside(str"uses Lily Lockwell, but did not find an Operation in R&D"))))(losestate:runner:tag1))}]}
{:events{:agenda-counter-spent{:effect(effect(gain:credit1)):msg"gain 1 [Credits]"}}:abilities[{:label"Trash to gain 2 [Credits]":msg"gain 2 [Credits]":effect(effect(gain:credit2)(trashcard))}{:label"Spend an agenda counter to gain 2 [Credits]":effect(req(resolve-abilitystateside{:prompt"Select an agenda with a counter":choices{:req#(and(is-type?%"Agenda")(pos?(get-in%[:counter:agenda]0)))}:effect(req(add-counterstatesidetarget:agenda-1)(gainstate:corp:credit2)(trigger-eventstateside:agenda-counter-spentcard)):msg(msg"spend an agenda token on "(:titletarget)" and gain 2 [Credits]")}cardnil))}]}
{:abilities[{:label"Search R&D for an Alliance card":cost[:click1]:prompt"Choose an Alliance card to play or install":choices(req(cancellable(filter#(and(has-subtype?%"Alliance")(if(is-type?%"Operation")(<=(:cost%)(:creditcorp))true))(:deckcorp)):sorted)):msg(msg"reveal "(:titletarget)" from R&D and "(if(=(:typetarget)"Operation")"play ""install ")" it"):effect(req(shuffle!stateside:deck)(if(=(:typetarget)"Operation")(play-instantstatesidetarget)(corp-installstatesidetargetnilnil)))}]}
{:derezzed-events{:runner-turn-endscorp-rez-toast}:events{:corp-turn-begins{:effect(effect(add-propcard:advance-counter1{:placedtrue}))}}:abilities[{:cost[:credit2]:req(req(and(>(getcard:advance-counter0)0)(some#(rezzed?%)(all-installedstate:corp)))):label"Move an advancement token to a faceup card":prompt"Choose a faceup card":choices{:req#(rezzed?%)}:msg(msg"move an advancement token to "(card-strstatetarget)):effect(effect(add-propcard:advance-counter-1{:placedtrue})(add-proptarget:advance-counter1{:placedtrue}))}]}
{:flags{:corp-phase-12(req(pos?(count(get-in@state[:corp:discard]))))}:abilities[{:label"Shuffle cards in Archives into R&D":prompt(msg(let[mus(count(filter#(and(="10019"(:code%))(rezzed?%))(all-installedstate:corp)))](str"Choose "(if(<1mus)(strmus" cards")"a card")" in Archives to shuffle into R&D"))):choices{:req#(and(card-is?%:side:corp)(=(:zone%)[:discard])):max(req(count(filter#(and(="10019"(:code%))(rezzed?%))(all-installedstate:corp))))}:show-discardtrue:priority1:once:per-turn:once-key:museum-of-history:msg(msg"shuffle "(let[seen(filter:seentargets)](str(join", "(map:titleseen))(let[n(count(filter#(not(:seen%))targets))](when(pos?n)(str(when-not(empty?seen)" and ")n" card"(when(>n1)"s"))))))" into R&D"):effect(req(doseq[ctargets](movestatesidec:deck))(shuffle!stateside:deck))}]}
(let[ability{:msg"gain 1 [Credits]":label"Gain 1 [Credits] (start of turn)":once:per-turn:effect(effect(gain:credit1))}]{:derezzed-events{:runner-turn-endscorp-rez-toast}:events{:corp-turn-beginsability}:abilities[ability{:label"Place 1 power counter":cost[:credit1]:effect(effect(add-countercard:power1)(system-msg(str"places 1 power counter on NASX")))}{:label"Place 2 power counters":cost[:credit2]:effect(effect(add-countercard:power2)(system-msg(str"places 2 power counters on NASX")))}{:label"[Trash] and gain 2 [Credits] for each power counter":cost[:click1]:msg(msg"gain "(*2(get-incard[:counter:power]))" [Credits]"):effect(effect(gain:credit(*2(get-incard[:counter:power])))(trashcard))}]})
{:access{:msg(msg"force the Runner take 2 tags or add it to their score area as an agenda worth -1 agenda point"):delayed-completiontrue:effect(effect(continue-ability{:player:runner:delayed-completiontrue:prompt"Take 2 tags or add News Team to your score area as an agenda worth -1 agenda point?":choices["Take 2 tags""Add News Team to score area"]:effect(req(if(=target"Add News Team to score area")(do(system-msgstate:runner(str"adds News Team to their score area as an agenda worth -1 agenda point"))(as-trashed-agendastate:runnercard-1{:forcetrue})(effect-completedstatesideeid))(do(system-msgstate:runner(str"takes 2 tags from News Team"))(tag-runnerstate:runnereid2))))}cardtargets))}}
{:abilities[{:cost[:click1]:label"Place 1 advancement token on a card":choices{:req#(and(=(:side%)"Corp")(installed?%))}:msg(msg"place 1 advancement token on "(card-strstatetarget)):effect(req(add-propstate:corptarget:advance-counter1{:placedtrue})(let[tgtcid(:cidtarget)](register-turn-flag!statesidetarget:can-score(fn[statesidecard](if(and(=(:cidcard)tgtcid)(>=(:advance-countercard)(or(:current-costcard)(:advancementcostcard))))((constantlyfalse)(toaststate:corp"Cannot score due to PAD Factory.""warning"))true)))))}]}
(let[ability{:msg"make each player draw 1 card":label"Make each player draw 1 card (start of turn)":once:per-turn:effect(effect(draw1)(draw:runner))}]{:derezzed-events{:runner-turn-endscorp-rez-toast}:flags{:corp-phase-12(reqtrue)}:events{:corp-turn-beginsability}:abilities[ability]})
(advance-ambush0{:req(req(pos?(:advance-counter(get-cardstatecard)0))):effect(req(show-wait-promptstate:runner"Corp to choose an agenda to score with Plan B")(doseq[ag(filter#(is-type?%"Agenda")(get-in@state[:corp:hand]))](update-advancement-coststatesideag))(resolve-abilitystateside{:prompt"Choose an Agenda in HQ to score":choices{:req#(and(is-type?%"Agenda")(<=(:current-cost%)(:advance-counter(get-cardstatecard)0))(in-hand?%))}:msg(msg"score "(:titletarget)):effect(effect(score(assoctarget:advance-counter(:current-costtarget)))(clear-wait-prompt:runner))}cardnil))}"Score an Agenda from HQ?")
(let[pdhelper(fnpd[agendasn]{:optional{:prompt(msg"Reveal and install "(:title(nthagendasn))"?"):yes-ability{:delayed-completiontrue:msg(msg"reveal "(:title(nthagendasn))):effect(req(when-completed(corp-installstateside(nthagendasn)nil{:install-state(:install-state(card-def(nthagendasn)):unrezzed)})(if(<(incn)(countagendas))(continue-abilitystateside(pdagendas(incn))cardnil)(effect-completedstatesideeid))))}:no-ability{:delayed-completiontrue:effect(req(if(<(incn)(countagendas))(continue-abilitystateside(pdagendas(incn))cardnil)(effect-completedstatesideeid)))}}})]{:events{:corp-draw{:delayed-completiontrue:req(req(let[drawn(get-in@state[:corp:register:most-recent-drawn])agendas(filter#(is-type?%"Agenda")drawn)](seqagendas))):effect(req(let[drawn(get-in@state[:corp:register:most-recent-drawn])agendas(filter#(is-type?%"Agenda")drawn)](continue-abilitystateside(pdhelperagendas0)cardnil)))}}})
(advance-ambush1{:req(req(<0(:advance-counter(get-cardstatecard)0))):msg(msg"do "(*2(:advance-counter(get-cardstatecard)0))" net damage"):delayed-completiontrue:effect(effect(damageeid:net(*2(:advance-counter(get-cardstatecard)0)){:cardcard}))})
(let[ab{:psi{:req(reqinstalled):not-equal{:msg(msg"do "(count(:handrunner))" net damage"):delayed-completiontrue:effect(effect(damageeid:net(count(:handrunner)){:cardcard}))}}}]{:exposeab:accessab})
{:effect(effect(add-countercard:power3)):derezzed-events{:runner-turn-endscorp-rez-toast}:events{:corp-turn-begins{:effect(req(add-counterstatesidecard:power-1)(when(<=(get-incard[:counter:power])1)(system-msgstate:corp"uses Public Support to add it to their score area as an agenda worth 1 agenda point")(as-agendastate:corp(dissoccard:counter)1)))}}}
{:abilities[{:once:per-turn:label"Lose [Click] and swap a card in HQ you just drew for a card in Archives":req(req(and(pos?(:clickcorp))(not-empty(turn-eventsstateside:corp-draw)))):effect(req(let[drawn(get-in@state[:corp:register:most-recent-drawn])](losestate:corp:click1)(resolve-abilitystateside{:prompt"Choose a card in HQ that you just drew to swap for a card of the same type in Archives":choices{:req#(some(fn[c](=(:cidc)(:cid%)))drawn)}:effect(req(let[hqcardtargett(:typehqcard)](resolve-abilitystateside{:show-discardtrue:prompt(msg"Choose an "t" in Archives to reveal and swap into HQ for "(:titlehqcard)):choices{:req#(and(=(:side%)"Corp")(=(:type%)t)(=(:zone%)[:discard]))}:msg(msg"lose [Click], reveal "(:titlehqcard)" from HQ, and swap it for "(:titletarget)" from Archives"):effect(req(let[swappedcard(assochqcard:zone[:discard])archndx(ice-indexstatetarget)arch(get-in@state[:corp:discard])newarch(applyconj(subvecarch0archndx)swappedcard(subvecarcharchndx))](swap!stateassoc-in[:corp:discard]newarch)(swap!stateupdate-in[:corp:hand](fn[coll](remove-once#(not=(:cid%)(:cidhqcard))coll)))(movestatesidetarget:hand)))}cardnil)))}cardnil)))}]}
{:advanceable:always:abilities[{:cost[:click1]:label"Force the Runner to lose 4 [Credits] per advancement":msg(msg"force the Runner to lose "(min(*4(getcard:advance-counter0))(:creditrunner))" [Credits]"):effect(effect(lose:runner:credit(*4(getcard:advance-counter0)))(trashcard))}]}
(let[ability{:once:per-turn:label"Remove 1 counter (start of turn)":effect(req(add-counterstatesidecard:power-1)(when(<=(get-incard[:counter:power])1)(trashstatesidecard)(resolve-abilitystateside{:prompt"Remove 1 bad publicity or gain 5 [Credits]?":choices["Remove 1 bad publicity""Gain 5 [Credits]"]:msg(msg(if(=target"Remove 1 bad publicity")"remove 1 bad publicity""gain 5 [Credits]")):effect(req(if(=target"Remove 1 bad publicity")(losestateside:bad-publicity1)(gainstateside:credit5)))}cardtargets)))}]{:effect(effect(add-countercard:power3)):derezzed-events{:runner-turn-endscorp-rez-toast}:events{:corp-turn-beginsability}:ability[ability]})
{:events{:runner-trash{:req(req(and(=(:sidetarget)"Corp")(>(:clickrunner)0))):msg"force the runner to lose 1 [Click]":effect(effect(lose:runner:click1))}}}
{:advanceable:always:abilities[{:cost[:click1]:req(req(>=(:advance-countercard)4)):msg"do 3 net damage":delayed-completiontrue:effect(effect(trashcard)(damageeid:net3{:cardcard}))}]}
{:abilities[{:label"Store any number of [Credits] on Sealed Vault":cost[:credit1]:prompt"How many [Credits]?":choices{:number(req(-(:creditcorp)1))}:msg(msg"store "target" [Credits]"):effect(effect(lose:credittarget)(add-countercard:credittarget))}{:label"Move any number of [Credits] to your credit pool":cost[:click1]:prompt"How many [Credits]?":choices{:counter:credit}:msg(msg"gain "target" [Credits]"):effect(effect(gain:credittarget))}{:label"[Trash]: Move any number of [Credits] to your credit pool":prompt"How many [Credits]?":choices{:counter:credit}:msg(msg"trash it and gain "target" [Credits]"):effect(effect(gain:credittarget)(trashcard))}]}
{:abilities[{:choices{:req#(and(ice?%)(rezzed?%))}:cost[:click1]:msg(msg"trash "(:titletarget)" to gain 4 [Credits]"):label"Trash a rezzed ICE to gain 4 [Credits]":effect(effect(trashtarget)(gain:credit4))}]}
{:derezzed-events{:runner-turn-endscorp-rez-toast}:flags{:corp-phase-12(requnprotected)}:abilities[{:label"Draw 3 cards and add 1 card in HQ to the bottom of R&D":once:per-turn:msg"draw 3 cards":effect(effect(draw3)(resolve-ability{:prompt"Choose a card in HQ to add to the bottom of R&D":choices{:req#(and(=(:side%)"Corp")(in-hand?%))}:msg"add 1 card from HQ to the bottom of R&D":effect(effect(movetarget:deck))}cardnil))}]}
(let[ability{:effect(effect(gain:credit2)):once:per-turn:label"Gain 2 [Credits] (start of turn)":msg"gain 2 [Credits]"}]{:derezzed-events{:runner-turn-endscorp-rez-toast}:abilities[ability]:events{:corp-turn-beginsability:corp-install{:req(req(ice?target)):effect(effect(trashcard)(system-msg"trashes Server Diagnostics"))}}})
{:abilities[{:cost[:click1]:msg"draw 1 card from the bottom of R&D":effect(effect(move(last(:deckcorp)):hand))}{:label"[Trash]: Search R&D for an agenda":prompt"Choose an agenda to add to the bottom of R&D":msg(msg"reveal "(:titletarget)" from R&D and add it to the bottom of R&D"):choices(req(cancellable(filter#(is-type?%"Agenda")(:deckcorp)):sorted)):effect(effect(shuffle!:deck)(movetarget:deck)(trashcard{:cause:ability-cost}))}{:label"[Trash]: Search Archives for an agenda":prompt"Choose an agenda to add to the bottom of R&D":msg(msg"reveal "(:titletarget)" from Archives and add it to the bottom of R&D"):choices(req(cancellable(filter#(is-type?%"Agenda")(:discardcorp)):sorted)):effect(effect(movetarget:deck)(trashcard{:cause:ability-cost}))}]}
(advance-ambush1{:delayed-completiontrue:effect(req(let[shat(get-cardstatecard)](when(<0(:advance-countershat0))(continue-abilitystateside(->trash-hardware(assoc-in[:choices:max](:advance-countershat))(assoc:prompt(msg"Choose "(:advance-countershat)" pieces of hardware to trash"):effect(effect(trash-cardstargets)):msg(msg"trash "(join", "(map:titletargets)))))shatnil))))})
{:access{:delayed-completiontrue:req(req(not=(first(:zonecard)):deck)):effect(effect(show-wait-prompt:runner"Corp to use Shi.Kyū")(continue-ability{:optional{:prompt"Pay [Credits] to use Shi.Kyū?":yes-ability{:prompt"How many [Credits] for Shi.Kyū?":choices:credit:msg(msg"attempt to do "target" net damage"):delayed-completiontrue:effect(effect(clear-wait-prompt:runner)(continue-ability{:player:runner:prompt(str"Take "target" net damage or add Shi.Kyū to your score area as an agenda worth -1 agenda point?"):choices[(str"Take "target" net damage")"Add Shi.Kyū to score area"]:delayed-completiontrue:effect(let[dmgtarget](req(if(=target"Add Shi.Kyū to score area")(do(as-trashed-agendastate:runnercard-1)(system-msgstate:runner(str"adds Shi.Kyū to their score area as as an agenda worth -1 agenda point"))(effect-completedstatesideeid))(do(damagestate:corpeid:netdmg{:cardcard})(system-msgstate:runner(str"takes "dmg" net damage from Shi.Kyū"))))))}cardtargets))}:no-ability{:effect(effect(clear-wait-prompt:runner))}}}cardtargets))}}
{:access{:req(req(not=(first(:zonecard)):discard)):delayed-completiontrue:effect(effect(show-wait-prompt:runner"Corp to use Snare!")(continue-ability{:optional{:prompt"Pay 4 [Credits] to use Snare! ability?":end-effect(effect(clear-wait-prompt:runner)):yes-ability{:delayed-completiontrue:cost[:credit4]:msg"do 3 net damage and give the Runner 1 tag":effect(effect(damageeid:net3{:cardcard})(tag-runner:runnereid1))}}}cardnil))}}
{:access{:delayed-completiontrue:effect(effect(show-wait-prompt:runner"Corp to use Space Camp")(continue-ability{:optional{:prompt"Place 1 advancement token?":end-effect(effect(clear-wait-prompt:runner)):yes-ability{:msg(msg"place 1 advancement token on "(card-strstatetarget)):choices{:reqcan-be-advanced?}:effect(effect(add-proptarget:advance-counter1{:placedtrue}))}}}cardnil))}}
{:events{:agenda-scored{:label"Install a card from Archives or HQ":prompt"Choose a card from Archives or HQ to install":show-discardtrue:interactive(reqtrue):delayed-completiontrue:choices{:req#(and(not(is-type?%"Operation"))(#{[:hand][:discard]}(:zone%)))}:msg(msg(corp-install-msgtarget)):effect(effect(corp-installeidtargetnil{:no-install-costtrue}))}}}
{:derezzed-events{:runner-turn-endscorp-rez-toast}:flags{:corp-phase-12(reqtrue)}:abilities[{:label"Install an asset from R&D":prompt"Choose an asset to install":msg(msg"install "(:titletarget)):choices(req(filter#(is-type?%"Asset")(:deckcorp))):effect(effect(trashcard)(shuffle!:deck)(corp-installtargetnil))}]}
{:abilities[{:label"Swap 2 pieces of installed ICE":cost[:click1]:prompt"Select two pieces of ICE to swap positions":choices{:req#(and(installed?%)(ice?%)):max2}:effect(req(when(=(counttargets)2)(swap-icestateside(firsttargets)(secondtargets)))):msg"swap the positions of two ICE"}]}
{:implementation"Derez is manual":advanceable:always:abilities[{:label"Derez 1 card for each advancement token":msg(msg"derez "(:advance-countercard)):effect(effect(trashcard))}]}
{:effect(effect(lose:runner:agenda-point(count(:scoredrunner)))):leave-play(effect(gain:runner:agenda-point(count(:scoredrunner)))):trash-effect{:when-inactivetrue:req(req(:access@state)):msg"add it to the Runner's score area as an agenda worth 2 agenda points":effect(effect(as-agenda:runnercard2))}:events{:agenda-stolen{:effect(effect(lose:runner:agenda-point1))}:card-moved{:req(req(or(some#{:scored}(:zone(firsttargets)))(some#{:scored}(:zone(secondtargets))))):effect(effect((if(some#{:scored}(:zone(firsttargets)))gainlose):runner:agenda-point1))}}}
(advance-ambush0{:effect(effect(resolve-ability{:prompt"Choose an asset or agenda in HQ":choices{:req#(and(or(is-type?%"Agenda")(is-type?%"Asset"))(in-hand?%))}:msg"swap it for an asset or agenda from HQ":effect(req(let[tidx(ice-indexstatecard)srvcont(get-in@state(cons:corp(:zonecard)))c(:advance-counter(get-cardstatecard)0)newcard(assoctarget:zone(:zonecard):advance-counterc)newcont(applyconj(subvecsrvcont0tidx)newcard(subvecsrvconttidx))](resolve-abilitystateside{:effect(req(swap!stateassoc-in(cons:corp(:zonecard))newcont)(swap!stateupdate-in[:corp:hand](fn[coll](remove-once#(not=(:cid%)(:cidnewcard))coll)))(trigger-eventstateside:corp-installnewcard)(movestatesidecard:hand))}cardnil)(resolve-promptstate:runner{:choice"No"}); gets rid of prompt to trash Toshiyuki since it's back in HQ now
(resolve-abilitystate:runner{:optional{:prompt"Access the newly installed card?":player:runner:prioritytrue:yes-ability{:effect(effect(handle-access[newcard]))}}}cardnil)))}cardnil))}"Swap Toshiyuki Sakai with an agenda or asset from HQ?")
{:effect(req(losestate:runner:click-per-turn1)(when(=(:active-player@state):runner)(losestate:runner:click1))):leave-play(req(gainstate:runner:click-per-turn1)(when(=(:active-player@state):runner)(gainstate:runner:click1))):trash-effect{:when-inactivetrue:req(req(:access@state)):msg"add it to the Runner's score area as an agenda worth 2 agenda points":effect(effect(as-agenda:runnercard2))}}
{:abilities[{:label"Install an asset on Worlds Plaza":req(req(<(count(:hostedcard))3)):cost[:click1]:prompt"Choose an asset to install on Worlds Plaza":choices{:req#(and(is-type?%"Asset")(in-hand?%)(=(:side%)"Corp"))}:msg(msg"host "(:titletarget)):effect(req(corp-installstatesidetargetcard);; install target onto card
(rez-cost-bonusstateside-2)(rezstateside(last(:hosted(get-cardstatecard)))))}]}
{:prevent{:expose[:all]}:derezzed-events{:pre-expose{:delayed-completiontrue:effect(req(let[etargettarget](continue-abilitystateside{:optional{:req(req(not(rezzed?card))):player:corp:prompt(msg"The Runner is about to expose "(:titleetarget)". Rez Zaibatsu Loyalty?"):yes-ability{:effect(effect(rezcard))}}}cardnil)))}}:abilities[{:msg"prevent 1 card from being exposed":cost[:credit1]:effect(effect(expose-prevent1))}{:msg"prevent 1 card from being exposed":label"[Trash]: Prevent 1 card from being exposed":effect(effect(trashcard{:cause:ability-cost})(expose-prevent1))}]}
{:rez-req(reqtagged):abilities[{:delayed-completiontrue:label"Give the Runner 1 tag":cost[:click1:credit1]:msg(msg"give the Runner 1 tag"):effect(effect(tag-runnereid1))}]}