{:events{:successful-run{:delayed-completiontrue:req(req(and(=target:archives)(not-empty(:discardcorp)))):effect(effect(continue-ability{:optional{:delayed-completiontrue:prompt"Use Archives Interface to remove a card from the game instead of accessing it?":yes-ability{:delayed-completiontrue:effect(req(swap!stateupdate-in[:corp:discard]#(map(fn[c](assocc:seentrue))%))(continue-abilitystateside{:prompt"Choose a card in Archives to remove from the game instead of accessing":choices(req(:discardcorp)):msg(msg"remove "(:titletarget)" from the game"):effect(effect(move:corptarget:rfg))}cardnil))}:no-ability{:effect(req(effect-completedstatesideeid))}}}cardnil))}}}
{:events{:runner-install{:silent(reqtrue):req(req(and(is-type?target"Program")(=(:active-player@state):runner);; only trigger when played a programm from grip
(some#{:hand}(:previous-zonetarget));; check if didn't played a program from the grip this turn
(empty?(let[cards(mapfirst(turn-eventsstateside:runner-install))progs(filter#(is-type?%"Program")cards)](filter#(some#{:hand}(:previous-zone%))progs))))):msg"gain [Click]":effect(effect(gain:click1))}:unsuccessful-run{:effect(effect(trashcard)(system-msg"trashes Autoscripter"))}}}
{:in-play[:memory2]:events{:expose{:msg(msg"attempt to force the rez of "(:titletarget)):delayed-completiontrue:effect(req(let[ctargetcdef(card-defc)cname(:titlec)](if(:additional-costcdef)(do(show-wait-promptstate:runner(str"Corp to decide if they will rez "cname))(continue-abilitystateside{:optional{:prompt(msg"Pay additional cost to rez "cname"?"):player:corp:yes-ability{:effect(effect(rez:corpc)(clear-wait-prompt:runner))}:no-ability{:effect(effect(system-msg:corp(str"declines to pay additional costs"" and is not forced to rez "cname))(clear-wait-prompt:runner))}}}cardnil))(do(rezstate:corptarget)(effect-completedstatesideeid)))))}}}
{:abilities[{:label"Host up to 3 cards from your Grip facedown":cost[:click1]:msg"host up to 3 cards from their Grip facedown":choices{:max3:req#(and(=(:side%)"Runner")(in-hand?%))}:effect(req(doseq[ctargets](hoststateside(get-cardstatecard)c{:facedowntrue})))}{:label"Add all hosted cards to Grip":cost[:click1]:msg"add all hosted cards to their Grip":effect(req(doseq[c(:hostedcard)](movestatesidec:hand)))}{:label"[Trash]: Add all hosted cards to Grip":msg"add all hosted cards to their Grip":effect(req(doseq[c(:hostedcard)](movestatesidec:hand))(update!stateside(dissoccard:hosted))(trashstateside(get-cardstatecard){:cause:ability-cost}))}]}
{:abilities[{:req(req(>(count(:handrunner))0)):cost[:click1]:effect(req(let[handsize(count(:handrunner))](resolve-abilitystateside{:prompt"Choose any number of cards to trash from your Grip":choices{:maxhandsize:req#(and(=(:side%)"Runner")(in-hand?%))}:effect(req(let[trashed(counttargets)remaining(-handsizetrashed)](doseq[ctargets](when(not(empty?(filter#(=(:titlec)(:title%))(all-installedstate:runner))))(drawstateside)))(trash-cardsstatesidetargets)(system-msgstateside(str"spends [Click] to use Capstone to trash "(join", "(map:titletargets))" and draw "(-(count(get-in@state[:runner:hand]))remaining)" cards"))))}cardnil)))}]}
{:abilities[{:prompt"Choose a program to install from your Heap":msg(msg"install "(:titletarget)):prioritytrue:show-discardtrue:req(req(not(seq(get-in@state[:runner:locked:discard])))):choices{:req#(and(is-type?%"Program")(=(:zone%)[:discard]))}:effect(effect(trashcard{:cause:ability-cost})(runner-installtarget))}]}
{:in-play[:memory1]:events{:play-event{:req(req(first-event?stateside:play-event)):effect(req(system-msgstate:runner(str"can play another event without spending a [Click] by clicking on Comet"))(update!stateside(assoccard:comet-eventtrue)))}}:abilities[{:req(req(:comet-eventcard)):prompt"Choose an Event in your Grip to play":choices{:req#(and(is-type?%"Event")(in-hand?%))}:msg(msg"play "(:titletarget)):effect(effect(play-instanttarget)(update!(dissoc(get-cardstatecard):comet-event)))}]}
{:abilities[{:prompt"Choose a piece of ICE":choices{:reqice?}:effect(req(let[icetarget](update!stateside(assoccard:cortez-targetice))(trashstateside(get-cardstatecard){:cause:ability-cost})(system-msgstateside(str"trashes Cortez Chip to increase the rez cost of "(card-strstateice)" by 2 [Credits] until the end of the turn"))))}]:trash-effect{:effect(effect(register-events{:pre-rez{:req(req(=(:cidtarget)(:cid(:cortez-targetcard)))):effect(effect(rez-cost-bonus2))}:runner-turn-ends{:effect(effect(unregister-eventscard))}:corp-turn-ends{:effect(effect(unregister-eventscard))}}(get-cardstatecard)))}:events{:pre-reznil:runner-turn-endsnil:corp-turn-endsnil}}
{:implementation"MU use restriction not enforced":in-play[:memory3]:events{:runner-install{:optional{:delayed-completiontrue:req(req(has-subtype?target"Caïssa")):prompt"Use Deep Red?":priority1:yes-ability{:delayed-completiontrue:effect(req(let[cid(:cidtarget)](continue-abilitystateside{:delayed-completiontrue:prompt"Choose the just-installed Caïssa to have Deep Red trigger its [Click] ability":choices{:req#(=cid(:cid%))}:msg(msg"trigger the [Click] ability of "(:titletarget)" without spending [Click]"):effect(req(gainstate:runner:click1)(play-abilitystateside{:cardtarget:ability0})(effect-completedstatesideeid))}cardnil)))}:no-ability{:effect(req(effect-completedstatesideeid))}}}}}
{:abilities[{:label"Install a non-AI icebreaker on Dinosaurus":req(req(empty?(:hostedcard))):cost[:click1]:prompt"Choose a non-AI icebreaker in your Grip to install on Dinosaurus":choices{:req#(and(has-subtype?%"Icebreaker")(not(has-subtype?%"AI"))(in-hand?%))}:effect(effect(gain:memory(:memoryunitstarget))(runner-installtarget{:host-cardcard})(update!(assoc(get-cardstatecard):dino-breaker(:cidtarget))))}{:label"Host an installed non-AI icebreaker on Dinosaurus":req(req(empty?(:hostedcard))):prompt"Choose an installed non-AI icebreaker to host on Dinosaurus":choices{:req#(and(has-subtype?%"Icebreaker")(not(has-subtype?%"AI"))(installed?%))}:msg(msg"host "(:titletarget)):effect(req(update-breaker-strengthstateside(hoststatesidecardtarget))(update!stateside(assoc(get-cardstatecard):dino-breaker(:cidtarget)))(gainstateside:memory(:memoryunitstarget)))}]:events{:pre-breaker-strength{:req(req(=(:cidtarget)(:cid(first(:hostedcard))))):effect(effect(breaker-strength-bonus2))}:card-moved{:req(req(=(:cidtarget)(:dino-breaker(get-cardstatecard)))):effect(effect(update!(dissoccard:dino-breaker))(lose:memory(:memoryunitstarget)))}}}
{:in-play[:memory1]:events{:runner-install{:req(req(=cardtarget)):silent(reqtrue):effect(effect(update!(assoccard:dopp-activetrue)))}:runner-turn-begins{:effect(effect(update!(assoccard:dopp-activetrue)))}:successful-run-ends{:optional{:req(req(:dopp-activecard)):player:runner:prompt"Use Doppelgänger to run again?":yes-ability{:prompt"Choose a server":choices(reqrunnable-servers):msg(msg"make a run on "target):makes-runtrue:effect(effect(update!(dissoccard:dopp-active))(runtarget))}}}}}
{:data{:counter{:power4}}:abilities[{:counter-cost[:power1]:cost[:click1]:req(req(notrun)):prompt"Choose a server":choices(reqrunnable-servers):msg"make a run and avoid all tags for the remainder of the run":makes-runtrue:effect(effect(update!(assoccard:dorm-activetrue))(runtarget))}]:events{:pre-tag{:req(req(:dorm-activecard)):effect(effect(tag-preventInteger/MAX_VALUE)):msg"avoid all tags during the run"}:run-ends{:effect(effect(update!(dissoccard:dorm-active)))}}}
{:abilities[{:req(req(:run@state)):msg"prevent the Corp from rezzing more than 1 piece of ICE for the remainder of the run":effect(effect(register-events{:rez{:req(req(ice?target)):effect(effect(register-run-flag!card:can-rez(fn[statesidecard](if(ice?card)((constantlyfalse)(toaststate:corp"Cannot rez ICE the rest of this run due to EMP Device"))true))))}:run-ends{:effect(effect(unregister-eventscard))}}(assoccard:zone'(:discard)))(trashcard{:cause:ability-cost}))}]}
{:prevent{:damage[:net:brain]}:abilities[{:cost[:credit3]:msg"prevent 1 net damage":effect(effect(damage-prevent:net1))}{:label"[Trash]: Prevent up to 2 brain damage":msg"prevent up to 2 brain damage":effect(effect(trashcard{:cause:ability-cost})(damage-prevent:brain2))}]}
{:abilities[{:req(req(and(ice?current-ice)(not(rezzed?current-ice)))):delayed-completiontrue:effect(req(when-completed(exposestatesidecurrent-ice)(continue-abilitystateside{:optional{:prompt"Trash GPI Net Tap to jack out?":yes-ability{:msg"trash it and jack out":effect(effect(trashcard{:unpreventabletrue})(jack-outnil))}}}cardnil)))}]}
{:in-play[:memory1:hand-size-modification1]:events{:agenda-scored{:player:runner:prompt"Choose a card":msg(msg"add 1 card to their Grip from their Stack"):choices(req(cancellable(:deckrunner))):effect(effect(trigger-event:searched-stacknil)(shuffle!:deck)(movetarget:hand))}}}
{:in-play[:memory2]:abilities[{:once:per-turn:delayed-completiontrue:label"Move this accessed card to bottom of R&D":req(req(when-let[c(:card(first(get-in@state[:runner:prompt])))](in-deck?c))):msg"move the card just accessed to the bottom of R&D":effect(req(let[c(:card(first(get-in@state[:runner:prompt])))](when(is-type?c"Agenda"); trashing before the :access events actually fire; fire them manually
(resolve-steal-eventsstatesidec))(movestate:corpc:deck)(close-access-promptstateside)(tag-runnerstate:runnereid1)))}{:once:per-turn:label"Move a previously accessed card to bottom of R&D":effect(effect(resolve-ability{; only allow targeting cards that were accessed this turn -- not perfect, but good enough?
:delayed-completiontrue:choices{:req#(some(fn[c](=(:cid%)(:cidc)))(mapfirst(turn-eventsstateside:access)))}:msg(msg"move "(:titletarget)" to the bottom of R&D"):effect(req(movestate:corptarget:deck)(tag-runnerstate:runnereid1)(swap!stateupdate-in[side:prompt]rest)(when-let[run(:run@state)](when(and(:endedrun)(empty?(get-in@state[:runner:prompt])))(handle-end-runstate:runner))))}cardnil))}]}
{:in-play[:memory2]:events{:successful-run{:delayed-completiontrue:req(req(=target:rd)):effect(effect(continue-ability{:prompt"Choose a card and replace 1 spent [Recurring Credits] on it":choices{:req#(<(:rec-counter%0)(:recurring(card-def%)0))}:msg(msg"replace 1 spent [Recurring Credits] on "(:titletarget)):effect(effect(add-proptarget:rec-counter1))}cardnil))}}}
(let[mhelper(fnmh[n]{:prompt"Choose a program to install":choices{:req#(and(is-type?%"Program")(in-hand?%))}:effect(req(install-cost-bonusstateside[:credit-4])(runner-installstatesidetargetnil)(when(<n3)(resolve-abilitystateside(mh(incn))cardnil)))})]{:prevent{:damage[:net:brain]}:in-play[:memory3]:effect(effect(resolve-ability(mhelper1)cardnil)):abilities[{:msg(msg"prevent 1 brain or net damage by trashing "(:titletarget)):priority50:choices{:req#(and(is-type?%"Program")(in-hand?%))}:prompt"Choose a program to trash from your Grip":effect(effect(trashtarget)(damage-prevent:brain1)(damage-prevent:net1))}]})
{:events{:pre-damage{:once:per-turn:once-key:muresh-bodysuit:req(req(=target:meat)):msg"prevent the first meat damage this turn":effect(effect(damage-prevent:meat1))}}}
{:abilities[{:label"Install a program on NetChip":req(req(empty?(:hostedcard))):effect(req(let[n(count(filter#(=(:title%)(:titlecard))(all-installedstate:runner)))](resolve-abilitystateside{:prompt"Choose a program in your Grip to install on NetChip":cost[:click1]:choices{:req#(and(is-type?%"Program")(runner-can-install?stateside%false)(<=(:memoryunits%)n)(in-hand?%))}:msg(msg"host "(:titletarget)):effect(effect(gain:memory(:memoryunitstarget))(runner-installtarget{:host-cardcard})(update!(assoc(get-cardstatecard):hosted-programs(cons(:cidtarget)(:hosted-programscard)))))}cardnil)))}{:label"Host an installed program on NetChip":req(req(empty?(:hostedcard))):effect(req(let[n(count(filter#(=(:title%)(:titlecard))(all-installedstate:runner)))](resolve-abilitystateside{:prompt"Choose an installed program to host on NetChip":choices{:req#(and(is-type?%"Program")(<=(:memoryunits%)n)(installed?%))}:msg(msg"host "(:titletarget)):effect(effect(hostcardtarget)(gain:memory(:memoryunitstarget))(update!(assoc(get-cardstatecard):hosted-programs(cons(:cidtarget)(:hosted-programscard)))))}cardnil)))}]:events{:card-moved{:req(req(some#{(:cidtarget)}(:hosted-programscard))):effect(effect(update!(assoccard:hosted-programs(remove#(=(:cidtarget)%)(:hosted-programscard))))(lose:memory(:memoryunitstarget)))}}}
{:recurring1:abilities[{:label"Install and host a program of 1[Memory Unit] or less on Omni-drive":req(req(empty?(:hostedcard))):cost[:click1]:prompt"Choose a program of 1[Memory Unit] or less to install on Omni-drive from your grip":choices{:req#(and(is-type?%"Program")(<=(:memoryunits%)1)(in-hand?%))}:msg(msg"host "(:titletarget)):effect(effect(gain:memory(:memoryunitstarget))(runner-installtarget{:host-cardcard})(update!(assoc(get-cardstatecard):Omnidrive-prog(:cidtarget))))}{:label"Host an installed program of 1[Memory Unit] or less on Omni-drive":prompt"Choose an installed program of 1[Memory Unit] or less to host on Omni-drive":choices{:req#(and(is-type?%"Program")(<=(:memoryunits%)1)(installed?%))}:msg(msg"host "(:titletarget)):effect(effect(hostcardtarget)(gain:memory(:memoryunitstarget))(update!(assoc(get-cardstatecard):Omnidrive-prog(:cidtarget))))}]:events{:card-moved{:req(req(=(:cidtarget)(:Omnidrive-prog(get-cardstatecard)))):effect(effect(update!(dissoccard:Omnidrive-prog))(lose:memory(:memoryunitstarget)))}}}
{:flags{:runner-phase-12(reqtrue)}:abilities[{:label"Lose [Click], avoid 1 tag (start of turn)":once:per-turn:req(req(:runner-phase-12@state)):effect(effect(update!(assoccard:qianju-activetrue))):msg"lose [Click] and avoid the first tag received until their next turn"}]:events{:corp-turn-ends{:effect(effect(update!(dissoccard:qianju-active)))}:runner-turn-begins{:req(req(:qianju-activecard)):effect(effect(lose:click1))}:pre-tag{:req(req(:qianju-activecard)):msg"avoid the first tag received":effect(effect(tag-prevent1)(update!(dissoccard:qianju-active)))}}}
{:in-play[:link1]:effect(effect(resolve-ability{:optional{:req(req(some#(when(=(:title%)"Rabbit Hole")%)(:deckrunner))):prompt"Install another Rabbit Hole?":msg"install another Rabbit Hole":yes-ability{:effect(req(when-let[c(some#(when(=(:title%)"Rabbit Hole")%)(:deckrunner))](trigger-eventstateside:searched-stacknil)(shuffle!state:runner:deck)(runner-installstatesidec)))}}}cardnil))}
{:prevent{:damage[:net:brain]}:abilities[{:req(req(not-empty(:deckrunner))):effect(req(let[n(count(filter#(=(:title%)(:titlecard))(all-installedstate:runner)))](resolve-abilitystateside{:prompt"Choose how much damage to prevent":priority50:choices{:number(req(minn(count(:deckrunner))))}:msg(msg"trash "(join", "(map:title(taketarget(:deckrunner))))" from their Stack and prevent "target" damage"):effect(effect(damage-prevent:nettarget)(damage-prevent:braintarget)(mill:runnertarget)(trashcard{:cause:ability-cost}))}cardnil)))}]}
(let[eventmap(fn[s](into{}(reverse(gets:turn-events))))]{:abilities[{:req(req(and(true?(:access@state))(=(:cid(second(:pre-damage(eventmap@state))))(:cid(first(:post-access-card(eventmap@state))))))):effect(effect(resolve-ability{:prompt"Choose how much damage to prevent":priority50:choices{:number(req(min(last(:pre-damage(eventmap@state)))(:creditrunner)))}:msg(msg"prevent "target" damage"):effect(effect(damage-prevent(first(:pre-damage(eventmap@state)))target)(lose:credittarget)(trashcard{:cause:ability-cost}))}cardnil))}]:events{:pre-access{:effect(req(doseq[dtype[:net:brain:meat]](swap!stateupdate-in[:prevent:damagedtype]#(conj%card))))}:run-ends{:effect(req(doseq[dtype[:net:brain:meat]](swap!stateupdate-in[:prevent:damagedtype]#(drop1%))))}}})
{:events{:successful-run{:req(req(=(get-in@state[:run:server])[:archives])):effect(req(let[rrcard](swap!stateassoc-in[:run:run-effect:replace-access]{:effect(effect(resolve-ability{:prompt"Choose one faceup card to add to the top of R&D":choices(req(filter#(:seen%)(:discardcorp))):msg(msg"add "(:titletarget)" to the top of R&D"):effect(req(movestate:corptarget:deck{:fronttrue}))}rrnil))})))}}}
{:events{:runner-install{:interactive(req(and(is-type?target"Hardware")(some#(=(:title%)(:titletarget))(:deckrunner)))):silent(req(not(and(is-type?target"Hardware")(some#(=(:title%)(:titletarget))(:deckrunner))))):optional{:prompt"Use Replicator to add a copy?":req(req(and(is-type?target"Hardware")(some#(=(:title%)(:titletarget))(:deckrunner)))):yes-ability{:msg(msg"add a copy of "(:titletarget)" to their Grip"):effect(effect(trigger-event:searched-stacknil)(shuffle!:deck)(move(some#(when(=(:title%)(:titletarget))%)(:deckrunner)):hand))}}}}}
{:abilities[{:label"[Trash]: Add [Link] strength to a non-Cloud icebreaker until the end of the run":msg(msg"add "(:linkrunner)" strength to "(:titletarget)" until the end of the run"):req(req(:run@state)):prompt"Choose one non-Cloud icebreaker":choices{:req#(and(has-subtype?%"Icebreaker")(not(has-subtype?%"Cloud"))(installed?%))}:effect(effect(pumptarget(:linkrunner):all-run)(trash(get-cardstatecard){:cause:ability-cost}))}{:label"[Trash]: Add [Link] strength to any Cloud icebreakers until the end of the run":msg(msg"add "(:linkrunner)" strength to "(counttargets)" Cloud icebreakers until the end of the run"):req(req(:run@state)):prompt"Choose any number of Cloud icebreakers":choices{:max50:req#(and(has-subtype?%"Icebreaker")(has-subtype?%"Cloud")(installed?%))}:effect(req(doseq[ttargets](pumpstatesidet(:linkrunner):all-run)(update-breaker-strengthstatesidet))(trashstateside(get-cardstatecard){:cause:ability-cost}))}]}
{:in-play[:memory1:link1]:abilities[{:req(req(:run@state)):delayed-completiontrue:msg"force the Corp to initiate a trace":label"Trace 5 - Give the Runner 1 tag and end the run":trace{:once:per-turn:base5:msg"give the Runner 1 tag and end the run":effect(effect(tag-runner:runnereid1)(end-run)):unsuccessful{:msg"bypass the current ICE"}}}]}
{:in-play[:memory2]:abilities[{:once:per-turn:req(req(rezzed?current-ice)):msg(msg"lower their maximum hand size by 1 and lower the strength of "(:titlecurrent-ice)" to 0"):effect(effect(lose:runner:hand-size-modification1)(update!(assoccard:sifr-targetcurrent-ice:sifr-usedtrue))(update-ice-strengthcurrent-ice))}]:events{:runner-turn-begins{:req(req(:sifr-usedcard)):effect(effect(gain:runner:hand-size-modification1)(update!(dissoccard:sifr-used)))}:pre-ice-strength{:req(req(=(:cidtarget)(get-incard[:sifr-target:cid]))):effect(req(let[ice-str(:current-strengthtarget)](ice-strength-bonusstateside(-ice-str)target)))}:run-ends{:effect(effect(update!(dissoccard:sifr-target)))}}}
{:abilities[{:cost[:click1]:delayed-completiontrue:label"Look at the top X cards of your Stack":msg"look at the top X cards of their Stack and rearrange them":effect(req(show-wait-promptstate:corp"Runner to rearrange the top cards of their stack")(let[n(count(filter#(=(:title%)(:titlecard))(all-installedstate:runner)))from(taken(:deckrunner))](if(pos?(countfrom))(continue-abilitystateside(reorder-choice:runner:corpfrom'()(countfrom)from)cardnil)(do(clear-wait-promptstate:corp)(effect-completedstatesideeidcard)))))}{:label"[Trash]: Look at the top card of R&D":msg"trash it and look at the top card of R&D":effect(effect(prompt!card(str"The top card of R&D is "(:title(first(:deckcorp))))["OK"]{})(trashcard{:cause:ability-cost}))}]}
{:in-play[:memory2]:events{:pre-access{:req(req(=:hqtarget)):silent(reqtrue):delayed-completiontrue:effect(effect(continue-ability{:prompt"How many ICE protecting HQ did you break all subroutines on?"; HACK ALERT - :number needs an upper limit. we don't track "broke all subroutines"
; events, so we can't put an accurate upper limit here. The higher the upper limit,
; the more entries in the UI drop-down list. 10 seems OK.
:choices{:number(req10)}:effect(effect(access-bonustarget))}cardnil))}}}
{:events{:pre-resolve-damage{:delayed-completiontrue:req(req(and(>(lasttargets)0)(runner-can-choose-damage?state)(not(get-in@state[:damage:damage-replace])))):effect(req(let[dtypetargetdmg(lasttargets)](when(>dmg(count(:handrunner)))(flatlinestate))(when(=dtype:brain)(swap!stateupdate-in[:runner:brain-damage]#(+%dmg))(swap!stateupdate-in[:runner:hand-size-modification]#(-%dmg)))(show-wait-promptstate:corp"Runner to use Titanium Ribs to choose cards to be trashed")(continue-abilitystateside{:prompt(msg"Choose "dmg" cards to trash for the "(namedtype)" damage"):player:runner:choices{:maxdmg:req#(and(in-hand?%)(=(:side%)"Runner"))}:msg(msg"trash "(join", "(map:titletargets))):effect(req(clear-wait-promptstate:corp)(doseq[ctargets](trashstatesidec{:causedtype:unpreventabletrue}))(trigger-eventstateside:damage-chosen)(damage-deferstateside:meat0)(effect-completedstatesideeidcard))}cardnil)(trigger-eventstateside:damagedtypenil)))}:damage-chosen{:effect(effect(enable-runner-damage-choice))}}:delayed-completiontrue:effect(effect(enable-runner-damage-choice)(system-msg(str"suffers 2 meat damage from installing Titanium Ribs"))(damageeid:meat2{:cardcard})):leave-play(req(swap!stateupdate-in[:damage]dissoc:damage-choose-runner))}
(letfn[(ability[n]{:delayed-completiontrue:mandatorytrue:prompt"Which card from the top of R&D would you like to access? (Card 1 is on top.)":choices(taken["1""2""3""4""5"]):effect(effect(handle-accesseid[(nth(:deckcorp)(dec(Integer/parseInttarget)))]))})]{:events{:successful-run{:req(req(=target:rd)):interactive(reqtrue):optional{:prompt"Use Top Hat to choose one of the top 5 cards in R&D to access?":yes-ability{:effect(req(swap!stateassoc-in[:run:run-effect:replace-access](ability(count(:deckcorp)))))}}}}})
{:in-play[:memory1]:events{:agenda-stolen{:interactive(reqtrue):req(req(not(empty?(:scoredcorp)))):delayed-completiontrue:effect(req(let[stolentarget](continue-abilitystateside{:optional{:prompt(msg"Swap "(:titlestolen)" for an agenda in the Corp's score area?"):yes-ability{:delayed-completiontrue:effect(req(continue-abilitystateside{:prompt(str"Choose a scored Corp agenda to swap with "(:titlestolen)):choices{:req#(in-corp-scored?stateside%)}:effect(req(let[scoredtarget](swap-agendasstatesidescoredstolen)(system-msgstateside(str"uses Turntable to swap "(:titlestolen)" for "(:titlescored)))(effect-completedstatesideeidcard)))}cardtargets))}}}cardtargets)))}}}
{:abilities[{:cost[:click2]:req(req(some#{:hq}(:successful-runrunner-reg))):label"trash a Bioroid, Clone, Executive or Sysop":prompt"Choose a Bioroid, Clone, Executive, or Sysop to trash":choices{:req#(and(rezzed?%)(or(has-subtype?%"Bioroid")(has-subtype?%"Clone")(has-subtype?%"Executive")(has-subtype?%"Sysop"))(or(and(=(last(:zone%)):content)(is-remote?(second(:zone%))))(=(last(:zone%)):onhost)))}:msg(msg"trash "(:titletarget)):effect(effect(trashtarget))}]}