(let[am{:effect(effect(add-countercard:power2)(system-msg:runner(str"places 2 power counters on Aaron Marrón")))}]{:abilities[{:counter-cost[:power1]:msg"remove 1 tag and draw 1 card":effect(effect(lose:tag1)(draw))}]:events{:agenda-scoredam:agenda-stolenam}})
{:events{:corp-turn-begins{:req(req(=0(:tagrunner))):msg"take 1 tag":delayed-completiontrue:effect(effect(tag-runner:runnereid1))}:runner-turn-begins{:req(req(nothas-bad-pub)):msg"give the Corp 1 bad publicity":effect(effect(gain:corp:bad-publicity1))}}}
{:flags{:runner-phase-12(req(>=2(count(all-installedstate:runner))))}:abilities[{:effect(req(resolve-abilitystateside{:msg(msg"trash "(:titletarget)" and gain 3 [Credits]"):choices{:req#(and(card-is?%:side:runner)(installed?%)(not(card-is?%:cid(:cidcard))))}:effect(effect(gain:credit3)(trashtarget{:unpreventabletrue}))}cardnil))}]}
{:in-play[:click1:click-per-turn1]:msg"give each player 1 additional [Click] to spend during their turn":effect(effect(gain:corp:click-per-turn1)):leave-play(effect(lose:corp:click-per-turn1))}
{:flags{:runner-phase-12(req(>(:creditrunner)0))}:abilities[{:label"Move up to 3 [Credit] from credit pool to Algo Trading":prompt"Choose how many [Credit] to move":once:per-turn:choices{:number(req(min(:creditrunner)3))}:effect(effect(lose:credittarget)(add-countercard:credittarget)):msg(msg"move "target" [Credit] to Algo Trading")}{:label"Take all credits from Algo Trading":cost[:click1]: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{:runner-turn-begins{:req(req(>=(get-incard[:counter:credit]0)6)):effect(effect(add-countercard:credit2)(system-msg(str"adds 2 [Credit] to Algo Trading")))}}}
{:prompt"How many power counters?":choices:credit:msg(msg"add "target" power counters"):effect(effect(add-countercard:powertarget)):abilities[{:counter-cost[:power1]:msg"look at the top card of Stack":effect(req(when(zero?(get-incard[:counter:power]0))(trashstate:runnercard{:unpreventabletrue}))):optional{:prompt(msg"Add "(:title(first(:deckrunner)))" to bottom of Stack?"):yes-ability{:msg"add the top card of Stack to the bottom":effect(req(movestateside(first(:deckrunner)):deck))}}}]}
{:abilities[{:prompt"Choose a card to install":msg(msg"install "(:titletarget)):cost[:forfeit]:choices(req(cancellable(filter#(not(is-type?%"Event"))(:deckrunner)):sorted)):effect(effect(trigger-event:searched-stacknil)(shuffle!:deck)(runner-installtarget))}]}
{:events{:successful-run{:req(req(and(=target:hq)(first-successful-run-on-server?state:hq))):msg"force the Corp to trash the top card of R&D":effect(effect(mill:corp))}}}
{:data{:counter{:credit8}}:events{:successful-run{:silent(reqtrue):req(req(is-remote?(:serverrun))):effect(req(let[bjcard](when-not(:replace-access(get-in@state[:run:run-effect]))(swap!stateassoc-in[:run:run-effect:replace-access]{:effect(req(if(>(count(filter#(=(:title%)"Bank Job")(all-installedstate:runner)))1)(resolve-abilitystateside{:prompt"Choose a copy of Bank Job to use":choices{:req#(andinstalled?(=(:title%)"Bank Job"))}:effect(req(let[ctargetcreds(get-inc[:counter:credit])](resolve-abilitystateside{:prompt"How many Bank Job credits?":choices{:number(req(get-inc[:counter:credit]))}:msg(msg"gain "target" [Credits]"):effect(req(gainstateside:credittarget)(set-propstatesidec:counter{:credit(-credstarget)})(when(=targetcreds)(trashstatesidec{:unpreventabletrue})))}cardnil)))}bjnil)(resolve-abilitystateside{:prompt"How many Bank Job credits?":choices{:counter:credit}:msg(msg"gain "target" [Credits]"):effect(req(gainstateside:credittarget)(when(=target(get-incard[:counter:credit]))(trashstatesidecard{:unpreventabletrue})))}bjnil)))}))))}}}
{:events{:runner-install{:interactive(req(and(is-type?target"Hardware")(some#(=(:title%)(:titletarget))(:handrunner)))):silent(req(not(and(is-type?target"Hardware")(some#(=(:title%)(:titletarget))(:handrunner))))):delayed-completiontrue:req(req(and(is-type?target"Hardware")(=[:hand](:previous-zonetarget)))):effect(req(let[hw(:titletarget)](continue-abilitystateside{:optional{:req(req(some#(when(=(:title%)hw)%)(:handrunner))):prompt(msg"Install another copy of "hw"?"):msg(msg"install another copy of "hw):yes-ability{:delayed-completiontrue:effect(req(if-let[c(some#(when(=(:title%)hw)%)(:handrunner))](runner-installstatesideeidcnil)))}}}cardnil)))}}}
(let[ability{:once:per-turn:label"Gain 1 [Credits], draw 1 card, or gain [Click] (start of turn)":req(req(:runner-phase-12@state)):effect(req(let[c(:creditcorp)b(:titlecard)](cond;; gain 1 credit
(<=5c9)(do(gainstateside:credit1)(system-msgstateside(str"uses "b" to gain 1 [Credits]")));; draw 1 card
(<=10c14)(do(drawstateside1)(system-msgstateside(str"uses "b" to draw 1 card")));; gain 1 click
(<=15c)(do(gainstateside:click1)(system-msgstateside(str"uses "b" to gain [Click]"))))))}]{:flags{:drip-economytrue}:abilities[ability]:events{:runner-turn-beginsability}})
{:abilities[{:cost[:click2]:msg"draw 3 cards and shuffle 1 card from their Grip back into their Stack":effect(effect(draw3)(resolve-ability{:prompt"Choose a card in your Grip to shuffle back into your Stack":choices{:req#(and(in-hand?%)(=(:side%)"Runner"))}:effect(effect(movetarget:deck)(shuffle!:deck))}cardnil))}]}
{:abilities[{:cost[:click1]:label"Place 1 power counter":msg"place 1 power counter on it":effect(effect(add-countercard:power1))}{:cost[:click1]:label"Install a program from your Grip":prompt"Choose a program to install from your Grip":choices{:req#(and(is-type?%"Program")(in-hand?%))}:msg(msg"install "(:titletarget)):effect(req(install-cost-bonusstateside[:credit(*-1(get-incard[:counter:power]0))])(runner-installstatesidetarget)(when(pos?(get-incard[:counter:power]0))(add-counterstatesidecard:power-1)))}]}
{:prevent{:damage[:meat]}:abilities[{:label"[Trash] and trash all cards in Grip to prevent all meat damage":msg"trash all cards in their Grip and prevent all meat damage":effect(req(trashstatesidecard{:cause:ability-cost})(doseq[c(:handrunner)](trashstatesidec{:unpreventabletrue}))(damage-preventstateside:meatInteger/MAX_VALUE))}]:events{:runner-turn-ends{:req(req(pos?(:tagrunner))):msg"force the Corp to initiate a trace":label"Trace 1 - If unsuccessful, Runner removes 1 tag":trace{:base1:unsuccessful{:effect(effect(lose:runner:tag1)):msg"remove 1 tag"}}}}}
{:implementation"Does not restrict Runner to Asset / Upgrade just rezzed":events{:rez{:req(req(and(#{"Asset""Upgrade"}(:typetarget))(can-pay?state:runnernil[:credit(rez-coststate:corptarget)]))):effect(req(toaststate:runner(str"Click Councilman to derez "(card-strstatetarget{:visibletrue})" that was just rezzed")"info")(toaststate:corp(str"Runner has the opportunity to derez with Councilman.")"error"))}}:abilities[{:prompt"Choose an asset or upgrade that was just rezzed":choices{:req#(and(rezzed?%)(or(is-type?%"Asset")(is-type?%"Upgrade")))}:effect(req(let[ctargetcreds(rez-coststate:corpc)](when(can-pay?statesidenil[:creditcreds])(resolve-abilitystate:runner{:msg(msg"pay "creds" [Credit] and derez "(:titlec)". Councilman is trashed"):effect(req(losestate:runner:creditcreds)(derezstate:corpc)(register-turn-flag!statesidecard:can-rez(fn[statesidecard](if(=(:cidcard)(:cidc))((constantlyfalse)(toaststate:corp"Cannot rez the rest of this turn due to Councilman"))true)))(trashstatesidecard{:unpreventabletrue}))}cardnil))))}]}
{:prevent{:damage[:meat]}:recurring2:abilities[{:label"Trash to prevent up to 3 meat damage":msg"prevent up to 3 meat damage":effect(effect(trashcard{:cause:ability-cost})(damage-prevent:meat3))}]}
{:req(req(some#{:hq:rd:archives}(:successful-runrunner-reg))):abilities[{:req(reqtagged):cost[:click1]:effect(effect(mill:corp)):msg"force the Corp to trash the top card of R&D"}]}
{:abilities[{:msg"prevent the corp from rezzing the outermost piece of ice during a run on any server this turn":effect(effect(register-turn-flag!card:can-rez(fn[statesidecard](if(and(ice?card)(=(count(get-in@state(concat[:corp:servers](:server(:run@state))[:ices])))(inc(ice-indexstatecard))))((constantlyfalse)(toaststate:corp"Cannot rez any outermost ICE due to DDoS.""warning"))true)))(trashcard{:cause:ability-cost}))}]}
{:flags{:runner-phase-12(req(>=2(count(all-installedstate:runner))))}:abilities[{:prompt"Choose an installed card to make its text box blank for the remainder of the turn":once:per-turn:choices{:req#(:installed%)}:msg(msg"make the text box of "(:titletarget)" blank for the remainder of the turn"):effect(req(let[ctarget](update!stateside(dissoctarget:events:abilities))(deactivatestatesidetarget)(register-eventsstateside{:runner-turn-ends{:effect(effect(card-init(get-cardstatec))(unregister-eventscard))}}card)))}]:events{:runner-turn-endsnil}}
{:flags{:runner-phase-12(req(some#(card-flag?%:drip-economytrue)(all-installedstate:runner)))}:abilities[{:label"Lose 1 [Credits] (start of turn)":msg(msg(if(=(get-in@state[:runner:credit])0)"lose 0 [Credits] (runner has no credits to lose)""lose 1 [Credits]")):req(req(:runner-phase-12@state)):once:per-turn:effect(effect(lose:credit1))}]:events{:corp-turn-begins{:msg(msg"draw "(if(=(count(get-in@state[:runner:deck]))0)"0 cards (runner's stack is empty)""1 card")):effect(effect(draw:runner1))}:runner-turn-begins{:msg(msg"lose "(if(=(get-in@state[:runner:credit])0)"0 [Credits] (runner has no credits to lose)""1 [Credits]")):once:per-turn:effect(effect(lose:credit1))}}}
{:abilities[{:effect(effect(trashcard{:cause:ability-cost})(draw:corp2)):msg"force the Corp to draw 2 cards"}]:install-cost-bonus(req(if(andrun(=(:serverrun)[:rd])(zero?(:positionrun)))[:credit-7:click-1]nil)):effect(req(when(andrun(=(:serverrun)[:rd])(zero?(:positionrun)))(when-completed(register-successful-runstateside(:serverrun))(do(swap!stateupdate-in[:runner:prompt]rest)(handle-end-runstateside)))))}
{:events{:successful-run{:silent(reqtrue):msg(msg"force the Corp to reveal "(:title(first(shuffle(:handcorp))))):req(req(genetics-trigger?stateside:successful-run))}}}
{:prevent{:trash[:resource]}:abilities[{:label"[Trash]: Prevent another installed resource from being trashed":effect(effect(trash-prevent:resource1)(trashcard{:unpreventabletrue:cause:ability-cost}))}{:label"[Trash]: Gain 2 [Credits]":effect(effect(trashcard{:cause:ability-cost})(gain:credit2)):msg"gain 2 [Credits]"}]}
{:events{:agenda-scored{:msg"add it to their score area as an agenda worth 0 agenda points":req(req(installed?card)):effect(effect(as-agenda:runnercard0))}}}
{:abilities[{:req(req(and(empty?(:hostedcard))(is-type?(:card(first(get-in@state[side:prompt])))"Agenda"))):label"Host an agenda being accessed":effect(req(when-let[agenda(:card(first(get-in@state[side:prompt])))](hoststatesidecard(movestatesideagenda:play-area))(close-access-promptstateside)(effect-completedstatesideeidnil)(when-not(:run@state)(swap!statedissoc:access)))):msg(msg"host "(:title(:card(first(get-in@state[side:prompt]))))" instead of accessing it")}{:cost[:click2]:label"Add hosted agenda to your score area":req(req(not(empty?(:hostedcard)))):effect(req(let[c(movestate:runner(first(:hostedcard)):scored)](gain-agenda-pointstate:runner(get-agenda-pointsstate:runnerc)))):msg(msg(let[c(first(:hostedcard))](str"add "(:titlec)" to their score area and gain "(get-agenda-pointsstate:runnerc)" agenda point"(when(>(get-agenda-pointsstate:runnerc)1)"s"))))}]}
{:events{:post-runner-draw{:msg(msg"reveal that they drew: "(join", "(map:title(get-in@state[:runner:register:most-recent-drawn]))))}:successful-run{:interactive(reqtrue):optional{:delayed-completiontrue:req(req(first-event?stateside:successful-run)):prompt"Use Find the Truth to look at the top card of R&D?":yes-ability{:msg"look at the top card of R&D":effect(req(prompt!state:runnercard(str"The top card of R&D is "(:title(first(:deckcorp))))["OK"]{})(effect-completedstatesideeid))}:no-ability{:effect(req(effect-completedstatesideeid))}}}}}
{:events{:agenda-scored{:delayed-completiontrue:interactive(reqtrue):msg(msg"access "(get-in@state[:runner:hq-access])" card"(when(<1(get-in@state[:runner:hq-access]))"s")" from HQ"):effect(req(when-completed; manually trigger the pre-access event to alert Nerve Agent.
(trigger-event-syncstateside:pre-access:hq)(let[from-hq(access-countstateside:hq-access)](continue-abilitystate:runner(access-helper-hqstatefrom-hq; access-helper-hq uses a set to keep track of which cards have already
; been accessed. by adding HQ root's contents to this set, we make the runner
; unable to access those cards, as Gang Sign intends.
(set(get-in@state[:corp:servers:hq:content])))cardnil))))}}}
{:msg"make Genetics trigger a second time each turn":effect(effect(register-persistent-flag!card:genetics-trigger-twice(constantlytrue))):leave-play(effect(clear-persistent-flag!card:genetics-trigger-twice))}
{:req(req(>(:linkrunner)1)):flags{:runner-phase-12(reqtrue)}:abilities[{:msg"lose [Click] and look at the top card of R&D":once:per-turn:effect(effect(prompt!card(str"The top card of R&D is "(:title(first(:deckcorp))))["OK"]{}))}]:events{:runner-turn-begins{:req(req(get-in@state[:per-turn(:cidcard)])):effect(effect(lose:click1))}}}
{:events{:pre-damage{:req(req(or(=target:meat)(=target:net))):msg(msg"prevent all "(if(=target:meat)"meat""net")" damage"):effect(req(damage-preventstateside:meatInteger/MAX_VALUE)(damage-preventstateside:netInteger/MAX_VALUE)(if(<(:creditrunner)4)(trashstatesidecard)(resolve-abilitystate:runner{:optional{:prompt"Pay 4 [Credits] to prevent trashing Guru Davinder?":player:runner:yes-ability{:effect(effect(lose:runner:credit4)(system-msg(str"pays 4 [Credits] to prevent Guru Davinder ""from being trashed")))}:no-ability{:effect(effect(trashcard))}}}cardnil)))}}}
{:abilities[{:msg"access all cards in Archives":effect(req(trashstatesidecard{:cause:ability-cost})(swap!stateupdate-in[:corp:discard]#(map(fn[c](assocc:seentrue))%))(when(:run@state)(swap!stateupdate-in[:run:cards-accessed](fnil#(+%(count(:discardcorp)))0)))(resolve-abilitystate:runner(choose-access(get-in@state[:corp:discard])'(:archives))cardnil))}]:install-cost-bonus(req(if(andrun(=(:serverrun)[:archives])(=0(:positionrun)))[:credit-7:click-1]nil)):effect(req(when(andrun(=(:serverrun)[:archives])(=0(:positionrun)))(when-completed(register-successful-runstateside(:serverrun))(do(swap!stateupdate-in[:runner:prompt]rest)(handle-end-runstateside)))))}
{:abilities[{:label"Prevent a \"when encountered\" ability on a piece of ICE":msg"prevent a \"when encountered\" ability on a piece of ICE":once:per-turn}{:label"[Trash]: Install the top 3 cards of your Stack facedown":msg"install the top 3 cards of their Stack facedown":effect(req(trashstatesidecard{:cause:ability-cost})(doseq[c(take3(get-in@state[:runner:deck]))](runner-installstatesidec{:facedowntrue})))}]}
{:implementation"Credit use restriction is not enforced":events{:rez{:req(req(ice?target)):msg"place 1 [Credits] on Ice Analyzer":effect(effect(add-counter:runnercard:credit1))}}:abilities[{:counter-cost[:credit1]:effect(effect(gain:credit1)):msg"take 1 [Credits] to install programs"}]}
{:req(reqhas-bad-pub):abilities[{:cost[:click4]:msg"give the Corp 1 bad publicity":effect(effect(gain:corp:bad-publicity1)(trashcard{:cause:ability-cost}))}]}
(let[ability{:label"Make a run (start of turn)":prompt"Choose a server to run with Jak Sinclair":once:per-turn:choices(reqrunnable-servers):msg(msg"make a run on "target" during which no programs can be used"):makes-runtrue:effect(effect(runtarget))}]{:implementation"Doesn't prevent program use":flags{:runner-phase-12(reqtrue)}:install-cost-bonus(req[:credit(*-1(:linkrunner))]):events{:runner-turn-begins{:optional{:req(req(not(get-in@state[:per-turn(:cidcard)]))):prompt"Use Jak Sinclair to make a run?":yes-abilityability}}}:abilities[ability]})
(let[ability{:msg"gain [Click]":once:per-turn:label"Gain [Click] (start of turn)":effect(effect(gain:click1)):end-turn{:delayed-completiontrue:effect(effect(tag-runnereid1)):msg"gain 1 tag"}}]{:events{:runner-turn-begins{:optional{:prompt"Use Joshua B. to gain [Click]?":once:per-turn:yes-abilityability}}}:abilities[ability]})
{:abilities[{:cost[:click5:forfeit]:msg"add it to their score area":effect(req(if(not(empty?(:scoredcorp)))(do(show-wait-promptstate:runner"Corp to decide whether or not to prevent Liberated Chela")(resolve-abilitystateside{:prompt(msg"Forfeit an agenda to prevent Liberated Chela from being added to Runner's score area?"):choices["Yes""No"]:player:corp:effect(final-effect(resolve-ability(if(=target"Yes"){:prompt"Choose an agenda to forfeit":player:corp:choices{:req#(in-corp-scored?stateside%)}:effect(effect(forfeittarget)(move:runnercard:rfg)(clear-wait-prompt:runner))}{:effect(effect(as-agenda:runnercard2)(clear-wait-prompt:runner)):msg"add it to their score area as an agenda worth 2 points"})cardnil))}cardnil))(resolve-abilitystateside{:effect(effect(as-agenda:runnercard2)):msg"add it to their score area as an agenda worth 2 points"}cardnil)))}]}
{:abilities[{:label"Install a non-virus program on London Library":cost[:click1]:prompt"Choose a non-virus program to install on London Library from your grip":choices{:req#(and(is-type?%"Program")(not(has-subtype?%"Virus"))(in-hand?%))}:msg(msg"host "(:titletarget)):effect(effect(runner-installtarget{:host-cardcard:no-costtrue}))}{:label"Add a program hosted on London Library to your Grip":cost[:click1]:choices{:req#(:host%)}:msg(msg"add "(:titletarget)" to their Grip"):effect(effect(movetarget:hand))}]:events{:runner-turn-ends{:effect(req(doseq[c(:hostedcard)](when(is-type?c"Program")(trashstatesidec))))}}}
(let[ability{:msg"look at the top card of their Stack":label"Look at the top card of Stack (start of turn)":once:per-turn:req(req(:runner-phase-12@state)):effect(effect(prompt!card(str"The top card of your Stack is "(:title(first(:deckrunner))))["OK"]{}))}]{:flags{:runner-turn-drawtrue:runner-phase-12(req(some#(card-flag?%:runner-turn-drawtrue)(all-installedstate:runner)))}:events{:runner-turn-beginsability}:abilities[ability]})
{:abilities[{:cost[:click1]:msg(msg"draw 2 cards"):effect(req(drawstateside2)(let[drawn(get-in@state[:runner:register:most-recent-drawn])](resolve-abilitystateside{:prompt(str"Choose 1 card to add to the bottom of the Stack"):msg(msg"add 1 card to the bottom of the Stack"):choices{:req#(and(in-hand?%)(some(fn[c](=(:cidc)(:cid%)))drawn))}:effect(req(movestatesidetarget:deck))}cardnil)))}]}
{:effect(req(resolve-abilitystate:corp{:prompt"Choose a card to derez":choices{:req#(and(=(:side%)"Corp")(:rezzed%))}:effect(req(derezstatesidetarget))}cardnil)):leave-play(req(resolve-abilitystate:corp{:prompt"Choose a card to rez, ignoring the rez cost":choices{:req#(not(:rezzed%))}:effect(req(rezstatesidetarget{:ignore-cost:rez-cost})(system-msgstateside(str"rezzes "(:titletarget)" at no cost")))}cardnil)):abilities[{:msg"draw 1 card":effect(effect(trashcard{:cause:ability-cost})(draw))}]}
{:abilities[{:counter-cost[:credit1]:msg"gain 1 [Credits]":effect(effect(gain:credit1)(trigger-event:spent-stealth-creditcard))}]:events{:spent-stealth-credit{:req(req(and(:run@state)(has-subtype?target"Stealth"))):once:per-run:delayed-completiontrue:effect(effect(show-wait-prompt:corp"Runner to use Net Mercur")(continue-ability{:prompt"Place 1 [Credits] on Net Mercur or draw 1 card?":player:runner:choices["Place 1 [Credits]""Draw 1 card"]:effect(req(if(=target"Draw 1 card")(do(drawstateside)(clear-wait-promptstate:corp)(system-msgstate:runner(str"uses Net Mercur to draw 1 card")))(do(add-counterstate:runnercard:credit1)(clear-wait-promptstate:corp)(system-msgstate:runner(str"places 1 [Credits] on Net Mercur")))))}cardnil))}}}
{:abilities[{:label"Install and host a connection on Off-Campus Apartment":effect(effect(resolve-ability{:cost[:click1]:prompt"Choose a connection in your Grip to install on Off-Campus Apartment":choices{:req#(and(has-subtype?%"Connection")(runner-can-install?stateside%false)(in-hand?%))}:msg(msg"host "(:titletarget)" and draw 1 card"):effect(effect(runner-installtarget{:host-cardcard})(draw))}cardnil))}{:label"Host an installed connection":prompt"Choose a connection to host on Off-Campus Apartment":choices{:req#(and(has-subtype?%"Connection")(installed?%))}:msg(msg"host "(:titletarget)" and draw 1 card"):effect(effect(hostcardtarget)(draw))}]}
{:abilities[{:cost[:click1]:once:per-turn:prompt"Choose card type":choices["Event""Hardware""Program""Resource"]:effect(req(let[c(first(get-in@state[:runner:deck]))](system-msgstateside(str"uses Oracle May, names "target" and reveals "(:titlec)))(if(is-type?ctarget)(do(system-msgstateside(str"gains 2 [Credits] and draws "(:titlec)))(gainstateside:credit2)(drawstateside))(do(system-msgstateside(str"trashes "(:titlec)))(millstateside)))))}]}
(let[pphelper(fn[titlecards](let[num(countcards)]{:optional{:prompt(str"Use Paige Piper to trash copies of "title"?"):yes-ability{:prompt"How many would you like to trash?":choices(take(incnum)["0""1""2""3""4""5"]):msg"shuffle their Stack":effect(req(let[target(Integer/parseInttarget)](trigger-eventstateside:searched-stacknil)(shuffle!state:runner:deck)(doseq[c(taketargetcards)](trashstatesidec{:unpreventabletrue}))(when(>(inttarget)0)(system-msgstateside(str"trashes "target" cop"(if(not=target1)"ies""y")" of "title)))))}}}))]{:events{:runner-install{:req(req(first-event?stateside:runner-install)):delayed-completiontrue:effect(effect(continue-ability(pphelper(:titletarget)(->>(:deckrunner)(filter#(has?%:title(:titletarget)))(vec)))cardnil))}}})
(let[ability{:prompt"Choose a server for Patron":choices(req(conjservers"No server")):req(req(and(not(click-spent?:runnerstate))(not(used-this-turn?(:cidcard)state)))):msg(msg"target "target):effect(req(when(not=target"No server")(update!stateside(assoccard:server-targettarget))))}]{:events{:runner-turn-beginsability:successful-run{:req(req(=(zone->name(get-in@state[:run:server]))(:server-target(get-cardstatecard)))):once:per-turn:effect(req(let[stcard](swap!stateassoc-in[:run:run-effect:replace-access]{:mandatorytrue:effect(effect(resolve-ability{:msg"draw 2 cards instead of accessing":effect(effect(draw2)(update!(dissocst:server-target)))}stnil))})))}:runner-turn-ends{:effect(effect(update!(dissoccard:server-target)))}}:abilities[ability]})
{:effect(req(swap!stateupdate-in[:runner:tagged]inc)):events{:pre-damage{:req(req(=target:meat)):msg"prevent all meat damage":effect(effect(damage-prevent:meatInteger/MAX_VALUE))}}:leave-play(req(swap!stateupdate-in[:runner:tagged]dec))}
(let[remove-counter{:req(req(not(empty?(:hostedcard)))):once:per-turn:msg(msg"remove 1 counter from "(:titletarget)):choices{:req#(:host%)}:effect(req(if(<=(get-intarget[:counter:power])1)(runner-installstateside(dissoctarget:counter){:no-costtrue})(add-counterstatesidetarget:power-1)))}]{:flags{:drip-economytrue}:abilities[{:label"Host a program or piece of hardware":cost[:click1]:prompt"Choose a card to host on Personal Workshop":choices{:req#(and(#{"Program""Hardware"}(:type%))(in-hand?%)(=(:side%)"Runner"))}:effect(req(if(zero?(:costtarget))(runner-installstatesidetarget)(hoststatesidecard(assoctarget:counter{:power(:costtarget)})))):msg(msg"host "(:titletarget)"")}(assocremove-counter:label"Remove 1 counter from a hosted card (start of turn)":cost[:credit1]){:label"X[Credit]: Remove counters from a hosted card":choices{:req#(:host%)}:req(req(not(empty?(:hostedcard)))):effect(req(let[paydowntargettargetnum-counters(get-inpaydowntarget[:counter:power]0)](resolve-abilitystateside{:prompt"How many counters to remove?":choices{:number(req(min(:creditrunner)num-counters))}:msg(msg"remove "target" counters from "(:titlepaydowntarget)):effect(req(do(losestateside:credittarget)(if(=num-counterstarget)(runner-installstateside(dissocpaydowntarget:counter){:no-costtrue})(add-counterstatesidepaydowntarget:power(-target)))))}cardnil)))}]:events{:runner-turn-beginsremove-counter}})
{:req(req(some#{:hq}(:successful-runrunner-reg))):abilities[{:prompt"Choose a rezzed card with a trash cost":choices{:req#(and(:trash%)(rezzed?%))}:effect(req(let[ctarget](trigger-eventstateside:pre-trashc)(let[cost(trash-coststate:runnerc)](when(can-pay?statesidenil[:creditcost])(resolve-abilitystateside{:msg(msg"pay "cost" [Credit] and trash "(:titlec)):effect(effect(lose:creditcost)(trashcard{:cause:ability-cost})(trashc))}cardnil)))(swap!stateupdate-in[:bonus]dissoc:trash)))}]}
{:in-play[:click1:click-per-turn1]:effect(req(add-watchstate:rachel-beckman(fn[krefoldnew](when(is-tagged?new)(remove-watchref:rachel-beckman)(trashref:runnercard)(system-msgrefside"trashes Rachel Beckman for being tagged")))))}
{:effect(req(add-watchstate:raymond-flint(fn[krefoldnew](when(<(get-inold[:corp:bad-publicity])(get-innew[:corp:bad-publicity]))(when-completed; manually trigger the pre-access event to alert Nerve Agent.
(trigger-event-syncrefside:pre-access:hq)(let[from-hq(access-countstateside:hq-access)](resolve-abilityrefside(access-helper-hqstatefrom-hq; see note in Gang Sign
(set(get-in@state[:corp:servers:hq:content])))cardnil))))))):leave-play(req(remove-watchstate:raymond-flint)):abilities[{:msg"expose 1 card":choices{:reqinstalled?}:delayed-completiontrue:effect(effect(exposeeidtarget)(trashcard{:cause:ability-cost}))}]}
{:delayed-completiontrue:msg"look at the top 5 cards of their Stack":effect(req(show-wait-promptstate:corp"Runner to rearrange the top cards of their Stack")(let[from(take5(:deckrunner))](if(pos?(countfrom))(continue-abilitystateside(reorder-choice:runner:corpfrom'()(countfrom)from)cardnil)(do(clear-wait-promptstate:corp)(effect-completedstatesideeidcard))))):trash-effect{:effect(effect(system-msg:runner(str"trashes "(join", "(map:title(take3(:deckrunner))))" from their Stack due to Rolodex being trashed"))(mill:runner3))}}
{:in-play[:hand-size-modification-2]:events{:runner-turn-ends{:req(req(<(count(:handrunner))(hand-sizestate:runner))):msg(msg"draw a card"):effect(effect(draw1))}}}
{:flags{:slow-trash(reqtrue)}:events{:runner-install{:req(req(=cardtarget)):silent(reqtrue):effect(effect(update!(assoccard:slums-activetrue)))}:runner-turn-begins{:effect(effect(update!(assoccard:slums-activetrue)))}:pre-trash{:req(req(and(:slums-activecard)(:trashtarget)(=(:sidetarget)"Corp"))):effect(req(toaststate:runner(str"Click Salsette Slums to remove "(:titletarget)" from the game")"info"{:prevent-duplicatestrue}))}}:abilities[{:label"Remove the currently accessed card from the game instead of trashing it":req(req(let[c(:card(first(get-in@state[:runner:prompt])))](if-let[trash-cost(trash-coststatesidec)](if(can-pay?state:runnernil:credittrash-cost)(if(:slums-activecard)true((toaststate:runner"Can only use a copy of Salsette Slums once per turn.")false))((toaststate:runner(str"Unable to pay for "(:titlec)"."))false))((toaststate:runner"Not currently accessing a card with a trash cost.")false)))):msg(msg(let[c(:card(first(get-in@state[:runner:prompt])))](str"pay "(trash-coststatesidec)" [Credits] and remove "(:titlec)" from the game"))):effect(req(let[c(:card(first(get-in@state[:runner:prompt])))](deactivatestatesidec)(movestate:corpc:rfg)(paystate:runnercard:credit(trash-coststatesidec))(swap!stateupdate-in[:turn-events]#(cons[:runner-trashc]%))(update!stateside(dissoccard:slums-active))(close-access-promptstateside)(when-not(:run@state)(swap!statedissoc:access))))}{:label"Remove a card trashed this turn from the game":req(req(if(:slums-activecard)true((toaststate:runner"Can only use a copy of Salsette Slums once per turn.")false))):effect(effect(resolve-ability{; only allow targeting cards that were trashed this turn -- not perfect, but good enough?
:choices{:req#(some(fn[c](=(:cid%)(:cidc)))(mapfirst(turn-eventsstateside:runner-trash)))}:msg(msg"remove "(:titletarget)" from the game"):effect(req(deactivatestatesidetarget)(movestate:corptarget:rfg)(swap!stateupdate-in[:turn-events]#(cons[:runner-trashtarget]%))(update!stateside(dissoccard:slums-active)))}cardnil))}]}
{:abilities[{:cost[:click2]:req(req(and(not(seq(get-in@state[:runner:locked:discard])))(<0(count(filter#(is-type?%"Event")(:discardrunner)))))):prompt"Choose an event to play":msg(msg"play "(:titletarget)):show-discardtrue:choices{:req#(and(is-type?%"Event")(=(:zone%)[:discard]))}:effect(effect(trashcard{:cause:ability-cost})(play-instanttarget))}]}
(let[ability{:prompt"Choose a server for Security Testing":choices(reqservers):msg(msg"target "target):req(req(and(not(click-spent?:runnerstate))(not(used-this-turn?(:cidcard)state)))):effect(effect(update!(assoccard:server-targettarget)))}]{:events{:runner-turn-beginsability:successful-run{:req(req(=(zone->name(get-in@state[:run:server]))(:server-target(get-cardstatecard)))):once:per-turn:effect(req(let[stcard](swap!stateassoc-in[:run:run-effect:replace-access]{:mandatorytrue:effect(effect(resolve-ability{:msg"gain 2 [Credits] instead of accessing":effect(effect(gain:credit2)(update!(dissocst:server-target)))}stnil))})))}:runner-turn-ends{:effect(effect(update!(dissoccard:server-target)))}}:abilities[ability]})
{:msg"ignore additional costs on Double events":effect(req(swap!stateassoc-in[:runner:register:double-ignore-additional]true)):events{:runner-turn-begins{:msg"lose [Click] and ignore additional costs on Double events":effect(req(losestate:runner:click1)(swap!stateassoc-in[:runner:register:double-ignore-additional]true))}}:leave-play(req(swap!stateupdate-in[:runner:register]dissoc:double-ignore-additional))}
{:events{:runner-turn-begins{:effect(req(if(>=(get-incard[:counter:power]0)2)(do(add-counterstatesidecard:power(-(get-incard[:counter:power]0)))(damagestatesideeid:brain1{:unpreventabletrue:cardcard})(system-msgstateside"takes 1 brain damage from Stim Dealer"))(do(add-counterstatesidecard:power1)(gainstateside:click1)(system-msgstateside"uses Stim Dealer to gain [Click]"))))}}}
{:effect(req(doseq[c(take3(:deckrunner))](hoststateside(get-cardstatecard)c{:facedowntrue}))):abilities[{:prompt"Choose a card on Street Peddler to install":choices(req(cancellable(filter#(and(not(is-type?%"Event"))(can-pay?statesidenil(modified-install-coststateside%[:credit-1])))(:hostedcard)))):msg(msg"install "(:titletarget)" lowering its install cost by 1 [Credits]"):effect(req(when(can-pay?statesidenil(modified-install-coststatesidetarget[:credit-1]))(install-cost-bonusstateside[:credit-1])(trashstateside(update-incard[:hosted](fn[coll](remove-once#(not=(:cid%)(:cidtarget))coll))){:cause:ability-cost})(runner-installstateside(dissoctarget:facedown))))}]}
{:abilities[{:label"Draw 1 card for each Corp bad publicity":effect(effect(trashcard{:cause:ability-cost})(draw(+(:bad-publicitycorp)(:has-bad-pubcorp)))):msg(msg"draw "(:bad-publicitycorp)" cards")}]:events{:play-operation{:req(req(or(has-subtype?target"Black Ops")(has-subtype?target"Gray Ops"))):effect(req(show-wait-promptstate:corp"Runner to use Tallie Perrault")(resolve-abilitystate:runner{:optional{:prompt"Use Tallie Perrault to give the Corp 1 bad publicity and take 1 tag?":player:runner:yes-ability{:msg"give the Corp 1 bad publicity and take 1 tag":delayed-completiontrue:effect(effect(gain:corp:bad-publicity1)(tag-runner:runnereid1)(clear-wait-prompt:corp))}:no-ability{:effect(effect(clear-wait-prompt:corp))}}}cardnil))}}}
{:abilities[{:cost[:click1]:label"Place 1 power counter":msg"place 1 power counter on it":effect(effect(add-countercard:power1))}{:label"Gain [Click]":counter-cost[:power1]:req(req(=(:active-player@state):runner)):msg"gain [Click]":once:per-turn:effect(effect(gain:click1))}]}
{:data{:counter{:credit20}}:prompt"Choose a server for Temüjin Contract":choices(reqservers):msg(msg"target "target):req(req(not(:server-targetcard))):effect(effect(update!(assoccard:server-targettarget))):events{:successful-run{:req(req(=(zone->name(get-in@state[:run:server]))(:server-target(get-cardstatecard)))):msg"gain 4 [Credits]":effect(req(let[creds(get-incard[:counter:credit])](gainstateside:credit4)(set-propstatesidecard:counter{:credit(-creds4)})(when(=0(get-in(get-cardstatecard)[:counter:credit]))(trashstatesidecard{:unpreventabletrue}))))}}}
{:msg"prevent the Corp from winning the game unless they are flatlined":effect(req(swap!stateassoc-in[:corp:cannot-win-on-points]true)):events{:runner-turn-begins{:effect(req(if(>=(get-incard[:counter:power]0)2)(do(movestateside(dissoccard:counter):rfg)(swap!stateupdate-in[:corp]dissoc:cannot-win-on-points)(system-msgstateside"removes The Black File from the game")(gain-agenda-pointstate:corp0))(add-counterstatesidecard:power1)))}}:trash-effect{:effect(req(swap!stateupdate-in[:corp]dissoc:cannot-win-on-points)(gain-agenda-pointstate:corp0))}}
{:in-play[:link1]:abilities[{:msg(msg"give +2 strength to "(:titletarget)):choices{:req#(and(has-subtype?%"Icebreaker")(installed?%))}:effect(effect(update!(assoccard:hai-targettarget))(trash(get-cardstatecard){:cause:ability-cost})(update-breaker-strengthtarget))}]:events{:runner-turn-endsnil:corp-turn-endsnil:pre-breaker-strengthnil}:trash-effect{:effect(effect(register-events(let[hai{:effect(effect(unregister-eventscard)(update!(dissoccard:hai-target))(update-breaker-strength(:hai-targetcard)))}]{:runner-turn-endshai:corp-turn-endshai:pre-breaker-strength{:req(req(=(:cidtarget)(:cid(:hai-targetcard)))):effect(effect(breaker-strength-bonus2))}})card))}}
(let[ability{:label"Install a hosted card (start of turn)":prompt"Choose a card hosted on The Supplier to install":once:per-turn:req(req(some#(can-pay?statesidenil(modified-install-coststateside%[:credit-2]))(:hostedcard))):choices{:req#(="The Supplier"(:title(:host%)))}:msg(msg"install "(:titletarget)" lowering its install cost by 2"):effect(req(when(can-pay?statesidenil(modified-install-coststatesidetarget[:credit-2]))(install-cost-bonusstateside[:credit-2])(runner-installstatesidetarget)(update!stateside(->card(assoc:supplier-installed(:cidtarget))(update-in[:hosted](fn[coll](remove-once#(not=(:cid%)(:cidtarget))coll)))))))}]{:flags{:drip-economytrue}; not technically drip economy, but has an interaction with Drug Dealer
:abilities[{:label"Host a resource or piece of hardware":cost[:click1]:prompt"Choose a card to host on The Supplier":choices{:req#(and(#{"Resource""Hardware"}(:type%))(in-hand?%))}:effect(effect(hostcardtarget)):msg(msg"host "(:titletarget)"")}ability]; A card installed by The Supplier is ineligible to receive the turn-begins event for this turn.
:suppress{:runner-turn-begins{:req(req(=(:cidtarget)(:supplier-installed(get-cardstatecard))))}}:events{:runner-turn-beginsability:runner-turn-ends{:req(req(:supplier-installedcard)):effect(effect(update!(dissoccard:supplier-installed)))}}})
{:events{:run{:effect(effect(update!(dissoccard:agenda-stolen:counters-spent)))}:agenda-stolen{:effect(effect(update!(assoccard:agenda-stolentrue))):silent(reqtrue)}:pre-access{:req(req(and(:counters-spentcard)(#{:hq:rd}target))):effect(effect(access-bonus(:counters-spentcard0))):silent(reqtrue)}:run-ends{:req(req(and(not(:agenda-stolencard))(#{:hq:rd}target))):effect(effect(add-countercard:power1)(system-msg:runner(str"places a power counter on "(:titlecard)))):silent(reqtrue)}}:abilities[{:counter-cost[:power2]:req(req(:run@state)):msg"access 1 additional card from HQ or R&D for the remainder of the run":effect(effect(update!(update-incard[:counters-spent]#(inc(or%0)))))}]}
{:abilities[{:prompt"Choose a piece of Hardware":msg(msg"add "(:titletarget)" to their Grip"):choices(req(cancellable(filter#(is-type?%"Hardware")(:deckrunner)):sorted)):cost[:click2]:effect(effect(trigger-event:searched-stacknil)(shuffle!:deck)(movetarget:hand))}]}
{:abilities[{:effect(effect(trash-cards:corp(take2(shuffle(:handcorp))))(trashcard{:cause:ability-cost})):msg"force the Corp to discard 2 cards from HQ at random"}]:install-cost-bonus(req(if(andrun(=(:serverrun)[:hq])(zero?(:positionrun)))[:credit-7:click-1]nil)):effect(req(when(andrun(=(:serverrun)[:hq])(zero?(:positionrun)))(when-completed(register-successful-runstateside(:serverrun))(do(swap!stateupdate-in[:runner:prompt]rest)(handle-end-runstateside)))))}
(let[ability{:msg(msg"reveal "(:title(first(:deckcorp)))" on the top of R&D"):label"Reveal the top card of R&D (start of turn)":once:per-turn:req(req(:runner-phase-12@state)):effect(effect(show-wait-prompt:runner"Corp to decide whether or not to draw with Woman in the Red Dress")(resolve-ability{:optional{:player:corp:prompt(msg"Draw "(:title(first(:deckcorp)))"?"):yes-ability{:effect(effect(clear-wait-prompt:runner)(system-msg(str"draws "(:title(first(:deckcorp)))))(draw))}:no-ability{:effect(effect(clear-wait-prompt:runner)(system-msg"doesn't draw with Woman in the Red Dress"))}}}cardnil))}]{:events{:runner-turn-beginsability}:abilities[ability]})
{:flags{:runner-turn-drawtrue:runner-phase-12(req(<1(count(filter#(card-flag?%:runner-turn-drawtrue)(cons(get-in@state[:runner:identity])(all-installedstate:runner))))))}:events{:runner-turn-begins{:effect(req(losestateside:click1)(when-not(get-in@state[:per-turn(:cidcard)])(system-msgstateside"uses Wyldside to draw 2 cards and lose [Click]")(drawstateside2)))}}:abilities[{:msg"draw 2 cards and lose [Click]":once:per-turn:effect(effect(draw2))}]}
{:events{:runner-turn-begins{:effect(effect(add-countercard:credit1))}}:abilities[{:cost[:click1]:msg(msg"gain "(get-incard[:counter:credit]0)" [Credits]"):label"Take all credits":effect(effect(gain:credit(get-incard[:counter:credit]0))(add-countercard:credit(-(get-incard[:counter:credit]0))))}]:effect(req(add-watchstate(keyword(str"zona-sul-shipping"(:cidcard)))(fn[krefoldnew](when(is-tagged?new)(remove-watchref(keyword(str"zona-sul-shipping"(:cidcard))))(trashref:runnercard)(system-msgrefside"trashes Zona Sul Shipping for being tagged")))))}