diff --git a/README.md b/README.md index dffc0db..34c0cc8 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ The game art contains scary monsters. Very scary. Look out! ## Legal Stuff -I've looked at the various licenses on github but I don't read lawyer well. My code is open, do with it as you please. That said, as outlined in the [credits](https://grousewood-games.github.io/solforge/docs/faq#credits), a good portion of this is the intellectual property of others. Trying to take anything from this repo and monetize it in any form is highly inadvisable. You might get a lunch date with a cease & desist. +I've looked at the various licenses on github but I don't read lawyer well. My code is open, do with it as you please. Giving credit would be appreciated but I won't go to war over it. + +That said, as outlined in the [credits](https://grousewood-games.github.io/solforge/docs/faq#credits), a good portion of this is the intellectual property of others. Trying to take anything from this repo and monetize it in any form is highly inadvisable. You might get a lunch date with a cease & desist. Use your noggin :brain:. Show respect :trophy:. \ No newline at end of file diff --git a/play/dist/solforge.js b/play/dist/solforge.js index 5a3ab8a..66a163b 100644 --- a/play/dist/solforge.js +++ b/play/dist/solforge.js @@ -1,4 +1,4 @@ -(function(){"use strict";const Se=["A","N","T","U"];const le=["C","R","H","L"];const Mt=[{c:"AAK",f:"T",r:"L",s:1,t:"C",ds:["AH"]},{c:"ABB",f:"N",r:"R",s:4,t:"C",dp:["SL"],ds:["RG","ZB"]},{c:"ABM",f:"N",r:"C",s:5,t:"C",dp:["AB"]},{c:"AGC",f:"A",r:"C",s:1,t:"C",ds:["AR"]},{c:"AGK",f:"A",r:"L",s:2.1,t:"C",dp:["AR"]},{c:"AGP",f:"A",r:"C",s:1.1,t:"S",ds:["AR"]},{c:"AGW",f:"A",r:"R",s:4,t:"S",dp:["AH"],ds:["AR","MV"]},{c:"ASG",f:"T",r:"R",s:1,t:"S",ds:["MV","SP","LV"]},{c:"AMS",f:"A",r:"H",s:5,t:"C",dp:["MM"],ds:["MV"]},{c:"AFO",f:"A",r:"C",s:2.1,t:"C",dp:["LV"],ds:["SP"]},{c:"ATG",f:"A",r:"C",s:2,t:"C",dp:["SP"],ds:["AR","RB"]},{c:"ART",f:"U",r:"H",s:2.1,t:"C",dp:["MU","SP","PL"]},{c:"ATP",f:"U",r:"H",s:3,t:"C",dn:["SP","CD"]},{c:"AGM",f:"T",r:"L",s:2.2,t:"C",dp:["XA"],ds:["RG","AR","MV"]},{c:"ALG",f:"A",r:"R",s:1,t:"C",ds:["AH"]},{c:"AHL",f:"A",r:"H",s:1,t:"C",dp:["HL"],ds:["RB"]},{c:"ALS",f:"A",r:"H",s:2,t:"C",ds:["AH","MV"]},{c:"AAA",f:"A",r:"L",s:5.1,t:"C",dp:["HL"],dn:["FC","AG","BN"]},{c:"ABE",f:"A",r:"H",s:5.1,t:"S",ds:["HL","TD"],dn:["GW"]},{c:"ATZ",f:"A",r:"C",s:4,t:"S",ds:["FR","AL","SP"]},{c:"AEC",f:"U",r:"L",s:5,t:"S",ds:["GW"]},{c:"ARB",f:"A",r:"H",s:4,t:"C",ds:["AR","RB"],dn:["TK","LZ"]},{c:"AEN",f:"A",r:"C",s:2,t:"C",dp:[],ds:["RB","AR"],dn:[]},{c:"APM",f:"A",r:"H",s:2,t:"C",dp:["MA","LV"],ds:["SP"]},{c:"AQE",f:"T",r:"C",s:1,t:"S",ds:["HR"]},{c:"AGD",f:"U",r:"L",s:1,t:"C",dp:["LG"],ds:["DR"]},{c:"AFS",f:"A",r:"L",s:1,t:"C",dp:["RB"],ds:["FR","VT"]},{c:"AMD",f:"T",r:"H",s:5,t:"C",dp:["FC"],ds:["AG"]},{c:"ABR",f:"T",r:"C",s:2,t:"C",dp:["FC"]},{c:"AFR",f:"T",r:"H",s:3.1,t:"C",dp:["MT","SP"],ds:["CS"]},{c:"AMY",f:"T",r:"C",s:1,t:"C",dp:["FC"]},{c:"ABL",f:"T",r:"R",s:1,t:"S",ds:["FC"]},{c:"ATT",f:"T",r:"L",s:4.1,t:"C",ds:["FC","AG","AS"]},{c:"AGU",f:"T",r:"R",s:2.1,t:"C",ds:["DN","WL","MV"]},{c:"AIV",f:"T",r:"H",s:1,t:"C",dp:["MT"],ds:["RK"]},{c:"BRS",f:"A",r:"C",s:5,t:"C",dn:["FC","AG","BN"]},{c:"BTB",f:"A",r:"R",s:5,t:"C",dp:["AR"],ds:["RB","DI"]},{c:"BTH",f:"U",r:"R",s:3,t:"C",ds:["DI","CS"]},{c:"BTI",f:"A",r:"C",s:4,t:"C",ds:["MM","AL"]},{c:"BTN",f:"A",r:"H",s:1,t:"C",ds:["NX","AH"]},{c:"BBB",f:"U",r:"H",s:4,t:"C",ds:["CS","UD"]},{c:"BLH",f:"T",r:"L",s:2,t:"C",dp:["SP"],ds:["AG","TK","GW","SF","RX"]},{c:"BFT",f:"N",r:"C",s:5,t:"S",ds:["UD"]},{c:"BSP",f:"N",r:"C",s:2.2,t:"C",ds:["RK"]},{c:"BWK",f:"N",r:"R",s:1,t:"C",ds:["RV","ZB"]},{c:"BLW",f:"N",r:"R",s:3,t:"C",ds:["ZB","CS"]},{c:"BZS",f:"T",r:"C",s:5,t:"C",ds:["RX","MV","FC"]},{c:"BSR",f:"N",r:"R",s:1,t:"C",ds:["AB","RV"]},{c:"BMY",f:"T",r:"H",s:2.1,t:"C",ds:["MV"]},{c:"BSW",f:"T",r:"C",s:3,t:"C",ds:["MS"]},{c:"BWW",f:"T",r:"H",s:4,t:"C",ds:["MV"]},{c:"BTM",f:"U",r:"H",s:1,t:"S",ds:["PL","RV","RP"]},{c:"BAW",f:"U",r:"R",s:2,t:"C",ds:["FC"]},{c:"BWG",f:"U",r:"C",s:1,t:"C",ds:["PL"]},{c:"BTR",f:"U",r:"H",s:3.1,t:"C",dp:["MU"],ds:["CS","FR"]},{c:"BWD",f:"U",r:"C",s:2,t:"C",ds:["PL","GW","SF","TK"]},{c:"BSG",f:"A",r:"L",s:1,t:"C",ds:["RB","MV","AR"]},{c:"BSS",f:"A",r:"L",s:1,t:"C",dp:["RB"],ds:["AR"]},{c:"BTS",f:"U",r:"C",s:1.1,t:"C",ds:["PL","TK","GW"]},{c:"BST",f:"T",r:"L",s:4,t:"C",dp:["RP"],ds:["MS"]},{c:"BWT",f:"U",r:"L",s:4.2,t:"C",dp:["DI"],ds:["RP","HR"]},{c:"BRH",f:"N",r:"R",s:5,t:"C",ds:["AB"]},{c:"BWH",f:"A",r:"R",s:1,t:"S",dp:["AR"]},{c:"BRN",f:"T",r:"R",s:3,t:"S",ds:["BN","TD"]},{c:"BZD",f:"N",r:"R",s:2,t:"C",dp:["QT"],ds:["DR","RG","MV"]},{c:"BFM",f:"N",r:"H",s:2.3,t:"C",dp:["QT"],ds:["MV","AL"]},{c:"BSM",f:"T",r:"H",s:2,t:"C",dp:["QN"],ds:["RV","AG"]},{c:"CKB",f:"N",r:"H",s:5,t:"C",ds:["RV"]},{c:"CDT",f:"U",r:"R",s:1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"CMF",f:"N",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"CTL",f:"T",r:"L",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"CCS",f:"N",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"CHY",f:"U",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"CSR",f:"U",r:"C",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"CHV",f:"N",r:"L",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"CRS",f:"A",r:"R",s:3,t:"C",dp:["MM"],ds:["LV"],dn:[]},{c:"COD",f:"T",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"CTI",f:"N",r:"C",s:1.1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"CHA",f:"U",r:"R",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"CHH",f:"U",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"CHR",f:"U",r:"L",s:1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"CBB",f:"T",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"CDC",f:"T",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"CFB",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"CNM",f:"T",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"CSW",f:"T",r:"L",s:2.3,t:"C",dp:[],ds:["DR"],dn:[]},{c:"CTG",f:"A",r:"C",s:3,t:"C",dp:[],ds:["RB"],dn:[]},{c:"CCT",f:"T",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"CFG",f:"T",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"CGL",f:"N",r:"H",s:3,t:"C",dp:["AB"],ds:[],dn:[]},{c:"CSU",f:"N",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"CCR",f:"N",r:"C",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"CSB",f:"N",r:"C",s:2,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"CNT",f:"A",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"CWK",f:"T",r:"C",s:3,t:"C",dp:[],ds:["DI"],dn:[]},{c:"CRC",f:"A",r:"R",s:2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"CYC",f:"N",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"CYS",f:"N",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"CTW",f:"N",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"CTV",f:"U",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"CAG",f:"A",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"CBS",f:"A",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"CIN",f:"A",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"CSH",f:"A",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"CSG",f:"A",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"DFR",f:"N",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"DHW",f:"N",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"DSS",f:"N",r:"R",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"DCR",f:"N",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"DSK",f:"N",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"DBA",f:"U",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"DBP",f:"U",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"DMR",f:"U",r:"C",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"DBR",f:"U",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"DCS",f:"A",r:"L",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"DDF",f:"U",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"DGZ",f:"A",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"DBN",f:"N",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"DDS",f:"A",r:"H",s:4.2,t:"S",dp:[],ds:[],dn:[]},{c:"DIS",f:"T",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"DSV",f:"U",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"DDD",f:"N",r:"L",s:1,t:"C",dp:[],ds:["DR"],dn:[]},{c:"DPB",f:"A",r:"L",s:5.2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"DZD",f:"U",r:"L",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"DRE",f:"T",r:"L",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"DGW",f:"T",r:"L",s:5.2,t:"S",dp:["DR"],ds:[],dn:[]},{c:"DBT",f:"N",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"DFB",f:"N",r:"R",s:1,t:"C",dp:["AB"],ds:[],dn:[]},{c:"DMW",f:"A",r:"L",s:1.1,t:"C",dp:["MM"],ds:[],dn:[]},{c:"DCH",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"DTD",f:"N",r:"L",s:4.2,t:"C",dp:["DR"],ds:[],dn:[]},{c:"DSZ",f:"N",r:"C",s:2,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"DYB",f:"U",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"DBQ",f:"N",r:"H",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"DYS",f:"N",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"DYL",f:"U",r:"L",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"EBW",f:"N",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"ESK",f:"N",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"EHW",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"ETN",f:"A",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"EWE",f:"T",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"ENP",f:"A",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"ESU",f:"A",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"ENR",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"EPD",f:"N",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"EPH",f:"A",r:"L",s:4.2,t:"C",dp:[],ds:[],dn:[]},{c:"ESG",f:"A",r:"H",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"ESC",f:"A",r:"H",s:2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"ESP",f:"U",r:"H",s:2.3,t:"C",dp:[],ds:[],dn:[]},{c:"EWT",f:"U",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"EHN",f:"U",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"EFA",f:"T",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"EFM",f:"T",r:"L",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"EFP",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"EFE",f:"U",r:"L",s:5.2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"EXD",f:"N",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"FWB",f:"U",r:"C",s:2.3,t:"C",dp:[],ds:[],dn:[]},{c:"FWR",f:"U",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"FFG",f:"U",r:"C",s:4,t:"C",dp:[],ds:["DI"],dn:[]},{c:"FST",f:"N",r:"R",s:4,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"FWK",f:"N",r:"C",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"FIN",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"FRR",f:"U",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"FVA",f:"T",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"FFU",f:"T",r:"H",s:1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"FLH",f:"T",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"FMS",f:"T",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"FSM",f:"T",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"FBC",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"FBI",f:"T",r:"H",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"FFS",f:"T",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"FJT",f:"T",r:"C",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"FLN",f:"T",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"FRI",f:"T",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"FSS",f:"T",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"FLS",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"FSH",f:"T",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"FFD",f:"N",r:"H",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"FRV",f:"N",r:"H",s:3,t:"C",dp:[],ds:["AB"],dn:[]},{c:"FSP",f:"A",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"FPR",f:"T",r:"C",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"FFL",f:"A",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"FGA",f:"A",r:"C",s:1,t:"C",dp:[],ds:["RB","VT"],dn:[]},{c:"FGB",f:"A",r:"R",s:1,t:"C",dp:[],ds:["RB","VT"],dn:[]},{c:"FGD",f:"A",r:"H",s:3,t:"C",dp:["VT"],ds:["RB"],dn:[]},{c:"FGG",f:"A",r:"H",s:1,t:"C",dp:["VT"],ds:["RB"],dn:[]},{c:"FOL",f:"A",r:"H",s:3.1,t:"C",dp:[],ds:[],dn:[]},{c:"FPM",f:"A",r:"R",s:3,t:"C",dp:[],ds:["RB"],dn:[]},{c:"FPS",f:"A",r:"C",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"FFM",f:"T",r:"H",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"FMD",f:"T",r:"L",s:3,t:"C",dp:[],ds:["DR"],dn:[]},{c:"FSK",f:"T",r:"C",s:2.3,t:"S",dp:[],ds:[],dn:[]},{c:"FWT",f:"U",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"FZS",f:"T",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"GOS",f:"A",r:"L",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"GHS",f:"U",r:"C",s:2.2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"GHB",f:"U",r:"R",s:1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"GHR",f:"U",r:"H",s:4.2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"GRN",f:"N",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"GTH",f:"N",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"GSC",f:"U",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"GMP",f:"A",r:"L",s:1,t:"C",dp:[],ds:["MM","CD"],dn:[]},{c:"GTT",f:"T",r:"L",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"GCL",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"GCR",f:"T",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"GLF",f:"N",r:"C",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"GRW",f:"N",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"GSW",f:"N",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"GVS",f:"U",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"GSS",f:"U",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"GBG",f:"N",r:"C",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"GGE",f:"N",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"GGH",f:"N",r:"C",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"GRP",f:"N",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"GGD",f:"N",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"GGR",f:"N",r:"L",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"GGP",f:"N",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"GGS",f:"N",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"GRM",f:"N",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"GHT",f:"U",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"GMR",f:"U",r:"C",s:1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"HMF",f:"T",r:"H",s:3,t:"C",dp:[],ds:["YT"],dn:[]},{c:"HTR",f:"U",r:"L",s:1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"HAR",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"HFA",f:"N",r:"H",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"HOD",f:"T",r:"R",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"HWM",f:"A",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"HOX",f:"N",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"HGS",f:"N",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"HTP",f:"U",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"IBF",f:"T",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"ITO",f:"T",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"IME",f:"N",r:"L",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"IVS",f:"N",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"ICD",f:"N",r:"L",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"IWC",f:"A",r:"C",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"IHA",f:"A",r:"L",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"IBR",f:"A",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"IMD",f:"A",r:"L",s:3,t:"C",dp:[],ds:["RB"],dn:[]},{c:"IMA",f:"A",r:"L",s:2.3,t:"C",dp:[],ds:[],dn:[]},{c:"IZK",f:"T",r:"L",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"JPK",f:"A",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"KDC",f:"T",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"KAW",f:"T",r:"L",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"KOD",f:"N",r:"L",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"KBE",f:"U",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"KIW",f:"A",r:"L",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"KTS",f:"U",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"KKK",f:"T",r:"L",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"LOD",f:"U",r:"L",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"LFA",f:"T",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"LKP",f:"U",r:"L",s:1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"LGT",f:"N",r:"R",s:2.3,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"LLD",f:"N",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"LLG",f:"U",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"LLS",f:"A",r:"H",s:5,t:"C",dp:[],ds:["RB"],dn:[]},{c:"LLT",f:"T",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"LBD",f:"U",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"LSS",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"LBL",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"LBR",f:"T",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"LSK",f:"T",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"LWY",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"LSP",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"LCE",f:"A",r:"L",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"LUC",f:"T",r:"L",s:4.2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"LMV",f:"N",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"LHY",f:"U",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"LYR",f:"U",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"LYS",f:"U",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"MMH",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"MHR",f:"U",r:"L",s:5.1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"MRF",f:"N",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"MOE",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"MXW",f:"A",r:"C",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"MSP",f:"U",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"MMA",f:"A",r:"C",s:1,t:"C",dp:[],ds:["MM"],dn:[]},{c:"MMR",f:"A",r:"C",s:5,t:"C",dp:["MM"],ds:[],dn:[]},{c:"MMX",f:"A",r:"C",s:2,t:"C",dp:[],ds:["MM"],dn:[]},{c:"MMI",f:"A",r:"C",s:4,t:"C",dp:[],ds:["MM"],dn:[]},{c:"MMO",f:"A",r:"C",s:2,t:"C",dp:[],ds:["MM"],dn:[]},{c:"MMV",f:"A",r:"C",s:2.2,t:"C",dp:[],ds:["MM"],dn:[]},{c:"MPH",f:"U",r:"H",s:3,t:"S",dp:[],ds:["DR"],dn:[]},{c:"MSC",f:"A",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"MTS",f:"A",r:"C",s:1.1,t:"S",dp:[],ds:[],dn:[]},{c:"MTT",f:"A",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"MML",f:"U",r:"H",s:2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"MMW",f:"U",r:"L",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"MDE",f:"N",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"MBP",f:"U",r:"H",s:1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"MND",f:"A",r:"R",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"NNS",f:"A",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"NGB",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"NGW",f:"T",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"NSL",f:"U",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"NCF",f:"N",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"NCM",f:"N",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"NCS",f:"N",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"NCW",f:"N",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"NCV",f:"N",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"NEM",f:"N",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"NSW",f:"N",r:"L",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"NSH",f:"N",r:"L",s:2.3,t:"S",dp:[],ds:["DR"],dn:[]},{c:"NXA",f:"A",r:"L",s:3.1,t:"C",dp:[],ds:[],dn:[]},{c:"NXC",f:"A",r:"C",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"NXG",f:"A",r:"H",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"NXO",f:"A",r:"C",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"NXP",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"NXT",f:"A",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"NGT",f:"N",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"NGQ",f:"U",r:"L",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"NCL",f:"U",r:"R",s:1.1,t:"S",dp:[],ds:[],dn:[]},{c:"NFF",f:"U",r:"L",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"NAM",f:"N",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"NOZ",f:"N",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"NSY",f:"N",r:"C",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"ONN",f:"N",r:"H",s:1.1,t:"S",dp:[],ds:[],dn:[]},{c:"OXA",f:"A",r:"H",s:2.3,t:"C",dp:[],ds:[],dn:[]},{c:"OXM",f:"A",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"OXP",f:"N",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"OBB",f:"T",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"OEX",f:"A",r:"H",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"OWH",f:"T",r:"H",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"OBD",f:"A",r:"H",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"OFM",f:"A",r:"R",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"OJC",f:"A",r:"H",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"OPK",f:"A",r:"R",s:2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"OSV",f:"A",r:"H",s:4,t:"C",dp:[],ds:["RB"],dn:[]},{c:"OSS",f:"A",r:"C",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"OWW",f:"A",r:"L",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"OHV",f:"N",r:"R",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"ODC",f:"U",r:"L",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"OSP",f:"N",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"OSL",f:"U",r:"C",s:3,t:"C",dp:[],ds:["PL"],dn:[]},{c:"OWF",f:"A",r:"H",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"OXS",f:"U",r:"R",s:1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"PHM",f:"A",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"PPM",f:"A",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"PSM",f:"A",r:"L",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"PLW",f:"A",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"PRG",f:"N",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"PRI",f:"A",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"PHS",f:"A",r:"R",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"PTB",f:"U",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"PSC",f:"U",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"PSH",f:"N",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"PTR",f:"A",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"PSG",f:"U",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"PMI",f:"T",r:"H",s:5.1,t:"C",dp:[],ds:[],dn:[]},{c:"PMS",f:"T",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"POX",f:"N",r:"H",s:4.2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"PYG",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"PYS",f:"T",r:"C",s:1.1,t:"S",dp:[],ds:[],dn:[]},{c:"RBH",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"ROK",f:"T",r:"L",s:3.1,t:"S",dp:[],ds:[],dn:[]},{c:"RHY",f:"U",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"RTS",f:"T",r:"C",s:2.2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"RLW",f:"U",r:"H",s:1,t:"C",dp:["WD"],ds:[],dn:[]},{c:"RHU",f:"A",r:"L",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"RFL",f:"T",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"RHC",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"ROG",f:"N",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"RWC",f:"U",r:"C",s:4,t:"C",dp:[],ds:["DI"],dn:[]},{c:"RFA",f:"U",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"RWD",f:"N",r:"C",s:5,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"RSE",f:"T",r:"H",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"RBG",f:"U",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"RGG",f:"U",r:"H",s:1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"RSZ",f:"N",r:"R",s:1.1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"RSP",f:"T",r:"R",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"RHW",f:"N",r:"C",s:3,t:"C",dp:["WD"],ds:[],dn:[]},{c:"SBF",f:"T",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SAP",f:"A",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SVO",f:"U",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"SSE",f:"U",r:"L",s:2.1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"STS",f:"U",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SCS",f:"N",r:"C",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"SMD",f:"T",r:"L",s:1,t:"C",dp:[],ds:["DR"],dn:[]},{c:"SFS",f:"N",r:"L",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"SHY",f:"N",r:"C",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SCD",f:"A",r:"H",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SFT",f:"A",r:"H",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SOC",f:"N",r:"L",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"SOA",f:"A",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SOD",f:"U",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SOK",f:"T",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SOT",f:"N",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SAD",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SHG",f:"N",r:"L",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SBI",f:"U",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"SCC",f:"U",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SPB",f:"U",r:"L",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SPD",f:"U",r:"R",s:1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SPM",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STD",f:"A",r:"H",s:2.2,t:"C",dp:[],ds:["MM"],dn:[]},{c:"STB",f:"T",r:"C",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"SHS",f:"U",r:"R",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"SGF",f:"N",r:"H",s:2.2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"SKG",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SSD",f:"T",r:"L",s:5,t:"C",dp:[],ds:["DR"],dn:[]},{c:"SDA",f:"U",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SSR",f:"U",r:"L",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SNB",f:"A",r:"C",s:2.3,t:"S",dp:[],ds:[],dn:[]},{c:"SNP",f:"A",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SRD",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SSH",f:"U",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SRM",f:"N",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SRH",f:"N",r:"C",s:2.3,t:"C",dp:["AB"],ds:[],dn:[]},{c:"SDN",f:"N",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SHV",f:"N",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SRP",f:"N",r:"L",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"SGG",f:"N",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SBA",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SKB",f:"A",r:"C",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SBR",f:"T",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SKS",f:"T",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SEL",f:"T",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"STM",f:"T",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SBD",f:"U",r:"C",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"SCV",f:"N",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SFM",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SSN",f:"A",r:"C",s:2.2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SSM",f:"T",r:"C",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"SLH",f:"N",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SRV",f:"N",r:"R",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"SSI",f:"A",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SND",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SNT",f:"N",r:"L",s:5.1,t:"C",dp:[],ds:[],dn:[]},{c:"STR",f:"N",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SPH",f:"N",r:"H",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"SSA",f:"N",r:"H",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"STO",f:"U",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SDR",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SOL",f:"U",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SOV",f:"T",r:"L",s:4,t:"S",dp:[],ds:["DR"],dn:[]},{c:"SHK",f:"T",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SWR",f:"A",r:"R",s:1,t:"C",dp:[],ds:["MM"],dn:[]},{c:"SMN",f:"T",r:"C",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SER",f:"A",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SES",f:"A",r:"L",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SFA",f:"A",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STG",f:"A",r:"L",s:2,t:"C",dp:[],ds:["DR","RB"],dn:[]},{c:"SSS",f:"A",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SSK",f:"A",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"SWG",f:"A",r:"C",s:4,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SWM",f:"A",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SIV",f:"U",r:"H",s:5.1,t:"S",dp:[],ds:[],dn:[]},{c:"STN",f:"T",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SGI",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SBG",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SCL",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SGA",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STP",f:"T",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"SSG",f:"U",r:"C",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SVH",f:"U",r:"C",s:2.3,t:"C",dp:[],ds:[],dn:[]},{c:"SIN",f:"U",r:"C",s:1.1,t:"S",dp:[],ds:[],dn:[]},{c:"SYL",f:"U",r:"H",s:2.2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"SEV",f:"N",r:"L",s:3.1,t:"C",dp:[],ds:[],dn:[]},{c:"SMA",f:"U",r:"C",s:5,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SML",f:"U",r:"C",s:1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SYO",f:"A",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TST",f:"T",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"TBA",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TGL",f:"U",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"TGS",f:"U",r:"C",s:2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TPT",f:"N",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"TDW",f:"N",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"TNL",f:"N",r:"L",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"TEX",f:"A",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TGN",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TSM",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TUP",f:"A",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TAB",f:"T",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TGI",f:"T",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TDS",f:"U",r:"L",s:1.1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"TSP",f:"T",r:"H",s:4.2,t:"S",dp:["DI"],ds:[],dn:[]},{c:"TPG",f:"N",r:"H",s:3.1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"TMG",f:"U",r:"R",s:3,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TMM",f:"U",r:"C",s:5,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TRA",f:"A",r:"R",s:5,t:"C",dp:[],ds:["MM"],dn:[]},{c:"TRS",f:"U",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TRV",f:"T",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TRW",f:"N",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TBB",f:"T",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TOB",f:"N",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TWS",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TVG",f:"A",r:"R",s:1.1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"TXB",f:"U",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"TXS",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TCG",f:"T",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"TWT",f:"A",r:"C",s:3,t:"C",dp:[],ds:["RB"],dn:[]},{c:"TRN",f:"T",r:"H",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"TGK",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TSL",f:"U",r:"H",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"TWG",f:"U",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"UGM",f:"U",r:"C",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"UGL",f:"T",r:"R",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UIC",f:"T",r:"H",s:2.3,t:"C",dp:[],ds:["DI"],dn:[]},{c:"ULR",f:"U",r:"H",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"URD",f:"N",r:"H",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"UBL",f:"T",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"UCM",f:"T",r:"R",s:1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UEM",f:"T",r:"C",s:4,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UHS",f:"T",r:"H",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UIM",f:"T",r:"C",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UWL",f:"T",r:"H",s:2,t:"C",dp:["YT"],ds:[],dn:[]},{c:"UWS",f:"T",r:"R",s:2.3,t:"C",dp:["YT"],ds:[],dn:[]},{c:"UIW",f:"A",r:"L",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"URS",f:"U",r:"C",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"UTM",f:"U",r:"C",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UTR",f:"U",r:"H",s:2,t:"C",dp:["DI"],ds:[],dn:[]},{c:"URB",f:"U",r:"L",s:2.3,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UPM",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VIK",f:"N",r:"L",s:5.2,t:"C",dp:[],ds:[],dn:[]},{c:"VRP",f:"N",r:"L",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"VBK",f:"A",r:"R",s:2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"VTC",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VTW",f:"A",r:"R",s:4,t:"C",dp:[],ds:["RB"],dn:[]},{c:"VGN",f:"N",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VND",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"VNF",f:"U",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"VNS",f:"U",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"VSK",f:"U",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"VCH",f:"U",r:"H",s:4.1,t:"S",dp:[],ds:[],dn:[]},{c:"VGR",f:"U",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"VGL",f:"N",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"VOB",f:"T",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"VCG",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VES",f:"N",r:"L",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"VYE",f:"N",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"WBY",f:"T",r:"R",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"WBU",f:"T",r:"C",s:1.1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"WMC",f:"A",r:"H",s:5,t:"C",dp:[],ds:["RB"],dn:[]},{c:"WMR",f:"A",r:"H",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"WTK",f:"A",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"WMM",f:"A",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WTW",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WTA",f:"U",r:"L",s:4,t:"C",dp:[],ds:["PL"],dn:[]},{c:"WWP",f:"U",r:"H",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WWR",f:"U",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"WOD",f:"U",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"WFM",f:"T",r:"H",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WWS",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WBH",f:"T",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WCS",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WPD",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WSE",f:"T",r:"L",s:5.1,t:"C",dp:[],ds:[],dn:[]},{c:"WFB",f:"N",r:"C",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WFS",f:"N",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WBG",f:"N",r:"L",s:1.1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"ZXR",f:"T",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"XCR",f:"N",r:"C",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XDH",f:"N",r:"R",s:3,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XHS",f:"N",r:"C",s:2.2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XHU",f:"N",r:"C",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XRF",f:"N",r:"C",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XSH",f:"N",r:"L",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XTR",f:"N",r:"H",s:5.1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XDV",f:"N",r:"H",s:1,t:"C",dp:["ZB"],ds:[],dn:[]},{c:"XRW",f:"N",r:"H",s:2,t:"S",dp:["ZB"],ds:[],dn:[]},{c:"YWC",f:"T",r:"C",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"YNS",f:"N",r:"L",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"ZPM",f:"T",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"ZTU",f:"N",r:"L",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZIN",f:"N",r:"C",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZMT",f:"N",r:"C",s:3,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZSH",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]}],ti=[["ASQ",["SLG","SLG"]],["CGL",["CGF"]],["DHC",["DYF"]],["DTD",["TOT"]],["FGD",["FGA","FGB","FGG"]],["IBA",["AVB"]],["IZK",["IFL","IFR"]],["RHU",["RSC"]],["SLS",["MMY"]],["TSL",["FUN"]],["WHR",["WHC"]]];class ei{raw={["C"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0},["S"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0}};addStat(t,e){this.raw[t][e]++}g(t,e){return this.raw[t][e]}typeSum(t){return Se.map(e=>this.g(t,e)).reduce((e,i)=>e+i,0)}getTotal(){const t=this.typeSum("C"),e=this.typeSum("S");return[t,e,t+e]}getFactTotal(t){const e=this.g("C",t),i=this.g("S",t);return[e,i,e+i]}}const l=(n,t)=>({card:n,num:t}),yi={name:"Official 1 - 3",id:"SBE1",decks:[{name:"Alloyin Starter",factions:["A"],cards:[l("SYO",1),l("BSS",1),l("SFT",2),l("SNP",2),l("TSM",2),l("SSS",2),l("ALG",2),l("MXW",3),l("TUP",3),l("FPS",3),l("MND",3),l("IWC",3),l("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[l("SFS",1),l("GGD",1),l("FFD",3),l("EPD",2),l("CCR",2),l("HGS",2),l("DSS",2),l("BWK",2),l("GBG",3),l("DSK",3),l("GRP",3),l("VGN",3),l("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[l("FBC",1),l("RBH",1),l("CFB",3),l("FSM",2),l("FSH",2),l("FSS",2),l("PMS",2),l("RFL",2),l("UBL",3),l("WPD",3),l("SGI",3),l("AMY",3),l("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[l("UPM",1),l("EHW",1),l("FRR",3),l("SPD",2),l("HTP",2),l("LSS",2),l("SDR",2),l("SRD",2),l("FWR",3),l("DBP",3),l("GHT",3),l("GSS",3),l("TXS",3)]},{name:"Cruel Corrosion",factions:["A","N"],cards:[l("IHA",1),l("WBG",1),l("OXP",1),l("DFR",1),l("APM",1),l("SNP",1),l("GRM",2),l("ETN",2),l("DHW",2),l("OXM",2),l("AEN",2),l("ATG",2),l("CTI",2),l("CTW",2),l("FPS",2),l("GRW",2),l("MTT",2),l("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[l("ZTU",1),l("VRP",1),l("GGP",1),l("EPD",1),l("DBT",1),l("BSM",1),l("TDW",2),l("NGT",2),l("UBL",2),l("FWK",2),l("BZD",2),l("CSB",2),l("SLH",2),l("MMH",2),l("LSK",2),l("GBG",2),l("CFG",2),l("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[l("TDS",1),l("SSR",1),l("FRR",1),l("ULR",1),l("UTR",1),l("BTM",1),l("UGL",2),l("EHN",2),l("SPD",2),l("GHB",2),l("FLN",2),l("SML",2),l("RFL",2),l("OXS",2),l("UTM",2),l("TWG",2),l("ENR",2),l("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[l("CSW",1),l("SMD",1),l("FRR",1),l("UIC",1),l("CFB",1),l("UGL",2),l("FSH",2),l("FLN",2),l("WPD",1),l("TWG",2),l("TCG",2),l("TGS",2),l("SML",2),l("SVH",1),l("SCL",2),l("RTS",1),l("FWB",2),l("ENR",2),l("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[l("IMA",1),l("GMP",1),l("OXA",1),l("EPD",1),l("OJC",1),l("ESU",2),l("OXM",2),l("MMA",2),l("SAP",1),l("AFO",2),l("GBG",2),l("CTW",2),l("SRH",1),l("TSM",2),l("SLH",1),l("MTT",1),l("DCR",1),l("DFB",1),l("BSR",1),l("LGT",1),l("XRF",2),l("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[l("SBG",1),l("NSH",1),l("FFU",1),l("EWE",1),l("BFM",1),l("WBH",1),l("UWS",1),l("TGI",2),l("RFL",2),l("GRM",1),l("ASG",1),l("YWC",2),l("XRF",2),l("WPD",2),l("WCS",2),l("WBU",2),l("TCG",1),l("FSK",1),l("SLH",2),l("CFG",1),l("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[l("URB",1),l("AGK",1),l("ESP",1),l("FRR",1),l("NXT",1),l("ALG",1),l("FGB",1),l("PHS",2),l("TUP",1),l("EWT",2),l("PTR",1),l("VBK",1),l("AGC",1),l("AEN",2),l("ETN",1),l("FPS",2),l("MXW",2),l("GHT",1),l("TWG",2),l("SNB",1),l("SML",1),l("JPK",1),l("ENR",1),l("IWC",1)]},{name:"Spare Parts",factions:["N"],cards:[l("SEV",1),l("SHG",1),l("TPG",1),l("CGL",1),l("FRV",1),l("HFA",2),l("XDH",1),l("GRM",1),l("SCV",1),l("DFB",2),l("EBW",2),l("GBG",2),l("GLF",2),l("XHS",2),l("SOT",1),l("XRF",2),l("SCS",1),l("ZMT",1),l("SLH",1),l("VYE",1),l("XCR",2),l("XHU",1)]},{name:"Future Forged",factions:["A"],cards:[l("NXA",1),l("IMD",1),l("FOL",1),l("SFA",2),l("SFT",1),l("SCD",1),l("CAG",1),l("ESU",1),l("NNS",1),l("FPM",1),l("PRI",1),l("SSS",1),l("CTG",1),l("TSM",2),l("IWC",1),l("MMA",2),l("TGN",2),l("MTT",1),l("SKG",1),l("AFO",1),l("MMV",1),l("TWS",1),l("SBA",2),l("SSK",1),l("JPK",1)]},{name:"Burning Rage",factions:["T"],cards:[l("ROK",1),l("KKK",1),l("MOE",1),l("AFR",1),l("FBI",1),l("FSS",2),l("FLN",2),l("CCT",2),l("BRN",2),l("WPD",2),l("SSM",2),l("SOK",1),l("RTS",2),l("FSK",2),l("CWK",2),l("CFG",2),l("BSW",2),l("FMS",2)]},{name:"Awakened Fury",factions:["U"],cards:[l("DZD",1),l("SSE",1),l("BTR",1),l("TSL",1),l("MPH",1),l("CDT",1),l("DYB",1),l("BTH",2),l("TMG",2),l("BWD",2),l("RHY",2),l("SBD",2),l("GMR",2),l("STS",1),l("OSL",2),l("SBI",2),l("LYS",2),l("TGS",2),l("SOD",2)]}]},bi={name:"Official 4 - 5",id:"SBE2",decks:[{name:"Titan's Assault",factions:["N","T"],cards:[l("ATT",1),l("TNL",1),l("RSE",1),l("SPH",1),l("SCV",2),l("ABB",2),l("TBB",2),l("BRN",2),l("FLN",2),l("CMF",2),l("XDH",2),l("FST",2),l("TAB",2),l("MDE",2),l("FSK",2),l("FLH",2),l("CBB",2)]},{name:"Verdant Fortress",factions:["A","U"],cards:[l("NGQ",1),l("RHU",1),l("VCH",1),l("ESG",1),l("PLW",2),l("NNS",2),l("SND",2),l("WOD",2),l("IBR",2),l("BWD",2),l("SBI",2),l("RWC",2),l("TEX",2),l("SER",2),l("SWG",2),l("SCC",2),l("DYB",2)]},{name:"Umbruk Uprising",factions:["T","U"],cards:[l("LUC",1),l("BWT",1),l("GHR",1),l("TSP",1),l("WBH",1),l("COD",1),l("SDR",1),l("ZPM",1),l("OXS",1),l("WOD",1),l("RWC",2),l("SSG",2),l("VGR",2),l("CFG",2),l("UEM",2),l("FFG",2),l("UGL",2),l("DMR",2),l("RTS",2),l("CWK",2)]},{name:"Onyxium Twilight",factions:["A","N"],cards:[l("EPH",1),l("DTD",1),l("POX",1),l("DDS",1),l("OHV",1),l("PHS",1),l("DFB",1),l("TDW",1),l("CAG",1),l("ALG",1),l("TUP",2),l("CTW",2),l("XCR",2),l("SSK",2),l("SRH",2),l("ATG",2),l("MTT",2),l("SLH",2),l("GLF",2),l("AFO",2)]},{name:"Blistering Chaos",factions:["T","U"],cards:[l("WSE",1),l("MHR",1),l("PMI",1),l("SIV",1),l("BRN",1),l("HOD",1),l("CHA",1),l("LYS",1),l("TRS",2),l("PSC",2),l("FLN",2),l("EFA",2),l("SHS",2),l("TXB",2),l("VNF",2),l("CFG",2),l("FSK",2),l("CBB",2),l("VND",2)]},{name:"Dark Retribution",factions:["A","N"],cards:[l("AAA",1),l("SNT",1),l("ABE",1),l("XTR",1),l("CNT",1),l("HOX",1),l("PLW",1),l("AGW",1),l("OHV",2),l("OXM",2),l("XDH",2),l("VGL",2),l("ETN",2),l("MTT",2),l("VYE",2),l("DSK",2),l("BFT",2),l("ATZ",2),l("IBR",2)]},{name:"Iron Tide",factions:["A","U"],cards:[l("EFE",1),l("DPB",1),l("HWM",1),l("HTR",1),l("OJC",1),l("RBG",1),l("EWT",1),l("CIN",1),l("TGK",2),l("CAG",2),l("TGN",3),l("SCC",3),l("URS",3),l("LSP",3),l("TSM",3),l("TMM",3)]},{name:"Dragon Forge",factions:["N","T"],cards:[l("DGW",1),l("VIK",1),l("DDD",1),l("SMD",1),l("FFM",1),l("SHV",1),l("GRP",1),l("TGI",1),l("SLH",1),l("WBH",2),l("BZD",2),l("EFA",2),l("WFB",3),l("BZS",3),l("CCR",3),l("DSK",3),l("RHC",3)]}]},Ai={name:"Set 1 & 2 Tournies",id:"T1309",decks:[{name:"Axel: Lifegain",factions:["T","U"],cards:[l("AGD",3),l("EHW",3),l("FRR",3),l("FIN",1),l("UPM",1),l("LKP",2),l("BTM",2),l("LBL",3),l("GSS",3),l("RFA",3),l("GHB",3),l("EFP",3)]},{name:"Derk: Metaminds",factions:["A"],cards:[l("OJC",3),l("DMW",3),l("MMV",3),l("JPK",3),l("MMO",3),l("GMP",3),l("ALS",3),l("MMA",3),l("SFA",3),l("BTN",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[l("DBP",3),l("EHW",2),l("FRR",3),l("FWT",3),l("UPM",3),l("LKP",2),l("BTM",3),l("HTR",2),l("LBD",2),l("RFA",3),l("GHB",2),l("SDR",2)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[l("ALS",3),l("TDS",3),l("FRR",3),l("WWP",3),l("SML",2),l("BSG",3),l("JPK",2),l("ODC",3),l("NXT",2),l("WMM",3),l("GHB",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[l("SCS",3),l("ROG",1),l("GGP",1),l("GGD",3),l("WFS",1),l("DSS",3),l("ZTU",1),l("GBG",3),l("HFA",3),l("EXD",1),l("EPD",1),l("BSR",1),l("MRF",2),l("HGS",3),l("GTH",3)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[l("SHK",3),l("MOE",3),l("FRR",3),l("LSK",3),l("FFU",3),l("UBL",3),l("WWS",3),l("FSS",3),l("ENR",3),l("MMH",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[l("DBP",2),l("EHW",2),l("FRR",3),l("HTP",2),l("UPM",3),l("LKP",2),l("GHT",3),l("GGP",2),l("LBD",1),l("EPD",2),l("DBT",2),l("SPD",3),l("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[l("IWC",3),l("FSS",3),l("ETN",1),l("WPD",2),l("FSM",1),l("AHL",1),l("UBL",3),l("SMD",2),l("BTN",3),l("LSK",1),l("MMH",3),l("FFU",1),l("TSM",3),l("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[l("DSS",3),l("FSS",3),l("EPD",2),l("GTH",3),l("FSM",1),l("MOE",1),l("UBL",3),l("GGP",3),l("GBG",1),l("LSK",3),l("HGS",1),l("CTW",1),l("SHK",3),l("GGD",1),l("DBT",1)]}]},ki={name:"The Forge",id:"TG10",decks:[{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[l("BWK",3),l("TDS",2),l("FRR",3),l("WWP",3),l("GGP",3),l("GGD",3),l("DBT",1),l("WFS",3),l("CTW",3),l("EPD",3),l("GHB",3)]},{name:"ErrorAsh: Burn",factions:["N","T"],cards:[l("UBL",2),l("EFM",2),l("FBI",3),l("ESK",3),l("FLN",3),l("EFP",3),l("MOE",3),l("FSS",3),l("SHK",3),l("EPD",3),l("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[l("WWS",3),l("DYB",3),l("FRR",3),l("SYL",3),l("EPD",3),l("SSE",2),l("NSH",2),l("TDW",3),l("NFF",2),l("CHR",2),l("LKP",2),l("EXD",2)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[l("NSH",2),l("SMD",2),l("DDD",3),l("TDW",3),l("VRP",3),l("WCS",3),l("BSM",3),l("SHG",2),l("TGI",2),l("EPD",3),l("FVA",2),l("DBT",1),l("TRN",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[l("UWL",3),l("FFU",3),l("WBY",3),l("UIM",3),l("WBU",3),l("SSR",1),l("TRN",1),l("GTT",1),l("GCR",3),l("FRR",3),l("UBL",3),l("WWP",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[l("DDD",3),l("DBT",3),l("EPD",3),l("EFP",3),l("GGP",3),l("LSK",3),l("SHK",3),l("UBL",3),l("WCS",3),l("ZTU",3)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[l("XSH",3),l("SPM",3),l("FRR",3),l("ODC",3),l("SSE",3),l("ESK",3),l("TGS",3),l("XRF",3),l("VRP",3),l("URB",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[l("RBH",3),l("TDS",3),l("FRR",3),l("WWP",3),l("EFP",3),l("AMY",2),l("FVA",2),l("ENR",3),l("ZSH",3),l("EHW",3),l("GHB",2)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[l("BWK",2),l("KOD",2),l("CYC",3),l("GRM",3),l("VYE",3),l("XRW",3),l("MOE",2),l("ZTU",3),l("BSM",3),l("EPD",3),l("DSS",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[l("AGM",3),l("TDS",2),l("FRR",3),l("WWP",3),l("CSW",3),l("FLN",3),l("EFP",2),l("UWL",3),l("WBY",2),l("WCS",2),l("EHW",2),l("SHS",2)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[l("UHS",2),l("FLN",3),l("STG",3),l("CRC",3),l("SHK",3),l("EFP",2),l("WMR",2),l("WMM",3),l("JPK",3),l("SMD",3),l("FVA",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[l("LSK",2),l("WBG",3),l("EPD",3),l("DDD",3),l("SHK",3),l("EFP",3),l("ZTU",2),l("GGD",2),l("GGP",3),l("CTW",3),l("DBT",3)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[l("DMW",3),l("GMP",3),l("MMA",3),l("MMV",2),l("TDW",3),l("VRP",3),l("EPD",3),l("SHG",2),l("OJC",2),l("ESK",2),l("CHV",2),l("CTW",2)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[l("CTW",1),l("GCR",1),l("CFG",1),l("FZS",1),l("FBI",3),l("MOE",3),l("EFP",3),l("LSK",3),l("FLN",3),l("SHK",3),l("RTS",3),l("GGP",3),l("UBL",2)]}]},vi={name:"Fundecks",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[l("DFB",3),l("BSR",3),l("HGS",3),l("HFA",3),l("FFD",3),l("XSH",3),l("XHU",3),l("WBG",3),l("GBG",3),l("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[l("TBA",3),l("SVH",3),l("MBP",2),l("FSH",3),l("RBH",3),l("FBC",3),l("LBR",2),l("CFB",3),l("AAK",3),l("KKK",2),l("FRR",1),l("FIN",1),l("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[l("MMA",3),l("DMW",3),l("GMP",3),l("SYO",3),l("KAW",3),l("SHK",3),l("CTL",2),l("CAG",2),l("MSC",2),l("MTS",2),l("ASG",2),l("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[l("CTV",3),l("TDW",3),l("BTS",3),l("CHR",3),l("GMR",3),l("KOD",2),l("LKP",2),l("SHV",2),l("DBA",2),l("CCR",2),l("PTB",2),l("FIN",1),l("DBT",2)]},{name:"Voltron",factions:["A"],cards:[l("FGA",3),l("FGB",3),l("FGD",3),l("FGG",3),l("AFS",3),l("BSS",3),l("PRI",3),l("TUP",2),l("JPK",2),l("BWH",2),l("SFT",3)]},{name:"Do Fear The Reaper",factions:["A","N"],cards:[l("CTI",3),l("DFR",3),l("GRW",3),l("LGT",3),l("OXM",3),l("OXP",3),l("PHM",3),l("CTW",2),l("NNS",2),l("OXA",2),l("SDN",3)]},{name:"Muadib",factions:["N","U"],cards:[l("DBA",3),l("DYL",3),l("GSW",3),l("LBD",3),l("MMW",3),l("NCW",3),l("SRV",3),l("LBL",2),l("MSP",2),l("VYE",2),l("SBD",3)]},{name:"Triassic Park",factions:["T","U"],cards:[l("URB",3),l("UTR",3),l("UTM",3),l("ULR",3),l("UIC",3),l("UGL",3),l("RTS",3),l("BRN",2),l("LBR",2),l("IBF",2),l("GHB",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[l("DDD",3),l("WBH",3),l("HMF",3),l("WCS",3),l("GGP",3),l("SAD",3),l("SDN",3),l("EWE",3),l("SBG",3),l("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[l("WWP",3),l("EHN",2),l("SDR",2),l("HTR",2),l("MML",2),l("HTP",2),l("SHS",3),l("MND",2),l("NXC",2),l("CDT",2),l("PTB",2),l("SVO",2),l("MPH",2),l("SYO",2)]},{name:"Braaiins",factions:["N"],cards:[l("XDV",3),l("XRW",3),l("ONN",2),l("SLH",2),l("FWK",2),l("BWK",2),l("URD",2),l("TPG",2),l("DSS",2),l("KOD",2),l("ZMT",2),l("RSZ",2),l("BLW",2),l("CSB",2)]},{name:"Wanderin",factions:["N","U"],cards:[l("LYS",3),l("STR",2),l("MBP",2),l("OSL",2),l("RLW",3),l("SSR",1),l("SVO",2),l("SSE",2),l("RHW",3),l("SYL",2),l("TGS",2),l("TMG",3),l("XDH",3)]},{name:"Walls",factions:["A","T"],cards:[l("CDC",3),l("CTG",3),l("CRC",3),l("DCS",3),l("FRI",3),l("FGA",2),l("OBB",3),l("FVA",2),l("TGN",2),l("OWH",3),l("STN",3)]},{name:"Snakes In A Lane",factions:["A","U"],cards:[l("AFO",3),l("DSV",3),l("PSC",3),l("SHS",3),l("STO",3),l("NCL",2),l("VNF",3),l("LYS",2),l("SVO",1),l("VNS",3),l("TXS",2),l("ART",2)]},{name:"Benny & Izzy",factions:["A","T"],cards:[l("BRN",3),l("EFM",2),l("IZK",3),l("JPK",1),l("MTT",1),l("NNS",1),l("OBB",2),l("OWF",2),l("OEX",3),l("PRI",2),l("PTR",1),l("TST",1),l("FLS",2),l("BLH",3),l("SHK",3)]}]},ge=[yi,bi,Ai,ki,vi];class Ce{state;constructor(t){this.state=t}getState(){return this.state}get adjacent(){return f.adjacentPositions(this.lane)}get attack(){return this.state.attack+this.modSum("AT")}get activationAvailable(){return this.state.negateActivate?!1:this.state.activationAvailable}set activationAvailable(t){this.state.activationAvailable=t}get aggressive(){return this.state.aggressive||this.modBool("AG")}set aggressive(t){this.state.aggressive=t}get armor(){return this.negateArmor?0:this.state.armor+this.modSum("AR")}get armorDmg(){return this.state.armorDmg}set armorDmg(t){this.state.armorDmg=t}get breakthrough(){return this.state.breakthrough||this.modBool("BT")}set breakthrough(t){this.state.breakthrough=t}get changed(){return this.state.changed||this.negateDefender||this.negateArmor||this.negateActivate||this.negateMobility||this.negateRegen||this.state.triggers.some(t=>t.changes)}set changed(t){this.state.changed=t}get code(){return this.state.code}get defender(){return this.negateDefender?!1:this.state.defender||this.modBool("DF")}set defender(t){this.negateDefender||(this.state.defender=t,this.enforceEffects("DF"))}get effects(){return this.state.effects}get extraBattles(){return this.state.extraBattles}set extraBattles(t){this.state.extraBattles=t}get faction(){return L.getCard(this.code).faction}get health(){return this.state.health+this.modSum("HL")}get id(){return this.state.id}get isActive(){return!this.sleeping||this.aggressive}isTribe(t){return L.getCard(this.code).isTribe(t)}get lane(){return this.state.lane}get level(){return L.getCard(this.code).level}get maxHealth(){return this.state.maxHealth+this.modSum("MH")}get mobility(){return this.negateMobility?0:this.state.mobility+this.modSum("MB")}get mobilityAvailable(){return this.state.mobilityAvailable}set mobilityAvailable(t){this.state.mobilityAvailable=t}get mods(){return this.state.mods}get negateActivate(){return this.state.negateActivate}set negateActivate(t){this.state.negateActivate=t}get negateArmor(){return this.state.negateArmor||this.modBool("NA")}set negateArmor(t){this.state.negateArmor=t,this.enforceEffects("AR")}get negateDefender(){return this.state.negateDefender||this.modBool("ND")}set negateDefender(t){this.state.negateDefender=t,this.enforceEffects("DF")}get negateMobility(){return this.state.negateMobility||this.modBool("NM")}set negateMobility(t){this.state.negateMobility=t}get negateRegen(){return this.state.negateRegen||this.modBool("NM")}set negateRegen(t){this.state.negateRegen=t}get opposed(){const t=p.crTarg();return t.player=v.toTarget(!this.owner),t.lanes=f.oppositeLane(this.lane),f.creatByTarget(t)[0]}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get rank(){return v.toPlayer(this.owner).rank}get regen(){return this.negateRegen?0:this.state.regen+this.modSum("RG")}get sleeping(){return this.state.sleeping}set sleeping(t){this.state.sleeping=t}get status(){return this.state.status}set status(t){this.state.status=t}get triggers(){return this.state.triggers}buff(t,e,i=void 0){t!==0&&(this.state.attack+=t,this.enforceEffects("AT")),e!==0&&(this.state.health+=e,this.state.maxHealth+=e,this.enforceEffects("CH"),W.deathProdder(this,i),e>0&&x.addEvents(O.creatHeal(this,e)))}addArmor(t){if(!this.negateArmor){const e=this.state.armor+t;this.state.armor=Math.max(0,e),this.enforceEffects("AR")}}addMobility(t){if(!this.negateMobility){const e=this.state.mobility+t;this.state.mobility=Math.max(0,e)}}addPoison(t){const e=this.state.poison+t;this.state.poison=Math.max(0,e)}addRegen(t){if(!this.negateRegen){const e=this.state.regen+t;this.state.regen=Math.max(0,e)}}heal(t){if(t===0)return 0;const e=Math.min(this.health+t,this.maxHealth)-this.health;return this.state.health+=e,this.enforceEffects("CH"),x.addEvents(O.creatHeal(this,e)),e}setHealth(t){this.state.health=t}hurt(t,e=!1){if(t<1)return[0,0];const i=Math.max(Math.min(t,this.armor-this.armorDmg),0);let s=t-i,h=this.health-s;this.state.armorDmg+=i;let u=0;return e&&h<0&&(u=s-this.health,s=this.health),s>0&&(this.state.health-=s,this.enforceEffects("CH")),[s,u]}hurtBattle(t,e,i=!1){const s=this.hurt(t,i);return s[0]>0&&x.addEvents(O.damage(!0,s[0],!0,!0,this,e)),s[1]}hurtDirect(t,e,i=void 0){const s=this.hurt(t,!1);return s[0]>0&&(m.new().crd(e).txt(` dealt ${t} dmg to `).crd(this.code).txt(".").go(),x.addEvents(O.damage(!1,s[0],!1,!0,this,void 0)),W.deathProdder(this,i)),s[0]}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),W.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF")}modSum(t){return p.modSum(this.mods,t)}modBool(t){return p.modBool(this.mods,t)}hasMod(t){return p.hasModG(this.mods,t)}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){p.hasMod(this.mods,t)||this.addMod(t)}removeMod(t){const e=this.state.mods.filter(i=>i.granter===t);this.state.mods=this.state.mods.filter(i=>i.granter!==t),e.forEach(i=>{this.modEffectPropagator(i),i.type==="AR"&&(this.state.armorDmg=Math.max(0,this.state.armorDmg-i.value))})}removeModSafe(t){this.hasMod(t)&&this.removeMod(t)}expireMod(t){this.state.mods.splice(p.modIdx(this.state.mods,t),1)}bonusTotal(){let t=ht.sumNuggets(this.triggers);return this.state.actvBonus&&(t=ht.addNuggets(t,this.state.actvBonus)),t}endActivation(){this.modBool("EA")?this.removeMod(this.id):this.state.activationAvailable=!1,W.deathCheck(),S.actionDone()}move(t){this.state.lane=t,re.positionChange(this.owner),x.addEvents(O.creature("MOV",this))}addEffect(t,e){const i=p.effect(t,e);return this.effects.push(i),i}enforceEffects(t,e=!1){this.effects.filter(i=>i.watch===t).filter(i=>i.area==="A"||i.area==="C"&&this.owner===e).forEach(i=>L.getCard(i.logicCode).enforceEffect(i,this))}jr4(t,e=""){e===""&&(e=this.code);const i=p.trigger(t,e);return i.cardCode=this.code,i.creatId=this.id,this.triggers.push(i),i}removeTrigger(t){const e=p.trigIdx(this.triggers,t);e>-1?this.triggers.splice(e,1):console.error("Wery curious, could not find trigger to remove",t)}wipeAll(){this.state.mods=[],this.state.triggers=[],this.state.effects=[],this.state.hints=[],this.state.armor=0,this.state.mobility=0,this.state.poison=0,this.state.regen=0,this.state.aggressive=!1,this.state.defender=!1,this.state.breakthrough=!1,this.state.defender=!1,this.state.negateDefender=!1,this.state.negateArmor=!1,this.state.actvBonus=void 0,this.state.changed=!0,this.state.negateActivate=!0,f.creatByTarget(p.crTarg()).forEach(t=>{t.removeMod(this.id),t.enforceEffects("PS",this.owner)}),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),re.defenderChange(this.owner)}get hints(){return this.state.hints}aiHints(){return this.hints}}class p{static creatureState(t,e){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,actvBonus:void 0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:e,maxHealth:0,mobility:0,mobilityAvailable:!0,mods:[],negateActivate:!1,negateArmor:!1,negateDefender:!1,negateMobility:!1,negateRegen:!1,owner:t,poison:0,regen:0,sleeping:!0,status:"A",triggers:[]}}static effect(t,e){return{area:"A",watch:t,logicCode:e}}static freeCard(t){return{id:R.genId(),condition:p.target("TH"),sourceCard:t}}static mod(t,e,i=""){return{type:t,value:typeof e=="boolean"?e?1:0:e,granter:i,expiry:"NN"}}static trigger(t,e){return{id:R.genId(),type:t,logicCode:e,cardCode:"",creatId:"",customCode:"",interactive:!1,changes:!1,bonus:void 0}}static triggerReaction(t,e,i,s){return{event:t,owner:i,creatId:"",cardCode:"",trigger:e,host:s}}static basicAction(t){return{zone:"N",key:t,host:"",param:""}}static fieldSelectAction(t,e=-1,i=!0){return{zone:"F",key:t,playerA:i,lane:e,host:"",param:""}}static deckSelectAction(t,e,i){return{zone:"N",key:t,card:e,position:i,host:"",param:""}}static handSelectAction(t,e="",i="",s=-1){return{zone:"H",key:t,card:e,cost:i,position:s,host:"",param:""}}static playerSelectAction(t,e){return{zone:"P",key:t,playerA:e,host:"",param:""}}static draftSelectAction(t,e,i){return{zone:"N",key:t,index:e,pack:i,host:"",param:""}}static menuButtonAction(t){return{zone:"N",key:"MNBT",host:"",param:t}}static actionifier(t,e,i,s){const h=t;return h.key=e,h.host=i,h.param=s,h}static target(t){return{target:t,level:"LA",canLevel:!1,faction:"X",player:"X",card:"A",field:"A",creatStatus:"A",tribe:"AN",notMe:"",hasArmor:!1,canArmor:!1,hasDefender:!1,canDefender:!1,hasMobility:!1,canMove:!1,hasPoison:!1,hasRegen:!1,canRegen:!1,cardCode:"",victims:""}}static actionTarget(t,e,i,s){return p.actionifier(p.target(t),e,i,s)}static crTarg(){const t=p.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,e,i){return p.actionifier(p.crTarg(),t,e,i)}static crNotMeTarg(t){const e=p.target("TF");return e.field="O",e.creatStatus="V",e.notMe=t,e}static crNotMeActTarg(t,e,i,s){return p.actionifier(p.crNotMeTarg(e),t,i,s)}static crFriendTarg(){const t=p.crTarg();return t.player="F",t}static crFriendActTarg(t,e,i){return p.actionifier(p.crFriendTarg(),t,e,i)}static crFriendNotMeTarg(t){const e=p.crNotMeTarg(t);return e.player="F",e}static crFriendNotMeActTarg(t,e,i,s){return p.actionifier(p.crFriendNotMeTarg(e),t,i,s)}static crEnemyTarg(){const t=p.crTarg();return t.player="E",t}static crEnemyActTarg(t,e,i){return p.actionifier(p.crEnemyTarg(),t,e,i)}static playerTarg(t){const e=p.target("TP");return e.player=v.toTarget(t),e}static playerActTarg(t,e,i,s){return p.actionifier(p.playerTarg(t),e,i,s)}static lvlHandActTarg(t,e){const i=this.actionTarget("TH","CARD",t,e);return i.player="F",i.canLevel=!0,i.hint=["CD"],i}static emptyTarg(){const t=p.target("TF");return t.field="E",t}static emptyActTarg(t,e,i){return p.actionifier(p.emptyTarg(),t,e,i)}static emptyPlayerTarg(t){const e=p.emptyTarg();return e.player=v.toTarget(t),e}static emptyPlayerActTarg(t,e,i,s){return p.actionifier(p.emptyPlayerTarg(t),e,i,s)}static modSum(t,e){return t.filter(i=>i.type===e).map(i=>i.value).reduce((i,s)=>i+s,0)}static modBool(t,e){return t.some(i=>i.type===e&&i.value===1)}static hasModG(t,e){return t.findIndex(i=>i.granter===e)>-1}static hasMod(t,e){return p.modIdx(t,e)>-1}static modIdx(t,e){return t.findIndex(i=>i.granter===e.granter&&i.type===e.type)}static trigIdx(t,e){return t.findIndex(i=>i.id===e.id)}}class Dt{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return Dt.extractCardCode(this.code)}image(t){return this.type==="S"?this.fixedImage(t):this.leveledImage(t)}leveledImage(t){return this.rawImage(this.code,t)}fixedImage(t){return this.rawImage(this.cardCode(),t)}rawImage(t,e){return`card/${e?"b":"s"}/${this.faction}/${t}.jpg`}isFree=!1;level;maxLevel=3;minLevel=1;name="";overload=!1;rarity="T";spice;text="";get type(){return "C"}hints;addSp(t,e){}aiHints(){return this.hints??[]}canLevel(){return this.level{h+=s[g]*i[0][g],u+=s[g]*i[1][g]}),[h,u]}rawNug(t,e,i,s,h=0){return ht.rawNugget(t,e,i,s,h)}buffNug(t,e){return this.rawNug(0,e+t,t,0,0)}playerNug(t){return this.rawNug(0,0,0,t,0)}spawnNug(t){const e=ht.cardCreatValueFormula(t);return this.rawNug(1,e,t.iAttack,0,0)}statSpawnNug(t,e){const i=this.buffNug(t,e);return i.count=1,i}avgSpawnNug(t){const e=this.avgCreatureStats(t);return this.statSpawnNug(e[0],e[1])}regnNug(t){return this.rawNug(0,ht.calcCreatValueFormula(0,0,0,0,t,!1,0),0,0,0)}multNug(t,e){return t.attack*=e,t.value*=e,t.count*=e,t.pHealth*=e,t}static extractCardCode(t){return t.substring(0,3)}get boof123n(){return this.level*-1}get boof124(){return this.lValN([1,2,4])}get boof135(){return this.lValN([1,3,5])}get boof137(){return this.lValN([1,3,7])}get boof147(){return this.lValN([1,4,7])}get boof234(){return this.level+1}get boof235(){return this.lValN([2,3,5])}get boof236(){return this.lValN([2,3,6])}get boof246(){return this.level*2}get boof246n(){return this.level*-2}get boof247(){return this.lValN([2,4,7])}get boof247n(){return this.lValN([-2,-4,-7])}get boof248(){return this.lValN([2,4,8])}get boof258(){return this.lValN([2,5,8])}get boof2510(){return this.lValN([2,5,10])}get boof2612(){return this.lValN([2,6,12])}get boof357(){return this.lValN([3,5,7])}get boof358(){return this.lValN([3,5,8])}get boof359(){return this.lValN([3,5,9])}get boof3510(){return this.lValN([3,5,10])}get boof3612(){return this.lValN([3,6,12])}get boof369(){return this.level*3}get boof369n(){return this.level*-3}get boof3610(){return this.lValN([3,6,10])}get boof3711(){return this.lValN([3,7,11])}get boof3712(){return this.lValN([3,7,12])}get boof3713(){return this.lValN([3,7,13])}get boof3714(){return this.lValN([3,7,14])}get boof3814(){return this.lValN([3,8,14])}get boof3915(){return this.lValN([3,9,15])}get boof468(){return this.lValN([4,6,8])}get boof469(){return this.lValN([4,6,9])}get boof4610(){return this.lValN([4,6,10])}get boof4612(){return this.lValN([4,6,12])}get boof4710(){return this.lValN([4,7,10])}get boof4711(){return this.lValN([4,7,11])}get boof4712(){return this.lValN([4,7,12])}get boof4713(){return this.lValN([4,7,13])}get boof4714(){return this.lValN([4,7,14])}get boof4812(){return this.level*4}get boof4812n(){return this.level*-4}get boof4813(){return this.lValN([4,8,13])}get boof4814(){return this.lValN([4,8,14])}get boof4815(){return this.lValN([4,8,15])}get boof4816(){return this.lValN([4,8,16])}get boof4914(){return this.lValN([4,9,14])}get boof4915(){return this.lValN([4,9,15])}get boof579(){return this.lValN([5,7,9])}get boof5711(){return this.lValN([5,7,11])}get boof5714(){return this.lValN([5,7,14])}get boof5812(){return this.lValN([5,8,12])}get boof5813(){return this.lValN([5,8,13])}get boof5814(){return this.lValN([5,8,14])}get boof5815(){return this.lValN([5,8,15])}get boof5914(){return this.lValN([5,9,14])}get boof5915(){return this.lValN([5,9,15])}get boof5916(){return this.lValN([5,9,16])}get boof5917(){return this.lValN([5,9,17])}get boof51014(){return this.lValN([5,10,14])}get boof51015(){return this.level*5}get boof51020(){return this.lValN([5,10,20])}get boof6812(){return this.lValN([6,8,12])}get boof6814(){return this.lValN([6,8,14])}get boof6912(){return this.lValN([6,9,12])}get boof6914(){return this.lValN([6,9,14])}get boof6915(){return this.lValN([6,9,15])}get boof6916(){return this.lValN([6,9,16])}get boof61014(){return this.lValN([6,10,14])}get boof61015(){return this.lValN([6,10,15])}get boof61016(){return this.lValN([6,10,16])}get boof61017(){return this.lValN([6,10,17])}get boof61018(){return this.lValN([6,10,18])}get boof61117(){return this.lValN([6,11,17])}get boof61218(){return this.lValN([6,12,18])}get boof61224(){return this.lValN([6,12,24])}get boof7911(){return this.lValN([7,9,11])}get boof7914(){return this.lValN([7,9,14])}get boof71013(){return this.lValN([7,10,13])}get boof71014(){return this.lValN([7,10,14])}get boof71015(){return this.lValN([7,10,15])}get boof71116(){return this.lValN([7,11,16])}get boof71117(){return this.lValN([7,11,17])}get boof71118(){return this.lValN([7,11,18])}get boof81116(){return this.lValN([8,11,16])}get boof81117(){return this.lValN([8,11,17])}get boof81217(){return this.lValN([8,12,17])}get boof81220(){return this.lValN([8,12,20])}get boof81318(){return this.lValN([8,13,18])}get boof91420(){return this.lValN([9,14,20])}get boof91421(){return this.lValN([9,14,21])}get boof101520(){return this.lValN([10,15,20])}get boof255080(){return this.lValN([25,50,80])}}class M extends Dt{constructor(t){super(t)}iHealth=0;iAttack=0;iAggro=!1;iArmor=0;iBT=!1;iDefend=!1;iMobile=0;iRegen=0;tribe=[];isTribe(t){return(Array.isArray(t)?t:[t]).every(i=>this.tribe.includes(i))}jr3(t,e){const i=p.creatureState(t,e);return i.id=R.genId(),i.code=this.code,i.health=this.iHealth,i.attack=this.iAttack,i.maxHealth=i.health,i.regen=this.iRegen,i.breakthrough=this.iBT,i.defender=this.iDefend,i.aggressive=this.iAggro,i.armor=this.iArmor,i.mobility=this.iMobile,i.hints=this.aiHints(),i.actvBonus=this.bonus?.activ8,new Ce(i)}playTargets(){const t=super.playTargets(),e=p.actionTarget("TF","FORG",this.code,"");return e.player="F",t.push(e),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}addExtraActivate(t){const e=p.mod("EA",!0,t.id);e.expiry="ET",t.addMod(e)}}class kt extends Dt{constructor(t){super(t)}get type(){return "S"}logSpell(t=void 0,e=void 0){let i=m.new().txt("Casted ").crd(this.code);t&&(i=i.txt(" on ").crd(t.code),e&&(i=i.txt(" and ").crd(e.code))),i.txt(".").go()}}class te{paStats;pbStats;constructor(t,e){this.paStats=t,this.pbStats=e}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const e=this.playerStats(t),i=this.playerStats(!t);return te.deltafier(e,i)}static deltafier(t,e){const i=te.blankStats(!0);return i.creatCount=t.creatCount-e.creatCount,i.creatValue=t.creatValue-e.creatValue,i.threatValue=t.threatValue-e.threatValue,i.playerHealth=t.playerHealth-e.playerHealth,i.bonus=t.bonus-e.bonus,i}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0,bonus:0}}}class ht{static dcWeight=.4;fromState(){const t=f.qActiveCreats(),i=[!0,!1].map(s=>{const h=te.blankStats(s),u=v.toPlayer(s);h.playerHealth=ht.playerFormula(u.health,v.totalArmor(u),v.totalPoison(u));const g=ht.sumNuggets(u.triggers);return h.playerHealth+=g.pHealth,h.creatCount=g.count,h.creatValue=g.value,h.threatValue=g.attack,h.bonus=g.bonus,t.filter(y=>y.owner===s).forEach(y=>{const C=y.bonusTotal();h.playerHealth+=C.pHealth,h.bonus+=C.bonus,h.creatCount+=1+C.count,h.creatValue+=ht.creatValueFormula(y)+C.value,h.threatValue+=ht.threatFormula(y,t)+C.attack}),h});return new te(i[0],i[1])}static ddp9(t,e,i,s,h=0){return ht.ddp9Nugget(t,e,i,s,h)[0]}static ddp9Nugget(t,e,i,s,h=0){const u=t/4,g=e/10,y=i/12,C=s/8;return[u+g+y+C+h,u,g,y,C,h]}static creatValueFormula(t){return ht.calcCreatValueFormula(t.attack,t.health,t.armor,t.mobility,t.regen,t.breakthrough,t.poison)}static cardCreatValueFormula(t){return ht.calcCreatValueFormula(t.iAttack,t.iHealth,t.iArmor,t.iMobile,t.iRegen,t.iBT,0)}static calcCreatValueFormula(t,e,i,s,h,u,g){const y=u?1:0;return e+Math.max(0,t)+(i+Math.min(s,3)+y+h-g)*1.5}static playerFormula(t,e,i){return t+(i-e)*2}static threatFormula(t,e){let i=0,s=0;if(t.defender)i=t.attack;else{const h=e.find(u=>u.owner!==t.owner&&u.lane===6-t.lane);h?(t.breakthrough&&(s=Math.max(t.attack-h.health,0)),i=t.attack-s):s=t.attack,s>0&&(s+=ht.scalingBonus(s))}return Math.max(i,0)+Math.max(s,0)}static rawNugget(t,e,i,s,h=0){return{count:t,value:e,attack:i,pHealth:s,bonus:h}}static addNuggets(t,e){return ht.rawNugget(t.count+e.count,t.value+e.value,t.attack+e.attack,t.pHealth+e.pHealth,t.bonus+e.bonus)}static sumNuggets(t){let e=ht.rawNugget(0,0,0,0,0);return t.forEach(i=>{i.bonus&&(e=ht.addNuggets(e,i.bonus))}),e}static scalingBonus(t){let e=7;if(t<=e)return 0;let i=!0,s=0,h=1;const u=7;for(;i;)t>e+u?(s+=h*u,e+=u,h++):(s+=h*(t-e),i=!1);return s}weighState(t,e,i){const s=t.deltaStats(i),h=e.deltaStats(i),u=te.deltafier(h,s),g=u.playerHealth<0?-1:1,y=ht.scalingBonus(u.playerHealth*g)*g+u.playerHealth;return ht.ddp9Nugget(u.creatCount,u.creatValue,u.threatValue,y,u.bonus)[0]}}class Ti{aiPlayer;constructor(t){this.aiPlayer=t}jr7(t,e=3){return`${t}${e}`}jr6(t,e){const i=T.randInt(0,e.length),s=e[i];return e.splice(i,1),f.birth(t,"F",this.aiPlayer,s)}cheatin(){const t=v.toPlayer(this.aiPlayer),e=v.toPlayer(!this.aiPlayer),i=e.health-t.health;let s=0;i>85?s=3:i>65?s=2:i>45&&(s=1);const h=f.emptyLanes(this.aiPlayer);if(s===0||h.length===0)return!1;m.new().plr(this.aiPlayer).txt(" is a cheaty cheaterton.").go();let u=0;if(s===1){if(E.regularPlays-=1,u=T.randInt(0,13),u===0)this.jr6(this.jr7("HTR"),h);else if(u===1)this.jr6(this.jr7("AGM"),h).addRegen(8);else if(u===2){const g=this.jr6(this.jr7("YNS"),h);g.buff(0,15),g.addRegen(4)}else if(u===3)this.jr6(this.jr7("TBA"),h);else if(u===4)this.jr6(this.jr7("DCS"),h);else if(u===5)this.jr6(this.jr7("GGP"),h).addRegen(8);else if(u===6){const g=this.jr6(this.jr7("WFM"),h);g.aggressive=!0}else if(u===7){const g=this.jr6(this.jr7("FFU"),h);g.aggressive=!0}else if(u===8){const g=this.jr6(this.jr7("URB"),h);g.aggressive=!0}else if(u===9){const g=this.jr6(this.jr7("KOD"),h);g.aggressive=!0,g.addRegen(6)}else if(u===10)this.jr6(this.jr7("AGK"),h).addArmor(3);else if(u===11){const g=this.jr6(this.jr7("PSC"),h);g.aggressive=!0}else if(u===12){const g=this.jr6(this.jr7("SAD"),h);g.aggressive=!0}}else if(s===2)if(E.regularPlays-=1,u=T.randInt(0,17),u===0){const g=this.jr6(this.jr7("NDR"),h);g.aggressive=!0}else if(u===1){const g=this.jr6(this.jr7("CSW"),h);g.aggressive=!0}else if(u===2)this.jr6(this.jr7("GGD"),h).addRegen(6);else if(u===3)this.jr6(this.jr7("EFP"),h);else if(u===4)this.jr6(this.jr7("ZTU"),h);else if(u===5){const g=this.jr6(this.jr7("DDD"),h);g.aggressive=!0}else if(u===6)this.jr6(this.jr7("RBH"),h).addRegen(8);else if(u===7)this.jr6(this.jr7("SFT"),h);else if(u===8)this.jr6(this.jr7("GTT"),h);else if(u===9)this.jr6(this.jr7("SMD"),h);else if(h.length===5)this.jr6(this.jr7("DFB"),h),[1,2,3,4].forEach(g=>this.jr6(this.jr7("XHS"),h));else if(h.length===4)this.jr6(this.jr7("LMV"),h);else if(h.length===3)this.jr6(this.jr7("LHY"),h),this.jr6(this.jr7("SVH"),h),this.jr6(this.jr7("DBA"),h);else if(h.length===2)this.jr6(this.jr7("UTR"),h),this.jr6(this.jr7("TDS"),h);else if(t.turn===4)this.jr6(this.jr7("SSR"),h);else if(t.turn===1)this.jr6(this.jr7("ESK"),h);else{const g=this.jr6(this.jr7("XSH"),h);g.aggressive=!0}else if(s===3)if(u=T.randInt(0,20),u===0){const g=this.jr6(this.jr7("IHA",4),h);g.aggressive=!0}else if(u===1)this.jr6(this.jr7("CHR"),h);else if(u===2)this.jr6(this.jr7("FGO",1),h);else if(u===3)this.jr6(this.jr7("CHV",4),h);else if(u===4)this.jr6(this.jr7("KKK",4),h);else if(t.health<20){const g=this.jr6(this.jr7("ODC",4),h);g.aggressive=!0}else if(h.length===5){const g=T.randInt(0,4);if(g===0)[1,2,3,4,5].forEach(y=>this.jr6(this.jr7("UWL",2),h));else if(g===1)[1,2].forEach(y=>this.jr6(this.jr7("DFB"),h)),[1,2,3].forEach(y=>this.jr6(this.jr7("FFD"),h));else if(g===2)[1,2,3,4,5].forEach(y=>this.jr6(this.jr7("BWK"),h));else if(g===3){this.jr6(this.jr7("SBG"),h),this.jr6(this.jr7("EWE"),h);const y=this.jr6(this.jr7("BMY"),h);y.defender=!0,y.aggressive=!0}}else if(e.health>350)t.health<180&&v.heal(t,180-t.health),this.jr6(this.jr7("AGD"),h);else if(e.health>250)this.jr6(this.jr7("FGO"),h);else if(h.length===4){const g=T.randInt(0,3);g===0?(this.jr6(this.jr7("AGK"),h),[1,2,3].forEach(y=>this.jr6(this.jr7("VBK"),h))):g===1?(this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("UTR"),h)):g===2&&[1,2,3,4].forEach(y=>this.jr6(this.jr7("CDC"),h))}else if(h.length===3)if(T.randInt(0,2)){this.jr6(this.jr7("SDR"),h),this.jr6(this.jr7("SDR"),h);const g=this.jr6(this.jr7("UPM"),h);g.aggressive=!0}else{this.jr6(this.jr7("SDL"),h);const g=this.jr6(this.jr7("NFF"),h);g.aggressive=!0}else if(h.length===2)this.jr6(this.jr7("SPM"),h),this.jr6(this.jr7("SPM"),h);else{const g=this.jr6(this.jr7("NXC"),h);g.buff(10,0),g.aggressive=!0,g.addMobility(2),g.addRegen(5)}return t.health<30&&v.heal(t,50-t.health),!0}}var it=(n=>(n[n.Left=0]="Left",n[n.Both=1]="Both",n[n.Right=2]="Right",n[n.ForceRight=3]="ForceRight",n))(it||{});class Ve{action;hitTest(t,e,i){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,e,i,s){let h,u=0;const g=t.length;for(;h===void 0&&u=t&&this.originY<=e&&this.endY>=e?this.action:void 0}}class $t extends dt{constructor(t,e,i,s,h=0){super({zone:"N",key:"BNDL",host:"",param:""},t,e,i,s,h)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,e,i){if(super.hitTest(t,e,i))return Ve.arrayHit(this.childs,t,e,i)}}class Si{guts="";txt(t){return at.simOn||(this.guts+=t),this}plr(t){if(!at.simOn){const e=v.toBool(t);this.guts+="^p"+(e?"a":"b")}return this}crd(t){return at.simOn||(this.guts+="^c"+t),this}go(){at.simOn||m.parse(this)}}class De{realPromise;resolveMe(t){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,e)=>{this.resolveMe=t,this.rejectMe=e})}}const We=25,ii=9999,Ci=-9999,wi=-999999,Di=["CANC","DEET","SCRH"],xi=["HPLY","ACTV","MOVE"];class Bi{log=!1;simOn=!1;dumb=!1;inPhase=!0;promStack=[];peekStack=[];peeking=!1;slowpoke=0;endCount=0;aiPlayer=!1;brdEval;rootBoardStats;turnSims=0;turnTime=0;kickOut=!1;kickTimer=0;constructor(){this.brdEval=new ht,this.rootBoardStats=new te(te.blankStats(!0),te.blankStats(!1))}setLog(t){this.log=t}lNum(t){return t<-899999?"NUNS":t<-8999?"LOSS":t>8888?"KILL":t.toFixed(1)}popProm(t){this.promStack.pop().resolveMe(t)}popPeeker(t){this.peekStack.pop().resolveMe(t)}hitMainPhase(){this.dumb&&this.simOn&&this.inPhase&&E.mainBattle&&(this.inPhase=!1)}simEndpoint(t){if(this.endCount++,this.promStack.length===0)m.debug("Tried to end a sim, but no promise to unlock."),console.trace();else{let e;if(t==="T"){const i=this.brdEval.fromState();e=this.brdEval.weighState(this.rootBoardStats,i,this.aiPlayer)}else t==="W"?e=ii:t==="L"?e=Ci:e=wi;this.popProm(e)}}async processAction(t,e,i=!1){const s=!this.simOn;let h=0,u,g=this.actionPruner(t);if(this.peeking){this.popPeeker(g);return}if(s&&this.dumb&&e&&(this.dumb=!1,m.debug("Smart Again.",!1)),this.dumb&&!this.inPhase){let B=g.filter($=>$.key==="FITE"||$.key==="ENDT");B.length>0&&(g=B)}if(s){g=this.noHandDoubles(g),u=new Ae,u.hwhipe();const B=g.map((ot,At)=>u.drawAiGear(At,!1));await Promise.all(B),await new Ie().drawActions([]),await T.sleep(We),this.kickOut=!1,this.simOn=!0,this.slowpoke=Date.now(),this.rootBoardStats=this.brdEval.fromState(),this.endCount=0;const Y=await this.peeker(g),J=[];let ut=0,U=0,nt=[];Y.forEach(ot=>{ut+=ot.peek.length,ot.free&&(ot.free==="FREE"?U++:nt.includes(ot.free)||(U++,nt.push(ot.free))),ot.wasPeek&&ot.peek.some(At=>this.hasHint(At,"DF"))&&J.push(ot.root)}),J.length>0?(g=J,this.dumb=!0,m.debug("Do firsts; dumb mode. Action count "+g.length,!1)):i?(this.dumb=!0,m.debug("Forced dumb mode.",!1)):E.regularPlays+U>3?(this.dumb=!0,m.debug("4+ plays; dumb mode. Peek was "+ut,!1)):v.getActive().hand.length>7?(this.dumb=!0,m.debug("8+ in hand; dumb mode. Peek was "+ut,!1)):ut>29&&T.options.debug&&this.peekerReport(Y)}if(g.length===0){s&&(console.error("Root eval set consisted of 0 valid actions"),m.debug("!! Zero Action Root !!")),this.simEndpoint("D");return}let y=-99999;const C=[];if(g.length===1&&s)C.push({a:g[0],weight:99});else{ue.saveState();for(let B=0;B4e4&&(this.kickOut=!0),J+=this.hintWeight($),J>y&&(y=J),ue.restoreState(),s&&(C.push({a:$,weight:J}),await u.drawAiGear(B,!0),h++,await T.sleep(We))}ue.popState()}if(s)if(this.simOn=!1,this.kickOut){const B="🤖: High complexity encountered. Recombobulating.";m.new().txt(B).go(),this.processAction(t,e,!0)}else{const B=y-.4;let $=C.filter(nt=>nt.weight>B);$.length>1&&$.findIndex(nt=>nt.a.key==="ENDT")>-1&&($=$.filter(nt=>nt.a.key!=="ENDT"));let Y;if(B>ii-100){const nt=$.find(ot=>ot.a.key==="FITE");nt?Y=nt.a:Y=$[T.randInt(0,$.length)].a}else Y=$[T.randInt(0,$.length)].a;const J=Date.now()-this.slowpoke,ut=Math.max(1,350-J),U=J-We*h;this.turnSims+=this.endCount,this.turnTime+=U,T.options.debug&&Y.key==="HPLY"&&(m.debug("!! Hand Choices !!"),C.forEach(nt=>{nt.a.key==="HPLY"&&m.new().crd(nt.a.card).txt(" : "+this.lNum(nt.weight)).go()}),m.debug("!! ~~~~~~~ !!")),T.sleep(ut).then(()=>{S.handleAction(Y)})}else this.popProm(y)}actionPruner(t){let e=t.filter(i=>Di.indexOf(i.key)===-1);return E.mainBattle?e=e.filter(i=>i.key!=="HDSC"):e=e.filter(i=>!this.hasHint(i,"BB")),e=e.filter(i=>{if(this.hasHint(i,"HR")){if(i.zone==="P")return i.playerA!==this.aiPlayer;{const s=i,h=f.ddf6(s);if(h.owner===this.aiPlayer){const u=h.aiHints();return u.includes("MC")||u.includes("LZ")}else return!0}}else return!0}),e=e.filter(i=>{if(this.hasHint(i,"KL")){const s=i,h=f.ddf6(s);if(h.owner===this.aiPlayer){const u=h.aiHints();return u.includes("ST")||u.includes("LZ")}else return!0}else return!0}),e=e.filter(i=>this.hasHint(i,"BF")?i.playerA===this.aiPlayer:!0),e=e.filter(i=>this.hasHint(i,"DB")?i.playerA!==this.aiPlayer:!0),e=e.filter(i=>{if(this.hasHint(i,"PN")){if(i.zone==="P")return i.playerA!==this.aiPlayer;{const s=i,h=f.ddf6(s);return h.owner===this.aiPlayer?h.aiHints().includes("MC"):!0}}else return!0}),e=e.filter(i=>{const s=i.key==="FORG";if(s||this.hasHint(i,"FL")){const h=i,u=f.searchByFSA(h);return u&&(E.mainBattle?E.newPre:E.newPost).includes(u.id)?u.aiHints().includes("RT")?!0:s?L.getCard(h.host).aiHints().includes("RD"):!1:!0}else return!0}),e}noHandDoubles(t){const e=[],i=[],s=[];return t.forEach(h=>{h.key==="HPLY"?e.push(h):i.push(h)}),e.forEach(h=>{const u=h.card;s.includes(u)||(s.push(u),i.push(h))}),i}async peeker(t){this.peeking=!0;const e=[],i=[];t.forEach(s=>{xi.includes(s.key)?i.push(s):e.push({root:s,peek:[s],wasPeek:!1,free:""})}),ue.saveState();for(let s=0;s0){let y="";if(h.key==="HPLY"){const C=h;C.cost!==""&&(y=C.cost)}e.push({root:h,peek:g,wasPeek:!0,free:y})}ue.restoreState()}return ue.popState(),this.peeking=!1,e}peekerReport(t){let e=0,i=0,s=0,h=[],u=[];t.forEach(g=>{const y=g.peek.length;if(y>0){const C=g.root.key;if(C==="HPLY")if(g.peek[0].key==="FORG")i+=y;else{const B=m.fastName(g.root.card)+": "+y;h.push(B)}else if(C==="MOVE")s+=y;else if(C==="ACTV"){const B=m.fastName(g.root.host)+": "+y;u.push(B)}else e+=y}}),m.debug("High complexity hit: Root: "+t.length),i>0&&m.debug("Forges: "+i),s>0&&m.debug("Mobility: "+s),h.forEach(g=>m.debug(g)),u.forEach(g=>m.debug(g)),e>0&&m.debug("Other: "+e)}hintWeight(t){let e=!1,i=!1,s="",h=0;if(t.key==="HDSC"?(s=t.host,i=!0):this.hasHint(t,"CD")?s=t.card:t.key==="HPLY"&&(s=t.card,e=!0),s){const u=L.getCard(s);h+=this.levelBonusFormula(u,!e,i),e&&(h+=this.hintAdjuster(u))}return h}levelBonusFormula(t,e,i){let s=0;const h=t.aiHints();return h.includes("LG")?(s+=1,h.includes("LM")&&(s+=.8)):h.includes("LB")?s-=1.3:e&&(s+=.4),i&&s>0&&(s=s/2.5),s}hintAdjuster(t){let e=0;const s=t.aiHints().find(h=>h.startsWith("ZZ"));return s&&(e=.5*parseInt(s.slice(2))),e}hasHint(t,e){return!t.hint||t.hint.length===0?!1:t.hint.includes(e)}logStats(t,e){const s=["Crt Cnt","Crt Val","Threat","P Health"].map((h,u)=>`${h}: ${this.numNum(e[u])}`).join(", ");console.log(t+s)}numNum(t){return t.length>6?t.charAt(0)==="-"?"NUNS":"KILL":t.padEnd(4)}cheater(){return R.aiMode&&R.aiActive&&T.options.cheater?new Ti(this.aiPlayer).cheatin():!1}peekAllCards(){const t=v.toPlayer(this.aiPlayer),e=t.deck.concat(t.hand,t.discard).sort();console.log(e.map(i=>m.fastName(i)).join(` -`))}peekDecks(){const t=v.toPlayer(!1),e=t.deck.map(u=>m.fastName(u)).sort(),i=t.hand.map(u=>m.fastName(u)).sort(),s=t.discard.map(u=>m.fastName(u)).sort(),h=["-- Deck --"].concat(e,"-- Hand --",i,"-- Discard --",s);console.log(h.join(` -`))}}const at=new Bi;class Hi{getState(){const t={cCrd:this.currPlayCard,cCst:this.currPlayCost,cPos:this.currPlayPos,aa:this.actionHistory};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.currPlayCard=e.cCrd,this.currPlayCost=e.cCst,this.currPlayPos=e.cPos,this.actionHistory=e.aa}handleAction(t){if(t.key==="DEET"){jt.init(t.param);return}if(t.key==="HPLY"){this.playCardSelect(t);return}if(t.key==="FORG"){E.forgeCard(t,this.currPlayCard,this.currPlayCost,this.currPlayPos);return}if(t.key==="FITE"){li.fight(t.param==="M");return}if(t.key==="ENDT"){E.endTurn();return}if(t.key==="MOVE"){this.mobilitySelect(t);return}if(t.key==="MEND"){E.mobility(t);return}if(t.key==="HDSC"){this.currPlayCost="",E.cardPlayed(this.currPlayCard,this.currPlayCost,this.currPlayPos,!0),this.actionDone();return}if(t.key==="ACTV"){const e=f.jr5(t.param);L.getCard(e.code).startActivation(e);return}if(t.key==="NOTR"){t.param==="PM"&&bt.popMode(),this.actionDone(!0);return}if(t.key==="CARD"){L.getCard(t.host).handleAction(t);return}if(t.key==="CANC"||t.key==="CNCL"){t.param==="PM"&&bt.popMode(),this.actionHistory.pop(),this.ddf5();return}if(t.key==="USWP"){bt.popMode(),Lt.whatNext();return}if(t.key==="DTUP"){jt.updateDetails(t),gt.drawAll();return}if(t.key==="VWDK"){Ft.handleShowDeck(t);return}if(t.key==="SCRK"){Ft.handleDeckScroll(t);return}if(t.key==="SCRH"){t.param==="R"?R.ui.handScrollLeft+=1:R.ui.handScrollLeft-=1,gt.drawAll();return}if(t.key==="DRFT"){pt.resumeDraft(t.param);return}if(t.key==="SCRD"){pt.paginate(t.param==="D"),gt.drawAll();return}if(t.key==="UIBT"){Xe.handleUIButton(t);return}if(t.key==="MENU"){Xe.handleMainMenuButton(t);return}if(t.key==="MNBT"){Xe.handleMenuButton(t);return}if(t.key==="DSET"){this.ddf5(Pt.generateDeckPickerActions(parseInt(t.param)));return}if(t.key==="DECK"){Pt.handleDeckPick(t);return}if(t.key==="DBUG"){T.toggleDebug();return}}ddf5(t,e=!1){let i;if(t){const s=this.generateDetailActions();i=t.concat(s),this.actionHistory.push(i)}else i=this.actionHistory[this.actionHistory.length-1];R.aiActive?at.processAction(i,e):gt.drawAll()}currPlayCard="";currPlayCost="";currPlayPos=-1;shiftPlayCard(t){t0&&e.canLevel()&&i.push(D.buttonTarget("HDSC",t.card));const s=D.toActions(i);return s.push(p.handSelectAction("CANC",t.card,"",t.position)),s}mobilitySelect(t){const e=this.getMoveCardActions(t);this.ddf5(e)}getMoveCardActions(t){if(t.key!=="MOVE")throw new Error("Unexpected action passed to getMoveCardActions: "+t.key);const e=f.ddf6(t);let i=[];if(t.param==="ACTV"){const s=p.actionTarget("TB","ACTV",e.code,e.id);i=D.toActions(s)}return i.push(p.fieldSelectAction("CANC",t.lane,t.playerA)),f.canMove(e).map(s=>{const h=p.fieldSelectAction("MEND",s,t.playerA);return h.param=e.id,h}).concat(i)}noneEndTrigger(){return D.toActions(D.buttonTarget("NOTR"))[0]}cancelAction(){return D.toActions(D.buttonTarget("CANC"))[0]}emptyAdjacents(t,e){const i=e||t.id,s=p.emptyPlayerActTarg("F","CARD",t.code,i);return s.lanes=t.adjacent,D.toActions(s)}generateDetailActions(){const t=bt.mode;if(R.aiActive)return[];if(t==="G"){const e=v.getLocal().hand.map((s,h)=>{const u=p.handSelectAction("DEET",s,"",h);return u.param=s,u}),i=f.qActiveCreats().map(s=>{const h=p.fieldSelectAction("DEET",s.lane,s.owner);return h.param=s.code,h});return e.concat(i)}else if(t==="D"){const e=pt.currentPack.map((s,h)=>{const u=p.draftSelectAction("DEET",h,!0);return u.param=`${s}1`,u}),i=pt.picksAsDeck.map((s,h)=>{const u=p.draftSelectAction("DEET",h,!1);return u.param=`${s.card}1`,u});return e.concat(i)}return[]}}const S=new Hi;class Ni{type="N0";events=[];triggerActions=[];deathCheck=!0;iaTrigLane=0;getState(){const t={type:this.type,events:this.events,tA:this.triggerActions,dC:this.deathCheck,tL:this.iaTrigLane};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.type=e.type,this.events=e.events,this.triggerActions=e.tA,this.deathCheck=e.dC,this.iaTrigLane=e.tL}startBatch(){this.deathCheck=!1,this.type==="C0"?this.type="C1":this.type==="C1"?this.type="C2":this.type==="C2"&&(this.type="N0");const t=this.type;let e;if(t==="N0")e=this.events.slice(),this.events=[];else{const s=this.events.filter(u=>u.code==="DIE"),h=this.events.filter(u=>u.code!=="DIE");t==="C1"?(e=h,this.events=s):(e=s,this.events=h)}const i=this.generateTriggers(e);this.triggerActions=this.sortTriggers(i),Lt.whatNext()}generateTriggers(t){let e;const i=t.map(s=>{s.code==="TRS"&&(e=s);const h=f.field.map(g=>g.triggers.map(y=>{const C=p.triggerReaction(s,y,g.owner,"C");return C.creatId=g.id,C.cardCode=g.code,C}).filter(y=>qe.ddf8(y))).flat(),u=[!0,!1].map(g=>v.toPlayer(g).triggers.map(C=>p.triggerReaction(s,C,g,"P")).filter(C=>qe.ddf8(C))).flat();return h.concat(u)}).flat();return e&&this.handleTurnStart(e),i}sortTriggers(t){const e=v.getActiveB(),i=t.filter(u=>!u.trigger.interactive&&u.owner===e),s=t.filter(u=>!u.trigger.interactive&&u.owner!==e);return t.filter(u=>u.trigger.interactive&&u.owner===e).concat(s,i)}handleTurnStart(t){const e=v.getActiveB();f.qPlayerCreats(e).filter(s=>s.sleeping).forEach(s=>{s.sleeping=!1});const i=R.tick();f.qActiveCreats().forEach(s=>{s.owner===t.playerA&&(s.activationAvailable=!0,s.mobilityAvailable=!0,s.sleeping=!1),s.armorDmg=0,s.poison>0&&s.hurtDirect(s.poison,"POIS",i),s.regen>0&&s.heal(s.regen),W.deathProdder(s,i)}),[v.playerA,v.playerB].forEach(s=>{s.armorDmg=0;const h=v.totalPoison(s);h>0&&v.hurtDirect(s,h,"POIS")})}getNextTrigger(){const t=this.triggerActions;if(t.length!==0)return t[t.length-1]}triggerDone(){this.triggerActions.length===0?console.error("batch.triggerDone() was called when there is no trigger actions"):(this.triggerActions.pop(),this.iaTrigLane=0),Lt.whatNext()}addEvents(...t){this.events.push(...t)}}const x=new Ni;class Fi{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new ci(t)}get(t){return this.registry[t]}}const et=new Fi;class Pi extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Abraxas, Avatar of Kadras",this.iAttack=this.boof4712,this.iHealth=this.lValN([7,11,21]),this.tribe.push("HY");const e=this.lValS(["Give an adjacent creature","Each adjacent creature gets","Each other friendly creature gets"]);this.text=`Activate: ${e} 2x attack this turn.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}targ(t){const e=p.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(e.lanes=t.adjacent),e}canActivate(t){return f.creatByTarget(this.targ(t)).length>0}startActivation(t){let e;this.level===1?e=this.targ(t):(e=D.boardTarget("CARD",this.code),e.param=t.id),e.hint=["BB"],S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){const e=f.jr5(t.param);if(t.zone==="F"){const i=f.ddf6(t);this.logAct(!0,i),this.applyMod(i,e.id)}else{this.logAct(!0);const i=this.targ(e);f.creatByTarget(i).forEach(s=>{this.applyMod(s,e.id)})}e.endActivation()}applyMod(t,e){const i=p.mod("AT",t.attack,e);i.expiry="ET",t.addMod(i)}}class Mi extends M{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Abyssal Brute",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.text=`When ${this.name} or another friendly creature enters a side lane, that creature gets ${m.jr9(this.level,this.level,!0)} and Regenerate ${this.level}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("EF");s.bonus=this.buffNug(this.level,this.level);const h=i.jr4("MV");return h.bonus=this.regnNug(this.level),i}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const e=O.toCreature(t.event),i=e.creature.lane;return(i===1||i===5)&&e.creature.owner===t.owner}return!1}jr8(t){const e=O.toCreature(t.event);e.creature.buff(this.level,this.level),e.creature.addRegen(this.level),x.triggerDone()}}class Ri extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Ambriel Archangel",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.iAttack+1,this.tribe.push("AG");const e=this.boof101520;this.text=`While ${this.name} is your only friendly creature, you get Armor ${e}, and this gets Armor ${this.level+1} and Mobility 1.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){const i=e.status==="A",s=p.crNotMeTarg(e.id);s.player=v.toTarget(e.owner);const h=f.creatByTarget(s);if(i&&h.length===0){const u=p.mod("AR",this.boof101520,e.id);v.addModSafe(e.owner,u);const g=p.mod("AR",this.level+1,e.id),y=p.mod("MB",1,e.id);e.addModSafe(g),e.addModSafe(y)}else v.removeModSafe(e.owner,e.id),e.removeModSafe(e.id)}}class xe extends M{lookup(t){return{["LLD"]:{c:()=>this.demC(),t:i=>this.demT(i)},["LLG"]:{c:()=>this.golC(),t:i=>this.golT(i)},["LLS"]:{c:()=>this.senC(),t:i=>this.senT(i)},["LLT"]:{c:()=>this.tyrC(),t:i=>this.tyrT(i)}}[t]}testAmbush(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}ddf8(t){return!at.simOn&&this.testAmbush(this.cardCode(),t)}jr8(t){const e=this.cardCode(),i=v.toPlayer(t.owner),s=i.hand.length;for(let h=s-1;h>-1;h--){const u=i.hand[h];u.startsWith(e)&&(m.new().crd(u).txt(" Ambushed.").go(),f.birth(u,"S",i.isPlayerA),E.levelAndDiscard(u,h,!1,"E"))}x.triggerDone()}ambT(){return`Spawn a ${this.name}. Then discard ${this.level===3?"":"and level up "} ${this.name}.`}demC(){this.faction="N",this.rarity="H",this.name="Leyline Demon",this.iAttack=this.lValN([3,9,14]),this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.text="Ambush: When the enemy player plays a card, if it is their third card played that turn, "+this.ambT()}demT(t){if(t.event.code==="PLC"){const e=t.event;return t.owner!==e.playerA&&E.cardsPlayed===3}else return!1}golC(){this.faction="U",this.rarity="H",this.name="Leyline Golem",this.iAttack=this.lValN([5,12,18]),this.iHealth=this.iAttack-(this.level+1),this.tribe.push("GL"),this.text="Ambush: When an enemy creature moves on the enemy player's turn, "+this.ambT()}golT(t){if(t.event.code==="MOV"){const e=O.toCreature(t.event);return t.owner!==e.creature.owner&&v.getActiveB()===e.creature.owner}else return!1}senC(){this.faction="A",this.rarity="H",this.name="Leyline Sentry",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.iAttack+this.level+5,this.tribe.push("RB"),this.text="Ambush: When an enemy creature enters play on the enemy player's turn, if it wasn't Forged, "+this.ambT()}senT(t){if(t.event.code==="ENT"){const e=O.toEnterField(t.event);return t.owner!==e.creature.owner&&v.getActiveB()===e.creature.owner&&!e.forged}else return!1}tyrC(){this.faction="T",this.rarity="H",this.name="Leyline Tyrant",this.iAttack=this.lValN([6,12,17]),this.iHealth=this.iAttack-2,this.tribe.push("GT"),this.text="Ambush: When an enemy player gains health on their turn, "+this.ambT()}tyrT(t){if(t.event.code==="PHL"){const e=t.event;return t.owner!==e.playerA&&v.getActiveB()===e.playerA}else return!1}}class Ei extends M{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Apocrymancer",this.iAttack=this.boof3713,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.text="When you play an Alloyin spell, you may discard and level up a card."}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.bonus=this.rawNug(0,0,0,0,.5),s.interactive=!0,i}handleAction(t){E.levelAndDiscardA(t),S.actionDone(!0)}ddf8(t){if(t.event.code==="PLC"){const e=t.event;if(e.playerA===t.owner){const i=L.getCard(e.cardCode);if(i.type==="S"&&i.faction==="A")return!0}}return!1}jr8(t){const e=p.lvlHandActTarg(this.code,t.creatId);S.ddf5(D.toActions([e,D.buttonTarget("NOTR")]))}}class Ii extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Arboris, Grove Dragon",this.iAttack=this.lValN([5,9,20]),this.iHealth=this.iAttack,this.tribe.push("DG");const e=this.boof;this.text=`While you have over 120 health, Arboris gets ${m.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e);return i.addEffect("PH",this.code),i}enforceEffect(t,e){if(v.toPlayer(e.owner).health>120&&e.status==="A"){const s=this.boof;e.addModSafe(p.mod("HL",s,e.id)),e.addModSafe(p.mod("MH",s,e.id)),e.addModSafe(p.mod("AT",s,e.id))}else e.removeModSafe(e.id)}get boof(){return this.lValN([4,8,80])}}class Li extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Ash Maiden",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("HM"),this.text=`When a friendly creature ${m.dbdtap()}, it gets ${m.jr9(this.level,this.level)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),i}ddf8(t){if(t.trigger.type==="DM"){const e=O.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}return!1}jr8(t){const e=O.toDamage(t.event);this.logAct(!1,e.srcCreat),e.srcCreat.buff(this.level,this.level),x.triggerDone()}}class Be extends M{constructor(t){super(t),this.rarity="H",this.iAttack=this.level+2,this.iHealth=this.iAttack;const e=this.cardCode();e==="SFA"?this.steel():e==="RFA"?this.root():e==="HFA"?this.hell():e==="SGA"&&this.storm(),this.text=`Forge: ${this.name} gets ${m.jr9(this.level,this.level)} for each ${m.factionText(this.faction)} card in your hand.`}hell(){this.faction="N",this.name="Hellforged Avatar",this.iRegen=this.level,this.tribe.push("AB")}root(){this.faction="U",this.name="Rootforged Avatar",this.iBT=!0,this.tribe.push("HM")}steel(){this.faction="A",this.name="Steelforged Avatar",this.iArmor=this.level,this.tribe.push("CY")}storm(){this.faction="T",this.name="Stormforged Avatar",this.iMobile=this.level,this.tribe.push("MT")}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){const e=O.toEnterField(t.event),i=v.toPlayer(t.owner).hand.filter(s=>L.getCard(s).faction===this.faction).length;if(i>0){const s=i*this.level;e.creature.buff(s,s)}x.triggerDone()}}class z extends M{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["COZ"]:()=>this.cooze(),["DZA"]:()=>this.dozer(),["FWG"]:()=>this.feywing(),["FUN"]:()=>this.funguy(),["POZ"]:()=>this.purpz(),["NSD"]:()=>this.fixedSeedling(1),["OOZ"]:()=>this.nooze(),["RPT"]:()=>this.raptor(),["SPL"]:()=>this.minion(),["SXP"]:()=>this.fixedSapling(5),["SXD"]:()=>this.fixedSeedling(3),["SXT"]:()=>this.fixedTreefolk(7),["SDL"]:()=>this.minion(),["SPN"]:()=>this.nekSpirit(),["SPU"]:()=>this.uspirit(),["XYR"]:()=>this.yuruSpirit(),["TFK"]:()=>this.minion(),["TFD"]:()=>this.fixedTreefolk(this.boof5714),["TFF"]:()=>this.tfFight(),["TTF"]:()=>this.fixedTreefolk(3),["ZTR"]:()=>this.zimus(),["ZBS"]:()=>this.threeZomb(),["ZST"]:()=>this.strideZomb(),["ZMB"]:()=>this.commonZomb()}[t]}constructor(t){super(t),this.rarity="T";const e=this.cardCode();this.imgKey=e,this.minLevel=this.level,this.maxLevel=this.level,this.lookup(e)()}image(t){return this.rawImage(this.imgKey,t)}static fgoc(t){return "FGO"+t}fixedNekSpirit(t){this.faction="N",this.rarity="T",this.name="Spirit",this.tribe.push("ST"),this.iAttack=t,this.iHealth=t,this.imgKey=`${"SPN"}${this.level}`}nekSpirit(){this.fixedNekSpirit(this.boof51015)}yuruSpirit(){this.fixedNekSpirit(this.boof5814)}static purpOzC(t){return "POZ"+t}oozer(t){this.faction="N",this.rarity="T",this.name="Oozeling",this.tribe.push("OZ"),this.iHealth=this.iAttack,this.imgKey=t?"POZ":"OOZ"}purpz(){this.iAttack=this.boof135,this.oozer(!0)}nooze(){this.iAttack=this.boof4711,this.oozer(!1)}cooze(){this.iAttack=1,this.oozer(!1),this.hints=["RT"]}minion(){this.iAttack=z.minionBuff(this.level),this.plont(),this.name=z.minionName(this.level),this.hints=["RT"]}static tffc(t){return "TFF"+t}static minionCode(t){return(t===1?"SDL":t===2?"SPL":"TFK")+t}static minionName(t){return t===1?"Seedling":t===2?"Sapling":"Treefolk"}static minionBuff(t){return t===1?1:t===2?3:5}plont(){this.faction="U",this.iHealth=this.iAttack,this.tribe.push("PL")}fixedSapling(t){this.iAttack=t,this.plont(),this.name=z.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.iAttack=t,this.plont(),this.name=z.minionName(1),this.imgKey="SDL",this.hints=["RT"]}fixedTreefolk(t){this.iAttack=t,this.plont(),this.name=z.minionName(3),this.imgKey="TFK"}tfFight(){this.iAttack=this.boof91421,this.plont(),this.name=z.minionName(3),this.imgKey="TFK"}dozer(){this.faction="U",this.name="Dozer, the Awakened",this.iAttack=this.level*3+6,this.iHealth=this.iAttack,this.iAggro=!0,this.iBT=!0,this.tribe.push("BR"),this.imgKey=this.code,this.text=`${this.name} enters play with health equal to the Dozer, the Dormant it replaced.`}feywing(){this.faction="U",this.name="Feywing",this.iAttack=9,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("DG")}funguy(){this.name="Funguy",this.iAttack=this.lValN([6,12,14]),this.plont(),this.minLevel=1,this.maxLevel=3,this.level===1?this.hints=["ZZ-1"]:this.level===2&&(this.hints=["LB"])}raptor(){this.faction="U",this.name="Raptor",this.iAttack=1,this.iHealth=1,this.tribe.push("DN"),this.hints=["RT"]}uspirit(){this.faction="U",this.name="Spirit",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("ST")}static zomc(t){return "ZMB"+t}zimus(){this.faction="N",this.rarity="L",this.name="Zimus, the Returned",this.tribe.push("ZB"),this.iAttack=10,this.iHealth=5,this.imgKey=`${"ZTU"}2`}zomb(t,e){this.faction="N",this.rarity="T",this.name="Zombie",this.tribe.push("ZB"),this.iAttack=t,this.iHealth=e,this.imgKey="ZMB"}commonZomb(){const t=this.boof359;this.zomb(t,t)}threeZomb(){this.zomb(3,3)}strideZomb(){this.zomb(this.lValN([4,8,10]),this.boof369)}}class ft extends kt{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ()},["ABE"]:{c:()=>this.edicC(),z:()=>this.edicZ()},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ()},["COD"]:{c:()=>this.chontC(),z:()=>this.chontZ()},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ()},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ()},["DGW"]:{c:()=>this.drwkC(),z:()=>this.drwkZ()},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ()},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ()},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ()},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ()},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ()},["IVS"]:{c:()=>this.infvC(),z:()=>this.infvZ()},["LOD"]:{c:()=>this.lashC(),z:()=>this.lashZ()},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ()},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ()},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ()},["PLW"]:{c:()=>this.palwC(),z:()=>this.palwZ()},["PTB"]:{c:()=>this.phyC(),z:()=>this.phyZ()},["PYS"]:{c:()=>this.pyreC(),z:()=>this.pyreZ()},["ROK"]:{c:()=>this.rokC(),z:()=>this.rokZ()},["STS"]:{c:()=>this.stsC(),z:()=>this.stsZ()},["SNP"]:{c:()=>this.pulseC(),z:()=>this.pulseZ()},["SRD"]:{c:()=>this.sradC(),z:()=>this.sradZ()},["SIV"]:{c:()=>this.beesC(),z:()=>this.beesZ()},["TST"]:{c:()=>this.talinC(),z:()=>this.talinZ()},["TRN"]:{c:()=>this.turnbC(),z:()=>this.turnbZ()},["VCH"]:{c:()=>this.verdC(),z:()=>this.verdZ()},["WOD"]:{c:()=>this.wdenC(),z:()=>this.wdenZ()}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){return this.cardCode()==="NSH"?this.leveledImage(t):this.fixedImage(t)}playTargets(){const t=super.playTargets();if(this.cardCode()==="ABE"&&this.aeSides().some(i=>i.length===0))return t;const e=D.boardTarget("CARD",this.code);return t.push(e),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),S.spellCast()}ddf8(t){return Dt.extractCardCode(t.trigger.logicCode)==="DGW"&&t.trigger.type==="TE"}jr8(t){if(Dt.extractCardCode(t.trigger.logicCode)==="DGW"){const i=f.jr5(t.trigger.creatId);i.status==="A"&&W.destroy(i,this.code)}x.triggerDone()}apulseC(){this.faction="A",this.rarity="C",this.name="Aegis Pulse",this.text=`Each friendly creature gets Armor ${this.boof234}.`}apulseZ(){const t=this.boof234;f.ddf1().forEach(e=>{e.addArmor(t)})}aeSides(){return[f.qPlayerCreats(!0),f.qPlayerCreats(!1)]}edicC(){this.faction="A",this.rarity="H",this.name="Ambriel's Edict",this.maxLevel=1,this.overload=!0,this.text="If each player has at least one creature in play, destroy all but the highest attack creature that each player controls.~Then discard you hand."}edicZ(){const t=this.aeSides(),e=R.tick();let i=[];t.forEach(g=>{if(g.length>1){let y=[],C=-999999;g.forEach(B=>{B.attack>C?(C=B.attack,i.push(...y),y=[B]):B.attack===C?y.push(B):i.push(B)}),y.length>1&&(y.splice(T.randInt(0,y.length),1),i.push(...y))}}),i.forEach(g=>W.destroy(g,this.code,e));const s=v.getActive(),h=S.playPosition(),u=s.hand.length;for(let g=u-1;g>-1;g--)g!==h&&(s.discard.push(s.hand[g]),s.hand.splice(g,1),S.shiftPlayCard(g))}get ctlboof(){return(this.level-1)*2}ctlC(){this.faction="T",this.rarity="L",this.name="Call the Lightning";const t=this.level>1?` gets ${m.jr9(this.ctlboof,0)} this turn. Those creatures`:"";this.text=`Each friendly creature${t} battles an additional time this turn.`}ctlZ(){const t=this.ctlboof;f.ddf1().forEach(e=>{const i=p.mod("AT",t,this.code);i.expiry="ET",e.addMod(i),e.extraBattles+=1})}chontC(){this.faction="T",this.rarity="R",this.name="Chant of Dragonwatch",this.maxLevel=1,this.text="Deal X damaage to each enemy creature, where X is your rank."}chontZ(){const t=v.getActive().rank,e=R.tick();f.qEnemyCreats().forEach(i=>{i.hurtDirect(t,this.code,e)})}dcurC(){this.faction="N",this.rarity="R",this.name="Death Current";const t=this.lValS(["a level 2 or lower","an","two"]);this.text=`Destroy ${t} enemy creature at random.`}dcurZ(){const t=this.dCurrHunter(),e=t.length;if(e>0){const i=T.randInt(0,e),s=R.tick();W.destroy(t[i],this.code,s),this.level===3&&e>1&&(t.splice(i,1),W.destroy(t[T.randInt(0,e-1)],this.code,s))}}dCurrHunter(){const t=p.crEnemyTarg();return t.level=D.ddf2(this.level+1),f.creatByTarget(t)}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${m.jr9(this.boof4812n,0)}.`}digiZ(){const t=this.boof4812n;f.qEnemyCreats().forEach(e=>{e.buff(t,0)})}drwkC(){this.faction="T",this.rarity="L",this.name="Dragonwake",this.text=`Search your deck for a ${m.levelGateText(this.level+1,!0)}Dragon and Spawn a copy of it. It gets Aggressive${this.level===3?".":' and "At the end of your turn, destroy this.'}`}drwkZ(){const t=p.target("DK");t.tribe="DG",t.level=D.ddf2(this.level+1),t.player="F";const e=D.deckByTarget(t),i=e.length;if(i>0){const s=f.birth(e[T.randInt(0,i)][0],"S",v.getActiveB());if(s&&(s.aggressive=!0,this.level<3)){const h=s.jr4("TE",this.code);h.creatId=s.id,h.changes=!0}}}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${m.jr9(t,t)}.`}epiZ(){const t=this.boof246n,e=p.crEnemyTarg();f.creatByTarget(e).forEach(i=>{i.buff(t,t)})}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${m.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;f.ddf1().forEach(e=>{e.buff(t,t),this.level===3&&(e.breakthrough=!0)})}get fszap(){return this.level+4}fstormC(){this.faction="T",this.rarity="H",this.name="Firestorm",this.text=`Deal ${this.fszap} damage to each creature.`}fstormZ(){const t=this.fszap,e=R.tick();f.qActiveCreats().forEach(i=>{i.hurtDirect(t,this.code,e)})}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${m.jr9(-1*t,0)}. Each friendly creature gets ${m.jr9(t,0)}.`}mealZ(){const t=this.boof234,e=v.getActiveB();f.qActiveCreats().forEach(i=>{const s=i.owner===e?t:-1*t;i.buff(s,0)})}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${m.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,e=p.crFriendTarg();f.creatByTarget(e).forEach(i=>{i.buff(0,t)})}infvC(){this.faction="N",this.rarity="C",this.name="Infernal Visage";const t=this.boof246;this.text=`Each friendly creature in a side lane gets ${m.jr9(t,t,!0)} and Regenerate ${this.level}.`}infvZ(){const t=this.boof246,e=p.crFriendTarg();e.lanes=[1,5],f.creatByTarget(e).forEach(i=>{i.buff(t,t),i.addRegen(this.level)})}lashC(){this.faction="U",this.rarity="L",this.name="Lash of Demara",this.text=`Each enemy creature gets Poison ${this.level+2}.`}lashZ(){const t=this.level+2;f.qEnemyCreats().forEach(e=>{e.addPoison(t)})}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=L.getCard(this.ndc());this.text=`Spawn a ${m.tokName(t)}.`}shriekZ(){f.birth(this.ndc(),"S",v.getActiveB())}ndc(){return "NDR"+this.level}noxC(){this.faction="U",this.rarity="R",this.name="Noxious Cloud",this.text=`Each enemy creature gets Poison ${this.boof246}.`}noxZ(){const t=this.boof246;f.qEnemyCreats().forEach(e=>{e.addPoison(t)})}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${m.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)f.ddf1().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;f.ddf1().forEach(e=>{e.buff(t,0)})}}palwC(){this.faction="A",this.rarity="R",this.name="Palladium Wave",this.maxLevel=1,this.text=`Each enemy creature gets ${m.jr9(-1,0).replaceAll("1","X")}, where X is two times your rank.`}palwZ(){const t=-2*v.getActive().rank;f.qEnemyCreats().forEach(e=>{e.buff(t,0)})}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=L.getCard(z.minionCode(this.level));this.text=`Put a ${m.tokName(t)} into each players available lanes.`}phyZ(){const t=z.minionCode(this.level),e=R.tick();[!0,!1].forEach(i=>{f.emptyLanes(i).forEach(s=>{f.birth(t,"P",i,s,e)})})}pyreC(){this.faction="T",this.rarity="C",this.name="Pyre Song",this.text=`Each friendly creature deals ${this.level} damage to each enemy creature.`}pyreZ(){const t=this.level,e=R.tick(),i=f.qEnemyCreats();f.ddf1().forEach(s=>{i.forEach(h=>{h.hurtDirect(t,s.code,e)})})}rokC(){this.faction="T",this.rarity="L",this.name="Rage of Kadras",this.overload=!0,this.maxLevel=1,this.text="Each friendly Tempys creature gets +1 attack and deals damage equal to its attack to the creature opposing it."}rokZ(){const t=R.tick(),e=p.crFriendTarg();e.faction="T",f.creatByTarget(e).forEach(i=>{i.buff(1,0);const s=i.opposed;s&&s.hurtDirect(i.attack,i.code,t)})}stsC(){this.faction="U",this.rarity="C",this.name="Scatter the Seeds";const t=L.getCard(z.minionCode(this.level));this.text=`Spawn three ${m.tokName(t)}s.`}stsZ(){const t=z.minionCode(this.level),e=R.tick();[1,2,3].forEach(i=>{f.birth(t,"S",v.getActiveB(),void 0,e)})}get spboof(){return(this.level+1)*-2}pulseC(){this.faction="A",this.rarity="H",this.name="Sonic Pulse",this.text=`Each enemy creature gets ${m.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;f.qEnemyCreats().forEach(e=>{e.buff(t,0)})}sradC(){this.faction="U",this.rarity="C",this.name="Soothing Radiance",this.text=`Heal ${this.boof61224} damage from each friendly creature.`}sradZ(){const t=this.boof61224;f.ddf1().forEach(e=>{e.heal(t)})}beec(){return "KBE"+this.level}beesC(){this.faction="U",this.rarity="H",this.name="Stinging Invocation";const t=L.getCard(this.beec());this.text=`Spawn one to three ${m.tokName(t)}s.`}beesZ(){const t=this.beec(),e=R.tick(),i=T.randInt(2,5);[1,2,3].forEach(s=>{s{const i=p.mod("AT",t);i.expiry="ET",e.addMod(i)})}talinTarg(){const t=p.crFriendTarg();return t.faction="T",f.creatByTarget(t)}turnbC(){this.faction="T",this.rarity="H",this.name="Turnabout",this.isFree=this.level===3;const t=this.boof235;this.text=`Each creature gets ${m.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,e=-1*t;f.qActiveCreats().forEach(i=>{const s=p.mod("AT",t),h=p.mod("HL",e),u=p.mod("MH",e);s.expiry="ET",h.expiry="ET",u.expiry="ET",i.addMod(s),i.addMod(h),i.addMod(u)})}verdC(){this.faction="U",this.rarity="H",this.name="Verdant Charge";const t=this.verdb;this.text=`Each friendly creature gets ${m.jr9(t,t,!0)} and Regenerate ${t}.`}verdZ(){const t=this.verdb;f.ddf1().forEach(e=>{e.buff(t,t),e.addRegen(t)})}get verdb(){return this.lValN([1,3,6])}wdenC(){this.faction="U",this.rarity="R",this.name="Whispers of Dendris",this.maxLevel=1,this.text=`Each friendly creature gets ${m.jr9(1,1).replaceAll("1","X")}, where X is your rank.`}wdenZ(){const t=v.getActive().rank;f.ddf1().forEach(e=>{e.buff(t,t)})}}class Gi extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Borean Mystic",this.iAttack=this.boof4814,this.iHealth=this.boof71118,this.tribe.push("WN","AS"),this.text=`Activate: Move another friendly creature to an available lane adjacent to ${this.name}.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=f.ddf6(t),s=f.jr5(e[1]),h=this.emptySloots(s,i.id);h.push(S.cancelAction()),S.ddf5(h)}else{const i=f.jr5(e[1]),s=f.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),i.endActivation()}}emptySloots(t,e=""){return S.emptyAdjacents(t,T.enTil("P2",t.id,e))}buddies(t){return D.toActions(p.crFriendNotMeActTarg("CARD",t,this.code,T.enTil("P1",t)))}}class $i extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Bron, Wild Tamer",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hints=["RD"];const e=this.boof357;this.text=`Upgrade Dinosaur: Replace Bron with a level ${this.level} Dino Knight.~When this ${m.dbdtap()}, heal ${e} damage from each other friendly creature.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("UP");const s=i.jr4("DM");return s.bonus=this.buffNug(0,this.boof357),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="UP"){const i=O.toReplaced(t.event).replCreat;i.isTribe("DN")&&f.birth("DNK"+this.level,"R",i.owner,i.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,i=p.crNotMeTarg(t.creatId);i.player=v.toTarget(t.owner),f.creatByTarget(i).forEach(h=>h.heal(e)),x.triggerDone()}}}class Vi extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Brightsteel Gargoyle",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("RB"),this.text=`At the end of your turn, ${this.name} gets Armor ${this.boof2510} and Defender until the end of the next turn.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("PT"),i}ddf8(t){return t.trigger.type==="PT"?t.event.playerA===t.owner:!1}jr8(t){const e=p.mod("AR",this.boof2510,t.creatId),i=p.mod("DF",!0,t.creatId);e.expiry="ET",i.expiry="ET";const s=f.jr5(t.creatId);s.addMod(e),s.addMod(i),x.triggerDone()}}class Wi extends kt{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Bullwark Bash",this.text=`Deal damage equal to ${this.level>1?this.level+"x ":""}the Armor on a friendly creature to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");e.hasArmor=!0,t.push(e)}return t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=f.ddf6(t),s=this.enemyTargActions(i.id);s.push(S.cancelAction()),S.ddf5(s)}else{const i=f.ddf6(t),s=f.jr5(e[1]);this.logSpell(s),i.hurtDirect(s.armor*this.level,this.code),S.spellCast()}}enemyTargActions(t=""){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return D.toActions(e)}}class Oi extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Byzerak Spitemage",this.iAttack=this.boof369,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("HM"),this.text=`Allied Nekrium: When ${this.name} ${m.dbdtac(this.level)}, destroy it.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}ddf8(t){if(t.trigger.type==="DM"){const e=O.toDamage(t.event);return e.battle&&e.isCreatSrc&&e.isCreatTarg&&e.dmg>0&&e.srcId===t.creatId&&D.levelTestCommon(e.hurtCreat.level,this.level)}else return!1}jr8(t){if(t.trigger.type==="FR"&&E.allied("N")){const e=f.jr5(t.creatId),i=e.jr4("DM");i.bonus=this.avgSpawnNug(),e.changed=!0}else if(t.trigger.type==="DM"){const i=O.toDamage(t.event).hurtCreat;i.status==="A"&&W.destroy(i,this.code)}x.triggerDone()}}class Ui extends M{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Cercee, Hand of Varna",this.iAttack=this.lValN([1,3,5,7]),this.iHealth=this.lValN([6,10,20,40]),this.tribe.push("FB"),this.hints=["ZZ-2"],this.iMobile=1,this.maxLevel=4;const e=this.level===4?`When ${this.name} ${m.dbdtap()}, deal damamge to that player equal to their health.~`:"";this.text=e+`When ${this.name} ${m.dbdtac(this.level)}, destroy that creature.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return this.level===4?s.bonus=this.rawNug(0,0,0,0,10):s.bonus=this.avgSpawnNug(),i}ddf8(t){if(t.trigger.type==="DM"){const e=O.toDamage(t.event);if(e.battle&&e.isCreatSrc&&e.srcId===t.creatId){if(this.level===4)return!0;if(e.isCreatTarg){const i=e.hurtCreat;return D.levelTestCommon(i.level,this.level)}}}return!1}jr8(t){const e=O.toDamage(t.event);if(e.isCreatTarg){const i=e.hurtCreat;i.status==="A"&&W.destroy(i,this.code)}else v.hurtDirect(e.hurtPlayer,e.hurtPlayer.health,this.code);x.triggerDone()}}class mt extends M{lookup(t){return{["BSW"]:{c:()=>this.bswC(),a:(i,s)=>this.bswA(i,s),t:i=>this.bswT(i)},["CCS"]:{c:()=>this.ccsC(),a:(i,s)=>this.ccsA(i,s),t:i=>this.ccsT(i)},["CGL"]:{c:()=>this.clordC(),a:(i,s)=>this.clordA(i,s),t:i=>this.clordT(i)},["CSH"]:{c:()=>this.cswC(),a:(i,s)=>this.cswA(i,s),t:i=>this.cswT(i)},["FFU"]:{c:()=>this.ffuC(),a:(i,s)=>this.ffuA(i,s),t:i=>this.ffuT(i)},["FFS"]:{c:()=>this.ffsC(),a:(i,s)=>this.ffsA(i,s),t:i=>this.ffsT(i)},["FSH"]:{c:()=>this.fssC(),a:(i,s)=>this.fssA(i,s),t:i=>this.fssT(i)},["KOD"]:{c:()=>this.kodC(),a:(i,s)=>this.kodA(i,s),t:i=>this.kodT(i)},["LOD"]:{c:()=>this.lashC(),a:(i,s)=>this.lashA(i,s),t:i=>this.lashT(i)},["MBP"]:{c:()=>this.mbpC(),a:(i,s)=>this.mbpA(i,s),t:i=>this.mbpT(i)},["MND"]:{c:()=>this.mndC(),a:(i,s)=>this.mndA(i,s),t:i=>this.mndT(i)},["NCS"]:{c:()=>this.ncsC(),a:(i,s)=>this.ncsA(i,s),t:i=>this.ncsT(i)},["NXG"]:{c:()=>this.nxgC(),a:(i,s)=>this.nxgA(i,s),t:i=>this.nxgT(i)},["NFF"]:{c:()=>this.nffC(),a:(i,s)=>this.nffA(i,s),t:i=>this.nffT(i)},["OHV"]:{c:()=>this.orghC(),a:(i,s)=>this.orghA(i,s),t:i=>this.orghT(i)},["PPM"]:{c:()=>this.ppmC(),a:(i,s)=>this.ppmA(i,s),t:i=>this.ppmT(i)},["PSC"]:{c:()=>this.pcoilC(),a:(i,s)=>this.pcoilA(i,s),t:i=>this.pcoilT(i)},["SGF"]:{c:()=>this.siggyC(),a:(i,s)=>this.siggyA(i,s),t:i=>this.siggyT(i)},["SRM"]:{c:()=>this.srmdC(),a:(i,s)=>this.srmdA(i,s),t:i=>this.srmdT(i)},["SSA"]:{c:()=>this.ssaC(),a:(i,s)=>this.ssaA(i,s),t:i=>this.ssaT(i)},["SWM"]:{c:()=>this.swmC(),a:(i,s)=>this.swmA(i,s),t:i=>this.swmT(i)},["UCM"]:{c:()=>this.ucmC(),a:(i,s)=>this.ucmA(i,s),t:i=>this.ucmT(i)},["UIM"]:{c:()=>this.uimC(),a:(i,s)=>this.uimA(i,s),t:i=>this.uimT(i)},["WMR"]:{c:()=>this.warmC(),a:(i,s)=>this.warmA(i,s),t:i=>this.warmT(i)},["WWR"]:{c:()=>this.wwrC(),a:(i,s)=>this.wwrA(i,s),t:i=>this.wwrT(i)},["WFS"]:{c:()=>this.wfsC(),a:(i,s)=>this.wfsA(i,s),t:i=>this.wfsT(i)},["XSH"]:{c:()=>this.shambC(),a:(i,s)=>this.shambA(i,s),t:i=>this.shambT(i)},["ZPM"]:{c:()=>this.zpmC(),a:(i,s)=>this.zpmA(i,s),t:i=>this.zpmT(i)}}[t]}targAction(t,e,i){this.lookup(t).a(e,i)}actTargets(t,e){return this.lookup(t).t(e)}xl=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return this.doubleActivator()&&(i.jr4("TS"),this.addExtraActivate(i)),i}canActivate(t){return D.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){const e=D.toActions([this.actTargets(this.cardCode(),t),D.buttonTarget("CANC")]);S.ddf5(e)}handleAction(t){const e=f.ddf6(t),i=f.jr5(t.param);this.logAct(!0,this.xl?e:void 0),this.targAction(this.cardCode(),e,i),i.endActivation()}makeCreatTarg(t){return p.crActTarg("CARD",this.code,t.id)}makeOtherCreatTarg(t){const e=this.makeCreatTarg(t);return e.notMe=t.id,e}doubleActivator(){return this.code==="CGL"+"3"||this.code==="XSH"+"3"}ddf8(t){return Dt.extractCardCode(t.trigger.logicCode)==="KOD"&&(t.trigger.type==="PT"||t.trigger.type==="VN")?!0:t.trigger.type==="TS"&&this.doubleActivator()?t.event.playerA===t.owner:super.ddf8(t)}jr8(t){if(t.trigger.type==="VN"){const e=t.event,i=f.jr5(e.creatId);f.birth(i.code,"S",t.owner),x.triggerDone()}else if(t.trigger.type==="PT"){const e=t.trigger.customCode,i=f.jr5(t.creatId);i.triggers.filter(h=>h.customCode===e).forEach(h=>i.removeTrigger(h)),x.triggerDone()}else if(t.trigger.type==="TS"){const e=f.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}bswC(){this.faction="T",this.rarity="C",this.name="Borean Stormweaver",this.iAttack=this.boof4816,this.iHealth=this.lValN([6,10,20]),this.tribe.push("GT"),this.xl=!1;const t=this.boof234;this.text=`Activate: Deal ${t} damage to a creature.`,this.bonus={activ8:this.buffNug(0,t)}}bswT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}bswA(t,e){t.hurtDirect(this.boof234,this.code)}ccsC(){this.faction="N",this.rarity="C",this.name="Catacomb Spider",this.iAttack=this.boof4815,this.iHealth=this.lValN([5,10,16]),this.tribe.push("SP");const t=this.boof246;this.text=`Activate: Give another creature Regenerate ${t}.`,this.bonus={activ8:this.regnNug(t)}}ccsT(t){const e=this.makeOtherCreatTarg(t);return e.canRegen=!0,e.hint=["BF"],e}ccsA(t,e){t.addRegen(this.boof246)}clordC(){this.faction="N",this.rarity="H",this.name="Contagion Lord",this.iAttack=this.boof4914,this.iHealth=this.iAttack+3,this.tribe.push("AB"),this.xl=!1,this.text="Activate, destroy a friendly Abomination: You may play an additional card this turn.",this.level===3&&(this.text+="~You may use this ability twice per turn."),this.bonus={activ8:this.multNug(this.avgSpawnNug(),.3)}}clordT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="AB",e}clordA(t,e){W.destroy(t,this.code),E.regularPlays+=1}cswC(){this.faction="A",this.rarity="C",this.name="Cypien Shieldwarden",this.iAttack=this.boof4610,this.iHealth=this.boof61016,this.tribe.push("HM");const t=this.boof246;this.text=`Activate: Give a creature Armor ${t} this turn.`,this.bonus={activ8:this.regnNug(t)}}cswT(t){const e=this.makeCreatTarg(t);return e.canArmor=!0,e.hint=["BF"],e}cswA(t,e){const i=p.mod("AR",this.boof246,e.id);i.expiry="ET",t.addMod(i)}ffuC(){this.faction="T",this.rarity="H",this.name="Firefist Uranti",this.iAttack=this.boof357,this.iHealth=this.boof71116,this.tribe.push("FR","YT"),this.xl=!1,this.text=`Activate: Deal damage equal to ${this.name}'s attack to a creature.`,this.bonus={activ8:this.buffNug(0,this.iAttack)}}ffuT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],t.attack<1&&(e.victims="???"),e}ffuA(t,e){t.hurtDirect(e.attack,this.code)}ffsC(){this.faction="T",this.rarity="R",this.name="Flamefury Shaman",this.iAttack=this.boof369,this.iHealth=this.boof81116,this.tribe.push("HM"),this.text=`Activate: Grant another creature ${m.jr9(this.iAttack,0)} this turn.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}ffsT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}ffsA(t,e){const i=p.mod("AT",this.iAttack,e.id);i.expiry="ET",t.addMod(i)}fssC(){this.faction="T",this.rarity="R",this.name="Flamestoke Shaman",this.iAttack=this.boof61218,this.iHealth=this.boof3712,this.tribe.push("HM"),this.text=`Activate: Grant an adjacent ${m.levelGateText(this.level,!0)}creature Aggressive.`,this.bonus={activ8:this.regnNug(1)}}fssT(t){const e=this.makeCreatTarg(t);return e.level=D.ddf2(this.level),e.lanes=t.adjacent,e.player="F",e}fssA(t,e){t.aggressive=!0}kodC(){this.faction="N",this.rarity="L",this.name="Keeper of the Damned",this.iAttack=this.boof5815,this.iHealth=this.boof61017,this.tribe.push("ZB"),this.text=`Activate: another friendly ${m.levelGateText(this.level,!0)}creature gets "Vengeance: Spawn this" this turn.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}kodT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.player="F",e}kodA(t,e){const i=t.jr4("VN");i.customCode=e.id,i.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e.id}lashC(){this.faction="U",this.rarity="L",this.name="Demara, Herald of Affliction",this.iAttack=14,this.iHealth=20,this.tribe.push("NG"),this.text="Activate: Give an enemy creature with Poison Defender.~Forge: Each enemy creature gets Poison 6.",this.bonus={activ8:this.rawNug(0,0,0,0,.1)}}lashT(t){const e=this.makeCreatTarg(t);return e.player="E",e.hasPoison=!0,e.canDefender=!0,e}lashA(t,e){t.defender=!0}mbpC(){this.faction="U",this.rarity="H",this.name="Mossbeard Patriarch",this.iAttack=this.boof137,this.iHealth=this.boof81220,this.tribe.push("PL");const t=this.boof468;this.text=`Activate: Give another creature ${m.jr9(0,t)}.`,this.bonus={activ8:this.buffNug(0,t)}}mbpT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mbpA(t,e){t.buff(0,this.boof468)}mndC(){this.faction="A",this.rarity="R",this.name="Munitions Drone",this.iAttack=this.boof137,this.iHealth=this.boof6814,this.tribe.push("RB");const t=this.boof357;this.text=`Activate: Give another creature ${m.jr9(t,0)}.`,this.bonus={activ8:this.buffNug(t,0)}}mndT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mndA(t,e){t.buff(this.boof357,0)}ncsC(){this.faction="N",this.rarity="R",this.name="Necroslime",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.xl=!1;const t=this.boof248;this.text=`Activate, deal 3 damage to another friendly creature: ${this.name} gets ${m.jr9(t,t)}.`,this.bonus={activ8:this.buffNug(t,t-3)}}ncsT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}ncsA(t,e){const i=this.boof248;t.hurtDirect(3,this.code),e.buff(i,i)}nxgC(){this.faction="A",this.rarity="H",this.name="Nexus Gunner",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("HM"),this.text=`Activate: Give a creature ${m.jr9(this.iAttack,0)}. Use this ability only if ${this.name} is in the center lane.`,this.bonus={activ8:this.buffNug(this.iAttack/2,0)}}nxgT(t){const e=this.makeCreatTarg(t);return t.lane!==3?e.victims="???":e.hint=["BF","BB"],e}nxgA(t,e){t.buff(this.iAttack,0)}nffC(){this.faction="U",this.rarity="L",this.name="Nuada, Faith's Flourish",this.iAttack=this.boof246,this.iHealth=this.lValN([10,17,25]),this.iDefend=!0,this.tribe.push("TK"),this.xl=!1,this.hints=[this.lValH(["ZZ-1","ZZ-2","ZZ-2"])];const t=L.getCard(z.tffc(this.level));this.text=`Activate: Replace a friendly Plant with a ${m.tokName(t)}.`,this.bonus={activ8:this.multNug(this.spawnNug(t),.5)}}nffT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="PL",e}nffA(t,e){f.birth(z.tffc(this.level),"R",e.owner,t.lane)}orghC(){this.faction="N",this.rarity="R",this.name="Organ Harvester",this.iAttack=this.lValN([2,6,9]),this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1,this.text=`Activate, destroy ${this.name}: Destroy a ${m.levelGateText(this.level,!0)}creature.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.4)}}orghT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.hint=["KL"],e}orghA(t,e){const i=R.tick();W.destroy(t,this.code,i),W.destroy(e,this.code,i)}ppmC(){this.faction="A",this.rarity="R",this.name="Palladium Pulsemage",this.iAttack=this.lValN([2,8,12]),this.iHealth=this.lValN([7,12,15]),this.tribe.push("HM"),this.text=`Activate: give a creature ${m.jr9(this.boof4812n,0)} this turn.`,this.bonus={activ8:this.buffNug(this.boof246,0)}}ppmT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}ppmA(t,e){const i=p.mod("AT",this.boof4812n,e.id);i.expiry="ET",t.addMod(i)}pcoilC(){this.faction="U",this.rarity="R",this.name="Poisoncoil",this.iAttack=this.boof357,this.iHealth=this.boof71013,this.iDefend=!0,this.tribe.push("SN");const t=this.boof135;this.text=`Activate: Give another creature Poison ${t}.`,this.bonus={activ8:this.regnNug(t)}}pcoilT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["PN","DF"],e}pcoilA(t,e){t.addPoison(this.boof135)}siggyC(){this.faction="N",this.rarity="H",this.name="Sigmund Fraud",this.iAttack=this.boof357,this.iHealth=this.lValN([9,14,19]),this.iDefend=!0,this.tribe.push("AB"),this.xl=!1;const t=this.boof4812;this.text=`Activate, destroy another friendly creature: Deal ${t} damage to the enemy player and you gain ${t} health.`,this.bonus={activ8:this.playerNug(t)}}siggyT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}siggyA(t,e){W.destroy(t,this.code);const i=this.boof4812;v.hurtDirect(!e.owner,i,this.code),v.heal(e.owner,i)}srmdC(){this.faction="N",this.rarity="H",this.name="Sorrow Maiden",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.xl=!1,this.text=`Activate: Destroy an enemy creature with ${this.iAttack} or less attack.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.4)}}srmdT(t){const e=this.makeCreatTarg(t);return e.player="E",e.maxAttack=this.iAttack,e}srmdA(t,e){W.destroy(t,this.code)}ssaC(){this.faction="N",this.rarity="H",this.name="Spitesower Acolyte",this.iAttack=this.boof234,this.iHealth=this.lValN([8,14,22]),this.tribe.push("HM");const t=this.boof246n;this.text=`Activate, deal ${-t} damage to ${this.name}: Give a creature ${m.jr9(t,t)}.`,this.bonus={activ8:this.buffNug(-t,0)}}ssaT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","BB"],e}ssaA(t,e){const i=this.boof246n,s=R.tick();e.hurtDirect(-i,this.code,s),t.buff(i,i,s)}swmC(){this.faction="A",this.rarity="R",this.name="Steelwelder Medic",this.iAttack=this.lValN([3,5,13]),this.iHealth=this.boof61014,this.tribe.push("HM"),this.text=`Activate: Give another creature Armor ${this.level}.`,this.bonus={activ8:this.regnNug(this.level)}}swmT(t){const e=this.makeOtherCreatTarg(t);return e.canArmor=!0,e.hint=["BF","BB"],e}swmA(t,e){t.addArmor(this.level)}ucmC(){this.faction="T",this.rarity="R",this.name="Uranti Cryomancer",this.iAttack=this.boof247,this.iHealth=this.lValN([8,13,17]),this.tribe.push("IC","YT"),this.xl=!1;const t=this.boof135;this.text=`Activate: Deal ${t} damage to a creature.`,this.bonus={activ8:this.buffNug(0,t)}}ucmT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}ucmA(t,e){t.hurtDirect(this.boof135,this.code)}uimC(){this.faction="T",this.rarity="C",this.name="Uranti Icemage",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.lValN([8,13,20]),this.tribe.push("IC","YT"),this.text="Activate: Negate Defender this turn.",this.bonus={activ8:this.regnNug(1)}}uimT(t){const e=this.makeCreatTarg(t);return e.hint=["BB"],e}uimA(t,e){const i=p.mod("ND",!0,e.id);i.expiry="ET",t.addMod(i)}warmC(){this.faction="A",this.rarity="H",this.name="War Merchant",this.iAttack=this.boof468,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("HM");const t=this.level===3?this.iAttack:0;this.text=`Activate: Give a creature in a center lane ${m.jr9(this.iAttack,t)}.`,this.bonus={activ8:this.multNug(this.buffNug(this.iAttack,t),.5)}}warmT(t){const e=this.makeCreatTarg(t);return e.lanes=3,e.hint=["BF","BB"],e}warmA(t,e){t.buff(this.iAttack,this.level===3?this.iAttack:0)}wwrC(){this.faction="U",this.rarity="C",this.name="Weirwood Ranger",this.iAttack=this.boof51015,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.text=`Activate: Give another creature ${m.jr9(this.level,this.level)}.`,this.bonus={activ8:this.buffNug(this.level,this.level)}}wwrT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF","BB"],e}wwrA(t,e){t.buff(this.level,this.level)}wfsC(){this.faction="N",this.rarity="H",this.name="Witherfrost Succubus",this.iAttack=this.boof147,this.iHealth=this.boof61018,this.tribe.push("DM");const t=this.boof357;this.text=`Activate: Give a creature ${m.jr9(-t,-t)} this turn.`,this.bonus={activ8:this.buffNug(t,t)}}wfsT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}wfsA(t,e){const i=-this.boof357,s=p.mod("AT",i,e.id);s.expiry="ET",t.addMod(s);const h=p.mod("HL",i,e.id);h.expiry="ET",t.addMod(h);const u=p.mod("MH",i,e.id);u.expiry="ET",t.addMod(u)}shambC(){this.faction="N",this.rarity="L",this.name="Xithian Shambler",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1;let t="";this.level===3&&(t="~You may use this ability twice per turn."),this.text=`Activate, destroy an adjacent creature: ${this.name} moves into that creature's lane, then gets +attack and +health equal to that creature's attack and health.${t}`,this.bonus={activ8:this.rawNug(0,0,0,0,this.lValN([.6,1.2,2.2]))}}shambT(t){const e=p.crFriendActTarg("CARD",this.code,t.id);return e.lanes=t.adjacent,e}shambA(t,e){const i=t.attack,s=t.health;W.destroy(t,this.code),e.move(t.lane),e.buff(i,s)}zpmC(){this.faction="T",this.rarity="R",this.name="Zephyr Mage",this.iAttack=this.boof4813,this.iHealth=this.boof61017,this.tribe.push("WN","AS"),this.text=`Activate: Give another ${m.levelGateText(this.level,!0)}creature Mobility ${this.level}.`,this.bonus={activ8:this.regnNug(this.level)}}zpmT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.canMove=!0,e.hint=["BF","BB"],e}zpmA(t,e){t.addMobility(this.level)}}class Oe extends M{lookup(t){return{["CMF"]:{c:()=>this.aconC(),f:(i,s)=>this.aconF(i,s)},["FLH"]:{c:()=>this.flhC(),f:(i,s)=>this.flhF(i,s)},["TBB"]:{c:()=>this.tbbC(),f:(i,s)=>this.tbbF(i,s)}}[t]}targAction(t,e,i){this.lookup(t).f(e,i)}playTarg;optional=!1;notme=!1;ftext="";constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("AS");return s.interactive=!0,i}handleAction(t){const e=f.ddf6(t),i=f.jr5(t.param);this.targAction(this.cardCode(),e,i),S.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const e=D.toActions(this.playTarg);e.length>0?(e.forEach(i=>{i.param=t.creatId}),this.optional&&e.push(S.noneEndTrigger()),S.ddf5(e)):x.triggerDone()}aconC(){this.faction="N",this.rarity="R",this.name="Calamity Fiend",this.iAttack=this.boof4814,this.iHealth=this.lValN([5,10,16]),this.tribe.push("DM");const t=-this.boof234;this.addSp("U",t),this.playTarg.player="E",this.ftext=`Give an enemy creature ${m.jr9(t,t)}.`}aconF(t,e){this.logAct(!1,t);const i=-this.boof234;t.buff(i,i)}flhC(){this.faction="T",this.rarity="C",this.name="Firelight Hunter",this.iAttack=this.boof468,this.iHealth=this.iAttack-2,this.tribe.push("HM"),this.playTarg.player="E",this.addSp("D",this.iAttack),this.ftext=`Deal ${this.iAttack} to an enemy creature.`}flhF(t,e){t.hurtDirect(this.iAttack,this.code)}tbbC(){this.faction="T",this.rarity="R",this.name="Totembound Berserker",this.iAttack=this.boof81318,this.iHealth=this.lValN([2,4,10]),this.tribe.push("GT"),this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level),this.optional=!0,this.ftext=`You may move an enemy ${m.levelGateText(this.level,!0)}creature to the space opposing ${this.name}.`}tbbF(t,e){e.opposed||(this.logAct(!1,t),t.move(f.oppositeLane(e.lane)))}}class yt extends M{lookup(t){return{["ABM"]:{c:()=>this.mawC(),f:(i,s)=>this.mawF(i,s)},["AGC"]:{c:()=>this.aconC(),f:(i,s)=>this.aconF(i,s)},["BTI"]:{c:()=>this.binvC(),f:(i,s)=>this.binvF(i,s)},["BSR"]:{c:()=>this.bsrC(),f:(i,s)=>this.bsrF(i,s)},["BAW"]:{c:()=>this.bawC(),f:(i,s)=>this.bawF(i,s)},["CKB"]:{c:()=>this.cacC(),f:(i,s)=>this.cacF(i,s)},["CHA"]:{c:()=>this.chaC(),f:(i,s)=>this.chaF(i,s)},["CCR"]:{c:()=>this.ccC(),f:(i,s)=>this.ccF(i,s)},["FRI"]:{c:()=>this.friC(),f:(i,s)=>this.friF(i,s)},["FRV"]:{c:()=>this.freavC(),f:(i,s)=>this.freavF(i,s)},["GLF"]:{c:()=>this.gfiendC(),f:(i,s)=>this.gfiendF(i,s)},["GRW"]:{c:()=>this.grwC(),f:(i,s)=>this.grwF(i,s)},["GHT"]:{c:()=>this.grhC(),f:(i,s)=>this.grhF(i,s)},["MMH"]:{c:()=>this.houndC(),f:(i,s)=>this.houndF(i,s)},["MXW"]:{c:()=>this.mtxC(),f:(i,s)=>this.mtxF(i,s)},["NGB"]:{c:()=>this.ngbC(),f:(i,s)=>this.ngbF(i,s)},["PHS"]:{c:()=>this.phxsC(),f:(i,s)=>this.phxsF(i,s)},["RWD"]:{c:()=>this.rotC(),f:(i,s)=>this.rotF(i,s)},["SHY"]:{c:()=>this.schyC(),f:(i,s)=>this.schyF(i,s)},["STD"]:{c:()=>this.stdC(),f:(i,s)=>this.stdF(i,s)},["SEV"]:{c:()=>this.surzC(),f:(i,s)=>this.surzF(i,s)},["VNF"]:{c:()=>this.vnfC(),f:(i,s)=>this.vnfF(i,s)},["WBY"]:{c:()=>this.wbyC(),f:(i,s)=>this.wbyF(i,s)},["WBU"]:{c:()=>this.wbuC(),f:(i,s)=>this.wbuF(i,s)},["XDH"]:{c:()=>this.dogsC(),f:(i,s)=>this.dogsF(i,s)}}[t]}targAction(t,e,i){this.lookup(t).f(e,i)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}jr3(t,e){const i=super.jr3(t,e);if(this.forges){const s=i.jr4("FR");s.interactive=!0}return i}ddf8(t){return Dt.extractCardCode(t.trigger.logicCode)==="CKB"&&t.trigger.type==="TS"?!0:super.ddf8(t)}handleAction(t){const e=f.ddf6(t),i=f.jr5(t.param);this.targAction(this.cardCode(),e,i),S.actionDone(!0)}jr8(t){const e=this.cardCode();if(t.trigger.type==="TS"&&e==="CKB"){this.logAct(!1),E.regularPlays+=1;const s=t.event,h=v.toPlayer(s.playerA),u=p.trigIdx(h.triggers,t.trigger);u>-1&&h.triggers.splice(u,1),x.triggerDone();return}if(e==="ABM"){const s=p.crFriendNotMeTarg(t.creatId);if(s.tribe="AB",f.creatByTarget(s).length===0){x.triggerDone();return}}this.notme&&(this.playTarg.notMe=t.creatId);const i=D.toActions(this.playTarg);i.length>0?(i.forEach(s=>{s.param=t.creatId}),this.optional&&i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}mawC(){this.faction="N",this.rarity="C",this.name="Abyssal Maw",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=-this.boof359;this.ftext=`If there is another friendly Abomination, give an enemy creature ${m.jr9(t,t)}.`}mawF(t,e){this.logAct(!1,t);const i=-this.boof359;t.buff(i,i)}aconC(){this.faction="A",this.rarity="C",this.name="Aegis Conscript",this.iAttack=this.boof3612,this.iHealth=this.boof6915,this.tribe.push("HM"),this.playTarg.canArmor=!0,this.playTarg.player="F",this.ftext=`Give a friendly creature Armor ${this.boof124}.`}aconF(t,e){this.logAct(!1,t),t.addArmor(this.boof124)}binvC(){this.faction="A",this.rarity="C",this.name="Battletech Inventor",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("MM"),this.playTarg.player="E",this.ftext=`Give an enemy creature ${m.jr9(-this.iAttack,0)}.`}binvF(t,e){this.logAct(!1,t),t.buff(-this.iAttack,0)}bsrC(){if(this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.iAttack=this.boof5813,this.iHealth=this.boof3712,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.playTarg.level=D.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy an enemy ${m.levelGateText(t,!0)}creature.`,this.optional=!0}else this.hints=["LG"]}bsrF(t,e){W.destroy(t,this.code)}bawC(){this.faction="U",this.rarity="R",this.name="Brambleaxe Warrior",this.iAttack=this.boof61014,this.iHealth=this.iAttack-4,this.tribe.push("HM"),this.playTarg.hint=["BF"],this.ftext="Give a creature Breakthrough this turn."}bawF(t,e){this.logAct(!1,t);const i=p.mod("BT",!0,e.id);i.expiry="ET",t.addMod(i)}cacC(){this.faction="N",this.rarity="H",this.name="Cacklebones",this.iAttack=this.boof5915,this.iHealth=this.iAttack-this.level,this.tribe.push("SK"),this.playTarg.level=D.ddf2(this.level),this.playTarg.player="E",this.ftext=`Destroy an enemy ${m.levelGateText(this.level,!0)}creature. If you do, the enemy player may play an additional card next turn.`,this.optional=!0}cacF(t,e){W.destroy(t,this.code);const i=v.toPlayer(t.owner),s=p.trigger("TS",this.code);s.bonus=this.avgSpawnNug(),i.triggers.push(s)}chaC(){this.faction="U",this.rarity="R",this.name="Chistlehearth Archer",this.iAttack=this.boof2510,this.iHealth=this.iAttack+7,this.tribe.push("HM");const t=this.boof4816;this.playTarg.player="E",this.playTarg.hasMobility=!0,this.ftext=`Deal ${t} damage to an enemy creature with Mobility. Negate Mobility from that creature.`}chaF(t,e){t.hurtDirect(this.boof4816,this.code),t.negateMobility=!0}ccC(){this.faction="N",this.rarity="C",this.name="Corpse Crawler",this.iAttack=this.boof81220,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.hints=[this.lValH(["ZZ-1","ZZ-2","ZZ-5"])],this.playTarg.player="F",this.ftext="Destroy a friendly creature."}ccF(t,e){W.destroy(t,this.code)}friC(){this.faction="T",this.rarity="C",this.name="Flamerift Instigator",this.iAttack=this.lValN([7,12,17]),this.iHealth=this.iAttack-5,this.tribe.push("GT"),this.ftext="Negate Defender from a creature."}friF(t,e){this.logAct(!1,t),t.negateDefender=!0}freavC(){if(this.faction="N",this.rarity="H",this.name="Fleshreaver",this.iAttack=this.boof6915,this.iHealth=this.boof235,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.consistent=!0,this.playTarg.level=D.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy a ${m.levelGateText(t)} enemy creature.`,this.optional=!0}else this.hints=["LG"]}freavF(t,e){W.destroy(t,this.code)}get fiendBof(){return this.lValN([-1,-2,-5])}gfiendC(){this.faction="N",this.rarity="C",this.name="Gloomfiend",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=this.fiendBof;this.ftext=`You may give an enemy creature ${m.jr9(t,t)}.`,this.optional=!0}gfiendF(t,e){this.logAct(!1,t);const i=this.fiendBof;t.buff(i,i)}grwC(){this.faction="N",this.rarity="C",this.name="Gloomreaper Witch",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof147;this.playTarg.maxAttack=t,this.playTarg.player="E",this.ftext=`You may destroy an enemy creature with ${t} or less attack.`,this.optional=!0}grwF(t,e){W.destroy(t,this.code)}grhC(){this.faction="U",this.rarity="C",this.name="Grove Huntress",this.iAttack=this.boof4711,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.playTarg.player="F";const t=this.boof135;this.ftext=`Give a friendly creature ${m.jr9(t,t)}.`}grhF(t,e){this.logAct(!1,t);const i=this.boof135;t.buff(i,i)}houndC(){this.faction="T",this.rarity="C",this.name="Magma Hound",this.iAttack=this.boof4813,this.iHealth=this.iAttack-1,this.tribe.push("ER","EL");const t=this.boof246;this.optional=!0,this.playTarg.player="E",this.ftext=`You may deal ${t} damage to an enemy creature.`}houndF(t,e){t.hurtDirect(this.boof246,this.code)}mtxC(){this.faction="A",this.rarity="C",this.name="Matrix Warden",this.iAttack=this.lValN([3,8,12]),this.iHealth=this.iAttack,this.tribe.push("RB");const t=this.boof3510;this.playTarg.player="F",this.ftext=`Give a friendly creature ${m.jr9(t,0)}.`}mtxF(t,e){this.logAct(!1,t),t.buff(this.boof3510,0)}ngbC(){this.faction="T",this.rarity="C",this.name="Nargath Bruiser",this.iAttack=this.boof5814,this.iHealth=this.iAttack-1,this.tribe.push("ER","AS");const t=this.boof248;this.playTarg.player="F",this.ftext=`Give a friendly creature ${m.jr9(0,t)}.`}ngbF(t,e){this.logAct(!1,t),t.buff(0,this.boof248)}phxsC(){this.faction="A",this.rarity="R",this.name="Phalanx Squadron",this.iAttack=this.boof3714,this.iHealth=this.boof61117,this.tribe.push("HM"),this.playTarg.hasArmor=!0,this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature with Armor ${m.jr9(t,t)}.`}phxsF(t,e){this.logAct(!1,t);const i=this.boof234;t.buff(i,i)}rotC(){this.faction="N",this.rarity="C",this.name="Rot Wanderer",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.playTarg.maxAttack=this.iAttack,this.playTarg.player="E",this.ftext=`Destroy an enemy creature with ${this.iAttack} or less attack.`}rotF(t,e){W.destroy(t,this.code)}schyC(){this.faction="N",this.rarity="C",this.name="Scourge Hydra",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("HY"),this.playTarg.player="F",this.ftext="Deal 3 damage to a friendly creature."}schyF(t,e){t.hurtDirect(3,this.code)}stdC(){this.faction="A",this.rarity="H",this.name="Shardthief Druid",this.iAttack=this.boof5813,this.iHealth=this.boof81318,this.tribe.push("MM"),this.playTarg.canRegen,this.playTarg.player="E",this.ftext=`Negate and remove all Regenerate from an enemy creature. ${this.name} gets that much Renerate.`}stdF(t,e){this.logAct(!1,t);const i=t.regen;t.negateRegen=!0,e.addRegen(i)}surzC(){this.faction="N",this.rarity="L",this.name="Suruzal, Emissary of Varna",this.iAttack=this.boof4814,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.playTarg.player="F",this.playTarg.level=D.ddf2(this.level),this.notme=!0,this.ftext=`You may destroy another friendly ${m.levelGateText(this.level,!0)}creature. If you do, spawn a copy of it.`}surzF(t,e){const i=R.tick();W.destroy(t,this.code,i),f.birth(t.code,"S",e.owner,void 0,i)}vnfC(){this.faction="U",this.rarity="R",this.name="Venomfang",this.iAttack=this.boof61014,this.iHealth=this.iAttack-2,this.tribe.push("SN");const t=this.boof246;this.playTarg.player="E",this.ftext=`Give an enemy creature Poison ${t}.`}vnfF(t,e){this.logAct(!1,t),t.addPoison(this.boof246)}wbyC(){this.faction="T",this.rarity="R",this.name="Wallbreaker Yeti",this.iAttack=this.boof4712,this.iHealth=this.boof71116,this.tribe.push("ER","YT"),this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${m.levelGateText(this.level,!0)}enemy creature with Defender.`,this.optional=!0}wbyF(t,e){W.destroy(t,this.code)}wbuC(){this.faction="T",this.rarity="C",this.name="Warbringer Uranti",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("LT","YT");const t=this.boof4812;this.notme=!0,this.playTarg.player="F",this.addSp("A",t),this.ftext=`Give another friendly creature ${m.jr9(t,0)} this turn.`}wbuF(t,e){this.logAct(!1,t);const i=p.mod("AT",this.boof4812,e.id);i.expiry="ET",t.addMod(i)}dogsC(){this.faction="N",this.rarity="R",this.name="Xithian Direhound",this.iAttack=4,this.iHealth=4,this.tribe.push("AB"),this.overload=!0,this.maxLevel=1,this.optional=!0,this.playTarg.player="E",this.ftext=`You may give an enemy creature ${m.jr9(-4,-4)}.`}dogsF(t,e){this.logAct(!1,t),t.buff(-4,-4)}}class G extends kt{lookup(t){return{["AGW"]:{c:()=>this.awingC(),z:i=>this.awingZ(i)},["ASG"]:{c:()=>this.asurgeC(),z:i=>this.asurgeZ(i)},["ATZ"]:{c:()=>this.anatC(),z:i=>this.anatZ(i)},["AQE"]:{c:()=>this.aqatC(),z:i=>this.aqatZ(i)},["ABL"]:{c:()=>this.ablC(),z:i=>this.ablZ(i)},["BFT"]:{c:()=>this.bftC(),z:i=>this.bftZ(i)},["BTM"]:{c:()=>this.botC(),z:i=>this.botZ(i)},["CSU"]:{c:()=>this.csurgeC(),z:i=>this.csurgeZ(i)},["CNT"]:{c:()=>this.ctmsC(),z:i=>this.ctmsZ(i)},["CTW"]:{c:()=>this.cullC(),z:i=>this.cullZ(i)},["CTV"]:{c:()=>this.cultC(),z:i=>this.cultZ(i)},["CAG"]:{c:()=>this.cypaC(),z:i=>this.cypaZ(i)},["CBS"]:{c:()=>this.cypbC(),z:i=>this.cypbZ(i)},["DDF"]:{c:()=>this.dendC(),z:i=>this.dendZ(i)},["DBT"]:{c:()=>this.dreadC(),z:i=>this.dreadZ(i)},["DYB"]:{c:()=>this.drybC(),z:i=>this.drybZ(i)},["ETN"]:{c:()=>this.elnC(),z:i=>this.elnZ(i)},["ENP"]:{c:()=>this.enpC(),z:i=>this.enpZ(i)},["ENR"]:{c:()=>this.rageC(),z:i=>this.rageZ(i)},["EFA"]:{c:()=>this.efauC(),z:i=>this.efauZ(i)},["EXD"]:{c:()=>this.expdmC(),z:i=>this.expdmZ(i)},["FIN"]:{c:()=>this.feralC(),z:i=>this.feralZ(i)},["FVA"]:{c:()=>this.fervassC(),z:i=>this.fervassZ(i)},["FJT"]:{c:()=>this.fjetC(),z:i=>this.fjetZ(i)},["FLN"]:{c:()=>this.flncC(),z:i=>this.flncZ(i)},["FFL"]:{c:()=>this.ffldC(),z:i=>this.ffldZ(i)},["FZS"]:{c:()=>this.frozC(),z:i=>this.frozZ(i)},["GTH"]:{c:()=>this.ghastC(),z:i=>this.ghastZ(i)},["GCR"]:{c:()=>this.crushC(),z:i=>this.crushZ(i)},["HAR"]:{c:()=>this.hartC(),z:i=>this.hartZ(i)},["IFR"]:{c:()=>this.izftC(),z:i=>this.izftZ(i)},["JPK"]:{c:()=>this.jpC(),z:i=>this.jpZ(i)},["LBR"]:{c:()=>this.lbrandC(),z:i=>this.lbrandZ(i)},["LYS"]:{c:()=>this.shartC(),z:i=>this.shartZ(i)},["MPH"]:{c:()=>this.morphC(),z:i=>this.morphZ(i)},["MSC"]:{c:()=>this.sculptC(),z:i=>this.sculptZ(i)},["NNS"]:{c:()=>this.nanoC(),z:i=>this.nanoZ(i)},["NSL"]:{c:()=>this.natselC(),z:i=>this.natselZ(i)},["NCF"]:{c:()=>this.nflayC(),z:i=>this.nflayZ(i)},["NCV"]:{c:()=>this.nviveC(),z:i=>this.nviveZ(i)},["OEX"]:{c:()=>this.oexpC(),z:i=>this.oexpZ(i)},["OSS"]:{c:()=>this.orssC(),z:i=>this.orssZ(i)},["PTR"]:{c:()=>this.pwtorC(),z:i=>this.pwtorZ(i)},["PSG"]:{c:()=>this.psurgeC(),z:i=>this.psurgeZ(i)},["PMS"]:{c:()=>this.pslamC(),z:i=>this.pslamZ(i)},["ROG"]:{c:()=>this.rotgC(),z:i=>this.rotgZ(i)},["SAP"]:{c:()=>this.sapC(),z:i=>this.sapZ(i)},["SVO"]:{c:()=>this.soathC(),z:i=>this.soathZ(i)},["SOC"]:{c:()=>this.scythC(),z:i=>this.scythZ(i)},["SOA"]:{c:()=>this.soaC(),z:i=>this.soaZ(i)},["SOD"]:{c:()=>this.sodC(),z:i=>this.sodZ(i)},["SOT"]:{c:()=>this.sotC(),z:i=>this.sotZ(i)},["SHG"]:{c:()=>this.shgrC(),z:i=>this.shgrZ(i)},["SNB"]:{c:()=>this.snbC(),z:i=>this.snbZ(i)},["SHV"]:{c:()=>this.sharvC(),z:i=>this.sharvZ(i)},["SRP"]:{c:()=>this.sreapC(),z:i=>this.sreapZ(i)},["STR"]:{c:()=>this.sttorC(),z:i=>this.sttorZ(i)},["STO"]:{c:()=>this.sptorC(),z:i=>this.sptorZ(i)},["SOV"]:{c:()=>this.sovC(),z:i=>this.sovZ(i)},["STN"]:{c:()=>this.stbrnC(),z:i=>this.stbrnZ(i)},["STP"]:{c:()=>this.ssperC(),z:i=>this.ssperZ(i)},["SIN"]:{c:()=>this.sinC(),z:i=>this.sinZ(i)},["TGL"]:{c:()=>this.tanglC(),z:i=>this.tanglZ(i)},["TPT"]:{c:()=>this.tpactC(),z:i=>this.tpactZ(i)},["TUP"]:{c:()=>this.tugC(),z:i=>this.tugZ(i)},["TOT"]:{c:()=>this.totsC(),z:i=>this.totsZ(i)},["TOB"]:{c:()=>this.blightC(),z:i=>this.blightZ(i)},["TXB"]:{c:()=>this.txbnC(),z:i=>this.txbnZ(i)},["TXS"]:{c:()=>this.sporeC(),z:i=>this.sporeZ(i)},["TCG"]:{c:()=>this.tremcC(),z:i=>this.tremcZ(i)},["URS"]:{c:()=>this.urstC(),z:i=>this.urstZ(i)},["VSK"]:{c:()=>this.vensC(),z:i=>this.vensZ(i)},["VGR"]:{c:()=>this.vgraC(),z:i=>this.vgraZ(i)},["VGL"]:{c:()=>this.vglchC(),z:i=>this.vglchZ(i)},["VOB"]:{c:()=>this.vobC(),z:i=>this.vobZ(i)},["VYE"]:{c:()=>this.vembC(),z:i=>this.vembZ(i)},["UBL"]:{c:()=>this.uboltC(),z:i=>this.uboltZ(i)},["WMM"]:{c:()=>this.warC(),z:i=>this.warZ(i)},["XRW"]:{c:()=>this.xwillC(),z:i=>this.xwillZ(i)}}[t]}cardCast(t,e){this.lookup(t).z(e)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.cardCode()==="NSL"&&f.creatByTarget(p.crFriendTarg()).length<5||t.push(this.playTarg),t}handleAction(t){const e=f.ddf6(t);this.logSpell(this.xl?e:void 0),this.cardCast(this.cardCode(),e),S.spellCast()}ddf8(t){const e=Dt.extractCardCode(t.trigger.logicCode);if(e==="TOB"&&t.trigger.type==="DM"){const i=O.toDamage(t.event);if(i.battle&&i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId)return this.level===3?!0:L.getCard(i.hurtCreat.code).level<=this.level}else if((e==="ABL"||e==="OEX"||e==="VOB")&&t.trigger.type==="DM"){const i=t.event;return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId}else if((e==="FZS"||e==="IFR")&&t.trigger.type==="DM"){const i=t.event;if(i.isCreatTarg&&i.target===t.creatId)return!0}else if(e==="DYB"&&t.trigger.type==="EF"){const i=O.toEnterField(t.event);return t.trigger.creatId!==i.creature.id&&i.creature.owner===t.owner}else if(e==="FVA"&&t.trigger.type==="FK"||e==="ROG"&&t.trigger.type==="DS"||e==="SHG"&&(t.trigger.type==="PT"||t.trigger.type==="VN")||(e==="IFR"||e==="OEX")&&t.trigger.type==="PT")return!0;return!1}jr8(t){const e=Dt.extractCardCode(t.trigger.logicCode);if(e==="TOB"){const i=t.event,s=f.jr5(i.target);s.status==="A"&&W.destroy(s,this.code)}else if(e==="ABL")f.jr5(t.creatId).buff(this.level,this.level);else if(e==="FVA"){const i=f.jr5(t.creatId),s=f.searchByLane(f.oppositeLane(i.lane),!i.owner);s&&s.hurtDirect(this.boof3612,i.code)}else if(e==="FZS"||e==="IFR"&&t.trigger.type==="DM"){const i=f.jr5(t.creatId);i.status==="A"&&W.destroy(i,this.code)}else if(e==="ROG"||e==="DYB")f.jr5(t.creatId).buff(this.level,this.level);else if(e==="SHG"){if(t.trigger.type==="VN"){const i=t.event,s=f.jr5(i.creatId);f.birth(s.code,"S",t.owner)}else if(t.trigger.type==="PT"){const i=t.trigger.customCode,s=f.jr5(t.creatId);s.triggers.filter(u=>u.customCode===i).forEach(u=>s.removeTrigger(u))}}else if(e==="IFR"&&t.trigger.type==="PT"){const i=T.deTil(t.trigger.customCode),s=i[1],h=f.jr5(t.creatId);if(i[0]==="P2"){const u=p.trigIdx(h.triggers,t.trigger);h.triggers[u].customCode=T.enTil("P1",s)}else{const u=h.triggers.find(g=>g.customCode===s);u&&h.removeTrigger(u),h.removeTrigger(t.trigger)}}else if(e==="OEX"){if(t.trigger.type==="DM"){const i=t.event,s=f.qEnemyCreats(),h=s.length,u=R.tick();let g;h>0&&(this.level===1?g=[s[T.randInt(0,h)]]:this.level===2?(g=s.splice(T.randInt(0,h),1),s.length>0&&g.push(s[T.randInt(0,h-1)])):g=s,g.forEach(y=>y.hurtDirect(i.dmg,this.code,u)))}else if(t.trigger.type==="PT"){const i=t.trigger.customCode,s=f.jr5(t.creatId);s.triggers.filter(u=>u.customCode===i).forEach(u=>s.removeTrigger(u))}}else if(e==="VOB"){const i=O.toDamage(t.event);i.srcCreat.hurtDirect(i.dmg,this.code)}else super.jr8(t);x.triggerDone()}rankT(){return`If you are rank ${this.level+1} or higher`}awingC(){this.faction="A",this.rarity="R",this.name="Aegis Wings",this.text=`Give a creature ${m.jr9(this.boof369,0)}. Then if that creature has the highest attack, it also gets Mobility 1 and Armor ${this.boof246}.`,this.playTarg.hint=["BF"]}awingZ(t){t.buff(this.boof369,0);const e=t.attack;f.qActiveCreats().every(i=>i.attack<=e)&&(t.addMobility(1),t.addArmor(this.boof246))}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.canMove=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Mobility ${this.level}.`}asurgeZ(t){t.addMobility(this.level)}anatC(){this.faction="A",this.rarity="C",this.name="Anatomize",this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(-this.boof4816,0)}.~You may play an additional ${this.name} this turn.`}anatZ(t){t.buff(-this.boof4816,0);const e=E.freeCard(this.code);e.condition.cardCode="ATZ"}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${m.jr9(0,this.boof51015)}.`,this.playTarg.hint=["BF"]}aqatZ(t){t.buff(0,this.boof51015)}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${m.dbdtap()}, it gets ${m.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}ablZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("OL")}bftC(){this.faction="N",this.rarity="C",this.name="Bitterfrost Totem";const t=this.boof4812n;this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(t,t)}. ${this.rankT()}, it gets an additional ${m.jr9(-2,-2)}.`}bftZ(t){const e=this.boof4812n-(v.getActive().rank>this.level?2:0);t.buff(e,e)}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.xl=!1,this.text=`Replace an enemy ${m.levelGateText(this.level,!0)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level)}botZ(t){f.birth(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof123n;this.text=`Give a creature ${m.jr9(t,t)}.`,this.playTarg.hint=["DB"]}csurgeZ(t){const e=this.boof123n;t.buff(e,e)}ctmsC(){this.faction="A",this.rarity="R",this.name="Countermeasure";const t=this.boof4816;this.text=`Give an enemy creature ${m.jr9(-t,0)}, or give a friendly creature ${m.jr9(t,0)}.`}ctmsZ(t){const e=this.boof4816;t.owner===v.getActiveB()?t.buff(e,0):t.buff(-e,0)}cullC(){this.faction="N",this.rarity="C",this.name="Cull the Weak",this.xl=!1;const t=this.boof4814;this.text=`Destroy a creature with ${t} or less attack.`,this.playTarg.maxAttack=t,this.playTarg.hint=["KL"]}cullZ(t){W.destroy(t,this.code)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate",this.xl=!1;const t=L.getCard(z.tffc(this.level));this.text=`Replace a friendly Plant with a ${m.tokName(t)}.`,this.playTarg.player="F",this.playTarg.tribe="PL"}cultZ(t){f.birth(z.tffc(this.level),"R",t.owner,t.lane)}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof246;this.text=`Give a creature in a center lane ${m.jr9(t,t)}.`,this.playTarg.lanes=3,this.playTarg.hint=["BF"]}cypaZ(t){const e=this.boof246;t.buff(e,e)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${m.jr9(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.hint=["BF"],this.playTarg.faction="A"}cypbZ(t){t.buff(this.boof51015,0),t.addArmor(this.boof124)}dendC(){this.faction="U",this.rarity="R",this.name="Dendrify",this.xl=!1,this.level===3&&(this.isFree=!0,this.overload=!0),this.text=`Replace a ${m.levelGateText(this.level+1,!0)}creature with a 7/7 Treefolk.`,this.playTarg.level=D.ddf2(this.level+1)}dendZ(t){f.birth(`${"SXT"}${this.level}`,"R",t.owner,t.lane)}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.xl=!1,this.hints=["LG"],this.text=`Destroy a ${m.levelGateText(this.level,!0)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"]}dreadZ(t){W.destroy(t,this.code)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${m.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${m.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}drybZ(t){t.buff(this.level,this.level),t.changed=!0,t.jr4("EF",this.code)}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.isFree=this.level===3,this.text=`Give a ${m.levelGateText(this.level,!0)}creature Defender.`,this.playTarg.canDefender=!0}enpZ(t){t.defender=!0}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${m.jr9(-this.boof51015,0)}.`,this.playTarg.hint=["DB"]}elnZ(t){t.buff(-this.boof51015,0)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${m.jr9(t,t)}.`,this.playTarg.hint=["BF"]}rageZ(t){const e=this.boof3612;t.buff(e,e)}efauC(){this.faction="T",this.rarity="R",this.name="Everflame Aura",this.text=`Deal ${this.level+6} damage to an enemy creature, or give a friendly creature Mobility ${this.level}.`}efauZ(t){t.owner===v.getActiveB()?t.addMobility(this.level):t.hurtDirect(this.level+6,this.code)}expdmC(){this.faction="N",this.rarity="H",this.name="Explosive Demise",this.xl=!1,this.text=`Destroy a friendly ${m.levelGateText(this.level+1,!0)}creature.~Deal damage equal to its attack to the enemy player.${this.level===3?"~You gain that much health.":""}`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F"}expdmZ(t){const e=t.attack;W.destroy(t,this.code),v.hurtDirect("E",e,this.code),this.level===3&&v.heal("F",e)}get fiboof(){return this.lValN([1,3,8])}feralC(){this.faction="U",this.rarity="C",this.name="Feral Instinct";const t=this.fiboof;this.text=`Give a creature ${m.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"]}feralZ(t){const e=this.fiboof;t.breakthrough=!0,t.buff(e,e)}fervassC(){this.faction="T",this.rarity="H",this.name="Fervent Assault",this.playTarg.player="F",this.text=`Give a friendly creature Mobility ${this.level} and "Flank: Deal ${this.boof3612} damage to the opposing creature.`}fervassZ(t){t.changed=!0,t.addMobility(this.level),t.jr4("FK",this.code)}fjetC(){this.faction="T",this.rarity="C",this.name="Flame Jet",this.playTarg.hint=["HR"],this.text=`Deal ${this.boof3915} damage to a creature. ${this.rankT()}, deal an additional 3 damage.`}fjetZ(t){t.hurtDirect(this.boof3915,this.code),v.getActive().rank>this.level&&t.hurtDirect(3,this.code)}flncC(){this.faction="T",this.rarity="R",this.name="Flame Lance",this.xl=!1;const t=this.boof579;this.text=`Deal ${t} damage to an enemy creature and ${t} damage to the enemy player.`,this.playTarg.player="E"}flncZ(t){const e=this.boof579;t.hurtDirect(e,this.code),v.hurtDirect("E",e,this.code)}ffldC(){this.faction="A",this.rarity="C",this.name="Forcefield",this.playTarg.canArmor=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Armor ${this.boof51020} this turn.`}ffldZ(t){const e=p.mod("AR",this.boof51020,this.code);e.expiry="ET",t.addMod(e)}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"],this.text=`Give a ${m.levelGateText(this.level,!0)}creature "When this is dealt damage, destroy it".`}frozZ(t){t.changed=!0,t.jr4("DM",this.code)}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${m.jr9(t,t)}.`,this.playTarg.hint=["DB"]}ghastZ(t){const e=-this.boof3612;t.buff(e,e)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.xl=!1,this.isFree=this.level>1,this.isFree||(this.hints=["LG"]),this.playTarg.player="E",this.playTarg.hasDefender=!0,this.text=`Destroy an enemy creature with Defender.${this.level===3?" Deal damage equal to its health to the enemy player.":""}`}crushZ(t){const e=t.health;W.destroy(t,this.code),this.level===3&&v.hurtDirect(t.owner,e,this.code)}hartC(){this.faction="A",this.rarity="C",this.name="Heavy Artillery",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}izftC(){this.faction="T",this.rarity="T",this.name="Iztek's Frost",this.isFree=this.level===3,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hint=["KL"],this.text=`Until the end of the next turn, give a ${m.levelGateText(this.level+1,!0)}creature "When this is dealt damage, destroy it".`}izftZ(t){const e=R.genId(),i=t.jr4("DM",this.code);i.changes=!0,i.customCode=e;const s=t.jr4("PT",this.code);s.customCode=T.enTil("P2",e)}jpC(){this.faction="A",this.rarity="C",this.name="Jet Pack",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof369,0)} and Mobility 1.`}jpZ(t){t.buff(this.boof369,0),t.addMobility(1)}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hint=["BF"],this.text=`Give a ${m.levelGateText(this.level+1)}creature ${m.jr9(this.boof124,0)} and Aggressive this turn.`}lbrandZ(t){const e=p.mod("AT",this.boof124,this.code),i=p.mod("AG",!0,this.code);e.expiry="ET",i.expiry="ET",t.addMod(e),t.addMod(i)}shartC(){this.faction="U",this.rarity="R",this.name="Lysian Shard",this.overload=!0,this.maxLevel=1,this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(6,6)}.`}shartZ(t){t.buff(6,6)}morphC(){this.faction="U",this.rarity="H",this.name="Metamorphosis",this.xl=!1,this.text=`Replace a ${m.levelGateText(this.level,!0)}creature with a 0/3 Feywing Chrysalis.`,this.playTarg.level=D.ddf2(this.level)}morphZ(t){f.birth(`${"FWC"}1`,"R",t.owner,t.lane)}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.level===3?this.isFree=!0:this.hints=["LG"],this.playTarg.level=D.ddf2(this.level+1),this.text=`Remove all abilities from a ${m.levelGateText(this.level+1,!0)}creature.`,this.playTarg.hint=["DB"]}sculptZ(t){t.wipeAll()}nanoC(){this.faction="A",this.rarity="R",this.name="Nanoswarm",this.playTarg.level=D.ddf2(this.level),this.text=`Give a ${m.levelGateText(this.level,!0)}creature ${m.jr9(-this.boof51015,0)} and remove all abilities from it.`,this.playTarg.hint=["DB"]}nanoZ(t){t.buff(-this.boof51015,0),t.wipeAll()}natselC(){this.faction="U",this.rarity="R",this.name="Natural Selection",this.xl=!1,this.text=`If there is a friendly creature in each lane, destroy a ${m.levelGateText(this.level,!0)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"]}natselZ(t){W.destroy(t,this.code)}nflayC(){this.faction="N",this.rarity="C",this.name="Necroflay";const t=-this.boof3711;this.text=`Give a creature ${m.jr9(t,t)}.~You may play an additional ${this.name} this turn.`,this.playTarg.hint=["DB"]}nflayZ(t){const e=-this.boof3711;t.buff(e,e);const i=E.freeCard(this.code);i.condition.cardCode="NCF"}nviveC(){this.faction="N",this.rarity="C",this.name="Necrovive",this.playTarg.canRegen=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Regenerate ${this.boof3612}.`}nviveZ(t){t.addRegen(this.boof3612)}oexpC(){this.faction="A",this.rarity="H",this.name="Oratek Explosives",this.playTarg.player="F";const t=this.lValS(["an enemy creature at random","up to two enemy creatures at random","each enemy creature"]);this.text=`Give a friendly creature ${m.jr9(5,0)}.~Allied Tempys: This turn, when that creature ${m.dbdtap()}, deal that much damage to ${t}.`}oexpZ(t){if(t.buff(5,0),E.allied("T")){const e=R.genId(),i=t.jr4("DM",this.code);i.changes=!0,i.customCode=e;const s=t.jr4("PT",this.code);s.customCode=e,t.hints.push("OL")}}orssC(){this.faction="A",this.rarity="C",this.name="Oreian Steelskin",this.playTarg.canArmor=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Armor ${this.boof246}. ${this.rankT()}, it gets an additional Armor 1.`}orssZ(t){const e=v.getActive().rank>this.level?1:0;t.addArmor(this.boof246+e)}pwtorC(){this.faction="A",this.rarity="R",this.name="Power Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.level,this.level)}.`}psurgeZ(t){t.buff(this.level,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof71116,0)} this turn.`}pslamZ(t){const e=p.mod("AT",this.boof71116,this.code);e.expiry="ET",t.addMod(e)}rotgC(){this.faction="N",this.rarity="H",this.name="Rite of the Grimgaunt",this.playTarg.hint=["BF"],this.text=`Give a creature "When a creature is destroyed, this gets ${m.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0,t.jr4("DS",this.code)}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=D.ddf2(this.level),this.text=`Reduce a ${m.levelGateText(this.level,!0)}creature's attack to 0.`,this.playTarg.hint=["DB"]}sapZ(t){t.buff(-t.attack,0)}soathC(){this.faction="U",this.rarity="C",this.name="Savage Oath",this.level===1&&(this.hints=["LG"]);const t=this.saboof;this.text=`Give an Uterra creature ${m.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"],this.playTarg.faction="U"}soathZ(t){const e=this.saboof;t.buff(e,e),t.breakthrough=!0}get saboof(){return this.lValN([2,6,15])}scythC(){this.faction="N",this.rarity="L",this.name="Scythe of Chiron";const t=this.boof246;this.playTarg.player="F",this.text=`Each enemy creature gets ${m.jr9(-t,0)}. Give a friendly creature ${m.jr9(t,0)} for each enemy creature.`}scythZ(t){const e=-this.boof246,i=f.qEnemyCreats();i.forEach(s=>{s.buff(e,0)}),i.length>0&&t.buff(-e*i.length,0)}soaC(){this.faction="A",this.rarity="C",this.name="Seal of Anvillon",this.level===1?this.hints=["LG"]:this.consistent=!0,this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.ubzap,0)}.`}soaZ(t){t.buff(this.ubzap,0)}sodC(){this.faction="U",this.rarity="C",this.name="Seal of Deepwood",this.level===1?this.hints=["LG"]:this.consistent=!0;const t=this.derpboof;this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(t,t)}.`}sodZ(t){const e=this.derpboof;t.buff(e,e)}get derpboof(){return this.lValN([1,6,12])}sotC(){this.faction="N",this.rarity="C",this.name="Seal of Tarsus",this.level===1?this.hints=["LG"]:this.consistent=!0;const t=this.tars;this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(t,t)}.`}sotZ(t){const e=this.tars;t.buff(e,e)}get tars(){return this.lValN([-2,-8,-16])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.isFree=this.level===3,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F",this.text=`Give a ${m.levelGateText(this.level+1,!0)}friendly creature "Vengeance: Spawn this" this turn.`}shgrZ(t){const e=R.genId(),i=t.jr4("VN",this.code);i.customCode=e,i.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){const e=this.level*f.ddf1().length;t.buff(e,e)}get snbboof(){return-1*(this.level+7)}snbC(){this.faction="A",this.rarity="C",this.name="Sonic Burst",this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(this.snbboof,0)}.`}snbZ(t){t.buff(this.snbboof,0)}sharvC(){this.faction="N",this.rarity="H",this.name="Soul Harvest",this.xl=!1;const t=this.lValS(["an additional level 1 card","an additional card","two additional cards"]);this.text=`Destroy a friendly creature. You may play ${t} this turn.`,this.playTarg.player="F"}sharvZ(t){if(W.destroy(t,this.code),this.level===1){const e=E.freeCard(this.code);e.condition.level=D.ddf2(1)}else E.regularPlays+=this.level-1}sreapC(){this.faction="N",this.rarity="L",this.name="Soulreap",this.xl=!1;const t=this.boof248;this.text=`Destroy an enemy creature with ${t} or less attack. Then Spawn a copy of it.`,this.playTarg.player="E",this.playTarg.maxAttack=t}sreapZ(t){W.destroy(t,this.code),f.birth(t.code,"S",!t.owner)}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.text=`Give a creature Regenerate ${this.boof234}.`,this.playTarg.hint=["BF"],this.playTarg.canRegen=!0}sttorZ(t){t.addRegen(this.boof234)}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.text=`Give a creature Poison ${this.boof234}.`,this.playTarg.hint=["PN"]}sptorZ(t){t.addPoison(this.boof234)}sovC(){this.faction="T",this.rarity="L",this.name="Staff of Vaerus",this.text=`Give a friendly ${m.levelGateText(this.level+1,!0)}creature Mobility ${this.level}. That creature battles an additional time this turn.`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F"}sovZ(t){t.extraBattles+=1,t.addMobility(this.level)}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${m.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hint=["BF"],this.playTarg.hasDefender=!0}stbrnZ(t){const e=this.boof579;t.buff(e,e),t.negateDefender=!0}ssperC(){this.faction="T",this.rarity="C",this.name="Stormspear",this.xl=!1,this.playTarg.hint=["HR"],this.text=`Deal ${this.sspb} to a creature.~You may play an additional ${this.name} this turn.`}ssperZ(t){t.hurtDirect(this.sspb,this.code);const e=E.freeCard(this.code);e.condition.cardCode="STP"}get sspb(){return this.lValN([3,8,12])}tanglC(){this.faction="U",this.rarity="R",this.name="Tangle",this.xl=!1;let t="";this.level===3?t=" You gain health equal to that creature's attack.":this.playTarg.hint=["KL"],this.text=`Destroy a ${m.levelGateText(this.level+1,!0)}creature with Mobility.${t}`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hasMobility=!0}tanglZ(t){W.destroy(t,this.code),this.level===3&&v.heal("F",t.attack)}tpactC(){this.faction="N",this.rarity="C",this.name="Tarsian Pact";const t=this.boof235;this.text=`Give a Nekrium creature ${m.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.hint=["BF"],this.playTarg.faction="N"}tpactZ(t){const e=this.boof235;t.buff(e,e),t.addRegen(e)}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.playTarg.hint=["BF"],this.text=`Give a Robot ${m.jr9(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),t.buff(this.boof4612,0)}totsC(){this.faction="N",this.rarity="T",this.name="Tendrils Of Twilight",this.isFree=!0;const t=-this.boof7911;this.text=`Give an enemy creature ${m.jr9(-1,-1)}.~If that creature is opposing a friendly Duskmaw, give that creature ${m.jr9(t,t)} instead.`,this.playTarg.player="E"}totsZ(t){const e=this.duskBof(t);t.buff(e,e)}duskBof(t){const e=t.opposed;let i=!1;return e&&(i=Dt.extractCardCode(e.code)==="DTD"),i?-this.boof7911:-1}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${m.dbdtac(this.level)}, destroy that creature."`,this.playTarg.hint=["BF"]}blightZ(t){t.changed=!0,t.jr4("DM",this.code)}txbnC(){this.faction="U",this.rarity="R",this.name="Toxic Boon";const t=this.boof357;this.text=`Give an enemy creature Poison ${t}, or give a friendly creature ${m.jr9(t,t)}.`}txbnZ(t){const e=this.boof357;t.owner===v.getActiveB()?t.buff(e,e):t.addPoison(e)}get tspois(){return this.lValN([5,7,12])}sporeC(){this.faction="U",this.rarity="C",this.name="Toxic Spores",this.text=`Give a creature Poison ${this.tspois}.`,this.playTarg.hint=["PN"]}sporeZ(t){t.addPoison(this.tspois)}tremcC(){this.faction="T",this.rarity="C",this.name="Tremorcharge",this.text=`Give a Tempys creature ${m.jr9(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T",this.playTarg.hint=["BF"]}tremcZ(t){t.buff(0,this.boof4812),t.addMobility(this.level)}uboltC(){this.faction="T",this.rarity="R",this.name="Uranti Bolt",this.xl=!1,this.text=`Deal ${this.ubzap} damage to a creature.~It gets Defender until the end of the next turn.`}uboltZ(t){t.hurtDirect(this.ubzap,this.code);const e=p.mod("DF",!0,this.code);e.expiry="EN",t.addMod(e)}get ubzap(){return this.lValN([3,10,20])}urstC(){this.faction="U",this.rarity="C",this.name="Ursine Strength";const t=this.boof3711;this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(t,t)}. ${this.rankT()}, it gets an additional ${m.jr9(2,2)}.`}urstZ(t){const e=this.boof3711+(v.getActive().rank>this.level?2:0);t.buff(e,e)}vensC(){this.faction="U",this.rarity="C",this.name="Venomstrike",this.playTarg.hint=["PN"],this.text=`Give a creature Poison ${this.boof468}.~You may play an additional ${this.name} this turn.`}vensZ(t){t.addPoison(this.boof468);const e=E.freeCard(this.code);e.condition.cardCode="VSK"}vgraC(){this.faction="U",this.rarity="C",this.name="Verdant Grace",this.playTarg.player="F",this.text=`Heal ${this.boof101520} damage from a friendly creature and ${this.boof246} health from each other friendly creature.`}vgraZ(t){t.heal(this.boof101520);const e=this.boof246;f.creatByTarget(p.crFriendNotMeTarg(t.id)).forEach(i=>{i.heal(e)})}vglchC(){this.faction="N",this.rarity="R",this.name="Vigor Leech";const t=this.boof369n;this.text=`Give an enemy creature ${m.jr9(t,t)}, or give a friendly creature Regenerate ${-t}.`}vglchZ(t){const e=this.boof369n;t.owner===v.getActiveB()?t.addRegen(-e):t.buff(e,e)}vobC(){this.faction="T",this.rarity="R",this.name="Violent Outburst",this.level===3?this.isFree=!0:this.hints=["LG"],this.text=`Give a ${m.levelGateText(this.level+1,!0)}creature Aggressive and, "When this creature ${m.dbdtap()}, it also deals that much damage to itself."`}vobZ(t){t.aggressive=!0,t.changed=!0,t.jr4("DM",this.code)}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace",this.playTarg.hint=["DB"];const t=this.boof468,e=-t;this.text=`Give a creature ${m.jr9(e,e)}.~You gain ${t} health.`}vembZ(t){const e=this.boof468,i=-e;t.buff(i,i),v.heal(v.getActive(),e)}warC(){this.faction="A",this.rarity="H",this.name="Warmonger Mod";let t=this.level,e=3;this.level===1&&(this.playTarg.level="LN",e=2,t=2),this.playTarg.hint=["BF"],this.text=`Give a ${m.levelGateText(e,!0)}creature ${t}x attack.`}warZ(t){const e=this.level===3?2:1;t.buff(t.attack*e,0)}xwillC(){this.faction="N",this.rarity="H",this.name="Xrath's Will",this.xl=!1;const t=this.boof3612;this.text=`Destroy an enemy creature with ${t} or less attack.~You may play an additional Zombie this turn.`,this.playTarg.player="E",this.playTarg.maxAttack=t}xwillZ(t){W.destroy(t,this.code);const e=E.freeCard(this.code);e.condition.tribe="ZB"}}class He extends M{lookup(t){return{["ATP"]:{c:()=>this.phagC(),t:()=>this.phagT(),f:(i,s)=>this.phagF(i,s)},["SSH"]:{c:()=>this.sshmC(),t:()=>this.sshmT(),f:(i,s)=>this.sshmF(i,s)},["TPG"]:{c:()=>this.pillC(),t:()=>this.pillT(),f:(i,s)=>this.pillF(i,s)},["TMG"]:{c:()=>this.grootC(),t:()=>this.grootT(),f:(i,s)=>this.grootF(i,s)}}[t]}forgTargets(t){return this.lookup(t).t()}forgAction(t,e,i){this.lookup(t).f(e,i)}optional=!0;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Forge: "+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}handleAction(t){const e=f.jr5(t.param);this.forgAction(this.cardCode(),t.position,e),bt.popMode(),S.actionDone(!0)}jr8(t){const e=this.forgTargets(this.cardCode());if(e.length>0){const i=e.map(s=>{const h=p.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return h.param=t.creatId,h.host=this.code,h});if(this.optional){const s=S.noneEndTrigger();s.param="PM",i.push(s)}Ft.showCustomDeck(e,i)}else x.triggerDone()}phagC(){this.faction="U",this.rarity="H",this.name="Aetherphage",this.iAttack=this.lValN([7,10,16]),this.iHealth=this.boof3612,this.tribe.push("IN"),this.ftext=`Look at the ${m.levelGateText(this.level,!0)}spells in the enemy player's hand and choose one. The enemy player discards the chosen spell.`}phagT(){const t=v.toPlayer(!v.getActiveB()),e=p.target("TH");return e.player=v.toTarget(t),e.level=D.ddf2(this.level),e.card="S",Ft.generateContent(t.hand,!1,e)}phagF(t,e){const i=v.toPlayer(!e.owner),s=i.hand[t];i.hand.splice(t,1),i.discard.push(s)}sshmC(){this.faction="U",this.rarity="H",this.name="Soothsayer Hermit",this.iAttack=this.boof61016,this.iHealth=this.iAttack-1,this.tribe.push("LP"),this.ftext=`You may put a ${m.levelGateText(this.level)} creature from your discard pile into your hand.`}sshmT(){const t=v.getActive(),e=p.target("TD");return e.player=v.toTarget(t),e.card="C",e.level=D.ddf2(this.level),Ft.generateContent(t.discard,!1,e)}sshmF(t,e){const i=v.toPlayer(e.owner),s=i.discard.splice(t,1);i.hand.push(s[0])}pillC(){this.faction="N",this.rarity="H",this.name="Tomb Pillager",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("ZB"),this.consistent=this.level>1,this.ftext="You may banish a Nekrium card from your discard pile."}pillT(){const t=v.getActive(),e=p.target("TD");return e.player=v.toTarget(t),e.faction="N",Ft.generateContent(t.discard,!1,e)}pillF(t,e){v.toPlayer(e.owner).discard.splice(t,1)}grootC(){this.faction="U",this.rarity="R",this.name="Toorgmai Guardian",this.iAttack=this.boof4711,this.iHealth=this.iAttack,this.tribe.push("PL");const t=this.boof358;this.ftext=`You may banish a Plant from your discard pile. If you do, ${this.name} gets ${m.jr9(t,t)}.`}grootT(){const t=v.getActive(),e=p.target("TD");return e.player=v.toTarget(t),e.tribe="PL",Ft.generateContent(t.discard,!1,e)}grootF(t,e){v.toPlayer(e.owner).discard.splice(t,1);const s=this.boof358;e.buff(s,s)}}class zi extends mt{jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){f.qEnemyCreats().forEach(e=>{e.addPoison(6)}),x.triggerDone()}}class Zi extends M{constructor(t){super(t),this.faction="U",this.rarity="T",this.name="Dino Knight",this.iAttack=this.lValN([8,12,18]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.iAggro=!0,this.iBT=!0,this.maxLevel=this.level,this.minLevel=this.level;const e=this.boof357;this.text=`When this ${m.dbdtap()}, heal ${e} damage from each other friendly creature.~Vengeance: Put a level ${this.level} Bron, Wild Tamer into this lane.`}image(t){return this.fixedImage(t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("VN");s.bonus=this.buffNug(this.iAttack,this.iHealth);const h=i.jr4("DM");return h.bonus=this.buffNug(0,this.boof357),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="VN"){const e=f.jr5(t.creatId);f.birth("BWT"+this.level,"P",e.owner,e.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,i=p.crNotMeTarg(t.creatId);i.player=v.toTarget(t.owner),f.creatByTarget(i).forEach(h=>h.heal(e)),x.triggerDone()}}}class Yi extends kt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Discordant Strike";const e=-this.boof4610;this.text=`Give an enemy creature ${m.jr9(e,0)}.~Allied Nekrium: Give an enemy creature ${m.jr9(0,e)}.`}playTargets(){const t=super.playTargets(),e=p.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=T.deTil(t.param),i=-this.boof4610,s=f.ddf6(t);e[0]==="P1"?(this.logSpell(s),s.buff(i,0),E.allied("N")?S.ddf5(D.toActions(p.crEnemyActTarg("CARD",this.code,"P2"))):S.spellCast()):(this.logSpell(s),s.buff(0,i),S.spellCast())}}class Ki extends kt{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.isFree=this.level===3,this.level<3&&(this.hints=["LG"]),this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}playTargets(){const t=super.playTargets(),e=this.poisTarg();return this.level===1?t.push(e):f.creatByTarget(e).length>0&&t.push(D.boardTarget("CARD",this.code)),t}handleAction(t){if(this.level===1){const e=f.ddf6(t);this.logSpell(e),e.addPoison(e.poison)}else this.logSpell(),f.creatByTarget(this.poisTarg()).forEach(i=>{i.addPoison(i.poison)});S.spellCast()}poisTarg(){const t=p.crEnemyActTarg("CARD",this.code,"");return t.hasPoison=!0,t}}class Xi extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Doppelbot",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("RB");let e="";const i=this.lValN([0,5,10]);this.level>1&&(e=`, then give it ${m.jr9(i,0)}`),this.text=`Activate: Look at the creatures in the enemy player's hand and choose one. Replace ${this.name} with the chosen creature${e}.`;const s=this.avgCreatureStats();this.bonus={activ8:this.buffNug(i+s[0]-this.iAttack,s[1])}}canActivate(t){return v.toPlayer(!t.owner).hand.some(i=>L.getCard(i).type==="C")}startActivation(t){let e;if(at.simOn)e=[{cardCode:"VND"+this.level,sourceIdx:0,cardCount:0}];else{const s=v.toPlayer(!v.getActiveB()),h=p.target("TH");h.player=v.toTarget(s),h.card="C",e=Ft.generateContent(s.hand,!1,h)}const i=e.map(s=>{const h=p.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return h.param=t.id,h.host=this.code,h});Ft.showCustomDeck(e,i)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),i=f.birth(t.card,"R",e.owner,e.lane);this.level>1&&i?.buff(this.level===3?10:5,0),bt.popMode(),e.endActivation()}}class qi extends M{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Dysian Broodqueen",this.iAttack=this.boof248,this.iHealth=this.boof61117,this.tribe.push("NG");const e=L.getCard(this.bfc()),i=`Destroy an enemy ${m.levelGateText(this.level,!0)}creature.`;this.text=`Activate, destroy another friendly creature: ${i}~Allied Uterra: Put a ${m.tokName(e)} into an available lane.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.5)}}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[1]==="P1"){const i=f.ddf6(t),s=this.enemies(e[0],i.id);s.push(S.cancelAction()),S.ddf5(s)}else if(e[1]==="P2"){this.logAct(!0);const i=f.jr5(e[0]),s=R.tick(),h=f.jr5(e[2]),u=f.ddf6(t);W.destroy(h,this.code,s),W.destroy(u,this.code,s),i.endActivation()}else f.birth(this.bfc(),"P",t.playerA,t.lane),S.actionDone(!0)}jr8(t){if(E.allied("U")){const e=p.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId),i=D.toActions(e);i.length>0?S.ddf5(i):x.triggerDone()}else x.triggerDone()}friends(t){const e=p.crFriendNotMeActTarg("CARD",t,this.code,T.enTil(t,"P1"));return D.toActions(e)}enemies(t,e=""){const i=p.crEnemyActTarg("CARD",this.code,T.enTil(t,"P2",e));return i.level=D.ddf2(this.level),D.toActions(i)}bfc(){return "BRF"+this.level}}class ji extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Dysian Siphon";const e=this.boof357;this.text=`Give an enemy creature ${m.jr9(-e,-e)}.~Allied Uterra: Give a friendly creature ${m.jr9(e,e)}. `}playTargets(){const t=super.playTargets(),e=p.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=T.deTil(t.param),i=this.boof357,s=f.ddf6(t);if(e[0]==="P1"){const h=p.crFriendActTarg("CARD",this.code,T.enTil("P2",s.id)),u=D.toActions(h);E.allied("U")&&u.length>0?(u.push(S.cancelAction()),S.ddf5(u)):(this.logSpell(s),s.buff(-i,-i),S.spellCast())}else{const h=f.jr5(e[1]);this.logSpell(h,s),h.buff(-i,-i),s.buff(i,i),S.spellCast()}}}class Ji extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Dysian Sludge",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ");const e=-this.boof135;this.text=`Forge: If you have health over 120, you may put a copy of ${this.name} into another lane.~When this enters play, if you have a Nekrium card in hand, the opposing creathure gets ${m.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,s.customCode=i.id,i.jr4("EF"),i}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){const e=O.toEnterField(t.event);if(e.forged&&e.creature.id===t.trigger.customCode)if(v.getActive().health>120){const i=p.actionTarget("TF","CARD",this.code,"");i.player="F",i.hint=["FL"],i.lanes=f.laneIdx.filter(h=>h!==e.creature.lane);const s=D.toActions(i);s.push(S.noneEndTrigger()),S.ddf5(s)}else x.triggerDone();else{const i=e.creature.opposed;if(i&&E.allied("N",e.creature.owner)){const s=-this.boof135;i.buff(s,s)}x.triggerDone()}}handleAction(t){f.birth(this.code,"R",t.playerA,t.lane),S.actionDone(!0)}}class Qi extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Echowisp",this.iAttack=this.lValN([7,8,10]),this.iHealth=this.boof135,this.tribe.push("ST"),this.level===3?this.text="Forge: Put a copy of Echowisp into each available lane.":this.text="Forge: You may put a copy of Echowisp into an adjacent lane."}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=this.level<3,i}jr8(t){if(this.level<3){const e=f.jr5(t.trigger.creatId),i=p.actionTarget("TF","CARD",this.code,"");i.player="F",i.lanes=e.adjacent,i.hint=["FL"];const s=D.toActions(i);s.push(S.noneEndTrigger()),S.ddf5(s)}else{const e=p.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId);let i=D.toActions(e);if(i.length>0){const s=R.tick();i.forEach(h=>f.birth(this.code,"P",h.playerA,h.lane,s))}x.triggerDone()}}handleAction(t){f.birth(this.code,"P",t.playerA,t.lane),S.actionDone(!0)}}class ri extends M{lookup(t){return{["BTB"]:{c:()=>this.bbtC(),m:i=>this.bbtM(i)},["TVG"]:{c:()=>this.tvgC(),m:i=>this.tvgM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}armThreshold=1;wipe=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("AR",this.code);return s.area="A",i}enforceEffect(t,e){this.armThreshold<=e.armor?this.createMods(this.cardCode(),e).forEach(i=>{this.wipe&&e.removeModSafe(e.id),e.addModSafe(i)}):e.removeModSafe(e.id)}bbtC(){this.faction="A",this.rarity="R",this.name="Batterbot",this.iAttack=this.boof6914,this.iHealth=this.iAttack+2,this.tribe.push("RB","DN"),this.wipe=!0,this.text=`${this.name} gets +Attack equal to its Armor.`}bbtM(t){return[p.mod("AT",this.boof247,t.id)]}tvgC(){this.faction="A",this.rarity="R",this.name="Tower Vanguard",this.iAttack=this.lValN([3,6,11]),this.iHealth=this.lValN([7,13,21]),this.tribe.push("RB");const t=this.boof247;this.text=`While ${this.name} has Armor, it gets ${m.jr9(t,0)}.`}tvgM(t){return[p.mod("AT",this.boof247,t.id)]}}class me extends M{lookup(t){return{["CIN"]:{c:()=>this.cyinC(),m:i=>this.cyinM(i)},["HWM"]:{c:()=>this.hlwmC(),m:i=>this.hlwmM(i)},["LSP"]:{c:()=>this.lspC(),m:i=>this.lspM(i)},["SSI"]:{c:()=>this.ssinC(),m:i=>this.ssinM(i)},["WTA"]:{c:()=>this.weguC(),m:i=>this.weguM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return i.addEffect("AT",this.code),i}enforceEffect(t,e){this.attThreshold<=e.attack?this.createMods(this.cardCode(),e).forEach(i=>{e.addModSafe(i)}):e.removeModSafe(e.id)}cyinC(){this.faction="A",this.rarity="R",this.name="Cypien Infiltrator",this.iAttack=this.boof61117,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.attThreshold=this.lValN([7,14,21]),this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Breakthrough.`}cyinM(t){return[p.mod("BT",!0,t.id)]}hlwmC(){this.faction="A",this.rarity="L",this.name="Hinterland Watchman",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.lValN([7,10,20]),this.tribe.push("MC"),this.attThreshold=this.boof51020;const t=this.lValS(["Mobility 3","Armor 5 and Mobility 3","Armor 5, Breakthrough, Aggressive, Mobility 3, and Regenerate 5"]);this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets ${t}.`}hlwmM(t){const e=[p.mod("MB",3,t.id)];return this.level>1&&e.push(p.mod("AR",5,t.id)),this.level===3&&(e.push(p.mod("BT",!0,t.id)),e.push(p.mod("AG",!0,t.id)),e.push(p.mod("RG",5,t.id))),e}lspC(){this.faction="A",this.rarity="C",this.name="Lightshield Patrol",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.boof51020,this.tribe.push("HM"),this.attThreshold=this.iHealth,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Armor ${this.boof234}.`}lspM(t){return[p.mod("AR",this.boof234,t.id)]}ssinC(){this.faction="A",this.rarity="R",this.name="Spiritsteel Infiltrator",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("EN"),this.attThreshold=this.boof51020,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Mobility ${this.level} and Armor ${this.boof246}.`}ssinM(t){return[p.mod("MB",this.level,t.id),p.mod("AR",this.boof246,t.id)]}weguC(){this.faction="U",this.rarity="L",this.name="Wegu, the Ancient",this.iAttack=0,this.iHealth=1,this.tribe.push("PL"),this.iDefend=!0,this.attThreshold=this.lValN([10,25,100]);const t=this.boof124,e=this.level===3?"it gets Breakthrough and ":"";this.text=`When you gain health, Wegu gets ${m.jr9(t,t)} for each health you gained.~While Wegu has ${this.attThreshold} or more attack, ${e}Negate Defender from it.`}weguM(t){const e=[p.mod("ND",!0,t.id)];return this.level===3&&e.push(p.mod("BT",!0,t.id)),e}}class si extends M{friendNotMe(t){const e=p.crNotMeTarg(t.id);return e.player=v.toTarget(t.owner),e}friendNone(t){const e=p.crTarg();return e.player=v.toTarget(t.owner),e.lanes=[],e}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforcementActive(t){return t.status==="A"}applyEffect(t,e,i){const s=this.friendNotMe(t),h=f.creatByTarget(s),u=f.creatByTarget(i);h.forEach(g=>{u.includes(g)?g.addModSafe(e):g.removeModSafe(t.id)})}}class Ne extends si{lookup(t){return{["BWW"]:{c:()=>this.bwwC(),m:i=>this.bwwM(i),t:i=>this.bwwT(i)},["HTR"]:{c:()=>this.hrtC(),m:i=>this.hrtM(i),t:i=>this.hrtT(i)},["KKK"]:{c:()=>this.kkkC(),m:i=>this.kkkM(i),t:i=>this.kkkT(i)},["XDV"]:{c:()=>this.xdvC(),m:i=>this.xdvM(i),t:i=>this.xdvT(i)}}[t]}createMod(t,e){return this.lookup(t).m(e)}effTargs(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t,e){const i=this.cardCode(),s=this.createMod(i,e),h=this.enforcementActive(e)?this.effTargs(i,e):this.friendNone(e);this.applyEffect(e,s,h)}bwwC(){this.faction="T",this.rarity="H",this.name="Borean Windweaver",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.iMobile=this.level,this.tribe.push("WN","AS"),this.text=`Each other friendly creature gets Mobility ${this.level}.`}bwwM(t){return p.mod("MB",this.level,t.id)}bwwT(t){return this.friendNotMe(t)}hrtC(){this.faction="U",this.rarity="L",this.name="Heart Tree",this.iAttack=0,this.iHealth=this.lValN([10,15,30]),this.iRegen=this.boof246,this.iDefend=!0,this.tribe.push("PL"),this.text=`Each other friendly creature gets Regenerate ${this.iRegen}.`}hrtM(t){return p.mod("RG",this.iRegen,t.id)}hrtT(t){return this.friendNotMe(t)}kkkC(){if(this.faction="T",this.rarity="L",this.name="Korok, Khan of Kadras",this.iAttack=this.lValN([4,7,12,18]),this.iHealth=this.lValN([7,12,18,26]),this.iAggro=!0,this.tribe.push("FB"),this.maxLevel=4,this.level>1){const t=this.lValS(["","friendly level 1","friendly level 2 or lower","other friendly"]);this.text=`Each ${t} creature gets Aggressive.`}}kkkM(t){return p.mod("AG",!0,t.id)}kkkT(t){const e=this.friendNotMe(t);return this.level===1?e.lanes=[]:e.level=D.ddf2(this.level-1),e}xdvC(){this.faction="N",this.rarity="H",this.name="Xrath, Dreadnight Of Varna",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.boof248,this.tribe.push("ZB"),this.text=`Each other friendly Zombie gets Regenerate ${this.iRegen}`}xdvM(t){return p.mod("RG",this.iRegen,t.id)}xdvT(t){const e=this.friendNotMe(t);return e.tribe="ZB",e}}class _i extends M{lookup(t){return{["AHL"]:{c:()=>this.ahlC(),m:i=>this.ahlM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){const i=p.crNotMeTarg(e.id);i.player=v.toTarget(e.owner),f.creatByTarget(i).length===0?this.createMods(this.cardCode(),e).forEach(h=>{e.addModSafe(h)}):e.removeModSafe(e.id)}ahlC(){this.faction="A",this.rarity="H",this.name="Alloyin Highlander",this.iAttack=this.lValN([5,7,10]),this.iHealth=this.boof6914,this.tribe.push("HM"),this.text=`While ${this.name} is your only friendly creature, it gets ${m.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}ahlM(t){return[p.mod("AT",this.boof4812,t.id),p.mod("AR",this.boof248,t.id)]}}class ai extends M{lookup(t){return{["NXP"]:{c:()=>this.nxpC(),m:i=>this.nxpM(i)},["SKG"]:{c:()=>this.skgC(),m:i=>this.skgM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){e.lane===3?this.createMods(this.cardCode(),e).forEach(i=>{e.addModSafe(i)}):e.removeModSafe(e.id)}nxpC(){this.faction="A",this.rarity="C",this.name="Nexus Pilot",this.iAttack=this.boof358,this.iHealth=this.boof4710,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets ${m.jr9(this.iAttack,this.iHealth)}.`}nxpM(t){return[p.mod("AT",this.iAttack,t.id),p.mod("HL",this.iHealth,t.id),p.mod("MH",this.iHealth,t.id)]}skgC(){this.faction="A",this.rarity="C",this.name="Skyknight Glider",this.iAttack=this.boof5916,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets Mobility 2.`}skgM(t){return[p.mod("MB",2,t.id)]}}class Ue extends M{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:i=>this.cctM(i)},["GHB"]:{c:()=>this.ghbC(),m:i=>this.ghbM(i)},["PYG"]:{c:()=>this.pygC(),m:i=>this.pygM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}likesOpposed=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=[this.likesOpposed?"OP":"OL"]}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){!!e.opposed===this.likesOpposed?this.createMods(this.cardCode(),e).forEach(i=>{e.addModSafe(i)}):e.removeModSafe(e.id)}cctC(){this.faction="T",this.rarity="R",this.name="Cloudcleaver Titan",this.iAttack=this.boof4812,this.iHealth=this.lValN([7,10,16]),this.tribe.push("WN","GT"),this.iMobile=this.level;const t=this.boof246;this.text=`While ${this.name} is unopposed, it gets ${m.jr9(t,0)}.`}cctM(t){return[p.mod("AT",this.boof246,t.id)]}ghbC(){this.faction="U",this.rarity="R",this.name="Gemhide Basher",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.lValN([3,7,10]),this.tribe.push("DN"),this.likesOpposed=!0,this.text=`While ${this.name} is opposed, it gets Aggressive.`}ghbM(t){return[p.mod("AG",!0,t.id)]}pygC(){this.faction="T",this.rarity="H",this.name="Pyre Giant",this.iAttack=this.boof468,this.iHealth=this.boof234,this.tribe.push("FR","GT"),this.iAggro=!0,this.text=`While ${this.name} is unopposed, it gets ${m.jr9(this.iAttack,0)}.`}pygM(t){return[p.mod("AT",this.iAttack,t.id)]}}class ni extends M{lookup(t){return{["BRS"]:{c:()=>this.barryC(),m:i=>this.barryM(i)},["CSR"]:{c:()=>this.cvsC(),m:i=>this.cvsM(i)}}[t]}mPlayer=0;targetPlayer(t){if(this.mPlayer===1)return t.owner;if(this.mPlayer===-1)return!t.owner;throw new Error("didnt write code OBDD")}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){const i=e.status==="A",s=this.targetPlayer(e);if(i){const h=this.createMod(this.cardCode(),e);v.addModSafe(s,h)}else v.removeModSafe(s,e.id)}barryC(){this.faction="A",this.rarity="C",this.name="Barrier Soldier",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("HM"),this.mPlayer=1,this.text=`You get Armor ${this.iHealth}.`}barryM(t){return p.mod("AR",this.iHealth,t.id)}cvsC(){this.faction="U",this.rarity="C",this.name="Cavern Serpent",this.iAttack=this.boof4914,this.iHealth=this.iAttack,this.tribe.push("SN"),this.mPlayer=-1,this.text=`The enemy player has Poison ${this.boof246}.`}cvsM(t){return p.mod("PN",this.boof246,t.id)}}class pe extends si{lookup(t){return{["ALG"]:{c:()=>this.algnC(),m:i=>this.algnM(i)},["ALS"]:{c:()=>this.alstC(),m:i=>this.alstM(i)},["BTN"]:{c:()=>this.btcC(),m:i=>this.btcM(i)},["NXA"]:{c:()=>this.aeroC(),m:i=>this.aeroM(i)},["NXT"]:{c:()=>this.ntcC(),m:i=>this.ntcM(i)}}[t]}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}nexus=!1;enforcementActive(t){return super.enforcementActive(t)?this.nexus?t.lane===3:!0:!1}enforceEffect(t,e){const i=this.cardCode(),s=this.createMod(i,e);let h;this.enforcementActive(e)?(h=this.friendNotMe(e),this.nexus?h.lanes=[1,2,4,5]:h.lanes=e.adjacent):h=this.friendNone(e),this.applyEffect(e,s,h)}algnC(){this.faction="A",this.rarity="R",this.name="Alloyin General",this.iAttack=this.boof246,this.iHealth=this.boof81318,this.tribe.push("HM"),this.text=`Adjacent creatures gets ${m.jr9(this.iAttack,0)}.`}algnM(t){return p.mod("AT",this.iAttack,t.id)}alstC(){this.faction="A",this.rarity="H",this.name="Alloyin Strategist",this.iAttack=this.boof4814,this.iHealth=this.iAttack+1,this.iMobile=this.level,this.tribe.push("HM");const t=this.boof246;this.text=`Adjacent creatures gets ${m.jr9(t,0)}.`}alstM(t){return p.mod("AT",this.boof246,t.id)}btcC(){this.faction="A",this.rarity="H",this.name="Battle Techtician",this.iAttack=this.boof3714,this.iHealth=this.boof71117,this.tribe.push("HM"),this.nexus=!0;const t=this.boof248;this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${m.jr9(t,0)}.`}btcM(t){return p.mod("AT",this.boof248,t.id)}aeroC(){this.faction="A",this.rarity="L",this.name="Nexus Aeronaut",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.iMobile=1;const t=this.boof236;this.nexus=!0,this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${m.jr9(t,0)}. Otherwise this gets Armor ${t}.`}aeroM(t){return p.mod("AT",this.boof236,t.id)}ntcC(){this.faction="A",this.rarity="H",this.name="Nexus Techtician",this.iHealth=this.boof6916,this.iAttack=this.iHealth-3,this.tribe.push("HM"),this.nexus=!0;const t=this.boof235;this.text=`While ${this.name} is in the center lane, each other friendly creature gets Armor ${t}.`}ntcM(t){return p.mod("AR",this.boof235,t.id)}}class ye extends M{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC(),["RWC"]:()=>this.roamC()})[t]()}targAction(t){f.birth(this.spawnCode,"P",t.playerA,t.lane)}adjacent=!1;optional=!1;needsEmpty=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const e=m.forglied(this.allied);this.text=e+": "+this.ftext}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){if(this.allied==="X"||E.allied(this.allied)){const e=f.jr5(t.creatId),i=p.emptyPlayerActTarg("F","CARD",this.code,t.creatId);this.needsEmpty||(i.field="A",i.hint=["FL"],i.lanes=f.laneIdx.filter(h=>h!==e.lane)),this.adjacent&&(i.lanes=e.adjacent);const s=D.toActions(i);s.length>0?(this.optional&&s.push(S.noneEndTrigger()),S.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){this.targAction(t),S.actionDone(!0)}bwdC(){this.faction="U",this.rarity="C",this.name="Branchweaver Druid",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.hints=["RT"],this.spawnCode=`${"TFD"}${this.level}`,this.optional=!0;const t=L.getCard(this.spawnCode);this.ftext=`You may put a ${m.tokName(t)} into another lane.`}btsC(){this.faction="U",this.rarity="C",this.name="Brighttusk Sower",this.iAttack=this.lValN([6,8,10]),this.iHealth=this.iAttack,this.tribe.push("TK"),this.level===1&&(this.hints=["ZZ-1"]),this.spawnCode=z.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=L.getCard(this.spawnCode);this.ftext=`You may put a ${m.tokName(t)} into an adjacent lane.`}escarC(){this.faction="A",this.rarity="H",this.name="Esperian Scarab",this.iAttack=this.lValN([3,4,7]),this.iHealth=this.boof5711,this.iArmor=this.boof135,this.tribe.push("RB"),this.allied="U",this.spawnCode=this.code,this.optional=!0,this.ftext=`You may but a copy of ${this.name} into another lane.`}ethhC(){this.faction="U",this.rarity="C",this.name="Ether Hounds",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ST"),this.needsEmpty=!0,this.spawnCode=this.code,this.ftext="Put a copy of this into an available lane."}roamC(){this.faction="U",this.rarity="C",this.name="Roaming Warclaw",this.iAttack=this.boof61016,this.iHealth=this.iAttack-3,this.tribe.push("DN"),this.spawnCode=`${"RPT"}${this.level}`,this.optional=!0,this.ftext="You may put a 1/1 Raptor into another lane."}}class tr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Epoch Hawk",this.iAttack=this.boof469,this.iHealth=this.boof71117,this.tribe.push("MC");const e=L.getCard(this.soldier);this.addSp("N",e.iAttack),this.text=`While you have 6 or more cards in hand, this gets "Activate: Put a ${m.tokName(e)} into an available lane."`,this.bonus={activ8:this.multNug(this.spawnNug(e),.3)}}canActivate(t){return v.toPlayer(t.owner).hand.length>5&&f.emptyLanes(t.owner).length>0}startActivation(t){const e=p.emptyPlayerActTarg(t.owner,"CARD",this.code,t.id),i=D.toActions(e);i.push(S.cancelAction()),S.ddf5(i)}handleAction(t){const e=f.jr5(t.param);this.logAct(!0),f.birth(this.soldier,"P",t.playerA,t.lane),e.endActivation()}ddf8(t){return t.trigger.type==="TE"}jr8(t){const e=v.toPlayer(t.owner);v.drawCard(e,1);const i=p.trigIdx(e.triggers,t.trigger);i>-1&&e.triggers.splice(i,1),x.triggerDone()}get soldier(){return "EPS"+this.level}}class er extends M{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Esperian Sage",this.iAttack=this.boof3510,this.iHealth=this.boof124,this.tribe.push("HM"),this.text=`When ${this.name} enters play, discard and level up a card.~Allied Uterra: You may put a copy of this into another lane.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");s.interactive=!0;const h=i.jr4("EF");return h.interactive=!0,i}handleAction(t){if(t.zone==="H")E.levelAndDiscardA(t);else{const e=t;f.birth(this.code,"R",e.playerA,e.lane)}S.actionDone(!0)}ddf8(t){return t.event.code==="ENT"?t.event.creatId===t.creatId:!1}jr8(t){if(t.trigger.type==="FR")if(E.allied("U")){const e=f.jr5(t.creatId),i=p.actionTarget("TF","CARD",this.code,t.creatId);i.player="F",i.lanes=f.laneIdx.filter(h=>h!==e.lane),i.hint=["FL"];const s=D.toActions(i);s.push(S.noneEndTrigger()),S.ddf5(s)}else x.triggerDone();else{const e=p.lvlHandActTarg(this.code,t.creatId),i=D.toActions(e);i.length>0?S.ddf5(i):x.triggerDone()}}}class ir extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Esperian Steelplate",this.iAttack=this.boof369,this.iHealth=this.boof6916,this.tribe.push("IN");const e=this.boof358;this.addSp("H",e),this.text=`Activate: Heal ${e} damage from each other friendly creature.~Allied Alloyin: Armor ${this.boof247}.`,this.bonus={activ8:this.buffNug(0,e)}}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){const e=p.crFriendNotMeTarg(t.id);return f.creatByTarget(e).length>0}startActivation(t){const e=D.boardTarget("CARD",this.code);e.param=t.id,S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),i=this.boof358,s=p.crFriendNotMeTarg(e.id);f.creatByTarget(s).forEach(h=>{h.heal(i)}),e.endActivation()}jr8(t){E.allied("A")&&f.jr5(t.creatId).addArmor(this.boof247),x.triggerDone()}}class rr extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Everflame Phoenix",this.iAttack=this.lValN([7,0,22]),this.iHealth=this.lValN([6,1,15]),this.tribe.push("PX"),this.iMobile=this.lValN([1,0,2]),this.level===2?(this.iDefend=!0,this.text=`When you gain a rank, replace ${this.name} with a level 3 ${this.name}.`,this.hints=["RH","LG"]):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this lane.`,this.hints=["ZZ-3"])}jr3(t,e){const i=super.jr3(t,e);if(this.level===2){const s=i.jr4("RU");s.bonus=this.buffNug(10,9)}else if(this.level===3){const s=i.jr4("VN");s.bonus=this.statSpawnNug(0,1)}return i}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.owner:super.ddf8(t)}jr8(t){if(t.trigger.type==="RU"){const e=f.jr5(t.creatId);f.birth(`${"EFP"}3`,"R",e.owner,e.lane)}else if(t.trigger.type==="VN"){const i=O.toCreature(t.event).creature;f.birth(`${"EFP"}2`,"P",i.owner,i.lane)}x.triggerDone()}}class sr extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Everflow Eidolon",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("PL"),this.text=`When ${this.name} gains health, you gain ${this.level===3?"2x ":""}that much health.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("HG");return s.bonus=this.playerNug(this.iHealth/2),i}ddf8(t){return t.trigger.type==="HG"?t.event.creatId===t.creatId:!1}jr8(t){if(t.trigger.type==="HG"){const e=t.event,i=this.level===3?2:1;v.heal(t.owner,e.healAmt*i)}x.triggerDone()}}class ar extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Frostmane Dragon",this.iAttack=this.lValN([6,9,13]),this.iHealth=this.iAttack+1,this.tribe.push("IC","DG"),this.iMobile=2,this.text=`At the start of your turn, if ${this.name} was Forged last turn, you may put a Level ${this.level} Frostmane egg into an available lane.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}handleAction(t){f.birth(`${"FME"}${this.level}`,"P",t.playerA,t.lane),S.actionDone(!0)}ddf8(t){return t.trigger.type==="TS"?t.event.playerA===t.owner:!1}jr8(t){const e=f.jr5(t.creatId);if(t.event.code==="ENT"){const i=e.jr4("TS");i.interactive=!0,i.changes=!0,i.bonus=this.rawNug(1,0,6,0),x.triggerDone()}else if(t.event.code==="TRS"){const i=p.trigIdx(e.triggers,t.trigger);i>-1&&e.removeTrigger(e.triggers[i]);const s=p.emptyPlayerActTarg("F","CARD",this.code,""),h=D.toActions(s);h.length===0?x.triggerDone():(h.push(S.noneEndTrigger()),S.ddf5(h))}}}class nr extends kt{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const e=this.boof4711;this.text=`Deal ${e} damage to an enemy creature.~Give a friendly creature ${m.jr9(e,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(p.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const e=T.deTil(t.param),i=f.ddf6(t);if(e[0]==="P1"){const s=this.friends(i.id);s.push(S.cancelAction()),S.ddf5(s)}else{this.logSpell(i);const s=f.jr5(e[1]),h=this.boof4711;s.hurtDirect(h,this.code);const u=p.mod("AT",h,this.code);u.expiry="ET",i.addMod(u),S.spellCast()}}friends(t=""){const e=p.crFriendActTarg("CARD",this.code,T.enTil("P2",t));return D.toActions(e)}}class or extends kt{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Gauntlets of Sulgrim";const e=this.boof2510;this.text=`Give a friendly creature Armor ${e}, then deal damage equal to its Armor to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.baddies().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");e.canArmor=!0,t.push(e)}return t}handleAction(t){const e=T.deTil(t.param),i=f.ddf6(t);if(e[0]==="P1"){const s=S.cancelAction(),h=this.baddies(i.id);h.push(s),S.ddf5(h)}else{const s=f.jr5(e[1]);this.logSpell(s);const h=this.boof2510;s.addArmor(h),i.hurtDirect(s.armor,this.code),S.spellCast()}}baddies(t=""){return D.toActions(p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t)))}}class hr extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Gemhide Ravager",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("DN"),this.text=`When ${this.name} ${m.dbdtap()}, you gain that much health.~Allied Tempys: Mobility ${this.level}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.bonus=this.playerNug(this.iAttack),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR")E.allied("T")&&f.jr5(t.creatId).addMobility(this.level),x.triggerDone();else if(t.trigger.type==="DM"){const e=t.event;v.heal(t.owner,e.dmg),x.triggerDone()}}}class lr extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Glaceus, Tundra Tyrant",this.iAttack=this.boof5916,this.iHealth=this.iAttack+2,this.tribe.push("IC","EL"),this.hints=["TL"];const e=`Gain Rank: each enemy ${m.levelGateText(this.level,!0)}creature gets "When this is dealt damage, destroy it."`,i=this.level===3?"At the start of each turn, deal 1 damage to each enemy creature.~":"";this.text=i+e}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("RU");if(s.bonus=this.statSpawnNug(0,0),this.level===3){const h=i.jr4("TS");h.bonus=this.buffNug(3,0)}return i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;if(e.isCreatTarg&&e.target===t.creatId)return!0}return t.trigger.type==="RU"?t.event.playerA===t.owner:t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="RU"){const e=p.crEnemyTarg();e.level=D.ddf2(this.level),f.creatByTarget(e).forEach(i=>{const s=i.jr4("DM");s.bonus=this.rawNug(0,0,0,0,-2),s.changes=!0})}else if(t.trigger.type==="TS"){const e=R.tick();f.qEnemyCreats().forEach(i=>{i.hurtDirect(1,this.code,e)})}else if(t.trigger.type==="DM"){const e=f.jr5(t.creatId);e.status==="A"&&W.destroy(e,this.code)}x.triggerDone()}}class cr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Grave Pact",this.isFree=this.level===3,this.text=`Destroy a friendly creature.~Destroy an ${m.levelGateText(this.level+1,!0)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=T.deTil(t.param),i=f.ddf6(t);if(e[0]==="P1"){const s=this.enemyTargActions(i.id);s.push(S.cancelAction()),S.ddf5(s)}else{this.logSpell();const s=f.jr5(e[1]),h=R.tick();W.destroy(s,this.code,h),W.destroy(i,this.code,h),S.spellCast()}}enemyTargActions(t=""){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return e.level=D.ddf2(this.level+1),D.toActions(e)}}class dr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const e=this.boof359;this.text=`Give a friendly creature +${e} attack.~Give an enemy creature -${e} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=T.deTil(t.param),i=f.ddf6(t);if(e[0]==="P1"){const s=this.enemyTargActions(i.id);s.push(S.cancelAction()),S.ddf5(s)}else{const s=f.jr5(e[1]);this.logSpell(s,i);const h=this.boof359;s.buff(h,0),i.buff(-h,0),S.spellCast()}}enemyTargActions(t=""){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return D.toActions(e)}}class ur extends M{constructor(t){super(t),this.faction="U",this.rarity="C",this.name="Hunting Pack",this.iAttack=this.boof3612,this.iHealth=this.boof248,this.tribe.push("WF"),this.text=`When ${this.name} enters play, you have a 50% chance to put a copy of ${this.name} into an available lane.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("EF");return s.interactive=!0,i}handleAction(t){f.birth(this.code,"P",t.playerA,t.lane),S.actionDone(!0)}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){if(T.randInt(0,at.simOn?4:2)===1){const i=p.emptyPlayerActTarg("F","CARD",this.code,""),s=p.actionTarget("TB","NOTR",this.code,""),h=D.toActions([i,s]);h.length===1?x.triggerDone():S.ddf5(h)}else x.triggerDone()}}class fr extends M{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Iniog, Carrion Demon",this.iAttack=this.lValN([0,12,20]),this.iHealth=this.boof3713,this.tribe.push("DM");let e;this.level===1?(this.iDefend=!0,e=5):(this.iMobile=1,this.iRegen=this.level===2?5:10,e=10,this.hints=["ZZ-5"]);let i;this.level===3?i="When this gains health, deal that much damage to the enemy player.~Vengeance: Put a level 1 Iniog into this lane.":i=`When a creature is destroyed, this gets Regenerate 1.~At the end of your turn, if this has Regenerate ${e} or higher, replace it with a level ${this.level+1} Iniog.`,this.text=i}jr3(t,e){const i=super.jr3(t,e);if(this.level===3){const s=i.jr4("HG");s.bonus=this.playerNug(4);const h=i.jr4("VN");h.bonus=this.buffNug(0,3)}else{const s=i.jr4("DS");s.bonus=this.regnNug(2);const h=i.jr4("TE"),u=L.getCard(this.levelUpCard());h.bonus=this.multNug(this.buffNug(u.iAttack,u.iHealth),.4)}return i}ddf8(t){return t.trigger.type==="TE"?t.event.playerA===t.owner:t.trigger.type==="HG"?t.event.creatId===t.creatId:t.trigger.type==="DS"}jr8(t){const e=f.jr5(t.creatId);if(t.trigger.type==="HG"){const i=t.event;v.hurtDirect(!t.owner,i.healAmt,this.code)}else if(t.trigger.type==="VN")f.birth("ICD"+"1","P",e.owner,e.lane);else if(t.trigger.type==="DS")e.addRegen(1);else if(t.trigger.type==="TE"){const i=this.level===1?4:9;e.regen>i&&f.birth(this.levelUpCard(),"R",e.owner,e.lane)}x.triggerDone()}}class gr extends M{image(t){return super.fixedImage(t)}constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Iztek, Avatar of Flame",this.iAttack=this.lValN([7,12,20]),this.iHealth=this.boof6915,this.tribe.push("FR","EL"),this.iAggro=!0,this.text=`When Iztek ${m.dbdtap()}, deal that much damage to that player again.~When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");s.bonus=this.buffNug(0,this.iAttack);const h=i.jr4("DM");return h.bonus=this.buffNug(this.iAttack,0),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}else if(t.trigger.type==="PC"){const e=t.event;if(e.playerA===t.owner)return L.getCard(e.cardCode).cardCode()==="IFR"}return!1}jr8(t){if(t.trigger.type==="DM"){const e=t.event;v.hurtDirect(!t.owner,e.dmg,this.code)}else if(t.trigger.type==="PC"){const e=f.jr5(t.trigger.creatId);f.birth(`${"IZR"}${this.level}`,"R",e.owner,e.lane)}x.triggerDone()}}class mr extends M{image(t){return super.fixedImage(t)}constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Iztek, Avatar of Frost",this.iAttack=this.boof6915,this.iHealth=this.lValN([7,12,20]),this.tribe.push("IC","EL"),this.iAggro=!0;const e=this.boof2510;this.text=`When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.~Activate: Deal ${e} damage to a creature.`,this.bonus={activ8:this.buffNug(e,0)}}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.bonus=this.buffNug(0,this.iAttack),i}canActivate(t){return!0}startActivation(t){const e=p.crActTarg("CARD",this.code,t.id);e.hint=["HR"];const i=D.toActions([e,D.buttonTarget("CANC")]);S.ddf5(i)}handleAction(t){const e=f.ddf6(t),i=f.jr5(t.param);this.logAct(!0),e.hurtDirect(this.boof2510,this.code),i.endActivation()}ddf8(t){const e=t.event;return e.playerA===t.owner?L.getCard(e.cardCode).cardCode()==="IFL":!1}jr8(t){const e=f.jr5(t.trigger.creatId);f.birth(`${"IZL"}${this.level}`,"R",e.owner,e.lane),x.triggerDone()}}class pr extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Killer Bee",this.iAttack=this.boof135,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("IN"),this.hints=["OL",this.lValH(["ZZ+2","ZZ+2","ZZ+3"])];const e=this.lValS(["Poison 1","Poison 3","that much Poison"]);this.text=`When ${this.name} deals battle damage to a creature or player, they get ${e}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.regnNug(this.iAttack),s.bonus.pHealth=this.iAttack,i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){const e=O.toDamage(t.event),i=this.lValN([1,3,e.dmg]);e.isCreatTarg?e.hurtCreat.addPoison(i):e.hurtPlayer.poison+=i,x.triggerDone()}}class yr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Killion, Infinity Warden",this.maxLevel=4,this.iAttack=this.lValN([6,9,16,22]),this.iHealth=this.lValN([3,7,14,20]),this.tribe.push("FB");let e;this.level<3?e=`a ${m.levelGateText(this.level)} card in your`:this.level===3?e="a card in your hand and":e="each card in your hand, deck, and",this.text=`Forge: Level up ${e} discard pile.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=this.level<4,i}handleAction(t){const e=v.getActive();if(t.zone==="N"){const i=L.getCard(e.discard[t.position]);e.discard[t.position]=i.levelUpCard(),bt.popMode(),S.actionDone(!0)}else{const i=L.getCard(e.hand[t.position]);e.hand[t.position]=i.levelUpCard(),this.discardLevel(!0)}}jr8(t){if(this.level<3)this.discardLevel(!1);else if(this.level===3){const e=D.toActions(p.lvlHandActTarg(this.code,""));e.length>0?S.ddf5(e):this.discardLevel(!1)}else{const e=v.getActive();this.levelDeck(e.deck),this.levelDeck(e.hand),this.levelDeck(e.discard),x.triggerDone()}}discardLevel(t){const e=v.getActive(),i=p.target("TD");i.player=v.toTarget(e),i.level=D.ddf2(this.level),i.canLevel=!0;const s=Ft.generateContent(e.discard,!1,i);if(s.length>0){const h=s.map(u=>{const g=p.deckSelectAction("CARD",u.cardCode,u.sourceIdx);return g.host=this.code,g.hint=["CD"],g});Ft.showCustomDeck(s,h)}else t?S.actionDone(!0):x.triggerDone()}levelDeck(t){t.map(i=>{const s=L.getCard(i);return s.canLevel()?s.levelUpCard():i}).forEach((i,s)=>t[s]=i)}}class br extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Lavafused Asir",this.iAttack=this.boof369,this.iHealth=this.iAttack*2,this.tribe.push("FR","AS"),this.text=`While a friendly creature is unopposed, gets ${m.jr9(this.iAttack,0)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){const i=p.crTarg(),s=e.status!=="A";i.player=v.toTarget(e.owner);const h=f.creatByTarget(i),u=p.mod("AT",this.iAttack,e.id);h.forEach(g=>{g.opposed||s?g.removeModSafe(e.id):g.addModSafe(u)})}}class Ar extends M{constructor(t){if(super(t),this.faction="U",this.rarity="L",this.name="Leafkin Progenitor",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level===3)this.text=`Activate: Put a level 1 ${this.name} into an adjacent available lane.`,this.bonus={activ8:this.statSpawnNug(3,3)};else{this.text=`Activate: Replace this with a level ${this.level+1} ${this.name}.`;const e=3*this.level;this.bonus={activ8:this.buffNug(e,e)}}}canActivate(t){return this.level===3?S.emptyAdjacents(t,"").length>0:!0}startActivation(t){let e;if(this.level===3)e=S.emptyAdjacents(t,"");else{const i=p.fieldSelectAction("CARD",t.lane,t.owner);i.param=t.id,i.host=this.code,e=[i]}e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);this.level===3?f.birth(this.leafCode(1),"P",t.playerA,t.lane):f.birth(this.leafCode(this.level+1),"R",e.owner,e.lane),e.endActivation()}leafCode(t){return`${"LKP"}${t}`}}class ce extends M{cardConstruct(t){({["AFO"]:()=>this.aetorC(),["CRS"]:()=>this.scootC(),["FOL"]:()=>this.forcC(),["NXO"]:()=>this.nexoC(),["TEX"]:()=>this.texC(),["TSM"]:()=>this.tsmithC()})[t]()}targAction(t,e,i){({["AFO"]:(h,u)=>this.doNossing(h,u),["CRS"]:(h,u)=>this.doNossing(h,u),["FOL"]:(h,u)=>this.doNossing(h,u),["NXO"]:(h,u)=>this.doNossing(h,u),["TEX"]:(h,u)=>this.doNossing(h,u),["TSM"]:(h,u)=>this.doNossing(h,u)})[t](e,i)}playTarg;optional=!1;ftext="";forgeLevels=[1,2,3,4];constructor(t){super(t),this.playTarg=p.lvlHandActTarg(this.code,""),this.cardConstruct(this.cardCode()),this.forgeLevels.includes(this.level)&&(this.text="Forge: "+this.ftext)}jr3(t,e){const i=super.jr3(t,e);if(this.forgeLevels.includes(this.level)){const s=i.jr4("FR");s.interactive=!0}return i}handleAction(t){E.levelAndDiscardA(t);const e=f.jr5(t.param);this.targAction(this.cardCode(),t,e),S.actionDone(!0)}jr8(t){if(this.cardCode()==="NXO"&&f.jr5(t.creatId).lane!==3){x.triggerDone();return}const e=D.toActions(this.playTarg);e.length>0?(e.forEach(i=>{i.param=t.creatId}),this.optional&&e.push(S.noneEndTrigger()),S.ddf5(e)):x.triggerDone()}doNossing(t,e){}aetorC(){this.faction="A",this.rarity="C",this.name="Aetherforge Oracle",this.iAttack=this.boof61218,this.iHealth=this.boof246,this.tribe.push("HM"),this.optional=!0,this.playTarg.card="S",this.ftext="You may discard and level up a spell."}scootC(){this.faction="A",this.rarity="R",this.name="Cerebral Scout",this.iAttack=this.boof51015,this.iHealth=this.boof3712,this.tribe.push("MM"),this.optional=!0,this.playTarg.tribe="MM",this.ftext="You may discard and level up a Metamind."}forcC(){this.faction="A",this.rarity="H",this.name="Forge Oracle",this.iAttack=this.lValN([1,10,20]),this.iHealth=this.iAttack,this.tribe.push("ST"),this.playTarg.faction="A",this.optional=!0,this.ftext="You may discard an Alloyin card and level it.",this.level===1?this.hints=["LG","RT"]:(this.consistent=!0,this.addSp("C",0),this.level===3&&(this.hints=["ZZ-2"]))}nexoC(){this.faction="A",this.rarity="C",this.name="Nexus Overwatch",this.iHealth=this.boof71014,this.iAttack=this.iHealth-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`If ${this.name} is in the center lane, you may ${m.daluac()}.`}texC(){this.faction="A",this.rarity="C",this.name="Tech Explorer",this.iAttack=this.lValN([1,8,18]),this.iHealth=this.iAttack+2,this.tribe.push("GN"),this.level===1&&(this.hints=["LG","RT"]),this.optional=!0,this.playTarg.card="C",this.ftext="You may discard and level up a creature."}tsmithC(){this.faction="A",this.rarity="C",this.name="Technosmith",this.iAttack=this.boof5915,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`You may ${m.daluac()}.`}}class Rt extends M{lookup(t){return{["DFB"]:{c:()=>this.dfbC(),d:(i,s)=>this.dfbD(i,s)},["GGD"]:{c:()=>this.ggdC(),d:(i,s)=>this.ggdD(i,s)},["GGR"]:{c:()=>this.ggdrC(),d:(i,s)=>this.ggdrD(i,s)},["GGP"]:{c:()=>this.ggpC(),d:(i,s)=>this.ggpD(i,s)},["MHR"]:{c:()=>this.mhermC(),d:(i,s)=>this.mhermD(i,s)},["NGT"]:{c:()=>this.ngauntC(),d:(i,s)=>this.ngauntD(i,s)},["SRH"]:{c:()=>this.sharvC(),d:(i,s)=>this.sharvD(i,s)},["YNS"]:{c:()=>this.yuruC(),d:(i,s)=>this.yuruD(i,s)}}[t]}trigB;creatDied(t,e){this.lookup(t).d(e,O.toCreature(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DS");return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="DS"}jr8(t){this.creatDied(this.cardCode(),t),x.triggerDone()}dfbC(){this.faction="N",this.rarity="R",this.name="Dr. Frankenbaum",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("AB");const t=this.boof234;this.text=`When a friendly Abomination is destroyed, deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t*2)}dfbD(t,e){const i=f.jr5(t.creatId),s=e.creature;(i.id===s.id||s.owner===i.owner&&s.isTribe("AB")&&Rt.itDiedFirst(s.id,i.id))&&v.hurtDirect(!i.owner,this.boof234,this.code)}ggdC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Devourer",this.iAttack=this.boof579,this.iHealth=this.iAttack-2,this.tribe.push("GG"),this.hints=["OL"],this.text=`When a creature is destroyed, ${this.name} gets ${m.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),2)}ggdD(t,e){f.jr5(t.creatId).buff(this.level,this.level)}get doomb(){return this.lValN([1,1,2])}ggdrC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Doomrider",this.iAttack=this.boof4712,this.iHealth=this.iAttack+2,this.tribe.push("GG");const t=this.doomb;this.text=`When a friendly creature is destroyed, ${this.name} moves to that creatures lane and gets ${m.jr9(t,t)}. Then give the opposing creature ${m.jr9(-t,-t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}ggdrD(t,e){const i=f.jr5(t.creatId),s=e.creature;if(s.owner===i.owner&&i.id!==s.id&&Rt.itDiedFirst(s.id,i.id)&&!f.searchByLane(s.lane,s.owner)){const u=this.doomb;i.move(s.lane),i.buff(u,u);const g=i.opposed;g&&(this.logAct(!1,g),g.buff(-u,-u))}}ggpC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Predator",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("GG"),this.hints=["OP"];const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${m.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}ggpD(t,e){const i=f.jr5(t.creatId),s=f.oppositeLane(i.lane);if(e.creature.owner!==i.owner&&e.creature.lane===s){const h=this.boof246;i.buff(h,h)}}mhermC(){this.faction="U",this.rarity="L",this.name="Malice Hermit",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("YT");const t=this.boof124;this.text=`Forge: Each other creature gets Poison ${t}.~When a creature with Poison is destroyed, ${this.name} gets ${m.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}mhermD(t,e){if(e.creature.poison>0){const i=this.boof124,s=f.jr5(t.creatId);this.logAct(!1,e.creature),s.buff(i,i)}}ngauntC(){this.faction="N",this.rarity="R",this.name="Nightgaunt",this.iAttack=this.boof4815,this.iHealth=this.iAttack+1,this.tribe.push("GG"),this.text=`When a creature is destroyed, ${this.name} gets Regenerate 1.`,this.trigB=this.regnNug(2)}ngauntD(t,e){f.jr5(t.creatId).addRegen(1)}sharvC(){this.faction="N",this.rarity="C",this.name="Sorrow Harvester",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("AB"),this.text="When a friendly Abomination is destroyed on your turn, draw a card.",this.trigB=this.rawNug(0,0,0,0,ht.dcWeight)}sharvD(t,e){const i=e.creature;i.owner===t.owner&&i.isTribe("AB")&&v.getActiveB()===t.owner&&Rt.itDiedFirst(i.id,t.creatId)&&v.drawCard(t.owner,1)}yuruC(){this.faction="N",this.rarity="L",this.name="Yuru, the Necrosage",this.iAttack=3,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("HM"),this.level===1&&(this.hints=["ZZ-1"]);const t=L.getCard(this.syc());this.text=`When an adjacent non-Spirit creature is destroyed, put a ${m.tokName(t)} into that lane.`,this.trigB=this.spawnNug(t)}yuruD(t,e){const i=f.jr5(t.creatId),s=e.creature;s.owner===i.owner&&i.adjacent.includes(s.lane)&&!s.isTribe("ST")&&Rt.itDiedFirst(s.id,i.id)&&f.birth(this.syc(),"P",i.owner,s.lane)}syc(){return "XYR"+this.level}static itDiedFirst(t,e){if(t===e)return!0;let i=!1;const s=W.findDeathTime(e);if(T.isUn(s))i=!0;else{const h=W.findDeathTime(t);(T.isUn(h)||h<=s)&&(i=!0)}return i}}class kr extends Rt{jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){if(t.trigger.type==="FR"){const e=f.creatByTarget(p.crNotMeTarg(t.creatId)),i=this.boof124;e.forEach(s=>s.addPoison(i)),x.triggerDone()}else super.jr8(t)}}class vr extends kt{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metatransfer",this.text=`Give a creature ${m.jr9(-this.boof579,0)}.~Discard and level up a card.`}playTargets(){const t=super.playTargets(),e=p.crActTarg("CARD",this.code,"P1");return e.hint=["DB"],t.push(e),t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=f.ddf6(t),s=p.lvlHandActTarg(this.code,T.enTil("P2",i.id));s.deckPositionSkip=S.playPosition();const h=D.toActions(s);h.length===0?(this.logSpell(i),i.buff(-this.boof579,0),S.spellCast()):(h.push(S.cancelAction()),S.ddf5(h))}else{const i=f.jr5(e[1]);this.logSpell(i),i.buff(-this.boof579,0);const s=t;S.shiftPlayCard(s.position),E.levelAndDiscardA(s),S.spellCast()}}}class Tr extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Mimicleaf",this.iAttack=this.lValN([2,5,11]),this.iHealth=this.iAttack,this.tribe.push("PL"),this.text=`Activate: Put a level ${this.level} ${this.name} into an adjacent available lane.`,this.bonus={activ8:this.statSpawnNug(this.iAttack,this.iHealth)}}canActivate(t){return S.emptyAdjacents(t,"").length>0}startActivation(t){const e=S.emptyAdjacents(t,"");e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);f.birth(e.code,"P",t.playerA,t.lane),e.endActivation()}}class Sr extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Mimicwurm",this.iAttack=7,this.iHealth=this.iAttack,this.tribe.push("WR"),this.text=this.lValS(["","Forge: You may put a level 1 Mimicwurm into another lane.","Forge: You may put a level 2 Mimicwurm into another lane. Then you may put a level 1 Mimicwurm into another lane."])}jr3(t,e){const i=super.jr3(t,e);if(this.level>1){const s=i.jr4("FR");s.interactive=!0}return i}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")if(this.level===3){this.wurmsign(2,t);const i=[t.lane,parseInt(e[1])],s=this.fieldActions("P2",i);S.ddf5(s)}else this.wurmsign(1,t),S.actionDone(!0);else this.wurmsign(1,t),S.actionDone(!0)}jr8(t){const e=O.toCreature(t.event);S.ddf5(this.fieldActions("P1",[e.creature.lane]))}fieldActions(t,e){const i=p.actionTarget("TF","CARD",this.code,T.enTil(t,e[0]));i.player="F",i.hint=["FL"],i.lanes=f.laneIdx.filter(h=>!e.includes(h));const s=D.toActions(i);return s.push(S.noneEndTrigger()),s}wurmsign(t,e){f.birth(this.wurmCode(t),"R",e.playerA,e.lane)}wurmCode(t){return`${"MMW"}${t}`}}class ae extends kt{lookup(t){return{["BRN"]:{c:()=>this.boutC(),z:(i,s)=>this.burner(i,s,8)},["IFL"]:{c:()=>this.izfmC(),z:(i,s)=>this.burner(i,s,this.boof6915)},["LSK"]:{c:()=>this.lspkC(),z:(i,s)=>this.burner(i,s,this.boof6812)},["LYR"]:{c:()=>this.rainC(),z:(i,s)=>this.rainZ(i,s)},["SOK"]:{c:()=>this.sealkC(),z:(i,s)=>this.burner(i,s,this.sealzap)},["STB"]:{c:()=>this.shatC(),z:(i,s)=>this.shatZ(i,s)},["SHK"]:{c:()=>this.shkC(),z:(i,s)=>this.shkZ(i,s)}}[t]}cardCast(t,e,i){this.lookup(t).z(e,i)}hurts=!0;burner(t,e,i){e?t.hurtDirect(i,this.code):v.hurtDirect(t,i,this.code)}burnText(t){return`Deal ${t} damage to a creature or player.`}constructor(t){super(t),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets(),e=this.hurts?["HR"]:["BF"],i=p.crActTarg("CARD",this.code,"");i.hint=e;const s=p.actionTarget("TP","CARD",this.code,"");return s.hint=e,t.push(i,s),t}handleAction(t){let e,i;t.zone==="P"?(this.logSpell(),e=!1,i=t.playerA):(i=f.ddf6(t),this.logSpell(this.hurts?void 0:i),e=!0),this.cardCast(this.cardCode(),i,e),S.spellCast()}boutC(){this.faction="T",this.rarity="R",this.name="Burnout",this.overload=!0,this.maxLevel=1,this.text=this.burnText(8)}izfmC(){this.faction="T",this.rarity="T",this.name="Iztek's Flame";const t=this.boof6915;this.addSp("D",t),this.text=this.burnText(t)}lspkC(){this.faction="T",this.rarity="C",this.name="Lightning Spark";const t=this.boof6812;this.addSp("D",t),this.text=this.burnText(t)}rainC(){this.faction="U",this.rarity="C",this.name="Lysian Rain",this.hurts=!1;const t=this.boof7911;this.addSp("H",t),this.text=`Give a creature or player +${t} health.`}rainZ(t,e){const i=this.boof7911;e?t.buff(0,i):v.heal(t,i)}sealkC(){this.faction="T",this.rarity="C",this.name="Seal of Kadras",this.level<3&&(this.hints=["LG"]),this.consistent=this.level>1;const t=this.sealzap;this.addSp("D",t),this.consistent&&this.addSp("C",0),this.text=this.burnText(t)}get sealzap(){return this.lValN([1,2,25])}shatC(){this.faction="T",this.rarity="C",this.name="Shatterbolt";const t=this.boof5914;this.addSp("D",t),this.text=`Negate Armor from a creature or player this turn, then deal ${t} damage to that creature or player.`}shatZ(t,e){const i=this.boof5914,s=p.mod("NA",!0,this.code);if(s.expiry="ET",e){const h=t;h.addMod(s),h.hurtDirect(i,this.code)}else{const h=v.toPlayer(t);v.addMod(h,s),v.hurtDirect(h,i,this.code)}}shkC(){this.faction="T",this.rarity="H",this.name="Static Shock";const t=this.boof124;this.addSp("D",t),this.text=`${this.burnText(t)} You may play an additional ${m.levelGateText(this.level,!0)}spell this turn.`}shkZ(t,e){this.burner(t,e,this.boof124);const i=E.freeCard(this.code);i.condition.level=D.ddf2(this.level),i.condition.card="S"}}class Cr extends M{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Nefrax, the Soulweaver",this.iAttack=this.boof4712,this.iHealth=this.lValN([10,15,25]),this.tribe.push("HM"),this.hints=["ZZ-2"];const e=L.getCard(this.spc());this.text=`Activate: Put a ${m.tokName(e)} into an available lane.~Forge: Destroy a friendly creature.`,this.bonus={activ8:this.spawnNug(e)}}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}canActivate(t){return this.empties(t).length>0}startActivation(t){const e=this.empties(t);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){this.logAct(!0);const i=f.jr5(e[1]);f.birth(this.spc(),"P",t.playerA,t.lane),i.endActivation()}else{const i=f.ddf6(t);W.destroy(i,this.code),S.actionDone(!0)}}jr8(t){const e=p.crFriendActTarg("CARD",this.code,""),i=D.toActions(e);S.ddf5(i)}spc(){return "SPN"+this.level}empties(t){const e=p.emptyPlayerActTarg("F","CARD",this.code,T.enTil("P1",t.id));return D.toActions(e)}}class wr extends M{constructor(t){super(t),this.faction="N",this.rarity="T",this.name="Netherdrake",this.iAttack=this.boof4815,this.iHealth=this.iAttack,this.iMobile=this.lValN([0,0,1]),this.tribe.push("DG"),this.text=`When this enters play or moves into a lane, destroy the opposing ${m.levelGateText(this.level,!0)}creature.`}image(t){return this.rawImage(`${"NSH"}${this.level}`,t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FK");return s.bonus=this.multNug(this.avgSpawnNug(),.5),i.jr4("EF"),i}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){const i=O.toCreature(t.event).creature.opposed;i&&D.levelTestCommon(i.level,this.level)&&W.destroy(i,this.code),x.triggerDone()}}class Dr extends pe{enforceEffect(t,e){e.lane===3?e.removeModSafe(e.id):e.addModSafe(p.mod("AR",this.boof236,e.id)),super.enforceEffect(t,e)}}class xr extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Nova, Grove Queen",this.iAttack=this.lValN([3,5,10,14]),this.iHealth=this.lValN([7,10,15,19]),this.tribe.push("FB"),this.maxLevel=4;const e=this.nbuf,i=this.lValS(["an adjacent","each adjacent","each","each"]);this.text=`Forge: Put a 1/1 Seedling into ${i} available space.~When a friendly creature is replaced, Nova gets ${m.jr9(e,e)}.`}get nbuf(){return this.lValN([1,3,5,10])}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");this.level===1&&(s.interactive=!0);const h=i.jr4("RP"),u=this.nbuf;return h.bonus=this.buffNug(u,u),i}ddf8(t){if(t.event.code==="RPL"){const e=O.toReplaced(t.event);return t.creatId!==e.replCreatId&&t.owner===e.replCreat.owner}return!1}jr8(t){const e=f.jr5(t.creatId);if(t.event.code==="RPL"){const i=this.nbuf;e.buff(i,i),x.triggerDone()}else{const i="NSD"+this.level,s=f.emptyLanes(t.owner);if(this.level>1){const h=this.level===2?e.adjacent.filter(g=>s.includes(g)):s,u=R.tick();h.forEach(g=>{f.birth(i,"P",e.owner,g,u)}),x.triggerDone()}else{const h=e.adjacent.filter(u=>s.includes(u));if(h.length===0)x.triggerDone();else if(h.length===1)f.birth(i,"P",e.owner,h[0]),x.triggerDone();else{const u=S.emptyAdjacents(e,"");S.ddf5(u)}}}}handleAction(t){f.birth("NSD"+this.level,"P",t.playerA,t.lane),S.actionDone(!0)}}class Br extends kt{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const e=this.boof246,i=e*-1;this.text=`Give a friendly Zombie ${m.jr9(e,e,!0)}, and Regenerate ${e}.~Then give an enemy non-Zombie ${m.jr9(i,i)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");e.tribe="ZB",t.push(e)}return t}handleAction(t){const e=T.deTil(t.param),i=f.ddf6(t);if(e[0]==="P1"){const s=S.cancelAction(),h=this.nonZombies(i.id);h.push(s),S.ddf5(h)}else{const s=f.jr5(e[1]);this.logSpell(s,i);const h=this.boof246;s.buff(h,h),s.addRegen(h),i.buff(-h,-h),S.spellCast()}}nonZombies(t=""){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return D.toActions(e).filter(i=>{const s=i;return!f.ddf6(s).isTribe("ZB")})}}class Hr extends M{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Onyxium Allomancer",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("HM");const e=this.boof358;this.text=`Activate: Discard and level up a card.~Allied Nekrium: Regenerate ${e}.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){return v.toPlayer(t.owner).hand.some(i=>L.getCard(i).canLevel())}startActivation(t){const e=p.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);E.levelAndDiscardA(t),e.endActivation()}jr8(t){E.allied("N")&&f.jr5(t.creatId).addRegen(this.boof358),x.triggerDone()}}class Nr extends M{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Onyxium Phantasm",this.iAttack=this.boof246,this.iHealth=this.lValN([9,12,19]),this.iRegen=this.boof124,this.tribe.push("ST");const e=this.boof4812n;this.addSp("A",e),this.text=`Allied Alloyin: Activate: Give a creature ${m.jr9(e,0)}`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){return t.hasMod(t.id)}startActivation(t){const e=p.crActTarg("CARD",this.code,t.id);e.hint=["DF","DB"];const i=D.toActions(e);i.push(S.cancelAction()),S.ddf5(i)}handleAction(t){const e=f.jr5(t.param),i=f.ddf6(t);this.logAct(!0,i),i.buff(this.boof4812n,0),e.endActivation()}jr8(t){if(E.allied("A")){const e=f.jr5(t.creatId);e.addMod(p.mod("AL",!0,e.id)),e.changed=!0;const i=e.jr4("PT");i.bonus=this.buffNug(this.boof4812,0)}x.triggerDone()}}class Fr extends kt{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Oratek Battlebrand";const e=this.boof71013;this.addSp("D",e),this.text=`Deal ${e} damage to a creature.~Allied Alloyin: You may discard a card and level it.`}playTargets(){const t=super.playTargets(),e=p.crActTarg("CARD",this.code,"");return e.hint=["HR"],t.push(e),t}handleAction(t){if(t.zone==="F"){const e=t,i=f.ddf6(e);if(this.logSpell(),i.hurtDirect(this.boof71013,this.code),E.allied("A")){const s=this.levelActs();s.length===1?S.spellCast():S.ddf5(s)}else S.spellCast()}else if(t.zone==="H"){const e=t;S.shiftPlayCard(e.position),E.levelAndDiscardA(e),S.spellCast()}else t.zone==="B"&&t.param==="NOTR"?S.spellCast():super.handleAction(t)}levelActs(){const t=p.actionTarget("TB","CARD",this.code,"NOTR"),e=p.lvlHandActTarg(this.code,"");return e.deckPositionSkip=S.playPosition(),D.toActions([e,t])}}class Pr extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Oratek Warhammer",this.iAttack=this.boof3713,this.iHealth=this.lValN([8,12,19]),this.iMobile=this.level,this.tribe.push("FR","AS"),this.text=`Allied Alloyin: When ${this.name} ${m.dbdtap()} on your turn, you may discard and level up a card.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.bonus=this.rawNug(0,0,0,0,.5),i}handleAction(t){E.levelAndDiscardA(t),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=O.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===v.getActiveB()}return!1}jr8(t){if(t.trigger.type==="FR"){if(E.allied("A")){const e=f.jr5(t.creatId),i=e.jr4("DM");i.interactive=!0,e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=D.toActions(p.lvlHandActTarg(this.code,""));e.length>0?(e.push(S.noneEndTrigger()),S.ddf5(e)):x.triggerDone()}}}class ze extends M{hitCreature;constructor(t,e){super(t),this.hitCreature=e}trigB;jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.trigB,i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatTarg===this.hitCreature&&e.isCreatSrc&&e.srcId===t.creatId}return!1}}class Mr extends ze{constructor(t){super(t,!1),this.faction="U",this.rarity="L",this.name="Oros, Deepwood's Chosen",this.iAttack=this.lValN([7,11,16,0]),this.iHealth=this.iAttack,this.iBT=!0,this.maxLevel=4,this.tribe.push("FB"),this.hints=["OL"];const e=`When Oros ${m.dbdtap()}, you gain that much health.`,i=this.level===4?"Oros gets +attack and +health equal to your health.~":"";this.text=i+e}jr3(t,e){const i=super.jr3(t,e);return this.level===4&&i.addEffect("PH",this.code),i}jr8(t){const e=t.event;v.heal(t.owner,e.dmg),x.triggerDone()}enforceEffect(t,e){const i=v.toPlayer(e.owner).health;e.status==="A"&&(e.removeModSafe(e.id),e.addModSafe(p.mod("HL",i,e.id)),e.addModSafe(p.mod("MH",i,e.id)),e.addModSafe(p.mod("AT",i,e.id)))}}class Rr extends M{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Oxidon Spitter",this.iAttack=this.boof7914,this.iHealth=this.boof3510,this.tribe.push("DN"),this.l3=this.level===3,this.text=`Forge: Negate Armor from ${this.l3?"each":"an"} enemy creature.`}l3;jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!this.l3,i}jr8(t){if(this.l3)f.creatByTarget(p.crEnemyTarg()).forEach(e=>{e.negateArmor=!0}),x.triggerDone();else{const e=p.crEnemyActTarg("CARD",this.code,""),i=D.toActions(e);i.length>0?S.ddf5(i):x.triggerDone()}}handleAction(t){const e=f.ddf6(t);this.logAct(!1,e),e.negateArmor=!0,S.actionDone(!0)}}class ne extends M{lookup(t){return{["AFS"]:{c:()=>this.afsC(),a:i=>this.afsA(i),t:i=>this.afsT(i)},["DMW"]:{c:()=>this.drixC(),a:i=>this.drixA(i),t:i=>this.drixT(i)},["FGG"]:{c:()=>this.fggC(),a:i=>this.fggA(i),t:i=>this.fggT(i)},["GHS"]:{c:()=>this.mvpC(),a:i=>this.mvpA(i),t:i=>this.mvpT(i)},["OWW"]:{c:()=>this.owwC(),a:i=>this.owwA(i),t:i=>this.owwT(i)},["UPM"]:{c:()=>this.upakC(),a:i=>this.upakA(i),t:i=>this.upakT(i)},["WFM"]:{c:()=>this.wfmC(),a:i=>this.wfmA(i),t:i=>this.wfmT(i)}}[t]}runAct(t,e){this.lookup(t).a(e)}testAct(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}preFight=!1;prePlay=!1;canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){const e=D.boardTarget("CARD",this.code);e.param=t.id,this.preFight&&(e.hint=["BB"]),this.prePlay&&(e.hint=["DF"]),S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);this.runAct(this.cardCode(),e),e.endActivation()}afsC(){this.faction="A",this.rarity="L",this.name="Arcflight Squadron",this.iAttack=this.boof4710,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.hints=["OL",this.level===1?"ZZ-3":"ZZ-2"],this.prePlay=!0,this.text=`Activate: You may play an additional ${m.levelGateText(this.level,!0)}Robot this turn.`,this.bonus={activ8:this.avgSpawnNug()}}afsT(t){return!0}afsA(t){const e=E.freeCard(this.code);e.condition.tribe="RB",e.condition.level=D.ddf2(this.level)}drixC(){this.faction="A",this.rarity="L",this.name="Drix, the Mindwelder",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,12,21]),this.tribe.push("MM"),this.preFight=!0,this.addSp("A",this.level),this.text=`Activate, discard your hand: Each friendly Metamind gets ${m.jr9(this.level,0)} for each card discarded this way.`,this.bonus={activ8:this.buffNug(3*this.level,0)}}drixT(t){return v.getActive().hand.length>0}drixA(t){const e=v.toPlayer(t.owner),i=e.hand.length*this.level;e.discard.push(...e.hand),e.hand=[];const s=p.crFriendTarg();s.tribe="MM",f.creatByTarget(s).forEach(h=>{h.buff(i,0)})}fggC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Gamma",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("RB","GD"),this.preFight=!0;const t=L.getCard(z.fgoc(this.level));this.addSp("N",t.iAttack),this.text=`Activate, destroy five friendly Robot Guardians: Put a ${m.tokName(t)} into this lane.`,this.bonus={activ8:this.rawNug(0,0,0,0,1)}}fggT(t){return f.creatByTarget(this.fggTarg()).length===5}fggA(t){const e=t.lane,i=t.owner,s=R.tick();f.creatByTarget(this.fggTarg()).forEach(h=>W.destroy(h,this.code,s)),f.birth(z.fgoc(this.level),"P",i,e)}fggTarg(){const t=p.crFriendTarg();return t.tribe="GD",t}mvpC(){this.faction="U",this.rarity="C",this.name="Gemheart Sprout",this.iAttack=this.boof357,this.iHealth=this.iAttack+this.level,this.iDefend=!0,this.tribe.push("PL"),this.preFight=!0,this.addSp("L",this.level),this.text=`Activate: You gain health equal to ${this.level}x the number of friendly creatures.`,this.bonus={activ8:this.playerNug(this.level*3)}}mvpT(t){return!0}mvpA(t){const e=f.ddf1().length;v.heal(t.owner,e*this.level)}owwC(){this.faction="A",this.rarity="L",this.name="Oreian Warwalker",this.iAttack=this.boof359,this.iHealth=this.boof61018,this.tribe.push("RB"),this.preFight=!0;const t=this.owwbuff+1;this.addSp("A",t),this.text=`Activate: ${this.name} gets ${t}x attack.`,this.bonus={activ8:this.buffNug(2*this.iAttack,0)}}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}upakC(){this.faction="U",this.rarity="L",this.name="Uterra Packmaster",this.iAttack=this.boof6914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.preFight=!0;const t=this.boof124;this.addSp("U",t),this.text=`Activate: each other friendly Uterra creature gets ${m.jr9(t,t)}.`,this.bonus={activ8:this.multNug(this.buffNug(t,t),1.5)}}upakT(t){return f.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const e=this.boof124;f.creatByTarget(this.upakTarg(t.id)).forEach(i=>{i.buff(e,e)})}upakTarg(t){const e=p.crFriendNotMeTarg(t);return e.faction="U",e}wfmC(){this.faction="T",this.rarity="H",this.name="Wildfire Maiden",this.iAttack=this.boof4610,this.iHealth=this.boof5814,this.tribe.push("FR","AS"),this.text=`Activate, destroy ${this.name}: Deal damage equal to its attack to each enemy creature.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}wfmT(t){return!0}wfmA(t){const e=R.tick();f.creatByTarget(p.crEnemyTarg()).forEach(i=>{i.hurtDirect(t.attack,this.code,e)}),W.destroy(t,this.code)}}class oi extends M{lookup(t){return{["MDE"]:{c:()=>this.misdC(),f:i=>this.misdF(i)},["TAB"]:{c:()=>this.thraC(),f:i=>this.thraF(i)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e);return i.jr4("AS"),i}jr8(t){this.cardForge(this.cardCode(),t),x.triggerDone()}misdC(){this.faction="N",this.rarity="C",this.name="Misery Demon",this.iAttack=this.boof5915,this.iHealth=this.boof2510,this.tribe.push("DM"),this.hints=["OL"];const t=this.level+3;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health.`}misdF(t){const e=this.level+3;v.hurtDirect(!t.owner,e,this.code),v.heal(t.owner,e)}thraC(){this.faction="T",this.rarity="C",this.name="Thranik Ambusher",this.iAttack=this.boof5813,this.iHealth=this.iAttack,this.tribe.push("DK"),this.hints=["OL"];const t=this.boof234;this.ftext=`${this.name} gets ${m.jr9(t,t)}.`}thraF(t){const e=this.boof234;f.jr5(t.creatId).buff(e,e)}}class vt extends M{lookup(t){return{["ATT"]:{c:()=>this.atorC(),t:(i,s)=>this.atorT(i,s),b:(i,s)=>this.atorB(i,s)},["BRH"]:{c:()=>this.brhrC(),t:(i,s)=>this.brhrT(i,s),b:(i,s)=>this.brhrB(i,s)},["FGD"]:{c:()=>this.fgdC(),t:(i,s)=>this.fgdT(i,s),b:(i,s)=>this.fgdB(i,s)},["FSP"]:{c:()=>this.fspC(),t:(i,s)=>this.fspT(i,s),b:(i,s)=>this.fspB(i,s)},["HMF"]:{c:()=>this.hamfC(),t:(i,s)=>this.hamfT(i,s),b:(i,s)=>this.hamfB(i,s)},["HOD"]:{c:()=>this.haroldC(),t:(i,s)=>this.ocarT(i,s),b:(i,s)=>this.haroldB(i,s)},["OJC"]:{c:()=>this.ocarC(),t:(i,s)=>this.ocarT(i,s),b:(i,s)=>this.ocarB(i,s)},["RLW"]:{c:()=>this.restwandC(),t:(i,s)=>this.restwandT(i,s),b:(i,s)=>this.restwandB(i,s)},["RHW"]:{c:()=>this.ruthwandC(),t:(i,s)=>this.restwandT(i,s),b:(i,s)=>this.ruthwandB(i,s)},["SDR"]:{c:()=>this.spdryC(),t:(i,s)=>this.spdryT(i,s),b:(i,s)=>this.spdryB(i,s)},["TDW"]:{c:()=>this.tdwC(),t:(i,s)=>this.tdwT(i,s),b:(i,s)=>this.tdwB(i,s)},["TNL"]:{c:()=>this.tnlC(),t:(i,s)=>this.tnlT(i,s),b:(i,s)=>this.tnlB(i,s)},["UTR"]:{c:()=>this.urexC(),t:(i,s)=>this.urexT(i,s),b:(i,s)=>this.urexB(i,s)}}[t]}testBirth(t,e){return this.lookup(t).t(e,O.toEnterField(e.event))}actBirth(t,e){this.lookup(t).b(e,O.toEnterField(e.event))}iTrigger=!0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);if(this.iTrigger){const s=i.jr4("EF");s.bonus=this.trigB}return i}ddf8(t){return t.event.code==="ENT"?this.testBirth(this.cardCode(),t):!1}jr8(t){this.actBirth(this.cardCode(),t),x.triggerDone()}atorC(){this.faction="T",this.rarity="L",this.name="Ator, Thunder Titan",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("GT"),this.text=`Each another friendly ${m.levelGateText(this.level,!0)}creature gets Assault: Aggressive.`,this.trigB=this.rawNug(0,0,0,0,.5)}atorT(t,e){const i=e.creature;return e.forged&&t.trigger.creatId!==i.id&&i.owner===t.owner&&D.levelTargetTest(D.ddf2(this.level),i.level)&&!i.opposed}atorB(t,e){e.creature.aggressive=!0}brhrC(){this.faction="N",this.rarity="R",this.name="Brood Horror",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("AB"),this.text=`When another friendly creature enters play, it gets ${m.jr9(this.level,this.level)}. Then ${this.name} gets ${m.jr9(-this.level,-this.level)}.`}brhrT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}brhrB(t,e){vt.itBirthedFirst(e.creature.id,t.creatId)&&(this.logAct(!1,e.creature),e.creature.buff(this.level,this.level),f.jr5(t.creatId).buff(-this.level,-this.level))}fgdC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Delta",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("RB","GD");const t=L.getCard(z.fgoc(this.level));this.text=`When ${this.name} enters play, if there is a friendly Alpha Beta, and Gamma, put a ${m.tokName(t)} in your discard pile.`}fgdT(t,e){return e.creature.id===t.creatId}fgdB(t,e){const i=p.crTarg();i.player=v.toTarget(t.owner);const s=f.creatByTarget(i).map(h=>h.code.slice(0,3));if(s.includes("FGA")&&s.includes("FGB")&&s.includes("FGG")){const h=v.toPlayer(t.owner);h.discard.push(z.fgoc(this.level));const u=p.trigger("NT",this.code);u.bonus=this.rawNug(0,0,0,0,10),h.triggers.push(u)}}fspC(){if(this.faction="A",this.rarity="L",this.name="Flowsteel Prototype",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.lValN([8,15,20]),this.tribe.push("SS"),this.iTrigger=this.level>1,this.iTrigger){const t=m.levelGateText(this.level-1);this.text=`When you Forge a ${t} creature, ${this.name} gets +attack equal to that creature's attack.`;const e=this.avgCreatureStats(this.level-1);this.trigB=this.buffNug(e[0],0)}}fspT(t,e){return!!(e.forged&&e.creature.owner===t.owner&&L.getCard(e.creature.code).level0&&f.jr5(t.creatId).move(i[T.randInt(0,s)])}haroldC(){this.faction="T",this.rarity="R",this.name="Herald of Destruction",this.iAttack=this.boof369,this.iHealth=this.lValN([9,12,18]),this.tribe.push("FR","AS"),this.text=`When an enemy creature enters play, if it wasn't Forged, deal damage equal to ${this.name}'s attack to the enemy player.`,this.trigB=this.playerNug(this.iAttack*.5)}haroldB(t,e){if(vt.itBirthedFirst(e.creature.id,t.creatId)){const i=f.jr5(t.creatId);v.hurtDirect(!i.owner,i.attack,this.code)}}ocarC(){this.faction="A",this.rarity="H",this.name="Oreian Justicar",this.iAttack=this.boof5814,this.iHealth=this.boof81220,this.tribe.push("HM");const t=this.ocarbuff;this.text=`When an enemy creature enters play, if it wasn't Forged, it gets ${m.jr9(t,0)}.`,this.trigB=this.buffNug(-.5*t,0)}ocarT(t,e){return e.creature.owner!==t.owner&&!e.forged}ocarB(t,e){vt.itBirthedFirst(e.creature.id,t.creatId)&&e.creature.buff(this.ocarbuff,0)}get ocarbuff(){return this.lValN([-5,-10,-20])}restwandC(){this.faction="U",this.rarity="H",this.name="Restless Wanderers",this.iAttack=this.boof51014,this.iHealth=this.boof3610,this.tribe.push("ST","WD");const t=this.boof369;this.text=`When another friendly Spirit Wanderer enters play, ${this.name} gets ${m.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),.5)}restwandT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner?e.creature.isTribe("WD"):!1}restwandB(t,e){const i=f.jr5(t.trigger.creatId),s=this.boof369;i.buff(s,s)}ruthwandC(){this.faction="N",this.rarity="C",this.name="Ruthless Wanderers",this.iAttack=this.boof3610,this.iHealth=this.boof51014,this.tribe.push("ST","WD");const t=this.boof369,e=-t;this.text=`When another friendly Spirit Wanderer enters play, the creature opposing this gets ${m.jr9(e,e)}.`,this.trigB=this.multNug(this.buffNug(t,t),.5)}ruthwandB(t,e){const s=f.jr5(t.trigger.creatId).opposed;if(s){const h=-this.boof369;s.buff(h,h)}}spdryC(){this.faction="U",this.rarity="R",this.name="Spring Dryad",this.iAttack=this.boof469,this.iHealth=this.iAttack,this.tribe.push("DY"),this.text=`When a friendly creature enters play, ${this.name} gets ${m.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),1.5)}spdryT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}spdryB(t,e){f.jr5(t.trigger.creatId).buff(this.level,this.level)}tdwC(){this.faction="N",this.rarity="R",this.name="Tarsus Deathweaver",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof246;this.text=`When a friendly creature enters play, if it wasn't Forged, it gets ${m.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}tdwT(t,e){return e.creature.owner===t.owner&&!e.forged}tdwB(t,e){if(vt.itBirthedFirst(e.creature.id,t.creatId)){const i=this.boof246;e.creature.buff(i,i)}}tnlC(){this.faction="N",this.rarity="L",this.name="Tarsus Necrolord",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof124,e=L.getCard(z.zomc(this.level));this.text=`Forge: Spawn a ${m.tokName(e)} for each friendly creature that was destroyed this turn.~When a friendly Zombie enters play, ${this.name} gets ${m.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}tnlT(t,e){return e.creature.owner===t.owner?e.creature.isTribe("ZB"):!1}tnlB(t,e){const i=f.jr5(t.trigger.creatId),s=this.boof124;i.buff(s,s)}urexC(){this.faction="U",this.rarity="H",this.name="Uterradon Rex",this.iAttack=this.boof4813,this.iHealth=this.boof71118,this.tribe.push("DN");const t=this.boof124;this.text=`When another friendly Dinosaur enters play, it gets ${m.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}urexT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("DN")}urexB(t,e){if(vt.itBirthedFirst(e.creature.id,t.creatId)){const i=this.boof124;e.creature.buff(i,i)}}static itBirthedFirst(t,e){if(t===e)return!0;let i=!1;const s=W.findDeathTime(e);if(T.isUn(s))i=!0;else{const h=f.findBirthTime(t);(T.isUn(h)||h<=s)&&(i=!0)}return i}}class oe extends ze{lookup(t){return{["AGM"]:{c:()=>this.agamC(),h:(i,s,h,u)=>this.agamH(i,s,h,u)},["BWK"]:{c:()=>this.blwalkC(),h:(i,s,h,u)=>this.blwalkH(i,s,h,u)},["BRF"]:{c:()=>this.bfangC(),h:(i,s,h,u)=>this.bfangH(i,s,h,u)},["CDT"]:{c:()=>this.cadtC(),h:(i,s,h,u)=>this.cadtH(i,s,h,u)},["GSC"]:{c:()=>this.gcobC(),h:(i,s,h,u)=>this.gcobH(i,s,h,u)},["IHA"]:{c:()=>this.ibhaC(),h:(i,s,h,u)=>this.ibhaH(i,s,h,u)},["SHS"]:{c:()=>this.shimfC(),h:(i,s,h,u)=>this.shimfH(i,s,h,u)}}[t]}image(t){return this.rarity==="T"?this.fixedImage(t):this.leveledImage(t)}cardConstruct(t){this.hints=["OP"],this.lookup(t).c()}creatHit(t,e,i,s,h){this.lookup(t).h(e,i,s,h)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const e=O.toDamage(t.event);this.creatHit(this.cardCode(),t,e,e.srcCreat,e.hurtCreat),x.triggerDone()}agamC(){this.faction="T",this.rarity="L",this.name="Agamemnon",this.iAttack=this.boof4814,this.iHealth=this.lValN([8,12,18]),this.level>1&&(this.iMobile=1,this.iAggro=this.level===3),this.tribe.push("GT"),this.text=`When ${this.name} ${m.dbdtac()} on your turn, this battles again.`,this.trigB=this.buffNug(this.iAttack/2,0)}agamH(t,e,i,s){t.owner===v.getActiveB()&&(i.extraBattles+=1)}blwalkC(){this.faction="N",this.rarity="R",this.name="Blight Walker",this.iAttack=this.boof137,this.iHealth=this.lValN([5,10,17]),this.tribe.push("ZB"),this.text=`When ${this.name} ${m.dbdtac(this.level)}, destroy that creature.`,this.trigB=this.avgSpawnNug()}blwalkH(t,e,i,s){s.status==="A"&&D.levelTestCommon(s.level,this.level)&&W.destroy(s,this.code)}bfangC(){this.faction="U",this.rarity="T",this.name="Broodfang",this.iAttack=this.level,this.iHealth=this.level,this.maxLevel=this.level,this.minLevel=this.level,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}bfangH(t,e,i,s){s.addPoison(this.iAttack)}poisonText(t){return`When ${this.name} ${m.dbdtac()}, give that creature gets Poison ${t}.`}cadtC(){this.faction="U",this.rarity="R",this.name="Cadaverous Thicket",this.iAttack=this.boof135,this.iHealth=this.lValN([7,12,22]),this.tribe.push("PL"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}cadtH(t,e,i,s){s.addPoison(this.iAttack)}gcobC(){this.faction="U",this.rarity="C",this.name="Ghostscale Cobra",this.iAttack=this.boof4610,this.iHealth=this.boof135,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}gcobH(t,e,i,s){s.addPoison(this.iAttack)}ibhaC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Hammer of Anvillon",this.iAttack=this.lValN([4,7,12,15]),this.iHealth=this.lValN([7,11,17,25]),this.iArmor=this.lValN([1,3,5,20]),this.tribe.push("FB"),this.maxLevel=4;const t=this.level===4?"'s attack gets reduced to 0":` gets ${m.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${m.dbdtac()}, that creature${t}, and moves to an available enemy lane at random.`,this.trigB=this.buffNug(this.lValN([2,4,6,16]),0)}ibhaH(t,e,i,s){if(s.status==="A"){const h=this.level===4?s.attack*-1:this.boof246n;s.buff(h,0);const u=f.emptyLanes(s.owner),g=u.length;g>0&&(this.logAct(!1,s),s.move(u[T.randInt(0,g)]))}}shimfC(){this.faction="U",this.rarity="R",this.name="Shimmerfang Serpent",this.iAttack=this.boof357,this.iHealth=this.boof61016,this.tribe.push("SN"),this.text=`When ${this.name} ${m.dbdtac()}, that creatures gets that much Poison.`,this.trigB=this.regnNug(this.iAttack)}shimfH(t,e,i,s){s.addPoison(e.dmg)}}class Vt extends ze{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(i,s,h)=>this.ashyH(i,s,h)},["AMY"]:{c:()=>this.ashmC(),h:(i,s,h)=>this.ashyH(i,s,h)},["CFB"]:{c:()=>this.cfbC(),h:(i,s,h)=>this.cfbH(i,s,h)},["EPS"]:{c:()=>this.epsdC(),h:(i,s,h)=>this.epsdH(i,s,h)},["EFM"]:{c:()=>this.efmC(),h:(i,s,h)=>this.efmH(i,s,h)},["FBC"]:{c:()=>this.fbcC(),h:(i,s,h)=>this.fbcH(i,s,h)},["RTS"]:{c:()=>this.rzstC(),h:(i,s,h)=>this.rzstH(i,s,h)},["RSE"]:{c:()=>this.rselC(),h:(i,s,h)=>this.rselH(i,s,h)},["SVH"]:{c:()=>this.strhyC(),h:(i,s,h)=>this.strhyH(i,s,h)},["URB"]:{c:()=>this.uridC(),h:(i,s,h)=>this.uridH(i,s,h)},["VES"]:{c:()=>this.veskC(),h:(i,s,h)=>this.veskH(i,s,h)}}[t]}cardConstruct(t){this.hints=["OL"],this.lookup(t).c()}creatHit(t,e,i,s){this.lookup(t).h(e,i,s)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}jr8(t){const e=O.toDamage(t.event);e.srcCreat&&(this.bothTurns||e.srcCreat.owner===v.getActiveB())&&this.creatHit(this.cardCode(),t,e,e.srcCreat),x.triggerDone()}ashyC(){this.faction="T",this.rarity="C",this.tribe.push("FR","AS");const t=this.boof124;this.text=`When ${this.name} ${m.dbdtap()}, it gets ${m.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}ashyH(t,e,i){const s=this.boof124;i.buff(s,s)}ashbC(){this.name="Ashurian Brawler",this.iAttack=this.boof7911,this.iHealth=this.iAttack,this.ashyC()}ashmC(){this.name="Ashurian Mystic",this.iAttack=this.boof3610,this.iHealth=this.boof5812,this.iAggro=!0,this.ashyC()}cfbC(){this.faction="T",this.rarity="H",this.name="Cinderfist Brawler",this.iAttack=this.boof71014,this.iHealth=this.boof357,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${m.dbdtap()}, deal that much damage to that player again.`,this.trigB=this.playerNug(this.iAttack/2)}cfbH(t,e,i){v.hurtDirect(!i.owner,e.dmg,i.code)}epsdC(){this.faction="A",this.rarity="T",this.name="Epoch Soldier",this.minLevel=this.level,this.maxLevel=this.level,this.iAttack=this.boof4710,this.iHealth=this.iAttack,this.tribe.push("HM"),this.bothTurns=!1,this.text=`When ${this.name} ${m.dbdtap()} on your turn, draw a card at the end of the turn.`,this.trigB=this.rawNug(0,0,0,0,.2)}epsdH(t,e,i){const s=p.trigger("TE","EPH"+this.level);s.changes=!0,s.bonus=this.rawNug(0,0,0,0,ht.dcWeight),v.toPlayer(t.owner).triggers.push(s)}efmC(){this.faction="T",this.rarity="L",this.name="Everflame Mystic",this.iAttack=this.boof5813,this.iHealth=this.iAttack+1,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${m.dbdtap()} on your turn, you may play ${this.lValS(["one","two","three"])} spells this turn.`,this.trigB=this.rawNug(0,0,0,0,this.level*.5)}efmH(t,e,i){if(v.getActiveB()===i.owner)for(let s=0;sh.hurtDirect(e.dmg,this.code,s))}rzstC(){this.faction="T",this.rarity="C",this.name="Razortooth Stalker",this.iAttack=this.boof4812,this.iHealth=this.iAttack+1,this.iMobile=1,this.tribe.push("DN");const t=this.boof235;this.text=`When ${this.name} ${m.dbdtap()}, it gets ${m.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}rzstH(t,e,i){const s=this.boof235;i.buff(s,s)}rselC(){this.faction="T",this.rarity="H",this.name="Rumblestone Elemental",this.iAttack=this.boof246,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("ER","EL"),this.text=`When ${this.name} ${m.dbdtap()}, deal that much damage to itself as well.~Assault: Spawn a copy of ${this.name}. Then repeat this for each copy.`,this.trigB=this.rawNug(0,0,0,0,-.1)}rselH(t,e,i){i.hurtDirect(e.dmg,this.code)}strhyC(){this.faction="U",this.rarity="C",this.name="Stranglevine Hydra",this.iAttack=this.boof5815,this.iHealth=this.iAttack+1,this.tribe.push("HY"),this.text=`When ${this.name} ${m.dbdtap()}, it gets Regenerate ${this.level}.`,this.trigB=this.regnNug(this.level)}strhyH(t,e,i){i.addRegen(this.level)}uridC(){this.faction="U",this.rarity="L",this.name="Uterradon Ridgeback",this.iAttack=this.boof71117,this.iHealth=this.boof4713,this.iBT=!0,this.tribe.push("DN"),this.bothTurns=!1;const t=this.boof124;this.text=`When ${this.name} ${m.dbdtap()} on your turn, each friendly creature gets ${m.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`,this.trigB=this.buffNug(t,t)}uridH(t,e,i){const s=this.boof124,h=this.level===3;f.ddf1().forEach(u=>{u.buff(s,s),h&&(u.breakthrough=!0)})}veskC(){this.faction="N",this.rarity="L",this.name="Vyric Ebonskull",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("VP");let t="",e=.5;this.level===3&&(t=" Then Spawn a copy of that creature."),this.text=`When Vyric ${m.dbdtap()}, destroy an enemy ${m.levelGateText(this.level,!0)} creature at random.`+t,this.trigB=this.multNug(this.avgSpawnNug(),e)}veskH(t,e,i){const s=p.crTarg();s.player=v.toTarget(e.hurtPlayer),s.level=D.ddf2(this.level);const h=f.creatByTarget(s);if(h.length>0){const u=R.tick(),g=h[T.randInt(0,h.length)];W.destroy(g,this.code,u),this.level===3&&f.birth(g.code,"S",i.owner,void 0,u)}}}class be extends M{lookup(t){return{["CHR"]:{c:()=>this.crgC(),d:(i,s,h)=>this.crgD(i,s,h)},["DZD"]:{c:()=>this.dozC(),d:(i,s,h)=>this.dozD(i,s,h)},["IMD"]:{c:()=>this.eddieC(),d:(i,s,h)=>this.eddieD(i,s,h)},["NCM"]:{c:()=>this.ncmbC(),d:(i,s,h)=>this.ncmbD(i,s,h)},["TDS"]:{c:()=>this.tsrC(),d:(i,s,h)=>this.tsrD(i,s,h)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}cares=!0;trigB;cardDamaged(t,e){const i=O.toDamage(e.event);this.lookup(t).d(e,i.hurtCreat,i)}image(t){return this.cardCode()==="DZD"?this.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e);if(this.cares){const s=i.jr4("DM");s.bonus=this.trigB}return i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.isCreatTarg&&e.target===t.creatId}return!1}jr8(t){this.cardDamaged(this.cardCode(),t),x.triggerDone()}crgC(){this.faction="U",this.rarity="L",this.name="Chrogias",this.iAttack=this.lValN([1,0,40]),this.iHealth=this.lValN([1,15,40]),this.tribe.push("PL"),this.level>1&&(this.hints=["MC"],this.text="When Chrogias is dealt damage, you gain that much health."),this.level===1?(this.hints=["LG","LM","RT"],this.cares=!1):this.level===2?(this.iRegen=2,this.iDefend=!0,this.trigB=this.playerNug(10),this.hints?.push("LG")):this.level===3&&(this.iBT=!0,this.iRegen=5,this.trigB=this.playerNug(20))}crgD(t,e,i){v.heal(t.owner,i.dmg)}dozC(){this.faction="U",this.rarity="L",this.name="Dozer, the Dormant",this.iAttack=0,this.iHealth=this.level*3+6,this.tribe.push("BR"),this.iDefend=!0,this.hints=["MC"],this.level===1&&this.hints.push("ZZ-2"),this.trigB=this.buffNug(this.iHealth,0),this.trigB.bonus=.3;const t=L.getCard(this.dz());this.text=`When ${this.name} is dealt damage and survives, replace it with a ${m.tokName(t)}.`}dozD(t,e,i){if(e.health>0&&e.status==="A"){const s=f.birth(this.dz(),"R",e.owner,e.lane);s&&s.setHealth(e.health)}}dz(){return "DZA"+this.level}eddieC(){this.faction="A",this.rarity="L",this.name="Iron Maiden",this.iAttack=this.lValN([1,3,30]),this.iHealth=this.iAttack,this.tribe.push("RB"),this.consistent=this.level>1,this.level===3?(this.iBT=!0,this.hints=["MC"],this.text="When Iron Maiden is dealt damage, deal that much damage to the enemy player.",this.trigB=this.playerNug(16)):(this.cares=!1,this.hints=["LG","LM","RT"])}eddieD(t,e,i){v.hurtDirect(!t.owner,i.dmg,this.code)}ncmbC(){this.faction="N",this.rarity="H",this.name="Necromoeba",this.iAttack=this.boof4710,this.iHealth=this.boof71117,this.tribe.push("OZ"),this.iRegen=3,this.hints=["MC"],this.level===1&&this.hints.push("ZZ-1");const t=L.getCard(z.purpOzC(this.level));this.text=`When ${this.name} is dealt damage, Spawn a ${m.tokName(t)}.`,this.trigB=this.spawnNug(t)}ncmbD(t,e,i){this.logAct(!1),f.birth(z.purpOzC(this.level),"S",t.owner)}tsrC(){this.faction="U",this.rarity="L",this.name="Thundersaur",this.iAttack=0,this.iHealth=this.level*12,this.tribe.push("DN"),this.iBT=!0,this.hints=["MC",this.level===2?"ZZ-3":"ZZ-1"],this.trigB=this.buffNug(this.iHealth/2,0),this.text=`When ${this.name} is dealt damage, it gets +1 attack for each damage dealt.`}tsrD(t,e,i){e.buff(i.dmg,0)}}class Z extends M{lookup(t){return{["AGK"]:{c:()=>this.agknitC(),f:i=>this.agknitF(i)},["AMS"]:{c:()=>this.squadC(),f:i=>this.squadF(i)},["AFR"]:{c:()=>this.afsC(),f:i=>this.afsF(i)},["BZS"]:{c:()=>this.bzshC(),f:i=>this.bzshF(i)},["BTR"]:{c:()=>this.bwtC(),f:i=>this.bwtF(i)},["BSS"]:{c:()=>this.bssC(),f:i=>this.bssF(i)},["BZD"]:{c:()=>this.bzdrC(),f:i=>this.bzdrF(i)},["BFM"]:{c:()=>this.bfmC(),f:i=>this.bfmF(i)},["CTI"]:{c:()=>this.charnC(),f:i=>this.charnF(i)},["CHH"]:{c:()=>this.chihC(),f:i=>this.chihF(i)},["CSW"]:{c:()=>this.chickenC(),f:i=>this.chickenF(i)},["DFR"]:{c:()=>this.dfrC(),f:i=>this.dfrF(i)},["DBA"]:{c:()=>this.dbaC(),f:i=>this.dbaF(i)},["DBN"]:{c:()=>this.drbC(),f:i=>this.drbF(i)},["DDD"]:{c:()=>this.dddC(),f:i=>this.dddF(i)},["EWT"]:{c:()=>this.espwrC(),f:i=>this.espwrF(i)},["FWT"]:{c:()=>this.fwtC(),f:i=>this.fwtF(i)},["GSW"]:{c:()=>this.gwurmC(),f:i=>this.gwurmF(i)},["GSS"]:{c:()=>this.gsC(),f:i=>this.gsF(i)},["IMA"]:{c:()=>this.iracoC(),f:i=>this.iracoF(i)},["LGT"]:{c:()=>this.legtitC(),f:i=>this.legtitF(i)},["LBD"]:{c:()=>this.lbdC(),f:i=>this.lbdF(i)},["LMV"]:{c:()=>this.lyrC(),f:i=>this.lyrF(i)},["MOE"]:{c:()=>this.moeC(),f:i=>this.moeF(i)},["MMA"]:{c:()=>this.mmaC(),f:i=>this.mmaF(i)},["MMR"]:{c:()=>this.mmrC(),f:i=>this.mmrF(i)},["NSY"]:{c:()=>this.nysymC(),f:i=>this.nysymF(i)},["OXM"]:{c:()=>this.onxmarC(),f:i=>this.onxmarF(i)},["OFM"]:{c:()=>this.ofmC(),f:i=>this.ofmF(i)},["OPK"]:{c:()=>this.orpC(),f:i=>this.orpF(i)},["PHM"]:{c:()=>this.phmC(),f:i=>this.phmF(i)},["PSM"]:{c:()=>this.palsC(),f:i=>this.palsF(i)},["PMI"]:{c:()=>this.prinvC(),f:i=>this.prinvF(i)},["SMD"]:{c:()=>this.scorchC(),f:i=>this.scorchF(i)},["SOC"]:{c:()=>this.scythC(),f:i=>this.scythF(i)},["SDN"]:{c:()=>this.souldrC(),f:i=>this.souldrF(i)},["SGG"]:{c:()=>this.ssggC(),f:i=>this.ssggF(i)},["SBD"]:{c:()=>this.sbdC(),f:i=>this.sbdF(i)},["SSK"]:{c:()=>this.sssC(),f:i=>this.sssF(i)},["SYL"]:{c:()=>this.lotusC(),f:i=>this.lotusF(i)},["TGI"]:{c:()=>this.tgiC(),f:i=>this.tgiF(i)},["TRA"]:{c:()=>this.toraC(),f:i=>this.toraF(i)},["TRS"]:{c:()=>this.torsC(),f:i=>this.torsF(i)},["TRV"]:{c:()=>this.torvC(),f:i=>this.torvF(i)},["TRW"]:{c:()=>this.torwC(),f:i=>this.torwF(i)},["UGL"]:{c:()=>this.umglidC(),f:i=>this.umglidF(i)},["UWL"]:{c:()=>this.uwarC(),f:i=>this.uwarF(i)},["UWS"]:{c:()=>this.ustokeC(),f:i=>this.ustokeF(i)},["UIW"]:{c:()=>this.uiwC(),f:i=>this.uiwF(i)},["UTM"]:{c:()=>this.umaulC(),f:i=>this.umaulF(i)},["VIK"]:{c:()=>this.vikC(),f:i=>this.vikF(i)},["VND"]:{c:()=>this.vdrkC(),f:i=>this.vdrkF(i)},["VNS"]:{c:()=>this.vnsC(),f:i=>this.vnsF(i)},["WMC"]:{c:()=>this.warC(),f:i=>this.warF(i)},["WWP"]:{c:()=>this.wwpC(),f:i=>this.wwpF(i)},["WFB"]:{c:()=>this.wfbC(),f:i=>this.wfbF(i)},["XTR"]:{c:()=>this.xtmC(),f:i=>this.xtmF(i)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";forges=!0;flanks;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let e="";this.flanks&&(e="Flank"),this.forges&&(e?e="Forge/"+e:e=m.forglied(this.allied)),e&&(this.text=e+": "+this.ftext),this.ftext=""}jr3(t,e){const i=super.jr3(t,e);if(this.forges&&i.jr4("FR"),this.flanks){const s=i.jr4("FK");s.bonus=this.flanks}return i}ddf8(t){return Dt.extractCardCode(t.trigger.logicCode)==="MMR"&&t.trigger.type==="TE"}jr8(t){const e=this.cardCode();if(t.trigger.type==="TE"&&e==="MMR"){this.logAct(!1);const i=t.event,s=v.toPlayer(i.playerA);v.drawCard(s,this.level);const h=p.trigIdx(s.triggers,t.trigger);h>-1&&s.triggers.splice(h,1),x.triggerDone();return}this.cardForge(this.cardCode(),t),x.triggerDone()}agknitC(){this.faction="A",this.rarity="L",this.name="Aegis Knight",this.iAttack=this.boof5814,this.iHealth=this.iAttack,this.tribe.push("HM"),this.iArmor=this.lValN([1,2,5]),this.ftext="Each friendly creature deals damage equal to its Armor to the opposing creature"}agknitF(t){const e=p.crFriendTarg();e.hasArmor=!0;const i=R.tick();f.creatByTarget(e).forEach(s=>{s.opposed&&s.opposed.hurtDirect(s.armor,s.code,i)})}squadC(){this.faction="A",this.rarity="H",this.name="Aeromind Squadron",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("MM"),this.iMobile=1,this.ftext="Put a Metamind at random from your deck into your hand."}squadF(t){const e=v.toPlayer(t.owner),i=p.target("TH");i.player=v.toTarget(e),i.tribe="MM";const s=D.deckByTarget(i),h=s.length;if(h>0){const u=s[T.randInt(0,h)];e.deck.splice(u[1],1),e.hand.push(u[0])}}afsC(){this.faction="T",this.rarity="H",this.name="Ashurian Flamesculptor",this.iAttack=this.boof5915,this.iHealth=this.boof3610,this.tribe.push("FR","AS"),this.forges=this.level>1,this.consistent=this.forges,this.ftext=`You may play an additional ${m.levelGateText(this.level-1)} Tempys spell this turn.`,this.forges&&this.addSp("C",0)}afsF(t){const e=E.freeCard(this.code);e.condition.card="S",e.condition.level=D.ddf2(this.level-1),e.condition.faction="T"}bzshC(){this.faction="T",this.rarity="C",this.name="Blizzard Shaman",this.iAttack=this.boof61014,this.iHealth=this.iAttack+1,this.tribe.push("WN","AS"),this.ftext="Move another friendly creature at random to another available lane at random."}bzshF(t){const e=f.creatByTarget(p.crFriendNotMeTarg(t.creatId)),i=e.length;if(i<4&&i>0){const s=e[T.randInt(0,i)],h=f.emptyLanes(s.owner);this.logAct(!1,s),s.move(h[T.randInt(0,h.length)])}}bwtC(){if(this.faction="U",this.rarity="H",this.name="Bramblewood Tracker",this.iAttack=this.boof3712,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.forges=this.level>1,this.forges){const t=this.level-1;this.ftext=`You may play an additional ${m.levelGateText(t)} Uterra creature this turn.`,this.consistent=!0,this.addSp("C",0)}else this.hints=["LG"]}bwtF(t){const e=E.freeCard(this.code);e.condition.card="C",e.condition.faction="U",e.condition.level=D.ddf2(this.level-1)}bssC(){this.faction="A",this.rarity="L",this.name="Brightsteel Sentinal",this.iHealth=this.boof51015,this.iAttack=this.iHealth-1,this.tribe.push("RB"),this.addSp("M",this.iHealth),this.ftext=`Each friendly Robot gets Armor ${this.iHealth} this turn.`}bssF(t){const e=this.boof51015,i=p.crFriendTarg();i.tribe="RB",i.canArmor=!0,f.creatByTarget(i).forEach(h=>{const u=p.mod("AR",e,t.creatId);u.expiry="ET",h.addMod(u)})}bzdrC(){this.faction="N",this.rarity="R",this.name="Byzerak Drake",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.iRegen=this.level,this.allied="T",this.tribe.push("DG"),this.addSp("R",this.level),this.ftext=`Mobility ${this.level}.`}bzdrF(t){E.allied(this.allied)&&f.jr5(t.creatId).addMobility(this.level)}bfmC(){this.faction="N",this.rarity="H",this.name="Byzerak Frostmaiden",this.iAttack=this.boof135,this.iHealth=this.boof91420,this.tribe.push("HM");const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${m.jr9(-1*t,0)} and this gets ${m.jr9(t,0)}.~Allied Tempys: Mobility ${this.level}.`}bfmF(t){const i=O.toEnterField(t.event).creature;t.trigger.type==="FR"&&E.allied("T")&&i.addMobility(this.level);const s=i.opposed;if(s){const h=this.boof246;s.buff(-1*h,0),i.buff(h,0)}}charnC(){this.faction="N",this.rarity="C",this.name="Charnel Titan",this.iAttack=this.boof359,this.iHealth=this.boof5814,this.tribe.push("AB");const t=this.boof357;this.ftext=`If there is an enemy creature with ${t} or less attack, ${this.name} gets ${m.jr9(t,t)}.`}charnF(t){const e=this.boof357,i=p.crEnemyTarg();i.maxAttack=e,f.creatByTarget(i).length>0&&f.jr5(t.creatId).buff(e,e)}chihC(){this.faction="U",this.rarity="C",this.name="Chistlehearth Hunter",this.iAttack=this.lValN([2,6,11]),this.iHealth=this.boof81217,this.tribe.push("HM"),this.ftext=`${this.name} gets ${m.jr9(1,0)} for each other friendly creature.`}chihF(t){const e=f.ddf1().length;e>1&&f.jr5(t.creatId).buff(e-1,0)}chickenC(){this.faction="T",this.rarity="L",this.name="Cindersmoke Wyvern",this.iAttack=this.boof3610,this.iHealth=this.lValN([7,12,17]),this.tribe.push("DG"),this.iMobile=this.boof124,this.forges=!1,this.flanks=this.buffNug(this.iAttack,0),this.ftext="Deal damage equal to its attack to the opposing creature. If there is no opposing creature, deal that damage to the enemy player instead."}chickenF(t){const e=O.toEnterField(t.event),i=e.creature.attack,s=e.creature.opposed;s?s.hurtDirect(i,this.code):v.hurtDirect(!t.owner,i,this.code)}dfrC(){this.faction="N",this.rarity="H",this.name="Darkfrost Reaper",this.iAttack=this.boof6916,this.iHealth=this.boof3713,this.tribe.push("SK"),this.ftext="Destroy each creature with 1 or less attack."}dfrF(t){const e=p.crTarg();e.maxAttack=1;const i=f.creatByTarget(e),s=R.tick();i.forEach(h=>{W.destroy(h,this.code,s)})}dbaC(){this.faction="U",this.rarity="H",this.name="Deepbranch Ancient",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HY"),this.ftext=`If there is a friendly creature in each lane, ${this.name} gets ${m.jr9(this.iAttack,this.iHealth)}.`}dbaF(t){f.ddf1().length===5&&f.jr5(t.creatId).buff(this.iAttack,this.iHealth)}drbC(){this.faction="N",this.rarity="C",this.name="Dirge Banshee",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${m.jr9(-t,0)} and this gets ${m.jr9(t,0)}.`}drbF(t){const e=O.toEnterField(t.event),i=e.creature.opposed;if(i){const s=this.boof246;i.buff(-s,0),e.creature.buff(s,0)}}dddC(){this.faction="N",this.rarity="L",this.name="Doomwing, Dire Drake",this.iAttack=this.boof61018,this.iHealth=this.lValN([2,6,10]),this.iMobile=this.level,this.tribe.push("DG"),this.level>1&&(this.hints=[this.level===2?"ZZ-2":"ZZ-5"]),this.forges=!1,this.flanks=this.multNug(this.avgSpawnNug(),.5),this.ftext=`Destroy the opposing ${m.levelGateText(this.level,!0)}creature.`}dddF(t){const i=O.toEnterField(t.event).creature.opposed;i&&D.levelTestCommon(i.level,this.level)&&W.destroy(i,this.code)}espwrC(){this.faction="U",this.rarity="R",this.name="Esperian Wartusk",this.iAttack=this.boof5916,this.iHealth=this.iAttack-1,this.iBT=!0,this.allied="A",this.tribe.push("TK");const t=this.boof124;this.ftext=`Armor ${t}.`}espwrF(t){E.allied(this.allied)&&f.jr5(t.creatId).addArmor(this.boof124)}fwtC(){this.faction="U",this.rarity="H",this.name="Frostwild Tracker",this.iAttack=this.boof4712,this.iHealth=this.boof248,this.tribe.push("TG"),this.forges=this.level>1;const t=this.level-1;this.ftext=`You may play an additional ${m.levelGateText(t)} creature this turn.`,this.level===1&&(this.hints=["LG"])}fwtF(t){const e=E.freeCard(this.code);e.condition.card="C",e.condition.level=D.ddf2(this.level-1)}gwurmC(){this.faction="N",this.rarity="C",this.name="Gloomspire Wurm",this.iAttack=this.boof4813,this.iHealth=this.iAttack,this.tribe.push("WR"),this.ftext=`If there are no enemy creatures, ${this.name} gets ${m.jr9(4,4)}.`}gwurmF(t){f.qEnemyCreats().length===0&&f.jr5(t.creatId).buff(4,4)}gsC(){this.faction="U",this.rarity="C",this.name="Glowstride Stag",this.iAttack=this.boof5812,this.iHealth=this.iAttack+this.level,this.tribe.push("ST");const t=this.boof51015;this.ftext=`You gain ${t} health.`}gsF(t){const e=this.boof51015;v.heal(t.owner,e)}iracoC(){this.faction="A",this.rarity="L",this.name="Ironmind Acolyte",this.iAttack=this.boof61015,this.iHealth=this.iAttack-2,this.tribe.push("GN"),this.ftext="If you have five or more cards in your hand, you may play an additional card this turn."}iracoF(t){v.toPlayer(t.owner).hand.length>4&&(E.regularPlays+=1)}legtitC(){this.faction="N",this.rarity="R",this.name="Legion Titan",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.ftext=`${this.name} gets ${m.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`}legtitF(t){const e=p.crEnemyTarg();e.maxAttack=this.boof357;const i=f.creatByTarget(e);if(i.length>0){const s=this.level*i.length;f.jr5(t.creatId).buff(s,s)}}lbdC(){this.faction="U",this.rarity="H",this.name="Lifeblood Dryad",this.iAttack=this.lValN([4,7,9]),this.iHealth=this.iAttack,this.tribe.push("DY");const t=this.boof236;this.ftext=`If there is a friendly creature in each lane, each other friendly creature gets ${m.jr9(t,t)}.`}lbdF(t){const e=f.creatByTarget(p.crFriendNotMeTarg(t.creatId));if(e.length===4){const i=this.boof236;e.forEach(s=>s.buff(i,i))}}lyrC(){this.faction="N",this.rarity="L",this.name="Lyria, Muse of Varna",this.iAttack=this.boof5815,this.iHealth=this.boof4714,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.level===2?"Spawn a random creature that was destroyed this game.":"Put a random creature that was destroyed this game into each of your available lanes.",this.forges||(this.hints=["LG"])}lyrF(t){if(this.level===2){const e=W.gravedigger();e&&f.birth(e,"S",t.owner)}else if(this.level===3){const e=f.emptyLanes(t.owner),i=e.map(s=>W.gravedigger());if(e.length>0&&i[0]){const s=R.tick();e.forEach((h,u)=>{f.birth(i[u],"P",t.owner,h,s)})}}}moeC(){this.faction="T",this.rarity="H",this.name="Master of Elements",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=`You may play an additional ${m.levelGateText(this.level-1)} spell this turn.`}moeF(t){const e=E.freeCard(this.code);e.condition.card="S",e.condition.level=D.ddf2(this.level-1)}mmaC(){this.faction="A",this.rarity="C",this.name="Metamind Adept",this.iAttack=this.boof5915,this.iHealth=this.boof4813,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`Draw ${this.level} card${t}.`}mmaF(t){v.drawCard(t.owner,this.level)}mmrC(){this.faction="A",this.rarity="C",this.name="Metamind Archivist",this.iAttack=this.boof3713,this.iHealth=this.iAttack+5,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`If there is another friendly Metamind, draw ${this.level} card${t} at the end of your turn.`}mmrF(t){const e=p.crFriendNotMeTarg(t.creatId);if(e.tribe="MM",f.creatByTarget(e).length>0){const i=p.trigger("TE",this.code);i.changes=!0,i.bonus=this.rawNug(0,0,0,0,this.level*ht.dcWeight),v.toPlayer(t.owner).triggers.push(i)}}nysymC(){this.faction="N",this.rarity="C",this.name="Nyrali Symbiote",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`}nysymF(t){const e=O.toEnterField(t.event);e.creature.opposed&&e.creature.addRegen(this.boof246)}ofmC(){this.faction="A",this.rarity="R",this.name="Oreian Fieldmarshal",this.iAttack=this.boof5914,this.iHealth=this.iAttack-2,this.tribe.push("HM");const t=this.boof135;this.ftext=`Each other friendly creature gets ${m.jr9(t,0)}.`}ofmF(t){const e=this.boof135;f.creatByTarget(p.crFriendNotMeTarg(t.creatId)).forEach(s=>{s.buff(e,0)})}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.tribe.push("RB"),this.hints=["OP"],this.ftext=`${this.name} gets Armor ${this.iAttack} this turn.`}orpF(t){const e=f.jr5(t.creatId),i=p.mod("AR",this.iAttack,t.creatId);i.expiry="ET",e.addMod(i)}onxmarC(){this.faction="A",this.rarity="R",this.name="Onyxium Marauder",this.iAttack=this.boof4714,this.iHealth=this.lValN([6,9,17]),this.iArmor=this.level,this.allied="N",this.tribe.push("HM"),this.ftext=`Regenerate ${this.level}.`}onxmarF(t){E.allied(this.allied)&&f.jr5(t.creatId).addRegen(this.level)}phmC(){this.faction="A",this.rarity="R",this.name="Palladium Hindermind",this.iAttack=this.boof2612,this.iHealth=this.boof61016,this.tribe.push("HM"),this.ftext=`Each enemy creature gets ${m.jr9(this.boof123n,0)}.`}phmF(t){const e=this.boof123n;f.qEnemyCreats().forEach(i=>{i.buff(e,0)})}palsC(){this.faction="A",this.rarity="L",this.name="Palladium Simulacrum",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.iMobile=this.level-1,this.tribe.push("SS"),this.flanks=this.multNug(this.statSpawnNug(this.iAttack,this.iHealth),.5),this.ftext=`If ${this.name} is in the center lane, Spawn a copy.`}palsF(t){O.toEnterField(t.event).creature.lane===3&&f.birth(this.code,"S",t.owner)}prinvC(){this.faction="T",this.rarity="H",this.name="Primordial Invoker",this.iAttack=this.boof61016,this.iHealth=this.boof468,this.tribe.push("HM"),this.ftext=`Deal ${this.iHealth} damage divided at random between enemy creatures and the the enemy player.`}prinvF(t){const e=f.creatByTarget(p.crEnemyTarg()),i=e.length;if(i===0)v.hurtDirect(!t.owner,this.iHealth,this.code);else{const s=R.tick(),h=i+1,u=Array(h).fill(0);for(let g=0;g{u[y]>0&&g.hurtDirect(u[y],this.code,s)}),u[i]>0&&v.hurtDirect(!t.owner,u[i],this.code)}}scorchC(){this.faction="T",this.rarity="L",this.name="Scorchmane Dragon",this.iAttack=this.lValN([0,12,24]),this.iHealth=this.boof61224,this.tribe.push("DG"),this.iDefend=this.level===1,this.iMobile=this.level-1,this.forges=this.level>1,this.ftext="Deal 5 damage to "+(this.level===2?"the opposing creature.":"each enemy creature and player."),this.level===1&&(this.hints=["LG","LM"])}scorchF(t){const e=O.toEnterField(t.event),i=!t.owner;if(this.level===2){const s=e.creature.opposed;s&&s.hurtDirect(5,this.code)}else if(this.level===3){const s=R.tick();f.qPlayerCreats(i).forEach(h=>h.hurtDirect(5,this.code,s)),v.hurtDirect(i,5,this.code)}}scythC(){this.faction="N",this.rarity="L",this.name="Chiron, Herald of Torment",this.iAttack=12,this.iHealth=6,this.tribe.push("DM"),this.ftext=`Each enemy creature gets ${m.jr9(-6,0)} and ${this.name} gets ${m.jr9(6,0)} for each enemy creature.`}scythF(t){const e=f.qEnemyCreats();e.forEach(i=>{i.buff(-6,0)}),e.length>0&&f.jr5(t.creatId).buff(6*e.length,0)}souldrC(){if(this.faction="N",this.rarity="L",this.name="Soul Drinker",this.iAttack=1,this.iHealth=this.boof4814,this.iMobile=this.level===3?1:0,this.tribe.push("VP"),this.hints=["OP"],this.level===3){const t=this.avgCreatureStats();this.flanks=this.buffNug(t[0]*2,0)}this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`}souldrF(t){const e=O.toEnterField(t.event),i=e.creature.opposed;if(i){const s=i.attack;e.creature.buff(s,0),i.buff(-1*s,0)}}ssggC(){this.faction="N",this.rarity="H",this.name="Soulscourge Grimgaunt",this.iAttack=this.level+1,this.iHealth=this.iAttack,this.tribe.push("GG"),this.ftext=`${this.name} gets ${m.jr9(this.iAttack,this.iHealth)} for each creature that was destroyed this turn.`}ssggF(t){const e=this.iAttack*(E.deathsA.length+E.deathsB.length);e>0&&f.jr5(t.creatId).buff(e,e)}sbdC(){this.faction="U",this.rarity="C",this.name="Spiritbloom Dryad",this.iAttack=this.boof6812,this.iHealth=this.iAttack+this.level,this.tribe.push("DY"),this.ftext=`Each player gains ${this.boof468} health.`}sbdF(t){const e=this.boof468;v.heal(!0,e),v.heal(!1,e)}sssC(){this.faction="A",this.rarity="C",this.name="Steelskin Spelunker",this.iAttack=this.boof5814,this.iHealth=this.boof61018,this.tribe.push("HM"),this.ftext=`If there is another friendly creature in the center lane, that creature gets Armor ${this.boof124}`}sssF(t){const e=f.searchByLane(3,t.owner);e&&e.id!==t.creatId&&!e.negateArmor&&e.addArmor(this.boof124)}lotusC(){this.faction="U",this.rarity="H",this.name="Stygian Lotus",this.iAttack=this.boof468,this.iHealth=this.iAttack-1,this.tribe.push("PL"),this.hints=["OP"],this.ftext=`If ${this.name} is opposed, spawn a copy of it. Then repeat this for each copy.`}lotusF(t){if(O.toEnterField(t.event).creature.opposed){let i=!0;for(;i;){const s=f.emptyLanes(t.owner),h=s.length;if(h===0)i=!1;else{const u=s[T.randInt(0,h)];f.birth(this.code,"P",t.owner,u).opposed||(i=!1)}}}}tgiC(){this.faction="T",this.rarity="R",this.name="Thundergale Invoker",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("WN","GT"),this.ftext=`Each creature adjacent to ${this.name} moves one lane away if possible.`}tgiF(t){const e=f.jr5(t.creatId),i=e.lane,s=e.owner,h=[];if(i>2){const u=f.searchByLane(i-1,s);u&&(f.searchByLane(i-2,s)||(h.push(u),u.move(i-2)))}if(i<4){const u=f.searchByLane(i+1,s);u&&(f.searchByLane(i+2,s)||(h.push(u),u.move(i+2)))}h.length>0&&this.logAct(!1,...h)}tortex(t){return`Put a level ${this.level} ${t} into your hand.`}torf(t){const e=v.getActive(),i=t+this.level;e.hand.push(i)}toraC(){this.faction="A",this.rarity="R",this.name="Torrent Acolyte",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.tribe.push("MM"),this.forges=this.level>1,this.ftext=this.tortex("Power Torrent")}toraF(t){this.torf("PTR")}torsC(){this.faction="U",this.rarity="R",this.name="Torrent Soldier",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("IN"),this.forges=this.level>1,this.ftext=this.tortex("Spore Torrent")}torsF(t){this.torf("STO")}torvC(){this.faction="T",this.rarity="R",this.name="Torrent Valkyrie",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("IC","AS"),this.forges=this.level>1,this.ftext=this.tortex("Ice Torrent")}torvF(t){this.torf("ITO")}torwC(){this.faction="N",this.rarity="R",this.name="Torrent Witch",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.tortex("Spirit Torrent")}torwF(t){this.torf("STR")}umglidC(){this.faction="T",this.rarity="R",this.name="Umbruk Glider",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.iMobile=this.level,this.allied="U",this.tribe.push("DN"),this.ftext="Breakthrough."}umglidF(t){if(E.allied(this.allied)){const e=f.jr5(t.creatId);e.breakthrough=!0}}uwarC(){this.faction="T",this.rarity="H",this.name="Uranti Warlord",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("FR","YT"),this.hints=["OP"],this.ftext=`Each friendly Yeti deals ${this.iAttack} damage to the opposing creature.`}uwarF(t){const e=p.crFriendTarg();e.tribe="YT";const i=f.creatByTarget(e),s=R.tick();i.forEach(h=>{const u=h.opposed;u&&u.hurtDirect(this.iAttack,h.code,s)})}ustokeC(){this.faction="T",this.rarity="R",this.name="Uranti Warstoker",this.iAttack=this.boof6812,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.ftext=`Each other friendly Yeti get ${m.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const e=p.crFriendNotMeTarg(t.creatId);e.tribe="YT";const i=f.creatByTarget(e),s=this.stokeboof;i.forEach(h=>{const u=p.mod("AT",s,t.creatId);u.expiry="ET",h.addMod(u)})}get stokeboof(){return this.lValN([3,4,6])}uiwC(){this.faction="A",this.rarity="L",this.name="Uriel Ironwing",this.iAttack=this.lValN([6,8,13]),this.iHealth=this.boof81117,this.iMobile=this.level,this.tribe.push("AG"),this.hints=["ZZ-1"];const t=this.boof246n;this.flanks=this.buffNug(-t,0);let e="";this.level===3&&(e=" If that creature has 0 or less attack, destroy it.",this.flanks.count=1),this.ftext=`The opposing creature gets ${m.jr9(t,0)}.${e}`}uiwF(t){const s=O.toEnterField(t.event).creature.opposed;s&&(s.buff(this.boof246n,0),this.level===3&&s.attack<1&&W.destroy(s,this.code))}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${m.jr9(t,t)}.`}umaulF(t){const e=O.toEnterField(t.event);if(e.creature.opposed){const i=this.boof246;e.creature.buff(i,i)}}vikC(){this.faction="N",this.rarity="L",this.name="Varna, Immortal King",this.maxLevel=4,this.iAttack=this.lValN([4,6,12,18]),this.iHealth=this.lValN([8,13,22,30]),this.tribe.push("FB");let t="";this.level===4&&(t="Destroy each other creature. Then "),this.ftext=t+"Spawn a random friendly creature that was destroyed this turn."}vikF(t){if(this.level===4){const s=f.creatByTarget(p.crNotMeTarg(t.creatId));if(s.length>0){const h=R.tick();s.forEach(u=>W.destroy(u,this.code,h))}}const e=t.owner?E.deathsA:E.deathsB,i=e.length;e.length>0&&f.birth(e[T.randInt(0,i)],"S",t.owner)}vdrkC(){this.faction="U",this.rarity="R",this.name="Venomdrinker",this.iAttack=this.lValN([5,9,13]),this.iHealth=this.iAttack,this.tribe.push("NG"),this.ftext=`${this.name} gets ${m.jr9(1,1).replaceAll("1","X")}, where X is the total amount of Poison on each enemy creature.`}vdrkF(t){const e=f.qEnemyCreats();let i=0;e.forEach(s=>{i+=s.poison}),i>0&&f.jr5(t.creatId).buff(i,i)}vnsC(){this.faction="U",this.rarity="H",this.name="Venomous Netherscale",this.iAttack=this.boof4713,this.iHealth=this.iAttack+4,this.tribe.push("NG"),this.ftext=`Double the Poison on each enemy creature${this.level===3?" and the enemy player":""}.`}vnsF(t){const e=p.crEnemyTarg();if(e.hasPoison=!0,f.creatByTarget(e).forEach(s=>{s.addPoison(s.poison)}),this.level===3){const s=v.toPlayer(!t.owner);s.poison+=v.totalPoison(s)}}warC(){this.faction="A",this.rarity="H",this.name="War Machine",this.iAttack=3,this.iHealth=3,this.tribe.push("RB"),this.maxLevel=1,this.overload=!0,this.ftext=`Each other friendly creature gets ${m.jr9(3,0)}.`}warF(t){const e=p.crFriendNotMeTarg(t.creatId);f.creatByTarget(e).forEach(i=>i.buff(3,0))}wwpC(){this.faction="U",this.rarity="H",this.name="Weirwood Patriarch",this.iAttack=this.boof5714,this.iHealth=this.lValN([7,10,17]),this.tribe.push("HM");const t=this.boof235;this.ftext=`Each friendly creature with ${this.boof357} or less attack gets ${m.jr9(t,t)}.`}wwpF(t){const e=this.boof235,i=p.crFriendNotMeTarg(t.creatId);i.maxAttack=this.boof357,f.creatByTarget(i).forEach(s=>s.buff(e,e))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof247n;this.flanks=this.buffNug(-t,-t),this.ftext=`The opposing creature gets ${m.jr9(t,t)}.`}wfbF(t){const i=O.toEnterField(t.event).creature.opposed;if(i){const s=this.boof247n;i.buff(s,s)}}xtmC(){this.faction="N",this.rarity="H",this.name="Xithian Tormentor",this.iAttack=this.lValN([6,12,22]),this.iHealth=this.lValN([10,16,28]),this.tribe.push("AB"),this.ftext="Destroy each other friendly creature."}xtmF(t){const e=f.creatByTarget(p.crFriendNotMeTarg(t.creatId));if(e.length>0){const i=R.tick();e.forEach(s=>W.destroy(s,this.code,i))}}}class Ze extends M{lookup(t){return{["RBG"]:{c:()=>this.rbgC(),g:(i,s)=>this.rbgG(i,s)},["SRV"]:{c:()=>this.sprvC(),g:(i,s)=>this.sprvG(i,s)},["TGK"]:{c:()=>this.tgkC(),g:(i,s)=>this.tgkG(i,s)}}[t]}onGain(t,e){this.lookup(t).g(e,e.event)}hPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("LG",this.code);return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="LG"&&this.validPlayer(t)}jr8(t){this.onGain(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.hPlayer===0)return!0;const e=t.event;return this.hPlayer===1?t.owner===e.playerA:t.owner!==e.playerA}rbgC(){this.faction="U",this.rarity="H",this.name="Runebark Guardian",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hPlayer=1;const t=this.boof135;this.text=`When you gain health, ${this.name} gets ${m.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}rbgG(t,e){const i=f.jr5(t.creatId),s=this.boof135;i.buff(s,s)}sprvC(){this.faction="N",this.rarity="R",this.name="Spirit Reaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.hPlayer=-1;const t=this.boof234;this.text=`When an enemy player gains health, ${this.name} gets ${m.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}sprvG(t,e){const i=f.jr5(t.creatId),s=this.boof234;i.buff(s,s)}tgkC(){this.faction="U",this.rarity="R",this.name="Tuskin Grovekeeper",this.iAttack=this.boof6912,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hPlayer=1,this.text=`When you gain health, Spawn a 3/3 ${z.minionName(this.level)}.`,this.trigB=this.rawNug(.5,3,3,0)}tgkG(t,e){const i=this.lValS(["SXD","SPL","TTF"])+this.level;f.birth(i,"S",t.owner)}}class Fe extends M{lookup(t){return{["EWE"]:{c:()=>this.eweC(),m:(i,s)=>this.eweM(i,s)},["FFM"]:{c:()=>this.ffmC(),m:(i,s)=>this.ffmM(i,s)},["LUC"]:{c:()=>this.lugC(),m:(i,s)=>this.lugM(i,s)},["WBH"]:{c:()=>this.wbhC(),m:(i,s)=>this.wbhM(i,s)}}[t]}onMove(t,e){this.lookup(t).m(e,O.toCreature(e.event))}mPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("MV");return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="MV"&&this.validPlayer(t)}jr8(t){this.onMove(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=O.toCreature(t.event);return this.mPlayer===1?t.owner===e.creature.owner:t.owner!==e.creature.owner}eweC(){this.faction="T",this.rarity="H",this.name="Emberwind Evoker",this.iAttack=this.boof4914,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.mPlayer=1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${m.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}eweM(t,e){const i=this.boof124;e.creature.buff(i,i)}ffmC(){this.faction="T",this.rarity="H",this.name="Frostfang Maiden",this.iAttack=this.boof5814,this.iHealth=this.iAttack+this.level,this.tribe.push("HM"),this.iMobile=this.level,this.mPlayer=1;const t=this.ffbof;this.text=`When a friendly creature moves, deal ${t} to the creature opposing it.`,this.trigB=this.buffNug(t,0)}ffmM(t,e){const i=e.creature.opposed;i&&i.hurtDirect(this.ffbof,this.code)}get ffbof(){return this.level+2}lugC(){this.faction="T",this.rarity="L",this.name="Lug, Uranti Charger",this.iAttack=this.boof359,this.iHealth=this.lValN([9,13,19]),this.level===3&&(this.iMobile=1),this.tribe.push("YT"),this.mPlayer=1,this.text="When a friendly creature moves on your turn, Lug battles an additional time.",this.trigB=this.buffNug(this.iAttack,0)}lugM(t,e){if(t.owner===v.getActiveB()){const i=f.jr5(t.creatId);i.extraBattles+=1}}wbhC(){this.faction="T",this.rarity="R",this.name="Windborn Hellion",this.iAttack=this.boof4812,this.iHealth=this.boof81217,this.tribe.push("WN","EL"),this.mPlayer=1,this.text=`When a friendly creature moves, ${this.name} gets ${m.jr9(this.level,this.level)}.`,this.trigB=this.buffNug(this.level,this.level)}wbhM(t,e){f.jr5(t.creatId).buff(this.level,this.level)}}class qt extends M{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.agrdP(i,s)},["ART"]:{c:()=>this.arootC(),t:(i,s)=>this.factionSpellMyTurn(i,s,"U"),p:(i,s)=>this.arootP(i,s)},["ARB"]:{c:()=>this.arbysC(),t:(i,s)=>this.enemyPlayed(i,s),p:(i,s)=>this.arbysP(i,s)},["BLH"]:{c:()=>this.bblhC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.bblhP(i,s)},["CYC"]:{c:()=>this.ccC(),t:(i,s)=>this.factionSpellMyTurn(i,s,"N"),p:(i,s)=>this.ccP(i,s)},["DHW"]:{c:()=>this.dhwC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.dhwP(i,s)},["FBI"]:{c:()=>this.fbiC(),t:(i,s)=>this.factionSpellMyTurn(i,s,"T"),p:(i,s)=>this.fbiP(i,s)},["FLS"]:{c:()=>this.flspkC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.flspkP(i,s)},["IZK"]:{c:()=>this.izzyC(),t:(i,s)=>this.izzyT(i,s),p:(i,s)=>this.izzyP(i,s)},["KAW"]:{c:()=>this.kasC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.kasP(i,s)}}[t]}testPlay(t,e){return this.lookup(t).t(e,e.event)}actPlay(t,e){this.lookup(t).p(e,e.event)}trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return this.trigB&&i.jr4("PC"),i}ddf8(t){return t.event.code==="PLC"?this.testPlay(this.cardCode(),t):t.event.code==="TRE"&&this.cardCode()==="BLH"}jr8(t){if(t.event.code==="PLC")this.actPlay(this.cardCode(),t);else{const e=f.jr5(t.creatId);W.destroy(e,this.code)}x.triggerDone()}spellMyTurn(t,e){return e.playerA===t.owner&&L.getCard(e.cardCode).type==="S"}factionSpellMyTurn(t,e,i){if(e.playerA===t.owner){const s=L.getCard(e.cardCode);if(s.type==="S"&&s.faction===i)return!0}return!1}enemyPlayed(t,e){return e.playerA!==t.owner}ownerAlive(t){return f.jr5(t).status==="A"}agrdC(){this.faction="A",this.rarity="C",this.name="Aetherguard",this.iAttack=this.boof6814,this.iHealth=this.iAttack-1,this.tribe.push("RB"),this.trigB=this.rawNug(0,ht.calcCreatValueFormula(0,0,this.level,0,0,!1,0),0,0),this.text=`When you play a spell, ${this.name} gets Armor ${this.level}.`}agrdP(t,e){f.jr5(t.trigger.creatId).addArmor(this.level)}arootC(){this.faction="U",this.rarity="H",this.name="Aether Root",this.iAttack=this.boof3610,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=[this.lValH(["ZZ+1","ZZ+2","ZZ+3"])];const t=this.boof234;this.text=`When you play an Uterra spell, ${this.name} gets ${m.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}arootP(t,e){const i=f.jr5(t.trigger.creatId),s=this.boof234;i.buff(s,s)}arbysC(){this.faction="A",this.rarity="H",this.name="Anvillon Arbiter",this.iAttack=this.boof3714,this.iHealth=this.iAttack+3,this.iArmor=1,this.tribe.push("RB"),this.text="When the enemy player plays their second card in a turn, that player discards their hand.",this.trigB=this.rawNug(0,0,0,0,1)}arbysP(t,e){if(E.cardsPlayed>1&&this.ownerAlive(t.creatId)){const i=v.getActive();i.discard.push(...i.hand),i.hand=[]}}bblhC(){this.faction="T",this.rarity="L",this.name="Binben, Lightning Herald",this.iAttack=this.boof61017,this.iHealth=this.boof468,this.tribe.push("LT","AS");const t=L.getCard(this.lwy());this.text=`When you play a spell, Spawn a ${m.tokName(t)}. At the end of your turn, destroy it.`,this.trigB=this.spawnNug(t)}bblhP(t,e){if(this.ownerAlive(t.creatId)){const i=f.birth(this.lwy(),"S",t.owner);if(i){const s=i.jr4("TE",this.code);s.changes=!0}}}lwy(){return "LWY"+this.level}ccC(){this.faction="N",this.rarity="H",this.name="Crypt Conjurer",this.iAttack=this.boof258,this.iHealth=this.lValN([8,14,20]),this.tribe.push("VP"),this.text=`When you play a Nekrium spell, deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.trigB=this.playerNug(2*this.iAttack)}ccP(t,e){this.ownerAlive(t.creatId)&&(v.hurtDirect(!t.owner,this.iAttack,t.cardCode),v.heal(t.owner,this.iAttack))}dhwC(){this.faction="N",this.rarity="R",this.name="Darkheart Wanderer",this.iAttack=this.boof3612,this.iHealth=this.boof81116,this.tribe.push("HM");const t=this.boof124;this.text=`When you play a spell, ${this.name} gets Regenerate ${t}.`,this.trigB=this.regnNug(t)}dhwP(t,e){f.jr5(t.trigger.creatId).addRegen(this.boof124)}fbiC(){this.faction="T",this.rarity="H",this.name="Flamebreak Invoker",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("FR","GT"),this.text=`When you play a Tempys spell, deal ${this.level} damage to each enemy creature.`,this.trigB=this.buffNug(0,this.level*2)}fbiP(t,e){if(this.ownerAlive(t.creatId)){const i=R.tick();f.qEnemyCreats().forEach(s=>{s.hurtDirect(this.level,this.code,i)})}}flspkC(){this.faction="T",this.rarity="C",this.name="Flame Speaker",this.iAttack=this.lValN([2,6,13]),this.iHealth=this.level*6,this.tribe.push("HM");const t=this.boof235;this.text=`When you play a spell, deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t)}flspkP(t,e){this.ownerAlive(t.creatId)&&v.hurtDirect(!t.owner,this.boof235,t.cardCode)}izzyC(){this.faction="T",this.rarity="L",this.name="Iztek, Khan of Arrachtor",this.iAttack=this.boof6915,this.iHealth=this.iAttack,this.tribe.push("IC","FR","AS"),this.text=`When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.~When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.`,this.trigB=this.rawNug(0,0,0,0,.5)}izzyT(t,e){if(e.playerA===t.owner){const s=L.getCard(e.cardCode).cardCode();if(s==="IFL"||s==="IFR")return!0}return!1}izzyP(t,e){const i=f.jr5(t.trigger.creatId),h=L.getCard(e.cardCode).cardCode()==="IFL"?"IZL":"IZR";f.birth(`${h}${this.level}`,"R",i.owner,i.lane)}kasC(){this.faction="T",this.rarity="L",this.name="Kas, Arcweaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("LT","AS"),this.hints=["OL"],this.text="When you play a spell, Kas battles an additional time this turn.",this.trigB=this.buffNug(this.iAttack,0)}kasP(t,e){const i=f.jr5(t.trigger.creatId);i.extraBattles+=1}}class Pe extends M{lookup(t){return{["KTS"]:{c:()=>this.kitC(),r:(i,s)=>this.kitR(i,s)},["RSC"]:{c:()=>this.scootC(),r:(i,s)=>this.scootR(i,s)},["SCC"]:{c:()=>this.shcrC(),r:(i,s)=>this.shcrR(i,s)},["SND"]:{c:()=>this.ssdC(),r:(i,s)=>this.ssdR(i,s)}}[t]}trigB;actReplace(t,e){this.lookup(t).r(e,O.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("RP");return s.bonus=this.trigB,i}ddf8(t){if(t.event.code==="RPL"){const e=t.event;return t.creatId===e.replCreatId}return!1}jr8(t){this.actReplace(this.cardCode(),t),x.triggerDone()}kitC(){this.faction="U",this.rarity="H",this.name="Kitaru Sprite",this.iAttack=this.boof358,this.iHealth=this.boof71117,this.tribe.push("FY"),this.hints=["RT"],this.text=`When this is replaced, Spawn a ${this.name}.`,this.trigB=this.buffNug(0,this.iHealth)}kitR(t,e){f.birth(this.code,"S",t.owner)}scootC(){this.faction="A",this.rarity="T",this.name="Relic Scout",this.iAttack=this.level,this.iHealth=this.level,this.iArmor=this.level,this.isFree=!0,this.tribe.push("RB"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${m.jr9(this.level,this.level,!0)} and Armor ${this.level}.`,this.trigB=this.buffNug(this.level,ht.calcCreatValueFormula(this.level,this.level,this.level,0,0,!1,0))}scootR(t,e){e.creature.buff(this.level,this.level),e.creature.addArmor(this.level)}shcrC(){this.faction="U",this.rarity="C",this.name="Shardclaw Crusher",this.iAttack=this.boof5812,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${m.jr9(this.iAttack,this.iAttack)}.`,this.trigB=this.multNug(this.buffNug(this.iAttack,this.iAttack),.5)}shcrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}ssdC(){this.faction="U",this.rarity="R",this.name="Spiritstone Druid",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("TG"),this.hints=["RT"],this.text=`When ${this.name} is replaced, put a ${this.iAttack}/${this.iHealth} Spirit into each adjacent available lane.`,this.trigB=this.buffNug(this.iAttack,this.iHealth),this.trigB.count=1}ssdR(t,e){const i=e.replCreat.adjacent,s=f.emptyLanes(t.owner),h=R.tick();i.forEach(u=>{s.includes(u)&&f.birth("SPU"+this.level,"P",t.owner,u,h)})}}class de extends M{lookup(t){return{["BST"]:{c:()=>this.brimC(),u:(i,s)=>this.brimR(i,s)},["OSV"]:{c:()=>this.scavC(),u:(i,s)=>this.scavR(i,s)},["RHU"]:{c:()=>this.tiaC(),u:(i,s)=>this.tiaR(i,s)},["SKS"]:{c:()=>this.spsoC(),u:(i,s)=>this.spsoR(i,s)},["SWG"]:{c:()=>this.stgrC(),u:(i,s)=>this.stgrR(i,s)},["VTW"]:{c:()=>this.weldC(),u:(i,s)=>this.weldR(i,s)}}[t]}actUpgrade(t,e){this.lookup(t).u(e,O.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return i.jr4("UP"),i}jr8(t){this.actUpgrade(this.cardCode(),t),x.triggerDone()}brimC(){this.faction="T",this.rarity="L",this.name="Brimstone Tyrant",this.iAttack=this.boof6916,this.iHealth=this.iAttack,this.tribe.push("FR","EL"),this.hints=["RD"];const t=this.boof468;this.text=`Upgrade: Deal ${t} damage to each other creature.`}brimR(t,e){const i=R.tick(),s=this.boof468;f.creatByTarget(p.crNotMeTarg(t.creatId)).forEach(h=>h.hurtDirect(s,this.code,i))}scavC(){this.faction="A",this.rarity="H",this.name="Oreian Scavenger",this.iAttack=this.boof6916,this.iHealth=1,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Armor ${this.iAttack}.`}scavR(t,e){e.creature.addArmor(this.iAttack)}tiaC(){this.faction="A",this.rarity="L",this.name="Relic Hunter",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iBT=!0,this.tribe.push("HM"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets +attack and +health equal to the creature it replaced.`}tiaR(t,e){e.creature.buff(e.replCreat.attack,e.replCreat.health)}spsoC(){this.faction="T",this.rarity="C",this.name="Sparksoul",this.iAttack=this.boof6915,this.iHealth=this.iAttack-1,this.tribe.push("LT","EL"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Aggressive.`}spsoR(t,e){e.creature.aggressive=!0}stgrC(){this.faction="A",this.rarity="C",this.name="Steelwatch Guard",this.iAttack=this.boof4711,this.iHealth=this.iAttack,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets ${m.jr9(this.iAttack,this.iAttack)}.`}stgrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}weldC(){this.faction="A",this.rarity="R",this.name="Vault Welder",this.iAttack=this.boof71118,this.iHealth=this.lValN([9,14,22]),this.iDefend=!0,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: Negate Defender from ${this.name}.`}weldR(t,e){e.creature.negateDefender=!0}}class Tt extends M{lookup(t){return{["CGF"]:{c:()=>this.cfiendC(),v:(i,s)=>this.cfiendV(i,s)},["CSB"]:{c:()=>this.corpsC(),v:(i,s)=>this.corpsV(i,s)},["CYS"]:{c:()=>this.cslmC(),v:(i,s)=>this.cslmV(i,s)},["DSK"]:{c:()=>this.dskC(),v:(i,s)=>this.dskV(i,s)},["FST"]:{c:()=>this.fstrC(),v:(i,s)=>this.fstrV(i,s)},["FWK"]:{c:()=>this.fwlkC(),v:(i,s)=>this.fwlkV(i,s)},["FFD"]:{c:()=>this.ffC(),v:(i,s)=>this.ffV(i,s)},["GVS"]:{c:()=>this.ghsC(),v:(i,s)=>this.ghsV(i,s)},["GBG"]:{c:()=>this.ggC(),v:(i,s)=>this.ggV(i,s)},["GMR"]:{c:()=>this.gromC(),v:(i,s)=>this.gromV(i,s)},["MMX"]:{c:()=>this.mmeC(),v:(i,s)=>this.mmeV(i,s)},["NOZ"]:{c:()=>this.nyozC(),v:(i,s)=>this.nyozV(i,s)},["POX"]:{c:()=>this.poxC(),v:(i,s)=>this.poxV(i,s)},["RSZ"]:{c:()=>this.rszC(),v:(i,s)=>this.rszV(i,s)},["SFM"]:{c:()=>this.spirmC(),v:(i,s)=>this.spirmV(i,s)},["SNT"]:{c:()=>this.sssC(),v:(i,s)=>this.sssV(i,s)},["VGN"]:{c:()=>this.vgfsC(),v:(i,s)=>this.vgfsV(i,s)},["XHS"]:{c:()=>this.xhostC(),v:(i,s)=>this.xhostV(i,s)},["ZTU"]:{c:()=>this.zimusC(),v:(i,s)=>this.zimusV(i,s)}}[t]}cardVengeance(t,e){this.lookup(t).v(e,O.toCreature(e.event))}vtext="";trigB;fixedImgCreat=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.trigB&&(this.text="Vengeance: "+this.vtext),this.vtext=""}image(t){return this.fixedImgCreat?this.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e);if(this.trigB){const s=i.jr4("VN");s.bonus=this.trigB}return i}jr8(t){this.cardVengeance(this.cardCode(),t),x.triggerDone()}cfiendC(){this.faction="N",this.rarity="T",this.name="Contagion Fiend",this.iAttack=this.boof234,this.iHealth=this.boof5812,this.tribe.push("AB"),this.fixedImgCreat=!0;const t=-this.level;this.vtext=`Each enemy creature gets ${m.jr9(t,t)}.`;const e=this.boof246;this.trigB=this.buffNug(e,e)}cfiendV(t,e){const i=-this.level,s=R.tick(),h=p.crTarg();h.player=v.toTarget(!t.owner),f.creatByTarget(h).forEach(u=>u.buff(i,i,s))}corpsC(){this.faction="N",this.rarity="C",this.name="Corpulent Shambler",this.iAttack=this.lValN([5,7,15]),this.iHealth=this.iAttack,this.tribe.push("ZB"),this.vtext="Put a 3/3 Zombie into this lane.",this.trigB=this.buffNug(3,3)}corpsV(t,e){const i=`${"ZBS"}${this.level}`;f.birth(i,"P",e.creature.owner,e.creature.lane)}cslmC(){this.faction="N",this.rarity="C",this.name="Crypt Slime",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.vtext="Put a 1/1 Oozeling into this lane.",this.trigB=this.buffNug(1,1)}cslmV(t,e){const i=`${"COZ"}${this.level}`;f.birth(i,"P",e.creature.owner,e.creature.lane)}dskC(){this.faction="N",this.rarity="C",this.name="Death Seeker",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.fixedImgCreat=!0,this.hints=["ST"];const t=this.boof51015;this.vtext=`Put a ${t}/${t} Spirit into this lane.`,this.trigB=this.buffNug(t,t)}dskV(t,e){const i=`${"SPN"}${this.level}`;f.birth(i,"P",e.creature.owner,e.creature.lane)}fstrC(){this.faction="N",this.rarity="R",this.name="Fell Strider",this.iAttack=this.lValN([4,8,10]),this.iHealth=this.boof369,this.tribe.push("ZB");const t=L.getCard(this.fsz());this.vtext=`Spawn a ${m.tokName(t)}.`,this.trigB=this.multNug(this.buffNug(t.iAttack,t.iHealth),.5)}fstrV(t,e){f.birth(this.fsz(),"S",e.creature.owner)}fsz(){return "ZST"+this.level}fwlkC(){this.faction="N",this.rarity="C",this.name="Fell Walker",this.iAttack=this.boof359,this.iHealth=this.iAttack,this.tribe.push("ZB");const t=L.getCard(z.zomc(this.level));this.vtext=`Put a ${m.tokName(t)} into this lane.`,this.trigB=this.buffNug(t.iAttack,t.iHealth)}fwlkV(t,e){f.birth(z.zomc(this.level),"P",e.creature.owner,e.creature.lane)}ffC(){this.faction="N",this.rarity="H",this.name="Fleshfiend",this.iAttack=this.boof6812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.vtext=`Put a level ${this.level-1} ${this.name} into this lane.`,this.level>1&&(this.trigB=this.buffNug(0,this.lValN([0,6,15])))}ffV(t,e){const i=`${"FFD"}${this.level-1}`;f.birth(i,"P",e.creature.owner,e.creature.lane)}ghsC(){this.faction="U",this.rarity="C",this.name="Glowhive Siren",this.iAttack=this.boof3814,this.iHealth=this.boof61117,this.tribe.push("IN"),this.vtext=`You gain ${this.boof124} to ${this.gghigh-1} health.`,this.trigB=this.playerNug(this.boof258)}ghsV(t,e){const i=T.randInt(this.boof124,this.gghigh);v.heal(t.owner,i)}get gghigh(){return this.lValN([5,9,13])}ggC(){this.faction="N",this.rarity="C",this.name="Graveborn Glutton",this.iAttack=this.boof61117,this.iHealth=this.boof3814,this.tribe.push("AB"),this.vtext=`Deal ${this.boof124} to ${this.gghigh-1} damage to the enemy player.`,this.trigB=this.playerNug(this.boof258)}ggV(t,e){const i=T.randInt(this.boof124,this.gghigh);v.hurtDirect(!t.owner,i,this.code)}gromC(){this.faction="U",this.rarity="C",this.name="Grove Matriarch",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("PL");const t=z.minionBuff(this.level),e=z.minionName(this.level);this.vtext=`Put a ${t}/${t} ${e} into this lane.`,this.trigB=this.buffNug(t,t)}gromV(t,e){const i=z.minionCode(this.level);f.birth(i,"P",e.creature.owner,e.creature.lane)}mmeC(){this.faction="A",this.rarity="C",this.name="Metamind Explorer",this.iAttack=this.boof3713,this.iHealth=this.iAttack+2,this.tribe.push("MM"),this.vtext=`Draw ${this.level} cards.`,this.trigB=this.rawNug(0,0,0,0,this.level*ht.dcWeight)}mmeV(t,e){v.drawCard(t.owner,this.level)}nyozC(){this.faction="N",this.rarity="R",this.name="Nyrali Ooze",this.iAttack=this.boof247,this.iHealth=this.iAttack,this.tribe.push("OZ");const t=this.level+this.iAttack+1;this.vtext=`Put a ${t}/${t} Oozeling into this lane.`,this.trigB=this.buffNug(t,t)}nyozV(t,e){const i=`${"OOZ"}${this.level}`;f.birth(i,"P",e.creature.owner,e.creature.lane)}poxC(){if(this.faction="N",this.rarity="H",this.name="Progeny of Xith",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.tribe.push("AB"),this.hints=["LB"],this.vtext=`Spawn a level ${this.level+1} ${this.name}.`,this.level<3){const t=this.lValN([10,6,0]);this.trigB=this.buffNug(t,t)}}poxV(t,e){const i=`${"POX"}${this.level+1}`;f.birth(i,"S",e.creature.owner)}rszC(){this.faction="N",this.rarity="R",this.name="Runescarred Zombie",this.iAttack=this.lValN([5,8,16]),this.iHealth=this.boof359,this.tribe.push("ZB"),this.vtext=`Put a ${m.levelGateText(this.level,!0)}spell at random from your discard pile into your hand.`,this.trigB=this.rawNug(0,0,0,0,.5)}rszV(t,e){const i=v.toPlayer(t.owner),s=p.target("TD");s.player=v.toTarget(i),s.card="S",s.level=D.ddf2(this.level);const h=D.deckByTarget(s);if(h.length>0){const u=h[T.randInt(0,h.length)];i.discard.splice(u[1],1),i.hand.push(u[0])}}spirmC(){this.faction="T",this.rarity="H",this.name="Spiritflame Mystic",this.iAttack=this.boof6912,this.iHealth=this.iAttack-3,this.tribe.push("HM"),this.vtext=`Deal ${this.boof246} damage to each creature.`,this.trigB=this.rawNug(0,0,0,0,.2)}spirmV(t,e){const i=this.boof246,s=R.tick();f.qActiveCreats().forEach(h=>h.hurtDirect(i,this.code,s))}sssC(){this.faction="N",this.rarity="L",this.name="Spiritstone Sentry",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("ST"),this.vtext=`If ${this.name} was in a side lane, Spawn a ${this.name}.`,this.hints=["ST"],this.trigB=this.buffNug(this.iAttack,this.iAttack)}sssV(t,e){(e.creature.lane===1||e.creature.lane===5)&&f.birth(e.creature.code,"S",t.owner)}vgfsC(){this.faction="N",this.rarity="C",this.name="Vengeful Spirit",this.iAttack=this.boof357,this.iHealth=this.iAttack-2,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof369n;this.vtext=`Give the opposing creature ${m.jr9(t,t)}.`,this.trigB=this.buffNug(-t,-t)}vgfsV(t,e){const i=e.creature.opposed;if(i){const s=this.boof369n;i.buff(s,s)}}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.iAttack=this.boof359,this.iHealth=this.boof135,this.tribe.push("AB"),this.vtext=`Deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.trigB=this.playerNug(this.iAttack*2)}xhostV(t,e){const i=this.iAttack;v.hurtDirect(!t.owner,i,this.code),v.heal(t.owner,i)}zimusC(){this.faction="N",this.rarity="L",this.name="Zimus, the Undying",this.iAttack=this.boof51014,this.iHealth=this.lValN([2,5,7]),this.tribe.push(this.level===1?"HM":"ZB"),this.vtext=`Spawn a Zimus, the ${this.level===2?"Returned":"Undying"}.`,this.level<3?(this.hints=["LG"],this.level===2?(this.trigB=this.buffNug(this.iAttack,this.iHealth),this.hints.push("ZZ-5")):this.hints.push("ZZ-1")):(this.hints=["ST","ZZ-5"],this.trigB=this.buffNug(this.iAttack,this.iHealth),this.trigB.bonus=1)}zimusV(t,e){let i;this.level===2?i=`${"ZTR"}2`:i=`${"ZTU"}3`,f.birth(i,"S",t.owner)}}class Wt extends kt{lookup(t){return{["AEC"]:{c:()=>this.anceC(),p:i=>this.aeZ(i)},["DIS"]:{c:()=>this.disnC(),p:i=>this.disnZ(i)},["DRE"]:{c:()=>this.dracC(),p:i=>this.deZ(i)},["DCH"]:{c:()=>this.dchantC(),p:i=>this.dchantZ(i)},["ESU"]:{c:()=>this.esrgC(),p:i=>this.esrgZ(i)},["HOX"]:{c:()=>this.howlC(),p:i=>this.howlZ(i)},["ITO"]:{c:()=>this.itorC(),p:i=>this.itorZ(i)},["IME"]:{c:()=>this.imecC(),p:i=>this.ieZ(i)},["LCE"]:{c:()=>this.lucidC(),p:i=>this.leZ(i)},["MSP"]:{c:()=>this.mendC(),p:i=>this.mendZ(i)},["NEM"]:{c:()=>this.netherC(),p:i=>this.netherZ(i)}}[t]}cardCast(t,e){this.lookup(t).p(e)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(p.playerActTarg(this.playTarg,"CARD",this.code,"")),t}handleAction(t){this.logSpell();const e=v.toPlayer(t.playerA);this.cardCast(this.cardCode(),e),S.spellCast()}ddf8(t){return t.trigger.type==="TE"?t.event.playerA===t.owner:!1}jr8(t){const e=Dt.extractCardCode(t.trigger.logicCode),i=t.event;if(e==="LCE"){const s=v.toPlayer(i.playerA),h=this.level===1?1:2;this.logAct(!1),v.drawCard(s,h)}else if(e==="IME"){const s=W.gravedigger(v.toTarget(t.owner),D.ddf2(this.level+1));s&&f.birth(s,"S",i.playerA)}else if(e==="DRE"){const s=this.level===1?11:21;v.hurtDirect(!i.playerA,T.randInt(1,s),this.code)}else if(e==="AEC"){const s=f.qPlayerCreats(t.owner);if(s.length>0){const h=this.level===1?[1,2]:[2,4];s.forEach(u=>{this.logAct(!1,u),u.buff(h[0],h[1])})}}else super.jr8(t);if(this.level<3){const s=v.toPlayer(i.playerA),h=p.trigIdx(s.triggers,t.trigger);h>-1?t.trigger.customCode==="P2"?s.triggers[h].customCode="P1":s.triggers.splice(h,1):console.error("Wery curious, could not find player trigger ",t.trigger)}x.triggerDone()}echTxt(){return"At the end of "+(this.level===3?"each of your turns":"this turn and your next turn")+", "}echoZ(t){const e=p.trigger("TE",this.code);return this.level<3&&(e.customCode="P2"),e.changes=!0,t.triggers.push(e),e}anceC(){this.faction="U",this.rarity="L",this.name="Ancestral Echoes",this.playTarg="F";const t=this.level===1?[1,2]:[2,4];this.text=`${this.echTxt()}each friendly creature gets ${m.jr9(t[0],t[1])}.`}aeZ(t){const e=this.echoZ(t),i=this.boof248;e.bonus=this.buffNug(i,i*2)}disnC(){this.faction="T",this.rarity="R",this.name="Disintigrate",this.playTarg="E",this.text=`Deal 1 to ${this.dshigh-1} damage to the enemy player.`}disnZ(t){v.hurtDirect(t,T.randInt(1,this.dshigh),this.code)}get dshigh(){return this.lValN([9,16,26])}dracC(){this.faction="T",this.rarity="L",this.name="Draconic Echoes",this.playTarg="F";const t=this.level===1?"10":"20";this.text=`${this.echTxt()}deal 1 to ${t} damage to the enemy player.`}deZ(t){const e=this.echoZ(t),i=this.lValN([4,9,25]);e.bonus=this.playerNug(i)}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){v.heal(t,this.boof81220)}esrgC(){this.faction="A",this.rarity="R",this.name="Energy Surge",this.isFree=this.level>1,this.overload=this.level===3,this.level===1&&(this.hints=["LG"]),this.playTarg="F",this.text=`Draw ${this.level} card${this.level>1?"s":""}.`}esrgZ(t){v.drawCard(t,this.level)}howlC(){this.faction="N",this.rarity="R",this.name="Howl of Xith",this.maxLevel=1,this.playTarg="E",this.text="Deal X damage to the enemy player and gain X health, where X is three times your rank."}howlZ(t){const e=v.getActive(),i=e.rank*3;v.hurtDirect(t,i,this.code),v.heal(e,i)}itorC(){this.faction="T",this.rarity="R",this.name="Ice Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg="E",this.text=`Deal ${this.boof234} damage to the enemy player.`}itorZ(t){v.hurtDirect(t,this.boof234,this.code)}imecC(){this.faction="N",this.rarity="L",this.name="Immortal Echoes",this.playTarg="F";const t=`Spawn a random friendly ${m.levelGateText(this.level+1,!0)}creature that was destroyed this game`;this.text=`${this.echTxt()}${t}.`}ieZ(t){const e=this.echoZ(t),i=this.lValN([1,1,3]);e.bonus=this.multNug(this.avgSpawnNug(),i)}lucidC(){this.faction="A",this.rarity="L",this.name="Lucid Echoes",this.playTarg="F";const t=this.level===1?"draw 1 card":"draw 2 cards";this.text=`${this.echTxt()}${t}.`}leZ(t){const e=this.echoZ(t),i=this.boof124*ht.dcWeight;e.bonus=this.rawNug(0,0,0,0,i)}mendC(){this.faction="U",this.rarity="R",this.name="Mending Spring",this.playTarg="F",this.text=`You gain 1 to ${this.mendboof} Health.`}mendZ(t){v.heal(t,T.randInt(1,this.mendboof+1))}get mendboof(){return this.lValN([10,20,40])}netherC(){this.faction="N",this.rarity="C",this.name="Nether Embrace",this.playTarg="E";const t=this.boof4712;this.text=`Deal ${t} damage to the enemy player. You gain ${t} heal`}netherZ(t){const e=this.boof4712;v.hurtDirect(t,e,this.code),v.heal(!t.isPlayerA,e)}}class Er extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Rageborn Hellion",this.iAttack=this.boof469,this.iHealth=this.iAttack*2,this.tribe.push("FR","EL"),this.hints=["OL"],this.text=`When a friendly creature ${m.dbdtap()}, ${this.name} gets ${m.jr9(this.level,this.level)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM"),h=this.boof246;return s.bonus=this.buffNug(h,h),i}ddf8(t){if(t.trigger.type==="DM"){const e=O.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}return!1}jr8(t){f.jr5(t.creatId).buff(this.level,this.level),x.triggerDone()}}class Et extends M{lookup(t){return{["AIV"]:{c:()=>this.avinvC(),r:i=>this.avinvR(i)},["BSP"]:{c:()=>this.bskphC(),r:i=>this.bskphR(i)},["CRC"]:{c:()=>this.crucC(),r:i=>this.crucR(i)},["ESK"]:{c:()=>this.ebknC(),r:i=>this.ebknR(i)},["FWC"]:{c:()=>this.fwcC(),r:i=>this.fwcR(i)},["FME"]:{c:()=>this.feggC(),r:i=>this.feggR(i)},["MMV"]:{c:()=>this.mmovC(),r:i=>this.mmovR(i)},["PSH"]:{c:()=>this.porshC(),r:i=>this.porshR(i)},["RGG"]:{c:()=>this.runegC(),r:i=>this.runegR(i)},["SSR"]:{c:()=>this.solrevC(),r:i=>this.solrevR(i)},["SSM"]:{c:()=>this.spshamC(),r:i=>this.spshamR(i)},["SSG"]:{c:()=>this.snoutC(),r:i=>this.snoutR(i)},["UGM"]:{c:()=>this.mantisC(),r:i=>this.mantisR(i)}}[t]}rtext="";trigB;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Gain Rank: "+this.rtext,this.rtext=""}image(t){return this.rarity==="T"?this.cardCode()==="FWC"?this.rawImage("MPH",t):super.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("RU");return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.owner:!1}jr8(t){this.lookup(this.cardCode()).r(t),x.triggerDone()}avinvC(){this.faction="T",this.rarity="H",this.name="Avalanche Invoker",this.iAttack=this.boof6914,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS"),this.hints=["TL"];const t=this.boof3612;this.trigB=this.buffNug(t,0),this.rtext=`Deal ${t} damage to each non-Tempys creature.`}avinvR(t){const e=this.boof3612,i=R.tick();f.qActiveCreats().filter(s=>s.faction!=="T").forEach(s=>s.hurtDirect(e,this.code,i))}bskphC(){this.faction="N",this.rarity="C",this.name="Blightskull Phantasm",this.iAttack=this.boof5814,this.iHealth=this.boof61017,this.tribe.push("ST"),this.hints=["TL","OP"];const t=this.boof369n;this.trigB=this.buffNug(0,-t),this.rtext=`The opposing creature gets ${m.jr9(t,t)}.`}bskphR(t){const i=f.jr5(t.creatId).opposed;if(i){const s=this.boof369n;i.buff(s,s)}}crucC(){this.faction="A",this.rarity="R",this.name="Crucible Colossus",this.iAttack=this.boof61016,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.iDefend=!0,this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,.2),this.rtext=`Negate Defender from ${this.name}.`}crucR(t){const e=f.jr5(t.creatId);e.negateDefender=!0}ebknC(){this.faction="N",this.rarity="H",this.name="Ebonskull Knight",this.iAttack=this.lValN([9,13,18]),this.iHealth=this.iAttack-2,this.tribe.push("VP"),this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,-1),this.rtext=`Destroy ${this.name}.`}ebknR(t){const e=f.jr5(t.creatId);W.destroy(e,this.code)}fwcC(){this.faction="U",this.rarity="T",this.maxLevel=1,this.name="Feywing Chrysalis",this.iAttack=0,this.iHealth=3,this.tribe.push("CR"),this.iDefend=!0,this.trigB=this.buffNug(5,5),this.rtext=`Replace ${this.name} with a 9/9 Feywing.`}fwcR(t){const e=f.jr5(t.creatId);f.birth(`${"FWG"}1`,"R",e.owner,e.lane)}feggC(){this.faction="T",this.rarity="T",this.minLevel=this.level,this.maxLevel=this.level,this.name="Frostmane Egg",this.iAttack=0,this.iHealth=6,this.tribe.push("DG"),this.iDefend=!0;const t=this.lValN([6,9,13]);this.trigB=this.buffNug(t,t),this.rtext=`Replace ${this.name} with a level ${this.level} Frostmane Dragon.`}feggR(t){const e=f.jr5(t.creatId);f.birth(`${"FMD"}${this.level}`,"R",e.owner,e.lane)}mmovC(){this.faction="A",this.rarity="C",this.name="Metamind Overseer",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,ht.dcWeight*.6),this.rtext="Draw 2 cards."}mmovR(t){v.drawCard(t.owner,2)}porshC(){this.faction="N",this.rarity="H",this.name="Portal Shade",this.iAttack=this.boof5914,this.iHealth=this.boof71118,this.tribe.push("ST"),this.trigB=this.multNug(this.avgSpawnNug(),.4),this.rtext="Spawn a random creature that was destroyed this game."}porshR(t){const e=W.gravedigger();e&&f.birth(e,"S",t.owner)}runegC(){this.faction="U",this.rarity="H",this.name="Runegrove Guardian",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=["TL"],this.trigB=this.buffNug(0,this.iAttack),this.rtext=`${this.name} gets ${m.jr9(this.iAttack,this.iAttack)}.`}runegR(t){f.jr5(t.creatId).buff(this.iAttack,this.iAttack)}solrevC(){this.faction="U",this.rarity="L",this.name="Solstice Reveler",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hints=["TL"];const t=this.boof248;this.trigB=this.buffNug(t,t);const e=this.level===3;let i="";e&&(i=", and Breakthrough"),this.rtext=`Each friendly creature gets ${m.jr9(t,t,e)}${i}.`}solrevR(t){const e=this.boof248;f.ddf1().forEach(i=>{i.buff(e,e),this.level===3&&(i.breakthrough=!0)})}spshamC(){this.faction="T",this.rarity="C",this.name="Spiritfrost Shaman",this.iAttack=this.boof71117,this.iHealth=this.boof4610,this.tribe.push("HM"),this.hints=["TL"];const t=this.boof579;this.rtext=`Deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t)}spshamR(t){v.hurtDirect(!t.owner,this.boof579,this.code)}snoutC(){this.faction="U",this.rarity="C",this.name="Stouthide Stegadon",this.iAttack=this.boof4714,this.iHealth=this.boof71117,this.tribe.push("DN"),this.hints=["TL"],this.rtext=`Heal ${this.snoutbof} damage from ${this.name}.`,this.trigB=this.buffNug(0,this.iHealth)}snoutR(t){f.jr5(t.creatId).heal(this.snoutbof)}get snoutbof(){return this.level*10}mantisC(){this.faction="U",this.rarity="C",this.name="Umbraglim Mantis",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("IN"),this.hints=["TL"];const t=this.mantbof;this.rtext=`You gain ${t} health.`,this.trigB=this.playerNug(t/3)}mantisR(t){v.heal(t.owner,this.mantbof)}get mantbof(){return this.lValN([8,10,12])}}class Ir extends M{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Riftlasher",this.iAttack=this.boof359,this.iHealth=this.boof61016,this.tribe.push("FR","EL"),this.text=`When ${this.name} ${m.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.interactive=!0,s.bonus=this.buffNug(this.iAttack,0),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&t.owner===v.getActiveB()}return!1}jr8(t){const e=t.event,i=D.toActions(p.crEnemyActTarg("CARD",this.code,T.enTil(t.creatId,e.dmg)));i.length>0?(i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}handleAction(t){const e=T.deTil(t.param);f.ddf6(t).hurtDirect(parseInt(e[1]),this.code),S.actionDone(!0)}}class Lr extends Vt{jr3(t,e){const i=super.jr3(t,e);return i.jr4("AS"),i}jr8(t){if(t.trigger.type==="AS"){let e=!0;for(;e;){const i=f.birth(this.code,"S",t.owner);i?i.opposed&&(e=!1):e=!1}x.triggerDone()}else super.jr8(t)}}class Gr extends M{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Scourgeflame Sorcerer",this.iAttack=this.boof358,this.iHealth=this.boof5914,this.tribe.push("ZB");let e=": ",i=1;this.level<3&&(e=", destroy another friendly creature: ",i=.5);const s=`Destroy an enemy ${m.levelGateText(this.level+1,!0)}creature.`;this.text=`Activate${e}${s}`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),i)}}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){let e;this.level===3?e=this.enemies(t):e=this.friends(t),e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param),i=f.jr5(e[0]),s=f.ddf6(t);if(e[1]==="P1"){const h=this.enemies(i,s.id);h.push(S.cancelAction()),S.ddf5(h)}else{this.logAct(!0);const h=R.tick();if(this.level<3){const u=f.jr5(e[2]);W.destroy(u,this.code,h)}W.destroy(s,this.code,h),i.endActivation()}}friends(t){const e=p.crFriendNotMeActTarg("CARD",t.id,this.code,T.enTil(t.id,"P1"));return D.toActions(e)}enemies(t,e=""){const i=p.crEnemyActTarg("CARD",this.code,T.enTil(t.id,"P2",e));return i.level=D.ddf2(this.level+1),D.toActions(i)}}class $r extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Seismic Adept",this.iAttack=this.boof4712,this.iHealth=this.boof61218,this.tribe.push("HM"),this.text="Activate: Move an enemy creature to another available enemy lane.",this.bonus={activ8:this.rawNug(0,0,0,0,this.level*.5)}}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){const e=this.enemies(t);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param),i=f.jr5(e[1]);if(e[0]==="P1"){const s=f.ddf6(t),h=this.empties(i,s.id);h.push(S.cancelAction()),S.ddf5(h)}else{const s=f.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),i.endActivation()}}empties(t,e=""){const i=p.emptyPlayerActTarg("E","CARD",this.code,T.enTil("P2",t.id,e));return D.toActions(i)}enemies(t){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P1",t.id));return D.toActions(e)}}class Me extends M{constructor(t){super(t),this.rarity="R",this.iAttack=this.boof4612,this.iHealth=this.boof61016;const e=this.cardCode();if(e==="SSS"?this.steel():e==="LSS"?this.life():e==="FSS"?this.flame():e==="DSS"&&this.dark(),this.level>1){const i=m.levelGateText(this.level-1);this.text=`When you play a ${i} ${m.factionText(this.faction)} card, you may ${this.tuxt}.`}else this.hints=["LG"];this.tuxt=""}tuxt="";dark(){this.faction="N",this.name="Darkshaper Savant",this.tribe.push("ZB");const t=-this.boof135;this.tuxt=`give an enemy creature ${m.jr9(t,t)}`}life(){this.faction="U",this.name="Lifeshaper Savant",this.tribe.push("SE");const t=this.boof135;this.tuxt=`give another friendly creature ${m.jr9(t,t)}`}steel(){this.faction="A",this.name="Steelshaper Savant",this.tribe.push("HM"),this.tuxt=`give another friendly creature Armor ${this.boof124}`}flame(){this.faction="T",this.name="Flameshaper Savant",this.tribe.push("HM"),this.tuxt=`deal ${this.boof147} damage to target creature or player`}jr3(t,e){const i=super.jr3(t,e);if(this.level>1){const s=i.jr4("PC");s.interactive=!0,s.bonus=this.rawNug(0,0,0,0,this.level*.5)}return i}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;if(e.playerA===t.owner){const i=L.getCard(e.cardCode);if(i.level0}startActivation(t){const e=this.empties(t);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);f.birth(`${this.hc()}`,"P",t.playerA,t.lane),e.endActivation()}empties(t){const e=p.emptyPlayerActTarg("F","CARD",this.code,t.id);return D.toActions(e)}}class Or extends M{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Sparkstone Elemental",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("LT","EL"),this.text="Negate Defender from each creature."}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){if(e.status==="A"){const s=p.mod("ND",!0,e.id);f.qActiveCreats().forEach(h=>h.addModSafe(s))}else f.qActiveCreats().forEach(s=>s.removeModSafe(e.id))}}class Ur extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Spiritcleave",this.text=`Destroy a ${m.levelGateText(this.level+1,!0)}creature with the highest health among all creatures.${this.level===3?"~You gain health equal to that creature's health.":""}`}playTargets(){const t=super.playTargets();let e=-1;const i=f.qActiveCreats();i.forEach(u=>{u.health>e&&(e=u.health)});const s=i.filter(u=>u.health===e).map(u=>u.id),h=p.crActTarg("CARD",this.code,"");return h.level=D.ddf2(this.level+1),h.victims=T.enTil(...s),this.level<3&&(h.hint=["KL"]),t.push(h),t}handleAction(t){this.logSpell();const e=f.ddf6(t);W.destroy(e,this.code),this.level===3&&v.heal(v.getActiveB(),e.health),S.spellCast()}}class zr extends kt{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Spiritleash";const e=this.boof5814;this.text=`Destroy a friendly creature.~Give a creature ${m.jr9(e,e)}.`}playTargets(){const t=super.playTargets(),e=p.crFriendActTarg("CARD",this.code,"P1");return f.creatByTarget(e).length>0&&f.qActiveCreats().length>1&&t.push(e),t}handleAction(t){const e=T.deTil(t.param),i=f.ddf6(t);if(e[0]==="P1"){const s=p.crNotMeActTarg("CARD",i.id,this.code,T.enTil("P2",i.id));s.hint=["BF"];const h=D.toActions(s);h.push(S.cancelAction()),S.ddf5(h)}else{this.logSpell(i);const s=f.jr5(e[1]),h=this.boof5814;W.destroy(s,this.code),i.buff(h,h),S.spellCast()}}}class Zr extends M{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Spite Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.tribe.push("HY"),this.text=`When ${this.name} ${m.dbdtac()}, this gets ${m.jr9(this.level,this.level)}.~Allied Tempys: Activate: Deal ${this.level} damage to another creature. This gets ${m.jr9(this.level,this.level)}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),i}zapTargs(t){const e=p.crNotMeActTarg("CARD",t,this.code,t);return e.hint=["HR"],D.toActions([e,D.buttonTarget("CANC")])}canActivate(t){return this.zapTargs(t.id).length>1&&t.hasMod(t.id)}startActivation(t){S.ddf5(this.zapTargs(t.id))}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}handleAction(t){const e=f.ddf6(t),i=f.jr5(t.param);this.logAct(!0),e.hurtDirect(this.level,this.code),i.buff(this.level,this.level),i.endActivation()}jr8(t){const e=f.jr5(t.creatId);if(t.trigger.type==="FR"){if(E.allied("T")){e.addMod(p.mod("AL",!0,e.id)),e.changed=!0;const i=e.jr4("PT");i.bonus=this.buffNug(this.boof246,this.level)}}else t.trigger.type==="DM"&&e.buff(this.level,this.level);x.triggerDone()}}class Yr extends M{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Statis Warden",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.text="When you play a spell, give a friendly creature Defender until the end of the enemy player's next turn."}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.interactive=!0,s.bonus=this.rawNug(0,0,0,0,.5),i}handleAction(t){const e=f.ddf6(t);this.logAct(!1,e);const i=p.mod("DF",!0,t.param);i.expiry="EN",e.addMod(i),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;return e.playerA===t.owner&&L.getCard(e.cardCode).type==="S"}return!1}jr8(t){const e=p.crFriendNotMeActTarg("CARD",t.creatId,this.code,t.creatId);e.canDefender=!0;const i=D.toActions(e);i.length===0?x.triggerDone():(i.push(S.noneEndTrigger()),S.ddf5(i))}}class Kr extends M{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Steeleye Researcher",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.hints=["RD"],this.text=`Upgrade: You may ${m.daluac()}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("UP");return s.interactive=!0,i}handleAction(t){E.levelAndDiscardA(t),S.actionDone(!0)}jr8(t){const e=p.lvlHandActTarg(this.code,t.creatId),i=D.toActions(e);i.length>0?(i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}}class Xr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steeleye Seer",this.iAttack=0,this.iHealth=this.lValN([8,12,18]),this.iDefend=!0,this.tribe.push("HM"),this.hints=["OL"],this.level===3?this.text="Activate: Level up a card in your hand. You may use this ability twice each turn.":this.text="Activate: Level a card in your hand, then discard it if its level is higher than your Rank.",this.bonus={activ8:this.rawNug(0,0,0,0,this.lValN([.8,1.7,3]))}}jr3(t,e){const i=super.jr3(t,e);return this.level===3&&(i.jr4("TS"),this.addExtraActivate(i)),i}jr8(t){if(t.trigger.type==="TS"){const e=f.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}canActivate(t){return v.toPlayer(t.owner).hand.some(i=>L.getCard(i).canLevel())}startActivation(t){const e=p.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),i=v.toPlayer(e.owner);this.level===3||i.rank>parseInt(t.card.slice(3))?i.hand[t.position]=L.getCard(t.card).levelUpCard():E.levelAndDiscardA(t),e.endActivation()}}class qr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steelscale Dragon",this.iAttack=this.boof4812,this.iHealth=this.iAttack+2,this.tribe.push("RB","DG"),this.iMobile=this.level;const e=this.boof246;this.addSp("M",e),this.text=`While each other friendly creature has Defender, ${this.name} gets ${m.jr9(this.iAttack,0)}, Armor ${e}, and Breakthrough.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("DF",this.code);s.area="C";const h=i.addEffect("PS",this.code);return h.area="C",i}enforceEffect(t,e){const i=p.crNotMeTarg(e.id);if(i.player=v.toTarget(e.owner),f.creatByTarget(i).some(h=>!h.defender))e.removeModSafe(e.id);else{const h=p.mod("AT",this.iAttack,e.id),u=p.mod("AR",this.boof246,e.id),g=p.mod("BT",!0,e.id);e.addModSafe(h),e.addModSafe(u),e.addModSafe(g)}}}class jr extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Storm Bringer",this.iAttack=this.boof5814,this.iHealth=this.boof61018,this.tribe.push("WN","EL");const e=this.boof246;this.addSp("D",e),this.text=`At the start of each turn, ${this.name} moves to an available lane at random. Flank: Deal ${e} damage to the opposing creature.`}jr3(t,e){const i=this.boof246,s=super.jr3(t,e),h=s.jr4("TS");h.bonus=this.rawNug(0,0,i,0,.2);const u=s.jr4("FK");return u.bonus=this.buffNug(i,0),s}ddf8(t){return t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="TS"){const e=f.emptyLanes(t.owner);e.length>0&&f.jr5(t.creatId).move(e[T.randInt(0,e.length)]),x.triggerDone()}else if(t.trigger.type==="FK"){const i=O.toCreature(t.event).creature.opposed;i&&i.hurtDirect(this.boof246,this.code),x.triggerDone()}else super.jr8(t)}}class Jr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Sulgrim, Herald of Force",this.iAttack=15,this.iHealth=15,this.tribe.push("GL"),this.addSp("M",6),this.bonus={activ8:this.buffNug(6,0)},this.text="Activate: Deal damage equal to a friendly creature's Armor to an enemy creature.~Forge: Each friendly creature gets Armor 6."}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param),i=f.ddf6(t);if(e[1]==="P1"){const s=this.enemies(e[0],i.id);s.push(S.cancelAction()),S.ddf5(s)}else if(e[1]==="P2"){const s=f.jr5(e[0]),h=f.jr5(e[2]);this.logAct(!0,h),i.hurtDirect(h.armor,this.code),s.endActivation()}}jr8(t){f.ddf1().forEach(e=>e.addArmor(6)),x.triggerDone()}friends(t){const e=p.crFriendActTarg("CARD",this.code,T.enTil(t,"P1"));return e.hasArmor=!0,D.toActions(e)}enemies(t,e=""){const i=p.crEnemyActTarg("CARD",this.code,T.enTil(t,"P2",e));return D.toActions(i)}}class Qr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Synapsis Oracle",this.iAttack=this.boof358,this.iHealth=this.lValN([9,15,24]),this.tribe.push("HM"),this.hints=["OL"];let e;this.level===3?(this.text="Activate: Level up a card in your hand.",e=1):(this.text=`Activate: ${m.daluac(!0)}.`,e=.5),this.bonus={activ8:this.rawNug(0,0,0,0,e)}}canActivate(t){return v.toPlayer(t.owner).hand.some(i=>L.getCard(i).canLevel())}startActivation(t){const e=p.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),i=v.toPlayer(e.owner);this.level===3?i.hand[t.position]=L.getCard(t.card).levelUpCard():E.levelAndDiscardA(t),e.endActivation()}}class _r extends vt{jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){if(t.trigger.type==="FR"){const e=t.owner?E.deathsA.length:E.deathsB.length;if(e>0){const i=R.tick();for(let s=0;s0}}class es extends M{constructor(t){super(t),this.rarity="C",this.faction="U",this.name="Toorgmai Mender",this.tribe.push("PL"),this.iAttack=this.lValN([2,5,9]),this.iHealth=this.iAttack+3,this.text=`Forge: Give a creature or player ${m.jr9(0,this.iHealth)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){const e=p.crActTarg("CARD",this.code,"");e.hint=["BF"];const i=p.actionTarget("TP","CARD",this.code,"");i.hint=["BF"];const s=[e,i,D.buttonTarget("NOTR")],h=D.toActions(s);S.ddf5(h)}handleAction(t){if(t.zone==="P")v.heal(t.playerA,this.iHealth);else{const e=f.ddf6(t);this.logAct(!1,e),e.buff(0,this.iHealth)}S.actionDone(!0)}}class Ye extends M{lookup(t){return{["SSD"]:{c:()=>this.ssdC(),t:i=>this.ssdT(i)},["SOL"]:{c:()=>this.stagC(),t:i=>this.stagT(i)},["WTK"]:{c:()=>this.tinkC(),t:i=>this.tinkT(i)}}[t]}mPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("TE");return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="TE"&&this.validPlayer(t)}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=t.event;return this.mPlayer===1?e.playerA===t.owner:e.playerA!==t.owner}ssdC(){this.faction="T",this.rarity="L",this.name="Smolderscale Dragon",this.iAttack=this.lValN([0,3,15]),this.iHealth=this.lValN([6,13,30]),this.tribe.push("DG"),this.level===3?this.iMobile=2:(this.hints=["LG"],this.iDefend=!0),this.mPlayer=1;const t=this.boof135;this.trigB=this.buffNug(t*2,0),this.text=`At the end of your turn, deal ${t} damage to each enemy creature.`}ssdT(t){const e=f.qEnemyCreats();if(e.length>0){const i=R.tick(),s=this.boof135;e.forEach(h=>h.hurtDirect(s,this.code,i))}}stagC(){this.faction="U",this.rarity="C",this.name="Stag of Lys",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("ST"),this.mPlayer=1;const t=this.boof246;this.trigB=this.playerNug(t),this.text=`At the end of your turn, gain ${t} health.`}stagT(t){v.heal(t.owner,this.boof246)}tinkC(){this.faction="A",this.rarity="H",this.name="War Tinker",this.iAttack=this.level,this.iHealth=this.boof4812,this.tribe.push("GN"),this.mPlayer=-1,this.trigB=this.avgSpawnNug(),this.text=`At the end of the enemy player's turn, replace ${this.name} with a copy of a random Robot from your deck.`}tinkT(t){const e=p.target("DK");e.player=v.toTarget(t.owner),e.tribe="RB";const i=D.deckByTarget(e),s=i.length;if(s>0){const h=i[T.randInt(0,s)][0],u=f.jr5(t.creatId);f.birth(h,"R",u.owner,u.lane)}}}class Ot extends M{lookup(t){return{["DCS"]:{c:()=>this.delphC(),t:i=>this.delphT(i)},["GMP"]:{c:()=>this.gmpC(),t:i=>this.gmpT(i)},["LBL"]:{c:()=>this.lbcC(),t:i=>this.lbcT(i)},["SBF"]:{c:()=>this.sfangC(),t:i=>this.sfangT(i)},["SSE"]:{c:()=>this.sseC(),t:i=>this.sseT(i)},["SPD"]:{c:()=>this.spdC(),t:i=>this.spdT(i)},["SPM"]:{c:()=>this.spmC(),t:i=>this.spmT(i)},["TBA"]:{c:()=>this.tbaC(),t:i=>this.tbaT(i)},["VCG"]:{c:()=>this.vgC(),t:i=>this.vgT(i)},["WBG"]:{c:()=>this.woeC(),t:i=>this.woeT(i)},["ZSH"]:{c:()=>this.zyxC(),t:i=>this.zyxT(i)}}[t]}bothTurns=!1;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("TS");s.bonus=this.trigB;const h=Dt.extractCardCode(this.code);return(h==="ZSH"||h==="SBF")&&(i.extraBattles=1),i}ddf8(t){return t.trigger.type==="TS"?this.bothTurns?!0:t.event.playerA===t.owner:!1}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}delphC(){this.faction="A",this.rarity="L",this.name="Delpha, Chronosculptor",this.iAttack=this.boof7914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.level>1&&(this.hints=["OL"],this.trigB=this.buffNug(5,4),this.text=`At the start of your turn, level a ${this.level===2?"level 1 ":""}card in your hand at random.`)}delphT(t){if(this.level>1){const e=v.toPlayer(t.owner),i=e.hand.map((h,u)=>{const g=L.getCard(h);return{idx:u,lvl:g.level,nxt:g.canLevel()?g.levelUpCard():""}}).filter(h=>h.nxt&&(this.level===3||h.lvl===1)),s=i.length;if(s>0){const h=i[T.randInt(0,s)];e.hand[h.idx]=h.nxt}}}gmpC(){this.faction="A",this.rarity="L",this.name="Ghox, Metamind Paragon",this.iAttack=this.boof4814,this.iHealth=this.boof61218,this.tribe.push("MM"),this.hints=["OL"];const t=this.level===1?"":"s";this.trigB=this.rawNug(0,0,0,0,this.level*ht.dcWeight),this.text=`At the start of your turn, draw ${this.level} card${t}.`}gmpT(t){v.drawCard(t.owner,this.level)}lbcC(){this.faction="U",this.rarity="R",this.name="Lightbringer Cleric",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hints=["OL"],this.trigB=this.playerNug(this.boof3610),this.text=`At the start of your turn, you gain ${this.boof137} to ${this.boof5914-1} health.`}lbcT(t){v.heal(t.owner,T.randInt(this.boof137,this.boof5914))}sfangC(){this.faction="T",this.rarity="H",this.name="Saberfang",this.iAttack=this.boof246,this.iHealth=1,this.iAggro=!0,this.tribe.push("CT"),this.trigB=this.buffNug(this.iAttack,0),this.text=`${this.name} battles an additional time on your turn.`}sfangT(t){const e=f.jr5(t.creatId);e.extraBattles+=1}sseC(){this.faction="U",this.rarity="L",this.name="Scatterspore Eidolon",this.iAttack=8,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level<3&&(this.hints=["LB"]);const t=this.boof357,e=z.minionName(this.level);this.trigB=this.statSpawnNug(t,t),this.text=`At the start of your turn, Spawn a ${t}/${t} ${e}.`}sseT(t){const e=this.lValS(["SXD","SXP","SXT"])+this.level.toString();f.birth(e,"S",t.owner)}spdC(){this.faction="U",this.rarity="R",this.name="Shardplate Delver",this.iAttack=this.boof4612,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OL"];const t=this.boof246;this.trigB=this.buffNug(t,t),this.text=`At the start of your turn, ${this.name} gets ${m.jr9(t,t)}.`}spdT(t){const e=this.boof246;f.jr5(t.creatId).buff(e,e)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.iAttack=this.boof91421,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["OP"],this.trigB=this.rawNug(0,0,0,0,this.lValN([-1.5,-2.1,-3])),this.text="At the start of your turn, randomly discard down to two cards in your hand."}spmT(t){const e=v.toPlayer(t.owner);if(e.hand.length>2){let i=e.hand.slice(),s=[];for(;i.length>2;)s.push(i.splice(T.randInt(0,i.length),1)[0]);e.discard.push(...s),e.hand=i}}tbaC(){this.faction="U",this.rarity="L",this.name="Talisin, Bard of Abundance",this.iAttack=this.lValN([8,12,16]),this.iHealth=this.lValN([10,14,20]),this.tribe.push("SY"),this.bothTurns=this.lValB([!0,!0,!1]),this.hints=["OL"],this.level===3?this.trigB=this.multNug(this.avgSpawnNug(),.5):this.hints.push("LG","ZZ-3"),this.text=`At the start of ${this.bothTurns?"your":"each player's"} turn, ${this.bothTurns?"you":"that player"} may play an additional card.`}tbaT(t){E.regularPlays+=1}vgC(){this.faction="T",this.rarity="C",this.name="Volcanic Giant",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("ER","GT"),this.hints=["OL"],this.trigB=this.playerNug(this.boof3610),this.text=`At the start of your turn, deals ${this.boof137} to ${this.boof5914-1} damage to the enemy player.`}vgT(t){const e=T.randInt(this.boof137,this.boof5914);v.hurtDirect(!t.owner,e,this.code)}woeC(){this.faction="N",this.rarity="L",this.name="Woebringer",this.iAttack=this.lValN([7,10,18]),this.iHealth=this.boof5815,this.tribe.push("AB"),this.text=`At the start of your turn, destroy the ${this.level===3?"enemy ":""}creature with the lowest attack. If there is a tie, one is chosen at random.`}woeT(t){const e=p.crTarg();this.level===3&&(e.player=v.toTarget(!t.owner));const i=f.creatByTarget(e);let s=99999,h=[];i.forEach(g=>{g.attack===s?h.push(g):g.attack0){const g=h[T.randInt(0,u)];W.destroy(g,this.code)}}zyxC(){this.faction="T",this.rarity="L",this.name="Zyx, Storm Herald",this.iAttack=this.boof4712,this.iHealth=this.lValN([6,9,20]),this.iMobile=1,this.tribe.push("LT","AS"),this.text="Zyx battles an additional time on your turn.",this.trigB=this.buffNug(this.iAttack,0)}zyxT(t){const e=f.jr5(t.creatId);e.extraBattles+=1}}class is extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Tuskin Sporelord",this.iAttack=this.lValN([2,6,10]),this.iHealth=this.lValN([10,14,18]),this.tribe.push("TK"),this.text=`Activate: Put a copy of friendly ${m.levelGateText(this.level,!0)}Plant into an available lane.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.5)}}canActivate(t){return this.emptySloots(t.id).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=f.ddf6(t),s=this.emptySloots(e[1],i.code);s.push(S.cancelAction()),S.ddf5(s)}else{const i=f.jr5(e[1]),s=f.birth(e[2],"P",i.owner,t.lane);this.logAct(!0,s),i.endActivation()}}emptySloots(t,e=""){const i=p.emptyPlayerActTarg("F","CARD",this.code,T.enTil("P2",t,e));return D.toActions(i)}buddies(t){const e=p.crFriendActTarg("CARD",this.code,T.enTil("P1",t));return e.tribe="PL",e.level=D.ddf2(this.level),D.toActions(e)}}class hi extends kt{constructor(t){super(t),this.faction="A",t==="PRI"+"1"?(this.rarity="R",this.name="Perilous Insight",this.maxLevel=1,this.overload=!0):(this.rarity="C",this.name="Metasight",this.maxLevel=2,this.isFree=this.level===2),this.text="Discard and level up two cards."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(S.shiftPlayCard(t.position),t.param==="P1"){this.logSpell(),E.levelAndDiscardA(t);const e=this.targParty("P2"),i=D.toActions(e);i.length===0?S.spellCast():S.ddf5(i)}else E.levelAndDiscardA(t),S.spellCast()}targParty(t){const e=p.lvlHandActTarg(this.code,t);return e.deckPositionSkip=S.playPosition(),e}}class Re extends kt{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(i,s)=>this.confZ(i,s)},["CSG"]:{c:()=>this.cystgC(),z:(i,s)=>this.cystgZ(i,s)},["GRN"]:{c:()=>this.grenC(),z:(i,s)=>this.grenZ(i,s)},["TWG"]:{c:()=>this.twstrC(),z:(i,s)=>this.twstrZ(i,s)}}[t]}cardCast(t,e,i){this.lookup(t).z(e,i)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",f.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const e=T.deTil(t.param),i=f.ddf6(t);if(e[0]==="P1"){this.playTarg.notMe=i.id,this.playTarg.param=T.enTil("P2",i.id);const s=D.toActions([this.playTarg,D.buttonTarget("CANC")]);S.ddf5(s)}else{const s=f.jr5(e[1]);this.xl?this.logSpell(s,i):this.logSpell(),this.cardCast(this.cardCode(),s,i),S.spellCast()}}confC(){this.faction="T",this.rarity="C",this.name="Conflagrate",this.xl=!1,this.text=`Deal ${this.boof369} to two enemy creatures.`,this.playTarg.player="E"}confZ(t,e){const i=R.tick(),s=this.boof369;t.hurtDirect(s,this.code,i),e.hurtDirect(s,this.code,i)}cystgC(){this.faction="A",this.rarity="C",this.name="Cypien Steelgraft",this.text=`Two friendly creatures get Armor ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canArmor=!0}cystgZ(t,e){const i=this.boof246;t.addArmor(i),e.addArmor(i)}grenC(){this.faction="N",this.rarity="C",this.name="Ghastly Renewal",this.text=`Give two friendly creatures Regenerate ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canRegen=!0}grenZ(t,e){const i=this.boof246;t.addRegen(i),e.addRegen(i)}get tsboof(){return this.level+2}twstrC(){this.faction="U",this.rarity="C",this.name="Twinstrength";const t=this.tsboof;this.text=`Two friendly creatures get ${m.jr9(t,t)}.`,this.playTarg.player="F"}twstrZ(t,e){const i=this.tsboof;t.buff(i,i),e.buff(i,i)}}class rs extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Umbruk Icecrusher",this.iAttack=this.boof61014,this.iHealth=this.boof246,this.tribe.push("DN"),this.text=`When ${this.name} ${m.dbdtap()}, deal that much damage to that player.~Allied Uterra: This gets ${m.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.bonus=this.playerNug(this.boof357),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR"){if(E.allied("U")){const e=f.jr5(t.creatId);e.breakthrough=!0,e.buff(2,2)}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event;v.hurtDirect(e.target,e.dmg,this.code),x.triggerDone()}}}class ss extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Umbruk Lasher",this.iAttack=this.boof71014,this.iHealth=this.iAttack-1,this.iBT=!0,this.tribe.push("DN"),this.text=`Allied Tempys: When ${this.name} ${m.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}handleAction(t){f.ddf6(t).hurtDirect(parseInt(t.param),this.code),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=O.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===v.getActiveB()}return!1}jr8(t){if(t.trigger.type==="FR"){if(E.allied("T")){const e=f.jr5(t.creatId),i=e.jr4("DM");i.interactive=!0,i.bonus=this.buffNug(this.iAttack,0),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,i=D.toActions(p.crEnemyActTarg("CARD",this.code,e.dmg.toString()));i.length>0?(i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}}}class Ee extends M{lookup(t){return{["CBB"]:{c:()=>this.cindC(),f:i=>this.cindF(i)},["EBW"]:{c:()=>this.ebwC(),f:i=>this.ebwF(i)},["IBR"]:{c:()=>this.ibrfC(),f:i=>this.ibrfF(i)},["SBI"]:{c:()=>this.sbiC(),f:i=>this.sbiF(i)}}[t]}targAction(t,e){this.lookup(t).f(e)}enemy=!1;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text=`Forge: If you are rank ${this.level+1} or higher, `+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}handleAction(t){const e=f.ddf6(t);this.targAction(this.cardCode(),e),S.actionDone(!0)}jr8(t){if(f.jr5(t.creatId).rank>this.level){const i=p.crActTarg("CARD",this.code,t.creatId);this.enemy?i.player="E":i.hint=["BF"];const s=D.toActions(i);s.length>0?S.ddf5(s):x.triggerDone()}else x.triggerDone()}ebwC(){this.faction="N",this.rarity="C",this.name="Ebonbound Warlord",this.iAttack=this.boof3714,this.iHealth=this.iAttack+4,this.tribe.push("VP"),this.enemy=!0;const t=this.boof369n;this.ftext=`give an enemy creature ${m.jr9(t,t)}.`}ebwF(t){this.logAct(!1,t);const e=this.boof369n;t.buff(e,e)}sbiC(){this.faction="U",this.rarity="C",this.name="Shardbound Invoker",this.iAttack=this.boof4714,this.iHealth=this.iAttack+1,this.tribe.push("TK");const t=this.boof359;this.ftext=`give a creature ${m.jr9(t,t)}.`}sbiF(t){this.logAct(!1,t);const e=this.boof359;t.buff(e,e)}cindC(){this.faction="T",this.rarity="C",this.name="Cinderbound Barbarian",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("FR","AS");const t=this.boof6912;this.enemy=!0,this.ftext=`deal ${t} damage to an enemy creature.`}cindF(t){t.hurtDirect(this.boof6912,this.code)}ibrfC(){this.faction="A",this.rarity="C",this.name="Ironbound Reinforcements",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("GN");const t=this.boof5812;this.ftext=`give a creature ${m.jr9(t,0)}.`}ibrfF(t){this.logAct(!1,t),t.buff(this.boof5812,0)}}class as extends M{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Uranti Elementalist",this.iAttack=this.boof4712,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.text=`Forge: You may move another friendly creature to an available lane adjacent to ${this.name}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){const e=f.jr5(t.creatId);if(this.emptySloots(e).length>0){const i=p.crFriendNotMeActTarg("CARD",e.id,this.code,T.enTil("P1",e.id)),s=D.toActions(i);s.length>0?(s.push(S.noneEndTrigger()),S.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=f.ddf6(t),s=f.jr5(e[1]),h=this.emptySloots(s,i.id);h.push(S.cancelAction()),S.ddf5(h)}else{const i=f.jr5(e[1]);this.logAct(!1,i),i.move(t.lane),S.actionDone(!0)}}emptySloots(t,e=""){return S.emptyAdjacents(t,T.enTil("P2",e))}}class ns extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Uranti Heartseeker",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("YT"),this.addSp("D",this.iAttack),this.text=`Activate: Deal ${this.iAttack} damage to an enemy creature or player with exactly ${this.iAttack} health.`,this.bonus={activ8:this.buffNug(this.iAttack/2,0)}}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){const e=this.findVictims(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){if(t.zone==="F"){const i=f.ddf6(t);this.logAct(!0,i),i.hurtDirect(this.iAttack,this.code)}else{this.logAct(!0);const i=t;v.hurtDirect(i.playerA,this.iAttack,this.code)}f.jr5(t.param).endActivation()}findVictims(t){const e=this.iAttack,i=p.crEnemyTarg(),h=f.creatByTarget(i).filter(g=>g.health===e).map(g=>p.fieldSelectAction("CARD",g.lane,g.owner)),u=v.toPlayer("E");return u.health===e&&h.push(p.playerSelectAction("CARD",u.isPlayerA)),h.forEach(g=>{g.host=this.code,g.param=t}),h}}class os extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Vaerus, Herald of Fury",this.iAttack=15,this.iHealth=12,this.iMobile=2,this.tribe.push("DG"),this.hints=["OL"],this.text="Each friendly creature battles an additional time on each of your turns."}jr3(t,e){const i=super.jr3(t,e);i.jr4("EF");const s=i.jr4("TS");return s.bonus=this.buffNug(20,0),i}ddf8(t){if(t.event.code==="ENT"){const e=O.toCreature(t.event);return t.owner===e.creature.owner&&t.owner===v.getActiveB()}else if(t.event.code==="TRS")return t.event.playerA===t.owner;return!1}giveXtra(t,e){t.hasMod(e)||(t.extraBattles+=1,t.addMod(p.mod("TK",!0,e)))}jr8(t){if(t.event.code==="ENT"){const e=O.toCreature(t.event);e.creature.id===t.creatId?f.ddf1().forEach(i=>{this.giveXtra(i,t.creatId)}):vt.itBirthedFirst(e.creature.id,t.creatId)&&this.giveXtra(e.creature,t.creatId)}else t.event.code==="TRS"&&f.ddf1().forEach(e=>{e.extraBattles+=1,e.hasMod(t.creatId)||e.addMod(p.mod("TK",!0,t.creatId))});x.triggerDone()}}class V extends M{constructor(t){super(t),this.cardConstruct(this.cardCode())}cardConstruct(t){({["AEN"]:()=>this.anvenf(),["AGU"]:()=>this.avguard(),["BTH"]:()=>this.batthid(),["BBB"]:()=>this.bart(),["BLW"]:()=>this.blitwi(),["BWG"]:()=>this.brambleguard(),["CHY"]:()=>this.cavernhyd(),["CDC"]:()=>this.cindcol(),["CNM"]:()=>this.cindmy(),["CTG"]:()=>this.citg(),["CWK"]:()=>this.crag(),["DBP"]:()=>this.prowler(),["DMR"]:()=>this.raptor(),["DBR"]:()=>this.bearride(),["DTD"]:()=>this.dmaw(),["DSZ"]:()=>this.duskzomb(),["FWB"]:()=>this.fangbear(),["FWR"]:()=>this.ravager(),["FFG"]:()=>this.ffang(),["FMS"]:()=>this.firemane(),["FPR"]:()=>this.flop(),["FGA"]:()=>this.falpha(),["FGB"]:()=>this.fbeta(),["FGO"]:()=>this.fomega(),["FPM"]:()=>this.minot(),["FPS"]:()=>this.forgeplate(),["GGE"]:()=>this.geist(),["GGH"]:()=>this.ghast(),["GGS"]:()=>this.ggs(),["GCL"]:()=>this.glacial(),["IWC"]:()=>this.warcharger(),["LWY"]:()=>this.lwyrm(),["LHY"]:()=>this.lyshyd(),["KDC"]:()=>this.kadc(),["MRF"]:()=>this.marrow(),["MMI"]:()=>this.mmin(),["MMO"]:()=>this.mmop(),["NGW"]:()=>this.narg(),["NCW"]:()=>this.necrotic(),["NXC"]:()=>this.nexcore(),["NAM"]:()=>this.nyam(),["OBD"]:()=>this.battledroid(),["OSP"]:()=>this.oss(),["OSL"]:()=>this.ogsl(),["PRG"]:()=>this.perd(),["RHY"]:()=>this.ravh(),["RHC"]:()=>this.rime(),["RSP"]:()=>this.runprim(),["SCS"]:()=>this.scorp(),["SCD"]:()=>this.scout(),["SFT"]:()=>this.scrap(),["SBA"]:()=>this.sparkblade(),["SKB"]:()=>this.sparkbot(),["SBR"]:()=>this.sparkass(),["STM"]:()=>this.sparkman(),["SSN"]:()=>this.sfsent(),["SMN"]:()=>this.steam(),["SGI"]:()=>this.stonefist(),["SCL"]:()=>this.stormcall(),["SMA"]:()=>this.ancient(),["SML"]:()=>this.lurker(),["TGS"]:()=>this.tsprout(),["TGN"]:()=>this.tgnome(),["TWS"]:()=>this.tscout(),["TWT"]:()=>this.tund(),["URD"]:()=>this.unrelenting(),["VBK"]:()=>this.vblock(),["VTC"]:()=>this.vtech(),["WTW"]:()=>this.waterwalk(),["WPD"]:()=>this.windprime(),["XCR"]:()=>this.xithcrush(),["XHU"]:()=>this.hulk(),["YWC"]:()=>this.yetiwar(),["ZIN"]:()=>this.zombinf()})[t]()}sist(){this.rarity="R",this.level===1?this.hints=["LG"]:this.consistent=!0}ancient(){this.faction="U",this.rarity="C",this.name="Swampmoss Ancient",this.iAttack=this.lValN([7,12]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=[this.level===1?"ZZ-1":"ZZ-2"],this.maxLevel=2}anvenf(){this.faction="A",this.rarity="C",this.name="Anvillon Enforcer",this.iAttack=this.boof5711,this.iHealth=this.iAttack-1,this.iArmor=this.boof246,this.tribe.push("RB")}avguard(){this.faction="T",this.rarity="R",this.name="Avalanche Guardian",this.iAttack=this.boof5915,this.iHealth=this.lValN([8,15,23]),this.iMobile=1,this.iDefend=!0,this.tribe.push("IC","EL")}bart(){this.faction="U",this.rarity="H",this.name="Big Bad Bartok",this.iAttack=this.level+8,this.iHealth=this.iAttack,this.consistent=!0,this.level<3&&(this.hints=["LB"]),this.tribe.push("TG")}batthid(){this.faction="U",this.name="Batterhide",this.iAttack=this.boof3814,this.iHealth=this.iAttack+3,this.sist(),this.iBT=!0,this.tribe.push("DN")}battledroid(){this.faction="A",this.rarity="H",this.name="Oreian Battledroid",this.iAttack=this.lValN([5,7,17]),this.iHealth=1,this.iArmor=this.iAttack,this.tribe.push("RB")}bearride(){this.faction="U",this.rarity="C",this.name="Deepwood Bear Rider",this.iAttack=this.lValN([5,16,18]),this.iHealth=this.lValN([2,8,10]),this.tribe.push("LP"),this.level===2&&(this.hints=["LB"])}blitwi(){this.faction="N",this.name="Blight Witch",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.boof71117,this.sist(),this.iRegen=this.boof234,this.tribe.push("ZB")}brambleguard(){this.faction="U",this.rarity="C",this.name="Bramblewood Guardian",this.iAttack=this.boof2612,this.iHealth=this.lValN([9,14,24]),this.tribe.push("PL")}cavernhyd(){this.faction="U",this.rarity="C",this.name="Cavern Hydra",this.iAttack=this.boof4711,this.iHealth=this.boof71015,this.iRegen=this.boof135,this.tribe.push("HY")}cindcol(){this.faction="T",this.rarity="C",this.name="Cinder Colossus",this.iAttack=this.lValN([3,13,24]),this.iHealth=this.lValN([4,14,27]),this.iDefend=!0,this.level===1&&(this.hints=["LG"]),this.tribe.push("ER","EL")}cindmy(){this.faction="T",this.rarity="C",this.name="Cinder Mystic",this.iAttack=this.lValN([4,11,21]),this.iHealth=this.boof3714,this.tribe.push("FR","AS")}citg(){this.faction="A",this.rarity="C",this.name="Citadel Guard",this.iAttack=this.lValN([8,12,25]),this.iHealth=this.lValN([9,13,30]),this.iDefend=!0,this.hints=[this.level===3?"ZZ-5":"ZZ-1"],this.tribe.push("RB")}crag(){this.faction="T",this.rarity="C",this.name="Crag Walker",this.iAttack=this.lValN([7,12,18]),this.iHealth=this.boof246,this.iMobile=1,this.tribe.push("DN")}dmaw(){this.faction="N",this.rarity="L",this.name="Duskmaw, Twilight Drake",this.iAttack=this.boof61017,this.iHealth=this.boof5915,this.iMobile=1,this.tribe.push("ST","DG")}duskzomb(){this.faction="N",this.rarity="C",this.name="Duskspire Zombie",this.iAttack=this.lValN([2,5,16]),this.iHealth=this.lValN([5,8,19]),this.iRegen=4,this.tribe.push("ZB")}falpha(){this.faction="A",this.rarity="C",this.name="Forge Guardian Alpha",this.iAttack=this.lValN([4,8,20]),this.iHealth=this.lValN([8,14,26]),this.iDefend=!0,this.tribe.push("RB","GD")}fangbear(){this.faction="U",this.rarity="C",this.name="Fangwood Bear",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("BR")}fbeta(){this.faction="A",this.rarity="R",this.name="Forge Guardian Beta",this.iAttack=this.lValN([5,8,20]),this.iHealth=this.lValN([3,6,18]),this.iArmor=this.boof124,this.tribe.push("RB","GD"),this.level===3&&(this.hints=["ZZ-3"])}ffang(){this.faction="U",this.rarity="C",this.name="Featherfang",this.iAttack=this.boof61218,this.iHealth=this.boof4812,this.tribe.push("DN")}firemane(){this.faction="T",this.rarity="C",this.name="Firemane Steed",this.iAttack=this.lValN([3,6,16]),this.iHealth=this.lValN([6,9,19]),this.iMobile=2,this.tribe.push("FR","EL")}flop(){this.faction="T",this.rarity="C",this.name="Flowstone Primordial",this.iAttack=this.lValN([6,7,15]),this.iHealth=this.iAttack+1,this.tribe.push("FR","EL")}fomega(){this.faction="A",this.rarity="L",this.name="Forge Guardian Omega",this.iAttack=this.boof255080,this.iHealth=this.iAttack,this.iMobile=this.boof124,this.iArmor=this.iMobile*10,this.iBT=!0,this.iAggro=!0,this.consistent=!0,this.tribe.push("RB","GD")}forgeplate(){this.faction="A",this.rarity="C",this.name="Forgeplate Sentry",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iArmor=this.boof135,this.tribe.push("RB")}ggs(){this.faction="N",this.rarity="C",this.name="Grimgaunt Spectre",this.iAttack=this.lValN([3,11,14]),this.iHealth=this.iAttack,this.iMobile=1,this.level===1?this.hints=["LG"]:this.level===2&&(this.hints=["LB"]),this.tribe.push("GG")}geist(){this.faction="N",this.rarity="C",this.name="Grave Geist",this.iAttack=this.boof71118,this.iHealth=this.boof4711,this.tribe.push("ST")}ghast(){this.faction="N",this.rarity="C",this.name="Grave Ghast",this.iHealth=this.boof71013,this.iAttack=this.iHealth-2,this.iRegen=this.boof246,this.tribe.push("ZB")}glacial(){this.faction="T",this.rarity="C",this.name="Glacial Colossus",this.iAttack=this.boof61016,this.iHealth=this.lValN([8,13,19]),this.tribe.push("IC","EL"),this.iDefend=!0}hulk(){this.faction="N",this.rarity="C",this.name="Xithian Hulk",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("AB")}kadc(){this.faction="T",this.rarity="C",this.name="Kadras Colossus",this.iAttack=this.lValN([6,11,13]),this.iHealth=this.iAttack,this.tribe.push("GT"),this.level<3&&(this.hints=["LB"],this.level===1&&this.hints.push("ZZ+1"))}lurker(){this.faction="U",this.rarity="C",this.name="Swampmoss Lurker",this.iAttack=this.lValN([8,13,22]),this.iHealth=this.lValN([4,6,15]),this.tribe.push("DN"),this.level===3?this.hints=["ZZ-5"]:this.hints=["ZZ-1"]}lwyrm(){this.faction="T",this.rarity="C",this.name="Lightning Wyrm",this.iAttack=this.boof4711,this.iHealth=this.boof258,this.tribe.push("LT","EL"),this.iAggro=!0}lyshyd(){this.faction="U",this.rarity="C",this.name="Lysian Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.level,this.tribe.push("HY")}marrow(){this.faction="N",this.rarity="C",this.name="Marrow Fiend",this.iAttack=this.boof81117,this.iHealth=this.lValN([1,5,13]),this.tribe.push("SK")}minot(){this.faction="A",this.name="Forgeplate Minotaur",this.iAttack=this.lValN([2,8,16]),this.iHealth=this.lValN([4,9,17]),this.sist(),this.iArmor=this.level,this.tribe.push("RB")}mmin(){this.faction="A",this.rarity="C",this.name="Metamind Infiltrator",this.iAttack=this.boof5917,this.iHealth=this.iAttack-1,this.tribe.push("MM")}mmop(){this.faction="A",this.rarity="C",this.name="Metamind Operator",this.iAttack=this.boof4610,this.iHealth=this.lValN([10,14,18]),this.tribe.push("MM")}narg(){this.faction="T",this.rarity="C",this.name="Nargath Warrior",this.iAttack=this.boof51014,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS")}necrotic(){this.faction="N",this.rarity="C",this.name="Necrotic Wurm",this.iAttack=this.lValN([4,7,18]),this.iHealth=this.lValN([5,8,19]),this.tribe.push("WR")}nexcore(){this.faction="A",this.rarity="C",this.name="Nexus Core",this.iAttack=0,this.iHealth=this.lValN([15,25,40]),this.tribe.push("RB"),this.iDefend=!0}nyam(){this.faction="N",this.rarity="C",this.name="Nyrali Ambusher",this.iAttack=this.boof71117,this.iHealth=this.lValN([3,6,13]),this.tribe.push("OZ")}ogsl(){this.faction="U",this.rarity="C",this.name="Overgrown Spineleaf",this.iAttack=this.lValN([6,12,16]),this.iHealth=this.boof4812,this.tribe.push("PL")}oss(){this.faction="N",this.rarity="R",this.name="Ossuary Spirit",this.iAttack=this.lValN([1,3,6]),this.iHealth=this.boof91420,this.iRegen=this.iAttack+2,this.tribe.push("ST")}perd(){this.faction="N",this.rarity="C",this.name="Perdition Guard",this.iAttack=this.lValN([3,12,15]),this.iHealth=this.iAttack-1,this.tribe.push("NG"),this.level===1?this.hints=["LG"]:this.level===2&&(this.hints=["LB"])}prowler(){this.faction="U",this.rarity="C",this.name="Deepbranch Prowler",this.iAttack=this.lValN([8,9,10]),this.iHealth=this.iAttack,this.tribe.push("CT"),this.level<3&&(this.hints=["LB"]),this.iBT=!0}raptor(){this.faction="U",this.rarity="C",this.name="Deepmoss Raptor",this.iAttack=this.lValN([2,13,16]),this.iHealth=this.iAttack,this.level===1?this.hints=["LG","RT"]:this.level===2&&(this.hints=["LB"]),this.tribe.push("DN")}ravager(){this.faction="U",this.rarity="C",this.name="Fangwood Ravager",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("BE")}ravh(){this.faction="U",this.rarity="C",this.name="Ravenous Hydra",this.iAttack=this.boof5813,this.iHealth=this.iAttack+this.level,this.iRegen=this.level,this.iBT=!0,this.tribe.push("HY")}rime(){this.faction="T",this.rarity="C",this.name="Rimehorn Charger",this.iAttack=this.lValN([5,8,10]),this.iHealth=this.iAttack+3,this.iMobile=1,this.level<3&&(this.hints=["LB"]),this.tribe.push("RM")}runprim(){this.faction="T",this.name="Runestorm Primordial",this.iAttack=this.boof3714,this.iHealth=this.iAttack-1,this.sist(),this.iAggro=!0,this.tribe.push("LT","EL")}scorp(){this.faction="N",this.rarity="C",this.name="Scavenger Scorpion",this.iAttack=this.lValN([6,9,11]),this.iHealth=this.iAttack,this.iRegen=this.level,this.level<3&&(this.hints=["LB"]),this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.isFree=this.level>1,this.level<3&&(this.hints=[this.level===1?"LG":"LB"]),this.tribe.push("RB")}scrap(){this.faction="A",this.rarity="H",this.name="Scrapforge Titan",this.iAttack=this.lValN([1,5,20]),this.iHealth=this.iAttack,this.iArmor=this.lValN([1,5,10]),this.level===1&&(this.hints=["LG","LM","RT"]),this.tribe.push("RB")}sfsent(){this.faction="A",this.rarity="C",this.name="Spiritforge Sentinel",this.iAttack=this.lValN([3,6,9]),this.iHealth=this.iAttack*2,this.iArmor=this.lValN([1,2,6]),this.tribe.push("RB")}sparkbot(){this.faction="A",this.rarity="C",this.name="Spark Bot",this.iAttack=this.boof5914,this.iHealth=this.lValN([6,11,16]),this.tribe.push("RB")}sparkblade(){this.faction="A",this.rarity="C",this.name="Sparkblade Assassin",this.iAttack=this.lValN([4,12,14]),this.iHealth=this.lValN([5,13,15]),this.tribe.push("HM")}sparkass(){this.faction="T",this.rarity="C",this.name="Sparkbrand Asir",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.lValN([6,11,13]),this.iAggro=!0,this.tribe.push("LT","AS")}sparkman(){this.faction="T",this.rarity="R",this.name="Sparktail Manticore",this.iAttack=this.boof369,this.iHealth=this.boof71116,this.iAggro=!0,this.iMobile=1,this.tribe.push("MT")}steam(){this.faction="T",this.rarity="C",this.name="Steam Sentinel",this.iAttack=this.lValN([8,14,20]),this.iHealth=this.boof61016,this.iDefend=!0,this.tribe.push("WT","EL")}stonefist(){this.faction="T",this.rarity="C",this.name="Stonefist Giant",this.iAttack=this.lValN([3,7,16]),this.iHealth=this.lValN([6,10,24]),this.tribe.push("ER","EL")}stormcall(){this.faction="T",this.rarity="C",this.name="Storm Caller",this.iAttack=this.lValN([8,11,14]),this.iHealth=this.iAttack-2,this.tribe.push("WN","AS")}tgnome(){this.faction="A",this.rarity="C",this.name="Technognome",this.iAttack=this.lValN([3,9,19]),this.iHealth=this.iAttack,this.level===1&&(this.hints=["LG"]),this.tribe.push("GN")}tscout(){this.faction="A",this.rarity="C",this.name="Tower Scout",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("HM")}tund(){this.faction="A",this.rarity="C",this.name="Tundra Watcher",this.iAttack=this.lValN([5,10,12]),this.iHealth=this.lValN([8,11,13]),this.level<3&&(this.hints=["LB"]),this.tribe.push("RB")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.iAttack=this.boof7911,this.iHealth=this.iAttack+1,this.level<3&&(this.hints=["LB"]),this.tribe.push("PL")}unrelenting(){this.faction="N",this.rarity="H",this.name="Unrelenting Dead",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.iRegen=this.iAttack,this.tribe.push("ZB")}vblock(){this.faction="A",this.rarity="R",this.name="Vault Blockade",this.iAttack=0,this.iHealth=this.boof135,this.iArmor=this.boof101520,this.iDefend=!0,this.tribe.push("RB")}vtech(){this.faction="A",this.rarity="C",this.name="Vault Technician",this.iAttack=this.boof61218,this.iHealth=this.boof3915,this.tribe.push("HM")}warcharger(){this.faction="A",this.rarity="C",this.name="Ionic Warcharger",this.iAttack=this.boof4915,this.iHealth=this.lValN([7,12,18]),this.iMobile=1,this.tribe.push("RB")}waterwalk(){this.faction="T",this.rarity="C",this.name="Water Walker",this.iAttack=this.lValN([5,12,14]),this.iHealth=this.lValN([2,9,11]),this.tribe.push("WT","AS")}windprime(){this.faction="T",this.rarity="C",this.name="Wind Primordial",this.iHealth=this.boof4814,this.iAttack=this.iHealth+2,this.iMobile=this.level,this.tribe.push("WN","EL")}xithcrush(){this.faction="N",this.rarity="C",this.name="Xithian Crusher",this.iAttack=this.lValN([4,10,16]),this.iHealth=this.iAttack+2,this.tribe.push("AB")}yetiwar(){this.faction="T",this.rarity="C",this.name="Yeti Warcaller",this.iAttack=this.boof248,this.iHealth=this.lValN([10,15,23]),this.tribe.push("YT")}zombinf(){this.faction="N",this.rarity="C",this.name="Zombie Infantry",this.iAttack=this.boof61015,this.iHealth=this.iAttack-1,this.tribe.push("ZB")}}class hs extends kt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Varna's Pact";const e=this.lValS(["a","two","three"]),i=this.level===1?"":"s",s=this.level===1?"was":"were";this.text=`Put ${e} random creature${i} that ${s} destroyed this game into ${e} lane${i}.`}playTargets(){const t=super.playTargets();return t.push(this.fieldTarget("P1",[])),t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")if(this.level===1)this.endSpell([t.lane],t.playerA);else{const i=this.fieldTarget("P2",[t.lane]);S.ddf5(D.toActions(i))}else if(e[0]==="P2"){const i=[t.lane,parseInt(e[1])];if(this.level===2)this.endSpell(i,t.playerA);else{const s=this.fieldTarget("P3",i);S.ddf5(D.toActions(s))}}else this.endSpell([t.lane,parseInt(e[1]),parseInt(e[2])],t.playerA)}endSpell(t,e){this.logSpell();const i=R.tick();t.forEach(s=>{const h=W.gravedigger();h&&f.birth(h,"R",e,s,i)}),S.spellCast()}fieldTarget(t,e){const i=p.actionTarget("TF","CARD",this.code,T.enTil(t,...e));return i.player="F",i.hint=["FL"],i.lanes=f.laneIdx.filter(s=>!e.includes(s)),i}}class ls extends me{jr3(t,e){const i=super.jr3(t,e),s=i.jr4("LG",this.code),h=this.boof124*5;return s.bonus=this.buffNug(h,h),i}ddf8(t){const e=t.event;return t.trigger.type==="LG"&&t.owner===e.playerA}jr8(t){const e=t.event,i=this.boof124*e.healAmt;f.jr5(t.creatId).buff(i,i),x.triggerDone()}}class cs extends M{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Wildwood Sower",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,11,18]),this.tribe.push("HM");const e=L.getCard(z.minionCode(this.level));this.text=`When you play a spell, you may put a ${m.tokName(e)} into an available lane.`,this.spB=this.spawnNug(e)}spB;jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.interactive=!0,s.bonus=this.spB,i}handleAction(t){f.birth(z.minionCode(this.level),"P",t.playerA,t.lane),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;return e.playerA===t.owner&&L.getCard(e.cardCode).type==="S"}return!1}jr8(t){const e=p.emptyPlayerActTarg("F","CARD",this.code,""),i=D.toActions(e);i.length===0?x.triggerDone():(i.push(S.noneEndTrigger()),S.ddf5(i))}}class ds extends M{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Windcaller Shaman",this.iAttack=this.boof3713,this.iHealth=this.iAttack+4,this.tribe.push("WN","AS"),this.text=`Forge: You may move another friendly ${m.levelGateText(this.level,!0)}creature to an available lane adjacent to ${this.name}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){const e=f.jr5(t.creatId);if(this.emptySloots(e).length>0){const i=p.crFriendNotMeActTarg("CARD",e.id,this.code,T.enTil("P1",e.id));i.level=D.ddf2(this.level);const s=D.toActions(i);s.length>0?(s.push(S.noneEndTrigger()),S.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=f.ddf6(t),s=f.jr5(e[1]),h=this.emptySloots(s,i.id);h.push(S.cancelAction()),S.ddf5(h)}else{const i=f.jr5(e[1]);this.logAct(!1,i),i.move(t.lane),S.actionDone(!0)}}emptySloots(t,e=""){return S.emptyAdjacents(t,T.enTil("P2",e))}}class us extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Windspark Elemental",this.iAttack=this.boof258,this.iHealth=this.lValN([7,14,21]),this.tribe.push("LT","EL"),this.text=`When an enemy creature is delt non-battle damage, deal ${this.boof246} damage to the enemy player.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.playerNug(this.boof246),i}ddf8(t){if(t.trigger.type==="DM"){const e=O.toDamage(t.event);return!e.battle&&e.isCreatTarg&&e.hurtCreat.owner!==t.owner}return!1}jr8(t){v.hurtDirect(!t.owner,this.boof246,this.code),x.triggerDone()}}class fs extends M{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Xithian Rotfiend",this.iAttack=this.lValN([7,12,20]),this.iHealth=this.iAttack+1,this.tribe.push("AB");const e=-this.boof135;this.text=`When ${this.name} becomes opposed, it gets ${m.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("EF");const s=i.jr4("MV"),h=-this.boof135;return s.bonus=this.buffNug(h,h),i}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const e=O.toCreature(t.event);return t.trigger.creatId===e.creature.id&&t.trigger.type==="MV"||e.creature.owner!==t.owner}return!1}jr8(t){let e=!1;const i=f.jr5(t.creatId),s=O.toCreature(t.event);if((i.id===s.creature.id&&i.opposed||s.creature.lane===f.oppositeLane(i.lane))&&(e=!0),e){const h=-this.boof135;i.buff(h,h)}x.triggerDone()}}class gs extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Zarox, the Raging",this.iAttack=this.lValN([2,4,10]),this.iHealth=this.lValN([8,12,18]),this.tribe.push("FR","EL"),this.text=`When Zaxox ${m.dbdtap()} on your turn, you may deal that much damage to an enemy creature.~Allied Nekrium: When a creature is destroyed, Zarox gets ${m.jr9(this.boof124,0)}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.interactive=!0,s.bonus=this.buffNug(this.lValN([3,6,14]),0),i}handleAction(t){f.ddf6(t).hurtDirect(parseInt(t.param),this.code),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=O.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===v.getActiveB()}else if(t.trigger.type==="DS")return!0;return!1}jr8(t){if(t.trigger.type==="FR"){if(E.allied("N")){const e=f.jr5(t.creatId),i=e.jr4("DS");i.bonus=this.buffNug(this.boof124,0),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,i=D.toActions(p.crEnemyActTarg("CARD",this.code,e.dmg.toString()));i.length>0?(i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}else if(t.trigger.type==="DS"){const e=f.jr5(t.creatId);this.logAct(!1),e.buff(this.boof124,0),x.triggerDone()}}}class ms extends M{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Zombie Titan",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("ZB");const e=this.boof234;this.text=`While ${this.name} is in a side lane, it gets ${m.jr9(e,e,!0)} and Regenerate ${this.level}.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){if(e.lane===1||e.lane===5){const i=this.boof234;[p.mod("AT",i,e.id),p.mod("HL",i,e.id),p.mod("MH",i,e.id),p.mod("RG",this.level,e.id)].forEach(h=>{e.addModSafe(h)})}else e.removeModSafe(e.id)}}class ps{cardCache=new Map;mapper={["AAK"]:Pi,["ABB"]:Mi,["ABM"]:yt,["AGC"]:yt,["AGK"]:Z,["AGP"]:ft,["AGW"]:G,["ASG"]:G,["AMS"]:Z,["AFO"]:ce,["ATG"]:qt,["ART"]:qt,["ATP"]:He,["AGM"]:oe,["ALG"]:pe,["AHL"]:_i,["ALS"]:pe,["AAA"]:Ri,["ABE"]:ft,["ATZ"]:G,["AEC"]:Wt,["ARB"]:qt,["AEN"]:V,["APM"]:Ei,["AQE"]:G,["AGD"]:Ii,["AFS"]:ne,["AMD"]:Li,["ABR"]:Vt,["AFR"]:Z,["AMY"]:Vt,["ABL"]:G,["ATT"]:vt,["AGU"]:V,["AIV"]:Et,["BRS"]:ni,["BTB"]:ri,["BTH"]:V,["BTI"]:yt,["BTN"]:pe,["BBB"]:V,["BLH"]:qt,["BFT"]:G,["BSP"]:Et,["BWK"]:oe,["BLW"]:V,["BZS"]:Z,["BSR"]:yt,["BMY"]:Gi,["BSW"]:mt,["BWW"]:Ne,["BTM"]:G,["BOS"]:z,["BAW"]:yt,["BWG"]:V,["BTR"]:Z,["BWD"]:ye,["BSG"]:Vi,["BSS"]:Z,["BTS"]:ye,["BST"]:de,["BWT"]:$i,["BRF"]:oe,["BRH"]:vt,["BWH"]:Wi,["BRN"]:ae,["BZD"]:Z,["BFM"]:Z,["BSM"]:Oi,["CKB"]:yt,["CDT"]:oe,["CMF"]:Oe,["CTL"]:ft,["CCS"]:mt,["CHY"]:V,["CSR"]:ni,["CHV"]:Ui,["CRS"]:ce,["COD"]:ft,["CTI"]:Z,["CHA"]:yt,["CHH"]:Z,["CHR"]:be,["CBB"]:Ee,["CDC"]:V,["CFB"]:Vt,["CNM"]:V,["CSW"]:Z,["CTG"]:V,["CCT"]:Ue,["CFG"]:Re,["CGF"]:Tt,["CGL"]:mt,["CSU"]:G,["CCR"]:yt,["CSB"]:Tt,["CNT"]:G,["CWK"]:V,["CRC"]:Et,["CYC"]:qt,["COZ"]:z,["CYS"]:Tt,["CTW"]:G,["CTV"]:G,["CAG"]:G,["CBS"]:G,["CIN"]:me,["CSH"]:mt,["CSG"]:Re,["DFR"]:Z,["DHW"]:qt,["DSS"]:Me,["DCR"]:ft,["DSK"]:Tt,["DBA"]:Z,["DBP"]:V,["DMR"]:V,["DBR"]:V,["DCS"]:Ot,["DDF"]:G,["DGZ"]:ft,["DNK"]:Zi,["DBN"]:Z,["DDS"]:Yi,["DIS"]:Wt,["DSV"]:Ki,["DDD"]:Z,["DPB"]:Xi,["DZA"]:z,["DZD"]:be,["DRE"]:Wt,["DGW"]:ft,["DBT"]:G,["DFB"]:Rt,["DMW"]:ne,["DCH"]:Wt,["DTD"]:V,["DSZ"]:V,["DYB"]:G,["DBQ"]:qi,["DYS"]:ji,["DYL"]:Ji,["EBW"]:Ee,["ESK"]:Et,["EHW"]:Qi,["ETN"]:G,["EWE"]:Fe,["ENP"]:G,["ESU"]:Wt,["ENR"]:G,["EPD"]:ft,["EPH"]:tr,["EPS"]:Vt,["ESG"]:er,["ESC"]:ye,["ESP"]:ir,["EWT"]:Z,["EHN"]:ye,["EFA"]:G,["EFM"]:Vt,["EFP"]:rr,["EFE"]:sr,["EXD"]:G,["FWB"]:V,["FWR"]:V,["FFG"]:V,["FST"]:Tt,["FWK"]:Tt,["FIN"]:G,["FRR"]:ft,["FVA"]:G,["FWG"]:z,["FWC"]:Et,["FFU"]:mt,["FLH"]:Oe,["FMS"]:V,["FSM"]:ft,["FBC"]:Vt,["FBI"]:qt,["FFS"]:mt,["FLN"]:G,["FJT"]:G,["FRI"]:yt,["FSS"]:Me,["FLS"]:qt,["FSH"]:mt,["FFD"]:Tt,["FRV"]:yt,["FSP"]:vt,["FPR"]:V,["FFL"]:G,["FGA"]:V,["FGB"]:V,["FGD"]:vt,["FGG"]:ne,["FGO"]:V,["FOL"]:ce,["FPM"]:V,["FPS"]:V,["FFM"]:Fe,["FMD"]:ar,["FME"]:Et,["FSK"]:nr,["FWT"]:Z,["FZS"]:G,["FUN"]:z,["GOS"]:or,["GHS"]:ne,["GHB"]:Ue,["GHR"]:hr,["GRN"]:Re,["GTH"]:G,["GSC"]:oe,["GMP"]:Ot,["GTT"]:lr,["GCL"]:V,["GCR"]:G,["GLF"]:yt,["GRW"]:yt,["GSW"]:Z,["GVS"]:Tt,["GSS"]:Z,["GBG"]:Tt,["GGE"]:V,["GGH"]:V,["GRP"]:cr,["GGD"]:Rt,["GGR"]:Rt,["GGP"]:Rt,["GGS"]:V,["GRM"]:ft,["GHT"]:yt,["GMR"]:Tt,["HMF"]:vt,["HTR"]:Ne,["HAR"]:G,["HFA"]:Be,["HOD"]:vt,["HWM"]:me,["HOX"]:Wt,["HGS"]:dr,["HTP"]:ur,["IBF"]:ft,["ITO"]:Wt,["IME"]:Wt,["IVS"]:ft,["ICD"]:fr,["IWC"]:V,["IHA"]:oe,["IBR"]:Ee,["IMD"]:be,["IMA"]:Z,["IZL"]:gr,["IZR"]:mr,["IZK"]:qt,["IFL"]:ae,["IFR"]:G,["JPK"]:G,["KDC"]:V,["KAW"]:qt,["KOD"]:mt,["KBE"]:pr,["KIW"]:yr,["KTS"]:Pe,["KKK"]:Ne,["LOD"]:ft,["LFA"]:br,["LKP"]:Ar,["LGT"]:Z,["LLD"]:xe,["LLG"]:xe,["LLS"]:xe,["LLT"]:xe,["LBR"]:G,["LSK"]:ae,["LWY"]:V,["LBD"]:Z,["LSS"]:Me,["LBL"]:Ot,["LSP"]:me,["LCE"]:Wt,["LUC"]:Fe,["LMV"]:Z,["LHY"]:V,["LYR"]:ae,["LYS"]:G,["MMH"]:yt,["MHR"]:kr,["MRF"]:V,["MOE"]:Z,["MXW"]:yt,["MSP"]:Wt,["MMA"]:Z,["MMR"]:Z,["MMX"]:Tt,["MMI"]:V,["MMO"]:V,["MMV"]:Et,["MPH"]:G,["MSC"]:G,["MTS"]:hi,["MTT"]:vr,["MML"]:Tr,["MMW"]:Sr,["MDE"]:oi,["MBP"]:mt,["MND"]:mt,["NNS"]:G,["NGB"]:yt,["NGW"]:V,["NSL"]:G,["NCF"]:G,["NCM"]:be,["POZ"]:z,["NCS"]:mt,["NCW"]:V,["NCV"]:G,["NSW"]:Cr,["NDR"]:wr,["NEM"]:Wt,["NSH"]:ft,["NXA"]:Dr,["NXC"]:V,["NXG"]:mt,["NXO"]:ce,["NXP"]:ai,["NXT"]:pe,["NGT"]:Rt,["NGQ"]:xr,["NSD"]:z,["NCL"]:ft,["NFF"]:mt,["NAM"]:V,["NOZ"]:Tt,["NSY"]:Z,["ONN"]:Br,["OXA"]:Hr,["OXM"]:Z,["OXP"]:Nr,["OOZ"]:z,["OBB"]:Fr,["OEX"]:G,["OWH"]:Pr,["OBD"]:V,["OFM"]:Z,["OJC"]:vt,["OPK"]:Z,["OSV"]:de,["OSS"]:G,["OWW"]:ne,["OHV"]:mt,["ODC"]:Mr,["OSP"]:V,["OSL"]:V,["OWF"]:ft,["OXS"]:Rr,["PHM"]:Z,["PPM"]:mt,["PSM"]:Z,["PLW"]:ft,["PRG"]:V,["PRI"]:hi,["PHS"]:yt,["PTB"]:ft,["PSC"]:mt,["PSH"]:Et,["PTR"]:G,["PSG"]:G,["PMI"]:Z,["PMS"]:G,["POX"]:Tt,["PYG"]:Ue,["PYS"]:ft,["RBH"]:Er,["ROK"]:ft,["RPT"]:z,["RHY"]:V,["RTS"]:Vt,["RHU"]:de,["RSC"]:Pe,["RLW"]:vt,["RFL"]:Ir,["RHC"]:V,["ROG"]:G,["RWC"]:ye,["RFA"]:Be,["RWD"]:yt,["RSE"]:Lr,["RBG"]:Ze,["RGG"]:Et,["RSZ"]:Tt,["RSP"]:V,["RHW"]:vt,["SBF"]:Ot,["SAP"]:G,["SPL"]:z,["SVO"]:G,["SSE"]:Ot,["SXP"]:z,["SXD"]:z,["SXT"]:z,["STS"]:ft,["SCS"]:V,["SMD"]:Z,["SFS"]:Gr,["SHY"]:yt,["SCD"]:V,["SFT"]:V,["SOC"]:G,["SOA"]:G,["SOD"]:G,["SOK"]:ae,["SOT"]:G,["SDL"]:z,["SAD"]:$r,["SHG"]:G,["SBI"]:Ee,["SCC"]:Pe,["SPB"]:Vr,["SPD"]:Ot,["SPM"]:Ot,["STD"]:yt,["STB"]:ae,["SHS"]:oe,["SGF"]:mt,["SKG"]:ai,["SSD"]:Ye,["SDA"]:Wr,["SSR"]:Et,["SNB"]:G,["SNP"]:ft,["SRD"]:ft,["SSH"]:He,["SRM"]:mt,["SRH"]:Rt,["SDN"]:Z,["SHV"]:G,["SRP"]:G,["SGG"]:Z,["SBA"]:V,["SKB"]:V,["SBR"]:V,["SKS"]:de,["SEL"]:Or,["STM"]:V,["SBD"]:Z,["SCV"]:Ur,["SFM"]:Tt,["SSN"]:V,["SSM"]:Et,["SLH"]:zr,["SPN"]:z,["SSI"]:me,["SND"]:Pe,["SNT"]:Tt,["SRV"]:Ze,["STR"]:G,["SPU"]:z,["XYR"]:z,["SPH"]:Zr,["SSA"]:mt,["STO"]:G,["SDR"]:vt,["SOL"]:Ye,["SOV"]:G,["SHK"]:ae,["SWR"]:Yr,["SMN"]:V,["SER"]:Kr,["SES"]:Xr,["SFA"]:Be,["STG"]:qr,["SSS"]:Me,["SSK"]:Z,["SWG"]:de,["SWM"]:mt,["SIV"]:ft,["STN"]:G,["SGI"]:V,["SBG"]:jr,["SCL"]:V,["SGA"]:Be,["STP"]:G,["SSG"]:Et,["SVH"]:Vt,["SIN"]:G,["SYL"]:Z,["SEV"]:yt,["SMA"]:V,["SML"]:V,["SYO"]:Qr,["TST"]:ft,["TBA"]:Ot,["TGL"]:G,["TGS"]:V,["TPT"]:G,["TDW"]:vt,["TNL"]:_r,["TEX"]:ce,["TGN"]:V,["TSM"]:ce,["TUP"]:G,["TOT"]:G,["TAB"]:oi,["TGI"]:Z,["TDS"]:be,["TSP"]:ts,["TPG"]:He,["TMG"]:He,["TMM"]:es,["TRA"]:Z,["TRS"]:Z,["TRV"]:Z,["TRW"]:Z,["TBB"]:Oe,["TOB"]:G,["TWS"]:V,["TVG"]:ri,["TXB"]:G,["TXS"]:G,["TFK"]:z,["TFD"]:z,["TFF"]:z,["TCG"]:G,["TWT"]:V,["TRN"]:ft,["TGK"]:Ze,["TSL"]:is,["TTF"]:z,["TWG"]:Re,["UGM"]:Et,["UGL"]:Z,["UIC"]:rs,["ULR"]:ss,["URD"]:V,["UBL"]:G,["UCM"]:mt,["UEM"]:as,["UHS"]:ns,["UIM"]:mt,["UWL"]:Z,["UWS"]:Z,["UIW"]:Z,["URS"]:G,["UTM"]:Z,["UTR"]:vt,["URB"]:Vt,["UPM"]:ne,["VIK"]:Z,["VRP"]:hs,["VBK"]:V,["VTC"]:V,["VTW"]:de,["VGN"]:Tt,["VND"]:Z,["VNF"]:yt,["VNS"]:Z,["VSK"]:G,["VCH"]:ft,["VGR"]:G,["VGL"]:G,["VOB"]:G,["VCG"]:Ot,["VES"]:Vt,["VYE"]:G,["WBY"]:yt,["WBU"]:yt,["WMC"]:Z,["WMR"]:mt,["WMM"]:G,["WTK"]:Ye,["WTW"]:V,["WTA"]:ls,["WWP"]:Z,["WWR"]:mt,["WOD"]:ft,["WFM"]:ne,["WWS"]:cs,["WBH"]:Fe,["WCS"]:ds,["WPD"]:V,["WSE"]:us,["WFB"]:Z,["WFS"]:mt,["WBG"]:Ot,["XCR"]:V,["XDH"]:yt,["XHS"]:Tt,["XHU"]:V,["XRF"]:fs,["XSH"]:mt,["XTR"]:Z,["XDV"]:Ne,["XRW"]:G,["YWC"]:V,["YNS"]:Rt,["ZXR"]:gs,["ZPM"]:mt,["ZTR"]:z,["ZTU"]:Tt,["ZIN"]:V,["ZBS"]:z,["ZST"]:z,["ZMT"]:ms,["ZMB"]:z,["ZSH"]:Ot};makeCard(t){try{let e;if(t==="SOV3"?e=new os(t):t==="SOC3"?e=new Z(t):t==="LOD3"?e=new zi(t):t==="GOS3"?e=new Jr(t):e=new this.mapper[Dt.extractCardCode(t)](t),e.type==="C"){const i=e;i.spice=[{icon:"A",num:i.iAttack},{icon:"H",num:i.iHealth}].concat(i.spice??[])}return e}catch(e){throw console.error("Make card screwed up on code: "+t),e}}getCard(t){let e=this.cardCache.get(t);return e||(e=this.makeCard(t),this.cardCache.set(t,e)),e}}const L=new ps;class ys{registry;constructor(){this.registry=[]}find(t){const e=this.registry.find(i=>i.action===t);if(e)return e;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,e){const i=this.find(t);i.enabled=e}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const e=this.registry.findIndex(i=>i.action===t);e>-1&&this.registry.splice(e,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,e,i){if(R.ui.animating)return;let s,h;this.scaleFactor===1?(s=t,h=e):(s=Math.round(t*this.scaleFactor),h=Math.round(e*this.scaleFactor));let u,g=T.clickMode;return g==="M"?u=i:i===it.ForceRight?u=it.Right:g==="T"?u=it.Left:u=it.Right,Ve.arrayHit(this.registry,s,h,u)}updateScale(t){t===1?this.scaleFactor=1:this.scaleFactor=1/t}scaleFactor=1}const tt=new ys;class bs{memLoad=!0;step="O";vsAI=!0;p1=this.dud();p2=this.dud();initConstructed(){this.step="O",this.memLoad&&(this.memLoad=!1,this.p1.mode=T.readStringStorage("cMode"+"A","CP"),this.p2.mode=T.readStringStorage("cMode"+"B","CP"),this.p1.mode==="LK"&&(this.p1.mode="CP"),this.p2.mode==="LK"&&(this.p2.mode="CP"),this.vsAI=T.readBoolStorage("cAI",!0)),gt.drawAll()}handleMenuPick(t,e){if(t==="CI"||t==="CV")this.vsAI=t==="CI",T.writeBoolStorage("cAI",this.vsAI);else if(t==="CN")this.ezDeck(this.p1)?this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",S.ddf5(this.generateDeckPickerActions())):(this.step="A",S.ddf5(this.generateDeckPickerActions()));else{const i=e==="A"?this.p1:this.p2;t==="LK"?Jt.loadFromFile().then(s=>{typeof s=="string"?new Ge().iAmError(s):(i.deck=s,i.mode=t,T.writeStorage("cMode"+e,t),gt.drawAll())}):(i.mode=t,T.writeStorage("cMode"+e,t))}gt.drawAll()}ezDeck(t){return t.mode==="CP"?!1:(t.mode==="CR"?t.deck=Jt.randomStockDeck():t.mode==="CX"&&(t.deck=Jt.treatsAbound(!0)),!0)}handleDeckPick(t){const e=T.deTil(t.param),i=Jt.stockDeckByName(e[0],e[1]);this.step==="A"?(this.p1.deck=i,this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",S.ddf5(this.generateDeckPickerActions()))):(this.p2.deck=i,this.launchConstructed())}generateDeckPickerActions(t=-1){const e=ge.map((i,s)=>{const h=p.basicAction("DSET");return h.param=s.toString(),h});if(t>-1){const i=ge[t],s=i.decks.map(h=>{const u=p.basicAction("DECK");return u.param=T.enTil(i.id,h.name),u});return e.concat(s)}return e}launchConstructed(){R.aiMode=this.vsAI,bt.setMode("G"),R.newGame(this.p1.deck.cards,this.p2.deck.cards)}replay(){R.newGame(this.p1.deck.cards,this.p2.deck.cards)}dud(){return{mode:"CP",deck:{cards:[],name:"",factions:[]}}}}const Pt=new bs;class As{deathOrder=[];graveyard=[];reset(){this.graveyard=[],this.deathOrder=[]}purge(){this.deathOrder=[]}getState(){const t={dO:this.deathOrder,gY:this.graveyard};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.deathOrder=e.dO,this.graveyard=e.gY}deathCheck(){const t=R.tick();f.qActiveCreats().forEach(s=>{s.health<1&&(m.new().crd(s.code).txt(" died.").go(),this.smite(s,t))});const e=v.toPlayer(!0),i=v.toPlayer(!1);(e.health<1||i.health<1)&&(e.healthi.creatId===t.id)&&(this.deathOrder=this.deathOrder.filter(i=>i.creatId!==t.id))}findDeathTime(t){const e=this.deathOrder.filter(i=>i.creatId===t).map(i=>i.time);if(e.length!==0)return Math.min(...e)}destroy(t,e,i=void 0){t.status==="A"?(m.new().crd(t.code).txt(" was destroyed by ").crd(e).txt(".").go(),this.smite(t,i)):(console.warn(`Attempted to destroy creature that was not active. Targ creat ${t.code}; Killer creat ${e}`),console.trace())}gravedigger(t="X",e="LA"){if(t==="X"&&e==="LA"){const i=this.graveyard.length;return i===0?"":this.graveyard[T.randInt(0,i)].cardCode}else{const i=v.toBool(t);let s=this.graveyard.filter(u=>u.owner===i);e!=="LA"&&(s=s.filter(u=>D.levelTargetTest(e,parseInt(u.cardCode.slice(3)))));const h=s.length;return h===0?"":s[T.randInt(0,h)].cardCode}}smite(t,e=void 0){t.status="D",this.deathOrder.push({creatId:t.id,time:e||R.tick()}),this.graveyard.push({cardCode:t.code,owner:t.owner}),x.addEvents(O.creature("DIE",t)),re.positionChange(t.owner),t.owner?E.deathsA.push(t.code):E.deathsB.push(t.code)}}const W=new As;class ks{get youi(){return R.ui}initDeck(t,e){this.youi.deckContents=t,this.youi.deckScroll=0,this.youi.deckSummary=e,bt.setMode("T")}get canPageDown(){return this.youi.deckContents.length-this.youi.deckScroll>15}get canPageUp(){return this.youi.deckScroll>0}paginate(t){t?this.youi.deckScroll+=15:this.youi.deckScroll-=15}visibleContent(){const t=this.youi.deckScroll;return this.youi.deckContents.slice(t,t+15)}generateContent(t,e,i){const s=D.cardByTarget(t,i);if(s.sort((h,u)=>{const g=h[0],y=u[0];return y===g?0:g>y?1:-1}),e){const h=s.length;let u=0,g="",y=0;const C=[];for(;u0&&C.push({cardCode:g,sourceIdx:-1,cardCount:y}),g=s[u][0],y=1),u++;return h>0&&C.push({cardCode:g,sourceIdx:-1,cardCount:y}),C}else return s.map(h=>({cardCode:h[0],sourceIdx:h[1],cardCount:0}))}handleShowDeck(t){const e=v.getActive();this.showDeck(e,t.param==="VD")}handleDeckScroll(t){this.paginate(t.param==="D"),gt.drawAll()}showPlayerDeck(t){this.showDeck(t,!1)}showPlayerDiscard(t){this.showDeck(t,!1)}showCustomDeck(t,e){this.initDeck(t,!1);const i=this.rightClickers();S.ddf5(e.concat(i))}showDeck(t,e){const i=v.toPlayer(t);this.initDeck(this.generateContent(e?i.discard:i.deck,!0),!0);const s=S.cancelAction();s.key="CNCL",s.param="PM";const h=this.rightClickers();h.push(s),S.ddf5(h)}rightClickers(){return R.aiActive?[]:this.youi.deckContents.map((t,e)=>{const i=p.deckSelectAction("DEET",t.cardCode,e);return i.param=t.cardCode,i})}}const Ft=new ks;class vs{friends;friendText;get browseStack(){return R.ui.detailStack}n(t,e){return`${t}${e}`}friendo(t,e){const i=Array.isArray(e)?e:[e];[1,2,3].forEach(s=>{this.friends[this.n(t,s)]=i.map(h=>this.n(h,s))})}plont(t){this.friends[this.n(t,1)]=[this.n("SDL",1)],this.friends[this.n(t,2)]=[this.n("SPL",2)],this.friends[this.n(t,3)]=[this.n("TFK",3)]}constructor(){const t=this.n("FWC",1);this.friends={[this.n("CGL",1)]:[this.n("CGF",1)],[this.n("DTD",1)]:[this.n("TOT",1)],[t]:[this.n("FWG",1)],[this.n("MPH",1)]:[t],[this.n("MPH",2)]:[t],[this.n("MPH",3)]:[t],[this.n("NGQ",4)]:[this.n("NSD",4)],[this.n("RHU",1)]:[this.n("RSC",1)],[this.n("SSE",1)]:[this.n("SXD",1)],[this.n("SSE",2)]:[this.n("SXP",2)],[this.n("SSE",3)]:[this.n("SXT",3)],[this.n("TRA",2)]:[this.n("PTR",2)],[this.n("TRA",3)]:[this.n("PTR",3)],[this.n("TRS",2)]:[this.n("STO",2)],[this.n("TRS",3)]:[this.n("STO",3)],[this.n("TRV",2)]:[this.n("ITO",2)],[this.n("TRV",3)]:[this.n("ITO",3)],[this.n("TRW",2)]:[this.n("STR",2)],[this.n("TRW",3)]:[this.n("STR",3)],[this.n("TGK",1)]:[this.n("SXD",1)],[this.n("TGK",2)]:[this.n("SPL",2)],[this.n("TGK",3)]:[this.n("TTF",3)],[this.n("TSL",1)]:[this.n("FUN",1)],[this.n("ZTU",2)]:[this.n("ZTR",2)]},this.friendo("BLH","LWY"),this.friendo("BTM","BOS"),this.friendo("BWD","TFD"),this.plont("BTS"),this.friendo("BWT","DNK"),this.friendo("CSB","ZBS"),this.friendo("CYS","COZ"),this.friendo("DSK","SPN"),this.friendo("DDF","SXT"),this.friendo("DNK","BWT"),this.friendo("DZD","DZA"),this.friendo("DBQ","BRF"),this.friendo("EPH","EPS"),this.friendo("FST","ZST"),this.friendo("FWK","ZMB"),this.friendo("FGD",["FGA","FGB","FGG","FGO"]),this.friendo("FGG","FGO"),this.friendo("FMD","FME"),this.plont("GMR"),this.friendo("IZL",["IFL","IFR","IZR"]),this.friendo("IZR",["IFL","IFR","IZL"]),this.friendo("IZK",["IFL","IFR","IZL","IZR"]),this.friendo("NCM","POZ"),this.friendo("NSW","SPN"),this.friendo("NSH","NDR"),this.friendo("NGQ","NSD"),this.friendo("NFF","TFF"),this.friendo("NOZ","OOZ"),this.plont("PTB"),this.friendo("RWC","RPT"),this.plont("STS"),this.friendo("SDA","HTP"),this.friendo("SND","SPU"),this.friendo("SIV","KBE"),this.friendo("TNL","ZMB"),this.plont("WWS"),this.friendo("YNS","XYR");const e=42,i=31,s=40,h=51,u=38,g=52,y=66;this.friendText={["BOS"]:[h,""],["BWT"]:[68,"Bron"],["BRF"]:[18,""],["CGF"]:[65,"Fiend"],["COZ"]:[i,""],["DNK"]:[8,""],["DZA"]:[59,"Dozer"],["EPS"]:[49,"Soldier"],["FWG"]:[44,""],["FWC"]:[28,"Chrysalis"],["FGA"]:[65,"Alpha"],["FGB"]:[77,"Beta"],["FGG"]:[53,"Gamma"],["FGO"]:[57,"Omega"],["FME"]:[78,"Egg"],["FUN"]:[49,""],["HTP"]:[38,"Hunting"],["ITO"]:[e,"Torrent"],["IZL"]:[42,"Av Flame"],["IZR"]:[44,"Av Frost"],["IFL"]:[65,"Flame"],["IFR"]:[67,"Frost"],["KBE"]:[78,"Bee"],["LWY"]:[65,"Wyrm"],["POZ"]:[i,""],["NDR"]:[3,""],["NSD"]:[s,""],["OOZ"]:[i,""],["PTR"]:[e,"Torrent"],["RPT"]:[51,""],["RSC"]:[60,"Scout"],["SPL"]:[h,""],["SXP"]:[h,""],["SXD"]:[s,""],["SXT"]:[u,""],["SDL"]:[s,""],["SPN"]:[y,""],["STR"]:[e,"Torrent"],["SPU"]:[y,""],["XYR"]:[y,""],["STO"]:[e,"Torrent"],["TOT"]:[40,"Tendrils"],["TFK"]:[u,""],["TFD"]:[u,""],["TFF"]:[u,""],["TTF"]:[u,""],["ZTR"]:[32,"Returned"],["ZBS"]:[g,""],["ZST"]:[g,""],["ZMB"]:[g,""]}}get currentCard(){const t=this.browseStack;return t[t.length-1]}get friendos(){return this.friends[this.currentCard]??[]}get canGoBack(){return this.browseStack.length>1}init(t){if(!R.aiActive)if(R.ui.detailStack=[t],bt.mode!=="R"){bt.setMode("R");const e=p.basicAction("CNCL");e.zone=bt.baseMode==="G"?"B":"N",e.param="PM",S.ddf5([e])}else gt.drawAll()}changeLevel(t){const e=this.browseStack,i=e.length-1,s=e[i];e[i]=this.n(Dt.extractCardCode(s),t)}goBack(){this.browseStack.pop()}goToFriend(t){this.browseStack.push(t)}friendTxt(t){const e=this.friendText[t];return e||[3,"I am error"]}goBackAction(){const t=p.basicAction("DTUP");return t.param="DB",t}levelAction(t){const e=p.basicAction("DTUP");return e.param=T.enTil("DL",t),e}friendAction(t){const e=p.basicAction("DTUP");return e.param=T.enTil("DF",t),e}updateDetails(t){const e=T.deTil(t.param),i=e[0];i==="DB"?this.goBack():i==="DF"?this.goToFriend(e[1]):i==="DL"?this.changeLevel(parseInt(e[1])):console.error("Unknown detail arg",t)}}const jt=new vs,Ke=[1,2,3,4,5].map(n=>n.toString());class Ts{rarityCache={["L"]:[],["H"]:[],["R"]:[],["C"]:[],["T"]:[]};faction1="X";faction2="X";factionLock=!1;picks=[];picksAsDeck=[];currentPack=[];scrollIdx=0;memLoad=!0;step="O";stats;vsAI=!0;legDraft=!1;fatPacks=!1;overdraft=!1;rarityFilters;setFilters;pAdeck=[];pBdeck=[];get aiPicking(){return this.vsAI&&this.step==="B"}packOdds=[];constructor(){this.rarityFilters=new Map(le.map(t=>[t,!0])),this.setFilters=new Map(Ke.map(t=>[t,!0])),this.stats=new ei}getRarity(t){return this.rarityFilters.get(t)??!0}toggleRarity(t){const e=!this.rarityFilters.get(t);return this.rarityFilters.set(t,e),e}getSet(t){return this.setFilters.get(t.toString())??!0}toggleSet(t){const e=t.toString(),i=!this.setFilters.get(e);return this.setFilters.set(e,i),i}get canPageDown(){return this.picksAsDeck.length-this.scrollIdx>15}get canPageUp(){return this.scrollIdx>0}paginate(t){t?this.scrollIdx+=15:this.scrollIdx-=15}initDraft(){this.step="O",this.memLoad&&(this.memLoad=!1,this.vsAI=T.readBoolStorage("dAI",!0),this.legDraft=T.readBoolStorage("legDraft",!1),this.fatPacks=T.readBoolStorage("fatPacks",!1),this.overdraft=T.readBoolStorage("overD",!1),Ke.forEach(t=>{this.setFilters.set(t,T.readBoolStorage("dSet"+t,!0))}),le.forEach(t=>{this.rarityFilters.set(t,T.readBoolStorage("dRare"+t,!0))})),gt.drawAll()}setFArr(){let t=Ke.filter(e=>this.setFilters.get(e)).map(e=>parseInt(e));return t.length===5&&(t=[]),t}validRarities(){return le.filter(t=>this.rarityFilters.get(t))}startDraftPicks(){const t=this.setFArr();le.forEach(e=>{this.getRarity(e)?this.rarityCache[e]=Jt.getDeckCards([e],[],t):this.rarityCache[e]=[]}),le.every(e=>this.rarityCache[e].length===0)&&(this.rarityCache["C"]=this.fun()),this.packOdds=this.fatPacks?[9,31,40]:[5,25,40],this.faction1="X",this.faction2="X",this.factionLock=!1,this.picks=[],this.picksAsDeck=[],this.scrollIdx=0,this.stats=new ei,this.resumeDraft("")}resumeDraft(t){if(t){this.picks.push(t),this.picksAsDeck=this.picksToDeck();const s=this.overdraft?60:30;if(this.picks.length===s){this.step==="A"?(this.pAdeck=this.picksAsDeck.slice(),this.step="B",this.startDraftPicks()):(this.pBdeck=this.picksAsDeck.slice(),this.launchDraft());return}const h=L.getCard(t);if(this.aiPicking||this.stats.addStat(h.type,h.faction),!this.factionLock){const u=h.faction;if(this.faction1==="X")this.faction1=u;else if(u!==this.faction1){this.faction2=u,this.factionLock=!0;const g=this.setFArr();this.validRarities().forEach(y=>{this.rarityCache[y]=Jt.getDeckCards([y],[this.faction1,this.faction2],g)})}}}const e=this.generatePack().slice(-1*(6-this.picks.length%5)),i=this.fillPack(e);if(this.aiPicking)this.resumeDraft(i[i.length-1]);else{this.currentPack=i;const s=i.map((h,u)=>{const g=p.draftSelectAction("DRFT",u,!0);return g.param=h,g});S.ddf5(s)}}replay(){this.launchDraft()}picksToDeck(){const t=[];return this.picks.forEach(e=>{const i=t.findIndex(s=>s.card===e);i===-1?t.push({card:e,num:1}):t[i].num+=1}),t.sort((e,i)=>{const s=L.getCard(e.card+"1"),h=L.getCard(i.card+"1");return s.name.toLowerCase(){const s=this.rarityCache[i].length;let h=!0;for(;h;){const u=this.rarityCache[i][T.randInt(0,s)];e.includes(u)||(e.push(u),h=!1)}}),e}handleMenuPick(t,e){if(t==="DI"||t==="DV")this.vsAI=t==="DI",T.writeBoolStorage("dAI",this.vsAI);else if(t==="DN")this.step="A",this.startDraftPicks();else if(t==="DR"){const i=e;T.writeBoolStorage("dRare"+e,this.toggleRarity(i))}else t==="DT"?T.writeBoolStorage("dSet"+e,this.toggleSet(e)):t==="LD"?(this.legDraft=!this.legDraft,T.writeBoolStorage("legDraft",this.legDraft)):t==="GP"?(this.fatPacks=!this.fatPacks,T.writeBoolStorage("fatPacks",this.fatPacks)):t==="OD"&&(this.overdraft=!this.overdraft,T.writeBoolStorage("overD",this.overdraft));gt.drawAll()}launchDraft(){R.aiMode=this.vsAI,bt.setMode("G"),R.newGame(this.pAdeck,this.pBdeck)}fun(){return[["ART","SVO","MPH","VSK","MSP","LYS"],["CAG","ATG","WMM","ESU","BWH","CBS"],["DHW","NCF","ROG","EXD","TPT","HOX"],["FLS","STP","BRN","TCG","AQE","VOB"]][T.randInt(0,4)]}}const pt=new Ts;class Ss{async drawAll(){if(at.simOn)return;const t=bt.mode;tt.removeAll(),this.clearDetails(),t==="G"?(this.clearDeck(),await Promise.all([this.drawHand(v.getLocal()),this.drawPlayers(),this.drawField(),this.drawActions(S.activeActions)]),R.winFlag!==0?await this.drawGameOver():await this.drawCommonButtons(!0,!0,!0)):t==="R"?await this.drawDetails(S.activeActions):t==="T"?R.aiActive||await this.drawDeck(S.activeActions):t==="D"?await this.drawDraft(S.activeActions):t==="C"?await this.drawConstructed():t==="I"?await this.drawInfoMenu():t==="X"?await this.drawExit(S.activeActions):t==="S"?await this.drawSwap():await this.drawMenu()}async drawGameOver(){await new Ae().drawGameOver()}async drawHand(t){await new fi().drawCards(t)}async drawField(){await new Je().drawCards()}async drawPlayers(){await new Ae().drawAllPlayers()}async drawDeck(t){const e=t.find(u=>u.zone==="B"),i=[];e&&i.push(e),await new Ie().drawActions(i);const h=new Vs;await h.drawCards(),await h.drawActions(t),await this.drawCommonButtons(!0,!0,!1)}async drawActions(t){if(at.simOn)return;const e=new Ie;if(R.aiActive)await e.drawActions([]);else{et.get("effects").clear();const s=new fi,h=new Je,u=new Ae;await Promise.all([s.drawActions(t),h.drawActions(t),e.drawActions(t),u.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;R.ui.animating=!0,et.get("effects").clear(),await new Je().drawFight(t),R.ui.animating=!1}async drawDraft(t){et.get("effects").clear();const i=new Os,s=et.get("game-ui");s.clear(),tt.removeAll(),pt.step==="O"?await i.drawDraftMenu(s):(await new ke().drawPickerPlayer(s,pt.step==="A",!1),await i.drawPack(t,s),await i.drawList(t,s),await i.drawStats(s),await this.drawCommonButtons(!0,!0,!1))}async drawMenu(){const t=new Us,e=et.get("game-ui");e.clear(),tt.removeAll(),await t.drawMenu(e)}async drawInfoMenu(){const t=new ke,e=et.get("game-ui");e.clear(),tt.removeAll(),await t.drawExtrasMenu(e)}async drawConstructed(){if(Pt.step==="O"){const t=new Ge,e=et.get("game-ui");e.clear(),tt.removeAll(),await t.drawConstrMenu(e)}else await this.drawDeckPick(S.activeActions)}async drawDeckPick(t){const e=new Ge,i=new ke,s=et.get("game-ui");s.clear(),tt.removeAll(),await i.drawPickerPlayer(s,Pt.step==="A",Pt.vsAI),await e.drawSets(t,s),await e.drawList(t,s)}clearDetails(){et.get("card").clear()}clearDeck(){et.get("decklist").clear()}async drawDetails(t){await this.drawActions(t),await this.drawCommonButtons(!0,!0,!1),et.get("card").clear();const i=new Ws,s=t.find(h=>h.key==="CNCL");s?await i.drawDetails(s):console.error("Attempted to show details view with no cancel action")}async drawCommonButtons(t,e,i){let s=979;const h=723,u=new je,g=et.get("game-ui");if(i&&g.clear(),t&&(await u.makeIconButton(g,s,h,"EX"),s-=50),e){const y=T.clickMode;y!=="M"&&await u.makeIconButton(g,s,h,y==="I"?"TM":"DM")}}async drawExit(t){et.get("decklist").clear();const i=et.get("effects"),s=new fe;await s.drawButton(i,151,488,t[1],"Quit Game",24,!1),await s.drawButton(i,478,488,t[0],"Resume",52,!1)}async drawSwap(){const t=et.get("decklist");t.clear(),t.context.fillStyle="#000000",t.context.fillRect(0,0,T.gameWidth,T.gameHeight);const e=new Ae,i=v.getActive(),s="#AAF0C1",h=p.basicAction("USWP");h.param="PM",await e.drawPlayer(i,t,200,300);const u={fontSize:22,colour:s};await e.drawText(t,"Player "+(i.isPlayerA?"1":"2"),480,360,u),await e.drawText(t,"Click to start turn",480,420,u);const g=new dt(h,0,0,T.gameWidth,T.gameHeight,it.Both);tt.add(g)}setBackground(t){const e="hide";this.allBackgrounds.forEach(i=>{const s=document.getElementById(i);s&&(t===i?s.classList.remove(e):s.classList.add(e))})}playmatSetup(){let t=!1;const e=T.options.playmat,i=document.getElementById("playmat");if(i?i.dataset.pic!==e&&(t=!0,i.remove()):t=!0,t){const s=new Image(T.gameWidth,T.gameHeight);s.id="playmat",s.classList.add("hide",this.scaleCSS(T.options.scale)),s.dataset.pic=e,s.src=T.imgRoot+`background/playfield-${e}.jpg`,document.getElementById("mainmenu").before(s)}}scaleCSS(t){return`uiSize${t}`}changeScale(t){this.clearAll();let e=T.options.scale;e===t&&(e="100");const i=t==="100"?1:.90625;tt.updateScale(i);const s=this.scaleCSS(e),h=this.scaleCSS(t);this.allCanvases.forEach(y=>{et.get(y).dom.classList.replace(s,h)}),this.allBackgrounds.forEach(y=>{const C=document.getElementById(y);C&&C.classList.replace(s,h)}),document.getElementById("solforge").classList.replace(`gameSize${e}`,`gameSize${t}`),document.getElementById("log").classList.replace(`logSize${e}`,`logSize${t}`),T.options.scale=t,T.writeStorage("scale",t)}clearAll(){this.allCanvases.forEach(t=>{et.get(t).clear()})}allCanvases=["game-ui","field","player","hand","effects","decklist","card"];allBackgrounds=["playmat","blueface","mainmenu"]}const gt=new Ss;class Cs{positionChange(t){f.creatByTarget().forEach(e=>{e.enforceEffects("PS",t)})}defenderChange(t){f.qActiveCreats().forEach(i=>{i.effects.filter(s=>s.watch==="DF").filter(s=>s.area==="C"&&i.owner===t||s.area==="A").forEach(s=>L.getCard(s.logicCode).enforceEffect(s,i))})}playerHealthChange(){f.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){f.qActiveCreats().forEach(e=>{e.enforceEffects("AT"),e.enforceEffects("AR"),e.enforceEffects("CH"),e.enforceEffects("DF",e.owner)})}}const re=new Cs;class ws{getC(t){return f.jr5(t)}creature(t,e){return{code:t,creatId:e.id}}creatHeal(t,e){return{code:"CHL",creatId:t.id,healAmt:e}}damage(t,e,i,s,h,u){let g;return h instanceof Ce?g=h.id:g=h,{code:"DMG",battle:t,dmg:e,isCreatSrc:i,isCreatTarg:s,target:g,srcId:u?.id}}enterField(t){return{code:"ENT",creatId:t.id,forged:!1}}playCard(t,e){return{code:"PLC",playerA:e,cardCode:t}}player(t,e){return{code:t,playerA:e}}playerHeal(t,e){return{code:"PHL",playerA:t,healAmt:e}}replaced(t,e){return{code:"RPL",creatId:t.id,replCreatId:e.id}}toCreature(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId)}}toDamage(t){const e=t;let i,s,h;return e.isCreatTarg?h=this.getC(e.target):s=v.toPlayer(e.target),e.isCreatSrc&&(i=this.getC(e.srcId)),{code:e.code,battle:e.battle,dmg:e.dmg,isCreatSrc:e.isCreatSrc,srcId:e.srcId,target:e.target,isCreatTarg:e.isCreatTarg,srcCreat:i,hurtCreat:h,hurtPlayer:s}}toEnterField(t){const e=t;return{code:e.code,creatId:e.creatId,forged:e.forged,creature:this.getC(e.creatId)}}toReplaced(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId),replCreatId:e.replCreatId,replCreat:this.getC(e.replCreatId)}}}const O=new ws;class Ds{field=[];birthOrder=[];laneIdx=[1,2,3,4,5];reset(){this.field=[],this.birthOrder=[]}purge(){this.field=this.field.filter(t=>t.status==="A"),this.birthOrder=[]}getState(){const t={field:this.field.map(e=>e.getState()),bO:this.birthOrder};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.field=e.field.map(i=>new Ce(i)),this.birthOrder=e.bO}jr5(t){const e=this.searchById(t);if(e)return e;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByLane(t,e){const i=this.searchByLane(t,e);if(i)return i;throw console.error("naughty creature lane ",t,e),new Error("Could not find creature by lane")}ddf6(t){const e=this.searchByFSA(t);if(e)return e;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return this.field.find(e=>e.id===t)}searchByLane(t,e){return this.field.find(i=>i.lane===t&&i.owner===e&&i.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let e=this.field;if(t){if(t.player!=="X"){const i=v.toBool(t.player);e=e.filter(s=>s.owner===i)}if(t.creatStatus!=="A"){const i=this.creatStatusTargetToCS(t.creatStatus);e=e.filter(s=>s.status===i)}if(!T.isUn(t.lanes)){const i=D.lanesToArr(t.lanes);e=e.filter(s=>i.includes(s.lane))}if(T.isUn(t.maxAttack)||(e=e.filter(i=>i.attack<=t.maxAttack)),t.notMe&&(e=e.filter(i=>i.id!==t.notMe)),t.victims){const i=T.deTil(t.victims);e=e.filter(s=>i.includes(s.id))}if(t.tribe!=="AN"&&(e=e.filter(i=>i.isTribe(t.tribe))),t.canLevel&&(e=e.filter(i=>L.getCard(i.code).canLevel())),t.level!=="LA"){const i=D.levelTargetToLevel(t.level);e=e.filter(s=>i.includes(s.level))}t.cardCode&&(e=e.filter(i=>L.getCard(i.code).cardCode()===t.cardCode)),t.canDefender&&(e=e.filter(i=>!i.negateDefender)),t.hasDefender&&(e=e.filter(i=>i.defender)),t.canArmor&&(e=e.filter(i=>!i.negateArmor)),t.hasArmor&&(e=e.filter(i=>i.armor>0)),t.canMove&&(e=e.filter(i=>!i.negateMobility)),t.hasMobility&&(e=e.filter(i=>i.mobility>0)),t.hasPoison&&(e=e.filter(i=>i.poison>0)),t.canRegen&&(e=e.filter(i=>!i.negateRegen)),t.hasRegen&&(e=e.filter(i=>i.regen>0)),t.faction!=="X"&&(e=e.filter(i=>i.faction===t.faction))}return e}cst2cs={["A"]:()=>{throw new Error("goof passed any to field state target mapper")},["V"]:()=>"A",["D"]:()=>"D",["R"]:()=>"R"};creatStatusTargetToCS(t){return this.cst2cs[t]()}emptyLanes(t){return this.laneIdx.filter(e=>!this.field.find(s=>s.owner===t&&s.lane===e&&s.status==="A"))}oppositeLane(t){return 6-t}adjacentPositions(t){return[[2],[1,3],[2,4],[3,5],[4]][t-1]}canMove(t){return t.mobility>0&&t.mobilityAvailable&&(!t.sleeping||t.aggressive)?this.emptyLanes(t.owner).filter(e=>Math.abs(t.lane-e)<=t.mobility):[]}birth(t,e,i,s=0,h=void 0){if(e==="S"){const C=this.emptyLanes(i);if(C.length===0)return;s=C[T.randInt(0,C.length)]}else if(e==="P"&&!this.emptyLanes(i).includes(s))return;const g=(typeof t=="string"?L.getCard(t):t).jr3(i,s);if(i===v.getActiveB()&&E.birthRegistrar(g.id),e==="F"||e==="R"){const C=f.searchByLane(s,i);if(C){const B=m.new().crd(C.code).txt(" was replaced");e==="R"?B.txt(" with ").crd(g.code).txt(".").go():B.txt(".").go(),C.status="R",x.addEvents(O.replaced(g,C))}}this.field.push(g);const y=O.enterField(g);return y.forged=e==="F",this.birthOrder.push({creatId:g.id,time:h||R.tick()}),x.addEvents(y),g.enforceEffects("PH"),re.positionChange(i),g}findBirthTime(t){const e=this.birthOrder.filter(i=>i.creatId===t).map(i=>i.time);if(e.length!==0)return e.length>1&&console.warn("wery curious, more than one birth record for creat "+t),e[0]}qActiveCreats(){return this.creatByTarget(p.crTarg())}qPlayerCreats(t){const e=p.crTarg();return e.player=v.toTarget(t),this.creatByTarget(e)}ddf1(){return this.creatByTarget(p.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(p.crEnemyTarg())}}const f=new Ds;class xs{creatFightState(t,e){return t?e===1||t.defender||t.sleeping&&!t.aggressive?1:e===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t,e,i,s){if(t>0){let h=0;if(e>0){const u=t===2&&i.breakthrough;h=s.hurtBattle(i.attack,i,u)}else t===2&&(h=i.attack);h>0&&v.hurtBattle(!i.owner,h,i)}}fight(t){const e=!at.simOn;e&&m.add("FIGHT!");let i=2,s=1;t&&(E.mainBattle=!1,i=0,s=0);const h=v.getActiveB(),u=[],g=[];f.laneIdx.forEach(C=>{const B=f.searchByLane(C,h),$=f.searchByLane(6-C,!h),Y=this.creatFightState(B,i),J=this.creatFightState($,s);(Y===2||J===2)&&(g.push([Y,J,B,$],[J,Y,$,B]),Y===2&&(E.ffs++,u.push([C,h])),J===2&&u.push([f.oppositeLane(C),!h]))}),this.barking&&u.length>0&&e&&T.dogBark();let y;e?y=gt.drawCombat(u):y=Promise.resolve(),y.then(()=>{g.forEach(C=>this.dukeItOut(...C)),re.playerHealthChange(),W.deathCheck(),x.type="C0",S.actionDone()})}barking=!0}const li=new xs;class Bs{aiMode=!1;aiActive=!1;winFlag=0;ui=this.freshUI();idnum=0;clock=0;genId(){return this.idnum++,"@"+this.idnum.toString(36)}tick(){return this.clock++,this.clock}getState(){return{i:this.idnum,t:this.clock}}setState(t,e){this.idnum=t,this.clock=e}newGame(t,e){this.idnum=0,this.clock=0,li.barking=T.options.bark,v.activePlayer=T.randInt(0,2)===0,this.aiActive=!v.activePlayer&&this.aiMode,v.isLocalA=this.aiMode||v.activePlayer,S.actionHistory=[],at.turnSims=0,at.turnTime=0,f.reset(),W.reset(),this.ui=this.freshUI(),E.firstTurn=!0,this.winFlag=0;const i=v.nameOSaurus();v.initPlayer(!0,t,"Forgy McGhee",25),v.initPlayer(!1,e,i[0],i[1]),m.setup(),m.add("Ready...FIGHT!"),E.startTurn()}freshUI(){return{handScrollLeft:0,detailStack:[],deckContents:[],deckScroll:0,deckSummary:!1,animating:!1}}}const R=new Bs;class Hs{loglist;you=!0;localPlayerKey="";oppPlayerKey="";localPlayerSpan="";oppPlayerSpan="";constructor(){this.loglist=document.getElementById("loglist")}setup(){this.you=v.getLocalB(),this.localPlayerKey=this.you?"^pa":"^pb",this.oppPlayerKey=this.you?"^pb":"^pa",this.localPlayerSpan=this.span(v.toPlayer(this.you).name,"green"),this.oppPlayerSpan=this.span(v.toPlayer(!this.you).name,"red")}addLi(t){const e=document.createElement("li");e.innerHTML=t,this.loglist.appendChild(e),e.scrollIntoView({behavior:"smooth",block:"end"})}span(t,e,i=""){const s=i.length>0?` onclick="sfapi.details('${i}')"`:"";return`${t}`}add(t){this.addLi(t)}debug(t,e=!0){(e||T.options.debug)&&this.addLi(this.span(t,"debug"))}clearAll(){this.loglist.innerHTML=""}new(){return new Si}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let e=!0;for(;e;){const i=t.indexOf("^c");if(i===-1)e=!1;else{const s=t.slice(i+2,i+6);if(s==="POIS")t=t.replaceAll("^c"+s,this.span("Poison","green"));else{const h=L.getCard(s);t=t.replaceAll("^c"+s,this.span(`${h.name} ${h.level}`,this.factMap[h.faction],s))}}}return t}parse(t){const i=t.guts.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),s=this.parseCards(i);this.add(s)}cardText(t){let e;if(t.type==="C"){const i=t,s=[];i.iRegen>0&&s.push("Regenerate "+i.iRegen),i.iArmor>0&&s.push("Armor "+i.iArmor),i.iMobile>0&&s.push("Mobility "+i.iMobile),i.iBT&&s.push("Breakthrough"),i.iDefend&&s.push("Defender"),i.iAggro&&s.push("Aggressive"),i.consistent&&s.push("Consistent"),s.length>0&&s.push(""),e=s.join(". ")+t.text}else e=t.text;return(t.isFree?"Free. ":"")+(t.overload?"Overload. ":"")+e}cardTextSplit(t){const e=[];if(t.isFree&&e.push("Free"),t.consistent&&e.push("Consistent"),t.overload&&e.push("Overload"),t.type==="C"){const i=t;i.iRegen>0&&e.push("Regenerate "+i.iRegen),i.iArmor>0&&e.push("Armor "+i.iArmor),i.iMobile>0&&e.push("Mobility "+i.iMobile),i.iBT&&e.push("Breakthrough"),i.iDefend&&e.push("Defender"),i.iAggro&&e.push("Aggressive")}if(t.text.length>0&&e.push(...t.text.split("~")),t.level===1){const i=t.cardCode(),s=ti.find(h=>h[0]===i);if(s){let h;const u=s[1];u.length===2&&u[0]===u[1]?h="2x "+L.getCard(`${u[0]}1`).name:h=u.map(g=>L.getCard(`${g}1`).name).join(", "),e.push("Solbind: "+h)}}return e}factionText(t){switch(t){case "A":return"Alloyin";case "N":return"Nekrium";case "T":return"Tempys";case "U":return"Uterra";case "X":return""}}cardTypeText(t){return t==="C"?"Creature":"Spell"}rarityText(t){switch(t){case "C":return"Common";case "R":return"Rare";case "H":return"Heroic";case "L":return"Legendary";case "T":return"Token"}}levelGateText(t,e=!1){const i=e?" ":"";return t===1?`level 1${i}`:t===2?`level 2 or lower${i}`:""}jr9(t,e,i=!1){return t!==0&&e!==0?`${this.bufferson(t,!0)}${i?",":" and"} ${this.bufferson(e,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(e,!1)}bufferson(t,e){return`${t>0?"+":""}${t} ${e?"attack":"health"}`}dbdtac(t=-1){return`deals battle damage to a ${t===-1?"":this.levelGateText(t,!0)}creature`}dbdtap(){return"deals battle damage to a player"}daluac(t=!1){return(t?"D":"d")+"iscard and level up a card"}forglied(t){return t==="X"?"Forge":`Allied ${this.factionText(t)}`}fastName(t){t.length===3&&(console.warn("HEY a 3 char card code was passed to fastName, why?: "+t),t=`${t}1`);const e=L.getCard(t);return e.name+" "+e.level}pName(t){return t?"A":"B"}tokName(t){return`${t.iAttack}/${t.iHealth} ${t.name}`}cardActionText(t){let e=`Card (${this.fastName(t.host)}) `;if(t.zone==="F"){const i=t,s=i.playerA?i.lane:6-i.lane,h=f.searchByFSA(i),u=h?this.fastName(h.code):"Empty";e+=`Lane ${s}${this.pName(i.playerA)} ${u}`}else if(t.zone==="H"){const i=t;e+=`Hand (${this.fastName(i.card)})`}else if(t.zone==="P"){const i=t;e+=`Player (${this.pName(i.playerA)})`}else t.zone==="R"?e+="Full Board":t.zone==="B"?e+="Button":t.zone==="N"&&(e+="Special");return e}actionText(t){switch(t.key){case "ACTV":return`Activate (${this.fastName(t.host)})`;case "CARD":return this.cardActionText(t);case "FITE":return"Fight";case "FORG":return`Forge to Lane ${6-t.lane}`;case "HDSC":return`Hand Discard (${this.fastName(t.host)})`;case "HPLY":const i=t;return`Play (${this.fastName(i.card)})`;case "MEND":return"Move End";case "MOVE":return"Move Start";case "NOTR":return"Pick None";case "ENDT":return"Donethanks";case "CANC":return"Cancel";default:return t.key}}tribeT={["AN"]:"Any",["AB"]:"Abomination",["AG"]:"Angel",["AS"]:"Asir",["BR"]:"Bear",["BE"]:"Beast",["CT"]:"Cat",["CR"]:"Chrysalis",["CY"]:"Cyborg",["DF"]:"Darkforged",["DM"]:"Demon",["DN"]:"Dinosaur",["DG"]:"Dragon",["DK"]:"Drakin",["DY"]:"Dryad",["ER"]:"Earth",["EL"]:"Elemental",["EN"]:"Energeist",["FY"]:"Fairy",["FR"]:"Fire",["FB"]:"Forgeborn",["FT"]:"Frost",["GT"]:"Giant",["GN"]:"Gnome",["GL"]:"Golem",["GG"]:"Grimgaunt",["GD"]:"Guardian",["HM"]:"Human",["HY"]:"Hydra",["IC"]:"Ice",["IN"]:"Insect",["LT"]:"Lightning",["LP"]:"Lupin",["MT"]:"Manticore",["MC"]:"Mech",["MM"]:"Metamind",["NG"]:"Naga",["OZ"]:"Ooze",["PX"]:"Phoenix",["PL"]:"Plant",["RM"]:"Ram",["RB"]:"Robot",["SY"]:"Satyr",["SE"]:"Seraph",["SH"]:"Shaman",["SS"]:"Shapeshifter",["SK"]:"Skeleton",["SN"]:"Snake",["SP"]:"Spider",["ST"]:"Spirit",["TG"]:"Tigrin",["TK"]:"Tuskin",["VP"]:"Vampire",["WD"]:"Wanderer",["WT"]:"Water",["WN"]:"Wind",["WF"]:"Wolf",["WR"]:"Wurm",["YT"]:"Yeti",["ZB"]:"Zombie"};tribeText(t){return this.tribeT[t]}}const m=new Hs;class Ns{handleMainMenuButton(t){t.param==="D"?(bt.setMode("D"),T.options.wasDrafting=!0,gt.playmatSetup(),pt.initDraft()):t.param==="C"?(bt.setMode("C"),T.options.wasDrafting=!1,gt.playmatSetup(),Pt.initConstructed()):t.param==="I"?(bt.setMode("I"),gt.drawAll()):window.open("deckbuilder.html")}handleMenuButton(t){const e=T.deTil(t.param),i=e[0];let s=!0;if(i==="RP")s=!1,m.clearAll(),T.options.wasDrafting?pt.replay():Pt.replay();else if(i==="MM")bt.setMode("M"),m.clearAll();else if(i==="CN"||i==="CP"||i==="CX"||i==="CR"||i==="CI"||i==="CV"||i==="LK")Pt.handleMenuPick(i,e[1]);else if(i==="DN"||i==="DR"||i==="DI"||i==="DV"||i==="LD"||i==="GP"||i==="OD"||i==="DT")pt.handleMenuPick(i,e[1]);else if(i==="alloyin"||i==="nekrium"||i==="tempys"||i==="uterra"||i==="vanilla")T.options.playmat=i,T.writeStorage("playmat",i);else if(i==="HH")T.toggleOption("highHealth");else if(i==="CH")T.toggleOption("cheater");else if(i==="BB")T.toggleOption("bark");else if(t.param==="BC")T.toggleOption("bigCards");else if(i==="90"){const h=T.options.scale==="90"?"100":"90";gt.changeScale(h)}else i==="RU"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/rules")):i==="FQ"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/faq")):(s=!1,console.error("missing handler for menu button param "+t.param));s&>.drawAll()}handleUIButton(t){t.param==="DM"?(T.setClickMode("I"),gt.drawAll()):t.param==="TM"?(T.setClickMode("T"),gt.drawAll()):t.param==="EX"?(bt.setMode("X"),S.ddf5(this.generateExitActions())):console.error("missing handler for common button param "+t.param)}generateExitActions(){const t=p.basicAction("CANC");return t.param="PM",[t,p.menuButtonAction("MM")]}}const Xe=new Ns;class Fs{stack=["M"];setMode(t){this.deetMode(t)||t==="X"||t==="S"?this.stack.push(t):(this.stack=[t],t==="G"?(et.get("game-ui").clear(),gt.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(et.get("game-ui").clear(),gt.setBackground("blueface")):t==="M"&&(gt.clearAll(),gt.setBackground("mainmenu")))}popMode(){this.stack.pop()}get mode(){const t=this.stack;return t[t.length-1]}get isDetailMode(){return this.deetMode(this.mode)}get baseMode(){return this.stack[0]}deetMode(t){return t==="R"||t==="T"}}const bt=new Fs;class Ps{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const e=v.toPlayer(t),i=[],s=[];if(e.deck.forEach(h=>{L.getCard(h).consistent?i.push(h):s.push(h)}),i.length===0)this.shuffle(e.deck);else{this.shuffle(s);const h=20-i.length,u=i.concat(s.slice(0,h));this.shuffle(u),e.deck=s.slice(h).concat(u)}}shuffle(t){const e=t.length,i=(s,h)=>{const u=t[s];t[s]=t[h],t[h]=u};if(e>0){let s,h;const u=e*4;for(let g=0;gi.decks).flat(),e=T.randInt(0,t.length);return t[e]}stockDeckByName(t,e){let i;if(ge.some(s=>s.id===t?s.decks.some(h=>{h.name===e&&(i=h)}):!1),i)return i;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+e)}ripper(t,e,i){const s=[[15,8,5],[30,15,10]],h=this.getDeckCards([],[t]),u=[],g=s[i===15?0:1][e-1];for(;u.length$===B)||u.push(B)}const y=u.map(C=>({card:C,num:e}));return e===2&&i===15&&(y[0].num=1),y}deckify(t){const e=t.map(i=>{const s=ti.find(h=>h[0]===i);return s?s[1]:[]}).flat();return t.concat(e).map(i=>`${i}1`)}parseDeck(t){const e=t.map(i=>Array(i.num).fill(i.card)).flat();return this.deckify(e)}validDeck(t){const e={};t.forEach(C=>{e[C.card]?e[C.card]+=C.num:e[C.card]=C.num});const i=Object.entries(e).map(C=>({card:C[0],num:C[1]})),s=i.map(C=>C.num).reduce((C,B)=>C+B,0);if(s!==30)return"Deck must have 30 cards, found "+s;const h=[];let u="";if(i.some(C=>{const B=Mt.findIndex($=>$.c===C.card);return B===-1?(u=C.card,!0):(h.push(Mt[B].f),!1)}))return`Invalid card code: '${u}'`;let g=0;if(i.some(C=>C.num>3?(u=C.card,g=C.num,!0):!1))return`${g} copies of '${u}' ${m.fastName(u).slice(0,-2)}`;const y=[...new Set(h)];return y.length>2?"Deck must have two or less factions, found: "+y.join():""}getDeckCards(t=[],e=[],i=[]){return t.length===0&&e.length===0&&i.length===0?Mt.map(s=>s.c):t.length>0&&e.length>0&&i.length===0?Mt.filter(s=>t.includes(s.r)&&e.includes(s.f)).map(s=>s.c):t.length>0&&e.length===0&&i.length===0?Mt.filter(s=>t.includes(s.r)).map(s=>s.c):t.length===0&&e.length>0&&i.length===0?Mt.filter(s=>e.includes(s.f)).map(s=>s.c):t.length>0&&e.length>0&&i.length>0?Mt.filter(s=>t.includes(s.r)&&e.includes(s.f)&&i.includes(Math.floor(s.s))).map(s=>s.c):t.length>0&&e.length===0&&i.length>0?Mt.filter(s=>t.includes(s.r)&&i.includes(Math.floor(s.s))).map(s=>s.c):t.length===0&&e.length>0&&i.length>0?Mt.filter(s=>e.includes(s.f)&&i.includes(Math.floor(s.s))).map(s=>s.c):Mt.filter(s=>i.includes(Math.floor(s.s))).map(s=>s.c)}getCardFaction(t){const e=Mt.find(i=>i.c===t);return e?e.f:"X"}getCardRarity(t){const e=Mt.find(i=>i.c===t);return e?e.r:"T"}cardStats(){Se.forEach(t=>{const e=`${m.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,i=le.map(s=>`${m.rarityText(s)}: ${this.getDeckCards([s],[t]).length}`).join("; ");console.log(e+i)})}loadPromise=new De;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new De,this.loader.click(),await this.loadPromise.getPromise(),this.fileguts==="")return"";if(this.fileguts.startsWith("!")){const s=this.fileguts.substring(1);return this.fileguts="",s}const t=JSON.parse(this.fileguts);this.fileguts="";const e=t.cards,i=this.validDeck(e);return i||t}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const e=this.loader.files;if(e&&e.length>0){const s=e[0];var i=new FileReader;i.onload=h=>{try{var u=i.result;if(u){var g=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(u)));g.cards&&Array.isArray(g.cards)&&!g.cards.some(y=>!(y&&typeof y.card=="string"&&Number.isInteger(y.num)))?(this.fileguts=JSON.stringify(g),this.loadPromise.resolveMe()):this.readError("File format is invalid.")}else this.readError("File read was empty.")}catch(y){console.error(y),this.readError("Error reading file.")}};try{i.readAsArrayBuffer(s)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}const Jt=new Ps;class Ms{phase="ST";enterMainPhase(){this.phase="MN";const t=v.getActive(),e=this.getMainPhaseActions(t);R.aiActive&&at.hitMainPhase(),S.ddf5(e,!0)}async whatNext(t=!1){if(R.winFlag!==0){at.simOn?(at.simEndpoint(R.winFlag===1?"L":"W"),R.winFlag=0):(S.actionHistory=[],R.aiActive=!1,R.ui.animating=!1,await gt.drawAll());return}if(await gt.drawAll(),S.actionHistory.length>0)S.ddf5();else if(t)bt.setMode("S"),gt.drawAll();else if(x.getNextTrigger())qe.resolve(x.getNextTrigger());else if(!x.deathCheck)W.deathCheck(),this.whatNext();else if(x.events.length>0)x.startBatch();else switch(f.purge(),W.purge(),this.phase){case "MN":this.enterMainPhase();break;case "ET":this.phase="PT",x.addEvents(O.player("PTN",v.getActiveB())),Lt.expireMods(),this.whatNext();break;case "PT":E.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),this.phase="MN",this.whatNext();break;case "ST":at.simOn?at.simEndpoint("T"):(this.phase="MN",at.cheater()?T.sleep(500).then(()=>this.whatNext()):T.sleep(100).then(()=>this.whatNext()));break}}expireatron(t,e,i,s){e.mods.forEach(h=>{h.expiry===s?h.expiry=i:h.expiry===i&&t.push([e,h])})}expireMods(){const t=f.creatByTarget(p.crTarg());t.push(v.playerA,v.playerB);let e=[];this.phase==="PT"?t.forEach(i=>{this.expireatron(e,i,"ET","EN")}):this.phase==="ST"&&t.forEach(i=>{this.expireatron(e,i,"ST","SN")}),e.length>0&&(e.forEach(i=>{const s=i[0];s instanceof Ce?s.expireMod(i[1]):v.expireMod(s,i[1])}),re.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const e=this.getHandActions(t),i=this.getFieldActions(t);let s=E.mainBattle,h="M";return s||(s=f.ddf1().some(g=>g.extraBattles>0&&g.isActive&&!g.defender),h="E"),s&&e.push({key:"FITE",zone:"B",param:h,host:""}),s||e.push({key:"ENDT",zone:"B",param:"",host:""}),[e,i].flat()}getHandActions(t){const e=[...new Set(t.hand)],i=[],s=[];e.forEach(y=>{L.getCard(y).isFree?i.push(y):s.push(y)});const h=i.map(y=>[y,"FREE"]);E.freeCards.forEach(y=>{D.cardByTarget(s,y.condition).forEach(B=>{h.push([B[0],y.id]),s.splice(s.indexOf(B[0]),1)})}),h.push(...s.map(y=>[y,""]));const u=E.regularPlays>0;let g=t.hand.map((y,C)=>[y,C]);return u||(g=g.filter(y=>!s.includes(y[0]))),g.map(y=>{const C=h.find(B=>B[0]===y[0]);return C||console.error("No cost found for card"+y[0]),p.handSelectAction("HPLY",y[0],C[1],y[1])})}getFieldActions(t){const e=f.qPlayerCreats(t.isPlayerA),i=e.filter(h=>f.canMove(h).length>0).map(h=>p.fieldSelectAction("MOVE",h.lane,h.owner)),s=e.filter(h=>h.isActive&&h.activationAvailable?L.getCard(h.code).canActivate(h):!1).map(h=>{const u=p.fieldSelectAction("ACTV",h.lane,h.owner);return u.host=h.code,u.param=h.id,u});return i.forEach(h=>{const u=s.findIndex(g=>g.lane===h.lane);u>-1&&(s.splice(u,1),h.param="ACTV")}),i.concat(s)}}const Lt=new Ms;class Rs{playerA;playerB;activePlayer;isLocalA;constructor(){this.playerA=this.newPlayer(!0),this.playerB=this.newPlayer(!1),this.activePlayer=!0,this.isLocalA=!0}getPlayerState(t){return{deck:t.deck,discard:t.discard,hand:t.hand,health:t.health,triggers:t.triggers,turn:t.turn,rank:t.rank,poison:t.poison,armor:t.armor,armorDmg:t.armorDmg,mods:t.mods}}setPlayerState(t,e){e.deck=t.deck,e.discard=t.discard,e.hand=t.hand,e.health=t.health,e.triggers=t.triggers,e.turn=t.turn,e.rank=t.rank,e.poison=t.poison,e.mods=t.mods,e.armor=t.armor,e.armorDmg=t.armorDmg}getState(){const t={pA:this.getPlayerState(this.playerA),pB:this.getPlayerState(this.playerB),actP:this.activePlayer};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.setPlayerState(e.pA,this.playerA),this.setPlayerState(e.pB,this.playerB),this.activePlayer=e.actP}pt2pb={["X"]:()=>{throw new Error("goof passed any to player target boolean-o-fier")},["A"]:()=>!0,["B"]:()=>!1,["F"]:()=>this.getActiveB(),["E"]:()=>!this.getActiveB()};b2p(t){return t?this.playerA:this.playerB}toPlayer(t){return typeof t=="boolean"?this.b2p(t):typeof t=="string"?this.b2p(this.pt2pb[t]()):t}toBool(t){return typeof t=="boolean"?t:typeof t=="string"?this.pt2pb[t]():t.isPlayerA}toTarget(t){return typeof t=="string"?t:(typeof t=="boolean"?t:t.isPlayerA)?"A":"B"}getActive(){return this.b2p(this.activePlayer)}getActiveB(){return this.activePlayer}getLocal(){return this.b2p(this.isLocalA)}getLocalB(){return this.isLocalA}hurtPlayer(t,e){if(e<1)return 0;const i=this.totalArmor(t),s=Math.max(Math.min(e,i-t.armorDmg),0);let h=e-s;return t.armorDmg+=s,t.health-=h,h}hurtDirect(t,e,i){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(m.new().crd(i).txt(` dealt ${h} dmg to `).plr(s).txt(".").go(),x.addEvents(O.damage(!1,h,!1,!1,s.isPlayerA,void 0)),re.playerHealthChange())}hurtBattle(t,e,i){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(m.new().crd(i.code).txt(` dealt ${h} battle dmg to `).plr(s).txt(".").go(),x.addEvents(O.damage(!0,h,!0,!1,s.isPlayerA,i)))}heal(t,e){const i=this.toPlayer(t);i.health+=e,m.new().plr(i).txt(` gained ${e} health.`).go(),x.addEvents(O.playerHeal(i.isPlayerA,e)),re.playerHealthChange()}drawCard(t,e){const i=this.toPlayer(t);for(let s=0;ss.granter===e?(s.type==="AR"&&(i.armorDmg=Math.max(0,i.armorDmg-s.value)),!1):!0)}removeModSafe(t,e){const i=this.toPlayer(t);this.hasMod(i,e)&&this.removeMod(i,e)}expireMod(t,e){const i=this.toPlayer(t);i.mods.splice(p.modIdx(i.mods,e),1)}newPlayer(t){return{hand:[],deck:[],discard:[],isPlayerA:t,health:120,mods:[],name:"",nameOffset:0,triggers:[],turn:1,rank:1,armor:0,armorDmg:0,poison:0,avatar:Math.floor(Math.random()*17)}}initPlayer(t,e,i,s){const h=this.toPlayer(t);h.name=i,h.nameOffset=s,h.turn=1,h.rank=1,h.health=T.options.highHealth?360:120,h.discard=[],h.deck=Jt.parseDeck(e),h.mods=[],h.triggers=[],h.poison=0,h.armor=0,h.armorDmg=0,this.ambushScan(h),Jt.shuffleDeck(h),h.hand=h.deck.splice(-5,5)}ambushScan(t){this.boosh(t,"LLD","PC"),this.boosh(t,"LLG","MV"),this.boosh(t,"LLS","EF"),this.boosh(t,"LLT","LG")}boosh(t,e,i){const s=e+"1";if(t.deck.includes(s)){const h=p.trigger(i,s);h.cardCode=s,h.customCode="AB",t.triggers.push(h)}}nameOSaurus(){const t=[["The Garmgunt",5],["Dr. Lucksack",15],["Sgt. Misplay",22],["Salty O'Teary",12],["M.V.P. Sprout",19],["Uncle Punchy",7],["Yesetherian",20],["Rubbish Asir",20],["Hogwash Druid",0],["Offal Savant",15],["Filth Knight",17],["Dirty Mystic",16],["Ether Buffoon",6],["Nexus Dimwit",12],["Hairy Poppins",11],["Al E. Gator",26],["Anita Bath",28],["Bennie Factor",9],["Chris P. Bacon",9],["Don Keigh",29],["Earl E. Bird",25],["Hugh Jass",34],["Jay Walker",28],["Barb Dwyer",22],["Robyn Banks",18],["Anna Graham",9],["Holly Graham",6],["Justin Case",26],["Sir Loins",39]],e=t[T.randInt(0,t.length)];return[e[0],e[1]+18]}}const v=new Rs;class Es{stateStack=[];popCheck(){if(this.stateStack.length===0)throw new Error("Attempted to manipulate empty stack")}saveState(){const t={action:S.getState(),aiInPhase:at.inPhase,batch:x.getState(),death:W.getState(),field:f.getState(),game:R.getState(),mode:JSON.stringify(bt.stack),phase:Lt.phase,player:v.getState(),turn:E.getState()};this.stateStack.push(t)}restoreState(){this.popCheck();const t=this.stateStack[this.stateStack.length-1];S.setState(t.action),at.inPhase=t.aiInPhase,x.setState(t.batch),W.setState(t.death),f.setState(t.field),R.setState(t.game.i,t.game.t),bt.stack=JSON.parse(t.mode),Lt.phase=t.phase,v.setState(t.player),E.setState(t.turn)}popState(){this.popCheck(),this.stateStack.pop()}}const ue=new Es;class Is{toActions(t){return(Array.isArray(t)?t:[t]).map(i=>{const s=this.actionTargGuts(i);return s.forEach(h=>{h.host=i.host,h.param=i.param,h.hint=i.hint}),s}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(e=>p.handSelectAction(t.key,e[0],"",e[1]));if(t.target==="TF"){if(t.field==="O")return f.creatByTarget(t).map(e=>p.fieldSelectAction(t.key,e.lane,e.owner));{const e=t.player==="X"?[!0,!1]:[v.toBool(t.player)],i=T.isUn(t.lanes)?f.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return e.map(s=>i.map(h=>p.fieldSelectAction(t.key,h,s))).flat();if(t.field==="E")return e.map(s=>f.emptyLanes(s).filter(h=>i.includes(h)).map(h=>p.fieldSelectAction(t.key,h,s))).flat()}}if(t.target==="TP")return t.player==="X"?[p.playerSelectAction(t.key,!0),p.playerSelectAction(t.key,!1)]:[p.playerSelectAction(t.key,v.toBool(t.player))];if(t.target==="TB")return[{key:t.key,zone:"B",host:t.host,param:""}];if(t.target==="TR")return[{key:t.key,zone:"R",host:t.host,param:""}];if(t.target==="TD")return[];throw new Error("Target encountered that doesnt have mappings to actions: "+t.target)}cardByTarget(t,e){let i=t.map((s,h)=>[s,h]);if(e){if(T.isUn(e.deckPositionSkip)||(i=i.filter(s=>s[1]!==e.deckPositionSkip)),e.faction!=="X"&&(i=i.filter(s=>L.getCard(s[0]).faction===e.faction)),e.tribe!=="AN"&&(i=i.filter(s=>{const h=L.getCard(s[0]);return h.type==="C"?h.isTribe(e.tribe):!1})),e.canLevel&&(i=i.filter(s=>L.getCard(s[0]).canLevel())),e.level!=="LA"){const s=D.levelTargetToLevel(e.level);i=i.filter(h=>{const u=parseInt(h[0].substring(3,4));return s.includes(u)})}if(e.card!=="A"){const s=e.card==="C"?"C":"S";i=i.filter(h=>L.getCard(h[0]).type===s)}e.cardCode&&(i=i.filter(s=>L.getCard(s[0]).cardCode()===e.cardCode))}return i}deckByTarget(t){const e=v.toPlayer(t.player);let i;if(t.target==="TH")i=e.hand;else if(t.target==="TD")i=e.discard;else if(t.target==="DK")i=e.deck;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(i,t)}buttonTarget(t,e="",i=""){return p.actionTarget("TB",t,e,i)}boardTarget(t,e){return p.actionTarget("TR",t,e,"")}ddf2(t){return t===1?"L1":t===2?"LN":"LA"}lt2l={["LA"]:()=>[1,2,3,4],["L1"]:()=>[1],["L2"]:()=>[2],["L3"]:()=>[3],["LN"]:()=>[1,2]};levelTargetToLevel(t){return this.lt2l[t]()}levelTargetTest(t,e){return this.levelTargetToLevel(t).includes(e)}levelTestCommon(t,e){return this.levelTargetTest(this.ddf2(e),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}const D=new Is;class Ls{ddf8(t){return t.trigger.type==="FR"?this.forgeTriggerTest(t,!1):t.trigger.type==="VN"?this.vengeanceTriggerTest(t):t.trigger.type==="FK"?this.flankTriggerTest(t):t.trigger.type==="AS"?this.forgeTriggerTest(t,!0):t.trigger.type==="UP"?this.upgradeTriggerTest(t):t.trigger.type==="DM"&&t.event.code==="DMG"||t.trigger.type==="HG"&&t.event.code==="CHL"||t.trigger.type==="EF"&&t.event.code==="ENT"||t.trigger.type==="DS"&&t.event.code==="DIE"||t.trigger.type==="PC"&&t.event.code==="PLC"||t.trigger.type==="MV"&&t.event.code==="MOV"||t.trigger.type==="RP"&&t.event.code==="RPL"||t.trigger.type==="LG"&&t.event.code==="PHL"||t.trigger.type==="TS"&&t.event.code==="TRS"||t.trigger.type==="TE"&&t.event.code==="TRE"||t.trigger.type==="PT"&&t.event.code==="PTN"||t.trigger.type==="RU"&&t.event.code==="RKU"?this.generalTriggerTest(t):!1}resolve(t){t.trigger.interactive&&(t.host==="P"?console.error("Encountered player hosted trigger that is interactive!!"):x.iaTrigLane=f.jr5(t.creatId).lane),L.getCard(t.trigger.logicCode).jr8(t)}forgeTriggerTest(t,e){if(t.event.code==="ENT"){const i=t.event;if(i.forged){const s=f.jr5(t.creatId),h=s.id===i.creatId&&s.status==="A";return e&&h?!s.opposed:h}}return!1}upgradeTriggerTest(t){if(t.event.code==="RPL"){const e=t.event,i=f.searchById(t.creatId);if(i)return i.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const e=t.event,i=f.searchById(t.creatId);if(i)return i.status==="D"&&i.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const e=t.event,i=f.jr5(t.creatId);return i.status==="A"&&i.id===e.creatId}return!1}generalTriggerTest(t){return L.getCard(t.trigger.logicCode).ddf8(t)}}const qe=new Ls;class Gs{firstTurn=!0;mainBattle=!0;deathsA=[];deathsB=[];ffs=0;regularPlays=2;cardsPlayed=0;freeCards=[];newPre=[];newPost=[];getState(){const t={mB:this.mainBattle,dA:this.deathsA,dB:this.deathsB,cP:this.cardsPlayed,ffs:this.ffs,fC:this.freeCards,rP:this.regularPlays,n1:this.newPre,n2:this.newPost};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.mainBattle=e.mB,this.deathsA=e.dA,this.deathsB=e.dB,this.cardsPlayed=e.cP,this.ffs=e.ffs,this.freeCards=e.fC,this.regularPlays=e.rP,this.newPre=e.n1,this.newPost=e.n2}resetTurnData(){this.mainBattle=!0,this.deathsA=[],this.deathsB=[],this.ffs=0,this.regularPlays=2,this.cardsPlayed=0,this.freeCards=[],this.newPre=[],this.newPost=[],this.firstTurn&&(this.firstTurn=!1,this.regularPlays=1)}forgeCard(t,e,i,s){const h=this.cardPlayed(e,i,s),u=v.getActive();m.new().txt("Forged ").crd(h.code).txt(".").go(),f.birth(h,"F",u.isPlayerA,t.lane),S.actionDone()}levelAndDiscardA(t){return this.levelAndDiscard(t.card,t.position)}levelAndDiscard(t,e,i=!0,s="F"){const h=L.getCard(t),u=v.toPlayer(s);if(e>-1?u.hand.splice(e,1):m.debug("Bad play index: "+e+" ("+t+")"),!h.overload){const g=h.levelUpCard();u.discard.push(g),i&&g!==t&&m.new().plr(u).txt(" leveled a card.").go()}return h}cardPlayed(t,e,i,s=!1){const h=this.levelAndDiscard(t,i,s),u=v.getActive();if(e==="")this.regularPlays-=1;else if(e!=="FREE"){const g=this.freeCards.findIndex(y=>y.id===e);g>-1?this.freeCards.splice(g,1):console.error("Could not find free card rule!")}if(this.cardsPlayed+=1,!s){const g=O.playCard(t,u.isPlayerA);x.addEvents(g)}return h}passTheTurn(){if(v.activePlayer=!v.activePlayer,Lt.phase="WT",R.aiMode){if(!at.simOn)if(R.aiActive=!R.aiActive,R.aiActive)at.turnSims=0,at.turnTime=0;else{const t=`🤖: ${this.calma(at.turnSims)} pontifications in ${(at.turnTime/1e3).toFixed(1)} seconds.`;m.new().txt(t).go()}}else v.isLocalA=v.activePlayer;this.startTurn()}calma(t){let e=t.toString();return e.length<4?e:e.length>6?e.slice(0,-6)+","+e.slice(-6,-3)+","+e.slice(-3):e.slice(0,-3)+","+e.slice(-3)}startTurn(){const t="------";at.log&&R.aiActive&&R.aiMode&&console.log(t+" AI Turn Start "+t),at.simOn||(m.new().txt(t).go(),m.new().plr(v.getActiveB()).txt(" starts turn.").go()),this.resetTurnData(),Lt.phase="ST",x.addEvents(O.player("TRS",v.getActiveB())),Lt.expireMods(),Lt.whatNext(!R.aiMode)}endTurn(){const t=v.getActive();t.discard.push(...t.hand),t.hand=[],t.turn++;const e=t.turn>4;x.addEvents(O.player("TRE",t.isPlayerA)),e&&(t.turn=1,t.rank++,m.new().plr(t).txt(" hits Rank "+t.rank+".").go(),x.addEvents(O.player("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],Jt.shuffleDeck(t.isPlayerA)),f.qActiveCreats().forEach(i=>{i.extraBattles=0}),v.drawCard(t,5),Lt.phase="ET",S.actionDone()}mobility(t){const e=f.jr5(t.param);m.new().crd(e.code).txt(" moved.").go(),e.mobilityAvailable=!1,e.move(t.lane),S.actionDone()}allied(t,e){const i=e??v.getActive(),s=p.target("TH");return s.player=v.toTarget(i),s.faction=t,D.deckByTarget(s).length>0}freeCard(t){const e=p.freeCard(t);return this.freeCards.push(e),e}birthRegistrar(t){this.mainBattle?this.newPre.push(t):this.newPost.push(t)}}const E=new Gs;class ci{id;dom;context;width;height;constructor(t){if(this.id=t,this.dom=document.getElementById(t),!this.dom)throw new Error(`Could not find canvas id ${t}`);this.context=this.dom.getContext("2d"),this.width=this.dom.width,this.height=this.dom.height,this.context.textBaseline="top",this.context.shadowOffsetX=1,this.context.shadowOffsetY=1}show(){this.dom.hidden=!1}hide(){this.dom.hidden=!0}get visible(){return!this.dom.hidden}clear(){this.context.clearRect(0,0,this.width,this.height)}sprite(t,e,i){this.context.drawImage(t,e,i)}updateScale(t){this.context.scale(t,t)}}class It{getCanv(t){return t instanceof ci?t:et.get(t)}async drawSprite(t,e,i,s,h={}){const u=this.getCanv(t).context,g=await T.getSprite(T.imgRoot+e);let y=1;h&&(y=h.alpha??1),y<1&&(u.globalAlpha=y),u.drawImage(g,i,s,g.naturalWidth,g.naturalHeight),y<1&&(u.globalAlpha=1)}async drawText(t,e,i,s,h={}){const u=this.getCanv(t).context,g=h.fontSize??24;T.pxRatio===2&&(s=this.retinaTextY(s,g)),u.fillStyle=h.colour||"#000000",u.font=`${g}px ${h.fontName||"cinzel"}`,u.shadowColor=h.shadow?"#000000":"#00000000",u.fillText(e,i,s),u.shadowColor="#00000000"}async spriteNumber(t,e,i,s,h,u){let g=i-this.numOffset(e,h);const y=[];e.toString().split("").forEach(C=>{y.push(this.drawSprite(t,this.numSpriteUrl(C,h,u),g,s)),g+=this.numSize(C,h)}),await Promise.all(y)}async drawHighlight(t,e,i,s,h,u="#00FF00"){const g=u.length===7?u.concat("aa"):u,y=this.getCanv(t);y.context.strokeStyle=g,y.context.beginPath(),y.context.rect(e,i,s,h),y.context.stroke()}hlColour(t){return t==="CANC"?"#FF0000":"#00FF00"}drawRarity(t,e,i,s){return this.drawSprite(t,`icons/rarity/new/${m.rarityText(e).toLowerCase()}.png`,i,s)}drawFaction(t,e,i,s){const h=e==="T"?2:0;return this.drawSprite(t,`icons/faction/${m.factionText(e).toLowerCase()}.png`,i+h,s+3)}retinaTextY(t,e){let i;return e<21?i=6:e<27?i=7:i=8,t-i}smallNumSize={"-":7,0:10,1:9,2:10,3:8,4:10,5:9,6:10,7:9,8:8,9:9};bigNumSize={"-":8,0:13,1:9,2:13,3:11,4:14,5:12,6:12,7:12,8:12,9:12};numSize(t,e){return e==="S"?this.smallNumSize[t]:this.bigNumSize[t]}numOffset(t,e){const i=t.toString().split("").reduce((s,h)=>s+this.numSize(h,e),0)-(e==="B"?2:1);return Math.floor(i/2)}numSpriteUrl(t,e,i){return`text/nums/${e}/${i}/${t}.png`}haze="#222222d8"}class fe extends It{async drawButton(t,e,i,s,h,u=7,g=!1,y=!0){let C,B;g?(C="ui/button/menu_on.png",B="#d7fc03"):(C="ui/button/menu_off.png",B="#00DEF7");const $=this.buttonBounds(e,i);if(await this.drawSprite(t,C,$[0],$[1]),await this.drawText(t,h,$[0]+7+u,$[1]+24,{colour:B,fontSize:30}),!g||y){const Y=new dt(s,...$,it.Both);tt.add(Y)}}async buttonMaker(t,e,i,s,h,u=7,g=!1,y=!0){const C={key:"MNBT",zone:"N",host:"",param:s};await this.drawButton(t,e,i,C,h,u,g,y)}buttonBounds(t,e){return[t-7,e-7,232,69]}}class je extends It{async makeIconButton(t,e,i,s){let u;u=`ui/button/ui_${s}.png`,await this.drawSprite(t,u,e,i);const g=p.basicAction("UIBT");g.param=s;const y=new dt(g,e,i,40,40,it.Both);tt.add(y)}async makeVScroller(t,e,i,s,h){const u=this.vScrollHilightBounds(e,i);await this.drawSprite(t,`ui/arrow/${s?"up":"down"}.png`,e,i);const g={zone:"N",key:h,host:"",param:s?"U":"D"},y=new dt(g,...u,it.Both);tt.add(y)}vScrollHilightBounds(t,e){return[t-3,e-3,40,27]}}class Ie extends It{async drawActions(t){if(bt.baseMode==="G"){const e=et.get("effects"),i=t.filter(s=>s.zone==="B");if(i.length>1&&console.error("Two button actions encountered in one batch",i),i.length===0||R.aiActive||T.clickMode==="I"&&!bt.isDetailMode){const s=this.buttonBounds();await this.drawSprite(e,"ui/button/off.png",s[0],s[1])}else{const s=i[0],h=this.buttonBounds();await this.drawSprite(e,"ui/button/on.png",h[0],h[1]);let u;s.key==="CARD"?u=s.param:u=s.key,await this.drawSprite(e,`text/butt/${u}.png`,h[0]+23,h[1]+18);const g=this.highlightBounds(),y=new dt(s,...g);s.key==="CNCL"&&(y.mouse=it.Both),tt.add(y)}}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),e=5,i=[-1,-1,2,2];return t.map((s,h)=>s+e*i[h])}}class Zt extends It{async drawCard(t,e,i,s){const h=this.getCanv(e),u=this.extractStats(t),g=u.cardClass;if(await this.drawSprite(h,g.image(!1),i+14,s+35),await this.drawSprite(h,this.frameImg(g.level,g.faction,g.type,!1),i,s),await this.drawSprite(h,`text/card/${g.cardCode()}.png`,i+12,s+16),u.isCreature){const y=s+178;await this.spriteNumber(h,u.att,i+24,y,"S","Y"),await this.spriteNumber(h,u.hlt,i+127,y,"S","Y")}if(u.sleeping&&await this.drawSprite(h,"icons/effects/defensive.png",i+5,s+40,{alpha:.7}),u.iconList.length>0){const y=i+57-17*(u.iconList.length-1);await Promise.all(u.iconList.map(async(C,B)=>this.drawIcon(h,y+B*35,s+140,C[0],C[1])))}}async drawBigCard(t,e,i,s){const h=this.extractStats(e);if(await this.drawSprite(t,e.image(!0),i+38,s+117),await this.drawSprite(t,this.frameImg(e.level,e.faction,e.type,!0),i,s),e.rarity!=="T"&&await this.drawRarity(t,e.rarity,i+309,s+394),h.isCreature){const u=s+555;await this.spriteNumber(t,h.att,i+44,u,"B","Y"),await this.spriteNumber(t,h.hlt,i+325,u,"B","Y")}}async drawIcon(t,e,i,s,h=0){const u=this.getCanv(t);if(await this.drawSprite(u,`icons/effects/${s}.png`,e,i),h>0){const g=s==="poison"?12:9;await this.spriteNumber(u,h,e+17,i+g,"S","B")}}extractStats(t){let e,i=!1,s=0,h=0,u=!1,g=0,y=!1,C=!1,B=!1,$=!1,Y=0,J=0,ut=0,U=!1,nt=!1;if(!(t instanceof Dt))i=!0,s=t.attack,h=t.health,u=t.sleeping&&!t.aggressive,g=t.regen,y=t.breakthrough,C=t.defender,B=t.aggressive,Y=t.armor,J=t.poison,ut=t.mobility,$=t.changed,e=L.getCard(t.code);else{if(t.type==="C"){i=!0;const At=t;s=At.iAttack,h=At.iHealth,g=At.iRegen,y=At.iBT,C=At.iDefend,B=At.iAggro,Y=At.iArmor,ut=At.iMobile}U=t.overload,nt=t.consistent,e=t}const ot=[];return U&&ot.push(["overload",0]),nt&&ot.push(["consistent",0]),g>0&&ot.push(["regenerate",g]),y&&ot.push(["breakthrough",0]),C&&ot.push(["defender",0]),B&&ot.push(["aggressive",0]),Y>0&&ot.push(["armor",Y]),J>0&&ot.push(["poison",J]),ut>0&&ot.push(["mobility",ut]),$&&ot.push(["changed",0]),{cardClass:e,isCreature:i,iconList:ot,hlt:h,att:s,sleeping:u}}async drawHilight(t,e,i,s="#00FF00"){await super.drawHighlight(t,...this.highlightBounds(e,i),s)}cardBounds(t,e){return[t,e,150,205]}highlightBounds(t,e){const i=this.cardBounds(t,e),s=5,h=[-1,-1,2,2];return i.map((u,g)=>u+s*h[g])}frameImg(t,e,i,s){return`frames/${s?"big":"small"}/lvl${t}_${e}${i}.png`}levelImg(t){return`icons/frame/lvl${t}.png`}oldFrameImg(t){return`icons/frame/frame${t}.png`}factionImg(t){return`icons/faction/orb${t}.png`}}const di=30,Le=540,ui=5;class fi extends It{async drawCards(t){const e=et.get("hand");e.clear();const i=new Zt,s=i.highlightBounds(0,0)[2]+ui;let h=di;const u=this.paginatron(t);for(let g=u[0];g<=u[1];g++){const y=L.getCard(t.hand[g]);await i.drawCard(y,e,h,Le),h+=s}}async drawActions(t){const e=T.clickMode!=="I",i=et.get("effects"),s=new Zt,h=s.highlightBounds(0,0)[2]+ui,u=new $t(0,520,1e3,250),g=new $t(0,520,1e3,250,it.Right),y=this.paginatron(v.getActive());await Promise.all(t.filter(C=>C.zone==="H").map(async C=>{const B=C;if(B.position>=y[0]&&B.position<=y[1]){const $=di+(B.position-y[0])*h;if(C.key==="DEET"){const Y=new dt(C,...s.highlightBounds($,Le),it.Right);g.addChild(Y)}else if(e){const Y=new dt(C,...s.highlightBounds($,Le));u.addChild(Y),await s.drawHilight(i,$,Le,this.hlColour(B.key))}}})),e&&tt.add(u),tt.add(g),y[0]>0&&await this.makeScroller(i,!1),y[1]0&&t.hand.length-e<5&&(e=Math.max(0,t.hand.length-5),R.ui.handScrollLeft=e),[e,Math.min(e+4,t.hand.length-1),t.hand.length-1]}scrollHilightBounds(t,e){return[t-3,e-2,27,38]}async makeScroller(t,e){const i=e?894:856,s=726,h=this.scrollHilightBounds(i,s);await this.drawSprite(t,`ui/arrow/${e?"right":"left"}.png`,i,s),await this.drawHighlight(t,...h);const u={zone:"N",key:"SCRH",host:"",param:e?"R":"L"},g=new dt(u,...h,it.Both);tt.add(g)}}class Je extends It{fieldBoundary=[17,62,821,443];async drawCards(t){const e=v.getLocalB(),i=et.get("field");i.clear();const s=new Zt,h=f.qActiveCreats().map(u=>{let g=0;t&&t.scrappers.some(C=>C[0]===u.lane&&C[1]===u.owner)&&(g=t.battlePhase);const y=this.coordCalc(u.lane,u.owner,e,g);return s.drawCard(u,i,...y)});if(await Promise.all(h),x.iaTrigLane>0){const u=this.coordCalc(x.iaTrigLane,v.getActiveB(),e),g=s.cardBounds(...u),y=g[1]+g[3]+11,C=g[0]+g[2]/2;await this.drawSprite(i,"icons/rewards/gold.png",C-10,y),await this.drawSprite(i,"icons/rewards/gold.png",C-35,y),await this.drawSprite(i,"icons/rewards/gold.png",C-60,y),await this.drawSprite(i,"icons/rewards/gold.png",C+15,y),await this.drawSprite(i,"icons/rewards/gold.png",C+40,y)}}async drawActions(t){const e=T.clickMode!=="I",i=v.getLocalB(),s=et.get("effects"),h=new Zt,u=new $t(...this.fieldBoundary),g=new $t(...this.fieldBoundary,it.Right);await Promise.all(t.filter(y=>y.zone==="F"||y.zone==="R").map(async y=>{if(y.zone==="R"&&e){const C=new dt(y,...this.fieldBoundary);tt.add(C),await this.drawHighlight(s,...this.fieldBoundary)}else{const C=y,B=this.coordCalc(C.lane,C.playerA,i);if(y.key==="DEET"){const $=new dt(y,...h.highlightBounds(...B),it.Right);g.addChild($)}else if(e){const $=new dt(y,...h.highlightBounds(...B));u.addChild($),await h.drawHilight(s,...B,this.hlColour(C.key))}}})),e&&u.childs.length>0&&tt.add(u),g.childs.length>0&&tt.add(g)}async drawFight(t){if(t.length>0){const e={battlePhase:1,scrappers:t},i=72;await new Ie().drawActions([]),await this.drawCards(e),await T.sleep(i),e.battlePhase=2,await this.drawCards(e),await T.sleep(i),e.battlePhase=3,await this.drawCards(e),await T.sleep(i),e.battlePhase=4,await this.drawCards(e),await T.sleep(i+70),e.battlePhase=3,await this.drawCards(e),await T.sleep(i),e.battlePhase=2,await this.drawCards(e),await T.sleep(i),e.battlePhase=1,await this.drawCards(e),await T.sleep(i)}}coordCalc(t,e,i,s=0){const h=i===e,u=166,g=5;let y,C,B;return[y,B,C]=h?[22,290,1]:[687,65,-1],[y+(t-1)*u*C,B+s*g*(-1*C)]}}class Ae extends It{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,e,i,s){const h=this.getCanv(e);await this.drawSprite(h,`avatar/${this.avatars[t.avatar]}.jpg`,i+46,s+48),await this.drawSprite(h,"ui/player_frame.png",i,s),await this.drawSprite(h,"ui/player_health.png",i+10,s+102),await this.spriteNumber(h,t.health,i+45,s+149,"B","G"),await this.drawText(h,`Turn: ${t.turn} Rank: ${t.rank}`,i+25,s+210,{colour:"#f5f242",fontSize:20}),await this.drawText(h,t.name,i+t.nameOffset,s+185,{colour:"#42a4f5",fontSize:20});const u=v.totalPoison(t),g=v.totalArmor(t);if(u>0||g>0){const y=new Zt,C=s+9;u>0&&await y.drawIcon(h,i+15,C,"poison",u),g>0&&await y.drawIcon(h,i+150,C,"armor",g)}}async drawAllPlayers(){const t=et.get("player");t.clear();const e=!R.aiActive,i=v.getLocal(),s=v.toPlayer(!i.isPlayerA);if(await this.drawPlayer(i,t,...this.playerOrigin(!0)),await this.drawPlayer(s,t,...this.playerOrigin(!1)),i.isPlayerA===v.getActiveB()){let h=862;const u=295,g=Array(E.regularPlays).fill("blue").concat(E.freeCards.map(C=>C.sourceCard)),y=[];g.forEach(C=>{let B;if(C==="blue")B=C;else if(B="green",e){const $={key:"DEET",zone:"N",host:"",param:C},Y=new dt($,h-1,u-1,28,41,it.Both);tt.add(Y)}y.push(this.drawSprite(t,`ui/${B}card.png`,h,u)),h+=30}),await Promise.all(y)}await this.drawDeckButton(t,i,!0,e),await this.drawDeckButton(t,i,!1,e)}async drawDeckButton(t,e,i,s){let h,u,g;if(i?(h=e.discard.length,u=935,g="T"):(h=e.deck.length,u=858,g="U"),await this.drawSprite(t,`ui/button/faction_${g}.png`,u,350),await this.spriteNumber(t,h,u+38,350+14,"S","Y"),h>0&&s){const C=p.basicAction("VWDK");C.param=i?"VD":"VR";const B=new dt(C,u,350,77,44,it.Both);tt.add(B)}}async drawActions(t){if(T.clickMode==="I")return;const e=et.get("effects"),i=v.getLocalB();await Promise.all(t.filter(s=>s.zone==="P").map(s=>{const h=s,u=this.playerOrigin(h.playerA===i),g=this.highlightBounds(...u),y=new dt(s,...g);return tt.add(y),this.drawHighlight(e,...g)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,e){return[t+18,e+18,170,170]}highlightBounds(t,e){return this.playerBounds(t,e)}async drawGameOver(){const t=et.get("field"),e=94,i=v.getLocalB(),s=R.winFlag,h=i&&s===1||!i&&s===-1;await this.drawSprite(t,`ui/you-${h?"win":"lose"}.png`,e,89),tt.removeAll();const u=new fe,g=et.get("effects");await u.drawButton(g,e+62,520,p.menuButtonAction("MM"),"Main Menu",20,!1),await u.drawButton(g,e+389,520,p.menuButtonAction("RP"),"Replay",55,!1)}async drawAiGear(t,e){const h=t%6,u=Math.floor(t/6),g=et.get("effects"),y=`icons/rewards/${e?"gold":"silver"}.png`;await this.drawSprite(g,y,862+h*24,255+u*24)}hwhipe(){et.get("effects").clear()}}const gi=15,mi=15,$s=5;class Vs extends It{constructor(){super();const e=new Zt().highlightBounds(0,0);this.xOffset=e[2]+$s,this.yOffset=e[3]+25}xOffset;yOffset;async drawCards(){const t=et.get("decklist");t.clear(),t.context.fillStyle=this.haze,t.context.fillRect(0,0,849,T.gameHeight);const e=new Zt,s=Ft.visibleContent().map((h,u)=>{const g=L.getCard(h.cardCode),y=this.listXY(u);return e.drawCard(g,t,...y).then(()=>{if(h.cardCount>0)return this.drawCount(t,y[0]+62,y[1]+163,h.cardCount)})});await Promise.all(s)}async drawActions(t){const e=et.get("decklist"),i=new Zt,s=new je,h=T.clickMode!=="I",u=Ft.visibleContent(),g=R.ui,y=g.deckScroll,C=y+15,$=g.deckSummary?it.Both:it.Right,Y=new $t(...this.deckBoundary()),J=new $t(...this.deckBoundary(),$),ut=[];t.forEach(U=>{if(U.key==="DEET"){const nt=U;if(nt.position>=y&&nt.positionAt.sourceIdx===nt.position);if(ot>-1){const At=this.listXY(ot-y),ve=new dt(U,...i.highlightBounds(...At));Y.addChild(ve),ut.push(i.drawHilight(e,...At,this.hlColour(U.key)))}}}),h&&Y.childs.length>0&&tt.add(Y),J.childs.length>0&&tt.add(J),Ft.canPageDown&&ut.push(s.makeVScroller(e,319,723,!1,"SCRK")),Ft.canPageUp&&ut.push(s.makeVScroller(e,487,723,!0,"SCRK")),await Promise.all(ut)}async drawCount(t,e,i,s){await this.drawSprite(t,"ui/dullcard.png",e,i),await this.spriteNumber(t,s,e+13,i+13,"S","Y")}listXY(t){return[gi+t%5*this.xOffset,mi+Math.floor(t/5)*this.yOffset]}deckBoundary(){return[gi,mi,this.xOffset*5,this.yOffset*3]}}class Ws extends It{async drawDetails(t){const e=[],i=et.get("card");i.clear(),i.context.fillStyle=this.haze,i.context.fillRect(0,0,849,T.gameHeight);const s=30,h=30,u=L.getCard(jt.currentCard),g=new Zt;T.options.bigCards?e.push(g.drawBigCard(i,u,s,h)):e.push(g.drawCard(u,i,134,280));const y=435;let C=30;const B="#f5f242",$="#03fcfc",Y=33,J=23,ut=28;let U=u.name;for(;U.length>0;){C+=36;let St;if(U.length{for(;St.length>0;){let Yt;if(St.length1){const St=u.cardCode(),Yt=At===3?[19,147,270]:At===2?[78,216]:[0,98,196,294];ot.forEach((he,$e)=>{e.push(this.drawLevelButton(i,St,he,40+Yt[$e],658,he===u.level))})}const ve=new fe;let Te=0;const Qe=513,_e=697,pi=74;bt.baseMode!=="G"&&(e.push(ve.drawButton(i,Qe,_e,t,"Close",62,!1)),Te++);const Ys=new dt(t,s,h,377,603,it.Both);if(tt.add(Ys),jt.canGoBack){const St=jt.goBackAction();e.push(ve.drawButton(i,Qe,this.buttonY(_e,Te,pi),St,"Back",72,!1)),Te++}jt.friendos.forEach(St=>{const Yt=L.getCard(St),he=jt.friendAction(St),$e=jt.friendTxt(Yt.cardCode());e.push(ve.drawButton(i,Qe,this.buttonY(_e,Te,pi),he,$e[1]||Yt.name,$e[0],!1)),Te++}),await Promise.all(e)}buttonY(t,e,i){return t-e*i}cardSummary(t){const e=m.factionText(t.faction),i=m.rarityText(t.rarity),s=m.cardTypeText(t.type);return`${e}, ${i} ${s}`}tribeSummary(t){return t.tribe.map(e=>m.tribeText(e)).join(" ")}async drawLevelButton(t,e,i,s,h,u){if(await this.drawSprite(t,`icons/frame/level${i}.png`,s,h),!u){const B=jt.levelAction(i),$=new dt(B,s-15,h-5,88,112,it.Both);tt.add($)}const y=L.getCard(`${e}${i}`).levelSpice(),C=[[-16,55],[41,55],[11,79]];await Promise.all(y.map((B,$)=>{const Y=s+C[$][0],J=h+C[$][1];if(B.icon==="A"||B.icon==="H"){let ut,U;return B.icon==="A"?(ut="icons/frame/attack.png",U=Y+17):(ut="icons/frame/health.png",U=Y+16),this.drawSprite(t,ut,Y-1,J-1).then(()=>this.spriteNumber(t,B.num,U,J+10,"S","Y"))}else{let ut=this.spiceIcon(B.icon);if(B.icon==="U"||B.icon==="D"||B.icon==="L"||B.icon==="N"){const U=`icons/effects/${ut}.png`;return this.drawSprite(t,U,Y-1,J-1).then(()=>this.spriteNumber(t,B.num,Y+16,J+10,"S","B"))}else return new Zt().drawIcon(t,Y,J,ut,B.num)}}))}spiceIcon(t){return t==="N"?"new":t==="D"?"damage":t==="U"?"buff":t==="V"?"mobility":t==="P"?"poison":t==="M"?"armor":t==="G"?"aggressive":t==="F"?"defender":t==="B"?"breakthrough":t==="R"?"regenerate":t==="L"?"life":t==="C"?"consistent":t==="O"?"overload":"whoops"}levelFun(t){return t.maxLevel===3?t.minLevel===1?[1,2,3]:[3]:t.maxLevel===t.minLevel?[t.minLevel]:t.maxLevel===4?[1,2,3,4]:[1,2]}}class Os extends It{packLeft=22;packTop=190;packBoundary=[this.packLeft-5,this.packTop-10,537,480];async drawPack(t,e){const i=new Zt,s=T.clickMode!=="I",h=[],u=new $t(...this.packBoundary),g=new $t(...this.packBoundary,it.Right);t.filter(C=>C.pack).forEach(C=>{const B=this.coordCalcPack(C.index);if(C.key==="DRFT"){const $=L.getCard(C.param+"1");if(h.push(i.drawCard($,e,...B).then(()=>this.drawRarity(e,$.rarity,B[0]+112,B[1]+4))),s){const Y=new dt(C,...i.highlightBounds(...B));u.addChild(Y)}}else{const $=new dt(C,...i.highlightBounds(...B),it.Right);g.addChild($)}}),s&&u.childs.length>0&&tt.add(u),g.childs.length>0&&tt.add(g),await Promise.all(h)}async drawList(t,e){let i=170;const s=570,h=[],u=pt.picksAsDeck,g=new $t(s,i,600,600,it.Both),y=t,C=15,B=pt.scrollIdx;pt.canPageDown&&await this.makeScroller(e,!1),pt.canPageUp&&await this.makeScroller(e,!0),y.filter($=>!$.pack).forEach($=>{if($.index>=B&&$.index{const u=e.getFactTotal(h);if(u[2]===0)return[Promise.resolve()];{i+=75;const g=this.threeLine(t,i,s,u),y=this.drawFaction(t,h,i-8,s-39);return[g,y]}}).flat())}async threeLine(t,e,i,s){const h={colour:"#ffd865",fontSize:18,fontName:"serif"},u=30;await Promise.all(s.map((g,y)=>this.drawText(t,g.toString(),e,i+u*y,h)))}async drawDraftMenu(t){const e=new fe,i=new ke,s=240,h=80,u=45,g=34;let y=50,C=s;await i.headerText(y+28,C,"Opponent",t),C+=u,await e.buttonMaker(t,y,C,"DI","DUMB BOT",27,pt.vsAI,!1),C+=h,await e.buttonMaker(t,y,C,"DV","HUMAN",47,!pt.vsAI,!1),C+=h+16,await i.headerText(y+17,C,"Rarity Filter",t),C+=h-g-6,await this.rarityButton(t,y+20,C,"L",pt.getRarity("L")),await this.rarityButton(t,y+125,C,"H",pt.getRarity("H")),C+=h,await this.rarityButton(t,y+20,C,"R",pt.getRarity("R")),await this.rarityButton(t,y+125,C,"C",pt.getRarity("C")),C=s+u+h*5,await e.buttonMaker(t,y,C,"MM","MAIN MENU",16),y=404,C=s,await i.headerText(y+5,C,"Draft Modes",t),C+=u,await e.buttonMaker(t,y,C,"GP","GOOD PACKS",9,pt.fatPacks),C+=h,await e.buttonMaker(t,y,C,"LD","LEGENDARY",17,pt.legDraft),C+=h,await e.buttonMaker(t,y,C,"OD","OVERDRAFT",17,pt.overdraft),y=757,C=s,await i.headerText(y+76,C,"Sets",t),C+=u,await this.chestButton(t,y+3,C,1,pt.getSet(1)),await this.chestButton(t,y+124,C,2,pt.getSet(2)),C+=88,await this.chestButton(t,y+3,C,3,pt.getSet(3)),await this.chestButton(t,y+124,C,4,pt.getSet(4)),C+=88,await this.chestButton(t,y+3,C,5,pt.getSet(5)),C=s+u+h*5,await e.buttonMaker(t,y,C,"DN","NEXT",68)}async rarityButton(t,e,i,s,h){const u={key:"MNBT",zone:"N",host:"",param:T.enTil("DR",s)},g=`ui/button/rarity_${s}${h?"y":"n"}.png`;await this.drawSprite(t,g,e,i);const y=new dt(u,e,i,75,65,it.Both);tt.add(y)}async chestButton(t,e,i,s,h){const u={key:"MNBT",zone:"N",host:"",param:T.enTil("DT",s)},g=`icons/sets/Chest_Set${s}${h?"y":"n"}.png`;await this.drawSprite(t,g,e,i);const y=new dt(u,e,i,90,74,it.Both);tt.add(y)}}class Ge extends It{async drawSets(t,e){let i=200;const s=100,h=[],u=new $t(s,i,400,600);t.filter(g=>g.key==="DSET").forEach(g=>{const y=ge[parseInt(g.param)];h.push(this.drawText(e,y.name,s,i,{colour:"#f5f242"}),this.drawSprite(e,"icons/chest_small.png",s-48,i-5));const C=new dt(g,s,i-2,400,35,it.Both);u.addChild(C),i+=45}),tt.add(u),await Promise.all(h)}async drawList(t,e){let i=170;const s=570,h=[],u=new $t(s,i,600,600);t.filter(g=>g.key==="DECK").forEach(g=>{const y=T.deTil(g.param),C=Jt.stockDeckByName(y[0],y[1]);h.push(this.drawFaction(e,C.factions[0],s,i),this.drawText(e,C.name,s+65,i+7,{colour:"#f5f242"})),C.factions.length===2&&h.push(this.drawFaction(e,C.factions[1],s+28,i));const B=new dt(g,s,i-2,600,35,it.Both);u.addChild(B),i+=35}),await Promise.all(h),tt.add(u)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,h=Math.floor(t/3);return[22+s*176,200+h*235]}iAmError(t){const e=et.get("game-ui");this.drawText(e,t,295,655,{colour:"#f5142e",fontSize:26})}async drawConstrMenu(t){const e=new fe,i=new ke,s=240,h=80,u=45;let g=50,y=s;await i.headerText(g+28,y,"Opponent",t),y+=u,await e.buttonMaker(t,g,y,"CI","DUMB BOT",27,Pt.vsAI,!1),y+=h,await e.buttonMaker(t,g,y,"CV","HUMAN",47,!Pt.vsAI,!1),y+=h*4,await e.buttonMaker(t,g,y,"MM","MAIN MENU",16),g=404,y=s,await i.headerText(g+46,y,"Player 1",t);const C=Pt.p1.mode;y+=u,await e.buttonMaker(t,g,y,T.enTil("CP","A"),"PRE-CON",39,C==="CP",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("CR","A"),"RANDOM",36,C==="CR",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("CX","A"),"SCRAMBLE",30,C==="CX",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("LK","A"),"LOAD FILE",32,C==="LK"),C==="LK"&&await this.drawFileDeck(t,g,y,Pt.p1.deck),g=757,y=s,await i.headerText(g+44,y,"Player 2",t);const B=Pt.p2.mode;y+=u,await e.buttonMaker(t,g,y,T.enTil("CP","B"),"PRE-CON",39,B==="CP",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("CR","B"),"RANDOM",36,B==="CR",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("CX","B"),"SCRAMBLE",30,B==="CX",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("LK","B"),"LOAD FILE",32,B==="LK"),B==="LK"&&await this.drawFileDeck(t,g,y,Pt.p2.deck),y+=h*2,await e.buttonMaker(t,g,y,"CN","NEXT",68)}async drawFileDeck(t,e,i,s){const h=i+89;await this.drawText(t,s.name.slice(0,20),e,i+70,{colour:"#f5f242",fontSize:18}),s.factions.length===1?await this.drawFaction(t,s.factions[0],e+96,h):(await this.drawFaction(t,s.factions[0],e+78,h),await this.drawFaction(t,s.factions[1],e+113,h))}}class ke extends It{async drawExtrasMenu(t){const e=new fe,i=240,s=80,h=45,u=34;let g=50,y=i;await this.headerText(g+28,y,"More Info",t),y+=h,await e.buttonMaker(t,g,y,"RU","RULES",66),y+=s,await e.buttonMaker(t,g,y,"FQ","INFO & FAQ",20),y+=s*4,await e.buttonMaker(t,g,y,"MM","MAIN MENU",16),g=404,y=i,await this.headerText(g+37,y,"UI Modes",t),y+=h,await e.buttonMaker(t,g,y,"90","90% SIZE",47,T.options.scale==="90"),y+=s,await e.buttonMaker(t,g,y,"BC","BIG CARDS",29,T.options.bigCards),y+=s+u,await this.headerText(g+12,y,"Game Modes",t),y+=s-u,await e.buttonMaker(t,g,y,"HH","BIG HEALTH",20,T.options.highHealth),y+=s,await e.buttonMaker(t,g,y,"CH","CHEATER",39,T.options.cheater),y+=s,await e.buttonMaker(t,g,y,"BB","BATTLE BARK",13,T.options.bark),g=757,y=i,await this.headerText(g+43,y,"Playmat",t),y+=h;const C=T.options.playmat==="vanilla";await e.buttonMaker(t,g,y,"vanilla","VANILLA",43,C,!C),y+=s;const B=T.options.playmat==="alloyin";await e.buttonMaker(t,g,y,"alloyin","ALLOYIN",43,B,!B),y+=s;const $=T.options.playmat==="nekrium";await e.buttonMaker(t,g,y,"nekrium","NEKRIUM",38,$,!$),y+=s;const Y=T.options.playmat==="tempys";await e.buttonMaker(t,g,y,"tempys","TEMPYS",51,Y,!Y),y+=s;const J=T.options.playmat==="uterra";await e.buttonMaker(t,g,y,"uterra","UTERRA",52,J,!J),await this.drawText(t,"v0.7.7",890,46,{fontSize:16,colour:"#7b68ee"})}async headerText(t,e,i,s){await this.drawText(s,i,t,e,{colour:"#f5f242",fontSize:30})}async drawPickerPlayer(t,e,i){let s;e?s="Player 1":i?s="Dumb Bot":s="Player 2",await this.headerText(54,75,s,t)}}class Us extends It{async drawMenu(t){let i=22;await this.drawSprite(t,"ui/button/constructed.png",778,i);const s=new dt(this.makeAction("C"),...this.buttHilightBounds(778,i),it.Both);tt.add(s),i=148,await this.drawSprite(t,"ui/button/draft.png",778,i);const h=new dt(this.makeAction("D"),...this.buttHilightBounds(778,i),it.Both);tt.add(h),i=508,await this.drawSprite(t,"ui/button/deck.png",778,i);const u=new dt(this.makeAction("B"),...this.buttHilightBounds(778,i),it.Both);tt.add(u),i=634,await this.drawSprite(t,"ui/button/info.png",778,i);const g=new dt(this.makeAction("I"),...this.buttHilightBounds(778,i),it.Both);tt.add(g);const y=p.basicAction("DBUG"),C=new dt(y,757,349,74,70,it.Right);tt.add(C),await this.drawSprite(t,"gwg/gwg_red.png",58,0)}buttBounds(t,e){return[t,e,242,113]}buttHilightBounds(t,e){const s=[-3,-3,6,6];return this.buttBounds(t,e).map((h,u)=>h+s[u])}makeAction(t){return{zone:"N",key:"MENU",host:"",param:t}}}class zs{gameWidth;gameHeight;spriteCache;dogAudio;_clickMode;pxRatio=1;options;imgRoot;constructor(){this.spriteCache={},this.imgRoot="./img/",this.gameWidth=1024,this.gameHeight=768,this.dogAudio=document.getElementById("dogbark"),this._clickMode="M",this.options={bark:!0,bigCards:!0,highHealth:!1,cheater:!1,playmat:"uterra",wasDrafting:!1,scale:"100",debug:!1}}randInt(t,e){return Math.floor(Math.random()*(e-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async getSprite(t){return this.spriteCache[t]||(this.spriteCache[t]=this.imageLoader(t)),this.spriteCache[t]}async bulkLoadSprite(t){await Promise.all(t.map(e=>this.getSprite(`${this.imgRoot}${e}`)))}dogBark(){this.dogAudio.volume=.3,this.dogAudio.play()}toggleDebug(){const t=!this.options.debug;this.options.debug=t,new Ge().iAmError("Debug mode "+(t?"ON":"OFF"))}enTil(...t){return t.join("~")}deTil(t){return t.split("~")}imageLoader(t){return new Promise(e=>{const i=new Image;i.onload=()=>{e(i)},i.src=t})}writeStorage(t,e){localStorage.setItem(t,e)}readStorage(t){return localStorage.getItem(t)}readStringStorage(t,e){const i=this.readStorage(t);return i===null?e:i}readBoolStorage(t,e){const i=this.readStorage(t);return i===null?e:i==="Y"}writeBoolStorage(t,e){this.writeStorage(t,e?"Y":"N")}restoreOptions(){const t=this.options;t.bark=this.readBoolStorage("bark",!0),t.bigCards=this.readBoolStorage("bigCards",!0),t.cheater=this.readBoolStorage("cheater",!1),t.highHealth=this.readBoolStorage("highHealth",!1),t.playmat=this.readStringStorage("playmat","uterra"),t.scale=this.readStringStorage("scale","100")}toggleOption(t){T.options[t]=!T.options[t],this.writeBoolStorage(t,T.options[t])}setClickMode(t){this._clickMode=t}get clickMode(){return this._clickMode}}const T=new zs;class Zs{log=!1;file=!1;makeReport(){if(!this.file&&!this.log)return;const t=Mt.map(s=>s.c);t.push("NDR","RSC","CGF","IZL","IZR","FUN","FWG","FWC","DZA");const e=t.map(s=>{const h=L.getCard(s+"1");return h.type==="C"?h.name+" "+this.cardGuts(h):""}).filter(Boolean).sort().join(` -`);if(this.file){var i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),i.setAttribute("download","guts.txt"),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}}cardGuts(t){const e=t.jr3(!0,3);e.sleeping=!1;const i=e.bonusTotal(),s=at.levelBonusFormula(t,!1,!1)+at.hintAdjuster(t);let h=ht.creatValueFormula(e),u=ht.threatFormula(e,[]),g=i.pHealth,y=i.bonus+s,C=1+i.count,B=h+i.value,$=u+i.attack,J=ht.ddp9Nugget(C,B,$,g,y).map(ut=>ut.toFixed(1)).join(" ");if(this.log&&(console.group("---- "+t.name+" "+t.level+" ----"),console.log("Attack: "+e.attack+"; Health: "+e.health),console.log("Creat Value Weight: "+h+"; Creat Threat Weight: "+u),console.log("Creat Value Bonus: "+i.value+"; Creat Threat Bonus: "+i.attack),console.log("Level Bonus: "+s+"; Raw Bonus: "+i.bonus),console.log("Player Bonus: "+i.pHealth+"; Count Bonus: "+i.count),console.log("Formula: Total, Count, Value, Threat, Player, Bonus"),console.log(J),console.groupEnd()),t.level{await document.fonts.ready;let n=[];document.fonts.forEach(U=>{U.load(),n.push(U.loaded)}),await Promise.all(n),["game-ui","field","player","hand","effects","decklist","card"].forEach(U=>{et.register(U)});const e=et.get("effects");e.context.lineWidth=2,T.pxRatio=window.devicePixelRatio;let i;(U=>{U.Neutral="N",U.Cancel="C",U.Down="D"})(i||(i={}));let s=!0,h=800,u="N",g;try{document.createEvent("TouchEvent"),T.setClickMode("T"),s=!1}catch{}const y=()=>{g&&(clearTimeout(g),g=void 0)},C=(U,nt,ot)=>{const At=tt.hitTest(U,nt,ot);At&&S.handleAction(At)},B=U=>{C(U.pageX,U.pageY,U.button)},$=U=>{U.touches.length>1?(u="C",y()):u==="N"&&(u="D",g=setTimeout(()=>{u="C";const nt=U.touches[0];C(nt.pageX,nt.pageY,it.ForceRight),g=void 0},h))},Y=U=>{if(u==="D"){if(y(),u="N",U.changedTouches.length>0){const nt=U.changedTouches[0];C(nt.pageX,nt.pageY,it.Left)}}else U.touches.length===0&&(u="N")},J=document.getElementById("solforge");s?(J.addEventListener("click",B),J.addEventListener("contextmenu",U=>(U.preventDefault(),B(U),!1))):(J.addEventListener("touchstart",$),J.addEventListener("touchend",Y)),window.sfapi={details:U=>{jt.init(U)},setLog:U=>{at.setLog(U)},peekAll:()=>{at.peekAllCards()},peekDeck:()=>{at.peekDecks()},peekField:()=>{console.log(f.field)},dumb:()=>{console.log("Am I dumb? "+at.dumb)},debug:()=>{T.toggleDebug()}},T.restoreOptions(),T.options.scale!=="100"&>.changeScale(T.options.scale),gt.drawAll(),new Zs().makeReport()}})(); +(function(){"use strict";const Se=["A","N","T","U"];const le=["C","R","H","L"];const Mt=[{c:"AAK",f:"T",r:"L",s:1,t:"C",ds:["AH"]},{c:"ABB",f:"N",r:"R",s:4,t:"C",dp:["SL"],ds:["RG","ZB"]},{c:"ABM",f:"N",r:"C",s:5,t:"C",dp:["AB"]},{c:"AGC",f:"A",r:"C",s:1,t:"C",ds:["AR"]},{c:"AGK",f:"A",r:"L",s:2.1,t:"C",dp:["AR"]},{c:"AGP",f:"A",r:"C",s:1.1,t:"S",ds:["AR"]},{c:"AGW",f:"A",r:"R",s:4,t:"S",dp:["AH"],ds:["AR","MV"]},{c:"ASG",f:"T",r:"R",s:1,t:"S",ds:["MV","SP","LV"]},{c:"AMS",f:"A",r:"H",s:5,t:"C",dp:["MM"],ds:["MV"]},{c:"AFO",f:"A",r:"C",s:2.1,t:"C",dp:["LV"],ds:["SP"]},{c:"ATG",f:"A",r:"C",s:2,t:"C",dp:["SP"],ds:["AR","RB"]},{c:"ART",f:"U",r:"H",s:2.1,t:"C",dp:["MU","SP","PL"]},{c:"ATP",f:"U",r:"H",s:3,t:"C",dn:["SP","CD"]},{c:"AGM",f:"T",r:"L",s:2.2,t:"C",dp:["XA"],ds:["RG","AR","MV"]},{c:"ALG",f:"A",r:"R",s:1,t:"C",ds:["AH"]},{c:"AHL",f:"A",r:"H",s:1,t:"C",dp:["HL"],ds:["RB"]},{c:"ALS",f:"A",r:"H",s:2,t:"C",ds:["AH","MV"]},{c:"AAA",f:"A",r:"L",s:5.1,t:"C",dp:["HL"],dn:["FC","AG","BN"]},{c:"ABE",f:"A",r:"H",s:5.1,t:"S",ds:["HL","TD"],dn:["GW"]},{c:"ATZ",f:"A",r:"C",s:4,t:"S",ds:["FR","AL","SP"]},{c:"AEC",f:"U",r:"L",s:5,t:"S",ds:["GW"]},{c:"ARB",f:"A",r:"H",s:4,t:"C",ds:["AR","RB"],dn:["TK","LZ"]},{c:"AEN",f:"A",r:"C",s:2,t:"C",dp:[],ds:["RB","AR"],dn:[]},{c:"APM",f:"A",r:"H",s:2,t:"C",dp:["MA","LV"],ds:["SP"]},{c:"AQE",f:"T",r:"C",s:1,t:"S",ds:["HR"]},{c:"AGD",f:"U",r:"L",s:1,t:"C",dp:["LG"],ds:["DR"]},{c:"AFS",f:"A",r:"L",s:1,t:"C",dp:["RB"],ds:["FR","VT"]},{c:"AMD",f:"T",r:"H",s:5,t:"C",dp:["FC"],ds:["AG"]},{c:"ABR",f:"T",r:"C",s:2,t:"C",dp:["FC"]},{c:"AFR",f:"T",r:"H",s:3.1,t:"C",dp:["MT","SP"],ds:["CS"]},{c:"AMY",f:"T",r:"C",s:1,t:"C",dp:["FC"]},{c:"ABL",f:"T",r:"R",s:1,t:"S",ds:["FC"]},{c:"ATT",f:"T",r:"L",s:4.1,t:"C",ds:["FC","AG","AS"]},{c:"AGU",f:"T",r:"R",s:2.1,t:"C",ds:["WL","MV"]},{c:"AIV",f:"T",r:"H",s:1,t:"C",dp:["MT"],ds:["RK"]},{c:"BRS",f:"A",r:"C",s:5,t:"C",dn:["FC","AG","BN"]},{c:"BTB",f:"A",r:"R",s:5,t:"C",dp:["AR"],ds:["RB","DI"]},{c:"BTH",f:"U",r:"R",s:3,t:"C",ds:["DI","CS"]},{c:"BTI",f:"A",r:"C",s:4,t:"C",ds:["MM","AL"]},{c:"BTN",f:"A",r:"H",s:1,t:"C",ds:["NX","AH"]},{c:"BBB",f:"U",r:"H",s:4,t:"C",ds:["CS","UD"]},{c:"BLH",f:"T",r:"L",s:2,t:"C",dp:["SP"],ds:["AG","TK","GW","SF"]},{c:"BFT",f:"N",r:"C",s:5,t:"S",dp:["UD"]},{c:"BSP",f:"N",r:"C",s:2.2,t:"C",ds:["RK"]},{c:"BWK",f:"N",r:"R",s:1,t:"C",ds:["RV","ZB"]},{c:"BLW",f:"N",r:"R",s:3,t:"C",ds:["ZB","CS"]},{c:"BZS",f:"T",r:"C",s:5,t:"C",ds:["MV","FC"]},{c:"BSR",f:"N",r:"R",s:1,t:"C",ds:["AB","RV"]},{c:"BMY",f:"T",r:"H",s:2.1,t:"C",ds:["MV"]},{c:"BSW",f:"T",r:"C",s:3,t:"C",ds:["MS"]},{c:"BWW",f:"T",r:"H",s:4,t:"C",ds:["MV"]},{c:"BTM",f:"U",r:"H",s:1,t:"S",ds:["PL","RV","RP"]},{c:"BAW",f:"U",r:"R",s:2,t:"C",ds:["FC"]},{c:"BWG",f:"U",r:"C",s:1,t:"C",ds:["PL"]},{c:"BTR",f:"U",r:"H",s:3.1,t:"C",dp:["MU"],ds:["CS","FR"]},{c:"BWD",f:"U",r:"C",s:2,t:"C",ds:["PL","GW","SF","TK"]},{c:"BSG",f:"A",r:"L",s:1,t:"C",ds:["RB","MV","AR"]},{c:"BSS",f:"A",r:"L",s:1,t:"C",dp:["RB"],ds:["AR"]},{c:"BTS",f:"U",r:"C",s:1.1,t:"C",ds:["PL","TK","GW"]},{c:"BST",f:"T",r:"L",s:4,t:"C",dp:["RP"],ds:["MS"]},{c:"BWT",f:"U",r:"L",s:4.2,t:"C",dp:["DI"],ds:["RP","HR"]},{c:"BRH",f:"N",r:"R",s:5,t:"C",ds:["AB"]},{c:"BWH",f:"A",r:"R",s:1,t:"S",dp:["AR"]},{c:"BRN",f:"T",r:"R",s:3,t:"S",ds:["BN","TD"]},{c:"BZD",f:"N",r:"R",s:2,t:"C",dp:["QT"],ds:["DR","RG","MV"]},{c:"BFM",f:"N",r:"H",s:2.3,t:"C",dp:["QT"],ds:["MV","AL"]},{c:"BSM",f:"T",r:"H",s:2,t:"C",dp:["QN"],ds:["RV","AG"]},{c:"CKB",f:"N",r:"H",s:5,t:"C",ds:["RV"]},{c:"CDT",f:"U",r:"R",s:1,t:"C",ds:["PL","PS"]},{c:"CMF",f:"N",r:"R",s:4,t:"C",ds:["AS"]},{c:"CTL",f:"T",r:"L",s:1,t:"S",ds:["XA"]},{c:"CCS",f:"N",r:"C",s:3,t:"C",ds:["RG"]},{c:"CHY",f:"U",r:"C",s:1,t:"C",ds:["RG"]},{c:"CSR",f:"U",r:"C",s:5,t:"C",ds:["PS"]},{c:"CHV",f:"N",r:"L",s:2,t:"C",ds:["MV","RV"]},{c:"CRS",f:"A",r:"R",s:3,t:"C",dp:["MM"],ds:["LV"],dn:[]},{c:"COD",f:"T",r:"R",s:4,t:"S",dp:["UD"],dn:["GW"]},{c:"CTI",f:"N",r:"C",s:1.1,t:"C",dp:["AL"],ds:["AB"]},{c:"CHA",f:"U",r:"R",s:2.1,t:"C",dn:["MV"]},{c:"CHH",f:"U",r:"C",s:2,t:"C",dp:["GW"]},{c:"CHR",f:"U",r:"L",s:1,t:"C",ds:["PL","MS","LV","RG"]},{c:"CBB",f:"T",r:"C",s:3,t:"C",dp:["UD"]},{c:"CDC",f:"T",r:"C",s:2,t:"C",ds:["WL"]},{c:"CFB",f:"T",r:"H",s:1,t:"C",ds:["FC"]},{c:"CNM",f:"T",r:"C",s:2,t:"C"},{c:"CSW",f:"T",r:"L",s:2.3,t:"C",ds:["DR","MV"]},{c:"CTG",f:"A",r:"C",s:3,t:"C",ds:["RB","WL"]},{c:"CCT",f:"T",r:"R",s:2,t:"C",ds:["MV","FC"]},{c:"CFG",f:"T",r:"C",s:2,t:"S"},{c:"CGL",f:"N",r:"H",s:3,t:"C",dp:["AB"],ds:["FR"]},{c:"CSU",f:"N",r:"R",s:1,t:"S",ds:["FR"]},{c:"CCR",f:"N",r:"C",s:1,t:"C",dp:["SF"],ds:["AB","LZ"]},{c:"CSB",f:"N",r:"C",s:2,t:"C",ds:["ZB","TK","VG"]},{c:"CNT",f:"A",r:"R",s:5,t:"S",ds:["AL","AH"]},{c:"CWK",f:"T",r:"C",s:3,t:"C",ds:["DI","MV"]},{c:"CRC",f:"A",r:"R",s:2,t:"C",ds:["RB","RK","WL"]},{c:"CYC",f:"N",r:"H",s:2,t:"C",dp:["MN","SP"],ds:["BN","LG"]},{c:"CYS",f:"N",r:"C",s:4,t:"C",ds:["TK","VG"]},{c:"CTW",f:"N",r:"C",s:1,t:"S",dp:["AL"],ds:["RV"]},{c:"CTV",f:"U",r:"H",s:1,t:"S",dp:["PL"],ds:["RP"]},{c:"CAG",f:"A",r:"R",s:1,t:"S",ds:["NX","FR","LV"]},{c:"CBS",f:"A",r:"C",s:2.1,t:"S",dp:["MA"],ds:["AH","AR"]},{c:"CIN",f:"A",r:"R",s:1.1,t:"C",dp:["AH"]},{c:"CSH",f:"A",r:"C",s:3,t:"C",ds:["AR"]},{c:"CSG",f:"A",r:"C",s:2,t:"S",ds:["AR"]},{c:"DFR",f:"N",r:"H",s:2,t:"C",dp:["AL"]},{c:"DHW",f:"N",r:"R",s:1,t:"C",dp:["SP"],ds:["RG"]},{c:"DSS",f:"N",r:"R",s:1,t:"C",dp:["MN"],ds:["ZB"]},{c:"DCR",f:"N",r:"R",s:2,t:"S",ds:["RV"]},{c:"DSK",f:"N",r:"C",s:1,t:"C",ds:["TK","SF","VG"]},{c:"DBA",f:"U",r:"H",s:1,t:"C",dp:["GW"]},{c:"DBP",f:"U",r:"C",s:1,t:"C",ds:["UD"]},{c:"DMR",f:"U",r:"C",s:2,t:"C",ds:["DI"]},{c:"DBR",f:"U",r:"C",s:1,t:"C"},{c:"DCS",f:"A",r:"L",s:2,t:"C",ds:["LV"]},{c:"DDF",f:"U",r:"R",s:5,t:"S",ds:["RP","UD","TD"]},{c:"DGZ",f:"A",r:"R",s:2,t:"S",ds:["AL"],dn:["GW"]},{c:"DBN",f:"N",r:"C",s:4,t:"C",ds:["AL"]},{c:"DDS",f:"A",r:"H",s:4.2,t:"S",dp:["QN"],ds:["AL"]},{c:"DIS",f:"T",r:"R",s:1,t:"S",ds:["BN"]},{c:"DSV",f:"U",r:"R",s:2,t:"S",dp:["PS"],ds:["FR"]},{c:"DDD",f:"N",r:"L",s:1,t:"C",ds:["MV","RV","DR"]},{c:"DPB",f:"A",r:"L",s:5.2,t:"C",ds:["RB","RP"]},{c:"DZD",f:"U",r:"L",s:3,t:"C",dp:["MS"],ds:["AG"]},{c:"DRE",f:"T",r:"L",s:5,t:"S",ds:["BN"]},{c:"DGW",f:"T",r:"L",s:5.2,t:"S",dp:["DR"],ds:["AG","TK"]},{c:"DBT",f:"N",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"DFB",f:"N",r:"R",s:1,t:"C",dp:["AB"],ds:["BN","SF","LZ"]},{c:"DMW",f:"A",r:"L",s:1.1,t:"C",dp:["MM","CD"],ds:["AH"]},{c:"DCH",f:"U",r:"C",s:1,t:"S",ds:["LG"]},{c:"DTD",f:"N",r:"L",s:4.2,t:"C",dp:["DR"],ds:["MV"]},{c:"DSZ",f:"N",r:"C",s:2,t:"C",ds:["ZB","RG"]},{c:"DYB",f:"U",r:"R",s:2,t:"S",dp:["GW","TK"]},{c:"DBQ",f:"N",r:"H",s:3,t:"C",dp:["QU"],ds:["TK","RV","PS"]},{c:"DYS",f:"N",r:"R",s:3,t:"S",dp:["QU"]},{c:"DYL",f:"U",r:"L",s:3,t:"C",dp:["QN","LG"],ds:["TK"]},{c:"EBW",f:"N",r:"C",s:3,t:"C",dp:["UD"]},{c:"ESK",f:"N",r:"H",s:2,t:"C",dp:["RK"],ds:["UD"]},{c:"EHW",f:"U",r:"L",s:1,t:"C",ds:["GW","TK"]},{c:"ETN",f:"A",r:"C",s:1,t:"S",ds:["AL"]},{c:"EWE",f:"T",r:"H",s:2,t:"C",dp:["MV"]},{c:"ENP",f:"A",r:"H",s:1,t:"S",ds:["FR","WL"]},{c:"ESU",f:"A",r:"R",s:1,t:"S",ds:["CD","TD","FR"]},{c:"ENR",f:"U",r:"C",s:1,t:"S"},{c:"EPD",f:"N",r:"H",s:1,t:"S",dn:["GW"]},{c:"EPH",f:"A",r:"L",s:4.2,t:"C",dp:["CD"],ds:["TK"]},{c:"ESG",f:"A",r:"H",s:4.1,t:"C",dp:["QU","LV"],ds:["TK","GW"]},{c:"ESC",f:"A",r:"H",s:2,t:"C",dp:["QU"],ds:["RB","TK","GW","AR"]},{c:"ESP",f:"U",r:"H",s:2.3,t:"C",dp:["QA"],ds:["AR","HR"]},{c:"EWT",f:"U",r:"R",s:2,t:"C",dp:["QA"],ds:["AR"]},{c:"EHN",f:"U",r:"C",s:1,t:"C",ds:["TK","GW"]},{c:"EFA",f:"T",r:"R",s:5,t:"S",ds:["MV"]},{c:"EFM",f:"T",r:"L",s:2.1,t:"C",dp:["FC","SP"],ds:["FR"]},{c:"EFP",f:"T",r:"L",s:1,t:"C",dp:["RK"],ds:["MV","TK","VG"]},{c:"EFE",f:"U",r:"L",s:5.2,t:"C",ds:["PL","TK","GW","UD"]},{c:"EXD",f:"N",r:"H",s:1,t:"S",ds:["LG","BN","SF"]},{c:"FWB",f:"U",r:"C",s:2.3,t:"C"},{c:"FWR",f:"U",r:"C",s:1,t:"C"},{c:"FFG",f:"U",r:"C",s:4,t:"C",ds:["DI"]},{c:"FST",f:"N",r:"R",s:4,t:"C",ds:["ZB","TK","VG"]},{c:"FWK",f:"N",r:"C",s:1,t:"C",ds:["ZB","TK","VG"]},{c:"FIN",f:"U",r:"C",s:1,t:"S",ds:["FC"]},{c:"FRR",f:"U",r:"H",s:1,t:"S",dp:["GW"]},{c:"FVA",f:"T",r:"H",s:1,t:"S",ds:["MV"]},{c:"FFU",f:"T",r:"H",s:1,t:"C",ds:["YT"]},{c:"FLH",f:"T",r:"C",s:4,t:"C",ds:["AS"]},{c:"FMS",f:"T",r:"C",s:2,t:"C",ds:["MV"]},{c:"FSM",f:"T",r:"H",s:1,t:"S",ds:["MS"],dn:["GW"]},{c:"FBC",f:"T",r:"L",s:1,t:"C",dp:["FC"],dn:["GW"]},{c:"FBI",f:"T",r:"H",s:2.2,t:"C",dp:["MT","SP"]},{c:"FFS",f:"T",r:"R",s:2,t:"C",ds:["AH"]},{c:"FJT",f:"T",r:"C",s:5,t:"S",dp:["UD"]},{c:"FLN",f:"T",r:"R",s:2,t:"S",ds:["BN"]},{c:"FRI",f:"T",r:"C",s:3,t:"C",dp:["WL"]},{c:"FSS",f:"T",r:"R",s:1,t:"C",dp:["MT"],ds:["BN"]},{c:"FLS",f:"T",r:"C",s:1,t:"C",dp:["SP"],ds:["BN"]},{c:"FSH",f:"T",r:"R",s:1,t:"C",ds:["AG","FC"]},{c:"FFD",f:"N",r:"H",s:1,t:"C",ds:["AB","TK","VG"]},{c:"FRV",f:"N",r:"H",s:3,t:"C",ds:["AB","RV","CS"]},{c:"FSP",f:"A",r:"L",s:1,t:"C",ds:["UD"]},{c:"FPR",f:"T",r:"C",s:2.1,t:"C"},{c:"FFL",f:"A",r:"C",s:1,t:"S",ds:["AR"]},{c:"FGA",f:"A",r:"C",s:1,t:"C",ds:["RB","WL","VT"]},{c:"FGB",f:"A",r:"R",s:1,t:"C",ds:["RB","VT"]},{c:"FGD",f:"A",r:"H",s:3,t:"C",dp:["VT"],ds:["RB"]},{c:"FGG",f:"A",r:"H",s:1,t:"C",dp:["VT"],ds:["RB","TK"]},{c:"FOL",f:"A",r:"H",s:3.1,t:"C",dp:["MA"],ds:["CS"]},{c:"FPM",f:"A",r:"R",s:3,t:"C",ds:["RB","AR","CS"]},{c:"FPS",f:"A",r:"C",s:1,t:"C",ds:["RB","AR"]},{c:"FFM",f:"T",r:"H",s:3,t:"C",dp:["MV"]},{c:"FMD",f:"T",r:"L",s:3,t:"C",dp:["RK"],ds:["TK","GW","MV","DR"]},{c:"FSK",f:"T",r:"C",s:2.3,t:"S",ds:["AH"]},{c:"FWT",f:"U",r:"H",s:1,t:"C",ds:["UD","FR","GW"]},{c:"FZS",f:"T",r:"R",s:1,t:"S",ds:["RV"]},{c:"GOS",f:"A",r:"L",s:4,t:"S",dp:["AR"]},{c:"GHS",f:"U",r:"C",s:2.2,t:"C",dp:["GW"],ds:["PL","SQ","LG"]},{c:"GHB",f:"U",r:"R",s:1,t:"C",ds:["DI","RV"]},{c:"GHR",f:"U",r:"H",s:4.2,t:"C",dp:["QT"],ds:["FC","LG","MV","DI"]},{c:"GRN",f:"N",r:"C",s:2,t:"S",ds:["RG"]},{c:"GTH",f:"N",r:"C",s:1,t:"S"},{c:"GSC",f:"U",r:"C",s:1,t:"C",ds:["PS"]},{c:"GMP",f:"A",r:"L",s:1,t:"C",ds:["MM","CD"]},{c:"GTT",f:"T",r:"L",s:2,t:"C",dp:["RK"],ds:["RV"]},{c:"GCL",f:"T",r:"C",s:1,t:"C",ds:["WL"]},{c:"GCR",f:"T",r:"C",s:2,t:"S",ds:["FR","BN"],dn:["WL","SQ"]},{c:"GLF",f:"N",r:"C",s:2,t:"C",ds:["AB"]},{c:"GRW",f:"N",r:"C",s:1,t:"C",dp:["AL"],ds:["RV"]},{c:"GSW",f:"N",r:"C",s:2,t:"C"},{c:"GVS",f:"U",r:"C",s:2,t:"C",ds:["VG","LG"]},{c:"GSS",f:"U",r:"C",s:1,t:"C",ds:["LG"]},{c:"GBG",f:"N",r:"C",s:1,t:"C",ds:["AB","VG","BN"]},{c:"GGE",f:"N",r:"C",s:2,t:"C"},{c:"GGH",f:"N",r:"C",s:1,t:"C",ds:["ZB","RG"]},{c:"GRP",f:"N",r:"R",s:1,t:"S",dp:["SF"],ds:["RV","FR"]},{c:"GGD",f:"N",r:"L",s:1,t:"C"},{c:"GGR",f:"N",r:"L",s:3,t:"C",ds:["SF","MV"]},{c:"GGP",f:"N",r:"H",s:1,t:"C",dp:["RV"],ds:["MV"]},{c:"GGS",f:"N",r:"C",s:1,t:"C",ds:["MV"]},{c:"GRM",f:"N",r:"R",s:2,t:"S",ds:["GW"],dn:["GW"]},{c:"GHT",f:"U",r:"C",s:1,t:"C"},{c:"GMR",f:"U",r:"C",s:1,t:"C",ds:["TK","VG","PL"]},{c:"HMF",f:"T",r:"H",s:3,t:"C",ds:["YT","MV"]},{c:"HTR",f:"U",r:"L",s:1,t:"C",ds:["RG","SQ","PL"]},{c:"HAR",f:"A",r:"C",s:1,t:"C",ds:["AH"]},{c:"HFA",f:"N",r:"H",s:1,t:"C",dp:["MN"],ds:["AB","RG"]},{c:"HOD",f:"T",r:"R",s:3,t:"C",ds:["BN"],dn:["TK","LZ"]},{c:"HWM",f:"A",r:"L",s:1,t:"C",dp:["AH"],ds:["MV","RG","AR"]},{c:"HOX",f:"N",r:"R",s:4,t:"S",dp:["UD"],ds:["BN","LG"]},{c:"HGS",f:"N",r:"R",s:1,t:"S",ds:["AH","AL"]},{c:"HTP",f:"U",r:"C",s:1,t:"C",ds:["TK","GW"]},{c:"IBF",f:"T",r:"R",s:1,t:"S",ds:["HR","GW"]},{c:"ITO",f:"T",r:"R",s:2,t:"S",ds:["FR","FC"]},{c:"IME",f:"N",r:"L",s:5,t:"S",ds:["TK","GW"]},{c:"IVS",f:"N",r:"C",s:4,t:"S",ds:["RG","SL"]},{c:"ICD",f:"N",r:"L",s:5,t:"C",dp:["RG"],ds:["VG","MV"]},{c:"IWC",f:"A",r:"C",s:1,t:"C",ds:["RB","MV"]},{c:"IHA",f:"A",r:"L",s:2,t:"C",ds:["AR","AL"]},{c:"IBR",f:"A",r:"C",s:3,t:"C",dp:["UD"],ds:["AH"]},{c:"IMD",f:"A",r:"L",s:3,t:"C",ds:["RB","BN","MS"]},{c:"IMA",f:"A",r:"L",s:2.3,t:"C",dp:["CD"],ds:["FR"]},{c:"IZK",f:"T",r:"L",s:3,t:"C",ds:["FC","RP","BN"]},{c:"JPK",f:"A",r:"C",s:1,t:"S",dp:["UD"],ds:["AH","MV","FC"]},{c:"KDC",f:"T",r:"C",s:3,t:"C"},{c:"KAW",f:"T",r:"L",s:1.1,t:"C",dp:["SP"],ds:["XA"]},{c:"KOD",f:"N",r:"L",s:1,t:"C",dp:["LZ"],ds:["ZB"]},{c:"KBE",f:"U",r:"H",s:5,t:"C",ds:["PS","MV"]},{c:"KIW",f:"A",r:"L",s:3,t:"C",dp:["LV"]},{c:"KTS",f:"U",r:"H",s:4,t:"C",dp:["RP"],ds:["TK"]},{c:"KKK",f:"T",r:"L",s:2,t:"C",ds:["AG","FC"]},{c:"LOD",f:"U",r:"L",s:4,t:"S",ds:["PS"]},{c:"LFA",f:"T",r:"H",s:4,t:"C",ds:["FC","AH"]},{c:"LKP",f:"U",r:"L",s:1,t:"C",ds:["PL","TK"]},{c:"LGT",f:"N",r:"R",s:2.3,t:"C",dp:["SL"],ds:["ZB","RG"]},{c:"LLD",f:"N",r:"H",s:5,t:"C",dn:["FR"]},{c:"LLG",f:"U",r:"H",s:5,t:"C",dn:["MV"]},{c:"LLS",f:"A",r:"H",s:5,t:"C",ds:["RB"],dn:["TK","LZ"]},{c:"LLT",f:"T",r:"H",s:5,t:"C",dn:["LG"]},{c:"LBD",f:"U",r:"H",s:1,t:"C",dp:["GW"]},{c:"LSS",f:"U",r:"R",s:1,t:"C",dp:["MU"],ds:["UD"]},{c:"LBL",f:"U",r:"R",s:1,t:"C",ds:["LG"]},{c:"LBR",f:"T",r:"C",s:1,t:"S",dp:["FC"],ds:["AG"]},{c:"LSK",f:"T",r:"C",s:1,t:"S",ds:["BN"]},{c:"LWY",f:"T",r:"C",s:1,t:"C",ds:["AG"]},{c:"LSP",f:"A",r:"C",s:1,t:"C",dp:["AH"],ds:["AR"]},{c:"LCE",f:"A",r:"L",s:5,t:"S",ds:["CD"]},{c:"LUC",f:"T",r:"L",s:4.2,t:"C",dp:["MV"],ds:["XA","YT"]},{c:"LMV",f:"N",r:"L",s:1,t:"C",ds:["TK","LZ","GW"]},{c:"LHY",f:"U",r:"C",s:2,t:"C",ds:["RG"]},{c:"LYR",f:"U",r:"C",s:4,t:"S",ds:["LG","HR"]},{c:"LYS",f:"U",r:"R",s:3,t:"S",ds:["TD"]},{c:"MMH",f:"T",r:"C",s:1,t:"C"},{c:"MHR",f:"U",r:"L",s:5.1,t:"C",dp:["PS"],ds:["YT"]},{c:"MRF",f:"N",r:"C",s:1,t:"C"},{c:"MOE",f:"T",r:"H",s:1,t:"C",dp:["SP"],ds:["FR"]},{c:"MXW",f:"A",r:"C",s:1,t:"C",ds:["RB","AH"]},{c:"MSP",f:"U",r:"R",s:2,t:"S",ds:["LG"]},{c:"MMA",f:"A",r:"C",s:1,t:"C",ds:["CD","MM"]},{c:"MMR",f:"A",r:"C",s:5,t:"C",dp:["MM"],ds:["CD"]},{c:"MMX",f:"A",r:"C",s:2,t:"C",ds:["MM","CD","VG"]},{c:"MMI",f:"A",r:"C",s:4,t:"C",ds:["MM"]},{c:"MMO",f:"A",r:"C",s:2,t:"C",ds:["MM"]},{c:"MMV",f:"A",r:"C",s:2.2,t:"C",ds:["MM","CD","RK"]},{c:"MPH",f:"U",r:"H",s:3,t:"S",ds:["RK","DR","RV","RP","TK","MV"]},{c:"MSC",f:"A",r:"H",s:1,t:"S",ds:["NT","FR"]},{c:"MTS",f:"A",r:"C",s:1.1,t:"S",ds:["LV","FR"]},{c:"MTT",f:"A",r:"C",s:2,t:"S",ds:["LV","AL"]},{c:"MML",f:"U",r:"H",s:2,t:"C",ds:["TK","GW","PL"]},{c:"MMW",f:"U",r:"L",s:2.2,t:"C",ds:["TK","GW"]},{c:"MDE",f:"N",r:"C",s:4,t:"C",ds:["AS","LG","BN"]},{c:"MBP",f:"U",r:"H",s:1,t:"C",ds:["HR","PL"]},{c:"MND",f:"A",r:"R",s:1,t:"C",ds:["RB","SQ","AH"]},{c:"NNS",f:"A",r:"R",s:3,t:"S",ds:["NT","AL"]},{c:"NGB",f:"T",r:"C",s:1,t:"C",ds:["HR"]},{c:"NGW",f:"T",r:"C",s:4,t:"C"},{c:"NSL",f:"U",r:"R",s:1,t:"S",dp:["GW"],ds:["RV"]},{c:"NCF",f:"N",r:"C",s:4,t:"S",ds:["FR"]},{c:"NCM",f:"N",r:"H",s:5,t:"C",ds:["MS","TK","RG","GW"]},{c:"NCS",f:"N",r:"R",s:1,t:"C"},{c:"NCW",f:"N",r:"C",s:1,t:"C"},{c:"NCV",f:"N",r:"C",s:1,t:"S",ds:["RG"]},{c:"NSW",f:"N",r:"L",s:3,t:"C",dp:["SF"],ds:["SQ","TK","GW"]},{c:"NEM",f:"N",r:"C",s:1,t:"S",ds:["LG","BN"]},{c:"NSH",f:"N",r:"L",s:2.3,t:"S",ds:["DR","RV","MV"],dn:["GW"]},{c:"NXA",f:"A",r:"L",s:3.1,t:"C",ds:["NX","AH","AR","MV"]},{c:"NXC",f:"A",r:"C",s:1,t:"C",ds:["RB","WL"]},{c:"NXG",f:"A",r:"H",s:3,t:"C",dp:["NX"],ds:["AH"]},{c:"NXO",f:"A",r:"C",s:5,t:"C",dp:["NX"],ds:["LV"]},{c:"NXP",f:"A",r:"C",s:1,t:"C",dp:["NX"]},{c:"NXT",f:"A",r:"H",s:2,t:"C",dp:["NX"],ds:["AR"]},{c:"NGT",f:"N",r:"R",s:2,t:"C",ds:["RG"]},{c:"NGQ",f:"U",r:"L",s:4.1,t:"C",dp:["RP"],ds:["TK","GW","PL"]},{c:"NCL",f:"U",r:"R",s:1.1,t:"S",ds:["PS"],dn:["GW"]},{c:"NFF",f:"U",r:"L",s:2,t:"C",dp:["PL"],ds:["RP","SQ","TK"]},{c:"NAM",f:"N",r:"C",s:3,t:"C"},{c:"NOZ",f:"N",r:"R",s:2,t:"C",ds:["TK","VG"]},{c:"NSY",f:"N",r:"C",s:2.1,t:"C",ds:["RG"]},{c:"ONN",f:"N",r:"H",s:1.1,t:"S",dp:["ZB"]},{c:"OXA",f:"A",r:"H",s:2.3,t:"C",dp:["QN"],ds:["LV","SQ","RG"]},{c:"OXM",f:"A",r:"R",s:2,t:"C",dp:["QN"],ds:["RG","AR"]},{c:"OXP",f:"N",r:"H",s:2,t:"C",dp:["QA"],ds:["RG","AL","SQ"]},{c:"OBB",f:"T",r:"R",s:3,t:"S",dp:["QA"],ds:["LV"]},{c:"OEX",f:"A",r:"H",s:3,t:"S",dp:["QT"],ds:["FC","AH"],dn:["GW"]},{c:"OWH",f:"T",r:"H",s:3,t:"C",dp:["QA"],ds:["FC","MV","LV"]},{c:"OBD",f:"A",r:"H",s:1,t:"C",ds:["AR","RB"]},{c:"OFM",f:"A",r:"R",s:2.1,t:"C",ds:["AH"]},{c:"OJC",f:"A",r:"H",s:1.1,t:"C",ds:["AL"],dn:["TK","LZ"]},{c:"OPK",f:"A",r:"R",s:2,t:"C",ds:["RB","AR"]},{c:"OSV",f:"A",r:"H",s:4,t:"C",dp:["RP"],ds:["AR","RB"]},{c:"OSS",f:"A",r:"C",s:5,t:"S",dp:["UD"],ds:["AR"]},{c:"OWW",f:"A",r:"L",s:1,t:"C",ds:["RB"]},{c:"OHV",f:"N",r:"R",s:2,t:"C",ds:["AB","RV"]},{c:"ODC",f:"U",r:"L",s:2,t:"C",ds:["LG"]},{c:"OSP",f:"N",r:"R",s:2,t:"C",ds:["RG"]},{c:"OSL",f:"U",r:"C",s:3,t:"C",ds:["PL"]},{c:"OWF",f:"A",r:"H",s:2,t:"S",ds:["AH","GW"]},{c:"OXS",f:"U",r:"R",s:1,t:"C",ds:["DI"],dn:["AR"]},{c:"PHM",f:"A",r:"R",s:2,t:"C",ds:["AL"],dn:["GW"]},{c:"PPM",f:"A",r:"R",s:1,t:"C",ds:["AL","SQ"]},{c:"PSM",f:"A",r:"L",s:2.2,t:"C",dp:["NX"],ds:["MV","TK"]},{c:"PLW",f:"A",r:"R",s:4,t:"S",dp:["UD"],ds:["AL"],dn:["GW"]},{c:"PRG",f:"N",r:"C",s:4,t:"C"},{c:"PRI",f:"A",r:"R",s:3,t:"S",dp:["LV"],ds:["TD"]},{c:"PHS",f:"A",r:"R",s:2.2,t:"C",dp:["AR"]},{c:"PTB",f:"U",r:"H",s:1,t:"S",ds:["PL","TK","GW"]},{c:"PSC",f:"U",r:"R",s:2,t:"C",ds:["PS","SQ"]},{c:"PSH",f:"N",r:"H",s:4,t:"C",ds:["RK","LZ","TK"]},{c:"PTR",f:"A",r:"R",s:2,t:"S",ds:["AH","FR"]},{c:"PSG",f:"U",r:"R",s:1,t:"S",ds:["FR"]},{c:"PMI",f:"T",r:"H",s:5.1,t:"C",ds:["BN"]},{c:"PMS",f:"T",r:"C",s:1,t:"S",ds:["AH"]},{c:"POX",f:"N",r:"H",s:4.2,t:"C",dp:["UD"],ds:["TK","VG","AB"]},{c:"PYG",f:"T",r:"H",s:1,t:"C",dp:["FC"],ds:["AG"]},{c:"PYS",f:"T",r:"C",s:1.1,t:"S",dp:["GW"],dn:["GW"]},{c:"RBH",f:"T",r:"L",s:1,t:"C",dp:["FC"]},{c:"ROK",f:"T",r:"L",s:3.1,t:"S",dp:["MT"],ds:["TD"]},{c:"RHY",f:"U",r:"C",s:3,t:"C",ds:["RG"]},{c:"RTS",f:"T",r:"C",s:2.2,t:"C",ds:["MV","FC","DI"]},{c:"RLW",f:"U",r:"H",s:1,t:"C",dp:["WD"]},{c:"RHU",f:"A",r:"L",s:4.1,t:"C",ds:["RP","WL"]},{c:"RFL",f:"T",r:"R",s:1,t:"C",dp:["FC"]},{c:"RHC",f:"T",r:"C",s:1,t:"C",ds:["MV"]},{c:"ROG",f:"N",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"RWC",f:"U",r:"C",s:4,t:"C",dp:[],ds:["DI"],dn:[]},{c:"RFA",f:"U",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"RWD",f:"N",r:"C",s:5,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"RSE",f:"T",r:"H",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"RBG",f:"U",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"RGG",f:"U",r:"H",s:1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"RSZ",f:"N",r:"R",s:1.1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"RSP",f:"T",r:"R",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"RHW",f:"N",r:"C",s:3,t:"C",dp:["WD"],ds:[],dn:[]},{c:"SBF",f:"T",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SAP",f:"A",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SVO",f:"U",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"SSE",f:"U",r:"L",s:2.1,t:"C",dp:[],ds:["PL"],dn:[]},{c:"STS",f:"U",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SCS",f:"N",r:"C",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"SMD",f:"T",r:"L",s:1,t:"C",dp:[],ds:["DR"],dn:[]},{c:"SFS",f:"N",r:"L",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"SHY",f:"N",r:"C",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SCD",f:"A",r:"H",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SFT",f:"A",r:"H",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SOC",f:"N",r:"L",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"SOA",f:"A",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SOD",f:"U",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SOK",f:"T",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SOT",f:"N",r:"C",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SAD",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SHG",f:"N",r:"L",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SBI",f:"U",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"SCC",f:"U",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SPB",f:"U",r:"L",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SPD",f:"U",r:"R",s:1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SPM",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STD",f:"A",r:"H",s:2.2,t:"C",dp:[],ds:["MM"],dn:[]},{c:"STB",f:"T",r:"C",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"SHS",f:"U",r:"R",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"SGF",f:"N",r:"H",s:2.2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"SKG",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SSD",f:"T",r:"L",s:5,t:"C",dp:[],ds:["DR"],dn:[]},{c:"SDA",f:"U",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SSR",f:"U",r:"L",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SNB",f:"A",r:"C",s:2.3,t:"S",dp:[],ds:[],dn:[]},{c:"SNP",f:"A",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SRD",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SSH",f:"U",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SRM",f:"N",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SRH",f:"N",r:"C",s:2.3,t:"C",dp:["AB"],ds:[],dn:[]},{c:"SDN",f:"N",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SHV",f:"N",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SRP",f:"N",r:"L",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"SGG",f:"N",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SBA",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SKB",f:"A",r:"C",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SBR",f:"T",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SKS",f:"T",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SEL",f:"T",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"STM",f:"T",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SBD",f:"U",r:"C",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"SCV",f:"N",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SFM",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SSN",f:"A",r:"C",s:2.2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SSM",f:"T",r:"C",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"SLH",f:"N",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SRV",f:"N",r:"R",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"SSI",f:"A",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SND",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SNT",f:"N",r:"L",s:5.1,t:"C",dp:[],ds:[],dn:[]},{c:"STR",f:"N",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SPH",f:"N",r:"H",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"SSA",f:"N",r:"H",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"STO",f:"U",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SDR",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SOL",f:"U",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SOV",f:"T",r:"L",s:4,t:"S",dp:[],ds:["DR"],dn:[]},{c:"SHK",f:"T",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SWR",f:"A",r:"R",s:1,t:"C",dp:[],ds:["MM"],dn:[]},{c:"SMN",f:"T",r:"C",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SER",f:"A",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SES",f:"A",r:"L",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SFA",f:"A",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STG",f:"A",r:"L",s:2,t:"C",dp:[],ds:["DR","RB"],dn:[]},{c:"SSS",f:"A",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SSK",f:"A",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"SWG",f:"A",r:"C",s:4,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SWM",f:"A",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SIV",f:"U",r:"H",s:5.1,t:"S",dp:[],ds:[],dn:[]},{c:"STN",f:"T",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SGI",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SBG",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SCL",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SGA",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STP",f:"T",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"SSG",f:"U",r:"C",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SVH",f:"U",r:"C",s:2.3,t:"C",dp:[],ds:[],dn:[]},{c:"SIN",f:"U",r:"C",s:1.1,t:"S",dp:[],ds:[],dn:[]},{c:"SYL",f:"U",r:"H",s:2.2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"SEV",f:"N",r:"L",s:3.1,t:"C",dp:[],ds:[],dn:[]},{c:"SMA",f:"U",r:"C",s:5,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SML",f:"U",r:"C",s:1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SYO",f:"A",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TST",f:"T",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"TBA",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TGL",f:"U",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"TGS",f:"U",r:"C",s:2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TPT",f:"N",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"TDW",f:"N",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"TNL",f:"N",r:"L",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"TEX",f:"A",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TGN",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TSM",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TUP",f:"A",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TAB",f:"T",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TGI",f:"T",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TDS",f:"U",r:"L",s:1.1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"TSP",f:"T",r:"H",s:4.2,t:"S",dp:["DI"],ds:[],dn:[]},{c:"TPG",f:"N",r:"H",s:3.1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"TMG",f:"U",r:"R",s:3,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TMM",f:"U",r:"C",s:5,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TRA",f:"A",r:"R",s:5,t:"C",dp:[],ds:["MM"],dn:[]},{c:"TRS",f:"U",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TRV",f:"T",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TRW",f:"N",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TBB",f:"T",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TOB",f:"N",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TWS",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TVG",f:"A",r:"R",s:1.1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"TXB",f:"U",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"TXS",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TCG",f:"T",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"TWT",f:"A",r:"C",s:3,t:"C",dp:[],ds:["RB"],dn:[]},{c:"TRN",f:"T",r:"H",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"TGK",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TSL",f:"U",r:"H",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"TWG",f:"U",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"UGM",f:"U",r:"C",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"UGL",f:"T",r:"R",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UIC",f:"T",r:"H",s:2.3,t:"C",dp:[],ds:["DI"],dn:[]},{c:"ULR",f:"U",r:"H",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"URD",f:"N",r:"H",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"UBL",f:"T",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"UCM",f:"T",r:"R",s:1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UEM",f:"T",r:"C",s:4,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UHS",f:"T",r:"H",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UIM",f:"T",r:"C",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UWL",f:"T",r:"H",s:2,t:"C",dp:["YT"],ds:[],dn:[]},{c:"UWS",f:"T",r:"R",s:2.3,t:"C",dp:["YT"],ds:[],dn:[]},{c:"UIW",f:"A",r:"L",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"URS",f:"U",r:"C",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"UTM",f:"U",r:"C",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UTR",f:"U",r:"H",s:2,t:"C",dp:["DI"],ds:[],dn:[]},{c:"URB",f:"U",r:"L",s:2.3,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UPM",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VIK",f:"N",r:"L",s:5.2,t:"C",dp:[],ds:[],dn:[]},{c:"VRP",f:"N",r:"L",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"VBK",f:"A",r:"R",s:2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"VTC",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VTW",f:"A",r:"R",s:4,t:"C",dp:[],ds:["RB"],dn:[]},{c:"VGN",f:"N",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VND",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"VNF",f:"U",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"VNS",f:"U",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"VSK",f:"U",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"VCH",f:"U",r:"H",s:4.1,t:"S",dp:[],ds:[],dn:[]},{c:"VGR",f:"U",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"VGL",f:"N",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"VOB",f:"T",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"VCG",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VES",f:"N",r:"L",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"VYE",f:"N",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"WBY",f:"T",r:"R",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"WBU",f:"T",r:"C",s:1.1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"WMC",f:"A",r:"H",s:5,t:"C",dp:[],ds:["RB"],dn:[]},{c:"WMR",f:"A",r:"H",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"WTK",f:"A",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"WMM",f:"A",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WTW",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WTA",f:"U",r:"L",s:4,t:"C",dp:[],ds:["PL"],dn:[]},{c:"WWP",f:"U",r:"H",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WWR",f:"U",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"WOD",f:"U",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"WFM",f:"T",r:"H",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WWS",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WBH",f:"T",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WCS",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WPD",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WSE",f:"T",r:"L",s:5.1,t:"C",dp:[],ds:[],dn:[]},{c:"WFB",f:"N",r:"C",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WFS",f:"N",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WBG",f:"N",r:"L",s:1.1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"ZXR",f:"T",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"XCR",f:"N",r:"C",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XDH",f:"N",r:"R",s:3,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XHS",f:"N",r:"C",s:2.2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XHU",f:"N",r:"C",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XRF",f:"N",r:"C",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XSH",f:"N",r:"L",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XTR",f:"N",r:"H",s:5.1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XDV",f:"N",r:"H",s:1,t:"C",dp:["ZB"],ds:[],dn:[]},{c:"XRW",f:"N",r:"H",s:2,t:"S",dp:["ZB"],ds:[],dn:[]},{c:"YWC",f:"T",r:"C",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"YNS",f:"N",r:"L",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"ZPM",f:"T",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"ZTU",f:"N",r:"L",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZIN",f:"N",r:"C",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZMT",f:"N",r:"C",s:3,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZSH",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]}],ti=[["ASQ",["SLG","SLG"]],["CGL",["CGF"]],["DHC",["DYF"]],["DTD",["TOT"]],["FGD",["FGA","FGB","FGG"]],["IBA",["AVB"]],["IZK",["IFL","IFR"]],["RHU",["RSC"]],["SLS",["MMY"]],["TSL",["FUN"]],["WHR",["WHC"]]];class ei{raw={["C"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0},["S"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0}};addStat(t,e){this.raw[t][e]++}g(t,e){return this.raw[t][e]}typeSum(t){return Se.map(e=>this.g(t,e)).reduce((e,i)=>e+i,0)}getTotal(){const t=this.typeSum("C"),e=this.typeSum("S");return[t,e,t+e]}getFactTotal(t){const e=this.g("C",t),i=this.g("S",t);return[e,i,e+i]}}const l=(n,t)=>({card:n,num:t}),yi={name:"Official 1 - 3",id:"SBE1",decks:[{name:"Alloyin Starter",factions:["A"],cards:[l("SYO",1),l("BSS",1),l("SFT",2),l("SNP",2),l("TSM",2),l("SSS",2),l("ALG",2),l("MXW",3),l("TUP",3),l("FPS",3),l("MND",3),l("IWC",3),l("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[l("SFS",1),l("GGD",1),l("FFD",3),l("EPD",2),l("CCR",2),l("HGS",2),l("DSS",2),l("BWK",2),l("GBG",3),l("DSK",3),l("GRP",3),l("VGN",3),l("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[l("FBC",1),l("RBH",1),l("CFB",3),l("FSM",2),l("FSH",2),l("FSS",2),l("PMS",2),l("RFL",2),l("UBL",3),l("WPD",3),l("SGI",3),l("AMY",3),l("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[l("UPM",1),l("EHW",1),l("FRR",3),l("SPD",2),l("HTP",2),l("LSS",2),l("SDR",2),l("SRD",2),l("FWR",3),l("DBP",3),l("GHT",3),l("GSS",3),l("TXS",3)]},{name:"Cruel Corrosion",factions:["A","N"],cards:[l("IHA",1),l("WBG",1),l("OXP",1),l("DFR",1),l("APM",1),l("SNP",1),l("GRM",2),l("ETN",2),l("DHW",2),l("OXM",2),l("AEN",2),l("ATG",2),l("CTI",2),l("CTW",2),l("FPS",2),l("GRW",2),l("MTT",2),l("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[l("ZTU",1),l("VRP",1),l("GGP",1),l("EPD",1),l("DBT",1),l("BSM",1),l("TDW",2),l("NGT",2),l("UBL",2),l("FWK",2),l("BZD",2),l("CSB",2),l("SLH",2),l("MMH",2),l("LSK",2),l("GBG",2),l("CFG",2),l("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[l("TDS",1),l("SSR",1),l("FRR",1),l("ULR",1),l("UTR",1),l("BTM",1),l("UGL",2),l("EHN",2),l("SPD",2),l("GHB",2),l("FLN",2),l("SML",2),l("RFL",2),l("OXS",2),l("UTM",2),l("TWG",2),l("ENR",2),l("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[l("CSW",1),l("SMD",1),l("FRR",1),l("UIC",1),l("CFB",1),l("UGL",2),l("FSH",2),l("FLN",2),l("WPD",1),l("TWG",2),l("TCG",2),l("TGS",2),l("SML",2),l("SVH",1),l("SCL",2),l("RTS",1),l("FWB",2),l("ENR",2),l("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[l("IMA",1),l("GMP",1),l("OXA",1),l("EPD",1),l("OJC",1),l("ESU",2),l("OXM",2),l("MMA",2),l("SAP",1),l("AFO",2),l("GBG",2),l("CTW",2),l("SRH",1),l("TSM",2),l("SLH",1),l("MTT",1),l("DCR",1),l("DFB",1),l("BSR",1),l("LGT",1),l("XRF",2),l("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[l("SBG",1),l("NSH",1),l("FFU",1),l("EWE",1),l("BFM",1),l("WBH",1),l("UWS",1),l("TGI",2),l("RFL",2),l("GRM",1),l("ASG",1),l("YWC",2),l("XRF",2),l("WPD",2),l("WCS",2),l("WBU",2),l("TCG",1),l("FSK",1),l("SLH",2),l("CFG",1),l("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[l("URB",1),l("AGK",1),l("ESP",1),l("FRR",1),l("NXT",1),l("ALG",1),l("FGB",1),l("PHS",2),l("TUP",1),l("EWT",2),l("PTR",1),l("VBK",1),l("AGC",1),l("AEN",2),l("ETN",1),l("FPS",2),l("MXW",2),l("GHT",1),l("TWG",2),l("SNB",1),l("SML",1),l("JPK",1),l("ENR",1),l("IWC",1)]},{name:"Spare Parts",factions:["N"],cards:[l("SEV",1),l("SHG",1),l("TPG",1),l("CGL",1),l("FRV",1),l("HFA",2),l("XDH",1),l("GRM",1),l("SCV",1),l("DFB",2),l("EBW",2),l("GBG",2),l("GLF",2),l("XHS",2),l("SOT",1),l("XRF",2),l("SCS",1),l("ZMT",1),l("SLH",1),l("VYE",1),l("XCR",2),l("XHU",1)]},{name:"Future Forged",factions:["A"],cards:[l("NXA",1),l("IMD",1),l("FOL",1),l("SFA",2),l("SFT",1),l("SCD",1),l("CAG",1),l("ESU",1),l("NNS",1),l("FPM",1),l("PRI",1),l("SSS",1),l("CTG",1),l("TSM",2),l("IWC",1),l("MMA",2),l("TGN",2),l("MTT",1),l("SKG",1),l("AFO",1),l("MMV",1),l("TWS",1),l("SBA",2),l("SSK",1),l("JPK",1)]},{name:"Burning Rage",factions:["T"],cards:[l("ROK",1),l("KKK",1),l("MOE",1),l("AFR",1),l("FBI",1),l("FSS",2),l("FLN",2),l("CCT",2),l("BRN",2),l("WPD",2),l("SSM",2),l("SOK",1),l("RTS",2),l("FSK",2),l("CWK",2),l("CFG",2),l("BSW",2),l("FMS",2)]},{name:"Awakened Fury",factions:["U"],cards:[l("DZD",1),l("SSE",1),l("BTR",1),l("TSL",1),l("MPH",1),l("CDT",1),l("DYB",1),l("BTH",2),l("TMG",2),l("BWD",2),l("RHY",2),l("SBD",2),l("GMR",2),l("STS",1),l("OSL",2),l("SBI",2),l("LYS",2),l("TGS",2),l("SOD",2)]}]},bi={name:"Official 4 - 5",id:"SBE2",decks:[{name:"Titan's Assault",factions:["N","T"],cards:[l("ATT",1),l("TNL",1),l("RSE",1),l("SPH",1),l("SCV",2),l("ABB",2),l("TBB",2),l("BRN",2),l("FLN",2),l("CMF",2),l("XDH",2),l("FST",2),l("TAB",2),l("MDE",2),l("FSK",2),l("FLH",2),l("CBB",2)]},{name:"Verdant Fortress",factions:["A","U"],cards:[l("NGQ",1),l("RHU",1),l("VCH",1),l("ESG",1),l("PLW",2),l("NNS",2),l("SND",2),l("WOD",2),l("IBR",2),l("BWD",2),l("SBI",2),l("RWC",2),l("TEX",2),l("SER",2),l("SWG",2),l("SCC",2),l("DYB",2)]},{name:"Umbruk Uprising",factions:["T","U"],cards:[l("LUC",1),l("BWT",1),l("GHR",1),l("TSP",1),l("WBH",1),l("COD",1),l("SDR",1),l("ZPM",1),l("OXS",1),l("WOD",1),l("RWC",2),l("SSG",2),l("VGR",2),l("CFG",2),l("UEM",2),l("FFG",2),l("UGL",2),l("DMR",2),l("RTS",2),l("CWK",2)]},{name:"Onyxium Twilight",factions:["A","N"],cards:[l("EPH",1),l("DTD",1),l("POX",1),l("DDS",1),l("OHV",1),l("PHS",1),l("DFB",1),l("TDW",1),l("CAG",1),l("ALG",1),l("TUP",2),l("CTW",2),l("XCR",2),l("SSK",2),l("SRH",2),l("ATG",2),l("MTT",2),l("SLH",2),l("GLF",2),l("AFO",2)]},{name:"Blistering Chaos",factions:["T","U"],cards:[l("WSE",1),l("MHR",1),l("PMI",1),l("SIV",1),l("BRN",1),l("HOD",1),l("CHA",1),l("LYS",1),l("TRS",2),l("PSC",2),l("FLN",2),l("EFA",2),l("SHS",2),l("TXB",2),l("VNF",2),l("CFG",2),l("FSK",2),l("CBB",2),l("VND",2)]},{name:"Dark Retribution",factions:["A","N"],cards:[l("AAA",1),l("SNT",1),l("ABE",1),l("XTR",1),l("CNT",1),l("HOX",1),l("PLW",1),l("AGW",1),l("OHV",2),l("OXM",2),l("XDH",2),l("VGL",2),l("ETN",2),l("MTT",2),l("VYE",2),l("DSK",2),l("BFT",2),l("ATZ",2),l("IBR",2)]},{name:"Iron Tide",factions:["A","U"],cards:[l("EFE",1),l("DPB",1),l("HWM",1),l("HTR",1),l("OJC",1),l("RBG",1),l("EWT",1),l("CIN",1),l("TGK",2),l("CAG",2),l("TGN",3),l("SCC",3),l("URS",3),l("LSP",3),l("TSM",3),l("TMM",3)]},{name:"Dragon Forge",factions:["N","T"],cards:[l("DGW",1),l("VIK",1),l("DDD",1),l("SMD",1),l("FFM",1),l("SHV",1),l("GRP",1),l("TGI",1),l("SLH",1),l("WBH",2),l("BZD",2),l("EFA",2),l("WFB",3),l("BZS",3),l("CCR",3),l("DSK",3),l("RHC",3)]}]},Ai={name:"Set 1 & 2 Tournies",id:"T1309",decks:[{name:"Axel: Lifegain",factions:["T","U"],cards:[l("AGD",3),l("EHW",3),l("FRR",3),l("FIN",1),l("UPM",1),l("LKP",2),l("BTM",2),l("LBL",3),l("GSS",3),l("RFA",3),l("GHB",3),l("EFP",3)]},{name:"Derk: Metaminds",factions:["A"],cards:[l("OJC",3),l("DMW",3),l("MMV",3),l("JPK",3),l("MMO",3),l("GMP",3),l("ALS",3),l("MMA",3),l("SFA",3),l("BTN",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[l("DBP",3),l("EHW",2),l("FRR",3),l("FWT",3),l("UPM",3),l("LKP",2),l("BTM",3),l("HTR",2),l("LBD",2),l("RFA",3),l("GHB",2),l("SDR",2)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[l("ALS",3),l("TDS",3),l("FRR",3),l("WWP",3),l("SML",2),l("BSG",3),l("JPK",2),l("ODC",3),l("NXT",2),l("WMM",3),l("GHB",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[l("SCS",3),l("ROG",1),l("GGP",1),l("GGD",3),l("WFS",1),l("DSS",3),l("ZTU",1),l("GBG",3),l("HFA",3),l("EXD",1),l("EPD",1),l("BSR",1),l("MRF",2),l("HGS",3),l("GTH",3)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[l("SHK",3),l("MOE",3),l("FRR",3),l("LSK",3),l("FFU",3),l("UBL",3),l("WWS",3),l("FSS",3),l("ENR",3),l("MMH",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[l("DBP",2),l("EHW",2),l("FRR",3),l("HTP",2),l("UPM",3),l("LKP",2),l("GHT",3),l("GGP",2),l("LBD",1),l("EPD",2),l("DBT",2),l("SPD",3),l("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[l("IWC",3),l("FSS",3),l("ETN",1),l("WPD",2),l("FSM",1),l("AHL",1),l("UBL",3),l("SMD",2),l("BTN",3),l("LSK",1),l("MMH",3),l("FFU",1),l("TSM",3),l("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[l("DSS",3),l("FSS",3),l("EPD",2),l("GTH",3),l("FSM",1),l("MOE",1),l("UBL",3),l("GGP",3),l("GBG",1),l("LSK",3),l("HGS",1),l("CTW",1),l("SHK",3),l("GGD",1),l("DBT",1)]}]},ki={name:"The Forge",id:"TG10",decks:[{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[l("BWK",3),l("TDS",2),l("FRR",3),l("WWP",3),l("GGP",3),l("GGD",3),l("DBT",1),l("WFS",3),l("CTW",3),l("EPD",3),l("GHB",3)]},{name:"ErrorAsh: Burn",factions:["N","T"],cards:[l("UBL",2),l("EFM",2),l("FBI",3),l("ESK",3),l("FLN",3),l("EFP",3),l("MOE",3),l("FSS",3),l("SHK",3),l("EPD",3),l("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[l("WWS",3),l("DYB",3),l("FRR",3),l("SYL",3),l("EPD",3),l("SSE",2),l("NSH",2),l("TDW",3),l("NFF",2),l("CHR",2),l("LKP",2),l("EXD",2)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[l("NSH",2),l("SMD",2),l("DDD",3),l("TDW",3),l("VRP",3),l("WCS",3),l("BSM",3),l("SHG",2),l("TGI",2),l("EPD",3),l("FVA",2),l("DBT",1),l("TRN",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[l("UWL",3),l("FFU",3),l("WBY",3),l("UIM",3),l("WBU",3),l("SSR",1),l("TRN",1),l("GTT",1),l("GCR",3),l("FRR",3),l("UBL",3),l("WWP",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[l("DDD",3),l("DBT",3),l("EPD",3),l("EFP",3),l("GGP",3),l("LSK",3),l("SHK",3),l("UBL",3),l("WCS",3),l("ZTU",3)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[l("XSH",3),l("SPM",3),l("FRR",3),l("ODC",3),l("SSE",3),l("ESK",3),l("TGS",3),l("XRF",3),l("VRP",3),l("URB",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[l("RBH",3),l("TDS",3),l("FRR",3),l("WWP",3),l("EFP",3),l("AMY",2),l("FVA",2),l("ENR",3),l("ZSH",3),l("EHW",3),l("GHB",2)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[l("BWK",2),l("KOD",2),l("CYC",3),l("GRM",3),l("VYE",3),l("XRW",3),l("MOE",2),l("ZTU",3),l("BSM",3),l("EPD",3),l("DSS",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[l("AGM",3),l("TDS",2),l("FRR",3),l("WWP",3),l("CSW",3),l("FLN",3),l("EFP",2),l("UWL",3),l("WBY",2),l("WCS",2),l("EHW",2),l("SHS",2)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[l("UHS",2),l("FLN",3),l("STG",3),l("CRC",3),l("SHK",3),l("EFP",2),l("WMR",2),l("WMM",3),l("JPK",3),l("SMD",3),l("FVA",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[l("LSK",2),l("WBG",3),l("EPD",3),l("DDD",3),l("SHK",3),l("EFP",3),l("ZTU",2),l("GGD",2),l("GGP",3),l("CTW",3),l("DBT",3)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[l("DMW",3),l("GMP",3),l("MMA",3),l("MMV",2),l("TDW",3),l("VRP",3),l("EPD",3),l("SHG",2),l("OJC",2),l("ESK",2),l("CHV",2),l("CTW",2)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[l("CTW",1),l("GCR",1),l("CFG",1),l("FZS",1),l("FBI",3),l("MOE",3),l("EFP",3),l("LSK",3),l("FLN",3),l("SHK",3),l("RTS",3),l("GGP",3),l("UBL",2)]}]},vi={name:"Fundecks",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[l("DFB",3),l("BSR",3),l("HGS",3),l("HFA",3),l("FFD",3),l("XSH",3),l("XHU",3),l("WBG",3),l("GBG",3),l("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[l("TBA",3),l("SVH",3),l("MBP",2),l("FSH",3),l("RBH",3),l("FBC",3),l("LBR",2),l("CFB",3),l("AAK",3),l("KKK",2),l("FRR",1),l("FIN",1),l("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[l("MMA",3),l("DMW",3),l("GMP",3),l("SYO",3),l("KAW",3),l("SHK",3),l("CTL",2),l("CAG",2),l("MSC",2),l("MTS",2),l("ASG",2),l("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[l("CTV",3),l("TDW",3),l("BTS",3),l("CHR",3),l("GMR",3),l("KOD",2),l("LKP",2),l("SHV",2),l("DBA",2),l("CCR",2),l("PTB",2),l("FIN",1),l("DBT",2)]},{name:"Voltron",factions:["A"],cards:[l("FGA",3),l("FGB",3),l("FGD",3),l("FGG",3),l("AFS",3),l("BSS",3),l("PRI",3),l("TUP",2),l("JPK",2),l("BWH",2),l("SFT",3)]},{name:"Do Fear The Reaper",factions:["A","N"],cards:[l("CTI",3),l("DFR",3),l("GRW",3),l("LGT",3),l("OXM",3),l("OXP",3),l("PHM",3),l("CTW",2),l("NNS",2),l("OXA",2),l("SDN",3)]},{name:"Muadib",factions:["N","U"],cards:[l("DBA",3),l("DYL",3),l("GSW",3),l("LBD",3),l("MMW",3),l("NCW",3),l("SRV",3),l("LBL",2),l("MSP",2),l("VYE",2),l("SBD",3)]},{name:"Triassic Park",factions:["T","U"],cards:[l("URB",3),l("UTR",3),l("UTM",3),l("ULR",3),l("UIC",3),l("UGL",3),l("RTS",3),l("BRN",2),l("LBR",2),l("IBF",2),l("GHB",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[l("DDD",3),l("WBH",3),l("HMF",3),l("WCS",3),l("GGP",3),l("SAD",3),l("SDN",3),l("EWE",3),l("SBG",3),l("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[l("WWP",3),l("EHN",2),l("SDR",2),l("HTR",2),l("MML",2),l("HTP",2),l("SHS",3),l("MND",2),l("NXC",2),l("CDT",2),l("PTB",2),l("SVO",2),l("MPH",2),l("SYO",2)]},{name:"Braaiins",factions:["N"],cards:[l("XDV",3),l("XRW",3),l("ONN",2),l("SLH",2),l("FWK",2),l("BWK",2),l("URD",2),l("TPG",2),l("DSS",2),l("KOD",2),l("ZMT",2),l("RSZ",2),l("BLW",2),l("CSB",2)]},{name:"Wanderin",factions:["N","U"],cards:[l("LYS",3),l("STR",2),l("MBP",2),l("OSL",2),l("RLW",3),l("SSR",1),l("SVO",2),l("SSE",2),l("RHW",3),l("SYL",2),l("TGS",2),l("TMG",3),l("XDH",3)]},{name:"Walls",factions:["A","T"],cards:[l("CDC",3),l("CTG",3),l("CRC",3),l("DCS",3),l("FRI",3),l("FGA",2),l("OBB",3),l("FVA",2),l("TGN",2),l("OWH",3),l("STN",3)]},{name:"Snakes In A Lane",factions:["A","U"],cards:[l("AFO",3),l("DSV",3),l("PSC",3),l("SHS",3),l("STO",3),l("NCL",2),l("VNF",3),l("LYS",2),l("SVO",1),l("VNS",3),l("TXS",2),l("ART",2)]},{name:"Benny & Izzy",factions:["A","T"],cards:[l("BRN",3),l("EFM",2),l("IZK",3),l("JPK",1),l("MTT",1),l("NNS",1),l("OBB",2),l("OWF",2),l("OEX",3),l("PRI",2),l("PTR",1),l("TST",1),l("FLS",2),l("BLH",3),l("SHK",3)]}]},ge=[yi,bi,Ai,ki,vi];class Ce{state;constructor(t){this.state=t}getState(){return this.state}get adjacent(){return g.adjacentPositions(this.lane)}get attack(){return this.state.attack+this.modSum("AT")}get activationAvailable(){return this.state.negateActivate?!1:this.state.activationAvailable}set activationAvailable(t){this.state.activationAvailable=t}get aggressive(){return this.state.aggressive||this.modBool("AG")}set aggressive(t){this.state.aggressive=t}get armor(){return this.negateArmor?0:this.state.armor+this.modSum("AR")}get armorDmg(){return this.state.armorDmg}set armorDmg(t){this.state.armorDmg=t}get breakthrough(){return this.state.breakthrough||this.modBool("BT")}set breakthrough(t){this.state.breakthrough=t}get changed(){return this.state.changed||this.negateDefender||this.negateArmor||this.negateActivate||this.negateMobility||this.negateRegen||this.state.triggers.some(t=>t.changes)}set changed(t){this.state.changed=t}get code(){return this.state.code}get defender(){return this.negateDefender?!1:this.state.defender||this.modBool("DF")}set defender(t){this.negateDefender||(this.state.defender=t,this.enforceEffects("DF"))}get effects(){return this.state.effects}get extraBattles(){return this.state.extraBattles}set extraBattles(t){this.state.extraBattles=t}get faction(){return L.getCard(this.code).faction}get health(){return this.state.health+this.modSum("HL")}get id(){return this.state.id}get isActive(){return!this.sleeping||this.aggressive}isTribe(t){return L.getCard(this.code).isTribe(t)}get lane(){return this.state.lane}get level(){return L.getCard(this.code).level}get maxHealth(){return this.state.maxHealth+this.modSum("MH")}get mobility(){return this.negateMobility?0:this.state.mobility+this.modSum("MB")}get mobilityAvailable(){return this.state.mobilityAvailable}set mobilityAvailable(t){this.state.mobilityAvailable=t}get mods(){return this.state.mods}get negateActivate(){return this.state.negateActivate}set negateActivate(t){this.state.negateActivate=t}get negateArmor(){return this.state.negateArmor||this.modBool("NA")}set negateArmor(t){this.state.negateArmor=t,this.enforceEffects("AR")}get negateDefender(){return this.state.negateDefender||this.modBool("ND")}set negateDefender(t){this.state.negateDefender=t,this.enforceEffects("DF")}get negateMobility(){return this.state.negateMobility||this.modBool("NM")}set negateMobility(t){this.state.negateMobility=t}get negateRegen(){return this.state.negateRegen||this.modBool("NM")}set negateRegen(t){this.state.negateRegen=t}get opposed(){const t=y.crTarg();return t.player=v.toTarget(!this.owner),t.lanes=g.oppositeLane(this.lane),g.creatByTarget(t)[0]}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get rank(){return v.toPlayer(this.owner).rank}get regen(){return this.negateRegen?0:this.state.regen+this.modSum("RG")}get sleeping(){return this.state.sleeping}set sleeping(t){this.state.sleeping=t}get status(){return this.state.status}set status(t){this.state.status=t}get triggers(){return this.state.triggers}buff(t,e,i=void 0){t!==0&&(this.state.attack+=t,this.enforceEffects("AT")),e!==0&&(this.state.health+=e,this.state.maxHealth+=e,this.enforceEffects("CH"),U.deathProdder(this,i),e>0&&x.addEvents(V.creatHeal(this,e)))}addArmor(t){if(!this.negateArmor){const e=this.state.armor+t;this.state.armor=Math.max(0,e),this.enforceEffects("AR")}}addMobility(t){if(!this.negateMobility){const e=this.state.mobility+t;this.state.mobility=Math.max(0,e)}}addPoison(t){const e=this.state.poison+t;this.state.poison=Math.max(0,e)}addRegen(t){if(!this.negateRegen){const e=this.state.regen+t;this.state.regen=Math.max(0,e)}}heal(t){if(t===0)return 0;const e=Math.min(this.health+t,this.maxHealth)-this.health;return this.state.health+=e,this.enforceEffects("CH"),x.addEvents(V.creatHeal(this,e)),e}setHealth(t){this.state.health=t}hurt(t,e=!1){if(t<1)return[0,0];const i=Math.max(Math.min(t,this.armor-this.armorDmg),0);let s=t-i,h=this.health-s;this.state.armorDmg+=i;let f=0;return e&&h<0&&(f=s-this.health,s=this.health),s>0&&(this.state.health-=s,this.enforceEffects("CH")),[s,f]}hurtBattle(t,e,i=!1){const s=this.hurt(t,i);return s[0]>0&&x.addEvents(V.damage(!0,s[0],!0,!0,this,e)),s[1]}hurtDirect(t,e,i=void 0){const s=this.hurt(t,!1);return s[0]>0&&(p.new().crd(e).txt(` dealt ${t} dmg to `).crd(this.code).txt(".").go(),x.addEvents(V.damage(!1,s[0],!1,!0,this,void 0)),U.deathProdder(this,i)),s[0]}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),U.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF")}modSum(t){return y.modSum(this.mods,t)}modBool(t){return y.modBool(this.mods,t)}hasMod(t){return y.hasModG(this.mods,t)}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){y.hasMod(this.mods,t)||this.addMod(t)}removeMod(t){const e=this.state.mods.filter(i=>i.granter===t);this.state.mods=this.state.mods.filter(i=>i.granter!==t),e.forEach(i=>{this.modEffectPropagator(i),i.type==="AR"&&(this.state.armorDmg=Math.max(0,this.state.armorDmg-i.value))})}removeModSafe(t){this.hasMod(t)&&this.removeMod(t)}expireMod(t){this.state.mods.splice(y.modIdx(this.state.mods,t),1)}bonusTotal(){let t=ht.sumNuggets(this.triggers);return this.state.actvBonus&&(t=ht.addNuggets(t,this.state.actvBonus)),t}endActivation(){this.modBool("EA")?this.removeMod(this.id):this.state.activationAvailable=!1,U.deathCheck(),S.actionDone()}move(t){this.state.lane=t,re.positionChange(this.owner),x.addEvents(V.creature("MOV",this))}addEffect(t,e){const i=y.effect(t,e);return this.effects.push(i),i}enforceEffects(t,e=!1){this.effects.filter(i=>i.watch===t).filter(i=>i.area==="A"||i.area==="C"&&this.owner===e).forEach(i=>L.getCard(i.logicCode).enforceEffect(i,this))}jr4(t,e=""){e===""&&(e=this.code);const i=y.trigger(t,e);return i.cardCode=this.code,i.creatId=this.id,this.triggers.push(i),i}removeTrigger(t){const e=y.trigIdx(this.triggers,t);e>-1?this.triggers.splice(e,1):console.error("Wery curious, could not find trigger to remove",t)}wipeAll(){this.state.mods=[],this.state.triggers=[],this.state.effects=[],this.state.hints=[],this.state.armor=0,this.state.mobility=0,this.state.poison=0,this.state.regen=0,this.state.aggressive=!1,this.state.defender=!1,this.state.breakthrough=!1,this.state.defender=!1,this.state.negateDefender=!1,this.state.negateArmor=!1,this.state.actvBonus=void 0,this.state.changed=!0,this.state.negateActivate=!0,g.creatByTarget(y.crTarg()).forEach(t=>{t.removeMod(this.id),t.enforceEffects("PS",this.owner)}),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),re.defenderChange(this.owner)}get hints(){return this.state.hints}aiHints(){return this.hints}}class y{static creatureState(t,e){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,actvBonus:void 0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:e,maxHealth:0,mobility:0,mobilityAvailable:!0,mods:[],negateActivate:!1,negateArmor:!1,negateDefender:!1,negateMobility:!1,negateRegen:!1,owner:t,poison:0,regen:0,sleeping:!0,status:"A",triggers:[]}}static effect(t,e){return{area:"A",watch:t,logicCode:e}}static freeCard(t){return{id:R.genId(),condition:y.target("TH"),sourceCard:t}}static mod(t,e,i=""){return{type:t,value:typeof e=="boolean"?e?1:0:e,granter:i,expiry:"NN"}}static trigger(t,e){return{id:R.genId(),type:t,logicCode:e,cardCode:"",creatId:"",customCode:"",interactive:!1,changes:!1,bonus:void 0}}static triggerReaction(t,e,i,s){return{event:t,owner:i,creatId:"",cardCode:"",trigger:e,host:s}}static basicAction(t){return{zone:"N",key:t,host:"",param:""}}static fieldSelectAction(t,e=-1,i=!0){return{zone:"F",key:t,playerA:i,lane:e,host:"",param:""}}static deckSelectAction(t,e,i){return{zone:"N",key:t,card:e,position:i,host:"",param:""}}static handSelectAction(t,e="",i="",s=-1){return{zone:"H",key:t,card:e,cost:i,position:s,host:"",param:""}}static playerSelectAction(t,e){return{zone:"P",key:t,playerA:e,host:"",param:""}}static draftSelectAction(t,e,i){return{zone:"N",key:t,index:e,pack:i,host:"",param:""}}static menuButtonAction(t){return{zone:"N",key:"MNBT",host:"",param:t}}static actionifier(t,e,i,s){const h=t;return h.key=e,h.host=i,h.param=s,h}static target(t){return{target:t,level:"LA",canLevel:!1,faction:"X",player:"X",card:"A",field:"A",creatStatus:"A",tribe:"AN",notMe:"",hasArmor:!1,canArmor:!1,hasDefender:!1,canDefender:!1,hasMobility:!1,canMove:!1,hasPoison:!1,hasRegen:!1,canRegen:!1,cardCode:"",victims:""}}static actionTarget(t,e,i,s){return y.actionifier(y.target(t),e,i,s)}static crTarg(){const t=y.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,e,i){return y.actionifier(y.crTarg(),t,e,i)}static crNotMeTarg(t){const e=y.target("TF");return e.field="O",e.creatStatus="V",e.notMe=t,e}static crNotMeActTarg(t,e,i,s){return y.actionifier(y.crNotMeTarg(e),t,i,s)}static crFriendTarg(){const t=y.crTarg();return t.player="F",t}static crFriendActTarg(t,e,i){return y.actionifier(y.crFriendTarg(),t,e,i)}static crFriendNotMeTarg(t){const e=y.crNotMeTarg(t);return e.player="F",e}static crFriendNotMeActTarg(t,e,i,s){return y.actionifier(y.crFriendNotMeTarg(e),t,i,s)}static crEnemyTarg(){const t=y.crTarg();return t.player="E",t}static crEnemyActTarg(t,e,i){return y.actionifier(y.crEnemyTarg(),t,e,i)}static playerTarg(t){const e=y.target("TP");return e.player=v.toTarget(t),e}static playerActTarg(t,e,i,s){return y.actionifier(y.playerTarg(t),e,i,s)}static lvlHandActTarg(t,e){const i=this.actionTarget("TH","CARD",t,e);return i.player="F",i.canLevel=!0,i.hint=["CD"],i}static emptyTarg(){const t=y.target("TF");return t.field="E",t}static emptyActTarg(t,e,i){return y.actionifier(y.emptyTarg(),t,e,i)}static emptyPlayerTarg(t){const e=y.emptyTarg();return e.player=v.toTarget(t),e}static emptyPlayerActTarg(t,e,i,s){return y.actionifier(y.emptyPlayerTarg(t),e,i,s)}static modSum(t,e){return t.filter(i=>i.type===e).map(i=>i.value).reduce((i,s)=>i+s,0)}static modBool(t,e){return t.some(i=>i.type===e&&i.value===1)}static hasModG(t,e){return t.findIndex(i=>i.granter===e)>-1}static hasMod(t,e){return y.modIdx(t,e)>-1}static modIdx(t,e){return t.findIndex(i=>i.granter===e.granter&&i.type===e.type)}static trigIdx(t,e){return t.findIndex(i=>i.id===e.id)}}class Dt{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return Dt.extractCardCode(this.code)}image(t){return this.type==="S"?this.fixedImage(t):this.leveledImage(t)}leveledImage(t){return this.rawImage(this.code,t)}fixedImage(t){return this.rawImage(this.cardCode(),t)}rawImage(t,e){return`card/${e?"b":"s"}/${this.faction}/${t}.jpg`}isFree=!1;level;maxLevel=3;minLevel=1;name="";overload=!1;rarity="T";spice;text="";get type(){return "C"}hints;addSp(t,e){}aiHints(){return this.hints??[]}canLevel(){return this.level{h+=s[m]*i[0][m],f+=s[m]*i[1][m]}),[h,f]}rawNug(t,e,i,s,h=0){return ht.rawNugget(t,e,i,s,h)}buffNug(t,e){return this.rawNug(0,e+t,t,0,0)}playerNug(t){return this.rawNug(0,0,0,t,0)}spawnNug(t){const e=ht.cardCreatValueFormula(t);return this.rawNug(1,e,t.iAttack,0,0)}statSpawnNug(t,e){const i=this.buffNug(t,e);return i.count=1,i}avgSpawnNug(t){const e=this.avgCreatureStats(t);return this.statSpawnNug(e[0],e[1])}regnNug(t){return this.rawNug(0,ht.calcCreatValueFormula(0,0,0,0,t,!1,0),0,0,0)}multNug(t,e){return t.attack*=e,t.value*=e,t.count*=e,t.pHealth*=e,t}static extractCardCode(t){return t.substring(0,3)}get boof123n(){return this.level*-1}get boof124(){return this.lValN([1,2,4])}get boof135(){return this.lValN([1,3,5])}get boof137(){return this.lValN([1,3,7])}get boof147(){return this.lValN([1,4,7])}get boof234(){return this.level+1}get boof235(){return this.lValN([2,3,5])}get boof236(){return this.lValN([2,3,6])}get boof246(){return this.level*2}get boof246n(){return this.level*-2}get boof247(){return this.lValN([2,4,7])}get boof247n(){return this.lValN([-2,-4,-7])}get boof248(){return this.lValN([2,4,8])}get boof258(){return this.lValN([2,5,8])}get boof2510(){return this.lValN([2,5,10])}get boof2612(){return this.lValN([2,6,12])}get boof357(){return this.lValN([3,5,7])}get boof358(){return this.lValN([3,5,8])}get boof359(){return this.lValN([3,5,9])}get boof3510(){return this.lValN([3,5,10])}get boof3612(){return this.lValN([3,6,12])}get boof369(){return this.level*3}get boof369n(){return this.level*-3}get boof3610(){return this.lValN([3,6,10])}get boof3711(){return this.lValN([3,7,11])}get boof3712(){return this.lValN([3,7,12])}get boof3713(){return this.lValN([3,7,13])}get boof3714(){return this.lValN([3,7,14])}get boof3814(){return this.lValN([3,8,14])}get boof3915(){return this.lValN([3,9,15])}get boof468(){return this.lValN([4,6,8])}get boof469(){return this.lValN([4,6,9])}get boof4610(){return this.lValN([4,6,10])}get boof4612(){return this.lValN([4,6,12])}get boof4710(){return this.lValN([4,7,10])}get boof4711(){return this.lValN([4,7,11])}get boof4712(){return this.lValN([4,7,12])}get boof4713(){return this.lValN([4,7,13])}get boof4714(){return this.lValN([4,7,14])}get boof4812(){return this.level*4}get boof4812n(){return this.level*-4}get boof4813(){return this.lValN([4,8,13])}get boof4814(){return this.lValN([4,8,14])}get boof4815(){return this.lValN([4,8,15])}get boof4816(){return this.lValN([4,8,16])}get boof4914(){return this.lValN([4,9,14])}get boof4915(){return this.lValN([4,9,15])}get boof579(){return this.lValN([5,7,9])}get boof5711(){return this.lValN([5,7,11])}get boof5714(){return this.lValN([5,7,14])}get boof5812(){return this.lValN([5,8,12])}get boof5813(){return this.lValN([5,8,13])}get boof5814(){return this.lValN([5,8,14])}get boof5815(){return this.lValN([5,8,15])}get boof5914(){return this.lValN([5,9,14])}get boof5915(){return this.lValN([5,9,15])}get boof5916(){return this.lValN([5,9,16])}get boof5917(){return this.lValN([5,9,17])}get boof51014(){return this.lValN([5,10,14])}get boof51015(){return this.level*5}get boof51020(){return this.lValN([5,10,20])}get boof6812(){return this.lValN([6,8,12])}get boof6814(){return this.lValN([6,8,14])}get boof6912(){return this.lValN([6,9,12])}get boof6914(){return this.lValN([6,9,14])}get boof6915(){return this.lValN([6,9,15])}get boof6916(){return this.lValN([6,9,16])}get boof61014(){return this.lValN([6,10,14])}get boof61015(){return this.lValN([6,10,15])}get boof61016(){return this.lValN([6,10,16])}get boof61017(){return this.lValN([6,10,17])}get boof61018(){return this.lValN([6,10,18])}get boof61117(){return this.lValN([6,11,17])}get boof61218(){return this.lValN([6,12,18])}get boof61224(){return this.lValN([6,12,24])}get boof7911(){return this.lValN([7,9,11])}get boof7914(){return this.lValN([7,9,14])}get boof71013(){return this.lValN([7,10,13])}get boof71014(){return this.lValN([7,10,14])}get boof71015(){return this.lValN([7,10,15])}get boof71116(){return this.lValN([7,11,16])}get boof71117(){return this.lValN([7,11,17])}get boof71118(){return this.lValN([7,11,18])}get boof81116(){return this.lValN([8,11,16])}get boof81117(){return this.lValN([8,11,17])}get boof81217(){return this.lValN([8,12,17])}get boof81220(){return this.lValN([8,12,20])}get boof81318(){return this.lValN([8,13,18])}get boof91420(){return this.lValN([9,14,20])}get boof91421(){return this.lValN([9,14,21])}get boof101520(){return this.lValN([10,15,20])}get boof255080(){return this.lValN([25,50,80])}}class M extends Dt{constructor(t){super(t)}iHealth=0;iAttack=0;iAggro=!1;iArmor=0;iBT=!1;iDefend=!1;iMobile=0;iRegen=0;tribe=[];isTribe(t){return(Array.isArray(t)?t:[t]).every(i=>this.tribe.includes(i))}jr3(t,e){const i=y.creatureState(t,e);return i.id=R.genId(),i.code=this.code,i.health=this.iHealth,i.attack=this.iAttack,i.maxHealth=i.health,i.regen=this.iRegen,i.breakthrough=this.iBT,i.defender=this.iDefend,i.aggressive=this.iAggro,i.armor=this.iArmor,i.mobility=this.iMobile,i.hints=this.aiHints(),i.actvBonus=this.bonus?.activ8,new Ce(i)}playTargets(){const t=super.playTargets(),e=y.actionTarget("TF","FORG",this.code,"");return e.player="F",t.push(e),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}addExtraActivate(t){const e=y.mod("EA",!0,t.id);e.expiry="ET",t.addMod(e)}}class kt extends Dt{constructor(t){super(t)}get type(){return "S"}logSpell(t=void 0,e=void 0){let i=p.new().txt("Casted ").crd(this.code);t&&(i=i.txt(" on ").crd(t.code),e&&(i=i.txt(" and ").crd(e.code))),i.txt(".").go()}}class te{paStats;pbStats;constructor(t,e){this.paStats=t,this.pbStats=e}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const e=this.playerStats(t),i=this.playerStats(!t);return te.deltafier(e,i)}static deltafier(t,e){const i=te.blankStats(!0);return i.creatCount=t.creatCount-e.creatCount,i.creatValue=t.creatValue-e.creatValue,i.threatValue=t.threatValue-e.threatValue,i.playerHealth=t.playerHealth-e.playerHealth,i.bonus=t.bonus-e.bonus,i}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0,bonus:0}}}class ht{static dcWeight=.4;fromState(){const t=g.qActiveCreats(),i=[!0,!1].map(s=>{const h=te.blankStats(s),f=v.toPlayer(s);h.playerHealth=ht.playerFormula(f.health,v.totalArmor(f),v.totalPoison(f));const m=ht.sumNuggets(f.triggers);return h.playerHealth+=m.pHealth,h.creatCount=m.count,h.creatValue=m.value,h.threatValue=m.attack,h.bonus=m.bonus,t.filter(A=>A.owner===s).forEach(A=>{const C=A.bonusTotal();h.playerHealth+=C.pHealth,h.bonus+=C.bonus,h.creatCount+=1+C.count,h.creatValue+=ht.creatValueFormula(A)+C.value,h.threatValue+=ht.threatFormula(A,t)+C.attack}),h});return new te(i[0],i[1])}static ddp9(t,e,i,s,h=0){return ht.ddp9Nugget(t,e,i,s,h)[0]}static ddp9Nugget(t,e,i,s,h=0){const f=t/4,m=e/10,A=i/12,C=s/8;return[f+m+A+C+h,f,m,A,C,h]}static creatValueFormula(t){return ht.calcCreatValueFormula(t.attack,t.health,t.armor,t.mobility,t.regen,t.breakthrough,t.poison)}static cardCreatValueFormula(t){return ht.calcCreatValueFormula(t.iAttack,t.iHealth,t.iArmor,t.iMobile,t.iRegen,t.iBT,0)}static calcCreatValueFormula(t,e,i,s,h,f,m){const A=f?1:0;return e+Math.max(0,t)+(i+Math.min(s,3)+A+h-m)*1.5}static playerFormula(t,e,i){return t+(i-e)*2}static threatFormula(t,e){let i=0,s=0;if(t.defender)i=t.attack;else{const h=e.find(f=>f.owner!==t.owner&&f.lane===6-t.lane);h?(t.breakthrough&&(s=Math.max(t.attack-h.health,0)),i=t.attack-s):s=t.attack,s>0&&(s+=ht.scalingBonus(s))}return Math.max(i,0)+Math.max(s,0)}static rawNugget(t,e,i,s,h=0){return{count:t,value:e,attack:i,pHealth:s,bonus:h}}static addNuggets(t,e){return ht.rawNugget(t.count+e.count,t.value+e.value,t.attack+e.attack,t.pHealth+e.pHealth,t.bonus+e.bonus)}static sumNuggets(t){let e=ht.rawNugget(0,0,0,0,0);return t.forEach(i=>{i.bonus&&(e=ht.addNuggets(e,i.bonus))}),e}static scalingBonus(t){let e=7;if(t<=e)return 0;let i=!0,s=0,h=1;const f=7;for(;i;)t>e+f?(s+=h*f,e+=f,h++):(s+=h*(t-e),i=!1);return s}weighState(t,e,i){const s=t.deltaStats(i),h=e.deltaStats(i),f=te.deltafier(h,s),m=f.playerHealth<0?-1:1,A=ht.scalingBonus(f.playerHealth*m)*m+f.playerHealth;return ht.ddp9Nugget(f.creatCount,f.creatValue,f.threatValue,A,f.bonus)[0]}}class Ti{aiPlayer;constructor(t){this.aiPlayer=t}jr7(t,e=3){return`${t}${e}`}jr6(t,e){const i=T.randInt(0,e.length),s=e[i];return e.splice(i,1),g.birth(t,"F",this.aiPlayer,s)}cheatin(){const t=v.toPlayer(this.aiPlayer),e=v.toPlayer(!this.aiPlayer),i=e.health-t.health;let s=0;i>85?s=3:i>65?s=2:i>45&&(s=1);const h=g.emptyLanes(this.aiPlayer);if(s===0||h.length===0)return!1;p.new().plr(this.aiPlayer).txt(" is a cheaty cheaterton.").go();let f=0;if(s===1){if(E.regularPlays-=1,f=T.randInt(0,13),f===0)this.jr6(this.jr7("HTR"),h);else if(f===1)this.jr6(this.jr7("AGM"),h).addRegen(8);else if(f===2){const m=this.jr6(this.jr7("YNS"),h);m.buff(0,15),m.addRegen(4)}else if(f===3)this.jr6(this.jr7("TBA"),h);else if(f===4)this.jr6(this.jr7("DCS"),h);else if(f===5)this.jr6(this.jr7("GGP"),h).addRegen(8);else if(f===6){const m=this.jr6(this.jr7("WFM"),h);m.aggressive=!0}else if(f===7){const m=this.jr6(this.jr7("FFU"),h);m.aggressive=!0}else if(f===8){const m=this.jr6(this.jr7("URB"),h);m.aggressive=!0}else if(f===9){const m=this.jr6(this.jr7("KOD"),h);m.aggressive=!0,m.addRegen(6)}else if(f===10)this.jr6(this.jr7("AGK"),h).addArmor(3);else if(f===11){const m=this.jr6(this.jr7("PSC"),h);m.aggressive=!0}else if(f===12){const m=this.jr6(this.jr7("SAD"),h);m.aggressive=!0}}else if(s===2)if(E.regularPlays-=1,f=T.randInt(0,17),f===0){const m=this.jr6(this.jr7("NDR"),h);m.aggressive=!0}else if(f===1){const m=this.jr6(this.jr7("CSW"),h);m.aggressive=!0}else if(f===2)this.jr6(this.jr7("GGD"),h).addRegen(6);else if(f===3)this.jr6(this.jr7("EFP"),h);else if(f===4)this.jr6(this.jr7("ZTU"),h);else if(f===5){const m=this.jr6(this.jr7("DDD"),h);m.aggressive=!0}else if(f===6)this.jr6(this.jr7("RBH"),h).addRegen(8);else if(f===7)this.jr6(this.jr7("SFT"),h);else if(f===8)this.jr6(this.jr7("GTT"),h);else if(f===9)this.jr6(this.jr7("SMD"),h);else if(h.length===5)this.jr6(this.jr7("DFB"),h),[1,2,3,4].forEach(m=>this.jr6(this.jr7("XHS"),h));else if(h.length===4)this.jr6(this.jr7("LMV"),h);else if(h.length===3)this.jr6(this.jr7("LHY"),h),this.jr6(this.jr7("SVH"),h),this.jr6(this.jr7("DBA"),h);else if(h.length===2)this.jr6(this.jr7("UTR"),h),this.jr6(this.jr7("TDS"),h);else if(t.turn===4)this.jr6(this.jr7("SSR"),h);else if(t.turn===1)this.jr6(this.jr7("ESK"),h);else{const m=this.jr6(this.jr7("XSH"),h);m.aggressive=!0}else if(s===3)if(f=T.randInt(0,20),f===0){const m=this.jr6(this.jr7("IHA",4),h);m.aggressive=!0}else if(f===1)this.jr6(this.jr7("CHR"),h);else if(f===2)this.jr6(this.jr7("FGO",1),h);else if(f===3)this.jr6(this.jr7("CHV",4),h);else if(f===4)this.jr6(this.jr7("KKK",4),h);else if(t.health<20){const m=this.jr6(this.jr7("ODC",4),h);m.aggressive=!0}else if(h.length===5){const m=T.randInt(0,4);if(m===0)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("UWL",2),h));else if(m===1)[1,2].forEach(A=>this.jr6(this.jr7("DFB"),h)),[1,2,3].forEach(A=>this.jr6(this.jr7("FFD"),h));else if(m===2)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("BWK"),h));else if(m===3){this.jr6(this.jr7("SBG"),h),this.jr6(this.jr7("EWE"),h);const A=this.jr6(this.jr7("BMY"),h);A.defender=!0,A.aggressive=!0}}else if(e.health>350)t.health<180&&v.heal(t,180-t.health),this.jr6(this.jr7("AGD"),h);else if(e.health>250)this.jr6(this.jr7("FGO"),h);else if(h.length===4){const m=T.randInt(0,3);m===0?(this.jr6(this.jr7("AGK"),h),[1,2,3].forEach(A=>this.jr6(this.jr7("VBK"),h))):m===1?(this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("UTR"),h)):m===2&&[1,2,3,4].forEach(A=>this.jr6(this.jr7("CDC"),h))}else if(h.length===3)if(T.randInt(0,2)){this.jr6(this.jr7("SDR"),h),this.jr6(this.jr7("SDR"),h);const m=this.jr6(this.jr7("UPM"),h);m.aggressive=!0}else{this.jr6(this.jr7("SDL"),h);const m=this.jr6(this.jr7("NFF"),h);m.aggressive=!0}else if(h.length===2)this.jr6(this.jr7("SPM"),h),this.jr6(this.jr7("SPM"),h);else{const m=this.jr6(this.jr7("NXC"),h);m.buff(10,0),m.aggressive=!0,m.addMobility(2),m.addRegen(5)}return t.health<30&&v.heal(t,50-t.health),!0}}var st=(n=>(n[n.Left=0]="Left",n[n.Both=1]="Both",n[n.Right=2]="Right",n[n.ForceRight=3]="ForceRight",n))(st||{});class We{action;hitTest(t,e,i){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,e,i,s){let h,f=0;const m=t.length;for(;h===void 0&&f=t&&this.originY<=e&&this.endY>=e?this.action:void 0}}class $t extends dt{constructor(t,e,i,s,h=0){super({zone:"N",key:"BNDL",host:"",param:""},t,e,i,s,h)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,e,i){if(super.hitTest(t,e,i))return We.arrayHit(this.childs,t,e,i)}}class Si{guts="";txt(t){return ot.simOn||(this.guts+=t),this}plr(t){if(!ot.simOn){const e=v.toBool(t);this.guts+="^p"+(e?"a":"b")}return this}crd(t){return ot.simOn||(this.guts+="^c"+t),this}go(){ot.simOn||p.parse(this)}}class De{realPromise;resolveMe(t){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,e)=>{this.resolveMe=t,this.rejectMe=e})}}const Ue=25,ii=9999,Ci=-9999,wi=-999999,Di=["CANC","DEET","SCRH"],xi=["HPLY","ACTV","MOVE"];class Bi{log=!1;simOn=!1;dumb=!1;inPhase=!0;promStack=[];peekStack=[];peeking=!1;slowpoke=0;endCount=0;aiPlayer=!1;brdEval;rootBoardStats;turnSims=0;turnTime=0;kickOut=!1;kickTimer=0;constructor(){this.brdEval=new ht,this.rootBoardStats=new te(te.blankStats(!0),te.blankStats(!1))}setLog(t){this.log=t}lNum(t){return t<-899999?"NUNS":t<-8999?"LOSS":t>8888?"KILL":t.toFixed(1)}popProm(t){this.promStack.pop().resolveMe(t)}popPeeker(t){this.peekStack.pop().resolveMe(t)}hitMainPhase(){this.dumb&&this.simOn&&this.inPhase&&E.mainBattle&&(this.inPhase=!1)}simEndpoint(t){if(this.endCount++,this.promStack.length===0)p.debug("Tried to end a sim, but no promise to unlock."),console.trace();else{let e;if(t==="T"){const i=this.brdEval.fromState();e=this.brdEval.weighState(this.rootBoardStats,i,this.aiPlayer)}else t==="W"?e=ii:t==="L"?e=Ci:e=wi;this.popProm(e)}}async processAction(t,e,i=!1){const s=!this.simOn;let h=0,f,m=this.actionPruner(t);if(m=this.noHandDoubles(m),this.peeking){this.popPeeker(m);return}if(s&&this.dumb&&e&&(this.dumb=!1,p.debug("Smart Again.",!1)),this.dumb&&!this.inPhase){let B=m.filter($=>$.key==="FITE"||$.key==="ENDT");B.length>0&&(m=B)}if(s){f=new Ae,f.hwhipe();const B=m.map((et,At)=>f.drawAiGear(At,!1));await Promise.all(B),await new Ie().drawActions([]),await T.sleep(Ue),this.kickOut=!1,this.simOn=!0,this.slowpoke=Date.now(),this.rootBoardStats=this.brdEval.fromState(),this.endCount=0;const Y=await this.peeker(m),J=[];let ut=0,O=0,it=[];Y.forEach(et=>{ut+=et.peek.length,et.free&&(et.free==="FREE"?O++:it.includes(et.free)||(O++,it.push(et.free))),et.wasPeek&&et.peek.some(At=>this.hasHint(At,"DF"))&&J.push(et.root)}),J.length>0?(m=J,this.dumb=!0,p.debug("Do firsts; dumb mode. Action count "+m.length,!1)):i?(this.dumb=!0,p.debug("Forced dumb mode.",!1)):E.regularPlays+O>3?(this.dumb=!0,p.debug("4+ plays; dumb mode. Peek was "+ut,!1)):v.getActive().hand.length>7?(this.dumb=!0,p.debug("8+ in hand; dumb mode. Peek was "+ut,!1)):ut>29&&T.options.debug&&this.peekerReport(Y)}if(m.length===0){s&&(console.error("Root eval set consisted of 0 valid actions"),p.debug("!! Zero Action Root !!")),this.simEndpoint("D");return}let A=-99999;const C=[];if(m.length===1&&s)C.push({a:m[0],weight:99});else{ue.saveState();for(let B=0;B4e4&&(this.kickOut=!0),J+=this.hintWeight($),J>A&&(A=J),ue.restoreState(),s&&(C.push({a:$,weight:J}),await f.drawAiGear(B,!0),h++,await T.sleep(Ue))}ue.popState()}if(s)if(this.simOn=!1,this.kickOut){const B="🤖: High complexity encountered. Recombobulating.";p.new().txt(B).go(),this.processAction(t,e,!0)}else{const B=A-.4;let $=C.filter(it=>it.weight>B);$.length>1&&$.findIndex(it=>it.a.key==="ENDT")>-1&&($=$.filter(it=>it.a.key!=="ENDT"));let Y;if(B>ii-100){const it=$.find(et=>et.a.key==="FITE");it?Y=it.a:Y=$[T.randInt(0,$.length)].a}else Y=$[T.randInt(0,$.length)].a;const J=Date.now()-this.slowpoke,ut=Math.max(1,350-J),O=J-Ue*h;this.turnSims+=this.endCount,this.turnTime+=O,T.options.debug&&Y.key==="HPLY"&&(p.debug("▪"),p.debug("🧠 Hand Choices 🧠"),C.filter(it=>it.a.key==="HPLY").sort((it,et)=>et.weight-it.weight).forEach(it=>{let et="";it.a===Y?et=" 🏆":it.weight>B&&(et=" 🌻"),p.new().crd(it.a.card).txt(" : "+this.lNum(it.weight)+et).go()}),p.debug("🧠 ~~~~~~~~~~~~ 🧠"),p.debug("▪")),T.sleep(ut).then(()=>{S.handleAction(Y)})}else this.popProm(A)}actionPruner(t){let e=t.filter(i=>Di.indexOf(i.key)===-1);return E.mainBattle?e=e.filter(i=>i.key!=="HDSC"):e=e.filter(i=>!this.hasHint(i,"BB")),e=e.filter(i=>{if(this.hasHint(i,"HR")){if(i.zone==="P")return i.playerA!==this.aiPlayer;{const s=i,h=g.ddf6(s);if(h.owner===this.aiPlayer){const f=h.aiHints();return f.includes("MC")||f.includes("LZ")}else return!0}}else return!0}),e=e.filter(i=>{if(this.hasHint(i,"KL")){const s=i,h=g.ddf6(s);if(h.owner===this.aiPlayer){const f=h.aiHints();return f.includes("ST")||f.includes("LZ")}else return!0}else return!0}),e=e.filter(i=>this.hasHint(i,"BF")?i.playerA===this.aiPlayer:!0),e=e.filter(i=>this.hasHint(i,"DB")?i.playerA!==this.aiPlayer:!0),e=e.filter(i=>{if(this.hasHint(i,"PN")){if(i.zone==="P")return i.playerA!==this.aiPlayer;{const s=i,h=g.ddf6(s);return h.owner===this.aiPlayer?h.aiHints().includes("MC"):!0}}else return!0}),e=e.filter(i=>{const s=i.key==="FORG";if(s||this.hasHint(i,"FL")){const h=i,f=g.searchByFSA(h);return f&&(E.mainBattle?E.newPre:E.newPost).includes(f.id)?f.aiHints().includes("RT")?!0:s?L.getCard(h.host).aiHints().includes("RD"):!1:!0}else return!0}),e}noHandDoubles(t){const e=[],i=[],s=[];return t.forEach(h=>{h.key==="HPLY"?e.push(h):i.push(h)}),e.forEach(h=>{const f=h.card;s.includes(f)||(s.push(f),i.push(h))}),i}async peeker(t){this.peeking=!0;const e=[],i=[];t.forEach(s=>{xi.includes(s.key)?i.push(s):e.push({root:s,peek:[s],wasPeek:!1,free:""})}),ue.saveState();for(let s=0;s0){let A="";if(h.key==="HPLY"){const C=h;C.cost!==""&&(A=C.cost)}e.push({root:h,peek:m,wasPeek:!0,free:A})}ue.restoreState()}return ue.popState(),this.peeking=!1,e}peekerReport(t){let e=0,i=0,s=0,h=[],f=[];t.forEach(m=>{const A=m.peek.length;if(A>0){const C=m.root.key;if(C==="HPLY")if(m.peek[0].key==="FORG")i+=A;else{const B=p.fastName(m.root.card)+": "+A;h.push(B)}else if(C==="MOVE")s+=A;else if(C==="ACTV"){const B=p.fastName(m.root.host)+": "+A;f.push(B)}else e+=A}}),p.debug("High complexity hit: Root: "+t.length),i>0&&p.debug("Forges: "+i),s>0&&p.debug("Mobility: "+s),h.forEach(m=>p.debug(m)),f.forEach(m=>p.debug(m)),e>0&&p.debug("Other: "+e)}hintWeight(t){let e=!1,i=!1,s="",h=0;if(t.key==="HDSC"?(s=t.host,i=!0):this.hasHint(t,"CD")?s=t.card:t.key==="HPLY"&&(s=t.card,e=!0),s){const f=L.getCard(s);h+=this.levelBonusFormula(f,!e,i),e&&(h+=this.hintAdjuster(f))}return h}levelBonusFormula(t,e,i){let s=0;const h=t.aiHints();return h.includes("LG")?(s+=1,h.includes("LM")&&(s+=.8)):h.includes("LB")?s-=1.3:e&&(s+=.4),i&&s>0&&(s=s/2.5),s}hintAdjuster(t){let e=0;const s=t.aiHints().find(h=>h.startsWith("ZZ"));return s&&(e=.5*parseInt(s.slice(2))),e}hasHint(t,e){return!t.hint||t.hint.length===0?!1:t.hint.includes(e)}logStats(t,e){const s=["Crt Cnt","Crt Val","Threat","P Health"].map((h,f)=>`${h}: ${this.numNum(e[f])}`).join(", ");console.log(t+s)}numNum(t){return t.length>6?t.charAt(0)==="-"?"NUNS":"KILL":t.padEnd(4)}cheater(){return R.aiMode&&R.aiActive&&T.options.cheater?new Ti(this.aiPlayer).cheatin():!1}peekAllCards(){const t=v.toPlayer(this.aiPlayer),e=t.deck.concat(t.hand,t.discard).sort();console.log(e.map(i=>p.fastName(i)).join(` +`))}peekDecks(){const t=v.toPlayer(!1),e=t.deck.map(f=>p.fastName(f)).sort(),i=t.hand.map(f=>p.fastName(f)).sort(),s=t.discard.map(f=>p.fastName(f)).sort(),h=["-- Deck --"].concat(e,"-- Hand --",i,"-- Discard --",s);console.log(h.join(` +`))}}const ot=new Bi;class Hi{getState(){const t={cCrd:this.currPlayCard,cCst:this.currPlayCost,cPos:this.currPlayPos,aa:this.actionHistory};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.currPlayCard=e.cCrd,this.currPlayCost=e.cCst,this.currPlayPos=e.cPos,this.actionHistory=e.aa}handleAction(t){if(t.key==="DEET"){jt.init(t.param);return}if(t.key==="HPLY"){this.playCardSelect(t);return}if(t.key==="FORG"){E.forgeCard(t,this.currPlayCard,this.currPlayCost,this.currPlayPos);return}if(t.key==="FITE"){li.fight(t.param==="M");return}if(t.key==="ENDT"){E.endTurn();return}if(t.key==="MOVE"){this.mobilitySelect(t);return}if(t.key==="MEND"){E.mobility(t);return}if(t.key==="HDSC"){this.currPlayCost="",E.cardPlayed(this.currPlayCard,this.currPlayCost,this.currPlayPos,!0),this.actionDone();return}if(t.key==="ACTV"){const e=g.jr5(t.param);L.getCard(e.code).startActivation(e);return}if(t.key==="NOTR"){t.param==="PM"&&bt.popMode(),this.actionDone(!0);return}if(t.key==="CARD"){L.getCard(t.host).handleAction(t);return}if(t.key==="CANC"||t.key==="CNCL"){t.param==="PM"&&bt.popMode(),this.actionHistory.pop(),this.ddf5();return}if(t.key==="USWP"){bt.popMode(),Lt.whatNext();return}if(t.key==="DTUP"){jt.updateDetails(t),gt.drawAll();return}if(t.key==="VWDK"){Ft.handleShowDeck(t);return}if(t.key==="SCRK"){Ft.handleDeckScroll(t);return}if(t.key==="SCRH"){t.param==="R"?R.ui.handScrollLeft+=1:R.ui.handScrollLeft-=1,gt.drawAll();return}if(t.key==="DRFT"){pt.resumeDraft(t.param);return}if(t.key==="SCRD"){pt.paginate(t.param==="D"),gt.drawAll();return}if(t.key==="UIBT"){Xe.handleUIButton(t);return}if(t.key==="MENU"){Xe.handleMainMenuButton(t);return}if(t.key==="MNBT"){Xe.handleMenuButton(t);return}if(t.key==="DSET"){this.ddf5(Pt.generateDeckPickerActions(parseInt(t.param)));return}if(t.key==="DECK"){Pt.handleDeckPick(t);return}if(t.key==="DBUG"){T.toggleDebug();return}}ddf5(t,e=!1){let i;if(t){const s=this.generateDetailActions();i=t.concat(s),this.actionHistory.push(i)}else i=this.actionHistory[this.actionHistory.length-1];R.aiActive?ot.processAction(i,e):gt.drawAll()}currPlayCard="";currPlayCost="";currPlayPos=-1;shiftPlayCard(t){t0&&e.canLevel()&&i.push(D.buttonTarget("HDSC",t.card));const s=D.toActions(i);return s.push(y.handSelectAction("CANC",t.card,"",t.position)),s}mobilitySelect(t){const e=this.getMoveCardActions(t);this.ddf5(e)}getMoveCardActions(t){if(t.key!=="MOVE")throw new Error("Unexpected action passed to getMoveCardActions: "+t.key);const e=g.ddf6(t);let i=[];if(t.param==="ACTV"){const s=y.actionTarget("TB","ACTV",e.code,e.id);i=D.toActions(s)}return i.push(y.fieldSelectAction("CANC",t.lane,t.playerA)),g.canMove(e).map(s=>{const h=y.fieldSelectAction("MEND",s,t.playerA);return h.param=e.id,h}).concat(i)}noneEndTrigger(){return D.toActions(D.buttonTarget("NOTR"))[0]}cancelAction(){return D.toActions(D.buttonTarget("CANC"))[0]}emptyAdjacents(t,e){const i=e||t.id,s=y.emptyPlayerActTarg("F","CARD",t.code,i);return s.lanes=t.adjacent,D.toActions(s)}generateDetailActions(){const t=bt.mode;if(R.aiActive)return[];if(t==="G"){const e=v.getLocal().hand.map((s,h)=>{const f=y.handSelectAction("DEET",s,"",h);return f.param=s,f}),i=g.qActiveCreats().map(s=>{const h=y.fieldSelectAction("DEET",s.lane,s.owner);return h.param=s.code,h});return e.concat(i)}else if(t==="D"){const e=pt.currentPack.map((s,h)=>{const f=y.draftSelectAction("DEET",h,!0);return f.param=`${s}1`,f}),i=pt.picksAsDeck.map((s,h)=>{const f=y.draftSelectAction("DEET",h,!1);return f.param=`${s.card}1`,f});return e.concat(i)}return[]}}const S=new Hi;class Ni{type="N0";events=[];triggerActions=[];deathCheck=!0;iaTrigLane=0;getState(){const t={type:this.type,events:this.events,tA:this.triggerActions,dC:this.deathCheck,tL:this.iaTrigLane};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.type=e.type,this.events=e.events,this.triggerActions=e.tA,this.deathCheck=e.dC,this.iaTrigLane=e.tL}startBatch(){this.deathCheck=!1,this.type==="C0"?this.type="C1":this.type==="C1"?this.type="C2":this.type==="C2"&&(this.type="N0");const t=this.type;let e;if(t==="N0")e=this.events.slice(),this.events=[];else{const s=this.events.filter(f=>f.code==="DIE"),h=this.events.filter(f=>f.code!=="DIE");t==="C1"?(e=h,this.events=s):(e=s,this.events=h)}const i=this.generateTriggers(e);this.triggerActions=this.sortTriggers(i),Lt.whatNext()}generateTriggers(t){let e;const i=t.map(s=>{s.code==="TRS"&&(e=s);const h=g.field.map(m=>m.triggers.map(A=>{const C=y.triggerReaction(s,A,m.owner,"C");return C.creatId=m.id,C.cardCode=m.code,C}).filter(A=>qe.ddf8(A))).flat(),f=[!0,!1].map(m=>v.toPlayer(m).triggers.map(C=>y.triggerReaction(s,C,m,"P")).filter(C=>qe.ddf8(C))).flat();return h.concat(f)}).flat();return e&&this.handleTurnStart(e),i}sortTriggers(t){const e=v.getActiveB(),i=t.filter(f=>!f.trigger.interactive&&f.owner===e),s=t.filter(f=>!f.trigger.interactive&&f.owner!==e);return t.filter(f=>f.trigger.interactive&&f.owner===e).concat(s,i)}handleTurnStart(t){const e=v.getActiveB();g.qPlayerCreats(e).filter(s=>s.sleeping).forEach(s=>{s.sleeping=!1});const i=R.tick();g.qActiveCreats().forEach(s=>{s.owner===t.playerA&&(s.activationAvailable=!0,s.mobilityAvailable=!0,s.sleeping=!1),s.armorDmg=0,s.poison>0&&s.hurtDirect(s.poison,"POIS",i),s.regen>0&&s.heal(s.regen),U.deathProdder(s,i)}),[v.playerA,v.playerB].forEach(s=>{s.armorDmg=0;const h=v.totalPoison(s);h>0&&v.hurtDirect(s,h,"POIS")})}getNextTrigger(){const t=this.triggerActions;if(t.length!==0)return t[t.length-1]}triggerDone(){this.triggerActions.length===0?console.error("batch.triggerDone() was called when there is no trigger actions"):(this.triggerActions.pop(),this.iaTrigLane=0),Lt.whatNext()}addEvents(...t){this.events.push(...t)}}const x=new Ni;class Fi{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new ci(t)}get(t){return this.registry[t]}}const rt=new Fi;class Pi extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Abraxas, Avatar of Kadras",this.iAttack=this.boof4712,this.iHealth=this.lValN([7,11,21]),this.tribe.push("HY");const e=this.lValS(["Give an adjacent creature","Each adjacent creature gets","Each other friendly creature gets"]);this.text=`Activate: ${e} 2x attack this turn.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}targ(t){const e=y.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(e.lanes=t.adjacent),e}canActivate(t){return g.creatByTarget(this.targ(t)).length>0}startActivation(t){let e;this.level===1?e=this.targ(t):(e=D.boardTarget("CARD",this.code),e.param=t.id),e.hint=["BB"],S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){const e=g.jr5(t.param);if(t.zone==="F"){const i=g.ddf6(t);this.logAct(!0,i),this.applyMod(i,e.id)}else{this.logAct(!0);const i=this.targ(e);g.creatByTarget(i).forEach(s=>{this.applyMod(s,e.id)})}e.endActivation()}applyMod(t,e){const i=y.mod("AT",t.attack,e);i.expiry="ET",t.addMod(i)}}class Mi extends M{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Abyssal Brute",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.text=`When ${this.name} or another friendly creature enters a side lane, that creature gets ${p.jr9(this.level,this.level,!0)} and Regenerate ${this.level}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("EF");s.bonus=this.buffNug(this.level,this.level);const h=i.jr4("MV");return h.bonus=this.regnNug(this.level),i}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const e=V.toCreature(t.event),i=e.creature.lane;return(i===1||i===5)&&e.creature.owner===t.owner}return!1}jr8(t){const e=V.toCreature(t.event);e.creature.buff(this.level,this.level),e.creature.addRegen(this.level),x.triggerDone()}}class Ri extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Ambriel Archangel",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.iAttack+1,this.tribe.push("AG");const e=this.boof101520;this.text=`While ${this.name} is your only friendly creature, you get Armor ${e}, and this gets Armor ${this.level+1} and Mobility 1.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){const i=e.status==="A",s=y.crNotMeTarg(e.id);s.player=v.toTarget(e.owner);const h=g.creatByTarget(s);if(i&&h.length===0){const f=y.mod("AR",this.boof101520,e.id);v.addModSafe(e.owner,f);const m=y.mod("AR",this.level+1,e.id),A=y.mod("MB",1,e.id);e.addModSafe(m),e.addModSafe(A)}else v.removeModSafe(e.owner,e.id),e.removeModSafe(e.id)}}class xe extends M{lookup(t){return{["LLD"]:{c:()=>this.demC(),t:i=>this.demT(i)},["LLG"]:{c:()=>this.golC(),t:i=>this.golT(i)},["LLS"]:{c:()=>this.senC(),t:i=>this.senT(i)},["LLT"]:{c:()=>this.tyrC(),t:i=>this.tyrT(i)}}[t]}testAmbush(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}ddf8(t){return!ot.simOn&&this.testAmbush(this.cardCode(),t)}jr8(t){const e=this.cardCode(),i=v.toPlayer(t.owner),s=i.hand.length;for(let h=s-1;h>-1;h--){const f=i.hand[h];f.startsWith(e)&&(p.new().crd(f).txt(" Ambushed.").go(),g.birth(f,"S",i.isPlayerA),E.levelAndDiscard(f,h,!1,"E"))}x.triggerDone()}ambT(){return`Spawn a ${this.name}. Then discard ${this.level===3?"":"and level up "} ${this.name}.`}demC(){this.faction="N",this.rarity="H",this.name="Leyline Demon",this.iAttack=this.lValN([3,9,14]),this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.text="Ambush: When the enemy player plays a card, if it is their third card played that turn, "+this.ambT()}demT(t){if(t.event.code==="PLC"){const e=t.event;return t.owner!==e.playerA&&E.cardsPlayed===3}else return!1}golC(){this.faction="U",this.rarity="H",this.name="Leyline Golem",this.iAttack=this.lValN([5,12,18]),this.iHealth=this.iAttack-(this.level+1),this.tribe.push("GL"),this.text="Ambush: When an enemy creature moves on the enemy player's turn, "+this.ambT()}golT(t){if(t.event.code==="MOV"){const e=V.toCreature(t.event);return t.owner!==e.creature.owner&&v.getActiveB()===e.creature.owner}else return!1}senC(){this.faction="A",this.rarity="H",this.name="Leyline Sentry",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.iAttack+this.level+5,this.tribe.push("RB"),this.text="Ambush: When an enemy creature enters play on the enemy player's turn, if it wasn't Forged, "+this.ambT()}senT(t){if(t.event.code==="ENT"){const e=V.toEnterField(t.event);return t.owner!==e.creature.owner&&v.getActiveB()===e.creature.owner&&!e.forged}else return!1}tyrC(){this.faction="T",this.rarity="H",this.name="Leyline Tyrant",this.iAttack=this.lValN([6,12,17]),this.iHealth=this.iAttack-2,this.tribe.push("GT"),this.text="Ambush: When an enemy player gains health on their turn, "+this.ambT()}tyrT(t){if(t.event.code==="PHL"){const e=t.event;return t.owner!==e.playerA&&v.getActiveB()===e.playerA}else return!1}}class Ei extends M{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Apocrymancer",this.iAttack=this.boof3713,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.text="When you play an Alloyin spell, you may discard and level up a card."}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.bonus=this.rawNug(0,0,0,0,.5),s.interactive=!0,i}handleAction(t){E.levelAndDiscardA(t),S.actionDone(!0)}ddf8(t){if(t.event.code==="PLC"){const e=t.event;if(e.playerA===t.owner){const i=L.getCard(e.cardCode);if(i.type==="S"&&i.faction==="A")return!0}}return!1}jr8(t){const e=y.lvlHandActTarg(this.code,t.creatId);S.ddf5(D.toActions([e,D.buttonTarget("NOTR")]))}}class Ii extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Arboris, Grove Dragon",this.iAttack=this.lValN([5,9,20]),this.iHealth=this.iAttack,this.tribe.push("DG");const e=this.boof;this.text=`While you have over 120 health, Arboris gets ${p.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e);return i.addEffect("PH",this.code),i}enforceEffect(t,e){if(v.toPlayer(e.owner).health>120&&e.status==="A"){const s=this.boof;e.addModSafe(y.mod("HL",s,e.id)),e.addModSafe(y.mod("MH",s,e.id)),e.addModSafe(y.mod("AT",s,e.id))}else e.removeModSafe(e.id)}get boof(){return this.lValN([4,8,80])}}class Li extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Ash Maiden",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("HM"),this.text=`When a friendly creature ${p.dbdtap()}, it gets ${p.jr9(this.level,this.level)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),i}ddf8(t){if(t.trigger.type==="DM"){const e=V.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}return!1}jr8(t){const e=V.toDamage(t.event);this.logAct(!1,e.srcCreat),e.srcCreat.buff(this.level,this.level),x.triggerDone()}}class Be extends M{constructor(t){super(t),this.rarity="H",this.iAttack=this.level+2,this.iHealth=this.iAttack;const e=this.cardCode();e==="SFA"?this.steel():e==="RFA"?this.root():e==="HFA"?this.hell():e==="SGA"&&this.storm(),this.text=`Forge: ${this.name} gets ${p.jr9(this.level,this.level)} for each ${p.factionText(this.faction)} card in your hand.`}hell(){this.faction="N",this.name="Hellforged Avatar",this.iRegen=this.level,this.tribe.push("AB")}root(){this.faction="U",this.name="Rootforged Avatar",this.iBT=!0,this.tribe.push("HM")}steel(){this.faction="A",this.name="Steelforged Avatar",this.iArmor=this.level,this.tribe.push("CY")}storm(){this.faction="T",this.name="Stormforged Avatar",this.iMobile=this.level,this.tribe.push("MT")}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){const e=V.toEnterField(t.event),i=v.toPlayer(t.owner).hand.filter(s=>L.getCard(s).faction===this.faction).length;if(i>0){const s=i*this.level;e.creature.buff(s,s)}x.triggerDone()}}class z extends M{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["COZ"]:()=>this.cooze(),["DZA"]:()=>this.dozer(),["FWG"]:()=>this.feywing(),["FUN"]:()=>this.funguy(),["POZ"]:()=>this.purpz(),["NSD"]:()=>this.fixedSeedling(1),["OOZ"]:()=>this.nooze(),["RPT"]:()=>this.raptor(),["SPL"]:()=>this.minion(),["SXP"]:()=>this.fixedSapling(5),["SXD"]:()=>this.fixedSeedling(3),["SXT"]:()=>this.fixedTreefolk(7),["SDL"]:()=>this.minion(),["SPN"]:()=>this.nekSpirit(),["SPU"]:()=>this.uspirit(),["XYR"]:()=>this.yuruSpirit(),["TFK"]:()=>this.minion(),["TFD"]:()=>this.fixedTreefolk(this.boof5714),["TFF"]:()=>this.tfFight(),["TTF"]:()=>this.fixedTreefolk(3),["ZTR"]:()=>this.zimus(),["ZBS"]:()=>this.threeZomb(),["ZST"]:()=>this.strideZomb(),["ZMB"]:()=>this.commonZomb()}[t]}constructor(t){super(t),this.rarity="T";const e=this.cardCode();this.imgKey=e,this.minLevel=this.level,this.maxLevel=this.level,this.lookup(e)()}image(t){return this.rawImage(this.imgKey,t)}static fgoc(t){return "FGO"+t}fixedNekSpirit(t){this.faction="N",this.rarity="T",this.name="Spirit",this.tribe.push("ST"),this.iAttack=t,this.iHealth=t,this.imgKey=`${"SPN"}${this.level}`}nekSpirit(){this.fixedNekSpirit(this.boof51015)}yuruSpirit(){this.fixedNekSpirit(this.boof5814)}static purpOzC(t){return "POZ"+t}oozer(t){this.faction="N",this.rarity="T",this.name="Oozeling",this.tribe.push("OZ"),this.iHealth=this.iAttack,this.imgKey=t?"POZ":"OOZ"}purpz(){this.iAttack=this.boof135,this.oozer(!0)}nooze(){this.iAttack=this.boof4711,this.oozer(!1)}cooze(){this.iAttack=1,this.oozer(!1),this.hints=["RT"]}minion(){this.iAttack=z.minionBuff(this.level),this.plont(),this.name=z.minionName(this.level),this.hints=["RT"]}static tffc(t){return "TFF"+t}static minionCode(t){return(t===1?"SDL":t===2?"SPL":"TFK")+t}static minionName(t){return t===1?"Seedling":t===2?"Sapling":"Treefolk"}static minionBuff(t){return t===1?1:t===2?3:5}plont(){this.faction="U",this.iHealth=this.iAttack,this.tribe.push("PL")}fixedSapling(t){this.iAttack=t,this.plont(),this.name=z.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.iAttack=t,this.plont(),this.name=z.minionName(1),this.imgKey="SDL",this.hints=["RT"]}fixedTreefolk(t){this.iAttack=t,this.plont(),this.name=z.minionName(3),this.imgKey="TFK"}tfFight(){this.iAttack=this.boof91421,this.plont(),this.name=z.minionName(3),this.imgKey="TFK"}dozer(){this.faction="U",this.name="Dozer, the Awakened",this.iAttack=this.level*3+6,this.iHealth=this.iAttack,this.iAggro=!0,this.iBT=!0,this.tribe.push("BR"),this.imgKey=this.code,this.text=`${this.name} enters play with health equal to the Dozer, the Dormant it replaced.`}feywing(){this.faction="U",this.name="Feywing",this.iAttack=9,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("DG")}funguy(){this.name="Funguy",this.iAttack=this.lValN([6,12,14]),this.plont(),this.minLevel=1,this.maxLevel=3,this.level===1?this.hints=["ZZ-1"]:this.level===2&&(this.hints=["LB"])}raptor(){this.faction="U",this.name="Raptor",this.iAttack=1,this.iHealth=1,this.tribe.push("DN"),this.hints=["RT"]}uspirit(){this.faction="U",this.name="Spirit",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("ST")}static zomc(t){return "ZMB"+t}zimus(){this.faction="N",this.rarity="L",this.name="Zimus, the Returned",this.tribe.push("ZB"),this.iAttack=10,this.iHealth=5,this.imgKey=`${"ZTU"}2`}zomb(t,e){this.faction="N",this.rarity="T",this.name="Zombie",this.tribe.push("ZB"),this.iAttack=t,this.iHealth=e,this.imgKey="ZMB"}commonZomb(){const t=this.boof359;this.zomb(t,t)}threeZomb(){this.zomb(3,3)}strideZomb(){this.zomb(this.lValN([4,8,10]),this.boof369)}}class ft extends kt{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ()},["ABE"]:{c:()=>this.edicC(),z:()=>this.edicZ()},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ()},["COD"]:{c:()=>this.chontC(),z:()=>this.chontZ()},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ()},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ()},["DGW"]:{c:()=>this.drwkC(),z:()=>this.drwkZ()},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ()},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ()},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ()},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ()},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ()},["IVS"]:{c:()=>this.infvC(),z:()=>this.infvZ()},["LOD"]:{c:()=>this.lashC(),z:()=>this.lashZ()},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ()},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ()},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ()},["PLW"]:{c:()=>this.palwC(),z:()=>this.palwZ()},["PTB"]:{c:()=>this.phyC(),z:()=>this.phyZ()},["PYS"]:{c:()=>this.pyreC(),z:()=>this.pyreZ()},["ROK"]:{c:()=>this.rokC(),z:()=>this.rokZ()},["STS"]:{c:()=>this.stsC(),z:()=>this.stsZ()},["SNP"]:{c:()=>this.pulseC(),z:()=>this.pulseZ()},["SRD"]:{c:()=>this.sradC(),z:()=>this.sradZ()},["SIV"]:{c:()=>this.beesC(),z:()=>this.beesZ()},["TST"]:{c:()=>this.talinC(),z:()=>this.talinZ()},["TRN"]:{c:()=>this.turnbC(),z:()=>this.turnbZ()},["VCH"]:{c:()=>this.verdC(),z:()=>this.verdZ()},["WOD"]:{c:()=>this.wdenC(),z:()=>this.wdenZ()}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){return this.cardCode()==="NSH"?this.leveledImage(t):this.fixedImage(t)}playTargets(){const t=super.playTargets();if(this.cardCode()==="ABE"&&this.aeSides().some(i=>i.length===0))return t;const e=D.boardTarget("CARD",this.code);return t.push(e),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),S.spellCast()}ddf8(t){return Dt.extractCardCode(t.trigger.logicCode)==="DGW"&&t.trigger.type==="TE"}jr8(t){if(Dt.extractCardCode(t.trigger.logicCode)==="DGW"){const i=g.jr5(t.trigger.creatId);i.status==="A"&&U.destroy(i,this.code)}x.triggerDone()}apulseC(){this.faction="A",this.rarity="C",this.name="Aegis Pulse",this.text=`Each friendly creature gets Armor ${this.boof234}.`}apulseZ(){const t=this.boof234;g.ddf1().forEach(e=>{e.addArmor(t)})}aeSides(){return[g.qPlayerCreats(!0),g.qPlayerCreats(!1)]}edicC(){this.faction="A",this.rarity="H",this.name="Ambriel's Edict",this.maxLevel=1,this.overload=!0,this.text="If each player has at least one creature in play, destroy all but the highest attack creature that each player controls.~Then discard you hand."}edicZ(){const t=this.aeSides(),e=R.tick();let i=[];t.forEach(m=>{if(m.length>1){let A=[],C=-999999;m.forEach(B=>{B.attack>C?(C=B.attack,i.push(...A),A=[B]):B.attack===C?A.push(B):i.push(B)}),A.length>1&&(A.splice(T.randInt(0,A.length),1),i.push(...A))}}),i.forEach(m=>U.destroy(m,this.code,e));const s=v.getActive(),h=S.playPosition(),f=s.hand.length;for(let m=f-1;m>-1;m--)m!==h&&(s.discard.push(s.hand[m]),s.hand.splice(m,1),S.shiftPlayCard(m))}get ctlboof(){return(this.level-1)*2}ctlC(){this.faction="T",this.rarity="L",this.name="Call the Lightning";const t=this.level>1?` gets ${p.jr9(this.ctlboof,0)} this turn. Those creatures`:"";this.text=`Each friendly creature${t} battles an additional time this turn.`}ctlZ(){const t=this.ctlboof;g.ddf1().forEach(e=>{const i=y.mod("AT",t,this.code);i.expiry="ET",e.addMod(i),e.extraBattles+=1})}chontC(){this.faction="T",this.rarity="R",this.name="Chant of Dragonwatch",this.maxLevel=1,this.text="Deal X damaage to each enemy creature, where X is your rank."}chontZ(){const t=v.getActive().rank,e=R.tick();g.qEnemyCreats().forEach(i=>{i.hurtDirect(t,this.code,e)})}dcurC(){this.faction="N",this.rarity="R",this.name="Death Current";const t=this.lValS(["a level 2 or lower","an","two"]);this.text=`Destroy ${t} enemy creature at random.`}dcurZ(){const t=this.dCurrHunter(),e=t.length;if(e>0){const i=T.randInt(0,e),s=R.tick();U.destroy(t[i],this.code,s),this.level===3&&e>1&&(t.splice(i,1),U.destroy(t[T.randInt(0,e-1)],this.code,s))}}dCurrHunter(){const t=y.crEnemyTarg();return t.level=D.ddf2(this.level+1),g.creatByTarget(t)}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${p.jr9(this.boof4812n,0)}.`}digiZ(){const t=this.boof4812n;g.qEnemyCreats().forEach(e=>{e.buff(t,0)})}drwkC(){this.faction="T",this.rarity="L",this.name="Dragonwake",this.text=`Search your deck for a ${p.levelGateText(this.level+1,!0)}Dragon and Spawn a copy of it. It gets Aggressive${this.level===3?".":' and "At the end of your turn, destroy this.'}`}drwkZ(){const t=y.target("DK");t.tribe="DG",t.level=D.ddf2(this.level+1),t.player="F";const e=D.deckByTarget(t),i=e.length;if(i>0){const s=g.birth(e[T.randInt(0,i)][0],"S",v.getActiveB());if(s&&(s.aggressive=!0,this.level<3)){const h=s.jr4("TE",this.code);h.creatId=s.id,h.changes=!0}}}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${p.jr9(t,t)}.`}epiZ(){const t=this.boof246n,e=y.crEnemyTarg();g.creatByTarget(e).forEach(i=>{i.buff(t,t)})}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${p.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;g.ddf1().forEach(e=>{e.buff(t,t),this.level===3&&(e.breakthrough=!0)})}get fszap(){return this.level+4}fstormC(){this.faction="T",this.rarity="H",this.name="Firestorm",this.text=`Deal ${this.fszap} damage to each creature.`}fstormZ(){const t=this.fszap,e=R.tick();g.qActiveCreats().forEach(i=>{i.hurtDirect(t,this.code,e)})}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${p.jr9(-1*t,0)}. Each friendly creature gets ${p.jr9(t,0)}.`}mealZ(){const t=this.boof234,e=v.getActiveB();g.qActiveCreats().forEach(i=>{const s=i.owner===e?t:-1*t;i.buff(s,0)})}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${p.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,e=y.crFriendTarg();g.creatByTarget(e).forEach(i=>{i.buff(0,t)})}infvC(){this.faction="N",this.rarity="C",this.name="Infernal Visage";const t=this.boof246;this.text=`Each friendly creature in a side lane gets ${p.jr9(t,t,!0)} and Regenerate ${this.level}.`}infvZ(){const t=this.boof246,e=y.crFriendTarg();e.lanes=[1,5],g.creatByTarget(e).forEach(i=>{i.buff(t,t),i.addRegen(this.level)})}lashC(){this.faction="U",this.rarity="L",this.name="Lash of Demara",this.text=`Each enemy creature gets Poison ${this.level+2}.`}lashZ(){const t=this.level+2;g.qEnemyCreats().forEach(e=>{e.addPoison(t)})}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=L.getCard(this.ndc());this.text=`Spawn a ${p.tokName(t)}.`}shriekZ(){g.birth(this.ndc(),"S",v.getActiveB())}ndc(){return "NDR"+this.level}noxC(){this.faction="U",this.rarity="R",this.name="Noxious Cloud",this.text=`Each enemy creature gets Poison ${this.boof246}.`}noxZ(){const t=this.boof246;g.qEnemyCreats().forEach(e=>{e.addPoison(t)})}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${p.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)g.ddf1().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;g.ddf1().forEach(e=>{e.buff(t,0)})}}palwC(){this.faction="A",this.rarity="R",this.name="Palladium Wave",this.maxLevel=1,this.text=`Each enemy creature gets ${p.jr9(-1,0).replaceAll("1","X")}, where X is two times your rank.`}palwZ(){const t=-2*v.getActive().rank;g.qEnemyCreats().forEach(e=>{e.buff(t,0)})}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=L.getCard(z.minionCode(this.level));this.text=`Put a ${p.tokName(t)} into each players available lanes.`}phyZ(){const t=z.minionCode(this.level),e=R.tick();[!0,!1].forEach(i=>{g.emptyLanes(i).forEach(s=>{g.birth(t,"P",i,s,e)})})}pyreC(){this.faction="T",this.rarity="C",this.name="Pyre Song",this.text=`Each friendly creature deals ${this.level} damage to each enemy creature.`}pyreZ(){const t=this.level,e=R.tick(),i=g.qEnemyCreats();g.ddf1().forEach(s=>{i.forEach(h=>{h.hurtDirect(t,s.code,e)})})}rokC(){this.faction="T",this.rarity="L",this.name="Rage of Kadras",this.overload=!0,this.maxLevel=1,this.text="Each friendly Tempys creature gets +1 attack and deals damage equal to its attack to the creature opposing it."}rokZ(){const t=R.tick(),e=y.crFriendTarg();e.faction="T",g.creatByTarget(e).forEach(i=>{i.buff(1,0);const s=i.opposed;s&&s.hurtDirect(i.attack,i.code,t)})}stsC(){this.faction="U",this.rarity="C",this.name="Scatter the Seeds";const t=L.getCard(z.minionCode(this.level));this.text=`Spawn three ${p.tokName(t)}s.`}stsZ(){const t=z.minionCode(this.level),e=R.tick();[1,2,3].forEach(i=>{g.birth(t,"S",v.getActiveB(),void 0,e)})}get spboof(){return(this.level+1)*-2}pulseC(){this.faction="A",this.rarity="H",this.name="Sonic Pulse",this.text=`Each enemy creature gets ${p.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;g.qEnemyCreats().forEach(e=>{e.buff(t,0)})}sradC(){this.faction="U",this.rarity="C",this.name="Soothing Radiance",this.text=`Heal ${this.boof61224} damage from each friendly creature.`}sradZ(){const t=this.boof61224;g.ddf1().forEach(e=>{e.heal(t)})}beec(){return "KBE"+this.level}beesC(){this.faction="U",this.rarity="H",this.name="Stinging Invocation";const t=L.getCard(this.beec());this.text=`Spawn one to three ${p.tokName(t)}s.`}beesZ(){const t=this.beec(),e=R.tick(),i=T.randInt(2,5);[1,2,3].forEach(s=>{s{const i=y.mod("AT",t);i.expiry="ET",e.addMod(i)})}talinTarg(){const t=y.crFriendTarg();return t.faction="T",g.creatByTarget(t)}turnbC(){this.faction="T",this.rarity="H",this.name="Turnabout",this.isFree=this.level===3;const t=this.boof235;this.text=`Each creature gets ${p.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,e=-1*t;g.qActiveCreats().forEach(i=>{const s=y.mod("AT",t),h=y.mod("HL",e),f=y.mod("MH",e);s.expiry="ET",h.expiry="ET",f.expiry="ET",i.addMod(s),i.addMod(h),i.addMod(f)})}verdC(){this.faction="U",this.rarity="H",this.name="Verdant Charge";const t=this.verdb;this.text=`Each friendly creature gets ${p.jr9(t,t,!0)} and Regenerate ${t}.`}verdZ(){const t=this.verdb;g.ddf1().forEach(e=>{e.buff(t,t),e.addRegen(t)})}get verdb(){return this.lValN([1,3,6])}wdenC(){this.faction="U",this.rarity="R",this.name="Whispers of Dendris",this.maxLevel=1,this.text=`Each friendly creature gets ${p.jr9(1,1).replaceAll("1","X")}, where X is your rank.`}wdenZ(){const t=v.getActive().rank;g.ddf1().forEach(e=>{e.buff(t,t)})}}class Gi extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Borean Mystic",this.iAttack=this.boof4814,this.iHealth=this.boof71118,this.tribe.push("WN","AS"),this.text=`Activate: Move another friendly creature to an available lane adjacent to ${this.name}.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=g.jr5(e[1]),h=this.emptySloots(s,i.id);h.push(S.cancelAction()),S.ddf5(h)}else{const i=g.jr5(e[1]),s=g.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),i.endActivation()}}emptySloots(t,e=""){return S.emptyAdjacents(t,T.enTil("P2",t.id,e))}buddies(t){return D.toActions(y.crFriendNotMeActTarg("CARD",t,this.code,T.enTil("P1",t)))}}class $i extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Bron, Wild Tamer",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hints=["RD"];const e=this.boof357;this.text=`Upgrade Dinosaur: Replace Bron with a level ${this.level} Dino Knight.~When this ${p.dbdtap()}, heal ${e} damage from each other friendly creature.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("UP");const s=i.jr4("DM");return s.bonus=this.buffNug(0,this.boof357),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="UP"){const i=V.toReplaced(t.event).replCreat;i.isTribe("DN")&&g.birth("DNK"+this.level,"R",i.owner,i.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,i=y.crNotMeTarg(t.creatId);i.player=v.toTarget(t.owner),g.creatByTarget(i).forEach(h=>h.heal(e)),x.triggerDone()}}}class Wi extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Brightsteel Gargoyle",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("RB"),this.text=`At the end of your turn, ${this.name} gets Armor ${this.boof2510} and Defender until the end of the next turn.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("PT"),i}ddf8(t){return t.trigger.type==="PT"?t.event.playerA===t.owner:!1}jr8(t){const e=y.mod("AR",this.boof2510,t.creatId),i=y.mod("DF",!0,t.creatId);e.expiry="ET",i.expiry="ET";const s=g.jr5(t.creatId);s.addMod(e),s.addMod(i),x.triggerDone()}}class Ui extends kt{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Bullwark Bash",this.text=`Deal damage equal to ${this.level>1?this.level+"x ":""}the Armor on a friendly creature to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");e.hasArmor=!0,t.push(e)}return t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=this.enemyTargActions(i.id);s.push(S.cancelAction()),S.ddf5(s)}else{const i=g.ddf6(t),s=g.jr5(e[1]);this.logSpell(s),i.hurtDirect(s.armor*this.level,this.code),S.spellCast()}}enemyTargActions(t=""){const e=y.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return D.toActions(e)}}class Vi extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Byzerak Spitemage",this.iAttack=this.boof369,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("HM"),this.text=`Allied Nekrium: When ${this.name} ${p.dbdtac(this.level)}, destroy it.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}ddf8(t){if(t.trigger.type==="DM"){const e=V.toDamage(t.event);return e.battle&&e.isCreatSrc&&e.isCreatTarg&&e.dmg>0&&e.srcId===t.creatId&&D.levelTestCommon(e.hurtCreat.level,this.level)}else return!1}jr8(t){if(t.trigger.type==="FR"&&E.allied("N")){const e=g.jr5(t.creatId),i=e.jr4("DM");i.bonus=this.avgSpawnNug(),e.changed=!0}else if(t.trigger.type==="DM"){const i=V.toDamage(t.event).hurtCreat;i.status==="A"&&U.destroy(i,this.code)}x.triggerDone()}}class Oi extends M{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Cercee, Hand of Varna",this.iAttack=this.lValN([1,3,5,7]),this.iHealth=this.lValN([6,10,20,40]),this.tribe.push("FB"),this.hints=["ZZ-2"],this.iMobile=1,this.maxLevel=4;const e=this.level===4?`When ${this.name} ${p.dbdtap()}, deal damamge to that player equal to their health.~`:"";this.text=e+`When ${this.name} ${p.dbdtac(this.level)}, destroy that creature.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return this.level===4?s.bonus=this.rawNug(0,0,0,0,10):s.bonus=this.avgSpawnNug(),i}ddf8(t){if(t.trigger.type==="DM"){const e=V.toDamage(t.event);if(e.battle&&e.isCreatSrc&&e.srcId===t.creatId){if(this.level===4)return!0;if(e.isCreatTarg){const i=e.hurtCreat;return D.levelTestCommon(i.level,this.level)}}}return!1}jr8(t){const e=V.toDamage(t.event);if(e.isCreatTarg){const i=e.hurtCreat;i.status==="A"&&U.destroy(i,this.code)}else v.hurtDirect(e.hurtPlayer,e.hurtPlayer.health,this.code);x.triggerDone()}}class mt extends M{lookup(t){return{["BSW"]:{c:()=>this.bswC(),a:(i,s)=>this.bswA(i,s),t:i=>this.bswT(i)},["CCS"]:{c:()=>this.ccsC(),a:(i,s)=>this.ccsA(i,s),t:i=>this.ccsT(i)},["CGL"]:{c:()=>this.clordC(),a:(i,s)=>this.clordA(i,s),t:i=>this.clordT(i)},["CSH"]:{c:()=>this.cswC(),a:(i,s)=>this.cswA(i,s),t:i=>this.cswT(i)},["FFU"]:{c:()=>this.ffuC(),a:(i,s)=>this.ffuA(i,s),t:i=>this.ffuT(i)},["FFS"]:{c:()=>this.ffsC(),a:(i,s)=>this.ffsA(i,s),t:i=>this.ffsT(i)},["FSH"]:{c:()=>this.fssC(),a:(i,s)=>this.fssA(i,s),t:i=>this.fssT(i)},["KOD"]:{c:()=>this.kodC(),a:(i,s)=>this.kodA(i,s),t:i=>this.kodT(i)},["LOD"]:{c:()=>this.lashC(),a:(i,s)=>this.lashA(i,s),t:i=>this.lashT(i)},["MBP"]:{c:()=>this.mbpC(),a:(i,s)=>this.mbpA(i,s),t:i=>this.mbpT(i)},["MND"]:{c:()=>this.mndC(),a:(i,s)=>this.mndA(i,s),t:i=>this.mndT(i)},["NCS"]:{c:()=>this.ncsC(),a:(i,s)=>this.ncsA(i,s),t:i=>this.ncsT(i)},["NXG"]:{c:()=>this.nxgC(),a:(i,s)=>this.nxgA(i,s),t:i=>this.nxgT(i)},["NFF"]:{c:()=>this.nffC(),a:(i,s)=>this.nffA(i,s),t:i=>this.nffT(i)},["OHV"]:{c:()=>this.orghC(),a:(i,s)=>this.orghA(i,s),t:i=>this.orghT(i)},["PPM"]:{c:()=>this.ppmC(),a:(i,s)=>this.ppmA(i,s),t:i=>this.ppmT(i)},["PSC"]:{c:()=>this.pcoilC(),a:(i,s)=>this.pcoilA(i,s),t:i=>this.pcoilT(i)},["SGF"]:{c:()=>this.siggyC(),a:(i,s)=>this.siggyA(i,s),t:i=>this.siggyT(i)},["SRM"]:{c:()=>this.srmdC(),a:(i,s)=>this.srmdA(i,s),t:i=>this.srmdT(i)},["SSA"]:{c:()=>this.ssaC(),a:(i,s)=>this.ssaA(i,s),t:i=>this.ssaT(i)},["SWM"]:{c:()=>this.swmC(),a:(i,s)=>this.swmA(i,s),t:i=>this.swmT(i)},["UCM"]:{c:()=>this.ucmC(),a:(i,s)=>this.ucmA(i,s),t:i=>this.ucmT(i)},["UIM"]:{c:()=>this.uimC(),a:(i,s)=>this.uimA(i,s),t:i=>this.uimT(i)},["WMR"]:{c:()=>this.warmC(),a:(i,s)=>this.warmA(i,s),t:i=>this.warmT(i)},["WWR"]:{c:()=>this.wwrC(),a:(i,s)=>this.wwrA(i,s),t:i=>this.wwrT(i)},["WFS"]:{c:()=>this.wfsC(),a:(i,s)=>this.wfsA(i,s),t:i=>this.wfsT(i)},["XSH"]:{c:()=>this.shambC(),a:(i,s)=>this.shambA(i,s),t:i=>this.shambT(i)},["ZPM"]:{c:()=>this.zpmC(),a:(i,s)=>this.zpmA(i,s),t:i=>this.zpmT(i)}}[t]}targAction(t,e,i){this.lookup(t).a(e,i)}actTargets(t,e){return this.lookup(t).t(e)}xl=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return this.doubleActivator()&&(i.jr4("TS"),this.addExtraActivate(i)),i}canActivate(t){return D.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){const e=D.toActions([this.actTargets(this.cardCode(),t),D.buttonTarget("CANC")]);S.ddf5(e)}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.logAct(!0,this.xl?e:void 0),this.targAction(this.cardCode(),e,i),i.endActivation()}makeCreatTarg(t){return y.crActTarg("CARD",this.code,t.id)}makeOtherCreatTarg(t){const e=this.makeCreatTarg(t);return e.notMe=t.id,e}doubleActivator(){return this.code==="CGL"+"3"||this.code==="XSH"+"3"}ddf8(t){return Dt.extractCardCode(t.trigger.logicCode)==="KOD"&&(t.trigger.type==="PT"||t.trigger.type==="VN")?!0:t.trigger.type==="TS"&&this.doubleActivator()?t.event.playerA===t.owner:super.ddf8(t)}jr8(t){if(t.trigger.type==="VN"){const e=t.event,i=g.jr5(e.creatId);g.birth(i.code,"S",t.owner),x.triggerDone()}else if(t.trigger.type==="PT"){const e=t.trigger.customCode,i=g.jr5(t.creatId);i.triggers.filter(h=>h.customCode===e).forEach(h=>i.removeTrigger(h)),x.triggerDone()}else if(t.trigger.type==="TS"){const e=g.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}bswC(){this.faction="T",this.rarity="C",this.name="Borean Stormweaver",this.iAttack=this.boof4816,this.iHealth=this.lValN([6,10,20]),this.tribe.push("GT"),this.xl=!1;const t=this.boof234;this.text=`Activate: Deal ${t} damage to a creature.`,this.bonus={activ8:this.buffNug(0,t)}}bswT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}bswA(t,e){t.hurtDirect(this.boof234,this.code)}ccsC(){this.faction="N",this.rarity="C",this.name="Catacomb Spider",this.iAttack=this.boof4815,this.iHealth=this.lValN([5,10,16]),this.tribe.push("SP");const t=this.boof246;this.text=`Activate: Give another creature Regenerate ${t}.`,this.bonus={activ8:this.regnNug(t)}}ccsT(t){const e=this.makeOtherCreatTarg(t);return e.canRegen=!0,e.hint=["BF"],e}ccsA(t,e){t.addRegen(this.boof246)}clordC(){this.faction="N",this.rarity="H",this.name="Contagion Lord",this.iAttack=this.boof4914,this.iHealth=this.iAttack+3,this.tribe.push("AB"),this.xl=!1,this.text="Activate, destroy a friendly Abomination: You may play an additional card this turn.",this.level===3&&(this.text+="~You may use this ability twice per turn."),this.bonus={activ8:this.multNug(this.avgSpawnNug(),.3)}}clordT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="AB",e}clordA(t,e){U.destroy(t,this.code),E.regularPlays+=1}cswC(){this.faction="A",this.rarity="C",this.name="Cypien Shieldwarden",this.iAttack=this.boof4610,this.iHealth=this.boof61016,this.tribe.push("HM");const t=this.boof246;this.text=`Activate: Give a creature Armor ${t} this turn.`,this.bonus={activ8:this.regnNug(t)}}cswT(t){const e=this.makeCreatTarg(t);return e.canArmor=!0,e.hint=["BF"],e}cswA(t,e){const i=y.mod("AR",this.boof246,e.id);i.expiry="ET",t.addMod(i)}ffuC(){this.faction="T",this.rarity="H",this.name="Firefist Uranti",this.iAttack=this.boof357,this.iHealth=this.boof71116,this.tribe.push("FR","YT"),this.xl=!1,this.text=`Activate: Deal damage equal to ${this.name}'s attack to a creature.`,this.bonus={activ8:this.buffNug(0,this.iAttack)}}ffuT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],t.attack<1&&(e.victims="???"),e}ffuA(t,e){t.hurtDirect(e.attack,this.code)}ffsC(){this.faction="T",this.rarity="R",this.name="Flamefury Shaman",this.iAttack=this.boof369,this.iHealth=this.boof81116,this.tribe.push("HM"),this.text=`Activate: Grant another creature ${p.jr9(this.iAttack,0)} this turn.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}ffsT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}ffsA(t,e){const i=y.mod("AT",this.iAttack,e.id);i.expiry="ET",t.addMod(i)}fssC(){this.faction="T",this.rarity="R",this.name="Flamestoke Shaman",this.iAttack=this.boof61218,this.iHealth=this.boof3712,this.tribe.push("HM"),this.text=`Activate: Grant an adjacent ${p.levelGateText(this.level,!0)}creature Aggressive.`,this.bonus={activ8:this.regnNug(1)}}fssT(t){const e=this.makeCreatTarg(t);return e.level=D.ddf2(this.level),e.lanes=t.adjacent,e.player="F",e}fssA(t,e){t.aggressive=!0}kodC(){this.faction="N",this.rarity="L",this.name="Keeper of the Damned",this.iAttack=this.boof5815,this.iHealth=this.boof61017,this.tribe.push("ZB"),this.text=`Activate: another friendly ${p.levelGateText(this.level,!0)}creature gets "Vengeance: Spawn this" this turn.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}kodT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.player="F",e}kodA(t,e){const i=t.jr4("VN");i.customCode=e.id,i.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e.id}lashC(){this.faction="U",this.rarity="L",this.name="Demara, Herald of Affliction",this.iAttack=14,this.iHealth=20,this.tribe.push("NG"),this.text="Activate: Give an enemy creature with Poison Defender.~Forge: Each enemy creature gets Poison 6.",this.bonus={activ8:this.rawNug(0,0,0,0,.1)}}lashT(t){const e=this.makeCreatTarg(t);return e.player="E",e.hasPoison=!0,e.canDefender=!0,e}lashA(t,e){t.defender=!0}mbpC(){this.faction="U",this.rarity="H",this.name="Mossbeard Patriarch",this.iAttack=this.boof137,this.iHealth=this.boof81220,this.tribe.push("PL");const t=this.boof468;this.text=`Activate: Give another creature ${p.jr9(0,t)}.`,this.bonus={activ8:this.buffNug(0,t)}}mbpT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mbpA(t,e){t.buff(0,this.boof468)}mndC(){this.faction="A",this.rarity="R",this.name="Munitions Drone",this.iAttack=this.boof137,this.iHealth=this.boof6814,this.tribe.push("RB");const t=this.boof357;this.text=`Activate: Give another creature ${p.jr9(t,0)}.`,this.bonus={activ8:this.buffNug(t,0)}}mndT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mndA(t,e){t.buff(this.boof357,0)}ncsC(){this.faction="N",this.rarity="R",this.name="Necroslime",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.xl=!1;const t=this.boof248;this.text=`Activate, deal 3 damage to another friendly creature: ${this.name} gets ${p.jr9(t,t)}.`,this.bonus={activ8:this.buffNug(t,t-3)}}ncsT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}ncsA(t,e){const i=this.boof248;t.hurtDirect(3,this.code),e.buff(i,i)}nxgC(){this.faction="A",this.rarity="H",this.name="Nexus Gunner",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("HM"),this.text=`Activate: Give a creature ${p.jr9(this.iAttack,0)}. Use this ability only if ${this.name} is in the center lane.`,this.bonus={activ8:this.buffNug(this.iAttack/2,0)}}nxgT(t){const e=this.makeCreatTarg(t);return t.lane!==3?e.victims="???":e.hint=["BF","BB"],e}nxgA(t,e){t.buff(this.iAttack,0)}nffC(){this.faction="U",this.rarity="L",this.name="Nuada, Faith's Flourish",this.iAttack=this.boof246,this.iHealth=this.lValN([10,17,25]),this.iDefend=!0,this.tribe.push("TK"),this.xl=!1,this.hints=[this.lValH(["ZZ-1","ZZ-2","ZZ-2"])];const t=L.getCard(z.tffc(this.level));this.text=`Activate: Replace a friendly Plant with a ${p.tokName(t)}.`,this.bonus={activ8:this.multNug(this.spawnNug(t),.5)}}nffT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="PL",e}nffA(t,e){g.birth(z.tffc(this.level),"R",e.owner,t.lane)}orghC(){this.faction="N",this.rarity="R",this.name="Organ Harvester",this.iAttack=this.lValN([2,6,9]),this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1,this.text=`Activate, destroy ${this.name}: Destroy a ${p.levelGateText(this.level,!0)}creature.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.4)}}orghT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.hint=["KL"],e}orghA(t,e){const i=R.tick();U.destroy(t,this.code,i),U.destroy(e,this.code,i)}ppmC(){this.faction="A",this.rarity="R",this.name="Palladium Pulsemage",this.iAttack=this.lValN([2,8,12]),this.iHealth=this.lValN([7,12,15]),this.tribe.push("HM"),this.text=`Activate: give a creature ${p.jr9(this.boof4812n,0)} this turn.`,this.bonus={activ8:this.buffNug(this.boof246,0)}}ppmT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}ppmA(t,e){const i=y.mod("AT",this.boof4812n,e.id);i.expiry="ET",t.addMod(i)}pcoilC(){this.faction="U",this.rarity="R",this.name="Poisoncoil",this.iAttack=this.boof357,this.iHealth=this.boof71013,this.iDefend=!0,this.tribe.push("SN");const t=this.boof135;this.text=`Activate: Give another creature Poison ${t}.`,this.bonus={activ8:this.regnNug(t)}}pcoilT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["PN","DF"],e}pcoilA(t,e){t.addPoison(this.boof135)}siggyC(){this.faction="N",this.rarity="H",this.name="Sigmund Fraud",this.iAttack=this.boof357,this.iHealth=this.lValN([9,14,19]),this.iDefend=!0,this.tribe.push("AB"),this.xl=!1;const t=this.boof4812;this.text=`Activate, destroy another friendly creature: Deal ${t} damage to the enemy player and you gain ${t} health.`,this.bonus={activ8:this.playerNug(t)}}siggyT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}siggyA(t,e){U.destroy(t,this.code);const i=this.boof4812;v.hurtDirect(!e.owner,i,this.code),v.heal(e.owner,i)}srmdC(){this.faction="N",this.rarity="H",this.name="Sorrow Maiden",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.xl=!1,this.text=`Activate: Destroy an enemy creature with ${this.iAttack} or less attack.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.4)}}srmdT(t){const e=this.makeCreatTarg(t);return e.player="E",e.maxAttack=this.iAttack,e}srmdA(t,e){U.destroy(t,this.code)}ssaC(){this.faction="N",this.rarity="H",this.name="Spitesower Acolyte",this.iAttack=this.boof234,this.iHealth=this.lValN([8,14,22]),this.tribe.push("HM");const t=this.boof246n;this.text=`Activate, deal ${-t} damage to ${this.name}: Give a creature ${p.jr9(t,t)}.`,this.bonus={activ8:this.buffNug(-t,0)}}ssaT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","BB"],e}ssaA(t,e){const i=this.boof246n,s=R.tick();e.hurtDirect(-i,this.code,s),t.buff(i,i,s)}swmC(){this.faction="A",this.rarity="R",this.name="Steelwelder Medic",this.iAttack=this.lValN([3,5,13]),this.iHealth=this.boof61014,this.tribe.push("HM"),this.text=`Activate: Give another creature Armor ${this.level}.`,this.bonus={activ8:this.regnNug(this.level)}}swmT(t){const e=this.makeOtherCreatTarg(t);return e.canArmor=!0,e.hint=["BF","BB"],e}swmA(t,e){t.addArmor(this.level)}ucmC(){this.faction="T",this.rarity="R",this.name="Uranti Cryomancer",this.iAttack=this.boof247,this.iHealth=this.lValN([8,13,17]),this.tribe.push("IC","YT"),this.xl=!1;const t=this.boof135;this.text=`Activate: Deal ${t} damage to a creature.`,this.bonus={activ8:this.buffNug(0,t)}}ucmT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}ucmA(t,e){t.hurtDirect(this.boof135,this.code)}uimC(){this.faction="T",this.rarity="C",this.name="Uranti Icemage",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.lValN([8,13,20]),this.tribe.push("IC","YT"),this.text="Activate: Negate Defender this turn.",this.bonus={activ8:this.regnNug(1)}}uimT(t){const e=this.makeCreatTarg(t);return e.hint=["BB"],e}uimA(t,e){const i=y.mod("ND",!0,e.id);i.expiry="ET",t.addMod(i)}warmC(){this.faction="A",this.rarity="H",this.name="War Merchant",this.iAttack=this.boof468,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("HM");const t=this.level===3?this.iAttack:0;this.text=`Activate: Give a creature in a center lane ${p.jr9(this.iAttack,t)}.`,this.bonus={activ8:this.multNug(this.buffNug(this.iAttack,t),.5)}}warmT(t){const e=this.makeCreatTarg(t);return e.lanes=3,e.hint=["BF","BB"],e}warmA(t,e){t.buff(this.iAttack,this.level===3?this.iAttack:0)}wwrC(){this.faction="U",this.rarity="C",this.name="Weirwood Ranger",this.iAttack=this.boof51015,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.text=`Activate: Give another creature ${p.jr9(this.level,this.level)}.`,this.bonus={activ8:this.buffNug(this.level,this.level)}}wwrT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF","BB"],e}wwrA(t,e){t.buff(this.level,this.level)}wfsC(){this.faction="N",this.rarity="H",this.name="Witherfrost Succubus",this.iAttack=this.boof147,this.iHealth=this.boof61018,this.tribe.push("DM");const t=this.boof357;this.text=`Activate: Give a creature ${p.jr9(-t,-t)} this turn.`,this.bonus={activ8:this.buffNug(t,t)}}wfsT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}wfsA(t,e){const i=-this.boof357,s=y.mod("AT",i,e.id);s.expiry="ET",t.addMod(s);const h=y.mod("HL",i,e.id);h.expiry="ET",t.addMod(h);const f=y.mod("MH",i,e.id);f.expiry="ET",t.addMod(f)}shambC(){this.faction="N",this.rarity="L",this.name="Xithian Shambler",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1;let t="";this.level===3&&(t="~You may use this ability twice per turn."),this.text=`Activate, destroy an adjacent creature: ${this.name} moves into that creature's lane, then gets +attack and +health equal to that creature's attack and health.${t}`,this.bonus={activ8:this.rawNug(0,0,0,0,this.lValN([.6,1.2,2.2]))}}shambT(t){const e=y.crFriendActTarg("CARD",this.code,t.id);return e.lanes=t.adjacent,e}shambA(t,e){const i=t.attack,s=t.health;U.destroy(t,this.code),e.move(t.lane),e.buff(i,s)}zpmC(){this.faction="T",this.rarity="R",this.name="Zephyr Mage",this.iAttack=this.boof4813,this.iHealth=this.boof61017,this.tribe.push("WN","AS"),this.text=`Activate: Give another ${p.levelGateText(this.level,!0)}creature Mobility ${this.level}.`,this.bonus={activ8:this.regnNug(this.level)}}zpmT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.canMove=!0,e.hint=["BF","BB"],e}zpmA(t,e){t.addMobility(this.level)}}class Ve extends M{lookup(t){return{["CMF"]:{c:()=>this.aconC(),f:(i,s)=>this.aconF(i,s)},["FLH"]:{c:()=>this.flhC(),f:(i,s)=>this.flhF(i,s)},["TBB"]:{c:()=>this.tbbC(),f:(i,s)=>this.tbbF(i,s)}}[t]}targAction(t,e,i){this.lookup(t).f(e,i)}playTarg;optional=!1;notme=!1;ftext="";constructor(t){super(t),this.playTarg=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("AS");return s.interactive=!0,i}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.targAction(this.cardCode(),e,i),S.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const e=D.toActions(this.playTarg);e.length>0?(e.forEach(i=>{i.param=t.creatId}),this.optional&&e.push(S.noneEndTrigger()),S.ddf5(e)):x.triggerDone()}aconC(){this.faction="N",this.rarity="R",this.name="Calamity Fiend",this.iAttack=this.boof4814,this.iHealth=this.lValN([5,10,16]),this.tribe.push("DM");const t=-this.boof234;this.addSp("U",t),this.playTarg.player="E",this.ftext=`Give an enemy creature ${p.jr9(t,t)}.`}aconF(t,e){this.logAct(!1,t);const i=-this.boof234;t.buff(i,i)}flhC(){this.faction="T",this.rarity="C",this.name="Firelight Hunter",this.iAttack=this.boof468,this.iHealth=this.iAttack-2,this.tribe.push("HM"),this.playTarg.player="E",this.addSp("D",this.iAttack),this.ftext=`Deal ${this.iAttack} to an enemy creature.`}flhF(t,e){t.hurtDirect(this.iAttack,this.code)}tbbC(){this.faction="T",this.rarity="R",this.name="Totembound Berserker",this.iAttack=this.boof81318,this.iHealth=this.lValN([2,4,10]),this.tribe.push("GT"),this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level),this.optional=!0,this.ftext=`You may move an enemy ${p.levelGateText(this.level,!0)}creature to the space opposing ${this.name}.`}tbbF(t,e){e.opposed||(this.logAct(!1,t),t.move(g.oppositeLane(e.lane)))}}class yt extends M{lookup(t){return{["ABM"]:{c:()=>this.mawC(),f:(i,s)=>this.mawF(i,s)},["AGC"]:{c:()=>this.aconC(),f:(i,s)=>this.aconF(i,s)},["BTI"]:{c:()=>this.binvC(),f:(i,s)=>this.binvF(i,s)},["BSR"]:{c:()=>this.bsrC(),f:(i,s)=>this.bsrF(i,s)},["BAW"]:{c:()=>this.bawC(),f:(i,s)=>this.bawF(i,s)},["CKB"]:{c:()=>this.cacC(),f:(i,s)=>this.cacF(i,s)},["CHA"]:{c:()=>this.chaC(),f:(i,s)=>this.chaF(i,s)},["CCR"]:{c:()=>this.ccC(),f:(i,s)=>this.ccF(i,s)},["FRI"]:{c:()=>this.friC(),f:(i,s)=>this.friF(i,s)},["FRV"]:{c:()=>this.freavC(),f:(i,s)=>this.freavF(i,s)},["GLF"]:{c:()=>this.gfiendC(),f:(i,s)=>this.gfiendF(i,s)},["GRW"]:{c:()=>this.grwC(),f:(i,s)=>this.grwF(i,s)},["GHT"]:{c:()=>this.grhC(),f:(i,s)=>this.grhF(i,s)},["MMH"]:{c:()=>this.houndC(),f:(i,s)=>this.houndF(i,s)},["MXW"]:{c:()=>this.mtxC(),f:(i,s)=>this.mtxF(i,s)},["NGB"]:{c:()=>this.ngbC(),f:(i,s)=>this.ngbF(i,s)},["PHS"]:{c:()=>this.phxsC(),f:(i,s)=>this.phxsF(i,s)},["RWD"]:{c:()=>this.rotC(),f:(i,s)=>this.rotF(i,s)},["SHY"]:{c:()=>this.schyC(),f:(i,s)=>this.schyF(i,s)},["STD"]:{c:()=>this.stdC(),f:(i,s)=>this.stdF(i,s)},["SEV"]:{c:()=>this.surzC(),f:(i,s)=>this.surzF(i,s)},["VNF"]:{c:()=>this.vnfC(),f:(i,s)=>this.vnfF(i,s)},["WBY"]:{c:()=>this.wbyC(),f:(i,s)=>this.wbyF(i,s)},["WBU"]:{c:()=>this.wbuC(),f:(i,s)=>this.wbuF(i,s)},["XDH"]:{c:()=>this.dogsC(),f:(i,s)=>this.dogsF(i,s)}}[t]}targAction(t,e,i){this.lookup(t).f(e,i)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}jr3(t,e){const i=super.jr3(t,e);if(this.forges){const s=i.jr4("FR");s.interactive=!0}return i}ddf8(t){return Dt.extractCardCode(t.trigger.logicCode)==="CKB"&&t.trigger.type==="TS"?!0:super.ddf8(t)}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.targAction(this.cardCode(),e,i),S.actionDone(!0)}jr8(t){const e=this.cardCode();if(t.trigger.type==="TS"&&e==="CKB"){this.logAct(!1),E.regularPlays+=1;const s=t.event,h=v.toPlayer(s.playerA),f=y.trigIdx(h.triggers,t.trigger);f>-1&&h.triggers.splice(f,1),x.triggerDone();return}if(e==="ABM"){const s=y.crFriendNotMeTarg(t.creatId);if(s.tribe="AB",g.creatByTarget(s).length===0){x.triggerDone();return}}this.notme&&(this.playTarg.notMe=t.creatId);const i=D.toActions(this.playTarg);i.length>0?(i.forEach(s=>{s.param=t.creatId}),this.optional&&i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}mawC(){this.faction="N",this.rarity="C",this.name="Abyssal Maw",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=-this.boof359;this.ftext=`If there is another friendly Abomination, give an enemy creature ${p.jr9(t,t)}.`}mawF(t,e){this.logAct(!1,t);const i=-this.boof359;t.buff(i,i)}aconC(){this.faction="A",this.rarity="C",this.name="Aegis Conscript",this.iAttack=this.boof3612,this.iHealth=this.boof6915,this.tribe.push("HM"),this.playTarg.canArmor=!0,this.playTarg.player="F",this.ftext=`Give a friendly creature Armor ${this.boof124}.`}aconF(t,e){this.logAct(!1,t),t.addArmor(this.boof124)}binvC(){this.faction="A",this.rarity="C",this.name="Battletech Inventor",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("MM"),this.playTarg.player="E",this.ftext=`Give an enemy creature ${p.jr9(-this.iAttack,0)}.`}binvF(t,e){this.logAct(!1,t),t.buff(-this.iAttack,0)}bsrC(){if(this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.iAttack=this.boof5813,this.iHealth=this.boof3712,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.playTarg.level=D.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy an enemy ${p.levelGateText(t,!0)}creature.`,this.optional=!0}else this.hints=["LG"]}bsrF(t,e){U.destroy(t,this.code)}bawC(){this.faction="U",this.rarity="R",this.name="Brambleaxe Warrior",this.iAttack=this.boof61014,this.iHealth=this.iAttack-4,this.tribe.push("HM"),this.playTarg.hint=["BF"],this.ftext="Give a creature Breakthrough this turn."}bawF(t,e){this.logAct(!1,t);const i=y.mod("BT",!0,e.id);i.expiry="ET",t.addMod(i)}cacC(){this.faction="N",this.rarity="H",this.name="Cacklebones",this.iAttack=this.boof5915,this.iHealth=this.iAttack-this.level,this.tribe.push("SK"),this.playTarg.level=D.ddf2(this.level),this.playTarg.player="E",this.ftext=`Destroy an enemy ${p.levelGateText(this.level,!0)}creature. If you do, the enemy player may play an additional card next turn.`,this.optional=!0}cacF(t,e){U.destroy(t,this.code);const i=v.toPlayer(t.owner),s=y.trigger("TS",this.code);s.bonus=this.avgSpawnNug(),i.triggers.push(s)}chaC(){this.faction="U",this.rarity="R",this.name="Chistlehearth Archer",this.iAttack=this.boof2510,this.iHealth=this.iAttack+7,this.tribe.push("HM");const t=this.boof4816;this.playTarg.player="E",this.playTarg.hasMobility=!0,this.ftext=`Deal ${t} damage to an enemy creature with Mobility. Negate Mobility from that creature.`}chaF(t,e){t.hurtDirect(this.boof4816,this.code),t.negateMobility=!0}ccC(){this.faction="N",this.rarity="C",this.name="Corpse Crawler",this.iAttack=this.boof81220,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.hints=[this.lValH(["ZZ-1","ZZ-2","ZZ-5"])],this.playTarg.player="F",this.ftext="Destroy a friendly creature."}ccF(t,e){U.destroy(t,this.code)}friC(){this.faction="T",this.rarity="C",this.name="Flamerift Instigator",this.iAttack=this.lValN([7,12,17]),this.iHealth=this.iAttack-5,this.tribe.push("GT"),this.ftext="Negate Defender from a creature."}friF(t,e){this.logAct(!1,t),t.negateDefender=!0}freavC(){if(this.faction="N",this.rarity="H",this.name="Fleshreaver",this.iAttack=this.boof6915,this.iHealth=this.boof235,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.consistent=!0,this.playTarg.level=D.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy a ${p.levelGateText(t)} enemy creature.`,this.optional=!0}else this.hints=["LG"]}freavF(t,e){U.destroy(t,this.code)}get fiendBof(){return this.lValN([-1,-2,-5])}gfiendC(){this.faction="N",this.rarity="C",this.name="Gloomfiend",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=this.fiendBof;this.ftext=`You may give an enemy creature ${p.jr9(t,t)}.`,this.optional=!0}gfiendF(t,e){this.logAct(!1,t);const i=this.fiendBof;t.buff(i,i)}grwC(){this.faction="N",this.rarity="C",this.name="Gloomreaper Witch",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof147;this.playTarg.maxAttack=t,this.playTarg.player="E",this.ftext=`You may destroy an enemy creature with ${t} or less attack.`,this.optional=!0}grwF(t,e){U.destroy(t,this.code)}grhC(){this.faction="U",this.rarity="C",this.name="Grove Huntress",this.iAttack=this.boof4711,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.playTarg.player="F";const t=this.boof135;this.ftext=`Give a friendly creature ${p.jr9(t,t)}.`}grhF(t,e){this.logAct(!1,t);const i=this.boof135;t.buff(i,i)}houndC(){this.faction="T",this.rarity="C",this.name="Magma Hound",this.iAttack=this.boof4813,this.iHealth=this.iAttack-1,this.tribe.push("ER","EL");const t=this.boof246;this.optional=!0,this.playTarg.player="E",this.ftext=`You may deal ${t} damage to an enemy creature.`}houndF(t,e){t.hurtDirect(this.boof246,this.code)}mtxC(){this.faction="A",this.rarity="C",this.name="Matrix Warden",this.iAttack=this.lValN([3,8,12]),this.iHealth=this.iAttack,this.tribe.push("RB");const t=this.boof3510;this.playTarg.player="F",this.ftext=`Give a friendly creature ${p.jr9(t,0)}.`}mtxF(t,e){this.logAct(!1,t),t.buff(this.boof3510,0)}ngbC(){this.faction="T",this.rarity="C",this.name="Nargath Bruiser",this.iAttack=this.boof5814,this.iHealth=this.iAttack-1,this.tribe.push("ER","AS");const t=this.boof248;this.playTarg.player="F",this.ftext=`Give a friendly creature ${p.jr9(0,t)}.`}ngbF(t,e){this.logAct(!1,t),t.buff(0,this.boof248)}phxsC(){this.faction="A",this.rarity="R",this.name="Phalanx Squadron",this.iAttack=this.boof3714,this.iHealth=this.boof61117,this.tribe.push("HM"),this.playTarg.hasArmor=!0,this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature with Armor ${p.jr9(t,t)}.`}phxsF(t,e){this.logAct(!1,t);const i=this.boof234;t.buff(i,i)}rotC(){this.faction="N",this.rarity="C",this.name="Rot Wanderer",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.playTarg.maxAttack=this.iAttack,this.playTarg.player="E",this.ftext=`Destroy an enemy creature with ${this.iAttack} or less attack.`}rotF(t,e){U.destroy(t,this.code)}schyC(){this.faction="N",this.rarity="C",this.name="Scourge Hydra",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("HY"),this.playTarg.player="F",this.ftext="Deal 3 damage to a friendly creature."}schyF(t,e){t.hurtDirect(3,this.code)}stdC(){this.faction="A",this.rarity="H",this.name="Shardthief Druid",this.iAttack=this.boof5813,this.iHealth=this.boof81318,this.tribe.push("MM"),this.playTarg.canRegen,this.playTarg.player="E",this.ftext=`Negate and remove all Regenerate from an enemy creature. ${this.name} gets that much Renerate.`}stdF(t,e){this.logAct(!1,t);const i=t.regen;t.negateRegen=!0,e.addRegen(i)}surzC(){this.faction="N",this.rarity="L",this.name="Suruzal, Emissary of Varna",this.iAttack=this.boof4814,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.playTarg.player="F",this.playTarg.level=D.ddf2(this.level),this.notme=!0,this.ftext=`You may destroy another friendly ${p.levelGateText(this.level,!0)}creature. If you do, spawn a copy of it.`}surzF(t,e){const i=R.tick();U.destroy(t,this.code,i),g.birth(t.code,"S",e.owner,void 0,i)}vnfC(){this.faction="U",this.rarity="R",this.name="Venomfang",this.iAttack=this.boof61014,this.iHealth=this.iAttack-2,this.tribe.push("SN");const t=this.boof246;this.playTarg.player="E",this.ftext=`Give an enemy creature Poison ${t}.`}vnfF(t,e){this.logAct(!1,t),t.addPoison(this.boof246)}wbyC(){this.faction="T",this.rarity="R",this.name="Wallbreaker Yeti",this.iAttack=this.boof4712,this.iHealth=this.boof71116,this.tribe.push("ER","YT"),this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${p.levelGateText(this.level,!0)}enemy creature with Defender.`,this.optional=!0}wbyF(t,e){U.destroy(t,this.code)}wbuC(){this.faction="T",this.rarity="C",this.name="Warbringer Uranti",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("LT","YT");const t=this.boof4812;this.notme=!0,this.playTarg.player="F",this.addSp("A",t),this.ftext=`Give another friendly creature ${p.jr9(t,0)} this turn.`}wbuF(t,e){this.logAct(!1,t);const i=y.mod("AT",this.boof4812,e.id);i.expiry="ET",t.addMod(i)}dogsC(){this.faction="N",this.rarity="R",this.name="Xithian Direhound",this.iAttack=4,this.iHealth=4,this.tribe.push("AB"),this.overload=!0,this.maxLevel=1,this.optional=!0,this.playTarg.player="E",this.ftext=`You may give an enemy creature ${p.jr9(-4,-4)}.`}dogsF(t,e){this.logAct(!1,t),t.buff(-4,-4)}}class G extends kt{lookup(t){return{["AGW"]:{c:()=>this.awingC(),z:i=>this.awingZ(i)},["ASG"]:{c:()=>this.asurgeC(),z:i=>this.asurgeZ(i)},["ATZ"]:{c:()=>this.anatC(),z:i=>this.anatZ(i)},["AQE"]:{c:()=>this.aqatC(),z:i=>this.aqatZ(i)},["ABL"]:{c:()=>this.ablC(),z:i=>this.ablZ(i)},["BFT"]:{c:()=>this.bftC(),z:i=>this.bftZ(i)},["BTM"]:{c:()=>this.botC(),z:i=>this.botZ(i)},["CSU"]:{c:()=>this.csurgeC(),z:i=>this.csurgeZ(i)},["CNT"]:{c:()=>this.ctmsC(),z:i=>this.ctmsZ(i)},["CTW"]:{c:()=>this.cullC(),z:i=>this.cullZ(i)},["CTV"]:{c:()=>this.cultC(),z:i=>this.cultZ(i)},["CAG"]:{c:()=>this.cypaC(),z:i=>this.cypaZ(i)},["CBS"]:{c:()=>this.cypbC(),z:i=>this.cypbZ(i)},["DDF"]:{c:()=>this.dendC(),z:i=>this.dendZ(i)},["DBT"]:{c:()=>this.dreadC(),z:i=>this.dreadZ(i)},["DYB"]:{c:()=>this.drybC(),z:i=>this.drybZ(i)},["ETN"]:{c:()=>this.elnC(),z:i=>this.elnZ(i)},["ENP"]:{c:()=>this.enpC(),z:i=>this.enpZ(i)},["ENR"]:{c:()=>this.rageC(),z:i=>this.rageZ(i)},["EFA"]:{c:()=>this.efauC(),z:i=>this.efauZ(i)},["EXD"]:{c:()=>this.expdmC(),z:i=>this.expdmZ(i)},["FIN"]:{c:()=>this.feralC(),z:i=>this.feralZ(i)},["FVA"]:{c:()=>this.fervassC(),z:i=>this.fervassZ(i)},["FJT"]:{c:()=>this.fjetC(),z:i=>this.fjetZ(i)},["FLN"]:{c:()=>this.flncC(),z:i=>this.flncZ(i)},["FFL"]:{c:()=>this.ffldC(),z:i=>this.ffldZ(i)},["FZS"]:{c:()=>this.frozC(),z:i=>this.frozZ(i)},["GTH"]:{c:()=>this.ghastC(),z:i=>this.ghastZ(i)},["GCR"]:{c:()=>this.crushC(),z:i=>this.crushZ(i)},["HAR"]:{c:()=>this.hartC(),z:i=>this.hartZ(i)},["IFR"]:{c:()=>this.izftC(),z:i=>this.izftZ(i)},["JPK"]:{c:()=>this.jpC(),z:i=>this.jpZ(i)},["LBR"]:{c:()=>this.lbrandC(),z:i=>this.lbrandZ(i)},["LYS"]:{c:()=>this.shartC(),z:i=>this.shartZ(i)},["MPH"]:{c:()=>this.morphC(),z:i=>this.morphZ(i)},["MSC"]:{c:()=>this.sculptC(),z:i=>this.sculptZ(i)},["NNS"]:{c:()=>this.nanoC(),z:i=>this.nanoZ(i)},["NSL"]:{c:()=>this.natselC(),z:i=>this.natselZ(i)},["NCF"]:{c:()=>this.nflayC(),z:i=>this.nflayZ(i)},["NCV"]:{c:()=>this.nviveC(),z:i=>this.nviveZ(i)},["OEX"]:{c:()=>this.oexpC(),z:i=>this.oexpZ(i)},["OSS"]:{c:()=>this.orssC(),z:i=>this.orssZ(i)},["PTR"]:{c:()=>this.pwtorC(),z:i=>this.pwtorZ(i)},["PSG"]:{c:()=>this.psurgeC(),z:i=>this.psurgeZ(i)},["PMS"]:{c:()=>this.pslamC(),z:i=>this.pslamZ(i)},["ROG"]:{c:()=>this.rotgC(),z:i=>this.rotgZ(i)},["SAP"]:{c:()=>this.sapC(),z:i=>this.sapZ(i)},["SVO"]:{c:()=>this.soathC(),z:i=>this.soathZ(i)},["SOC"]:{c:()=>this.scythC(),z:i=>this.scythZ(i)},["SOA"]:{c:()=>this.soaC(),z:i=>this.soaZ(i)},["SOD"]:{c:()=>this.sodC(),z:i=>this.sodZ(i)},["SOT"]:{c:()=>this.sotC(),z:i=>this.sotZ(i)},["SHG"]:{c:()=>this.shgrC(),z:i=>this.shgrZ(i)},["SNB"]:{c:()=>this.snbC(),z:i=>this.snbZ(i)},["SHV"]:{c:()=>this.sharvC(),z:i=>this.sharvZ(i)},["SRP"]:{c:()=>this.sreapC(),z:i=>this.sreapZ(i)},["STR"]:{c:()=>this.sttorC(),z:i=>this.sttorZ(i)},["STO"]:{c:()=>this.sptorC(),z:i=>this.sptorZ(i)},["SOV"]:{c:()=>this.sovC(),z:i=>this.sovZ(i)},["STN"]:{c:()=>this.stbrnC(),z:i=>this.stbrnZ(i)},["STP"]:{c:()=>this.ssperC(),z:i=>this.ssperZ(i)},["SIN"]:{c:()=>this.sinC(),z:i=>this.sinZ(i)},["TGL"]:{c:()=>this.tanglC(),z:i=>this.tanglZ(i)},["TPT"]:{c:()=>this.tpactC(),z:i=>this.tpactZ(i)},["TUP"]:{c:()=>this.tugC(),z:i=>this.tugZ(i)},["TOT"]:{c:()=>this.totsC(),z:i=>this.totsZ(i)},["TOB"]:{c:()=>this.blightC(),z:i=>this.blightZ(i)},["TXB"]:{c:()=>this.txbnC(),z:i=>this.txbnZ(i)},["TXS"]:{c:()=>this.sporeC(),z:i=>this.sporeZ(i)},["TCG"]:{c:()=>this.tremcC(),z:i=>this.tremcZ(i)},["URS"]:{c:()=>this.urstC(),z:i=>this.urstZ(i)},["VSK"]:{c:()=>this.vensC(),z:i=>this.vensZ(i)},["VGR"]:{c:()=>this.vgraC(),z:i=>this.vgraZ(i)},["VGL"]:{c:()=>this.vglchC(),z:i=>this.vglchZ(i)},["VOB"]:{c:()=>this.vobC(),z:i=>this.vobZ(i)},["VYE"]:{c:()=>this.vembC(),z:i=>this.vembZ(i)},["UBL"]:{c:()=>this.uboltC(),z:i=>this.uboltZ(i)},["WMM"]:{c:()=>this.warC(),z:i=>this.warZ(i)},["XRW"]:{c:()=>this.xwillC(),z:i=>this.xwillZ(i)}}[t]}cardCast(t,e){this.lookup(t).z(e)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.cardCode()==="NSL"&&g.creatByTarget(y.crFriendTarg()).length<5||t.push(this.playTarg),t}handleAction(t){const e=g.ddf6(t);this.logSpell(this.xl?e:void 0),this.cardCast(this.cardCode(),e),S.spellCast()}ddf8(t){const e=Dt.extractCardCode(t.trigger.logicCode);if(e==="TOB"&&t.trigger.type==="DM"){const i=V.toDamage(t.event);if(i.battle&&i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId)return this.level===3?!0:L.getCard(i.hurtCreat.code).level<=this.level}else if((e==="ABL"||e==="OEX"||e==="VOB")&&t.trigger.type==="DM"){const i=t.event;return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId}else if((e==="FZS"||e==="IFR")&&t.trigger.type==="DM"){const i=t.event;if(i.isCreatTarg&&i.target===t.creatId)return!0}else if(e==="DYB"&&t.trigger.type==="EF"){const i=V.toEnterField(t.event);return t.trigger.creatId!==i.creature.id&&i.creature.owner===t.owner}else if(e==="FVA"&&t.trigger.type==="FK"||e==="ROG"&&t.trigger.type==="DS"||e==="SHG"&&(t.trigger.type==="PT"||t.trigger.type==="VN")||(e==="IFR"||e==="OEX")&&t.trigger.type==="PT")return!0;return!1}jr8(t){const e=Dt.extractCardCode(t.trigger.logicCode);if(e==="TOB"){const i=t.event,s=g.jr5(i.target);s.status==="A"&&U.destroy(s,this.code)}else if(e==="ABL")g.jr5(t.creatId).buff(this.level,this.level);else if(e==="FVA"){const i=g.jr5(t.creatId),s=g.searchByLane(g.oppositeLane(i.lane),!i.owner);s&&s.hurtDirect(this.boof3612,i.code)}else if(e==="FZS"||e==="IFR"&&t.trigger.type==="DM"){const i=g.jr5(t.creatId);i.status==="A"&&U.destroy(i,this.code)}else if(e==="ROG"||e==="DYB")g.jr5(t.creatId).buff(this.level,this.level);else if(e==="SHG"){if(t.trigger.type==="VN"){const i=t.event,s=g.jr5(i.creatId);g.birth(s.code,"S",t.owner)}else if(t.trigger.type==="PT"){const i=t.trigger.customCode,s=g.jr5(t.creatId);s.triggers.filter(f=>f.customCode===i).forEach(f=>s.removeTrigger(f))}}else if(e==="IFR"&&t.trigger.type==="PT"){const i=T.deTil(t.trigger.customCode),s=i[1],h=g.jr5(t.creatId);if(i[0]==="P2"){const f=y.trigIdx(h.triggers,t.trigger);h.triggers[f].customCode=T.enTil("P1",s)}else{const f=h.triggers.find(m=>m.customCode===s);f&&h.removeTrigger(f),h.removeTrigger(t.trigger)}}else if(e==="OEX"){if(t.trigger.type==="DM"){const i=t.event,s=g.qEnemyCreats(),h=s.length,f=R.tick();let m;h>0&&(this.level===1?m=[s[T.randInt(0,h)]]:this.level===2?(m=s.splice(T.randInt(0,h),1),s.length>0&&m.push(s[T.randInt(0,h-1)])):m=s,m.forEach(A=>A.hurtDirect(i.dmg,this.code,f)))}else if(t.trigger.type==="PT"){const i=t.trigger.customCode,s=g.jr5(t.creatId);s.triggers.filter(f=>f.customCode===i).forEach(f=>s.removeTrigger(f))}}else if(e==="VOB"){const i=V.toDamage(t.event);i.srcCreat.hurtDirect(i.dmg,this.code)}else super.jr8(t);x.triggerDone()}rankT(){return`If you are rank ${this.level+1} or higher`}awingC(){this.faction="A",this.rarity="R",this.name="Aegis Wings",this.text=`Give a creature ${p.jr9(this.boof369,0)}. Then if that creature has the highest attack, it also gets Mobility 1 and Armor ${this.boof246}.`,this.playTarg.hint=["BF"]}awingZ(t){t.buff(this.boof369,0);const e=t.attack;g.qActiveCreats().every(i=>i.attack<=e)&&(t.addMobility(1),t.addArmor(this.boof246))}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.canMove=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Mobility ${this.level}.`}asurgeZ(t){t.addMobility(this.level)}anatC(){this.faction="A",this.rarity="C",this.name="Anatomize",this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(-this.boof4816,0)}.~You may play an additional ${this.name} this turn.`}anatZ(t){t.buff(-this.boof4816,0);const e=E.freeCard(this.code);e.condition.cardCode="ATZ"}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${p.jr9(0,this.boof51015)}.`,this.playTarg.hint=["BF"]}aqatZ(t){t.buff(0,this.boof51015)}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${p.dbdtap()}, it gets ${p.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}ablZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("OL")}bftC(){this.faction="N",this.rarity="C",this.name="Bitterfrost Totem";const t=this.boof4812n;this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(t,t)}. ${this.rankT()}, it gets an additional ${p.jr9(-2,-2)}.`}bftZ(t){const e=this.boof4812n-(v.getActive().rank>this.level?2:0);t.buff(e,e)}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.xl=!1,this.text=`Replace an enemy ${p.levelGateText(this.level,!0)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level)}botZ(t){g.birth(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof123n;this.text=`Give a creature ${p.jr9(t,t)}.`,this.playTarg.hint=["DB"]}csurgeZ(t){const e=this.boof123n;t.buff(e,e)}ctmsC(){this.faction="A",this.rarity="R",this.name="Countermeasure";const t=this.boof4816;this.text=`Give an enemy creature ${p.jr9(-t,0)}, or give a friendly creature ${p.jr9(t,0)}.`}ctmsZ(t){const e=this.boof4816;t.owner===v.getActiveB()?t.buff(e,0):t.buff(-e,0)}cullC(){this.faction="N",this.rarity="C",this.name="Cull the Weak",this.xl=!1;const t=this.boof4814;this.text=`Destroy a creature with ${t} or less attack.`,this.playTarg.maxAttack=t,this.playTarg.hint=["KL"]}cullZ(t){U.destroy(t,this.code)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate",this.xl=!1;const t=L.getCard(z.tffc(this.level));this.text=`Replace a friendly Plant with a ${p.tokName(t)}.`,this.playTarg.player="F",this.playTarg.tribe="PL"}cultZ(t){g.birth(z.tffc(this.level),"R",t.owner,t.lane)}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof246;this.text=`Give a creature in a center lane ${p.jr9(t,t)}.`,this.playTarg.lanes=3,this.playTarg.hint=["BF"]}cypaZ(t){const e=this.boof246;t.buff(e,e)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${p.jr9(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.hint=["BF"],this.playTarg.faction="A"}cypbZ(t){t.buff(this.boof51015,0),t.addArmor(this.boof124)}dendC(){this.faction="U",this.rarity="R",this.name="Dendrify",this.xl=!1,this.level===3&&(this.isFree=!0,this.overload=!0),this.text=`Replace a ${p.levelGateText(this.level+1,!0)}creature with a 7/7 Treefolk.`,this.playTarg.level=D.ddf2(this.level+1)}dendZ(t){g.birth(`${"SXT"}${this.level}`,"R",t.owner,t.lane)}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.xl=!1,this.hints=["LG"],this.text=`Destroy a ${p.levelGateText(this.level,!0)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"]}dreadZ(t){U.destroy(t,this.code)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${p.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${p.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}drybZ(t){t.buff(this.level,this.level),t.changed=!0,t.jr4("EF",this.code)}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.isFree=this.level===3,this.text=`Give a ${p.levelGateText(this.level,!0)}creature Defender.`,this.playTarg.canDefender=!0,this.playTarg.level=D.ddf2(this.level)}enpZ(t){t.defender=!0}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${p.jr9(-this.boof51015,0)}.`,this.playTarg.hint=["DB"]}elnZ(t){t.buff(-this.boof51015,0)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${p.jr9(t,t)}.`,this.playTarg.hint=["BF"]}rageZ(t){const e=this.boof3612;t.buff(e,e)}efauC(){this.faction="T",this.rarity="R",this.name="Everflame Aura",this.text=`Deal ${this.level+6} damage to an enemy creature, or give a friendly creature Mobility ${this.level}.`}efauZ(t){t.owner===v.getActiveB()?t.addMobility(this.level):t.hurtDirect(this.level+6,this.code)}expdmC(){this.faction="N",this.rarity="H",this.name="Explosive Demise",this.xl=!1,this.text=`Destroy a friendly ${p.levelGateText(this.level+1,!0)}creature.~Deal damage equal to its attack to the enemy player.${this.level===3?"~You gain that much health.":""}`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F"}expdmZ(t){const e=t.attack;U.destroy(t,this.code),v.hurtDirect("E",e,this.code),this.level===3&&v.heal("F",e)}get fiboof(){return this.lValN([1,3,8])}feralC(){this.faction="U",this.rarity="C",this.name="Feral Instinct";const t=this.fiboof;this.text=`Give a creature ${p.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"]}feralZ(t){const e=this.fiboof;t.breakthrough=!0,t.buff(e,e)}fervassC(){this.faction="T",this.rarity="H",this.name="Fervent Assault",this.playTarg.player="F",this.text=`Give a friendly creature Mobility ${this.level} and "Flank: Deal ${this.boof3612} damage to the opposing creature.`}fervassZ(t){t.changed=!0,t.addMobility(this.level),t.jr4("FK",this.code)}fjetC(){this.faction="T",this.rarity="C",this.name="Flame Jet",this.playTarg.hint=["HR"],this.text=`Deal ${this.boof3915} damage to a creature. ${this.rankT()}, deal an additional 3 damage.`}fjetZ(t){t.hurtDirect(this.boof3915,this.code),v.getActive().rank>this.level&&t.hurtDirect(3,this.code)}flncC(){this.faction="T",this.rarity="R",this.name="Flame Lance",this.xl=!1;const t=this.boof579;this.text=`Deal ${t} damage to an enemy creature and ${t} damage to the enemy player.`,this.playTarg.player="E"}flncZ(t){const e=this.boof579;t.hurtDirect(e,this.code),v.hurtDirect("E",e,this.code)}ffldC(){this.faction="A",this.rarity="C",this.name="Forcefield",this.playTarg.canArmor=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Armor ${this.boof51020} this turn.`}ffldZ(t){const e=y.mod("AR",this.boof51020,this.code);e.expiry="ET",t.addMod(e)}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"],this.text=`Give a ${p.levelGateText(this.level,!0)}creature "When this is dealt damage, destroy it".`}frozZ(t){t.changed=!0,t.jr4("DM",this.code)}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${p.jr9(t,t)}.`,this.playTarg.hint=["DB"]}ghastZ(t){const e=-this.boof3612;t.buff(e,e)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.xl=!1,this.isFree=this.level>1,this.isFree||(this.hints=["LG"]),this.playTarg.player="E",this.playTarg.hasDefender=!0,this.text=`Destroy an enemy creature with Defender.${this.level===3?" Deal damage equal to its health to the enemy player.":""}`}crushZ(t){const e=t.health;U.destroy(t,this.code),this.level===3&&v.hurtDirect(t.owner,e,this.code)}hartC(){this.faction="A",this.rarity="C",this.name="Heavy Artillery",this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}izftC(){this.faction="T",this.rarity="T",this.name="Iztek's Frost",this.isFree=this.level===3,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hint=["KL"],this.text=`Until the end of the next turn, give a ${p.levelGateText(this.level+1,!0)}creature "When this is dealt damage, destroy it".`}izftZ(t){const e=R.genId(),i=t.jr4("DM",this.code);i.changes=!0,i.customCode=e;const s=t.jr4("PT",this.code);s.customCode=T.enTil("P2",e)}jpC(){this.faction="A",this.rarity="C",this.name="Jet Pack",this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.boof369,0)} and Mobility 1.`}jpZ(t){t.buff(this.boof369,0),t.addMobility(1)}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hint=["BF"],this.text=`Give a ${p.levelGateText(this.level+1)}creature ${p.jr9(this.boof124,0)} and Aggressive this turn.`}lbrandZ(t){const e=y.mod("AT",this.boof124,this.code),i=y.mod("AG",!0,this.code);e.expiry="ET",i.expiry="ET",t.addMod(e),t.addMod(i)}shartC(){this.faction="U",this.rarity="R",this.name="Lysian Shard",this.overload=!0,this.maxLevel=1,this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(6,6)}.`}shartZ(t){t.buff(6,6)}morphC(){this.faction="U",this.rarity="H",this.name="Metamorphosis",this.xl=!1,this.text=`Replace a ${p.levelGateText(this.level,!0)}creature with a 0/3 Feywing Chrysalis.`,this.playTarg.level=D.ddf2(this.level)}morphZ(t){g.birth(`${"FWC"}1`,"R",t.owner,t.lane)}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.level===3?this.isFree=!0:this.hints=["LG"],this.playTarg.level=D.ddf2(this.level+1),this.text=`Remove all abilities from a ${p.levelGateText(this.level+1,!0)}creature.`,this.playTarg.hint=["DB"]}sculptZ(t){t.wipeAll()}nanoC(){this.faction="A",this.rarity="R",this.name="Nanoswarm",this.playTarg.level=D.ddf2(this.level),this.text=`Give a ${p.levelGateText(this.level,!0)}creature ${p.jr9(-this.boof51015,0)} and remove all abilities from it.`,this.playTarg.hint=["DB"]}nanoZ(t){t.buff(-this.boof51015,0),t.wipeAll()}natselC(){this.faction="U",this.rarity="R",this.name="Natural Selection",this.xl=!1,this.text=`If there is a friendly creature in each lane, destroy a ${p.levelGateText(this.level,!0)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"]}natselZ(t){U.destroy(t,this.code)}nflayC(){this.faction="N",this.rarity="C",this.name="Necroflay";const t=-this.boof3711;this.text=`Give a creature ${p.jr9(t,t)}.~You may play an additional ${this.name} this turn.`,this.playTarg.hint=["DB"]}nflayZ(t){const e=-this.boof3711;t.buff(e,e);const i=E.freeCard(this.code);i.condition.cardCode="NCF"}nviveC(){this.faction="N",this.rarity="C",this.name="Necrovive",this.playTarg.canRegen=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Regenerate ${this.boof3612}.`}nviveZ(t){t.addRegen(this.boof3612)}oexpC(){this.faction="A",this.rarity="H",this.name="Oratek Explosives",this.playTarg.player="F";const t=this.lValS(["an enemy creature at random","up to two enemy creatures at random","each enemy creature"]);this.text=`Give a friendly creature ${p.jr9(5,0)}.~Allied Tempys: This turn, when that creature ${p.dbdtap()}, deal that much damage to ${t}.`}oexpZ(t){if(t.buff(5,0),E.allied("T")){const e=R.genId(),i=t.jr4("DM",this.code);i.changes=!0,i.customCode=e;const s=t.jr4("PT",this.code);s.customCode=e,t.hints.push("OL")}}orssC(){this.faction="A",this.rarity="C",this.name="Oreian Steelskin",this.playTarg.canArmor=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Armor ${this.boof246}. ${this.rankT()}, it gets an additional Armor 1.`}orssZ(t){const e=v.getActive().rank>this.level?1:0;t.addArmor(this.boof246+e)}pwtorC(){this.faction="A",this.rarity="R",this.name="Power Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.level,this.level)}.`}psurgeZ(t){t.buff(this.level,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.boof71116,0)} this turn.`}pslamZ(t){const e=y.mod("AT",this.boof71116,this.code);e.expiry="ET",t.addMod(e)}rotgC(){this.faction="N",this.rarity="H",this.name="Rite of the Grimgaunt",this.playTarg.hint=["BF"],this.text=`Give a creature "When a creature is destroyed, this gets ${p.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0,t.jr4("DS",this.code)}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=D.ddf2(this.level),this.text=`Reduce a ${p.levelGateText(this.level,!0)}creature's attack to 0.`,this.playTarg.hint=["DB"]}sapZ(t){t.buff(-t.attack,0)}soathC(){this.faction="U",this.rarity="C",this.name="Savage Oath",this.level===1&&(this.hints=["LG"]);const t=this.saboof;this.text=`Give an Uterra creature ${p.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"],this.playTarg.faction="U"}soathZ(t){const e=this.saboof;t.buff(e,e),t.breakthrough=!0}get saboof(){return this.lValN([2,6,15])}scythC(){this.faction="N",this.rarity="L",this.name="Scythe of Chiron";const t=this.boof246;this.playTarg.player="F",this.text=`Each enemy creature gets ${p.jr9(-t,0)}. Give a friendly creature ${p.jr9(t,0)} for each enemy creature.`}scythZ(t){const e=-this.boof246,i=g.qEnemyCreats();i.forEach(s=>{s.buff(e,0)}),i.length>0&&t.buff(-e*i.length,0)}soaC(){this.faction="A",this.rarity="C",this.name="Seal of Anvillon",this.level===1?this.hints=["LG"]:this.consistent=!0,this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.ubzap,0)}.`}soaZ(t){t.buff(this.ubzap,0)}sodC(){this.faction="U",this.rarity="C",this.name="Seal of Deepwood",this.level===1?this.hints=["LG"]:this.consistent=!0;const t=this.derpboof;this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(t,t)}.`}sodZ(t){const e=this.derpboof;t.buff(e,e)}get derpboof(){return this.lValN([1,6,12])}sotC(){this.faction="N",this.rarity="C",this.name="Seal of Tarsus",this.level===1?this.hints=["LG"]:this.consistent=!0;const t=this.tars;this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(t,t)}.`}sotZ(t){const e=this.tars;t.buff(e,e)}get tars(){return this.lValN([-2,-8,-16])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.isFree=this.level===3,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F",this.text=`Give a ${p.levelGateText(this.level+1,!0)}friendly creature "Vengeance: Spawn this" this turn.`}shgrZ(t){const e=R.genId(),i=t.jr4("VN",this.code);i.customCode=e,i.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){const e=this.level*g.ddf1().length;t.buff(e,e)}get snbboof(){return-1*(this.level+7)}snbC(){this.faction="A",this.rarity="C",this.name="Sonic Burst",this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(this.snbboof,0)}.`}snbZ(t){t.buff(this.snbboof,0)}sharvC(){this.faction="N",this.rarity="H",this.name="Soul Harvest",this.xl=!1;const t=this.lValS(["an additional level 1 card","an additional card","two additional cards"]);this.text=`Destroy a friendly creature. You may play ${t} this turn.`,this.playTarg.player="F"}sharvZ(t){if(U.destroy(t,this.code),this.level===1){const e=E.freeCard(this.code);e.condition.level=D.ddf2(1)}else E.regularPlays+=this.level-1}sreapC(){this.faction="N",this.rarity="L",this.name="Soulreap",this.xl=!1;const t=this.boof248;this.text=`Destroy an enemy creature with ${t} or less attack. Then Spawn a copy of it.`,this.playTarg.player="E",this.playTarg.maxAttack=t}sreapZ(t){U.destroy(t,this.code),g.birth(t.code,"S",!t.owner)}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.text=`Give a creature Regenerate ${this.boof234}.`,this.playTarg.hint=["BF"],this.playTarg.canRegen=!0}sttorZ(t){t.addRegen(this.boof234)}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.text=`Give a creature Poison ${this.boof234}.`,this.playTarg.hint=["PN"]}sptorZ(t){t.addPoison(this.boof234)}sovC(){this.faction="T",this.rarity="L",this.name="Staff of Vaerus",this.text=`Give a friendly ${p.levelGateText(this.level+1,!0)}creature Mobility ${this.level}. That creature battles an additional time this turn.`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F"}sovZ(t){t.extraBattles+=1,t.addMobility(this.level)}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${p.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hint=["BF"],this.playTarg.hasDefender=!0}stbrnZ(t){const e=this.boof579;t.buff(e,e),t.negateDefender=!0}ssperC(){this.faction="T",this.rarity="C",this.name="Stormspear",this.xl=!1,this.playTarg.hint=["HR"],this.text=`Deal ${this.sspb} to a creature.~You may play an additional ${this.name} this turn.`}ssperZ(t){t.hurtDirect(this.sspb,this.code);const e=E.freeCard(this.code);e.condition.cardCode="STP"}get sspb(){return this.lValN([3,8,12])}tanglC(){this.faction="U",this.rarity="R",this.name="Tangle",this.xl=!1;let t="";this.level===3?t=" You gain health equal to that creature's attack.":this.playTarg.hint=["KL"],this.text=`Destroy a ${p.levelGateText(this.level+1,!0)}creature with Mobility.${t}`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hasMobility=!0}tanglZ(t){U.destroy(t,this.code),this.level===3&&v.heal("F",t.attack)}tpactC(){this.faction="N",this.rarity="C",this.name="Tarsian Pact";const t=this.boof235;this.text=`Give a Nekrium creature ${p.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.hint=["BF"],this.playTarg.faction="N"}tpactZ(t){const e=this.boof235;t.buff(e,e),t.addRegen(e)}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.playTarg.hint=["BF"],this.text=`Give a Robot ${p.jr9(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),t.buff(this.boof4612,0)}totsC(){this.faction="N",this.rarity="T",this.name="Tendrils Of Twilight",this.isFree=!0;const t=-this.boof7911;this.text=`Give an enemy creature ${p.jr9(-1,-1)}.~If that creature is opposing a friendly Duskmaw, give that creature ${p.jr9(t,t)} instead.`,this.playTarg.player="E"}totsZ(t){const e=this.duskBof(t);t.buff(e,e)}duskBof(t){const e=t.opposed;let i=!1;return e&&(i=Dt.extractCardCode(e.code)==="DTD"),i?-this.boof7911:-1}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${p.dbdtac(this.level)}, destroy that creature."`,this.playTarg.hint=["BF"]}blightZ(t){t.changed=!0,t.jr4("DM",this.code)}txbnC(){this.faction="U",this.rarity="R",this.name="Toxic Boon";const t=this.boof357;this.text=`Give an enemy creature Poison ${t}, or give a friendly creature ${p.jr9(t,t)}.`}txbnZ(t){const e=this.boof357;t.owner===v.getActiveB()?t.buff(e,e):t.addPoison(e)}get tspois(){return this.lValN([5,7,12])}sporeC(){this.faction="U",this.rarity="C",this.name="Toxic Spores",this.text=`Give a creature Poison ${this.tspois}.`,this.playTarg.hint=["PN"]}sporeZ(t){t.addPoison(this.tspois)}tremcC(){this.faction="T",this.rarity="C",this.name="Tremorcharge",this.text=`Give a Tempys creature ${p.jr9(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T",this.playTarg.hint=["BF"]}tremcZ(t){t.buff(0,this.boof4812),t.addMobility(this.level)}uboltC(){this.faction="T",this.rarity="R",this.name="Uranti Bolt",this.xl=!1,this.text=`Deal ${this.ubzap} damage to a creature.~It gets Defender until the end of the next turn.`}uboltZ(t){t.hurtDirect(this.ubzap,this.code);const e=y.mod("DF",!0,this.code);e.expiry="EN",t.addMod(e)}get ubzap(){return this.lValN([3,10,20])}urstC(){this.faction="U",this.rarity="C",this.name="Ursine Strength";const t=this.boof3711;this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(t,t)}. ${this.rankT()}, it gets an additional ${p.jr9(2,2)}.`}urstZ(t){const e=this.boof3711+(v.getActive().rank>this.level?2:0);t.buff(e,e)}vensC(){this.faction="U",this.rarity="C",this.name="Venomstrike",this.playTarg.hint=["PN"],this.text=`Give a creature Poison ${this.boof468}.~You may play an additional ${this.name} this turn.`}vensZ(t){t.addPoison(this.boof468);const e=E.freeCard(this.code);e.condition.cardCode="VSK"}vgraC(){this.faction="U",this.rarity="C",this.name="Verdant Grace",this.playTarg.player="F",this.text=`Heal ${this.boof101520} damage from a friendly creature and ${this.boof246} health from each other friendly creature.`}vgraZ(t){t.heal(this.boof101520);const e=this.boof246;g.creatByTarget(y.crFriendNotMeTarg(t.id)).forEach(i=>{i.heal(e)})}vglchC(){this.faction="N",this.rarity="R",this.name="Vigor Leech";const t=this.boof369n;this.text=`Give an enemy creature ${p.jr9(t,t)}, or give a friendly creature Regenerate ${-t}.`}vglchZ(t){const e=this.boof369n;t.owner===v.getActiveB()?t.addRegen(-e):t.buff(e,e)}vobC(){this.faction="T",this.rarity="R",this.name="Violent Outburst",this.level===3?this.isFree=!0:this.hints=["LG"],this.text=`Give a ${p.levelGateText(this.level+1,!0)}creature Aggressive and, "When this creature ${p.dbdtap()}, it also deals that much damage to itself."`}vobZ(t){t.aggressive=!0,t.changed=!0,t.jr4("DM",this.code)}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace",this.playTarg.hint=["DB"];const t=this.boof468,e=-t;this.text=`Give a creature ${p.jr9(e,e)}.~You gain ${t} health.`}vembZ(t){const e=this.boof468,i=-e;t.buff(i,i),v.heal(v.getActive(),e)}warC(){this.faction="A",this.rarity="H",this.name="Warmonger Mod";let t=this.level,e=3;this.level===1&&(this.playTarg.level="LN",e=2,t=2),this.playTarg.hint=["BF"],this.text=`Give a ${p.levelGateText(e,!0)}creature ${t}x attack.`}warZ(t){const e=this.level===3?2:1;t.buff(t.attack*e,0)}xwillC(){this.faction="N",this.rarity="H",this.name="Xrath's Will",this.xl=!1;const t=this.boof3612;this.text=`Destroy an enemy creature with ${t} or less attack.~You may play an additional Zombie this turn.`,this.playTarg.player="E",this.playTarg.maxAttack=t}xwillZ(t){U.destroy(t,this.code);const e=E.freeCard(this.code);e.condition.tribe="ZB"}}class He extends M{lookup(t){return{["ATP"]:{c:()=>this.phagC(),t:()=>this.phagT(),f:(i,s)=>this.phagF(i,s)},["SSH"]:{c:()=>this.sshmC(),t:()=>this.sshmT(),f:(i,s)=>this.sshmF(i,s)},["TPG"]:{c:()=>this.pillC(),t:()=>this.pillT(),f:(i,s)=>this.pillF(i,s)},["TMG"]:{c:()=>this.grootC(),t:()=>this.grootT(),f:(i,s)=>this.grootF(i,s)}}[t]}forgTargets(t){return this.lookup(t).t()}forgAction(t,e,i){this.lookup(t).f(e,i)}optional=!0;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Forge: "+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}handleAction(t){const e=g.jr5(t.param);this.forgAction(this.cardCode(),t.position,e),bt.popMode(),S.actionDone(!0)}jr8(t){const e=this.forgTargets(this.cardCode());if(e.length>0){const i=e.map(s=>{const h=y.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return h.param=t.creatId,h.host=this.code,h});if(this.optional){const s=S.noneEndTrigger();s.param="PM",i.push(s)}Ft.showCustomDeck(e,i)}else x.triggerDone()}phagC(){this.faction="U",this.rarity="H",this.name="Aetherphage",this.iAttack=this.lValN([7,10,16]),this.iHealth=this.boof3612,this.tribe.push("IN"),this.ftext=`Look at the ${p.levelGateText(this.level,!0)}spells in the enemy player's hand and choose one. The enemy player discards the chosen spell.`}phagT(){const t=v.toPlayer(!v.getActiveB()),e=y.target("TH");return e.player=v.toTarget(t),e.level=D.ddf2(this.level),e.card="S",Ft.generateContent(t.hand,!1,e)}phagF(t,e){const i=v.toPlayer(!e.owner),s=i.hand[t];i.hand.splice(t,1),i.discard.push(s)}sshmC(){this.faction="U",this.rarity="H",this.name="Soothsayer Hermit",this.iAttack=this.boof61016,this.iHealth=this.iAttack-1,this.tribe.push("LP"),this.ftext=`You may put a ${p.levelGateText(this.level)} creature from your discard pile into your hand.`}sshmT(){const t=v.getActive(),e=y.target("TD");return e.player=v.toTarget(t),e.card="C",e.level=D.ddf2(this.level),Ft.generateContent(t.discard,!1,e)}sshmF(t,e){const i=v.toPlayer(e.owner),s=i.discard.splice(t,1);i.hand.push(s[0])}pillC(){this.faction="N",this.rarity="H",this.name="Tomb Pillager",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("ZB"),this.consistent=this.level>1,this.ftext="You may banish a Nekrium card from your discard pile."}pillT(){const t=v.getActive(),e=y.target("TD");return e.player=v.toTarget(t),e.faction="N",Ft.generateContent(t.discard,!1,e)}pillF(t,e){v.toPlayer(e.owner).discard.splice(t,1)}grootC(){this.faction="U",this.rarity="R",this.name="Toorgmai Guardian",this.iAttack=this.boof4711,this.iHealth=this.iAttack,this.tribe.push("PL");const t=this.boof358;this.ftext=`You may banish a Plant from your discard pile. If you do, ${this.name} gets ${p.jr9(t,t)}.`}grootT(){const t=v.getActive(),e=y.target("TD");return e.player=v.toTarget(t),e.tribe="PL",Ft.generateContent(t.discard,!1,e)}grootF(t,e){v.toPlayer(e.owner).discard.splice(t,1);const s=this.boof358;e.buff(s,s)}}class zi extends mt{jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){g.qEnemyCreats().forEach(e=>{e.addPoison(6)}),x.triggerDone()}}class Zi extends M{constructor(t){super(t),this.faction="U",this.rarity="T",this.name="Dino Knight",this.iAttack=this.lValN([8,12,18]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.iAggro=!0,this.iBT=!0,this.maxLevel=this.level,this.minLevel=this.level;const e=this.boof357;this.text=`When this ${p.dbdtap()}, heal ${e} damage from each other friendly creature.~Vengeance: Put a level ${this.level} Bron, Wild Tamer into this lane.`}image(t){return this.fixedImage(t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("VN");s.bonus=this.buffNug(this.iAttack,this.iHealth);const h=i.jr4("DM");return h.bonus=this.buffNug(0,this.boof357),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="VN"){const e=g.jr5(t.creatId);g.birth("BWT"+this.level,"P",e.owner,e.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,i=y.crNotMeTarg(t.creatId);i.player=v.toTarget(t.owner),g.creatByTarget(i).forEach(h=>h.heal(e)),x.triggerDone()}}}class Yi extends kt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Discordant Strike";const e=-this.boof4610;this.text=`Give an enemy creature ${p.jr9(e,0)}.~Allied Nekrium: Give an enemy creature ${p.jr9(0,e)}.`}playTargets(){const t=super.playTargets(),e=y.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=T.deTil(t.param),i=-this.boof4610,s=g.ddf6(t);e[0]==="P1"?(this.logSpell(s),s.buff(i,0),E.allied("N")?S.ddf5(D.toActions(y.crEnemyActTarg("CARD",this.code,"P2"))):S.spellCast()):(this.logSpell(s),s.buff(0,i),S.spellCast())}}class Ki extends kt{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.isFree=this.level===3,this.level<3&&(this.hints=["LG"]),this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}playTargets(){const t=super.playTargets(),e=this.poisTarg();return this.level===1?t.push(e):g.creatByTarget(e).length>0&&t.push(D.boardTarget("CARD",this.code)),t}handleAction(t){if(this.level===1){const e=g.ddf6(t);this.logSpell(e),e.addPoison(e.poison)}else this.logSpell(),g.creatByTarget(this.poisTarg()).forEach(i=>{i.addPoison(i.poison)});S.spellCast()}poisTarg(){const t=y.crEnemyActTarg("CARD",this.code,"");return t.hasPoison=!0,t}}class Xi extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Doppelbot",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("RB");let e="";const i=this.lValN([0,5,10]);this.level>1&&(e=`, then give it ${p.jr9(i,0)}`),this.text=`Activate: Look at the creatures in the enemy player's hand and choose one. Replace ${this.name} with the chosen creature${e}.`;const s=this.avgCreatureStats();this.bonus={activ8:this.buffNug(i+s[0]-this.iAttack,s[1])}}canActivate(t){return v.toPlayer(!t.owner).hand.some(i=>L.getCard(i).type==="C")}startActivation(t){let e;if(ot.simOn)e=[{cardCode:"VND"+this.level,sourceIdx:0,cardCount:0}];else{const s=v.toPlayer(!v.getActiveB()),h=y.target("TH");h.player=v.toTarget(s),h.card="C",e=Ft.generateContent(s.hand,!1,h)}const i=e.map(s=>{const h=y.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return h.param=t.id,h.host=this.code,h});Ft.showCustomDeck(e,i)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),i=g.birth(t.card,"R",e.owner,e.lane);this.level>1&&i?.buff(this.level===3?10:5,0),bt.popMode(),e.endActivation()}}class qi extends M{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Dysian Broodqueen",this.iAttack=this.boof248,this.iHealth=this.boof61117,this.tribe.push("NG");const e=L.getCard(this.bfc()),i=`Destroy an enemy ${p.levelGateText(this.level,!0)}creature.`;this.text=`Activate, destroy another friendly creature: ${i}~Allied Uterra: Put a ${p.tokName(e)} into an available lane.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.5)}}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[1]==="P1"){const i=g.ddf6(t),s=this.enemies(e[0],i.id);s.push(S.cancelAction()),S.ddf5(s)}else if(e[1]==="P2"){this.logAct(!0);const i=g.jr5(e[0]),s=R.tick(),h=g.jr5(e[2]),f=g.ddf6(t);U.destroy(h,this.code,s),U.destroy(f,this.code,s),i.endActivation()}else g.birth(this.bfc(),"P",t.playerA,t.lane),S.actionDone(!0)}jr8(t){if(E.allied("U")){const e=y.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId),i=D.toActions(e);i.length>0?S.ddf5(i):x.triggerDone()}else x.triggerDone()}friends(t){const e=y.crFriendNotMeActTarg("CARD",t,this.code,T.enTil(t,"P1"));return D.toActions(e)}enemies(t,e=""){const i=y.crEnemyActTarg("CARD",this.code,T.enTil(t,"P2",e));return i.level=D.ddf2(this.level),D.toActions(i)}bfc(){return "BRF"+this.level}}class ji extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Dysian Siphon";const e=this.boof357;this.text=`Give an enemy creature ${p.jr9(-e,-e)}.~Allied Uterra: Give a friendly creature ${p.jr9(e,e)}. `}playTargets(){const t=super.playTargets(),e=y.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=T.deTil(t.param),i=this.boof357,s=g.ddf6(t);if(e[0]==="P1"){const h=y.crFriendActTarg("CARD",this.code,T.enTil("P2",s.id)),f=D.toActions(h);E.allied("U")&&f.length>0?(f.push(S.cancelAction()),S.ddf5(f)):(this.logSpell(s),s.buff(-i,-i),S.spellCast())}else{const h=g.jr5(e[1]);this.logSpell(h,s),h.buff(-i,-i),s.buff(i,i),S.spellCast()}}}class Ji extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Dysian Sludge",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ");const e=-this.boof135;this.text=`Forge: If you have health over 120, you may put a copy of ${this.name} into another lane.~When this enters play, if you have a Nekrium card in hand, the opposing creathure gets ${p.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,s.customCode=i.id,i.jr4("EF"),i}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){const e=V.toEnterField(t.event);if(e.forged&&e.creature.id===t.trigger.customCode)if(v.getActive().health>120){const i=y.actionTarget("TF","CARD",this.code,"");i.player="F",i.hint=["FL"],i.lanes=g.laneIdx.filter(h=>h!==e.creature.lane);const s=D.toActions(i);s.push(S.noneEndTrigger()),S.ddf5(s)}else x.triggerDone();else{const i=e.creature.opposed;if(i&&E.allied("N",e.creature.owner)){const s=-this.boof135;i.buff(s,s)}x.triggerDone()}}handleAction(t){g.birth(this.code,"R",t.playerA,t.lane),S.actionDone(!0)}}class Qi extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Echowisp",this.iAttack=this.lValN([7,8,10]),this.iHealth=this.boof135,this.tribe.push("ST"),this.level===3?this.text="Forge: Put a copy of Echowisp into each available lane.":this.text="Forge: You may put a copy of Echowisp into an adjacent lane."}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=this.level<3,i}jr8(t){if(this.level<3){const e=g.jr5(t.trigger.creatId),i=y.actionTarget("TF","CARD",this.code,"");i.player="F",i.lanes=e.adjacent,i.hint=["FL"];const s=D.toActions(i);s.push(S.noneEndTrigger()),S.ddf5(s)}else{const e=y.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId);let i=D.toActions(e);if(i.length>0){const s=R.tick();i.forEach(h=>g.birth(this.code,"P",h.playerA,h.lane,s))}x.triggerDone()}}handleAction(t){g.birth(this.code,"P",t.playerA,t.lane),S.actionDone(!0)}}class ri extends M{lookup(t){return{["BTB"]:{c:()=>this.bbtC(),m:i=>this.bbtM(i)},["TVG"]:{c:()=>this.tvgC(),m:i=>this.tvgM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}armThreshold=1;wipe=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("AR",this.code);return s.area="A",i}enforceEffect(t,e){this.armThreshold<=e.armor?this.createMods(this.cardCode(),e).forEach(i=>{this.wipe&&e.removeModSafe(e.id),e.addModSafe(i)}):e.removeModSafe(e.id)}bbtC(){this.faction="A",this.rarity="R",this.name="Batterbot",this.iAttack=this.boof6914,this.iHealth=this.iAttack+2,this.tribe.push("RB","DN"),this.wipe=!0,this.text=`${this.name} gets +Attack equal to its Armor.`}bbtM(t){return[y.mod("AT",t.armor,t.id)]}tvgC(){this.faction="A",this.rarity="R",this.name="Tower Vanguard",this.iAttack=this.lValN([3,6,11]),this.iHealth=this.lValN([7,13,21]),this.tribe.push("RB");const t=this.boof247;this.text=`While ${this.name} has Armor, it gets ${p.jr9(t,0)}.`}tvgM(t){return[y.mod("AT",this.boof247,t.id)]}}class me extends M{lookup(t){return{["CIN"]:{c:()=>this.cyinC(),m:i=>this.cyinM(i)},["HWM"]:{c:()=>this.hlwmC(),m:i=>this.hlwmM(i)},["LSP"]:{c:()=>this.lspC(),m:i=>this.lspM(i)},["SSI"]:{c:()=>this.ssinC(),m:i=>this.ssinM(i)},["WTA"]:{c:()=>this.weguC(),m:i=>this.weguM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return i.addEffect("AT",this.code),i}enforceEffect(t,e){this.attThreshold<=e.attack?this.createMods(this.cardCode(),e).forEach(i=>{e.addModSafe(i)}):e.removeModSafe(e.id)}cyinC(){this.faction="A",this.rarity="R",this.name="Cypien Infiltrator",this.iAttack=this.boof61117,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.attThreshold=this.lValN([7,14,21]),this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Breakthrough.`}cyinM(t){return[y.mod("BT",!0,t.id)]}hlwmC(){this.faction="A",this.rarity="L",this.name="Hinterland Watchman",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.lValN([7,10,20]),this.tribe.push("MC"),this.attThreshold=this.boof51020;const t=this.lValS(["Mobility 3","Armor 5 and Mobility 3","Armor 5, Breakthrough, Aggressive, Mobility 3, and Regenerate 5"]);this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets ${t}.`}hlwmM(t){const e=[y.mod("MB",3,t.id)];return this.level>1&&e.push(y.mod("AR",5,t.id)),this.level===3&&(e.push(y.mod("BT",!0,t.id)),e.push(y.mod("AG",!0,t.id)),e.push(y.mod("RG",5,t.id))),e}lspC(){this.faction="A",this.rarity="C",this.name="Lightshield Patrol",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.boof51020,this.tribe.push("HM"),this.attThreshold=this.iHealth,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Armor ${this.boof234}.`}lspM(t){return[y.mod("AR",this.boof234,t.id)]}ssinC(){this.faction="A",this.rarity="R",this.name="Spiritsteel Infiltrator",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("EN"),this.attThreshold=this.boof51020,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Mobility ${this.level} and Armor ${this.boof246}.`}ssinM(t){return[y.mod("MB",this.level,t.id),y.mod("AR",this.boof246,t.id)]}weguC(){this.faction="U",this.rarity="L",this.name="Wegu, the Ancient",this.iAttack=0,this.iHealth=1,this.tribe.push("PL"),this.iDefend=!0,this.attThreshold=this.lValN([10,25,100]);const t=this.boof124,e=this.level===3?"it gets Breakthrough and ":"";this.text=`When you gain health, Wegu gets ${p.jr9(t,t)} for each health you gained.~While Wegu has ${this.attThreshold} or more attack, ${e}Negate Defender from it.`}weguM(t){const e=[y.mod("ND",!0,t.id)];return this.level===3&&e.push(y.mod("BT",!0,t.id)),e}}class si extends M{friendNotMe(t){const e=y.crNotMeTarg(t.id);return e.player=v.toTarget(t.owner),e}friendNone(t){const e=y.crTarg();return e.player=v.toTarget(t.owner),e.lanes=[],e}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforcementActive(t){return t.status==="A"}applyEffect(t,e,i){const s=this.friendNotMe(t),h=g.creatByTarget(s),f=g.creatByTarget(i);h.forEach(m=>{f.includes(m)?m.addModSafe(e):m.removeModSafe(t.id)})}}class Ne extends si{lookup(t){return{["BWW"]:{c:()=>this.bwwC(),m:i=>this.bwwM(i),t:i=>this.bwwT(i)},["HTR"]:{c:()=>this.hrtC(),m:i=>this.hrtM(i),t:i=>this.hrtT(i)},["KKK"]:{c:()=>this.kkkC(),m:i=>this.kkkM(i),t:i=>this.kkkT(i)},["XDV"]:{c:()=>this.xdvC(),m:i=>this.xdvM(i),t:i=>this.xdvT(i)}}[t]}createMod(t,e){return this.lookup(t).m(e)}effTargs(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t,e){const i=this.cardCode(),s=this.createMod(i,e),h=this.enforcementActive(e)?this.effTargs(i,e):this.friendNone(e);this.applyEffect(e,s,h)}bwwC(){this.faction="T",this.rarity="H",this.name="Borean Windweaver",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.iMobile=this.level,this.tribe.push("WN","AS"),this.text=`Each other friendly creature gets Mobility ${this.level}.`}bwwM(t){return y.mod("MB",this.level,t.id)}bwwT(t){return this.friendNotMe(t)}hrtC(){this.faction="U",this.rarity="L",this.name="Heart Tree",this.iAttack=0,this.iHealth=this.lValN([10,15,30]),this.iRegen=this.boof246,this.iDefend=!0,this.tribe.push("PL"),this.text=`Each other friendly creature gets Regenerate ${this.iRegen}.`}hrtM(t){return y.mod("RG",this.iRegen,t.id)}hrtT(t){return this.friendNotMe(t)}kkkC(){if(this.faction="T",this.rarity="L",this.name="Korok, Khan of Kadras",this.iAttack=this.lValN([4,7,12,18]),this.iHealth=this.lValN([7,12,18,26]),this.iAggro=!0,this.tribe.push("FB"),this.maxLevel=4,this.level>1){const t=this.lValS(["","friendly level 1","friendly level 2 or lower","other friendly"]);this.text=`Each ${t} creature gets Aggressive.`}}kkkM(t){return y.mod("AG",!0,t.id)}kkkT(t){const e=this.friendNotMe(t);return this.level===1?e.lanes=[]:e.level=D.ddf2(this.level-1),e}xdvC(){this.faction="N",this.rarity="H",this.name="Xrath, Dreadnight Of Varna",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.boof248,this.tribe.push("ZB"),this.text=`Each other friendly Zombie gets Regenerate ${this.iRegen}`}xdvM(t){return y.mod("RG",this.iRegen,t.id)}xdvT(t){const e=this.friendNotMe(t);return e.tribe="ZB",e}}class _i extends M{lookup(t){return{["AHL"]:{c:()=>this.ahlC(),m:i=>this.ahlM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){const i=y.crNotMeTarg(e.id);i.player=v.toTarget(e.owner),g.creatByTarget(i).length===0?this.createMods(this.cardCode(),e).forEach(h=>{e.addModSafe(h)}):e.removeModSafe(e.id)}ahlC(){this.faction="A",this.rarity="H",this.name="Alloyin Highlander",this.iAttack=this.lValN([5,7,10]),this.iHealth=this.boof6914,this.tribe.push("HM"),this.text=`While ${this.name} is your only friendly creature, it gets ${p.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}ahlM(t){return[y.mod("AT",this.boof4812,t.id),y.mod("AR",this.boof248,t.id)]}}class ai extends M{lookup(t){return{["NXP"]:{c:()=>this.nxpC(),m:i=>this.nxpM(i)},["SKG"]:{c:()=>this.skgC(),m:i=>this.skgM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){e.lane===3?this.createMods(this.cardCode(),e).forEach(i=>{e.addModSafe(i)}):e.removeModSafe(e.id)}nxpC(){this.faction="A",this.rarity="C",this.name="Nexus Pilot",this.iAttack=this.boof358,this.iHealth=this.boof4710,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets ${p.jr9(this.iAttack,this.iHealth)}.`}nxpM(t){return[y.mod("AT",this.iAttack,t.id),y.mod("HL",this.iHealth,t.id),y.mod("MH",this.iHealth,t.id)]}skgC(){this.faction="A",this.rarity="C",this.name="Skyknight Glider",this.iAttack=this.boof5916,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets Mobility 2.`}skgM(t){return[y.mod("MB",2,t.id)]}}class Oe extends M{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:i=>this.cctM(i)},["GHB"]:{c:()=>this.ghbC(),m:i=>this.ghbM(i)},["PYG"]:{c:()=>this.pygC(),m:i=>this.pygM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}likesOpposed=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=[this.likesOpposed?"OP":"OL"]}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){!!e.opposed===this.likesOpposed?this.createMods(this.cardCode(),e).forEach(i=>{e.addModSafe(i)}):e.removeModSafe(e.id)}cctC(){this.faction="T",this.rarity="R",this.name="Cloudcleaver Titan",this.iAttack=this.boof4812,this.iHealth=this.lValN([7,10,16]),this.tribe.push("WN","GT"),this.iMobile=this.level;const t=this.boof246;this.text=`While ${this.name} is unopposed, it gets ${p.jr9(t,0)}.`}cctM(t){return[y.mod("AT",this.boof246,t.id)]}ghbC(){this.faction="U",this.rarity="R",this.name="Gemhide Basher",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.lValN([3,7,10]),this.tribe.push("DN"),this.likesOpposed=!0,this.text=`While ${this.name} is opposed, it gets Aggressive.`}ghbM(t){return[y.mod("AG",!0,t.id)]}pygC(){this.faction="T",this.rarity="H",this.name="Pyre Giant",this.iAttack=this.boof468,this.iHealth=this.boof234,this.tribe.push("FR","GT"),this.iAggro=!0,this.text=`While ${this.name} is unopposed, it gets ${p.jr9(this.iAttack,0)}.`}pygM(t){return[y.mod("AT",this.iAttack,t.id)]}}class ni extends M{lookup(t){return{["BRS"]:{c:()=>this.barryC(),m:i=>this.barryM(i)},["CSR"]:{c:()=>this.cvsC(),m:i=>this.cvsM(i)}}[t]}mPlayer=0;targetPlayer(t){if(this.mPlayer===1)return t.owner;if(this.mPlayer===-1)return!t.owner;throw new Error("didnt write code OBDD")}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){const i=e.status==="A",s=this.targetPlayer(e);if(i){const h=this.createMod(this.cardCode(),e);v.addModSafe(s,h)}else v.removeModSafe(s,e.id)}barryC(){this.faction="A",this.rarity="C",this.name="Barrier Soldier",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("HM"),this.mPlayer=1,this.text=`You get Armor ${this.iHealth}.`}barryM(t){return y.mod("AR",this.iHealth,t.id)}cvsC(){this.faction="U",this.rarity="C",this.name="Cavern Serpent",this.iAttack=this.boof4914,this.iHealth=this.iAttack,this.tribe.push("SN"),this.mPlayer=-1,this.text=`The enemy player has Poison ${this.boof246}.`}cvsM(t){return y.mod("PN",this.boof246,t.id)}}class pe extends si{lookup(t){return{["ALG"]:{c:()=>this.algnC(),m:i=>this.algnM(i)},["ALS"]:{c:()=>this.alstC(),m:i=>this.alstM(i)},["BTN"]:{c:()=>this.btcC(),m:i=>this.btcM(i)},["NXA"]:{c:()=>this.aeroC(),m:i=>this.aeroM(i)},["NXT"]:{c:()=>this.ntcC(),m:i=>this.ntcM(i)}}[t]}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}nexus=!1;enforcementActive(t){return super.enforcementActive(t)?this.nexus?t.lane===3:!0:!1}enforceEffect(t,e){const i=this.cardCode(),s=this.createMod(i,e);let h;this.enforcementActive(e)?(h=this.friendNotMe(e),this.nexus?h.lanes=[1,2,4,5]:h.lanes=e.adjacent):h=this.friendNone(e),this.applyEffect(e,s,h)}algnC(){this.faction="A",this.rarity="R",this.name="Alloyin General",this.iAttack=this.boof246,this.iHealth=this.boof81318,this.tribe.push("HM"),this.text=`Adjacent creatures gets ${p.jr9(this.iAttack,0)}.`}algnM(t){return y.mod("AT",this.iAttack,t.id)}alstC(){this.faction="A",this.rarity="H",this.name="Alloyin Strategist",this.iAttack=this.boof4814,this.iHealth=this.iAttack+1,this.iMobile=this.level,this.tribe.push("HM");const t=this.boof246;this.text=`Adjacent creatures gets ${p.jr9(t,0)}.`}alstM(t){return y.mod("AT",this.boof246,t.id)}btcC(){this.faction="A",this.rarity="H",this.name="Battle Techtician",this.iAttack=this.boof3714,this.iHealth=this.boof71117,this.tribe.push("HM"),this.nexus=!0;const t=this.boof248;this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${p.jr9(t,0)}.`}btcM(t){return y.mod("AT",this.boof248,t.id)}aeroC(){this.faction="A",this.rarity="L",this.name="Nexus Aeronaut",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.iMobile=1;const t=this.boof236;this.nexus=!0,this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${p.jr9(t,0)}. Otherwise this gets Armor ${t}.`}aeroM(t){return y.mod("AT",this.boof236,t.id)}ntcC(){this.faction="A",this.rarity="H",this.name="Nexus Techtician",this.iHealth=this.boof6916,this.iAttack=this.iHealth-3,this.tribe.push("HM"),this.nexus=!0;const t=this.boof235;this.text=`While ${this.name} is in the center lane, each other friendly creature gets Armor ${t}.`}ntcM(t){return y.mod("AR",this.boof235,t.id)}}class ye extends M{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC(),["RWC"]:()=>this.roamC()})[t]()}targAction(t){g.birth(this.spawnCode,"P",t.playerA,t.lane)}adjacent=!1;optional=!1;needsEmpty=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const e=p.forglied(this.allied);this.text=e+": "+this.ftext}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){if(this.allied==="X"||E.allied(this.allied)){const e=g.jr5(t.creatId),i=y.emptyPlayerActTarg("F","CARD",this.code,t.creatId);this.needsEmpty||(i.field="A",i.hint=["FL"],i.lanes=g.laneIdx.filter(h=>h!==e.lane)),this.adjacent&&(i.lanes=e.adjacent);const s=D.toActions(i);s.length>0?(this.optional&&s.push(S.noneEndTrigger()),S.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){this.targAction(t),S.actionDone(!0)}bwdC(){this.faction="U",this.rarity="C",this.name="Branchweaver Druid",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.hints=["RT"],this.spawnCode=`${"TFD"}${this.level}`,this.optional=!0;const t=L.getCard(this.spawnCode);this.ftext=`You may put a ${p.tokName(t)} into another lane.`}btsC(){this.faction="U",this.rarity="C",this.name="Brighttusk Sower",this.iAttack=this.lValN([6,8,10]),this.iHealth=this.iAttack,this.tribe.push("TK"),this.level===1&&(this.hints=["ZZ-1"]),this.spawnCode=z.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=L.getCard(this.spawnCode);this.ftext=`You may put a ${p.tokName(t)} into an adjacent lane.`}escarC(){this.faction="A",this.rarity="H",this.name="Esperian Scarab",this.iAttack=this.lValN([3,4,7]),this.iHealth=this.boof5711,this.iArmor=this.boof135,this.tribe.push("RB"),this.allied="U",this.spawnCode=this.code,this.optional=!0,this.ftext=`You may but a copy of ${this.name} into another lane.`}ethhC(){this.faction="U",this.rarity="C",this.name="Ether Hounds",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ST"),this.needsEmpty=!0,this.spawnCode=this.code,this.ftext="Put a copy of this into an available lane."}roamC(){this.faction="U",this.rarity="C",this.name="Roaming Warclaw",this.iAttack=this.boof61016,this.iHealth=this.iAttack-3,this.tribe.push("DN"),this.spawnCode=`${"RPT"}${this.level}`,this.optional=!0,this.ftext="You may put a 1/1 Raptor into another lane."}}class tr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Epoch Hawk",this.iAttack=this.boof469,this.iHealth=this.boof71117,this.tribe.push("MC");const e=L.getCard(this.soldier);this.addSp("N",e.iAttack),this.text=`While you have 6 or more cards in hand, this gets "Activate: Put a ${p.tokName(e)} into an available lane."`,this.bonus={activ8:this.multNug(this.spawnNug(e),.3)}}canActivate(t){return v.toPlayer(t.owner).hand.length>5&&g.emptyLanes(t.owner).length>0}startActivation(t){const e=y.emptyPlayerActTarg(t.owner,"CARD",this.code,t.id),i=D.toActions(e);i.push(S.cancelAction()),S.ddf5(i)}handleAction(t){const e=g.jr5(t.param);this.logAct(!0),g.birth(this.soldier,"P",t.playerA,t.lane),e.endActivation()}ddf8(t){return t.trigger.type==="TE"}jr8(t){const e=v.toPlayer(t.owner);v.drawCard(e,1);const i=y.trigIdx(e.triggers,t.trigger);i>-1&&e.triggers.splice(i,1),x.triggerDone()}get soldier(){return "EPS"+this.level}}class er extends M{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Esperian Sage",this.iAttack=this.boof3510,this.iHealth=this.boof124,this.tribe.push("HM"),this.text=`When ${this.name} enters play, discard and level up a card.~Allied Uterra: You may put a copy of this into another lane.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");s.interactive=!0;const h=i.jr4("EF");return h.interactive=!0,i}handleAction(t){if(t.zone==="H")E.levelAndDiscardA(t);else{const e=t;g.birth(this.code,"R",e.playerA,e.lane)}S.actionDone(!0)}ddf8(t){return t.event.code==="ENT"?t.event.creatId===t.creatId:!1}jr8(t){if(t.trigger.type==="FR")if(E.allied("U")){const e=g.jr5(t.creatId),i=y.actionTarget("TF","CARD",this.code,t.creatId);i.player="F",i.lanes=g.laneIdx.filter(h=>h!==e.lane),i.hint=["FL"];const s=D.toActions(i);s.push(S.noneEndTrigger()),S.ddf5(s)}else x.triggerDone();else{const e=y.lvlHandActTarg(this.code,t.creatId),i=D.toActions(e);i.length>0?S.ddf5(i):x.triggerDone()}}}class ir extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Esperian Steelplate",this.iAttack=this.boof369,this.iHealth=this.boof6916,this.tribe.push("IN");const e=this.boof358;this.addSp("H",e),this.text=`Activate: Heal ${e} damage from each other friendly creature.~Allied Alloyin: Armor ${this.boof247}.`,this.bonus={activ8:this.buffNug(0,e)}}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){const e=y.crFriendNotMeTarg(t.id);return g.creatByTarget(e).length>0}startActivation(t){const e=D.boardTarget("CARD",this.code);e.param=t.id,S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),i=this.boof358,s=y.crFriendNotMeTarg(e.id);g.creatByTarget(s).forEach(h=>{h.heal(i)}),e.endActivation()}jr8(t){E.allied("A")&&g.jr5(t.creatId).addArmor(this.boof247),x.triggerDone()}}class rr extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Everflame Phoenix",this.iAttack=this.lValN([7,0,22]),this.iHealth=this.lValN([6,1,15]),this.tribe.push("PX"),this.iMobile=this.lValN([1,0,2]),this.level===2?(this.iDefend=!0,this.text=`When you gain a rank, replace ${this.name} with a level 3 ${this.name}.`,this.hints=["RH","LG"]):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this lane.`,this.hints=["ZZ-3"])}jr3(t,e){const i=super.jr3(t,e);if(this.level===2){const s=i.jr4("RU");s.bonus=this.buffNug(10,9)}else if(this.level===3){const s=i.jr4("VN");s.bonus=this.statSpawnNug(0,1)}return i}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.owner:super.ddf8(t)}jr8(t){if(t.trigger.type==="RU"){const e=g.jr5(t.creatId);g.birth(`${"EFP"}3`,"R",e.owner,e.lane)}else if(t.trigger.type==="VN"){const i=V.toCreature(t.event).creature;g.birth(`${"EFP"}2`,"P",i.owner,i.lane)}x.triggerDone()}}class sr extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Everflow Eidolon",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("PL"),this.text=`When ${this.name} gains health, you gain ${this.level===3?"2x ":""}that much health.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("HG");return s.bonus=this.playerNug(this.iHealth/2),i}ddf8(t){return t.trigger.type==="HG"?t.event.creatId===t.creatId:!1}jr8(t){if(t.trigger.type==="HG"){const e=t.event,i=this.level===3?2:1;v.heal(t.owner,e.healAmt*i)}x.triggerDone()}}class ar extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Frostmane Dragon",this.iAttack=this.lValN([6,9,13]),this.iHealth=this.iAttack+1,this.tribe.push("IC","DG"),this.iMobile=2,this.text=`At the start of your turn, if ${this.name} was Forged last turn, you may put a Level ${this.level} Frostmane egg into an available lane.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}handleAction(t){g.birth(`${"FME"}${this.level}`,"P",t.playerA,t.lane),S.actionDone(!0)}ddf8(t){return t.trigger.type==="TS"?t.event.playerA===t.owner:!1}jr8(t){const e=g.jr5(t.creatId);if(t.event.code==="ENT"){const i=e.jr4("TS");i.interactive=!0,i.changes=!0,i.bonus=this.rawNug(1,0,6,0),x.triggerDone()}else if(t.event.code==="TRS"){const i=y.trigIdx(e.triggers,t.trigger);i>-1&&e.removeTrigger(e.triggers[i]);const s=y.emptyPlayerActTarg("F","CARD",this.code,""),h=D.toActions(s);h.length===0?x.triggerDone():(h.push(S.noneEndTrigger()),S.ddf5(h))}}}class nr extends kt{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const e=this.boof4711;this.text=`Deal ${e} damage to an enemy creature.~Give a friendly creature ${p.jr9(e,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(y.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const e=T.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=this.friends(i.id);s.push(S.cancelAction()),S.ddf5(s)}else{this.logSpell(i);const s=g.jr5(e[1]),h=this.boof4711;s.hurtDirect(h,this.code);const f=y.mod("AT",h,this.code);f.expiry="ET",i.addMod(f),S.spellCast()}}friends(t=""){const e=y.crFriendActTarg("CARD",this.code,T.enTil("P2",t));return D.toActions(e)}}class or extends kt{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Gauntlets of Sulgrim";const e=this.boof2510;this.text=`Give a friendly creature Armor ${e}, then deal damage equal to its Armor to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.baddies().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");e.canArmor=!0,t.push(e)}return t}handleAction(t){const e=T.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=S.cancelAction(),h=this.baddies(i.id);h.push(s),S.ddf5(h)}else{const s=g.jr5(e[1]);this.logSpell(s);const h=this.boof2510;s.addArmor(h),i.hurtDirect(s.armor,this.code),S.spellCast()}}baddies(t=""){return D.toActions(y.crEnemyActTarg("CARD",this.code,T.enTil("P2",t)))}}class hr extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Gemhide Ravager",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("DN"),this.text=`When ${this.name} ${p.dbdtap()}, you gain that much health.~Allied Tempys: Mobility ${this.level}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.bonus=this.playerNug(this.iAttack),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR")E.allied("T")&&g.jr5(t.creatId).addMobility(this.level),x.triggerDone();else if(t.trigger.type==="DM"){const e=t.event;v.heal(t.owner,e.dmg),x.triggerDone()}}}class lr extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Glaceus, Tundra Tyrant",this.iAttack=this.boof5916,this.iHealth=this.iAttack+2,this.tribe.push("IC","EL"),this.hints=["TL"];const e=`Gain Rank: each enemy ${p.levelGateText(this.level,!0)}creature gets "When this is dealt damage, destroy it."`,i=this.level===3?"At the start of each turn, deal 1 damage to each enemy creature.~":"";this.text=i+e}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("RU");if(s.bonus=this.statSpawnNug(0,0),this.level===3){const h=i.jr4("TS");h.bonus=this.buffNug(3,0)}return i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;if(e.isCreatTarg&&e.target===t.creatId)return!0}return t.trigger.type==="RU"?t.event.playerA===t.owner:t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="RU"){const e=y.crEnemyTarg();e.level=D.ddf2(this.level),g.creatByTarget(e).forEach(i=>{const s=i.jr4("DM");s.bonus=this.rawNug(0,0,0,0,-2),s.changes=!0})}else if(t.trigger.type==="TS"){const e=R.tick();g.qEnemyCreats().forEach(i=>{i.hurtDirect(1,this.code,e)})}else if(t.trigger.type==="DM"){const e=g.jr5(t.creatId);e.status==="A"&&U.destroy(e,this.code)}x.triggerDone()}}class cr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Grave Pact",this.isFree=this.level===3,this.text=`Destroy a friendly creature.~Destroy an ${p.levelGateText(this.level+1,!0)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=T.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=this.enemyTargActions(i.id);s.push(S.cancelAction()),S.ddf5(s)}else{this.logSpell();const s=g.jr5(e[1]),h=R.tick();U.destroy(s,this.code,h),U.destroy(i,this.code,h),S.spellCast()}}enemyTargActions(t=""){const e=y.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return e.level=D.ddf2(this.level+1),D.toActions(e)}}class dr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const e=this.boof359;this.text=`Give a friendly creature +${e} attack.~Give an enemy creature -${e} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=T.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=this.enemyTargActions(i.id);s.push(S.cancelAction()),S.ddf5(s)}else{const s=g.jr5(e[1]);this.logSpell(s,i);const h=this.boof359;s.buff(h,0),i.buff(-h,0),S.spellCast()}}enemyTargActions(t=""){const e=y.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return D.toActions(e)}}class ur extends M{constructor(t){super(t),this.faction="U",this.rarity="C",this.name="Hunting Pack",this.iAttack=this.boof3612,this.iHealth=this.boof248,this.tribe.push("WF"),this.text=`When ${this.name} enters play, you have a 50% chance to put a copy of ${this.name} into an available lane.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("EF");return s.interactive=!0,i}handleAction(t){g.birth(this.code,"P",t.playerA,t.lane),S.actionDone(!0)}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){if(T.randInt(0,ot.simOn?4:2)===1){const i=y.emptyPlayerActTarg("F","CARD",this.code,""),s=y.actionTarget("TB","NOTR",this.code,""),h=D.toActions([i,s]);h.length===1?x.triggerDone():S.ddf5(h)}else x.triggerDone()}}class fr extends M{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Iniog, Carrion Demon",this.iAttack=this.lValN([0,12,20]),this.iHealth=this.boof3713,this.tribe.push("DM");let e;this.level===1?(this.iDefend=!0,e=5):(this.iMobile=1,this.iRegen=this.level===2?5:10,e=10,this.hints=["ZZ-5"]);let i;this.level===3?i="When this gains health, deal that much damage to the enemy player.~Vengeance: Put a level 1 Iniog into this lane.":i=`When a creature is destroyed, this gets Regenerate 1.~At the end of your turn, if this has Regenerate ${e} or higher, replace it with a level ${this.level+1} Iniog.`,this.text=i}jr3(t,e){const i=super.jr3(t,e);if(this.level===3){const s=i.jr4("HG");s.bonus=this.playerNug(4);const h=i.jr4("VN");h.bonus=this.buffNug(0,3)}else{const s=i.jr4("DS");s.bonus=this.regnNug(2);const h=i.jr4("TE"),f=L.getCard(this.levelUpCard());h.bonus=this.multNug(this.buffNug(f.iAttack,f.iHealth),.4)}return i}ddf8(t){return t.trigger.type==="TE"?t.event.playerA===t.owner:t.trigger.type==="HG"?t.event.creatId===t.creatId:t.trigger.type==="DS"}jr8(t){const e=g.jr5(t.creatId);if(t.trigger.type==="HG"){const i=t.event;v.hurtDirect(!t.owner,i.healAmt,this.code)}else if(t.trigger.type==="VN")g.birth("ICD"+"1","P",e.owner,e.lane);else if(t.trigger.type==="DS")e.addRegen(1);else if(t.trigger.type==="TE"){const i=this.level===1?4:9;e.regen>i&&g.birth(this.levelUpCard(),"R",e.owner,e.lane)}x.triggerDone()}}class gr extends M{image(t){return super.fixedImage(t)}constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Iztek, Avatar of Flame",this.iAttack=this.lValN([7,12,20]),this.iHealth=this.boof6915,this.tribe.push("FR","EL"),this.iAggro=!0,this.text=`When Iztek ${p.dbdtap()}, deal that much damage to that player again.~When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");s.bonus=this.buffNug(0,this.iAttack);const h=i.jr4("DM");return h.bonus=this.buffNug(this.iAttack,0),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}else if(t.trigger.type==="PC"){const e=t.event;if(e.playerA===t.owner)return L.getCard(e.cardCode).cardCode()==="IFR"}return!1}jr8(t){if(t.trigger.type==="DM"){const e=t.event;v.hurtDirect(!t.owner,e.dmg,this.code)}else if(t.trigger.type==="PC"){const e=g.jr5(t.trigger.creatId);g.birth(`${"IZR"}${this.level}`,"R",e.owner,e.lane)}x.triggerDone()}}class mr extends M{image(t){return super.fixedImage(t)}constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Iztek, Avatar of Frost",this.iAttack=this.boof6915,this.iHealth=this.lValN([7,12,20]),this.tribe.push("IC","EL"),this.iAggro=!0;const e=this.boof2510;this.text=`When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.~Activate: Deal ${e} damage to a creature.`,this.bonus={activ8:this.buffNug(e,0)}}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.bonus=this.buffNug(0,this.iAttack),i}canActivate(t){return!0}startActivation(t){const e=y.crActTarg("CARD",this.code,t.id);e.hint=["HR"];const i=D.toActions([e,D.buttonTarget("CANC")]);S.ddf5(i)}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.logAct(!0),e.hurtDirect(this.boof2510,this.code),i.endActivation()}ddf8(t){const e=t.event;return e.playerA===t.owner?L.getCard(e.cardCode).cardCode()==="IFL":!1}jr8(t){const e=g.jr5(t.trigger.creatId);g.birth(`${"IZL"}${this.level}`,"R",e.owner,e.lane),x.triggerDone()}}class pr extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Killer Bee",this.iAttack=this.boof135,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("IN"),this.hints=["OL",this.lValH(["ZZ+2","ZZ+2","ZZ+3"])];const e=this.lValS(["Poison 1","Poison 3","that much Poison"]);this.text=`When ${this.name} deals battle damage to a creature or player, they get ${e}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.regnNug(this.iAttack),s.bonus.pHealth=this.iAttack,i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){const e=V.toDamage(t.event),i=this.lValN([1,3,e.dmg]);e.isCreatTarg?e.hurtCreat.addPoison(i):e.hurtPlayer.poison+=i,x.triggerDone()}}class yr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Killion, Infinity Warden",this.maxLevel=4,this.iAttack=this.lValN([6,9,16,22]),this.iHealth=this.lValN([3,7,14,20]),this.tribe.push("FB");let e;this.level<3?e=`a ${p.levelGateText(this.level)} card in your`:this.level===3?e="a card in your hand and":e="each card in your hand, deck, and",this.text=`Forge: Level up ${e} discard pile.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=this.level<4,i}handleAction(t){const e=v.getActive();if(t.zone==="N"){const i=L.getCard(e.discard[t.position]);e.discard[t.position]=i.levelUpCard(),bt.popMode(),S.actionDone(!0)}else{const i=L.getCard(e.hand[t.position]);e.hand[t.position]=i.levelUpCard(),this.discardLevel(!0)}}jr8(t){if(this.level<3)this.discardLevel(!1);else if(this.level===3){const e=D.toActions(y.lvlHandActTarg(this.code,""));e.length>0?S.ddf5(e):this.discardLevel(!1)}else{const e=v.getActive();this.levelDeck(e.deck),this.levelDeck(e.hand),this.levelDeck(e.discard),x.triggerDone()}}discardLevel(t){const e=v.getActive(),i=y.target("TD");i.player=v.toTarget(e),i.level=D.ddf2(this.level),i.canLevel=!0;const s=Ft.generateContent(e.discard,!1,i);if(s.length>0){const h=s.map(f=>{const m=y.deckSelectAction("CARD",f.cardCode,f.sourceIdx);return m.host=this.code,m.hint=["CD"],m});Ft.showCustomDeck(s,h)}else t?S.actionDone(!0):x.triggerDone()}levelDeck(t){t.map(i=>{const s=L.getCard(i);return s.canLevel()?s.levelUpCard():i}).forEach((i,s)=>t[s]=i)}}class br extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Lavafused Asir",this.iAttack=this.boof369,this.iHealth=this.iAttack*2,this.tribe.push("FR","AS"),this.text=`While a friendly creature is unopposed, gets ${p.jr9(this.iAttack,0)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){const i=y.crTarg(),s=e.status!=="A";i.player=v.toTarget(e.owner);const h=g.creatByTarget(i),f=y.mod("AT",this.iAttack,e.id);h.forEach(m=>{m.opposed||s?m.removeModSafe(e.id):m.addModSafe(f)})}}class Ar extends M{constructor(t){if(super(t),this.faction="U",this.rarity="L",this.name="Leafkin Progenitor",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level===3)this.text=`Activate: Put a level 1 ${this.name} into an adjacent available lane.`,this.bonus={activ8:this.statSpawnNug(3,3)};else{this.text=`Activate: Replace this with a level ${this.level+1} ${this.name}.`;const e=3*this.level;this.bonus={activ8:this.buffNug(e,e)}}}canActivate(t){return this.level===3?S.emptyAdjacents(t,"").length>0:!0}startActivation(t){let e;if(this.level===3)e=S.emptyAdjacents(t,"");else{const i=y.fieldSelectAction("CARD",t.lane,t.owner);i.param=t.id,i.host=this.code,e=[i]}e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);this.level===3?g.birth(this.leafCode(1),"P",t.playerA,t.lane):g.birth(this.leafCode(this.level+1),"R",e.owner,e.lane),e.endActivation()}leafCode(t){return`${"LKP"}${t}`}}class ce extends M{cardConstruct(t){({["AFO"]:()=>this.aetorC(),["CRS"]:()=>this.scootC(),["FOL"]:()=>this.forcC(),["NXO"]:()=>this.nexoC(),["TEX"]:()=>this.texC(),["TSM"]:()=>this.tsmithC()})[t]()}targAction(t,e,i){({["AFO"]:(h,f)=>this.doNossing(h,f),["CRS"]:(h,f)=>this.doNossing(h,f),["FOL"]:(h,f)=>this.doNossing(h,f),["NXO"]:(h,f)=>this.doNossing(h,f),["TEX"]:(h,f)=>this.doNossing(h,f),["TSM"]:(h,f)=>this.doNossing(h,f)})[t](e,i)}playTarg;optional=!1;ftext="";forgeLevels=[1,2,3,4];constructor(t){super(t),this.playTarg=y.lvlHandActTarg(this.code,""),this.cardConstruct(this.cardCode()),this.forgeLevels.includes(this.level)&&(this.text="Forge: "+this.ftext)}jr3(t,e){const i=super.jr3(t,e);if(this.forgeLevels.includes(this.level)){const s=i.jr4("FR");s.interactive=!0}return i}handleAction(t){E.levelAndDiscardA(t);const e=g.jr5(t.param);this.targAction(this.cardCode(),t,e),S.actionDone(!0)}jr8(t){if(this.cardCode()==="NXO"&&g.jr5(t.creatId).lane!==3){x.triggerDone();return}const e=D.toActions(this.playTarg);e.length>0?(e.forEach(i=>{i.param=t.creatId}),this.optional&&e.push(S.noneEndTrigger()),S.ddf5(e)):x.triggerDone()}doNossing(t,e){}aetorC(){this.faction="A",this.rarity="C",this.name="Aetherforge Oracle",this.iAttack=this.boof61218,this.iHealth=this.boof246,this.tribe.push("HM"),this.optional=!0,this.playTarg.card="S",this.ftext="You may discard and level up a spell."}scootC(){this.faction="A",this.rarity="R",this.name="Cerebral Scout",this.iAttack=this.boof51015,this.iHealth=this.boof3712,this.tribe.push("MM"),this.optional=!0,this.playTarg.tribe="MM",this.ftext="You may discard and level up a Metamind."}forcC(){this.faction="A",this.rarity="H",this.name="Forge Oracle",this.iAttack=this.lValN([1,10,20]),this.iHealth=this.iAttack,this.tribe.push("ST"),this.playTarg.faction="A",this.optional=!0,this.ftext="You may discard an Alloyin card and level it.",this.level===1?this.hints=["LG","RT"]:(this.consistent=!0,this.addSp("C",0),this.level===3&&(this.hints=["ZZ-2"]))}nexoC(){this.faction="A",this.rarity="C",this.name="Nexus Overwatch",this.iHealth=this.boof71014,this.iAttack=this.iHealth-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`If ${this.name} is in the center lane, you may ${p.daluac()}.`}texC(){this.faction="A",this.rarity="C",this.name="Tech Explorer",this.iAttack=this.lValN([1,8,18]),this.iHealth=this.iAttack+2,this.tribe.push("GN"),this.level===1&&(this.hints=["LG","RT"]),this.optional=!0,this.playTarg.card="C",this.ftext="You may discard and level up a creature."}tsmithC(){this.faction="A",this.rarity="C",this.name="Technosmith",this.iAttack=this.boof5915,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`You may ${p.daluac()}.`}}class Rt extends M{lookup(t){return{["DFB"]:{c:()=>this.dfbC(),d:(i,s)=>this.dfbD(i,s)},["GGD"]:{c:()=>this.ggdC(),d:(i,s)=>this.ggdD(i,s)},["GGR"]:{c:()=>this.ggdrC(),d:(i,s)=>this.ggdrD(i,s)},["GGP"]:{c:()=>this.ggpC(),d:(i,s)=>this.ggpD(i,s)},["MHR"]:{c:()=>this.mhermC(),d:(i,s)=>this.mhermD(i,s)},["NGT"]:{c:()=>this.ngauntC(),d:(i,s)=>this.ngauntD(i,s)},["SRH"]:{c:()=>this.sharvC(),d:(i,s)=>this.sharvD(i,s)},["YNS"]:{c:()=>this.yuruC(),d:(i,s)=>this.yuruD(i,s)}}[t]}trigB;creatDied(t,e){this.lookup(t).d(e,V.toCreature(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DS");return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="DS"}jr8(t){this.creatDied(this.cardCode(),t),x.triggerDone()}dfbC(){this.faction="N",this.rarity="R",this.name="Dr. Frankenbaum",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("AB");const t=this.boof234;this.text=`When a friendly Abomination is destroyed, deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t*2)}dfbD(t,e){const i=g.jr5(t.creatId),s=e.creature;(i.id===s.id||s.owner===i.owner&&s.isTribe("AB")&&Rt.itDiedFirst(s.id,i.id))&&v.hurtDirect(!i.owner,this.boof234,this.code)}ggdC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Devourer",this.iAttack=this.boof579,this.iHealth=this.iAttack-2,this.tribe.push("GG"),this.hints=["OL"],this.text=`When a creature is destroyed, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),2)}ggdD(t,e){g.jr5(t.creatId).buff(this.level,this.level)}get doomb(){return this.lValN([1,1,2])}ggdrC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Doomrider",this.iAttack=this.boof4712,this.iHealth=this.iAttack+2,this.tribe.push("GG");const t=this.doomb;this.text=`When a friendly creature is destroyed, ${this.name} moves to that creatures lane and gets ${p.jr9(t,t)}. Then give the opposing creature ${p.jr9(-t,-t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}ggdrD(t,e){const i=g.jr5(t.creatId),s=e.creature;if(s.owner===i.owner&&i.id!==s.id&&Rt.itDiedFirst(s.id,i.id)&&!g.searchByLane(s.lane,s.owner)){const f=this.doomb;i.move(s.lane),i.buff(f,f);const m=i.opposed;m&&(this.logAct(!1,m),m.buff(-f,-f))}}ggpC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Predator",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("GG"),this.hints=["OP"];const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}ggpD(t,e){const i=g.jr5(t.creatId),s=g.oppositeLane(i.lane);if(e.creature.owner!==i.owner&&e.creature.lane===s){const h=this.boof246;i.buff(h,h)}}mhermC(){this.faction="U",this.rarity="L",this.name="Malice Hermit",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("YT");const t=this.boof124;this.text=`Forge: Each other creature gets Poison ${t}.~When a creature with Poison is destroyed, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}mhermD(t,e){if(e.creature.poison>0){const i=this.boof124,s=g.jr5(t.creatId);this.logAct(!1,e.creature),s.buff(i,i)}}ngauntC(){this.faction="N",this.rarity="R",this.name="Nightgaunt",this.iAttack=this.boof4815,this.iHealth=this.iAttack+1,this.tribe.push("GG"),this.text=`When a creature is destroyed, ${this.name} gets Regenerate 1.`,this.trigB=this.regnNug(2)}ngauntD(t,e){g.jr5(t.creatId).addRegen(1)}sharvC(){this.faction="N",this.rarity="C",this.name="Sorrow Harvester",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("AB"),this.text="When a friendly Abomination is destroyed on your turn, draw a card.",this.trigB=this.rawNug(0,0,0,0,ht.dcWeight)}sharvD(t,e){const i=e.creature;i.owner===t.owner&&i.isTribe("AB")&&v.getActiveB()===t.owner&&Rt.itDiedFirst(i.id,t.creatId)&&v.drawCard(t.owner,1)}yuruC(){this.faction="N",this.rarity="L",this.name="Yuru, the Necrosage",this.iAttack=3,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("HM"),this.level===1&&(this.hints=["ZZ-1"]);const t=L.getCard(this.syc());this.text=`When an adjacent non-Spirit creature is destroyed, put a ${p.tokName(t)} into that lane.`,this.trigB=this.spawnNug(t)}yuruD(t,e){const i=g.jr5(t.creatId),s=e.creature;s.owner===i.owner&&i.adjacent.includes(s.lane)&&!s.isTribe("ST")&&Rt.itDiedFirst(s.id,i.id)&&g.birth(this.syc(),"P",i.owner,s.lane)}syc(){return "XYR"+this.level}static itDiedFirst(t,e){if(t===e)return!0;let i=!1;const s=U.findDeathTime(e);if(T.isUn(s))i=!0;else{const h=U.findDeathTime(t);(T.isUn(h)||h<=s)&&(i=!0)}return i}}class kr extends Rt{jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){if(t.trigger.type==="FR"){const e=g.creatByTarget(y.crNotMeTarg(t.creatId)),i=this.boof124;e.forEach(s=>s.addPoison(i)),x.triggerDone()}else super.jr8(t)}}class vr extends kt{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metatransfer",this.text=`Give a creature ${p.jr9(-this.boof579,0)}.~Discard and level up a card.`}playTargets(){const t=super.playTargets(),e=y.crActTarg("CARD",this.code,"P1");return e.hint=["DB"],t.push(e),t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=y.lvlHandActTarg(this.code,T.enTil("P2",i.id));s.deckPositionSkip=S.playPosition();const h=D.toActions(s);h.length===0?(this.logSpell(i),i.buff(-this.boof579,0),S.spellCast()):(h.push(S.cancelAction()),S.ddf5(h))}else{const i=g.jr5(e[1]);this.logSpell(i),i.buff(-this.boof579,0);const s=t;S.shiftPlayCard(s.position),E.levelAndDiscardA(s),S.spellCast()}}}class Tr extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Mimicleaf",this.iAttack=this.lValN([2,5,11]),this.iHealth=this.iAttack,this.tribe.push("PL"),this.text=`Activate: Put a level ${this.level} ${this.name} into an adjacent available lane.`,this.bonus={activ8:this.statSpawnNug(this.iAttack,this.iHealth)}}canActivate(t){return S.emptyAdjacents(t,"").length>0}startActivation(t){const e=S.emptyAdjacents(t,"");e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);g.birth(e.code,"P",t.playerA,t.lane),e.endActivation()}}class Sr extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Mimicwurm",this.iAttack=7,this.iHealth=this.iAttack,this.tribe.push("WR"),this.text=this.lValS(["","Forge: You may put a level 1 Mimicwurm into another lane.","Forge: You may put a level 2 Mimicwurm into another lane. Then you may put a level 1 Mimicwurm into another lane."])}jr3(t,e){const i=super.jr3(t,e);if(this.level>1){const s=i.jr4("FR");s.interactive=!0}return i}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")if(this.level===3){this.wurmsign(2,t);const i=[t.lane,parseInt(e[1])],s=this.fieldActions("P2",i);S.ddf5(s)}else this.wurmsign(1,t),S.actionDone(!0);else this.wurmsign(1,t),S.actionDone(!0)}jr8(t){const e=V.toCreature(t.event);S.ddf5(this.fieldActions("P1",[e.creature.lane]))}fieldActions(t,e){const i=y.actionTarget("TF","CARD",this.code,T.enTil(t,e[0]));i.player="F",i.hint=["FL"],i.lanes=g.laneIdx.filter(h=>!e.includes(h));const s=D.toActions(i);return s.push(S.noneEndTrigger()),s}wurmsign(t,e){g.birth(this.wurmCode(t),"R",e.playerA,e.lane)}wurmCode(t){return`${"MMW"}${t}`}}class ae extends kt{lookup(t){return{["BRN"]:{c:()=>this.boutC(),z:(i,s)=>this.burner(i,s,8)},["IFL"]:{c:()=>this.izfmC(),z:(i,s)=>this.burner(i,s,this.boof6915)},["LSK"]:{c:()=>this.lspkC(),z:(i,s)=>this.burner(i,s,this.boof6812)},["LYR"]:{c:()=>this.rainC(),z:(i,s)=>this.rainZ(i,s)},["SOK"]:{c:()=>this.sealkC(),z:(i,s)=>this.burner(i,s,this.sealzap)},["STB"]:{c:()=>this.shatC(),z:(i,s)=>this.shatZ(i,s)},["SHK"]:{c:()=>this.shkC(),z:(i,s)=>this.shkZ(i,s)}}[t]}cardCast(t,e,i){this.lookup(t).z(e,i)}hurts=!0;burner(t,e,i){e?t.hurtDirect(i,this.code):v.hurtDirect(t,i,this.code)}burnText(t){return`Deal ${t} damage to a creature or player.`}constructor(t){super(t),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets(),e=this.hurts?["HR"]:["BF"],i=y.crActTarg("CARD",this.code,"");i.hint=e;const s=y.actionTarget("TP","CARD",this.code,"");return s.hint=e,t.push(i,s),t}handleAction(t){let e,i;t.zone==="P"?(this.logSpell(),e=!1,i=t.playerA):(i=g.ddf6(t),this.logSpell(this.hurts?void 0:i),e=!0),this.cardCast(this.cardCode(),i,e),S.spellCast()}boutC(){this.faction="T",this.rarity="R",this.name="Burnout",this.overload=!0,this.maxLevel=1,this.text=this.burnText(8)}izfmC(){this.faction="T",this.rarity="T",this.name="Iztek's Flame";const t=this.boof6915;this.addSp("D",t),this.text=this.burnText(t)}lspkC(){this.faction="T",this.rarity="C",this.name="Lightning Spark";const t=this.boof6812;this.addSp("D",t),this.text=this.burnText(t)}rainC(){this.faction="U",this.rarity="C",this.name="Lysian Rain",this.hurts=!1;const t=this.boof7911;this.addSp("H",t),this.text=`Give a creature or player +${t} health.`}rainZ(t,e){const i=this.boof7911;e?t.buff(0,i):v.heal(t,i)}sealkC(){this.faction="T",this.rarity="C",this.name="Seal of Kadras",this.level<3&&(this.hints=["LG"]),this.consistent=this.level>1;const t=this.sealzap;this.addSp("D",t),this.consistent&&this.addSp("C",0),this.text=this.burnText(t)}get sealzap(){return this.lValN([1,2,25])}shatC(){this.faction="T",this.rarity="C",this.name="Shatterbolt";const t=this.boof5914;this.addSp("D",t),this.text=`Negate Armor from a creature or player this turn, then deal ${t} damage to that creature or player.`}shatZ(t,e){const i=this.boof5914,s=y.mod("NA",!0,this.code);if(s.expiry="ET",e){const h=t;h.addMod(s),h.hurtDirect(i,this.code)}else{const h=v.toPlayer(t);v.addMod(h,s),v.hurtDirect(h,i,this.code)}}shkC(){this.faction="T",this.rarity="H",this.name="Static Shock";const t=this.boof124;this.addSp("D",t),this.hints=["ZZ+1"],this.text=`${this.burnText(t)} You may play an additional ${p.levelGateText(this.level,!0)}spell this turn.`}shkZ(t,e){this.burner(t,e,this.boof124);const i=E.freeCard(this.code);i.condition.level=D.ddf2(this.level),i.condition.card="S"}}class Cr extends M{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Nefrax, the Soulweaver",this.iAttack=this.boof4712,this.iHealth=this.lValN([10,15,25]),this.tribe.push("HM"),this.hints=["ZZ-2"];const e=L.getCard(this.spc());this.text=`Activate: Put a ${p.tokName(e)} into an available lane.~Forge: Destroy a friendly creature.`,this.bonus={activ8:this.spawnNug(e)}}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}canActivate(t){return this.empties(t).length>0}startActivation(t){const e=this.empties(t);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){this.logAct(!0);const i=g.jr5(e[1]);g.birth(this.spc(),"P",t.playerA,t.lane),i.endActivation()}else{const i=g.ddf6(t);U.destroy(i,this.code),S.actionDone(!0)}}jr8(t){const e=y.crFriendActTarg("CARD",this.code,""),i=D.toActions(e);S.ddf5(i)}spc(){return "SPN"+this.level}empties(t){const e=y.emptyPlayerActTarg("F","CARD",this.code,T.enTil("P1",t.id));return D.toActions(e)}}class wr extends M{constructor(t){super(t),this.faction="N",this.rarity="T",this.name="Netherdrake",this.iAttack=this.boof4815,this.iHealth=this.iAttack,this.iMobile=this.lValN([0,0,1]),this.tribe.push("DG"),this.text=`When this enters play or moves into a lane, destroy the opposing ${p.levelGateText(this.level,!0)}creature.`}image(t){return this.rawImage(`${"NSH"}${this.level}`,t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FK");return s.bonus=this.multNug(this.avgSpawnNug(),.5),i.jr4("EF"),i}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){const i=V.toCreature(t.event).creature.opposed;i&&D.levelTestCommon(i.level,this.level)&&U.destroy(i,this.code),x.triggerDone()}}class Dr extends pe{enforceEffect(t,e){e.lane===3?e.removeModSafe(e.id):e.addModSafe(y.mod("AR",this.boof236,e.id)),super.enforceEffect(t,e)}}class xr extends M{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Nova, Grove Queen",this.iAttack=this.lValN([3,5,10,14]),this.iHealth=this.lValN([7,10,15,19]),this.tribe.push("FB"),this.maxLevel=4;const e=this.nbuf,i=this.lValS(["an adjacent","each adjacent","each","each"]);this.text=`Forge: Put a 1/1 Seedling into ${i} available space.~When a friendly creature is replaced, Nova gets ${p.jr9(e,e)}.`}get nbuf(){return this.lValN([1,3,5,10])}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");this.level===1&&(s.interactive=!0);const h=i.jr4("RP"),f=this.nbuf;return h.bonus=this.buffNug(f,f),i}ddf8(t){if(t.event.code==="RPL"){const e=V.toReplaced(t.event);return t.creatId!==e.replCreatId&&t.owner===e.replCreat.owner}return!1}jr8(t){const e=g.jr5(t.creatId);if(t.event.code==="RPL"){const i=this.nbuf;e.buff(i,i),x.triggerDone()}else{const i="NSD"+this.level,s=g.emptyLanes(t.owner);if(this.level>1){const h=this.level===2?e.adjacent.filter(m=>s.includes(m)):s,f=R.tick();h.forEach(m=>{g.birth(i,"P",e.owner,m,f)}),x.triggerDone()}else{const h=e.adjacent.filter(f=>s.includes(f));if(h.length===0)x.triggerDone();else if(h.length===1)g.birth(i,"P",e.owner,h[0]),x.triggerDone();else{const f=S.emptyAdjacents(e,"");S.ddf5(f)}}}}handleAction(t){g.birth("NSD"+this.level,"P",t.playerA,t.lane),S.actionDone(!0)}}class Br extends kt{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const e=this.boof246,i=e*-1;this.text=`Give a friendly Zombie ${p.jr9(e,e,!0)}, and Regenerate ${e}.~Then give an enemy non-Zombie ${p.jr9(i,i)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");e.tribe="ZB",t.push(e)}return t}handleAction(t){const e=T.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=S.cancelAction(),h=this.nonZombies(i.id);h.push(s),S.ddf5(h)}else{const s=g.jr5(e[1]);this.logSpell(s,i);const h=this.boof246;s.buff(h,h),s.addRegen(h),i.buff(-h,-h),S.spellCast()}}nonZombies(t=""){const e=y.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return D.toActions(e).filter(i=>{const s=i;return!g.ddf6(s).isTribe("ZB")})}}class Hr extends M{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Onyxium Allomancer",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("HM");const e=this.boof358;this.text=`Activate: Discard and level up a card.~Allied Nekrium: Regenerate ${e}.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){return v.toPlayer(t.owner).hand.some(i=>L.getCard(i).canLevel())}startActivation(t){const e=y.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);E.levelAndDiscardA(t),e.endActivation()}jr8(t){E.allied("N")&&g.jr5(t.creatId).addRegen(this.boof358),x.triggerDone()}}class Nr extends M{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Onyxium Phantasm",this.iAttack=this.boof246,this.iHealth=this.lValN([9,12,19]),this.iRegen=this.boof124,this.tribe.push("ST");const e=this.boof4812n;this.addSp("A",e),this.text=`Allied Alloyin: Activate: Give a creature ${p.jr9(e,0)}`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){return t.hasMod(t.id)}startActivation(t){const e=y.crActTarg("CARD",this.code,t.id);e.hint=["DF","DB"];const i=D.toActions(e);i.push(S.cancelAction()),S.ddf5(i)}handleAction(t){const e=g.jr5(t.param),i=g.ddf6(t);this.logAct(!0,i),i.buff(this.boof4812n,0),e.endActivation()}jr8(t){if(E.allied("A")){const e=g.jr5(t.creatId);e.addMod(y.mod("AL",!0,e.id)),e.changed=!0;const i=e.jr4("PT");i.bonus=this.buffNug(this.boof4812,0)}x.triggerDone()}}class Fr extends kt{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Oratek Battlebrand";const e=this.boof71013;this.addSp("D",e),this.text=`Deal ${e} damage to a creature.~Allied Alloyin: You may discard a card and level it.`}playTargets(){const t=super.playTargets(),e=y.crActTarg("CARD",this.code,"");return e.hint=["HR"],t.push(e),t}handleAction(t){if(t.zone==="F"){const e=t,i=g.ddf6(e);if(this.logSpell(),i.hurtDirect(this.boof71013,this.code),E.allied("A")){const s=this.levelActs();s.length===1?S.spellCast():S.ddf5(s)}else S.spellCast()}else if(t.zone==="H"){const e=t;S.shiftPlayCard(e.position),E.levelAndDiscardA(e),S.spellCast()}else t.zone==="B"&&t.param==="NOTR"?S.spellCast():super.handleAction(t)}levelActs(){const t=y.actionTarget("TB","CARD",this.code,"NOTR"),e=y.lvlHandActTarg(this.code,"");return e.deckPositionSkip=S.playPosition(),D.toActions([e,t])}}class Pr extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Oratek Warhammer",this.iAttack=this.boof3713,this.iHealth=this.lValN([8,12,19]),this.iMobile=this.level,this.tribe.push("FR","AS"),this.text=`Allied Alloyin: When ${this.name} ${p.dbdtap()} on your turn, you may discard and level up a card.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.bonus=this.rawNug(0,0,0,0,.5),i}handleAction(t){E.levelAndDiscardA(t),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=V.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===v.getActiveB()}return!1}jr8(t){if(t.trigger.type==="FR"){if(E.allied("A")){const e=g.jr5(t.creatId),i=e.jr4("DM");i.interactive=!0,e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=D.toActions(y.lvlHandActTarg(this.code,""));e.length>0?(e.push(S.noneEndTrigger()),S.ddf5(e)):x.triggerDone()}}}class ze extends M{hitCreature;constructor(t,e){super(t),this.hitCreature=e}trigB;jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.trigB,i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatTarg===this.hitCreature&&e.isCreatSrc&&e.srcId===t.creatId}return!1}}class Mr extends ze{constructor(t){super(t,!1),this.faction="U",this.rarity="L",this.name="Oros, Deepwood's Chosen",this.iAttack=this.lValN([7,11,16,0]),this.iHealth=this.iAttack,this.iBT=!0,this.maxLevel=4,this.tribe.push("FB"),this.hints=["OL"];const e=`When Oros ${p.dbdtap()}, you gain that much health.`,i=this.level===4?"Oros gets +attack and +health equal to your health.~":"";this.text=i+e}jr3(t,e){const i=super.jr3(t,e);return this.level===4&&i.addEffect("PH",this.code),i}jr8(t){const e=t.event;v.heal(t.owner,e.dmg),x.triggerDone()}enforceEffect(t,e){const i=v.toPlayer(e.owner).health;e.status==="A"&&(e.removeModSafe(e.id),e.addModSafe(y.mod("HL",i,e.id)),e.addModSafe(y.mod("MH",i,e.id)),e.addModSafe(y.mod("AT",i,e.id)))}}class Rr extends M{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Oxidon Spitter",this.iAttack=this.boof7914,this.iHealth=this.boof3510,this.tribe.push("DN"),this.l3=this.level===3,this.text=`Forge: Negate Armor from ${this.l3?"each":"an"} enemy creature.`}l3;jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!this.l3,i}jr8(t){if(this.l3)g.creatByTarget(y.crEnemyTarg()).forEach(e=>{e.negateArmor=!0}),x.triggerDone();else{const e=y.crEnemyActTarg("CARD",this.code,""),i=D.toActions(e);i.length>0?S.ddf5(i):x.triggerDone()}}handleAction(t){const e=g.ddf6(t);this.logAct(!1,e),e.negateArmor=!0,S.actionDone(!0)}}class ne extends M{lookup(t){return{["AFS"]:{c:()=>this.afsC(),a:i=>this.afsA(i),t:i=>this.afsT(i)},["DMW"]:{c:()=>this.drixC(),a:i=>this.drixA(i),t:i=>this.drixT(i)},["FGG"]:{c:()=>this.fggC(),a:i=>this.fggA(i),t:i=>this.fggT(i)},["GHS"]:{c:()=>this.mvpC(),a:i=>this.mvpA(i),t:i=>this.mvpT(i)},["OWW"]:{c:()=>this.owwC(),a:i=>this.owwA(i),t:i=>this.owwT(i)},["UPM"]:{c:()=>this.upakC(),a:i=>this.upakA(i),t:i=>this.upakT(i)},["WFM"]:{c:()=>this.wfmC(),a:i=>this.wfmA(i),t:i=>this.wfmT(i)}}[t]}runAct(t,e){this.lookup(t).a(e)}testAct(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}preFight=!1;prePlay=!1;canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){const e=D.boardTarget("CARD",this.code);e.param=t.id,this.preFight&&(e.hint=["BB"]),this.prePlay&&(e.hint=["DF"]),S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);this.runAct(this.cardCode(),e),e.endActivation()}afsC(){this.faction="A",this.rarity="L",this.name="Arcflight Squadron",this.iAttack=this.boof4710,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.hints=["OL",this.level===1?"ZZ-3":"ZZ-2"],this.prePlay=!0,this.text=`Activate: You may play an additional ${p.levelGateText(this.level,!0)}Robot this turn.`,this.bonus={activ8:this.avgSpawnNug()}}afsT(t){return!0}afsA(t){const e=E.freeCard(this.code);e.condition.tribe="RB",e.condition.level=D.ddf2(this.level)}drixC(){this.faction="A",this.rarity="L",this.name="Drix, the Mindwelder",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,12,21]),this.tribe.push("MM"),this.preFight=!0,this.addSp("A",this.level),this.text=`Activate, discard your hand: Each friendly Metamind gets ${p.jr9(this.level,0)} for each card discarded this way.`,this.bonus={activ8:this.buffNug(3*this.level,0)}}drixT(t){return v.getActive().hand.length>0}drixA(t){const e=v.toPlayer(t.owner),i=e.hand.length*this.level;e.discard.push(...e.hand),e.hand=[];const s=y.crFriendTarg();s.tribe="MM",g.creatByTarget(s).forEach(h=>{h.buff(i,0)})}fggC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Gamma",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("RB","GD"),this.preFight=!0;const t=L.getCard(z.fgoc(this.level));this.addSp("N",t.iAttack),this.text=`Activate, destroy five friendly Robot Guardians: Put a ${p.tokName(t)} into this lane.`,this.bonus={activ8:this.rawNug(0,0,0,0,1)}}fggT(t){return g.creatByTarget(this.fggTarg()).length===5}fggA(t){const e=t.lane,i=t.owner,s=R.tick();g.creatByTarget(this.fggTarg()).forEach(h=>U.destroy(h,this.code,s)),g.birth(z.fgoc(this.level),"P",i,e)}fggTarg(){const t=y.crFriendTarg();return t.tribe="GD",t}mvpC(){this.faction="U",this.rarity="C",this.name="Gemheart Sprout",this.iAttack=this.boof357,this.iHealth=this.iAttack+this.level,this.iDefend=!0,this.tribe.push("PL"),this.preFight=!0,this.addSp("L",this.level),this.text=`Activate: You gain health equal to ${this.level}x the number of friendly creatures.`,this.bonus={activ8:this.playerNug(this.level*3)}}mvpT(t){return!0}mvpA(t){const e=g.ddf1().length;v.heal(t.owner,e*this.level)}owwC(){this.faction="A",this.rarity="L",this.name="Oreian Warwalker",this.iAttack=this.boof359,this.iHealth=this.boof61018,this.tribe.push("RB"),this.preFight=!0;const t=this.owwbuff+1;this.addSp("A",t),this.text=`Activate: ${this.name} gets ${t}x attack.`,this.bonus={activ8:this.buffNug(2*this.iAttack,0)}}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}upakC(){this.faction="U",this.rarity="L",this.name="Uterra Packmaster",this.iAttack=this.boof6914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.preFight=!0;const t=this.boof124;this.addSp("U",t),this.text=`Activate: each other friendly Uterra creature gets ${p.jr9(t,t)}.`,this.bonus={activ8:this.multNug(this.buffNug(t,t),1.5)}}upakT(t){return g.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const e=this.boof124;g.creatByTarget(this.upakTarg(t.id)).forEach(i=>{i.buff(e,e)})}upakTarg(t){const e=y.crFriendNotMeTarg(t);return e.faction="U",e}wfmC(){this.faction="T",this.rarity="H",this.name="Wildfire Maiden",this.iAttack=this.boof4610,this.iHealth=this.boof5814,this.tribe.push("FR","AS"),this.text=`Activate, destroy ${this.name}: Deal damage equal to its attack to each enemy creature.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}wfmT(t){return!0}wfmA(t){const e=R.tick();g.creatByTarget(y.crEnemyTarg()).forEach(i=>{i.hurtDirect(t.attack,this.code,e)}),U.destroy(t,this.code)}}class oi extends M{lookup(t){return{["MDE"]:{c:()=>this.misdC(),f:i=>this.misdF(i)},["TAB"]:{c:()=>this.thraC(),f:i=>this.thraF(i)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e);return i.jr4("AS"),i}jr8(t){this.cardForge(this.cardCode(),t),x.triggerDone()}misdC(){this.faction="N",this.rarity="C",this.name="Misery Demon",this.iAttack=this.boof5915,this.iHealth=this.boof2510,this.tribe.push("DM"),this.hints=["OL"];const t=this.level+3;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health.`}misdF(t){const e=this.level+3;v.hurtDirect(!t.owner,e,this.code),v.heal(t.owner,e)}thraC(){this.faction="T",this.rarity="C",this.name="Thranik Ambusher",this.iAttack=this.boof5813,this.iHealth=this.iAttack,this.tribe.push("DK"),this.hints=["OL"];const t=this.boof234;this.ftext=`${this.name} gets ${p.jr9(t,t)}.`}thraF(t){const e=this.boof234;g.jr5(t.creatId).buff(e,e)}}class vt extends M{lookup(t){return{["ATT"]:{c:()=>this.atorC(),t:(i,s)=>this.atorT(i,s),b:(i,s)=>this.atorB(i,s)},["BRH"]:{c:()=>this.brhrC(),t:(i,s)=>this.brhrT(i,s),b:(i,s)=>this.brhrB(i,s)},["FGD"]:{c:()=>this.fgdC(),t:(i,s)=>this.fgdT(i,s),b:(i,s)=>this.fgdB(i,s)},["FSP"]:{c:()=>this.fspC(),t:(i,s)=>this.fspT(i,s),b:(i,s)=>this.fspB(i,s)},["HMF"]:{c:()=>this.hamfC(),t:(i,s)=>this.hamfT(i,s),b:(i,s)=>this.hamfB(i,s)},["HOD"]:{c:()=>this.haroldC(),t:(i,s)=>this.ocarT(i,s),b:(i,s)=>this.haroldB(i,s)},["OJC"]:{c:()=>this.ocarC(),t:(i,s)=>this.ocarT(i,s),b:(i,s)=>this.ocarB(i,s)},["RLW"]:{c:()=>this.restwandC(),t:(i,s)=>this.restwandT(i,s),b:(i,s)=>this.restwandB(i,s)},["RHW"]:{c:()=>this.ruthwandC(),t:(i,s)=>this.restwandT(i,s),b:(i,s)=>this.ruthwandB(i,s)},["SDR"]:{c:()=>this.spdryC(),t:(i,s)=>this.spdryT(i,s),b:(i,s)=>this.spdryB(i,s)},["TDW"]:{c:()=>this.tdwC(),t:(i,s)=>this.tdwT(i,s),b:(i,s)=>this.tdwB(i,s)},["TNL"]:{c:()=>this.tnlC(),t:(i,s)=>this.tnlT(i,s),b:(i,s)=>this.tnlB(i,s)},["UTR"]:{c:()=>this.urexC(),t:(i,s)=>this.urexT(i,s),b:(i,s)=>this.urexB(i,s)}}[t]}testBirth(t,e){return this.lookup(t).t(e,V.toEnterField(e.event))}actBirth(t,e){this.lookup(t).b(e,V.toEnterField(e.event))}iTrigger=!0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);if(this.iTrigger){const s=i.jr4("EF");s.bonus=this.trigB}return i}ddf8(t){return t.event.code==="ENT"?this.testBirth(this.cardCode(),t):!1}jr8(t){this.actBirth(this.cardCode(),t),x.triggerDone()}atorC(){this.faction="T",this.rarity="L",this.name="Ator, Thunder Titan",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("GT"),this.text=`Each another friendly ${p.levelGateText(this.level,!0)}creature gets Assault: Aggressive.`,this.trigB=this.rawNug(0,0,0,0,.5)}atorT(t,e){const i=e.creature;return e.forged&&t.trigger.creatId!==i.id&&i.owner===t.owner&&D.levelTargetTest(D.ddf2(this.level),i.level)&&!i.opposed}atorB(t,e){e.creature.aggressive=!0}brhrC(){this.faction="N",this.rarity="R",this.name="Brood Horror",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("AB"),this.text=`When another friendly creature enters play, it gets ${p.jr9(this.level,this.level)}. Then ${this.name} gets ${p.jr9(-this.level,-this.level)}.`}brhrT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}brhrB(t,e){vt.itBirthedFirst(e.creature.id,t.creatId)&&(this.logAct(!1,e.creature),e.creature.buff(this.level,this.level),g.jr5(t.creatId).buff(-this.level,-this.level))}fgdC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Delta",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("RB","GD");const t=L.getCard(z.fgoc(this.level));this.text=`When ${this.name} enters play, if there is a friendly Alpha Beta, and Gamma, put a ${p.tokName(t)} in your discard pile.`}fgdT(t,e){return e.creature.id===t.creatId}fgdB(t,e){const i=y.crTarg();i.player=v.toTarget(t.owner);const s=g.creatByTarget(i).map(h=>h.code.slice(0,3));if(s.includes("FGA")&&s.includes("FGB")&&s.includes("FGG")){const h=v.toPlayer(t.owner);h.discard.push(z.fgoc(this.level));const f=y.trigger("NT",this.code);f.bonus=this.rawNug(0,0,0,0,10),h.triggers.push(f)}}fspC(){if(this.faction="A",this.rarity="L",this.name="Flowsteel Prototype",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.lValN([8,15,20]),this.tribe.push("SS"),this.iTrigger=this.level>1,this.iTrigger){const t=p.levelGateText(this.level-1);this.text=`When you Forge a ${t} creature, ${this.name} gets +attack equal to that creature's attack.`;const e=this.avgCreatureStats(this.level-1);this.trigB=this.buffNug(e[0],0)}}fspT(t,e){return!!(e.forged&&e.creature.owner===t.owner&&L.getCard(e.creature.code).level0&&g.jr5(t.creatId).move(i[T.randInt(0,s)])}haroldC(){this.faction="T",this.rarity="R",this.name="Herald of Destruction",this.iAttack=this.boof369,this.iHealth=this.lValN([9,12,18]),this.tribe.push("FR","AS"),this.text=`When an enemy creature enters play, if it wasn't Forged, deal damage equal to ${this.name}'s attack to the enemy player.`,this.trigB=this.playerNug(this.iAttack*.5)}haroldB(t,e){if(vt.itBirthedFirst(e.creature.id,t.creatId)){const i=g.jr5(t.creatId);v.hurtDirect(!i.owner,i.attack,this.code)}}ocarC(){this.faction="A",this.rarity="H",this.name="Oreian Justicar",this.iAttack=this.boof5814,this.iHealth=this.boof81220,this.tribe.push("HM");const t=this.ocarbuff;this.text=`When an enemy creature enters play, if it wasn't Forged, it gets ${p.jr9(t,0)}.`,this.trigB=this.buffNug(-.5*t,0)}ocarT(t,e){return e.creature.owner!==t.owner&&!e.forged}ocarB(t,e){vt.itBirthedFirst(e.creature.id,t.creatId)&&e.creature.buff(this.ocarbuff,0)}get ocarbuff(){return this.lValN([-5,-10,-20])}restwandC(){this.faction="U",this.rarity="H",this.name="Restless Wanderers",this.iAttack=this.boof51014,this.iHealth=this.boof3610,this.tribe.push("ST","WD");const t=this.boof369;this.text=`When another friendly Spirit Wanderer enters play, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),.5)}restwandT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner?e.creature.isTribe("WD"):!1}restwandB(t,e){const i=g.jr5(t.trigger.creatId),s=this.boof369;i.buff(s,s)}ruthwandC(){this.faction="N",this.rarity="C",this.name="Ruthless Wanderers",this.iAttack=this.boof3610,this.iHealth=this.boof51014,this.tribe.push("ST","WD");const t=this.boof369,e=-t;this.text=`When another friendly Spirit Wanderer enters play, the creature opposing this gets ${p.jr9(e,e)}.`,this.trigB=this.multNug(this.buffNug(t,t),.5)}ruthwandB(t,e){const s=g.jr5(t.trigger.creatId).opposed;if(s){const h=-this.boof369;s.buff(h,h)}}spdryC(){this.faction="U",this.rarity="R",this.name="Spring Dryad",this.iAttack=this.boof469,this.iHealth=this.iAttack,this.tribe.push("DY"),this.text=`When a friendly creature enters play, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),1.5)}spdryT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}spdryB(t,e){g.jr5(t.trigger.creatId).buff(this.level,this.level)}tdwC(){this.faction="N",this.rarity="R",this.name="Tarsus Deathweaver",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof246;this.text=`When a friendly creature enters play, if it wasn't Forged, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}tdwT(t,e){return e.creature.owner===t.owner&&!e.forged}tdwB(t,e){if(vt.itBirthedFirst(e.creature.id,t.creatId)){const i=this.boof246;e.creature.buff(i,i)}}tnlC(){this.faction="N",this.rarity="L",this.name="Tarsus Necrolord",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof124,e=L.getCard(z.zomc(this.level));this.text=`Forge: Spawn a ${p.tokName(e)} for each friendly creature that was destroyed this turn.~When a friendly Zombie enters play, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}tnlT(t,e){return e.creature.owner===t.owner?e.creature.isTribe("ZB"):!1}tnlB(t,e){const i=g.jr5(t.trigger.creatId),s=this.boof124;i.buff(s,s)}urexC(){this.faction="U",this.rarity="H",this.name="Uterradon Rex",this.iAttack=this.boof4813,this.iHealth=this.boof71118,this.tribe.push("DN");const t=this.boof124;this.text=`When another friendly Dinosaur enters play, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}urexT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("DN")}urexB(t,e){if(vt.itBirthedFirst(e.creature.id,t.creatId)){const i=this.boof124;e.creature.buff(i,i)}}static itBirthedFirst(t,e){if(t===e)return!0;let i=!1;const s=U.findDeathTime(e);if(T.isUn(s))i=!0;else{const h=g.findBirthTime(t);(T.isUn(h)||h<=s)&&(i=!0)}return i}}class oe extends ze{lookup(t){return{["AGM"]:{c:()=>this.agamC(),h:(i,s,h,f)=>this.agamH(i,s,h,f)},["BWK"]:{c:()=>this.blwalkC(),h:(i,s,h,f)=>this.blwalkH(i,s,h,f)},["BRF"]:{c:()=>this.bfangC(),h:(i,s,h,f)=>this.bfangH(i,s,h,f)},["CDT"]:{c:()=>this.cadtC(),h:(i,s,h,f)=>this.cadtH(i,s,h,f)},["GSC"]:{c:()=>this.gcobC(),h:(i,s,h,f)=>this.gcobH(i,s,h,f)},["IHA"]:{c:()=>this.ibhaC(),h:(i,s,h,f)=>this.ibhaH(i,s,h,f)},["SHS"]:{c:()=>this.shimfC(),h:(i,s,h,f)=>this.shimfH(i,s,h,f)}}[t]}image(t){return this.rarity==="T"?this.fixedImage(t):this.leveledImage(t)}cardConstruct(t){this.hints=["OP"],this.lookup(t).c()}creatHit(t,e,i,s,h){this.lookup(t).h(e,i,s,h)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const e=V.toDamage(t.event);this.creatHit(this.cardCode(),t,e,e.srcCreat,e.hurtCreat),x.triggerDone()}agamC(){this.faction="T",this.rarity="L",this.name="Agamemnon",this.iAttack=this.boof4814,this.iHealth=this.lValN([8,12,18]),this.level>1&&(this.iMobile=1,this.iAggro=this.level===3),this.tribe.push("GT"),this.text=`When ${this.name} ${p.dbdtac()} on your turn, this battles again.`,this.trigB=this.buffNug(this.iAttack/2,0)}agamH(t,e,i,s){t.owner===v.getActiveB()&&(i.extraBattles+=1)}blwalkC(){this.faction="N",this.rarity="R",this.name="Blight Walker",this.iAttack=this.boof137,this.iHealth=this.lValN([5,10,17]),this.tribe.push("ZB"),this.text=`When ${this.name} ${p.dbdtac(this.level)}, destroy that creature.`,this.trigB=this.avgSpawnNug()}blwalkH(t,e,i,s){s.status==="A"&&D.levelTestCommon(s.level,this.level)&&U.destroy(s,this.code)}bfangC(){this.faction="U",this.rarity="T",this.name="Broodfang",this.iAttack=this.level,this.iHealth=this.level,this.maxLevel=this.level,this.minLevel=this.level,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}bfangH(t,e,i,s){s.addPoison(this.iAttack)}poisonText(t){return`When ${this.name} ${p.dbdtac()}, give that creature gets Poison ${t}.`}cadtC(){this.faction="U",this.rarity="R",this.name="Cadaverous Thicket",this.iAttack=this.boof135,this.iHealth=this.lValN([7,12,22]),this.tribe.push("PL"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}cadtH(t,e,i,s){s.addPoison(this.iAttack)}gcobC(){this.faction="U",this.rarity="C",this.name="Ghostscale Cobra",this.iAttack=this.boof4610,this.iHealth=this.boof135,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}gcobH(t,e,i,s){s.addPoison(this.iAttack)}ibhaC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Hammer of Anvillon",this.iAttack=this.lValN([4,7,12,15]),this.iHealth=this.lValN([7,11,17,25]),this.iArmor=this.lValN([1,3,5,20]),this.tribe.push("FB"),this.maxLevel=4;const t=this.level===4?"'s attack gets reduced to 0":` gets ${p.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${p.dbdtac()}, that creature${t}, and moves to an available enemy lane at random.`,this.trigB=this.buffNug(this.lValN([2,4,6,16]),0)}ibhaH(t,e,i,s){if(s.status==="A"){const h=this.level===4?s.attack*-1:this.boof246n;s.buff(h,0);const f=g.emptyLanes(s.owner),m=f.length;m>0&&(this.logAct(!1,s),s.move(f[T.randInt(0,m)]))}}shimfC(){this.faction="U",this.rarity="R",this.name="Shimmerfang Serpent",this.iAttack=this.boof357,this.iHealth=this.boof61016,this.tribe.push("SN"),this.text=`When ${this.name} ${p.dbdtac()}, that creatures gets that much Poison.`,this.trigB=this.regnNug(this.iAttack)}shimfH(t,e,i,s){s.addPoison(e.dmg)}}class Wt extends ze{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(i,s,h)=>this.ashyH(i,s,h)},["AMY"]:{c:()=>this.ashmC(),h:(i,s,h)=>this.ashyH(i,s,h)},["CFB"]:{c:()=>this.cfbC(),h:(i,s,h)=>this.cfbH(i,s,h)},["EPS"]:{c:()=>this.epsdC(),h:(i,s,h)=>this.epsdH(i,s,h)},["EFM"]:{c:()=>this.efmC(),h:(i,s,h)=>this.efmH(i,s,h)},["FBC"]:{c:()=>this.fbcC(),h:(i,s,h)=>this.fbcH(i,s,h)},["RTS"]:{c:()=>this.rzstC(),h:(i,s,h)=>this.rzstH(i,s,h)},["RSE"]:{c:()=>this.rselC(),h:(i,s,h)=>this.rselH(i,s,h)},["SVH"]:{c:()=>this.strhyC(),h:(i,s,h)=>this.strhyH(i,s,h)},["URB"]:{c:()=>this.uridC(),h:(i,s,h)=>this.uridH(i,s,h)},["VES"]:{c:()=>this.veskC(),h:(i,s,h)=>this.veskH(i,s,h)}}[t]}cardConstruct(t){this.hints=["OL"],this.lookup(t).c()}creatHit(t,e,i,s){this.lookup(t).h(e,i,s)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}jr8(t){const e=V.toDamage(t.event);e.srcCreat&&(this.bothTurns||e.srcCreat.owner===v.getActiveB())&&this.creatHit(this.cardCode(),t,e,e.srcCreat),x.triggerDone()}ashyC(){this.faction="T",this.rarity="C",this.tribe.push("FR","AS");const t=this.boof124;this.text=`When ${this.name} ${p.dbdtap()}, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}ashyH(t,e,i){const s=this.boof124;i.buff(s,s)}ashbC(){this.name="Ashurian Brawler",this.iAttack=this.boof7911,this.iHealth=this.iAttack,this.ashyC()}ashmC(){this.name="Ashurian Mystic",this.iAttack=this.boof3610,this.iHealth=this.boof5812,this.iAggro=!0,this.ashyC()}cfbC(){this.faction="T",this.rarity="H",this.name="Cinderfist Brawler",this.iAttack=this.boof71014,this.iHealth=this.boof357,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${p.dbdtap()}, deal that much damage to that player again.`,this.trigB=this.playerNug(this.iAttack/2)}cfbH(t,e,i){v.hurtDirect(!i.owner,e.dmg,i.code)}epsdC(){this.faction="A",this.rarity="T",this.name="Epoch Soldier",this.minLevel=this.level,this.maxLevel=this.level,this.iAttack=this.boof4710,this.iHealth=this.iAttack,this.tribe.push("HM"),this.bothTurns=!1,this.text=`When ${this.name} ${p.dbdtap()} on your turn, draw a card at the end of the turn.`,this.trigB=this.rawNug(0,0,0,0,.2)}epsdH(t,e,i){const s=y.trigger("TE","EPH"+this.level);s.changes=!0,s.bonus=this.rawNug(0,0,0,0,ht.dcWeight),v.toPlayer(t.owner).triggers.push(s)}efmC(){this.faction="T",this.rarity="L",this.name="Everflame Mystic",this.iAttack=this.boof5813,this.iHealth=this.iAttack+1,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${p.dbdtap()} on your turn, you may play ${this.lValS(["one","two","three"])} spells this turn.`,this.trigB=this.rawNug(0,0,0,0,this.level*.5)}efmH(t,e,i){if(v.getActiveB()===i.owner)for(let s=0;sh.hurtDirect(e.dmg,this.code,s))}rzstC(){this.faction="T",this.rarity="C",this.name="Razortooth Stalker",this.iAttack=this.boof4812,this.iHealth=this.iAttack+1,this.iMobile=1,this.tribe.push("DN");const t=this.boof235;this.text=`When ${this.name} ${p.dbdtap()}, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}rzstH(t,e,i){const s=this.boof235;i.buff(s,s)}rselC(){this.faction="T",this.rarity="H",this.name="Rumblestone Elemental",this.iAttack=this.boof246,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("ER","EL"),this.text=`When ${this.name} ${p.dbdtap()}, deal that much damage to itself as well.~Assault: Spawn a copy of ${this.name}. Then repeat this for each copy.`,this.trigB=this.rawNug(0,0,0,0,-.1)}rselH(t,e,i){i.hurtDirect(e.dmg,this.code)}strhyC(){this.faction="U",this.rarity="C",this.name="Stranglevine Hydra",this.iAttack=this.boof5815,this.iHealth=this.iAttack+1,this.tribe.push("HY"),this.text=`When ${this.name} ${p.dbdtap()}, it gets Regenerate ${this.level}.`,this.trigB=this.regnNug(this.level)}strhyH(t,e,i){i.addRegen(this.level)}uridC(){this.faction="U",this.rarity="L",this.name="Uterradon Ridgeback",this.iAttack=this.boof71117,this.iHealth=this.boof4713,this.iBT=!0,this.tribe.push("DN"),this.bothTurns=!1;const t=this.boof124;this.text=`When ${this.name} ${p.dbdtap()} on your turn, each friendly creature gets ${p.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`,this.trigB=this.buffNug(t,t)}uridH(t,e,i){const s=this.boof124,h=this.level===3;g.ddf1().forEach(f=>{f.buff(s,s),h&&(f.breakthrough=!0)})}veskC(){this.faction="N",this.rarity="L",this.name="Vyric Ebonskull",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("VP");let t="",e=.5;this.level===3&&(t=" Then Spawn a copy of that creature."),this.text=`When Vyric ${p.dbdtap()}, destroy an enemy ${p.levelGateText(this.level,!0)} creature at random.`+t,this.trigB=this.multNug(this.avgSpawnNug(),e)}veskH(t,e,i){const s=y.crTarg();s.player=v.toTarget(e.hurtPlayer),s.level=D.ddf2(this.level);const h=g.creatByTarget(s);if(h.length>0){const f=R.tick(),m=h[T.randInt(0,h.length)];U.destroy(m,this.code,f),this.level===3&&g.birth(m.code,"S",i.owner,void 0,f)}}}class be extends M{lookup(t){return{["CHR"]:{c:()=>this.crgC(),d:(i,s,h)=>this.crgD(i,s,h)},["DZD"]:{c:()=>this.dozC(),d:(i,s,h)=>this.dozD(i,s,h)},["IMD"]:{c:()=>this.eddieC(),d:(i,s,h)=>this.eddieD(i,s,h)},["NCM"]:{c:()=>this.ncmbC(),d:(i,s,h)=>this.ncmbD(i,s,h)},["TDS"]:{c:()=>this.tsrC(),d:(i,s,h)=>this.tsrD(i,s,h)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}cares=!0;trigB;cardDamaged(t,e){const i=V.toDamage(e.event);this.lookup(t).d(e,i.hurtCreat,i)}image(t){return this.cardCode()==="DZD"?this.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e);if(this.cares){const s=i.jr4("DM");s.bonus=this.trigB}return i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.isCreatTarg&&e.target===t.creatId}return!1}jr8(t){this.cardDamaged(this.cardCode(),t),x.triggerDone()}crgC(){this.faction="U",this.rarity="L",this.name="Chrogias",this.iAttack=this.lValN([1,0,40]),this.iHealth=this.lValN([1,15,40]),this.tribe.push("PL"),this.level>1&&(this.hints=["MC"],this.text="When Chrogias is dealt damage, you gain that much health."),this.level===1?(this.hints=["LG","LM","RT"],this.cares=!1):this.level===2?(this.iRegen=2,this.iDefend=!0,this.trigB=this.playerNug(10),this.hints?.push("LG")):this.level===3&&(this.iBT=!0,this.iRegen=5,this.trigB=this.playerNug(20))}crgD(t,e,i){v.heal(t.owner,i.dmg)}dozC(){this.faction="U",this.rarity="L",this.name="Dozer, the Dormant",this.iAttack=0,this.iHealth=this.level*3+6,this.tribe.push("BR"),this.iDefend=!0,this.hints=["MC"],this.level===1&&this.hints.push("ZZ-2"),this.trigB=this.buffNug(this.iHealth,0),this.trigB.bonus=.3;const t=L.getCard(this.dz());this.text=`When ${this.name} is dealt damage and survives, replace it with a ${p.tokName(t)}.`}dozD(t,e,i){if(e.health>0&&e.status==="A"){const s=g.birth(this.dz(),"R",e.owner,e.lane);s&&s.setHealth(e.health)}}dz(){return "DZA"+this.level}eddieC(){this.faction="A",this.rarity="L",this.name="Iron Maiden",this.iAttack=this.lValN([1,3,30]),this.iHealth=this.iAttack,this.tribe.push("RB"),this.consistent=this.level>1,this.level===3?(this.iBT=!0,this.hints=["MC"],this.text="When Iron Maiden is dealt damage, deal that much damage to the enemy player.",this.trigB=this.playerNug(16)):(this.cares=!1,this.hints=["LG","LM","RT"])}eddieD(t,e,i){v.hurtDirect(!t.owner,i.dmg,this.code)}ncmbC(){this.faction="N",this.rarity="H",this.name="Necromoeba",this.iAttack=this.boof4710,this.iHealth=this.boof71117,this.tribe.push("OZ"),this.iRegen=3,this.hints=["MC"],this.level===1&&this.hints.push("ZZ-1");const t=L.getCard(z.purpOzC(this.level));this.text=`When ${this.name} is dealt damage, Spawn a ${p.tokName(t)}.`,this.trigB=this.spawnNug(t)}ncmbD(t,e,i){this.logAct(!1),g.birth(z.purpOzC(this.level),"S",t.owner)}tsrC(){this.faction="U",this.rarity="L",this.name="Thundersaur",this.iAttack=0,this.iHealth=this.level*12,this.tribe.push("DN"),this.iBT=!0,this.hints=["MC",this.level===2?"ZZ-3":"ZZ-1"],this.trigB=this.buffNug(this.iHealth/2,0),this.text=`When ${this.name} is dealt damage, it gets +1 attack for each damage dealt.`}tsrD(t,e,i){e.buff(i.dmg,0)}}class Z extends M{lookup(t){return{["AGK"]:{c:()=>this.agknitC(),f:i=>this.agknitF(i)},["AMS"]:{c:()=>this.squadC(),f:i=>this.squadF(i)},["AFR"]:{c:()=>this.afsC(),f:i=>this.afsF(i)},["BZS"]:{c:()=>this.bzshC(),f:i=>this.bzshF(i)},["BTR"]:{c:()=>this.bwtC(),f:i=>this.bwtF(i)},["BSS"]:{c:()=>this.bssC(),f:i=>this.bssF(i)},["BZD"]:{c:()=>this.bzdrC(),f:i=>this.bzdrF(i)},["BFM"]:{c:()=>this.bfmC(),f:i=>this.bfmF(i)},["CTI"]:{c:()=>this.charnC(),f:i=>this.charnF(i)},["CHH"]:{c:()=>this.chihC(),f:i=>this.chihF(i)},["CSW"]:{c:()=>this.chickenC(),f:i=>this.chickenF(i)},["DFR"]:{c:()=>this.dfrC(),f:i=>this.dfrF(i)},["DBA"]:{c:()=>this.dbaC(),f:i=>this.dbaF(i)},["DBN"]:{c:()=>this.drbC(),f:i=>this.drbF(i)},["DDD"]:{c:()=>this.dddC(),f:i=>this.dddF(i)},["EWT"]:{c:()=>this.espwrC(),f:i=>this.espwrF(i)},["FWT"]:{c:()=>this.fwtC(),f:i=>this.fwtF(i)},["GSW"]:{c:()=>this.gwurmC(),f:i=>this.gwurmF(i)},["GSS"]:{c:()=>this.gsC(),f:i=>this.gsF(i)},["IMA"]:{c:()=>this.iracoC(),f:i=>this.iracoF(i)},["LGT"]:{c:()=>this.legtitC(),f:i=>this.legtitF(i)},["LBD"]:{c:()=>this.lbdC(),f:i=>this.lbdF(i)},["LMV"]:{c:()=>this.lyrC(),f:i=>this.lyrF(i)},["MOE"]:{c:()=>this.moeC(),f:i=>this.moeF(i)},["MMA"]:{c:()=>this.mmaC(),f:i=>this.mmaF(i)},["MMR"]:{c:()=>this.mmrC(),f:i=>this.mmrF(i)},["NSY"]:{c:()=>this.nysymC(),f:i=>this.nysymF(i)},["OXM"]:{c:()=>this.onxmarC(),f:i=>this.onxmarF(i)},["OFM"]:{c:()=>this.ofmC(),f:i=>this.ofmF(i)},["OPK"]:{c:()=>this.orpC(),f:i=>this.orpF(i)},["PHM"]:{c:()=>this.phmC(),f:i=>this.phmF(i)},["PSM"]:{c:()=>this.palsC(),f:i=>this.palsF(i)},["PMI"]:{c:()=>this.prinvC(),f:i=>this.prinvF(i)},["SMD"]:{c:()=>this.scorchC(),f:i=>this.scorchF(i)},["SOC"]:{c:()=>this.scythC(),f:i=>this.scythF(i)},["SDN"]:{c:()=>this.souldrC(),f:i=>this.souldrF(i)},["SGG"]:{c:()=>this.ssggC(),f:i=>this.ssggF(i)},["SBD"]:{c:()=>this.sbdC(),f:i=>this.sbdF(i)},["SSK"]:{c:()=>this.sssC(),f:i=>this.sssF(i)},["SYL"]:{c:()=>this.lotusC(),f:i=>this.lotusF(i)},["TGI"]:{c:()=>this.tgiC(),f:i=>this.tgiF(i)},["TRA"]:{c:()=>this.toraC(),f:i=>this.toraF(i)},["TRS"]:{c:()=>this.torsC(),f:i=>this.torsF(i)},["TRV"]:{c:()=>this.torvC(),f:i=>this.torvF(i)},["TRW"]:{c:()=>this.torwC(),f:i=>this.torwF(i)},["UGL"]:{c:()=>this.umglidC(),f:i=>this.umglidF(i)},["UWL"]:{c:()=>this.uwarC(),f:i=>this.uwarF(i)},["UWS"]:{c:()=>this.ustokeC(),f:i=>this.ustokeF(i)},["UIW"]:{c:()=>this.uiwC(),f:i=>this.uiwF(i)},["UTM"]:{c:()=>this.umaulC(),f:i=>this.umaulF(i)},["VIK"]:{c:()=>this.vikC(),f:i=>this.vikF(i)},["VND"]:{c:()=>this.vdrkC(),f:i=>this.vdrkF(i)},["VNS"]:{c:()=>this.vnsC(),f:i=>this.vnsF(i)},["WMC"]:{c:()=>this.warC(),f:i=>this.warF(i)},["WWP"]:{c:()=>this.wwpC(),f:i=>this.wwpF(i)},["WFB"]:{c:()=>this.wfbC(),f:i=>this.wfbF(i)},["XTR"]:{c:()=>this.xtmC(),f:i=>this.xtmF(i)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";forges=!0;flanks;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let e="";this.flanks&&(e="Flank"),this.forges&&(e?e="Forge/"+e:e=p.forglied(this.allied)),e&&(this.text=e+": "+this.ftext),this.ftext=""}jr3(t,e){const i=super.jr3(t,e);if(this.forges&&i.jr4("FR"),this.flanks){const s=i.jr4("FK");s.bonus=this.flanks}return i}ddf8(t){return Dt.extractCardCode(t.trigger.logicCode)==="MMR"&&t.trigger.type==="TE"}jr8(t){const e=this.cardCode();if(t.trigger.type==="TE"&&e==="MMR"){this.logAct(!1);const i=t.event,s=v.toPlayer(i.playerA);v.drawCard(s,this.level);const h=y.trigIdx(s.triggers,t.trigger);h>-1&&s.triggers.splice(h,1),x.triggerDone();return}this.cardForge(this.cardCode(),t),x.triggerDone()}agknitC(){this.faction="A",this.rarity="L",this.name="Aegis Knight",this.iAttack=this.boof5814,this.iHealth=this.iAttack,this.tribe.push("HM"),this.iArmor=this.lValN([1,2,5]),this.ftext="Each friendly creature deals damage equal to its Armor to the opposing creature"}agknitF(t){const e=y.crFriendTarg();e.hasArmor=!0;const i=R.tick();g.creatByTarget(e).forEach(s=>{s.opposed&&s.opposed.hurtDirect(s.armor,s.code,i)})}squadC(){this.faction="A",this.rarity="H",this.name="Aeromind Squadron",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("MM"),this.iMobile=1,this.ftext="Put a Metamind at random from your deck into your hand."}squadF(t){const e=v.toPlayer(t.owner),i=y.target("TH");i.player=v.toTarget(e),i.tribe="MM";const s=D.deckByTarget(i),h=s.length;if(h>0){const f=s[T.randInt(0,h)];e.deck.splice(f[1],1),e.hand.push(f[0])}}afsC(){this.faction="T",this.rarity="H",this.name="Ashurian Flamesculptor",this.iAttack=this.boof5915,this.iHealth=this.boof3610,this.tribe.push("FR","AS"),this.forges=this.level>1,this.consistent=this.forges,this.ftext=`You may play an additional ${p.levelGateText(this.level-1)} Tempys spell this turn.`,this.forges&&this.addSp("C",0)}afsF(t){const e=E.freeCard(this.code);e.condition.card="S",e.condition.level=D.ddf2(this.level-1),e.condition.faction="T"}bzshC(){this.faction="T",this.rarity="C",this.name="Blizzard Shaman",this.iAttack=this.boof61014,this.iHealth=this.iAttack+1,this.tribe.push("WN","AS"),this.ftext="Move another friendly creature at random to another available lane at random."}bzshF(t){const e=g.creatByTarget(y.crFriendNotMeTarg(t.creatId)),i=e.length;if(i<4&&i>0){const s=e[T.randInt(0,i)],h=g.emptyLanes(s.owner);this.logAct(!1,s),s.move(h[T.randInt(0,h.length)])}}bwtC(){if(this.faction="U",this.rarity="H",this.name="Bramblewood Tracker",this.iAttack=this.boof3712,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.forges=this.level>1,this.forges){const t=this.level-1;this.ftext=`You may play an additional ${p.levelGateText(t)} Uterra creature this turn.`,this.consistent=!0,this.addSp("C",0)}else this.hints=["LG"]}bwtF(t){const e=E.freeCard(this.code);e.condition.card="C",e.condition.faction="U",e.condition.level=D.ddf2(this.level-1)}bssC(){this.faction="A",this.rarity="L",this.name="Brightsteel Sentinal",this.iHealth=this.boof51015,this.iAttack=this.iHealth-1,this.tribe.push("RB"),this.addSp("M",this.iHealth),this.ftext=`Each friendly Robot gets Armor ${this.iHealth} this turn.`}bssF(t){const e=this.boof51015,i=y.crFriendTarg();i.tribe="RB",i.canArmor=!0,g.creatByTarget(i).forEach(h=>{const f=y.mod("AR",e,t.creatId);f.expiry="ET",h.addMod(f)})}bzdrC(){this.faction="N",this.rarity="R",this.name="Byzerak Drake",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.iRegen=this.level,this.allied="T",this.tribe.push("DG"),this.addSp("R",this.level),this.ftext=`Mobility ${this.level}.`}bzdrF(t){E.allied(this.allied)&&g.jr5(t.creatId).addMobility(this.level)}bfmC(){this.faction="N",this.rarity="H",this.name="Byzerak Frostmaiden",this.iAttack=this.boof135,this.iHealth=this.boof91420,this.tribe.push("HM");const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${p.jr9(-1*t,0)} and this gets ${p.jr9(t,0)}.~Allied Tempys: Mobility ${this.level}.`}bfmF(t){const i=V.toEnterField(t.event).creature;t.trigger.type==="FR"&&E.allied("T")&&i.addMobility(this.level);const s=i.opposed;if(s){const h=this.boof246;s.buff(-1*h,0),i.buff(h,0)}}charnC(){this.faction="N",this.rarity="C",this.name="Charnel Titan",this.iAttack=this.boof359,this.iHealth=this.boof5814,this.tribe.push("AB");const t=this.boof357;this.ftext=`If there is an enemy creature with ${t} or less attack, ${this.name} gets ${p.jr9(t,t)}.`}charnF(t){const e=this.boof357,i=y.crEnemyTarg();i.maxAttack=e,g.creatByTarget(i).length>0&&g.jr5(t.creatId).buff(e,e)}chihC(){this.faction="U",this.rarity="C",this.name="Chistlehearth Hunter",this.iAttack=this.lValN([2,6,11]),this.iHealth=this.boof81217,this.tribe.push("HM"),this.ftext=`${this.name} gets ${p.jr9(1,0)} for each other friendly creature.`}chihF(t){const e=g.ddf1().length;e>1&&g.jr5(t.creatId).buff(e-1,0)}chickenC(){this.faction="T",this.rarity="L",this.name="Cindersmoke Wyvern",this.iAttack=this.boof3610,this.iHealth=this.lValN([7,12,17]),this.tribe.push("DG"),this.iMobile=this.boof124,this.forges=!1,this.flanks=this.buffNug(this.iAttack,0),this.ftext="Deal damage equal to its attack to the opposing creature. If there is no opposing creature, deal that damage to the enemy player instead."}chickenF(t){const e=V.toEnterField(t.event),i=e.creature.attack,s=e.creature.opposed;s?s.hurtDirect(i,this.code):v.hurtDirect(!t.owner,i,this.code)}dfrC(){this.faction="N",this.rarity="H",this.name="Darkfrost Reaper",this.iAttack=this.boof6916,this.iHealth=this.boof3713,this.tribe.push("SK"),this.ftext="Destroy each creature with 1 or less attack."}dfrF(t){const e=y.crTarg();e.maxAttack=1;const i=g.creatByTarget(e),s=R.tick();i.forEach(h=>{U.destroy(h,this.code,s)})}dbaC(){this.faction="U",this.rarity="H",this.name="Deepbranch Ancient",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HY"),this.ftext=`If there is a friendly creature in each lane, ${this.name} gets ${p.jr9(this.iAttack,this.iHealth)}.`}dbaF(t){g.ddf1().length===5&&g.jr5(t.creatId).buff(this.iAttack,this.iHealth)}drbC(){this.faction="N",this.rarity="C",this.name="Dirge Banshee",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${p.jr9(-t,0)} and this gets ${p.jr9(t,0)}.`}drbF(t){const e=V.toEnterField(t.event),i=e.creature.opposed;if(i){const s=this.boof246;i.buff(-s,0),e.creature.buff(s,0)}}dddC(){this.faction="N",this.rarity="L",this.name="Doomwing, Dire Drake",this.iAttack=this.boof61018,this.iHealth=this.lValN([2,6,10]),this.iMobile=this.level,this.tribe.push("DG"),this.level>1&&(this.hints=[this.level===2?"ZZ-2":"ZZ-5"]),this.forges=!1,this.flanks=this.multNug(this.avgSpawnNug(),.5),this.ftext=`Destroy the opposing ${p.levelGateText(this.level,!0)}creature.`}dddF(t){const i=V.toEnterField(t.event).creature.opposed;i&&D.levelTestCommon(i.level,this.level)&&U.destroy(i,this.code)}espwrC(){this.faction="U",this.rarity="R",this.name="Esperian Wartusk",this.iAttack=this.boof5916,this.iHealth=this.iAttack-1,this.iBT=!0,this.allied="A",this.tribe.push("TK");const t=this.boof124;this.ftext=`Armor ${t}.`}espwrF(t){E.allied(this.allied)&&g.jr5(t.creatId).addArmor(this.boof124)}fwtC(){this.faction="U",this.rarity="H",this.name="Frostwild Tracker",this.iAttack=this.boof4712,this.iHealth=this.boof248,this.tribe.push("TG"),this.forges=this.level>1;const t=this.level-1;this.ftext=`You may play an additional ${p.levelGateText(t)} creature this turn.`,this.level===1&&(this.hints=["LG"])}fwtF(t){const e=E.freeCard(this.code);e.condition.card="C",e.condition.level=D.ddf2(this.level-1)}gwurmC(){this.faction="N",this.rarity="C",this.name="Gloomspire Wurm",this.iAttack=this.boof4813,this.iHealth=this.iAttack,this.tribe.push("WR"),this.ftext=`If there are no enemy creatures, ${this.name} gets ${p.jr9(4,4)}.`}gwurmF(t){g.qEnemyCreats().length===0&&g.jr5(t.creatId).buff(4,4)}gsC(){this.faction="U",this.rarity="C",this.name="Glowstride Stag",this.iAttack=this.boof5812,this.iHealth=this.iAttack+this.level,this.tribe.push("ST");const t=this.boof51015;this.ftext=`You gain ${t} health.`}gsF(t){const e=this.boof51015;v.heal(t.owner,e)}iracoC(){this.faction="A",this.rarity="L",this.name="Ironmind Acolyte",this.iAttack=this.boof61015,this.iHealth=this.iAttack-2,this.tribe.push("GN"),this.ftext="If you have five or more cards in your hand, you may play an additional card this turn."}iracoF(t){v.toPlayer(t.owner).hand.length>4&&(E.regularPlays+=1)}legtitC(){this.faction="N",this.rarity="R",this.name="Legion Titan",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.ftext=`${this.name} gets ${p.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`}legtitF(t){const e=y.crEnemyTarg();e.maxAttack=this.boof357;const i=g.creatByTarget(e);if(i.length>0){const s=this.level*i.length;g.jr5(t.creatId).buff(s,s)}}lbdC(){this.faction="U",this.rarity="H",this.name="Lifeblood Dryad",this.iAttack=this.lValN([4,7,9]),this.iHealth=this.iAttack,this.tribe.push("DY");const t=this.boof236;this.ftext=`If there is a friendly creature in each lane, each other friendly creature gets ${p.jr9(t,t)}.`}lbdF(t){const e=g.creatByTarget(y.crFriendNotMeTarg(t.creatId));if(e.length===4){const i=this.boof236;e.forEach(s=>s.buff(i,i))}}lyrC(){this.faction="N",this.rarity="L",this.name="Lyria, Muse of Varna",this.iAttack=this.boof5815,this.iHealth=this.boof4714,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.level===2?"Spawn a random creature that was destroyed this game.":"Put a random creature that was destroyed this game into each of your available lanes.",this.forges||(this.hints=["LG"])}lyrF(t){if(this.level===2){const e=U.gravedigger();e&&g.birth(e,"S",t.owner)}else if(this.level===3){const e=g.emptyLanes(t.owner),i=e.map(s=>U.gravedigger());if(e.length>0&&i[0]){const s=R.tick();e.forEach((h,f)=>{g.birth(i[f],"P",t.owner,h,s)})}}}moeC(){this.faction="T",this.rarity="H",this.name="Master of Elements",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=`You may play an additional ${p.levelGateText(this.level-1)} spell this turn.`}moeF(t){const e=E.freeCard(this.code);e.condition.card="S",e.condition.level=D.ddf2(this.level-1)}mmaC(){this.faction="A",this.rarity="C",this.name="Metamind Adept",this.iAttack=this.boof5915,this.iHealth=this.boof4813,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`Draw ${this.level} card${t}.`}mmaF(t){v.drawCard(t.owner,this.level)}mmrC(){this.faction="A",this.rarity="C",this.name="Metamind Archivist",this.iAttack=this.boof3713,this.iHealth=this.iAttack+5,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`If there is another friendly Metamind, draw ${this.level} card${t} at the end of your turn.`}mmrF(t){const e=y.crFriendNotMeTarg(t.creatId);if(e.tribe="MM",g.creatByTarget(e).length>0){const i=y.trigger("TE",this.code);i.changes=!0,i.bonus=this.rawNug(0,0,0,0,this.level*ht.dcWeight),v.toPlayer(t.owner).triggers.push(i)}}nysymC(){this.faction="N",this.rarity="C",this.name="Nyrali Symbiote",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`}nysymF(t){const e=V.toEnterField(t.event);e.creature.opposed&&e.creature.addRegen(this.boof246)}ofmC(){this.faction="A",this.rarity="R",this.name="Oreian Fieldmarshal",this.iAttack=this.boof5914,this.iHealth=this.iAttack-2,this.tribe.push("HM");const t=this.boof135;this.ftext=`Each other friendly creature gets ${p.jr9(t,0)}.`}ofmF(t){const e=this.boof135;g.creatByTarget(y.crFriendNotMeTarg(t.creatId)).forEach(s=>{s.buff(e,0)})}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.tribe.push("RB"),this.hints=["OP"],this.ftext=`${this.name} gets Armor ${this.iAttack} this turn.`}orpF(t){const e=g.jr5(t.creatId),i=y.mod("AR",this.iAttack,t.creatId);i.expiry="ET",e.addMod(i)}onxmarC(){this.faction="A",this.rarity="R",this.name="Onyxium Marauder",this.iAttack=this.boof4714,this.iHealth=this.lValN([6,9,17]),this.iArmor=this.level,this.allied="N",this.tribe.push("HM"),this.ftext=`Regenerate ${this.level}.`}onxmarF(t){E.allied(this.allied)&&g.jr5(t.creatId).addRegen(this.level)}phmC(){this.faction="A",this.rarity="R",this.name="Palladium Hindermind",this.iAttack=this.boof2612,this.iHealth=this.boof61016,this.tribe.push("HM"),this.ftext=`Each enemy creature gets ${p.jr9(this.boof123n,0)}.`}phmF(t){const e=this.boof123n;g.qEnemyCreats().forEach(i=>{i.buff(e,0)})}palsC(){this.faction="A",this.rarity="L",this.name="Palladium Simulacrum",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.iMobile=this.level-1,this.tribe.push("SS"),this.flanks=this.multNug(this.statSpawnNug(this.iAttack,this.iHealth),.5),this.ftext=`If ${this.name} is in the center lane, Spawn a copy.`}palsF(t){V.toEnterField(t.event).creature.lane===3&&g.birth(this.code,"S",t.owner)}prinvC(){this.faction="T",this.rarity="H",this.name="Primordial Invoker",this.iAttack=this.boof61016,this.iHealth=this.boof468,this.tribe.push("HM"),this.ftext=`Deal ${this.iHealth} damage divided at random between enemy creatures and the the enemy player.`}prinvF(t){const e=g.creatByTarget(y.crEnemyTarg()),i=e.length;if(i===0)v.hurtDirect(!t.owner,this.iHealth,this.code);else{const s=R.tick(),h=i+1,f=Array(h).fill(0);for(let m=0;m{f[A]>0&&m.hurtDirect(f[A],this.code,s)}),f[i]>0&&v.hurtDirect(!t.owner,f[i],this.code)}}scorchC(){this.faction="T",this.rarity="L",this.name="Scorchmane Dragon",this.iAttack=this.lValN([0,12,24]),this.iHealth=this.boof61224,this.tribe.push("DG"),this.iDefend=this.level===1,this.iMobile=this.level-1,this.forges=this.level>1,this.ftext="Deal 5 damage to "+(this.level===2?"the opposing creature.":"each enemy creature and player."),this.level===1&&(this.hints=["LG","LM"])}scorchF(t){const e=V.toEnterField(t.event),i=!t.owner;if(this.level===2){const s=e.creature.opposed;s&&s.hurtDirect(5,this.code)}else if(this.level===3){const s=R.tick();g.qPlayerCreats(i).forEach(h=>h.hurtDirect(5,this.code,s)),v.hurtDirect(i,5,this.code)}}scythC(){this.faction="N",this.rarity="L",this.name="Chiron, Herald of Torment",this.iAttack=12,this.iHealth=6,this.tribe.push("DM"),this.ftext=`Each enemy creature gets ${p.jr9(-6,0)} and ${this.name} gets ${p.jr9(6,0)} for each enemy creature.`}scythF(t){const e=g.qEnemyCreats();e.forEach(i=>{i.buff(-6,0)}),e.length>0&&g.jr5(t.creatId).buff(6*e.length,0)}souldrC(){if(this.faction="N",this.rarity="L",this.name="Soul Drinker",this.iAttack=1,this.iHealth=this.boof4814,this.iMobile=this.level===3?1:0,this.tribe.push("VP"),this.hints=["OP"],this.level===3){const t=this.avgCreatureStats();this.flanks=this.buffNug(t[0]*2,0)}this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`}souldrF(t){const e=V.toEnterField(t.event),i=e.creature.opposed;if(i){const s=i.attack;e.creature.buff(s,0),i.buff(-1*s,0)}}ssggC(){this.faction="N",this.rarity="H",this.name="Soulscourge Grimgaunt",this.iAttack=this.level+1,this.iHealth=this.iAttack,this.tribe.push("GG"),this.ftext=`${this.name} gets ${p.jr9(this.iAttack,this.iHealth)} for each creature that was destroyed this turn.`}ssggF(t){const e=this.iAttack*(E.deathsA.length+E.deathsB.length);e>0&&g.jr5(t.creatId).buff(e,e)}sbdC(){this.faction="U",this.rarity="C",this.name="Spiritbloom Dryad",this.iAttack=this.boof6812,this.iHealth=this.iAttack+this.level,this.tribe.push("DY"),this.ftext=`Each player gains ${this.boof468} health.`}sbdF(t){const e=this.boof468;v.heal(!0,e),v.heal(!1,e)}sssC(){this.faction="A",this.rarity="C",this.name="Steelskin Spelunker",this.iAttack=this.boof5814,this.iHealth=this.boof61018,this.tribe.push("HM"),this.ftext=`If there is another friendly creature in the center lane, that creature gets Armor ${this.boof124}`}sssF(t){const e=g.searchByLane(3,t.owner);e&&e.id!==t.creatId&&!e.negateArmor&&e.addArmor(this.boof124)}lotusC(){this.faction="U",this.rarity="H",this.name="Stygian Lotus",this.iAttack=this.boof468,this.iHealth=this.iAttack-1,this.tribe.push("PL"),this.hints=["ZZ-1"],this.ftext=`If ${this.name} is opposed, spawn a copy of it. Then repeat this for each copy.`}lotusF(t){if(V.toEnterField(t.event).creature.opposed){let i=!0;for(;i;){const s=g.emptyLanes(t.owner),h=s.length;if(h===0)i=!1;else{const f=s[T.randInt(0,h)];g.birth(this.code,"P",t.owner,f).opposed||(i=!1)}}}}tgiC(){this.faction="T",this.rarity="R",this.name="Thundergale Invoker",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("WN","GT"),this.ftext=`Each creature adjacent to ${this.name} moves one lane away if possible.`}tgiF(t){const e=g.jr5(t.creatId),i=e.lane,s=e.owner,h=[];if(i>2){const f=g.searchByLane(i-1,s);f&&(g.searchByLane(i-2,s)||(h.push(f),f.move(i-2)))}if(i<4){const f=g.searchByLane(i+1,s);f&&(g.searchByLane(i+2,s)||(h.push(f),f.move(i+2)))}h.length>0&&this.logAct(!1,...h)}tortex(t){return`Put a level ${this.level} ${t} into your hand.`}torf(t){const e=v.getActive(),i=t+this.level;e.hand.push(i)}toraC(){this.faction="A",this.rarity="R",this.name="Torrent Acolyte",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.tribe.push("MM"),this.forges=this.level>1,this.ftext=this.tortex("Power Torrent")}toraF(t){this.torf("PTR")}torsC(){this.faction="U",this.rarity="R",this.name="Torrent Soldier",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("IN"),this.forges=this.level>1,this.ftext=this.tortex("Spore Torrent")}torsF(t){this.torf("STO")}torvC(){this.faction="T",this.rarity="R",this.name="Torrent Valkyrie",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("IC","AS"),this.forges=this.level>1,this.ftext=this.tortex("Ice Torrent")}torvF(t){this.torf("ITO")}torwC(){this.faction="N",this.rarity="R",this.name="Torrent Witch",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.tortex("Spirit Torrent")}torwF(t){this.torf("STR")}umglidC(){this.faction="T",this.rarity="R",this.name="Umbruk Glider",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.iMobile=this.level,this.allied="U",this.tribe.push("DN"),this.ftext="Breakthrough."}umglidF(t){if(E.allied(this.allied)){const e=g.jr5(t.creatId);e.breakthrough=!0}}uwarC(){this.faction="T",this.rarity="H",this.name="Uranti Warlord",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("FR","YT"),this.hints=["OP"],this.ftext=`Each friendly Yeti deals ${this.iAttack} damage to the opposing creature.`}uwarF(t){const e=y.crFriendTarg();e.tribe="YT";const i=g.creatByTarget(e),s=R.tick();i.forEach(h=>{const f=h.opposed;f&&f.hurtDirect(this.iAttack,h.code,s)})}ustokeC(){this.faction="T",this.rarity="R",this.name="Uranti Warstoker",this.iAttack=this.boof6812,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.ftext=`Each other friendly Yeti get ${p.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const e=y.crFriendNotMeTarg(t.creatId);e.tribe="YT";const i=g.creatByTarget(e),s=this.stokeboof;i.forEach(h=>{const f=y.mod("AT",s,t.creatId);f.expiry="ET",h.addMod(f)})}get stokeboof(){return this.lValN([3,4,6])}uiwC(){this.faction="A",this.rarity="L",this.name="Uriel Ironwing",this.iAttack=this.lValN([6,8,13]),this.iHealth=this.boof81117,this.iMobile=this.level,this.tribe.push("AG"),this.hints=["ZZ-1"];const t=this.boof246n;this.flanks=this.buffNug(-t,0);let e="";this.level===3&&(e=" If that creature has 0 or less attack, destroy it.",this.flanks.count=1),this.ftext=`The opposing creature gets ${p.jr9(t,0)}.${e}`}uiwF(t){const s=V.toEnterField(t.event).creature.opposed;s&&(s.buff(this.boof246n,0),this.level===3&&s.attack<1&&U.destroy(s,this.code))}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${p.jr9(t,t)}.`}umaulF(t){const e=V.toEnterField(t.event);if(e.creature.opposed){const i=this.boof246;e.creature.buff(i,i)}}vikC(){this.faction="N",this.rarity="L",this.name="Varna, Immortal King",this.maxLevel=4,this.iAttack=this.lValN([4,6,12,18]),this.iHealth=this.lValN([8,13,22,30]),this.tribe.push("FB");let t="";this.level===4&&(t="Destroy each other creature. Then "),this.ftext=t+"Spawn a random friendly creature that was destroyed this turn."}vikF(t){if(this.level===4){const s=g.creatByTarget(y.crNotMeTarg(t.creatId));if(s.length>0){const h=R.tick();s.forEach(f=>U.destroy(f,this.code,h))}}const e=t.owner?E.deathsA:E.deathsB,i=e.length;e.length>0&&g.birth(e[T.randInt(0,i)],"S",t.owner)}vdrkC(){this.faction="U",this.rarity="R",this.name="Venomdrinker",this.iAttack=this.lValN([5,9,13]),this.iHealth=this.iAttack,this.tribe.push("NG"),this.ftext=`${this.name} gets ${p.jr9(1,1).replaceAll("1","X")}, where X is the total amount of Poison on each enemy creature.`}vdrkF(t){const e=g.qEnemyCreats();let i=0;e.forEach(s=>{i+=s.poison}),i>0&&g.jr5(t.creatId).buff(i,i)}vnsC(){this.faction="U",this.rarity="H",this.name="Venomous Netherscale",this.iAttack=this.boof4713,this.iHealth=this.iAttack+4,this.tribe.push("NG"),this.ftext=`Double the Poison on each enemy creature${this.level===3?" and the enemy player":""}.`}vnsF(t){const e=y.crEnemyTarg();if(e.hasPoison=!0,g.creatByTarget(e).forEach(s=>{s.addPoison(s.poison)}),this.level===3){const s=v.toPlayer(!t.owner);s.poison+=v.totalPoison(s)}}warC(){this.faction="A",this.rarity="H",this.name="War Machine",this.iAttack=3,this.iHealth=3,this.tribe.push("RB"),this.maxLevel=1,this.overload=!0,this.ftext=`Each other friendly creature gets ${p.jr9(3,0)}.`}warF(t){const e=y.crFriendNotMeTarg(t.creatId);g.creatByTarget(e).forEach(i=>i.buff(3,0))}wwpC(){this.faction="U",this.rarity="H",this.name="Weirwood Patriarch",this.iAttack=this.boof5714,this.iHealth=this.lValN([7,10,17]),this.tribe.push("HM");const t=this.boof235;this.ftext=`Each friendly creature with ${this.boof357} or less attack gets ${p.jr9(t,t)}.`}wwpF(t){const e=this.boof235,i=y.crFriendNotMeTarg(t.creatId);i.maxAttack=this.boof357,g.creatByTarget(i).forEach(s=>s.buff(e,e))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof247n;this.flanks=this.buffNug(-t,-t),this.ftext=`The opposing creature gets ${p.jr9(t,t)}.`}wfbF(t){const i=V.toEnterField(t.event).creature.opposed;if(i){const s=this.boof247n;i.buff(s,s)}}xtmC(){this.faction="N",this.rarity="H",this.name="Xithian Tormentor",this.iAttack=this.lValN([6,12,22]),this.iHealth=this.lValN([10,16,28]),this.tribe.push("AB"),this.ftext="Destroy each other friendly creature."}xtmF(t){const e=g.creatByTarget(y.crFriendNotMeTarg(t.creatId));if(e.length>0){const i=R.tick();e.forEach(s=>U.destroy(s,this.code,i))}}}class Ze extends M{lookup(t){return{["RBG"]:{c:()=>this.rbgC(),g:(i,s)=>this.rbgG(i,s)},["SRV"]:{c:()=>this.sprvC(),g:(i,s)=>this.sprvG(i,s)},["TGK"]:{c:()=>this.tgkC(),g:(i,s)=>this.tgkG(i,s)}}[t]}onGain(t,e){this.lookup(t).g(e,e.event)}hPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("LG",this.code);return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="LG"&&this.validPlayer(t)}jr8(t){this.onGain(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.hPlayer===0)return!0;const e=t.event;return this.hPlayer===1?t.owner===e.playerA:t.owner!==e.playerA}rbgC(){this.faction="U",this.rarity="H",this.name="Runebark Guardian",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hPlayer=1;const t=this.boof135;this.text=`When you gain health, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}rbgG(t,e){const i=g.jr5(t.creatId),s=this.boof135;i.buff(s,s)}sprvC(){this.faction="N",this.rarity="R",this.name="Spirit Reaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.hPlayer=-1;const t=this.boof234;this.text=`When an enemy player gains health, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t),this.hints=["ZZ-1"]}sprvG(t,e){const i=g.jr5(t.creatId),s=this.boof234;i.buff(s,s)}tgkC(){this.faction="U",this.rarity="R",this.name="Tuskin Grovekeeper",this.iAttack=this.boof6912,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hPlayer=1,this.text=`When you gain health, Spawn a 3/3 ${z.minionName(this.level)}.`,this.trigB=this.rawNug(.5,3,3,0)}tgkG(t,e){const i=this.lValS(["SXD","SPL","TTF"])+this.level;g.birth(i,"S",t.owner)}}class Fe extends M{lookup(t){return{["EWE"]:{c:()=>this.eweC(),m:(i,s)=>this.eweM(i,s)},["FFM"]:{c:()=>this.ffmC(),m:(i,s)=>this.ffmM(i,s)},["LUC"]:{c:()=>this.lugC(),m:(i,s)=>this.lugM(i,s)},["WBH"]:{c:()=>this.wbhC(),m:(i,s)=>this.wbhM(i,s)}}[t]}onMove(t,e){this.lookup(t).m(e,V.toCreature(e.event))}mPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("MV");return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="MV"&&this.validPlayer(t)}jr8(t){this.onMove(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=V.toCreature(t.event);return this.mPlayer===1?t.owner===e.creature.owner:t.owner!==e.creature.owner}eweC(){this.faction="T",this.rarity="H",this.name="Emberwind Evoker",this.iAttack=this.boof4914,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.mPlayer=1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}eweM(t,e){const i=this.boof124;e.creature.buff(i,i)}ffmC(){this.faction="T",this.rarity="H",this.name="Frostfang Maiden",this.iAttack=this.boof5814,this.iHealth=this.iAttack+this.level,this.tribe.push("HM"),this.iMobile=this.level,this.mPlayer=1;const t=this.ffbof;this.text=`When a friendly creature moves, deal ${t} to the creature opposing it.`,this.trigB=this.buffNug(t,0)}ffmM(t,e){const i=e.creature.opposed;i&&i.hurtDirect(this.ffbof,this.code)}get ffbof(){return this.level+2}lugC(){this.faction="T",this.rarity="L",this.name="Lug, Uranti Charger",this.iAttack=this.boof359,this.iHealth=this.lValN([9,13,19]),this.level===3&&(this.iMobile=1),this.tribe.push("YT"),this.mPlayer=1,this.text="When a friendly creature moves on your turn, Lug battles an additional time.",this.trigB=this.buffNug(this.iAttack,0)}lugM(t,e){if(t.owner===v.getActiveB()){const i=g.jr5(t.creatId);i.extraBattles+=1}}wbhC(){this.faction="T",this.rarity="R",this.name="Windborn Hellion",this.iAttack=this.boof4812,this.iHealth=this.boof81217,this.tribe.push("WN","EL"),this.mPlayer=1,this.text=`When a friendly creature moves, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.buffNug(this.level,this.level)}wbhM(t,e){g.jr5(t.creatId).buff(this.level,this.level)}}class qt extends M{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.agrdP(i,s)},["ART"]:{c:()=>this.arootC(),t:(i,s)=>this.factionSpellMyTurn(i,s,"U"),p:(i,s)=>this.arootP(i,s)},["ARB"]:{c:()=>this.arbysC(),t:(i,s)=>this.enemyPlayed(i,s),p:(i,s)=>this.arbysP(i,s)},["BLH"]:{c:()=>this.bblhC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.bblhP(i,s)},["CYC"]:{c:()=>this.ccC(),t:(i,s)=>this.factionSpellMyTurn(i,s,"N"),p:(i,s)=>this.ccP(i,s)},["DHW"]:{c:()=>this.dhwC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.dhwP(i,s)},["FBI"]:{c:()=>this.fbiC(),t:(i,s)=>this.factionSpellMyTurn(i,s,"T"),p:(i,s)=>this.fbiP(i,s)},["FLS"]:{c:()=>this.flspkC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.flspkP(i,s)},["IZK"]:{c:()=>this.izzyC(),t:(i,s)=>this.izzyT(i,s),p:(i,s)=>this.izzyP(i,s)},["KAW"]:{c:()=>this.kasC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.kasP(i,s)}}[t]}testPlay(t,e){return this.lookup(t).t(e,e.event)}actPlay(t,e){this.lookup(t).p(e,e.event)}trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return this.trigB&&i.jr4("PC"),i}ddf8(t){return t.event.code==="PLC"?this.testPlay(this.cardCode(),t):t.event.code==="TRE"&&this.cardCode()==="BLH"}jr8(t){if(t.event.code==="PLC")this.actPlay(this.cardCode(),t);else{const e=g.jr5(t.creatId);U.destroy(e,this.code)}x.triggerDone()}spellMyTurn(t,e){return e.playerA===t.owner&&L.getCard(e.cardCode).type==="S"}factionSpellMyTurn(t,e,i){if(e.playerA===t.owner){const s=L.getCard(e.cardCode);if(s.type==="S"&&s.faction===i)return!0}return!1}enemyPlayed(t,e){return e.playerA!==t.owner}ownerAlive(t){return g.jr5(t).status==="A"}agrdC(){this.faction="A",this.rarity="C",this.name="Aetherguard",this.iAttack=this.boof6814,this.iHealth=this.iAttack-1,this.tribe.push("RB"),this.trigB=this.rawNug(0,ht.calcCreatValueFormula(0,0,this.level,0,0,!1,0),0,0),this.text=`When you play a spell, ${this.name} gets Armor ${this.level}.`}agrdP(t,e){g.jr5(t.trigger.creatId).addArmor(this.level)}arootC(){this.faction="U",this.rarity="H",this.name="Aether Root",this.iAttack=this.boof3610,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=[this.lValH(["ZZ+1","ZZ+2","ZZ+3"])];const t=this.boof234;this.text=`When you play an Uterra spell, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}arootP(t,e){const i=g.jr5(t.trigger.creatId),s=this.boof234;i.buff(s,s)}arbysC(){this.faction="A",this.rarity="H",this.name="Anvillon Arbiter",this.iAttack=this.boof3714,this.iHealth=this.iAttack+3,this.iArmor=1,this.tribe.push("RB"),this.text="When the enemy player plays their second card in a turn, that player discards their hand.",this.trigB=this.rawNug(0,0,0,0,1)}arbysP(t,e){if(E.cardsPlayed>1&&this.ownerAlive(t.creatId)){const i=v.getActive();i.discard.push(...i.hand),i.hand=[]}}bblhC(){this.faction="T",this.rarity="L",this.name="Binben, Lightning Herald",this.iAttack=this.boof61017,this.iHealth=this.boof468,this.tribe.push("LT","AS");const t=L.getCard(this.lwy());this.text=`When you play a spell, Spawn a ${p.tokName(t)}. At the end of your turn, destroy it.`,this.trigB=this.spawnNug(t)}bblhP(t,e){if(this.ownerAlive(t.creatId)){const i=g.birth(this.lwy(),"S",t.owner);if(i){const s=i.jr4("TE",this.code);s.changes=!0}}}lwy(){return "LWY"+this.level}ccC(){this.faction="N",this.rarity="H",this.name="Crypt Conjurer",this.iAttack=this.boof258,this.iHealth=this.lValN([8,14,20]),this.tribe.push("VP"),this.text=`When you play a Nekrium spell, deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.trigB=this.playerNug(2*this.iAttack)}ccP(t,e){this.ownerAlive(t.creatId)&&(v.hurtDirect(!t.owner,this.iAttack,t.cardCode),v.heal(t.owner,this.iAttack))}dhwC(){this.faction="N",this.rarity="R",this.name="Darkheart Wanderer",this.iAttack=this.boof3612,this.iHealth=this.boof81116,this.tribe.push("HM");const t=this.boof124;this.text=`When you play a spell, ${this.name} gets Regenerate ${t}.`,this.trigB=this.regnNug(t)}dhwP(t,e){g.jr5(t.trigger.creatId).addRegen(this.boof124)}fbiC(){this.faction="T",this.rarity="H",this.name="Flamebreak Invoker",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("FR","GT"),this.text=`When you play a Tempys spell, deal ${this.level} damage to each enemy creature.`,this.trigB=this.buffNug(0,this.level*2)}fbiP(t,e){if(this.ownerAlive(t.creatId)){const i=R.tick();g.qEnemyCreats().forEach(s=>{s.hurtDirect(this.level,this.code,i)})}}flspkC(){this.faction="T",this.rarity="C",this.name="Flame Speaker",this.iAttack=this.lValN([2,6,13]),this.iHealth=this.level*6,this.tribe.push("HM");const t=this.boof235;this.text=`When you play a spell, deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t)}flspkP(t,e){this.ownerAlive(t.creatId)&&v.hurtDirect(!t.owner,this.boof235,t.cardCode)}izzyC(){this.faction="T",this.rarity="L",this.name="Iztek, Khan of Arrachtor",this.iAttack=this.boof6915,this.iHealth=this.iAttack,this.tribe.push("IC","FR","AS"),this.text=`When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.~When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.`,this.trigB=this.rawNug(0,0,0,0,.5)}izzyT(t,e){if(e.playerA===t.owner){const s=L.getCard(e.cardCode).cardCode();if(s==="IFL"||s==="IFR")return!0}return!1}izzyP(t,e){const i=g.jr5(t.trigger.creatId),h=L.getCard(e.cardCode).cardCode()==="IFL"?"IZL":"IZR";g.birth(`${h}${this.level}`,"R",i.owner,i.lane)}kasC(){this.faction="T",this.rarity="L",this.name="Kas, Arcweaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("LT","AS"),this.hints=["OL"],this.text="When you play a spell, Kas battles an additional time this turn.",this.trigB=this.buffNug(this.iAttack,0)}kasP(t,e){const i=g.jr5(t.trigger.creatId);i.extraBattles+=1}}class Pe extends M{lookup(t){return{["KTS"]:{c:()=>this.kitC(),r:(i,s)=>this.kitR(i,s)},["RSC"]:{c:()=>this.scootC(),r:(i,s)=>this.scootR(i,s)},["SCC"]:{c:()=>this.shcrC(),r:(i,s)=>this.shcrR(i,s)},["SND"]:{c:()=>this.ssdC(),r:(i,s)=>this.ssdR(i,s)}}[t]}trigB;actReplace(t,e){this.lookup(t).r(e,V.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("RP");return s.bonus=this.trigB,i}ddf8(t){if(t.event.code==="RPL"){const e=t.event;return t.creatId===e.replCreatId}return!1}jr8(t){this.actReplace(this.cardCode(),t),x.triggerDone()}kitC(){this.faction="U",this.rarity="H",this.name="Kitaru Sprite",this.iAttack=this.boof358,this.iHealth=this.boof71117,this.tribe.push("FY"),this.hints=["RT"],this.text=`When this is replaced, Spawn a ${this.name}.`,this.trigB=this.buffNug(0,this.iHealth)}kitR(t,e){g.birth(this.code,"S",t.owner)}scootC(){this.faction="A",this.rarity="T",this.name="Relic Scout",this.iAttack=this.level,this.iHealth=this.level,this.iArmor=this.level,this.isFree=!0,this.tribe.push("RB"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${p.jr9(this.level,this.level,!0)} and Armor ${this.level}.`,this.trigB=this.buffNug(this.level,ht.calcCreatValueFormula(this.level,this.level,this.level,0,0,!1,0))}scootR(t,e){e.creature.buff(this.level,this.level),e.creature.addArmor(this.level)}shcrC(){this.faction="U",this.rarity="C",this.name="Shardclaw Crusher",this.iAttack=this.boof5812,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${p.jr9(this.iAttack,this.iAttack)}.`,this.trigB=this.multNug(this.buffNug(this.iAttack,this.iAttack),.5)}shcrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}ssdC(){this.faction="U",this.rarity="R",this.name="Spiritstone Druid",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("TG"),this.hints=["RT"],this.text=`When ${this.name} is replaced, put a ${this.iAttack}/${this.iHealth} Spirit into each adjacent available lane.`,this.trigB=this.buffNug(this.iAttack,this.iHealth),this.trigB.count=1}ssdR(t,e){const i=e.replCreat.adjacent,s=g.emptyLanes(t.owner),h=R.tick();i.forEach(f=>{s.includes(f)&&g.birth("SPU"+this.level,"P",t.owner,f,h)})}}class de extends M{lookup(t){return{["BST"]:{c:()=>this.brimC(),u:(i,s)=>this.brimR(i,s)},["OSV"]:{c:()=>this.scavC(),u:(i,s)=>this.scavR(i,s)},["RHU"]:{c:()=>this.tiaC(),u:(i,s)=>this.tiaR(i,s)},["SKS"]:{c:()=>this.spsoC(),u:(i,s)=>this.spsoR(i,s)},["SWG"]:{c:()=>this.stgrC(),u:(i,s)=>this.stgrR(i,s)},["VTW"]:{c:()=>this.weldC(),u:(i,s)=>this.weldR(i,s)}}[t]}actUpgrade(t,e){this.lookup(t).u(e,V.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return i.jr4("UP"),i}jr8(t){this.actUpgrade(this.cardCode(),t),x.triggerDone()}brimC(){this.faction="T",this.rarity="L",this.name="Brimstone Tyrant",this.iAttack=this.boof6916,this.iHealth=this.iAttack,this.tribe.push("FR","EL"),this.hints=["RD"];const t=this.boof468;this.text=`Upgrade: Deal ${t} damage to each other creature.`}brimR(t,e){const i=R.tick(),s=this.boof468;g.creatByTarget(y.crNotMeTarg(t.creatId)).forEach(h=>h.hurtDirect(s,this.code,i))}scavC(){this.faction="A",this.rarity="H",this.name="Oreian Scavenger",this.iAttack=this.boof6916,this.iHealth=1,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Armor ${this.iAttack}.`}scavR(t,e){e.creature.addArmor(this.iAttack)}tiaC(){this.faction="A",this.rarity="L",this.name="Relic Hunter",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iBT=!0,this.tribe.push("HM"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets +attack and +health equal to the creature it replaced.`}tiaR(t,e){e.creature.buff(e.replCreat.attack,e.replCreat.health)}spsoC(){this.faction="T",this.rarity="C",this.name="Sparksoul",this.iAttack=this.boof6915,this.iHealth=this.iAttack-1,this.tribe.push("LT","EL"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Aggressive.`}spsoR(t,e){e.creature.aggressive=!0}stgrC(){this.faction="A",this.rarity="C",this.name="Steelwatch Guard",this.iAttack=this.boof4711,this.iHealth=this.iAttack,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets ${p.jr9(this.iAttack,this.iAttack)}.`}stgrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}weldC(){this.faction="A",this.rarity="R",this.name="Vault Welder",this.iAttack=this.boof71118,this.iHealth=this.lValN([9,14,22]),this.iDefend=!0,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: Negate Defender from ${this.name}.`}weldR(t,e){e.creature.negateDefender=!0}}class Tt extends M{lookup(t){return{["CGF"]:{c:()=>this.cfiendC(),v:(i,s)=>this.cfiendV(i,s)},["CSB"]:{c:()=>this.corpsC(),v:(i,s)=>this.corpsV(i,s)},["CYS"]:{c:()=>this.cslmC(),v:(i,s)=>this.cslmV(i,s)},["DSK"]:{c:()=>this.dskC(),v:(i,s)=>this.dskV(i,s)},["FST"]:{c:()=>this.fstrC(),v:(i,s)=>this.fstrV(i,s)},["FWK"]:{c:()=>this.fwlkC(),v:(i,s)=>this.fwlkV(i,s)},["FFD"]:{c:()=>this.ffC(),v:(i,s)=>this.ffV(i,s)},["GVS"]:{c:()=>this.ghsC(),v:(i,s)=>this.ghsV(i,s)},["GBG"]:{c:()=>this.ggC(),v:(i,s)=>this.ggV(i,s)},["GMR"]:{c:()=>this.gromC(),v:(i,s)=>this.gromV(i,s)},["MMX"]:{c:()=>this.mmeC(),v:(i,s)=>this.mmeV(i,s)},["NOZ"]:{c:()=>this.nyozC(),v:(i,s)=>this.nyozV(i,s)},["POX"]:{c:()=>this.poxC(),v:(i,s)=>this.poxV(i,s)},["RSZ"]:{c:()=>this.rszC(),v:(i,s)=>this.rszV(i,s)},["SFM"]:{c:()=>this.spirmC(),v:(i,s)=>this.spirmV(i,s)},["SNT"]:{c:()=>this.sssC(),v:(i,s)=>this.sssV(i,s)},["VGN"]:{c:()=>this.vgfsC(),v:(i,s)=>this.vgfsV(i,s)},["XHS"]:{c:()=>this.xhostC(),v:(i,s)=>this.xhostV(i,s)},["ZTU"]:{c:()=>this.zimusC(),v:(i,s)=>this.zimusV(i,s)}}[t]}cardVengeance(t,e){this.lookup(t).v(e,V.toCreature(e.event))}vtext="";trigB;fixedImgCreat=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.trigB&&(this.text="Vengeance: "+this.vtext),this.vtext=""}image(t){return this.fixedImgCreat?this.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e);if(this.trigB){const s=i.jr4("VN");s.bonus=this.trigB}return i}jr8(t){this.cardVengeance(this.cardCode(),t),x.triggerDone()}cfiendC(){this.faction="N",this.rarity="T",this.name="Contagion Fiend",this.iAttack=this.boof234,this.iHealth=this.boof5812,this.tribe.push("AB"),this.fixedImgCreat=!0;const t=-this.level;this.vtext=`Each enemy creature gets ${p.jr9(t,t)}.`;const e=this.boof246;this.trigB=this.buffNug(e,e)}cfiendV(t,e){const i=-this.level,s=R.tick(),h=y.crTarg();h.player=v.toTarget(!t.owner),g.creatByTarget(h).forEach(f=>f.buff(i,i,s))}corpsC(){this.faction="N",this.rarity="C",this.name="Corpulent Shambler",this.iAttack=this.lValN([5,7,15]),this.iHealth=this.iAttack,this.tribe.push("ZB"),this.vtext="Put a 3/3 Zombie into this lane.",this.trigB=this.buffNug(3,3)}corpsV(t,e){const i=`${"ZBS"}${this.level}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}cslmC(){this.faction="N",this.rarity="C",this.name="Crypt Slime",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.vtext="Put a 1/1 Oozeling into this lane.",this.trigB=this.buffNug(1,1)}cslmV(t,e){const i=`${"COZ"}${this.level}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}dskC(){this.faction="N",this.rarity="C",this.name="Death Seeker",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.fixedImgCreat=!0,this.hints=["ST"];const t=this.boof51015;this.vtext=`Put a ${t}/${t} Spirit into this lane.`,this.trigB=this.buffNug(t,t)}dskV(t,e){const i=`${"SPN"}${this.level}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}fstrC(){this.faction="N",this.rarity="R",this.name="Fell Strider",this.iAttack=this.lValN([4,8,10]),this.iHealth=this.boof369,this.tribe.push("ZB");const t=L.getCard(this.fsz());this.vtext=`Spawn a ${p.tokName(t)}.`,this.trigB=this.multNug(this.buffNug(t.iAttack,t.iHealth),.5)}fstrV(t,e){g.birth(this.fsz(),"S",e.creature.owner)}fsz(){return "ZST"+this.level}fwlkC(){this.faction="N",this.rarity="C",this.name="Fell Walker",this.iAttack=this.boof359,this.iHealth=this.iAttack,this.tribe.push("ZB");const t=L.getCard(z.zomc(this.level));this.vtext=`Put a ${p.tokName(t)} into this lane.`,this.trigB=this.buffNug(t.iAttack,t.iHealth)}fwlkV(t,e){g.birth(z.zomc(this.level),"P",e.creature.owner,e.creature.lane)}ffC(){this.faction="N",this.rarity="H",this.name="Fleshfiend",this.iAttack=this.boof6812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.vtext=`Put a level ${this.level-1} ${this.name} into this lane.`,this.level>1&&(this.trigB=this.buffNug(0,this.lValN([0,6,15])))}ffV(t,e){const i=`${"FFD"}${this.level-1}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}ghsC(){this.faction="U",this.rarity="C",this.name="Glowhive Siren",this.iAttack=this.boof3814,this.iHealth=this.boof61117,this.tribe.push("IN"),this.vtext=`You gain ${this.boof124} to ${this.gghigh-1} health.`,this.trigB=this.playerNug(this.boof258)}ghsV(t,e){const i=T.randInt(this.boof124,this.gghigh);v.heal(t.owner,i)}get gghigh(){return this.lValN([5,9,13])}ggC(){this.faction="N",this.rarity="C",this.name="Graveborn Glutton",this.iAttack=this.boof61117,this.iHealth=this.boof3814,this.tribe.push("AB"),this.vtext=`Deal ${this.boof124} to ${this.gghigh-1} damage to the enemy player.`,this.trigB=this.playerNug(this.boof258)}ggV(t,e){const i=T.randInt(this.boof124,this.gghigh);v.hurtDirect(!t.owner,i,this.code)}gromC(){this.faction="U",this.rarity="C",this.name="Grove Matriarch",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("PL");const t=z.minionBuff(this.level),e=z.minionName(this.level);this.vtext=`Put a ${t}/${t} ${e} into this lane.`,this.trigB=this.buffNug(t,t)}gromV(t,e){const i=z.minionCode(this.level);g.birth(i,"P",e.creature.owner,e.creature.lane)}mmeC(){this.faction="A",this.rarity="C",this.name="Metamind Explorer",this.iAttack=this.boof3713,this.iHealth=this.iAttack+2,this.tribe.push("MM"),this.vtext=`Draw ${this.level} cards.`,this.trigB=this.rawNug(0,0,0,0,this.level*ht.dcWeight)}mmeV(t,e){v.drawCard(t.owner,this.level)}nyozC(){this.faction="N",this.rarity="R",this.name="Nyrali Ooze",this.iAttack=this.boof247,this.iHealth=this.iAttack,this.tribe.push("OZ");const t=this.level+this.iAttack+1;this.vtext=`Put a ${t}/${t} Oozeling into this lane.`,this.trigB=this.buffNug(t,t)}nyozV(t,e){const i=`${"OOZ"}${this.level}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}poxC(){if(this.faction="N",this.rarity="H",this.name="Progeny of Xith",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.tribe.push("AB"),this.hints=["LB"],this.vtext=`Spawn a level ${this.level+1} ${this.name}.`,this.level<3){const t=this.lValN([10,6,0]);this.trigB=this.buffNug(t,t)}}poxV(t,e){const i=`${"POX"}${this.level+1}`;g.birth(i,"S",e.creature.owner)}rszC(){this.faction="N",this.rarity="R",this.name="Runescarred Zombie",this.iAttack=this.lValN([5,8,16]),this.iHealth=this.boof359,this.tribe.push("ZB"),this.vtext=`Put a ${p.levelGateText(this.level,!0)}spell at random from your discard pile into your hand.`,this.trigB=this.rawNug(0,0,0,0,.5)}rszV(t,e){const i=v.toPlayer(t.owner),s=y.target("TD");s.player=v.toTarget(i),s.card="S",s.level=D.ddf2(this.level);const h=D.deckByTarget(s);if(h.length>0){const f=h[T.randInt(0,h.length)];i.discard.splice(f[1],1),i.hand.push(f[0])}}spirmC(){this.faction="T",this.rarity="H",this.name="Spiritflame Mystic",this.iAttack=this.boof6912,this.iHealth=this.iAttack-3,this.tribe.push("HM"),this.vtext=`Deal ${this.boof246} damage to each creature.`,this.trigB=this.rawNug(0,0,0,0,.2)}spirmV(t,e){const i=this.boof246,s=R.tick();g.qActiveCreats().forEach(h=>h.hurtDirect(i,this.code,s))}sssC(){this.faction="N",this.rarity="L",this.name="Spiritstone Sentry",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("ST"),this.vtext=`If ${this.name} was in a side lane, Spawn a ${this.name}.`,this.hints=["ST"],this.trigB=this.buffNug(this.iAttack,this.iAttack)}sssV(t,e){(e.creature.lane===1||e.creature.lane===5)&&g.birth(e.creature.code,"S",t.owner)}vgfsC(){this.faction="N",this.rarity="C",this.name="Vengeful Spirit",this.iAttack=this.boof357,this.iHealth=this.iAttack-2,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof369n;this.vtext=`Give the opposing creature ${p.jr9(t,t)}.`,this.trigB=this.buffNug(-t,-t)}vgfsV(t,e){const i=e.creature.opposed;if(i){const s=this.boof369n;i.buff(s,s)}}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.iAttack=this.boof359,this.iHealth=this.boof135,this.tribe.push("AB"),this.vtext=`Deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.trigB=this.playerNug(this.iAttack*2)}xhostV(t,e){const i=this.iAttack;v.hurtDirect(!t.owner,i,this.code),v.heal(t.owner,i)}zimusC(){this.faction="N",this.rarity="L",this.name="Zimus, the Undying",this.iAttack=this.boof51014,this.iHealth=this.lValN([2,5,7]),this.tribe.push(this.level===1?"HM":"ZB"),this.vtext=`Spawn a Zimus, the ${this.level===2?"Returned":"Undying"}.`,this.level<3?(this.hints=["LG"],this.level===2?(this.trigB=this.buffNug(this.iAttack,this.iHealth),this.hints.push("ZZ-5")):this.hints.push("ZZ-1")):(this.hints=["ST","ZZ-5"],this.trigB=this.buffNug(this.iAttack,this.iHealth),this.trigB.bonus=1)}zimusV(t,e){let i;this.level===2?i=`${"ZTR"}2`:i=`${"ZTU"}3`,g.birth(i,"S",t.owner)}}class Ut extends kt{lookup(t){return{["AEC"]:{c:()=>this.anceC(),p:i=>this.aeZ(i)},["DIS"]:{c:()=>this.disnC(),p:i=>this.disnZ(i)},["DRE"]:{c:()=>this.dracC(),p:i=>this.deZ(i)},["DCH"]:{c:()=>this.dchantC(),p:i=>this.dchantZ(i)},["ESU"]:{c:()=>this.esrgC(),p:i=>this.esrgZ(i)},["HOX"]:{c:()=>this.howlC(),p:i=>this.howlZ(i)},["ITO"]:{c:()=>this.itorC(),p:i=>this.itorZ(i)},["IME"]:{c:()=>this.imecC(),p:i=>this.ieZ(i)},["LCE"]:{c:()=>this.lucidC(),p:i=>this.leZ(i)},["MSP"]:{c:()=>this.mendC(),p:i=>this.mendZ(i)},["NEM"]:{c:()=>this.netherC(),p:i=>this.netherZ(i)}}[t]}cardCast(t,e){this.lookup(t).p(e)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(y.playerActTarg(this.playTarg,"CARD",this.code,"")),t}handleAction(t){this.logSpell();const e=v.toPlayer(t.playerA);this.cardCast(this.cardCode(),e),S.spellCast()}ddf8(t){return t.trigger.type==="TE"?t.event.playerA===t.owner:!1}jr8(t){const e=Dt.extractCardCode(t.trigger.logicCode),i=t.event;if(e==="LCE"){const s=v.toPlayer(i.playerA),h=this.level===1?1:2;this.logAct(!1),v.drawCard(s,h)}else if(e==="IME"){const s=U.gravedigger(v.toTarget(t.owner),D.ddf2(this.level+1));s&&g.birth(s,"S",i.playerA)}else if(e==="DRE"){const s=this.level===1?11:21;v.hurtDirect(!i.playerA,T.randInt(1,s),this.code)}else if(e==="AEC"){const s=g.qPlayerCreats(t.owner);if(s.length>0){const h=this.level===1?[1,2]:[2,4];s.forEach(f=>{this.logAct(!1,f),f.buff(h[0],h[1])})}}else super.jr8(t);if(this.level<3){const s=v.toPlayer(i.playerA),h=y.trigIdx(s.triggers,t.trigger);h>-1?t.trigger.customCode==="P2"?s.triggers[h].customCode="P1":s.triggers.splice(h,1):console.error("Wery curious, could not find player trigger ",t.trigger)}x.triggerDone()}echTxt(){return"At the end of "+(this.level===3?"each of your turns":"this turn and your next turn")+", "}echoZ(t){const e=y.trigger("TE",this.code);return this.level<3&&(e.customCode="P2"),e.changes=!0,t.triggers.push(e),e}anceC(){this.faction="U",this.rarity="L",this.name="Ancestral Echoes",this.playTarg="F";const t=this.level===1?[1,2]:[2,4];this.text=`${this.echTxt()}each friendly creature gets ${p.jr9(t[0],t[1])}.`}aeZ(t){const e=this.echoZ(t),i=this.boof248;e.bonus=this.buffNug(i,i*2)}disnC(){this.faction="T",this.rarity="R",this.name="Disintigrate",this.playTarg="E",this.text=`Deal 1 to ${this.dshigh-1} damage to the enemy player.`}disnZ(t){v.hurtDirect(t,T.randInt(1,this.dshigh),this.code)}get dshigh(){return this.lValN([9,16,26])}dracC(){this.faction="T",this.rarity="L",this.name="Draconic Echoes",this.playTarg="F";const t=this.level===1?"10":"20";this.text=`${this.echTxt()}deal 1 to ${t} damage to the enemy player.`}deZ(t){const e=this.echoZ(t),i=this.lValN([4,9,25]);e.bonus=this.playerNug(i)}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){v.heal(t,this.boof81220)}esrgC(){this.faction="A",this.rarity="R",this.name="Energy Surge",this.isFree=this.level>1,this.overload=this.level===3,this.level===1&&(this.hints=["LG"]),this.playTarg="F",this.text=`Draw ${this.level} card${this.level>1?"s":""}.`}esrgZ(t){v.drawCard(t,this.level)}howlC(){this.faction="N",this.rarity="R",this.name="Howl of Xith",this.maxLevel=1,this.playTarg="E",this.text="Deal X damage to the enemy player and gain X health, where X is three times your rank."}howlZ(t){const e=v.getActive(),i=e.rank*3;v.hurtDirect(t,i,this.code),v.heal(e,i)}itorC(){this.faction="T",this.rarity="R",this.name="Ice Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg="E",this.text=`Deal ${this.boof234} damage to the enemy player.`}itorZ(t){v.hurtDirect(t,this.boof234,this.code)}imecC(){this.faction="N",this.rarity="L",this.name="Immortal Echoes",this.playTarg="F";const t=`Spawn a random friendly ${p.levelGateText(this.level+1,!0)}creature that was destroyed this game`;this.text=`${this.echTxt()}${t}.`}ieZ(t){const e=this.echoZ(t),i=this.lValN([1,1,3]);e.bonus=this.multNug(this.avgSpawnNug(),i)}lucidC(){this.faction="A",this.rarity="L",this.name="Lucid Echoes",this.playTarg="F";const t=this.level===1?"draw 1 card":"draw 2 cards";this.text=`${this.echTxt()}${t}.`}leZ(t){const e=this.echoZ(t),i=this.boof124*ht.dcWeight;e.bonus=this.rawNug(0,0,0,0,i)}mendC(){this.faction="U",this.rarity="R",this.name="Mending Spring",this.playTarg="F",this.text=`You gain 1 to ${this.mendboof} Health.`}mendZ(t){ot.simOn?this.boof61224:this.mendboof+1,v.heal(t,T.randInt(1,this.mendboof+1))}get mendboof(){return this.lValN([10,20,40])}netherC(){this.faction="N",this.rarity="C",this.name="Nether Embrace",this.playTarg="E";const t=this.boof4712;this.text=`Deal ${t} damage to the enemy player. You gain ${t} heal`}netherZ(t){const e=this.boof4712;v.hurtDirect(t,e,this.code),v.heal(!t.isPlayerA,e)}}class Er extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Rageborn Hellion",this.iAttack=this.boof469,this.iHealth=this.iAttack*2,this.tribe.push("FR","EL"),this.hints=["OL"],this.text=`When a friendly creature ${p.dbdtap()}, ${this.name} gets ${p.jr9(this.level,this.level)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM"),h=this.boof246;return s.bonus=this.buffNug(h,h),i}ddf8(t){if(t.trigger.type==="DM"){const e=V.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}return!1}jr8(t){g.jr5(t.creatId).buff(this.level,this.level),x.triggerDone()}}class Et extends M{lookup(t){return{["AIV"]:{c:()=>this.avinvC(),r:i=>this.avinvR(i)},["BSP"]:{c:()=>this.bskphC(),r:i=>this.bskphR(i)},["CRC"]:{c:()=>this.crucC(),r:i=>this.crucR(i)},["ESK"]:{c:()=>this.ebknC(),r:i=>this.ebknR(i)},["FWC"]:{c:()=>this.fwcC(),r:i=>this.fwcR(i)},["FME"]:{c:()=>this.feggC(),r:i=>this.feggR(i)},["MMV"]:{c:()=>this.mmovC(),r:i=>this.mmovR(i)},["PSH"]:{c:()=>this.porshC(),r:i=>this.porshR(i)},["RGG"]:{c:()=>this.runegC(),r:i=>this.runegR(i)},["SSR"]:{c:()=>this.solrevC(),r:i=>this.solrevR(i)},["SSM"]:{c:()=>this.spshamC(),r:i=>this.spshamR(i)},["SSG"]:{c:()=>this.snoutC(),r:i=>this.snoutR(i)},["UGM"]:{c:()=>this.mantisC(),r:i=>this.mantisR(i)}}[t]}rtext="";trigB;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Gain Rank: "+this.rtext,this.rtext=""}image(t){return this.rarity==="T"?this.cardCode()==="FWC"?this.rawImage("MPH",t):super.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("RU");return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.owner:!1}jr8(t){this.lookup(this.cardCode()).r(t),x.triggerDone()}avinvC(){this.faction="T",this.rarity="H",this.name="Avalanche Invoker",this.iAttack=this.boof6914,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS"),this.hints=["TL"];const t=this.boof3612;this.trigB=this.buffNug(t,0),this.rtext=`Deal ${t} damage to each non-Tempys creature.`}avinvR(t){const e=this.boof3612,i=R.tick();g.qActiveCreats().filter(s=>s.faction!=="T").forEach(s=>s.hurtDirect(e,this.code,i))}bskphC(){this.faction="N",this.rarity="C",this.name="Blightskull Phantasm",this.iAttack=this.boof5814,this.iHealth=this.boof61017,this.tribe.push("ST"),this.hints=["TL","OP"];const t=this.boof369n;this.trigB=this.buffNug(0,-t),this.rtext=`The opposing creature gets ${p.jr9(t,t)}.`}bskphR(t){const i=g.jr5(t.creatId).opposed;if(i){const s=this.boof369n;i.buff(s,s)}}crucC(){this.faction="A",this.rarity="R",this.name="Crucible Colossus",this.iAttack=this.boof61016,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.iDefend=!0,this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,.2),this.rtext=`Negate Defender from ${this.name}.`}crucR(t){const e=g.jr5(t.creatId);e.negateDefender=!0}ebknC(){this.faction="N",this.rarity="H",this.name="Ebonskull Knight",this.iAttack=this.lValN([9,13,18]),this.iHealth=this.iAttack-2,this.tribe.push("VP"),this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,-1),this.rtext=`Destroy ${this.name}.`}ebknR(t){const e=g.jr5(t.creatId);U.destroy(e,this.code)}fwcC(){this.faction="U",this.rarity="T",this.maxLevel=1,this.name="Feywing Chrysalis",this.iAttack=0,this.iHealth=3,this.tribe.push("CR"),this.iDefend=!0,this.trigB=this.buffNug(5,5),this.rtext=`Replace ${this.name} with a 9/9 Feywing.`}fwcR(t){const e=g.jr5(t.creatId);g.birth(`${"FWG"}1`,"R",e.owner,e.lane)}feggC(){this.faction="T",this.rarity="T",this.minLevel=this.level,this.maxLevel=this.level,this.name="Frostmane Egg",this.iAttack=0,this.iHealth=6,this.tribe.push("DG"),this.iDefend=!0;const t=this.lValN([6,9,13]);this.trigB=this.buffNug(t,t),this.rtext=`Replace ${this.name} with a level ${this.level} Frostmane Dragon.`}feggR(t){const e=g.jr5(t.creatId);g.birth(`${"FMD"}${this.level}`,"R",e.owner,e.lane)}mmovC(){this.faction="A",this.rarity="C",this.name="Metamind Overseer",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,ht.dcWeight*.6),this.rtext="Draw 2 cards."}mmovR(t){v.drawCard(t.owner,2)}porshC(){this.faction="N",this.rarity="H",this.name="Portal Shade",this.iAttack=this.boof5914,this.iHealth=this.boof71118,this.tribe.push("ST"),this.trigB=this.multNug(this.avgSpawnNug(),.4),this.rtext="Spawn a random creature that was destroyed this game."}porshR(t){const e=U.gravedigger();e&&g.birth(e,"S",t.owner)}runegC(){this.faction="U",this.rarity="H",this.name="Runegrove Guardian",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=["TL"],this.trigB=this.buffNug(0,this.iAttack),this.rtext=`${this.name} gets ${p.jr9(this.iAttack,this.iAttack)}.`}runegR(t){g.jr5(t.creatId).buff(this.iAttack,this.iAttack)}solrevC(){this.faction="U",this.rarity="L",this.name="Solstice Reveler",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hints=["TL"];const t=this.boof248;this.trigB=this.buffNug(t,t);const e=this.level===3;let i="";e&&(i=", and Breakthrough"),this.rtext=`Each friendly creature gets ${p.jr9(t,t,e)}${i}.`}solrevR(t){const e=this.boof248;g.ddf1().forEach(i=>{i.buff(e,e),this.level===3&&(i.breakthrough=!0)})}spshamC(){this.faction="T",this.rarity="C",this.name="Spiritfrost Shaman",this.iAttack=this.boof71117,this.iHealth=this.boof4610,this.tribe.push("HM"),this.hints=["TL"];const t=this.boof579;this.rtext=`Deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t)}spshamR(t){v.hurtDirect(!t.owner,this.boof579,this.code)}snoutC(){this.faction="U",this.rarity="C",this.name="Stouthide Stegadon",this.iAttack=this.boof4714,this.iHealth=this.boof71117,this.tribe.push("DN"),this.hints=["TL"],this.rtext=`Heal ${this.snoutbof} damage from ${this.name}.`,this.trigB=this.buffNug(0,this.iHealth)}snoutR(t){g.jr5(t.creatId).heal(this.snoutbof)}get snoutbof(){return this.level*10}mantisC(){this.faction="U",this.rarity="C",this.name="Umbraglim Mantis",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("IN"),this.hints=["TL"];const t=this.mantbof;this.rtext=`You gain ${t} health.`,this.trigB=this.playerNug(t/3)}mantisR(t){v.heal(t.owner,this.mantbof)}get mantbof(){return this.lValN([8,10,12])}}class Ir extends M{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Riftlasher",this.iAttack=this.boof359,this.iHealth=this.boof61016,this.tribe.push("FR","EL"),this.text=`When ${this.name} ${p.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.interactive=!0,s.bonus=this.buffNug(this.iAttack,0),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&t.owner===v.getActiveB()}return!1}jr8(t){const e=t.event,i=D.toActions(y.crEnemyActTarg("CARD",this.code,T.enTil(t.creatId,e.dmg)));i.length>0?(i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}handleAction(t){const e=T.deTil(t.param);g.ddf6(t).hurtDirect(parseInt(e[1]),this.code),S.actionDone(!0)}}class Lr extends Wt{jr3(t,e){const i=super.jr3(t,e);return i.jr4("AS"),i}jr8(t){if(t.trigger.type==="AS"){let e=!0;for(;e;){const i=g.birth(this.code,"S",t.owner);i?i.opposed&&(e=!1):e=!1}x.triggerDone()}else super.jr8(t)}}class Gr extends M{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Scourgeflame Sorcerer",this.iAttack=this.boof358,this.iHealth=this.boof5914,this.tribe.push("ZB");let e=": ",i=1;this.level<3&&(e=", destroy another friendly creature: ",i=.5);const s=`Destroy an enemy ${p.levelGateText(this.level+1,!0)}creature.`;this.text=`Activate${e}${s}`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),i)}}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){let e;this.level===3?e=this.enemies(t):e=this.friends(t),e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param),i=g.jr5(e[0]),s=g.ddf6(t);if(e[1]==="P1"){const h=this.enemies(i,s.id);h.push(S.cancelAction()),S.ddf5(h)}else{this.logAct(!0);const h=R.tick();if(this.level<3){const f=g.jr5(e[2]);U.destroy(f,this.code,h)}U.destroy(s,this.code,h),i.endActivation()}}friends(t){const e=y.crFriendNotMeActTarg("CARD",t.id,this.code,T.enTil(t.id,"P1"));return D.toActions(e)}enemies(t,e=""){const i=y.crEnemyActTarg("CARD",this.code,T.enTil(t.id,"P2",e));return i.level=D.ddf2(this.level+1),D.toActions(i)}}class $r extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Seismic Adept",this.iAttack=this.boof4712,this.iHealth=this.boof61218,this.tribe.push("HM"),this.text="Activate: Move an enemy creature to another available enemy lane.",this.bonus={activ8:this.rawNug(0,0,0,0,this.level*.5)}}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){const e=this.enemies(t);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param),i=g.jr5(e[1]);if(e[0]==="P1"){const s=g.ddf6(t),h=this.empties(i,s.id);h.push(S.cancelAction()),S.ddf5(h)}else{const s=g.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),i.endActivation()}}empties(t,e=""){const i=y.emptyPlayerActTarg("E","CARD",this.code,T.enTil("P2",t.id,e));return D.toActions(i)}enemies(t){const e=y.crEnemyActTarg("CARD",this.code,T.enTil("P1",t.id));return D.toActions(e)}}class Me extends M{constructor(t){super(t),this.rarity="R",this.iAttack=this.boof4612,this.iHealth=this.boof61016;const e=this.cardCode();if(e==="SSS"?this.steel():e==="LSS"?this.life():e==="FSS"?this.flame():e==="DSS"&&this.dark(),this.level>1){const i=p.levelGateText(this.level-1);this.text=`When you play a ${i} ${p.factionText(this.faction)} card, you may ${this.tuxt}.`}else this.hints=["LG"];this.tuxt=""}tuxt="";dark(){this.faction="N",this.name="Darkshaper Savant",this.tribe.push("ZB");const t=-this.boof135;this.tuxt=`give an enemy creature ${p.jr9(t,t)}`}life(){this.faction="U",this.name="Lifeshaper Savant",this.tribe.push("SE");const t=this.boof135;this.tuxt=`give another friendly creature ${p.jr9(t,t)}`}steel(){this.faction="A",this.name="Steelshaper Savant",this.tribe.push("HM"),this.tuxt=`give another friendly creature Armor ${this.boof124}`}flame(){this.faction="T",this.name="Flameshaper Savant",this.tribe.push("HM"),this.tuxt=`deal ${this.boof147} damage to target creature or player`}jr3(t,e){const i=super.jr3(t,e);if(this.level>1){const s=i.jr4("PC");s.interactive=!0,s.bonus=this.rawNug(0,0,0,0,this.level*.5)}return i}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;if(e.playerA===t.owner){const i=L.getCard(e.cardCode);if(i.level0}startActivation(t){const e=this.empties(t);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);g.birth(`${this.hc()}`,"P",t.playerA,t.lane),e.endActivation()}empties(t){const e=y.emptyPlayerActTarg("F","CARD",this.code,t.id);return D.toActions(e)}}class Vr extends M{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Sparkstone Elemental",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("LT","EL"),this.text="Negate Defender from each creature."}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){if(e.status==="A"){const s=y.mod("ND",!0,e.id);g.qActiveCreats().forEach(h=>h.addModSafe(s))}else g.qActiveCreats().forEach(s=>s.removeModSafe(e.id))}}class Or extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Spiritcleave",this.text=`Destroy a ${p.levelGateText(this.level+1,!0)}creature with the highest health among all creatures.${this.level===3?"~You gain health equal to that creature's health.":""}`}playTargets(){const t=super.playTargets();let e=-1;const i=g.qActiveCreats();i.forEach(f=>{f.health>e&&(e=f.health)});const s=i.filter(f=>f.health===e).map(f=>f.id),h=y.crActTarg("CARD",this.code,"");return h.level=D.ddf2(this.level+1),h.victims=T.enTil(...s),this.level<3&&(h.hint=["KL"]),t.push(h),t}handleAction(t){this.logSpell();const e=g.ddf6(t);U.destroy(e,this.code),this.level===3&&v.heal(v.getActiveB(),e.health),S.spellCast()}}class zr extends kt{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Spiritleash";const e=this.boof5814;this.text=`Destroy a friendly creature.~Give a creature ${p.jr9(e,e)}.`}playTargets(){const t=super.playTargets(),e=y.crFriendActTarg("CARD",this.code,"P1");return g.creatByTarget(e).length>0&&g.qActiveCreats().length>1&&t.push(e),t}handleAction(t){const e=T.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=y.crNotMeActTarg("CARD",i.id,this.code,T.enTil("P2",i.id));s.hint=["BF"];const h=D.toActions(s);h.push(S.cancelAction()),S.ddf5(h)}else{this.logSpell(i);const s=g.jr5(e[1]),h=this.boof5814;U.destroy(s,this.code),i.buff(h,h),S.spellCast()}}}class Zr extends M{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Spite Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.tribe.push("HY"),this.text=`When ${this.name} ${p.dbdtac()}, this gets ${p.jr9(this.level,this.level)}.~Allied Tempys: Activate: Deal ${this.level} damage to another creature. This gets ${p.jr9(this.level,this.level)}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),i}zapTargs(t){const e=y.crNotMeActTarg("CARD",t,this.code,t);return e.hint=["HR"],D.toActions([e,D.buttonTarget("CANC")])}canActivate(t){return this.zapTargs(t.id).length>1&&t.hasMod(t.id)}startActivation(t){S.ddf5(this.zapTargs(t.id))}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.logAct(!0),e.hurtDirect(this.level,this.code),i.buff(this.level,this.level),i.endActivation()}jr8(t){const e=g.jr5(t.creatId);if(t.trigger.type==="FR"){if(E.allied("T")){e.addMod(y.mod("AL",!0,e.id)),e.changed=!0;const i=e.jr4("PT");i.bonus=this.buffNug(this.boof246,this.level)}}else t.trigger.type==="DM"&&e.buff(this.level,this.level);x.triggerDone()}}class Yr extends M{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Statis Warden",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.text="When you play a spell, give a friendly creature Defender until the end of the enemy player's next turn."}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.interactive=!0,s.bonus=this.rawNug(0,0,0,0,.5),i}handleAction(t){const e=g.ddf6(t);this.logAct(!1,e);const i=y.mod("DF",!0,t.param);i.expiry="EN",e.addMod(i),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;return e.playerA===t.owner&&L.getCard(e.cardCode).type==="S"}return!1}jr8(t){const e=y.crFriendNotMeActTarg("CARD",t.creatId,this.code,t.creatId);e.canDefender=!0;const i=D.toActions(e);i.length===0?x.triggerDone():(i.push(S.noneEndTrigger()),S.ddf5(i))}}class Kr extends M{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Steeleye Researcher",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.hints=["RD"],this.text=`Upgrade: You may ${p.daluac()}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("UP");return s.interactive=!0,i}handleAction(t){E.levelAndDiscardA(t),S.actionDone(!0)}jr8(t){const e=y.lvlHandActTarg(this.code,t.creatId),i=D.toActions(e);i.length>0?(i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}}class Xr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steeleye Seer",this.iAttack=0,this.iHealth=this.lValN([8,12,18]),this.iDefend=!0,this.tribe.push("HM"),this.hints=["OL"],this.level===3?this.text="Activate: Level up a card in your hand. You may use this ability twice each turn.":this.text="Activate: Level a card in your hand, then discard it if its level is higher than your Rank.",this.bonus={activ8:this.rawNug(0,0,0,0,this.lValN([.8,1.7,3]))}}jr3(t,e){const i=super.jr3(t,e);return this.level===3&&(i.jr4("TS"),this.addExtraActivate(i)),i}jr8(t){if(t.trigger.type==="TS"){const e=g.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}canActivate(t){return v.toPlayer(t.owner).hand.some(i=>L.getCard(i).canLevel())}startActivation(t){const e=y.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),i=v.toPlayer(e.owner);this.level===3||i.rank>parseInt(t.card.slice(3))?i.hand[t.position]=L.getCard(t.card).levelUpCard():E.levelAndDiscardA(t),e.endActivation()}}class qr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steelscale Dragon",this.iAttack=this.boof4812,this.iHealth=this.iAttack+2,this.tribe.push("RB","DG"),this.iMobile=this.level;const e=this.boof246;this.addSp("M",e),this.text=`While each other friendly creature has Defender, ${this.name} gets ${p.jr9(this.iAttack,0)}, Armor ${e}, and Breakthrough.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("DF",this.code);s.area="C";const h=i.addEffect("PS",this.code);return h.area="C",i}enforceEffect(t,e){const i=y.crNotMeTarg(e.id);if(i.player=v.toTarget(e.owner),g.creatByTarget(i).some(h=>!h.defender))e.removeModSafe(e.id);else{const h=y.mod("AT",this.iAttack,e.id),f=y.mod("AR",this.boof246,e.id),m=y.mod("BT",!0,e.id);e.addModSafe(h),e.addModSafe(f),e.addModSafe(m)}}}class jr extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Storm Bringer",this.iAttack=this.boof5814,this.iHealth=this.boof61018,this.tribe.push("WN","EL");const e=this.boof246;this.addSp("D",e),this.text=`At the start of each turn, ${this.name} moves to an available lane at random. Flank: Deal ${e} damage to the opposing creature.`}jr3(t,e){const i=this.boof246,s=super.jr3(t,e),h=s.jr4("TS");h.bonus=this.rawNug(0,0,i,0,.2);const f=s.jr4("FK");return f.bonus=this.buffNug(i,0),s}ddf8(t){return t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="TS"){const e=g.emptyLanes(t.owner);e.length>0&&g.jr5(t.creatId).move(e[T.randInt(0,e.length)]),x.triggerDone()}else if(t.trigger.type==="FK"){const i=V.toCreature(t.event).creature.opposed;i&&i.hurtDirect(this.boof246,this.code),x.triggerDone()}else super.jr8(t)}}class Jr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Sulgrim, Herald of Force",this.iAttack=15,this.iHealth=15,this.tribe.push("GL"),this.addSp("M",6),this.bonus={activ8:this.buffNug(6,0)},this.text="Activate: Deal damage equal to a friendly creature's Armor to an enemy creature.~Forge: Each friendly creature gets Armor 6."}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param),i=g.ddf6(t);if(e[1]==="P1"){const s=this.enemies(e[0],i.id);s.push(S.cancelAction()),S.ddf5(s)}else if(e[1]==="P2"){const s=g.jr5(e[0]),h=g.jr5(e[2]);this.logAct(!0,h),i.hurtDirect(h.armor,this.code),s.endActivation()}}jr8(t){g.ddf1().forEach(e=>e.addArmor(6)),x.triggerDone()}friends(t){const e=y.crFriendActTarg("CARD",this.code,T.enTil(t,"P1"));return e.hasArmor=!0,D.toActions(e)}enemies(t,e=""){const i=y.crEnemyActTarg("CARD",this.code,T.enTil(t,"P2",e));return D.toActions(i)}}class Qr extends M{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Synapsis Oracle",this.iAttack=this.boof358,this.iHealth=this.lValN([9,15,24]),this.tribe.push("HM"),this.hints=["OL"];let e;this.level===3?(this.text="Activate: Level up a card in your hand.",e=1):(this.text=`Activate: ${p.daluac(!0)}.`,e=.5),this.bonus={activ8:this.rawNug(0,0,0,0,e)}}canActivate(t){return v.toPlayer(t.owner).hand.some(i=>L.getCard(i).canLevel())}startActivation(t){const e=y.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),S.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),i=v.toPlayer(e.owner);this.level===3?i.hand[t.position]=L.getCard(t.card).levelUpCard():E.levelAndDiscardA(t),e.endActivation()}}class _r extends vt{jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){if(t.trigger.type==="FR"){const e=t.owner?E.deathsA.length:E.deathsB.length;if(e>0){const i=R.tick();for(let s=0;s0}}class es extends M{constructor(t){super(t),this.rarity="C",this.faction="U",this.name="Toorgmai Mender",this.tribe.push("PL"),this.iAttack=this.lValN([2,5,9]),this.iHealth=this.iAttack+3,this.text=`Forge: Give a creature or player ${p.jr9(0,this.iHealth)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){const e=y.crActTarg("CARD",this.code,"");e.hint=["BF"];const i=y.actionTarget("TP","CARD",this.code,"");i.hint=["BF"];const s=[e,i,D.buttonTarget("NOTR")],h=D.toActions(s);S.ddf5(h)}handleAction(t){if(t.zone==="P")v.heal(t.playerA,this.iHealth);else{const e=g.ddf6(t);this.logAct(!1,e),e.buff(0,this.iHealth)}S.actionDone(!0)}}class Ye extends M{lookup(t){return{["SSD"]:{c:()=>this.ssdC(),t:i=>this.ssdT(i)},["SOL"]:{c:()=>this.stagC(),t:i=>this.stagT(i)},["WTK"]:{c:()=>this.tinkC(),t:i=>this.tinkT(i)}}[t]}mPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("TE");return s.bonus=this.trigB,i}ddf8(t){return t.trigger.type==="TE"&&this.validPlayer(t)}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=t.event;return this.mPlayer===1?e.playerA===t.owner:e.playerA!==t.owner}ssdC(){this.faction="T",this.rarity="L",this.name="Smolderscale Dragon",this.iAttack=this.lValN([0,3,15]),this.iHealth=this.lValN([6,13,30]),this.tribe.push("DG"),this.level===3?this.iMobile=2:(this.hints=["LG"],this.iDefend=!0),this.mPlayer=1;const t=this.boof135;this.trigB=this.buffNug(t*2,0),this.text=`At the end of your turn, deal ${t} damage to each enemy creature.`}ssdT(t){const e=g.qEnemyCreats();if(e.length>0){const i=R.tick(),s=this.boof135;e.forEach(h=>h.hurtDirect(s,this.code,i))}}stagC(){this.faction="U",this.rarity="C",this.name="Stag of Lys",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("ST"),this.mPlayer=1;const t=this.boof246;this.trigB=this.playerNug(t),this.text=`At the end of your turn, gain ${t} health.`}stagT(t){v.heal(t.owner,this.boof246)}tinkC(){this.faction="A",this.rarity="H",this.name="War Tinker",this.iAttack=this.level,this.iHealth=this.boof4812,this.tribe.push("GN"),this.mPlayer=-1,this.trigB=this.avgSpawnNug(),this.text=`At the end of the enemy player's turn, replace ${this.name} with a copy of a random Robot from your deck.`}tinkT(t){const e=y.target("DK");e.player=v.toTarget(t.owner),e.tribe="RB";const i=D.deckByTarget(e),s=i.length;if(s>0){const h=i[T.randInt(0,s)][0],f=g.jr5(t.creatId);g.birth(h,"R",f.owner,f.lane)}}}class Vt extends M{lookup(t){return{["DCS"]:{c:()=>this.delphC(),t:i=>this.delphT(i)},["GMP"]:{c:()=>this.gmpC(),t:i=>this.gmpT(i)},["LBL"]:{c:()=>this.lbcC(),t:i=>this.lbcT(i)},["SBF"]:{c:()=>this.sfangC(),t:i=>this.sfangT(i)},["SSE"]:{c:()=>this.sseC(),t:i=>this.sseT(i)},["SPD"]:{c:()=>this.spdC(),t:i=>this.spdT(i)},["SPM"]:{c:()=>this.spmC(),t:i=>this.spmT(i)},["TBA"]:{c:()=>this.tbaC(),t:i=>this.tbaT(i)},["VCG"]:{c:()=>this.vgC(),t:i=>this.vgT(i)},["WBG"]:{c:()=>this.woeC(),t:i=>this.woeT(i)},["ZSH"]:{c:()=>this.zyxC(),t:i=>this.zyxT(i)}}[t]}bothTurns=!1;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("TS");s.bonus=this.trigB;const h=Dt.extractCardCode(this.code);return(h==="ZSH"||h==="SBF")&&(i.extraBattles=1),i}ddf8(t){return t.trigger.type==="TS"?this.bothTurns?!0:t.event.playerA===t.owner:!1}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}delphC(){this.faction="A",this.rarity="L",this.name="Delpha, Chronosculptor",this.iAttack=this.boof7914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.level>1&&(this.hints=["OL"],this.trigB=this.buffNug(5,4),this.text=`At the start of your turn, level a ${this.level===2?"level 1 ":""}card in your hand at random.`)}delphT(t){if(this.level>1){const e=v.toPlayer(t.owner),i=e.hand.map((h,f)=>{const m=L.getCard(h);return{idx:f,lvl:m.level,nxt:m.canLevel()?m.levelUpCard():""}}).filter(h=>h.nxt&&(this.level===3||h.lvl===1)),s=i.length;if(s>0){const h=i[T.randInt(0,s)];e.hand[h.idx]=h.nxt}}}gmpC(){this.faction="A",this.rarity="L",this.name="Ghox, Metamind Paragon",this.iAttack=this.boof4814,this.iHealth=this.boof61218,this.tribe.push("MM"),this.hints=["OL"];const t=this.level===1?"":"s";this.trigB=this.rawNug(0,0,0,0,this.level*ht.dcWeight),this.text=`At the start of your turn, draw ${this.level} card${t}.`}gmpT(t){v.drawCard(t.owner,this.level)}lbcC(){this.faction="U",this.rarity="R",this.name="Lightbringer Cleric",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hints=["OL"],this.trigB=this.playerNug(this.boof3610),this.text=`At the start of your turn, you gain ${this.boof137} to ${this.boof5914-1} health.`}lbcT(t){v.heal(t.owner,T.randInt(this.boof137,this.boof5914))}sfangC(){this.faction="T",this.rarity="H",this.name="Saberfang",this.iAttack=this.boof246,this.iHealth=1,this.iAggro=!0,this.tribe.push("CT"),this.trigB=this.buffNug(this.iAttack,0),this.text=`${this.name} battles an additional time on your turn.`}sfangT(t){const e=g.jr5(t.creatId);e.extraBattles+=1}sseC(){this.faction="U",this.rarity="L",this.name="Scatterspore Eidolon",this.iAttack=8,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level<3&&(this.hints=["LB"]);const t=this.boof357,e=z.minionName(this.level);this.trigB=this.statSpawnNug(t,t),this.text=`At the start of your turn, Spawn a ${t}/${t} ${e}.`}sseT(t){const e=this.lValS(["SXD","SXP","SXT"])+this.level.toString();g.birth(e,"S",t.owner)}spdC(){this.faction="U",this.rarity="R",this.name="Shardplate Delver",this.iAttack=this.boof4612,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OL"];const t=this.boof246;this.trigB=this.buffNug(t,t),this.text=`At the start of your turn, ${this.name} gets ${p.jr9(t,t)}.`}spdT(t){const e=this.boof246;g.jr5(t.creatId).buff(e,e)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.iAttack=this.boof91421,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["OP"],this.trigB=this.rawNug(0,0,0,0,this.lValN([-1.5,-2.1,-3])),this.text="At the start of your turn, randomly discard down to two cards in your hand."}spmT(t){const e=v.toPlayer(t.owner);if(e.hand.length>2){let i=e.hand.slice(),s=[];for(;i.length>2;)s.push(i.splice(T.randInt(0,i.length),1)[0]);e.discard.push(...s),e.hand=i}}tbaC(){this.faction="U",this.rarity="L",this.name="Talisin, Bard of Abundance",this.iAttack=this.lValN([8,12,16]),this.iHealth=this.lValN([10,14,20]),this.tribe.push("SY"),this.bothTurns=this.lValB([!0,!0,!1]),this.hints=["OL"],this.level===3?this.trigB=this.multNug(this.avgSpawnNug(),.5):this.hints.push("LG","ZZ-3"),this.text=`At the start of ${this.bothTurns?"each player's":"your"} turn, ${this.bothTurns?"that player":"you"} may play an additional card.`}tbaT(t){E.regularPlays+=1}vgC(){this.faction="T",this.rarity="C",this.name="Volcanic Giant",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("ER","GT"),this.hints=["OL"],this.trigB=this.playerNug(this.boof3610),this.text=`At the start of your turn, deals ${this.boof137} to ${this.boof5914-1} damage to the enemy player.`}vgT(t){const e=T.randInt(this.boof137,this.boof5914);v.hurtDirect(!t.owner,e,this.code)}woeC(){this.faction="N",this.rarity="L",this.name="Woebringer",this.iAttack=this.lValN([7,10,18]),this.iHealth=this.boof5815,this.tribe.push("AB"),this.text=`At the start of your turn, destroy the ${this.level===3?"enemy ":""}creature with the lowest attack. If there is a tie, one is chosen at random.`}woeT(t){const e=y.crTarg();this.level===3&&(e.player=v.toTarget(!t.owner));const i=g.creatByTarget(e);let s=99999,h=[];i.forEach(m=>{m.attack===s?h.push(m):m.attack0){const m=h[T.randInt(0,f)];U.destroy(m,this.code)}}zyxC(){this.faction="T",this.rarity="L",this.name="Zyx, Storm Herald",this.iAttack=this.boof4712,this.iHealth=this.lValN([6,9,20]),this.iMobile=1,this.tribe.push("LT","AS"),this.text="Zyx battles an additional time on your turn.",this.trigB=this.buffNug(this.iAttack,0)}zyxT(t){const e=g.jr5(t.creatId);e.extraBattles+=1}}class is extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Tuskin Sporelord",this.iAttack=this.lValN([2,6,10]),this.iHealth=this.lValN([10,14,18]),this.tribe.push("TK"),this.text=`Activate: Put a copy of friendly ${p.levelGateText(this.level,!0)}Plant into an available lane.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.5)}}canActivate(t){return this.emptySloots(t.id).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=this.emptySloots(e[1],i.code);s.push(S.cancelAction()),S.ddf5(s)}else{const i=g.jr5(e[1]),s=g.birth(e[2],"P",i.owner,t.lane);this.logAct(!0,s),i.endActivation()}}emptySloots(t,e=""){const i=y.emptyPlayerActTarg("F","CARD",this.code,T.enTil("P2",t,e));return D.toActions(i)}buddies(t){const e=y.crFriendActTarg("CARD",this.code,T.enTil("P1",t));return e.tribe="PL",e.level=D.ddf2(this.level),D.toActions(e)}}class hi extends kt{constructor(t){super(t),this.faction="A",t==="PRI"+"1"?(this.rarity="R",this.name="Perilous Insight",this.maxLevel=1,this.overload=!0):(this.rarity="C",this.name="Metasight",this.maxLevel=2,this.isFree=this.level===2),this.text="Discard and level up two cards."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(S.shiftPlayCard(t.position),t.param==="P1"){this.logSpell(),E.levelAndDiscardA(t);const e=this.targParty("P2"),i=D.toActions(e);i.length===0?S.spellCast():S.ddf5(i)}else E.levelAndDiscardA(t),S.spellCast()}targParty(t){const e=y.lvlHandActTarg(this.code,t);return e.deckPositionSkip=S.playPosition(),e}}class Re extends kt{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(i,s)=>this.confZ(i,s)},["CSG"]:{c:()=>this.cystgC(),z:(i,s)=>this.cystgZ(i,s)},["GRN"]:{c:()=>this.grenC(),z:(i,s)=>this.grenZ(i,s)},["TWG"]:{c:()=>this.twstrC(),z:(i,s)=>this.twstrZ(i,s)}}[t]}cardCast(t,e,i){this.lookup(t).z(e,i)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",g.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const e=T.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){this.playTarg.notMe=i.id,this.playTarg.param=T.enTil("P2",i.id);const s=D.toActions([this.playTarg,D.buttonTarget("CANC")]);S.ddf5(s)}else{const s=g.jr5(e[1]);this.xl?this.logSpell(s,i):this.logSpell(),this.cardCast(this.cardCode(),s,i),S.spellCast()}}confC(){this.faction="T",this.rarity="C",this.name="Conflagrate",this.xl=!1,this.text=`Deal ${this.boof369} to two enemy creatures.`,this.playTarg.player="E"}confZ(t,e){const i=R.tick(),s=this.boof369;t.hurtDirect(s,this.code,i),e.hurtDirect(s,this.code,i)}cystgC(){this.faction="A",this.rarity="C",this.name="Cypien Steelgraft",this.text=`Two friendly creatures get Armor ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canArmor=!0}cystgZ(t,e){const i=this.boof246;t.addArmor(i),e.addArmor(i)}grenC(){this.faction="N",this.rarity="C",this.name="Ghastly Renewal",this.text=`Give two friendly creatures Regenerate ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canRegen=!0}grenZ(t,e){const i=this.boof246;t.addRegen(i),e.addRegen(i)}get tsboof(){return this.level+2}twstrC(){this.faction="U",this.rarity="C",this.name="Twinstrength";const t=this.tsboof;this.text=`Two friendly creatures get ${p.jr9(t,t)}.`,this.playTarg.player="F"}twstrZ(t,e){const i=this.tsboof;t.buff(i,i),e.buff(i,i)}}class rs extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Umbruk Icecrusher",this.iAttack=this.boof61014,this.iHealth=this.boof246,this.tribe.push("DN"),this.text=`When ${this.name} ${p.dbdtap()}, deal that much damage to that player.~Allied Uterra: This gets ${p.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.bonus=this.playerNug(this.boof357),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR"){if(E.allied("U")){const e=g.jr5(t.creatId);e.breakthrough=!0,e.buff(2,2)}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event;v.hurtDirect(e.target,e.dmg,this.code),x.triggerDone()}}}class ss extends M{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Umbruk Lasher",this.iAttack=this.boof71014,this.iHealth=this.iAttack-1,this.iBT=!0,this.tribe.push("DN"),this.text=`Allied Tempys: When ${this.name} ${p.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}handleAction(t){g.ddf6(t).hurtDirect(parseInt(t.param),this.code),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=V.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===v.getActiveB()}return!1}jr8(t){if(t.trigger.type==="FR"){if(E.allied("T")){const e=g.jr5(t.creatId),i=e.jr4("DM");i.interactive=!0,i.bonus=this.buffNug(this.iAttack,0),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,i=D.toActions(y.crEnemyActTarg("CARD",this.code,e.dmg.toString()));i.length>0?(i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}}}class Ee extends M{lookup(t){return{["CBB"]:{c:()=>this.cindC(),f:i=>this.cindF(i)},["EBW"]:{c:()=>this.ebwC(),f:i=>this.ebwF(i)},["IBR"]:{c:()=>this.ibrfC(),f:i=>this.ibrfF(i)},["SBI"]:{c:()=>this.sbiC(),f:i=>this.sbiF(i)}}[t]}targAction(t,e){this.lookup(t).f(e)}enemy=!1;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text=`Forge: If you are rank ${this.level+1} or higher, `+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}handleAction(t){const e=g.ddf6(t);this.targAction(this.cardCode(),e),S.actionDone(!0)}jr8(t){if(g.jr5(t.creatId).rank>this.level){const i=y.crActTarg("CARD",this.code,t.creatId);this.enemy?i.player="E":i.hint=["BF"];const s=D.toActions(i);s.length>0?S.ddf5(s):x.triggerDone()}else x.triggerDone()}ebwC(){this.faction="N",this.rarity="C",this.name="Ebonbound Warlord",this.iAttack=this.boof3714,this.iHealth=this.iAttack+4,this.tribe.push("VP"),this.enemy=!0;const t=this.boof369n;this.ftext=`give an enemy creature ${p.jr9(t,t)}.`}ebwF(t){this.logAct(!1,t);const e=this.boof369n;t.buff(e,e)}sbiC(){this.faction="U",this.rarity="C",this.name="Shardbound Invoker",this.iAttack=this.boof4714,this.iHealth=this.iAttack+1,this.tribe.push("TK");const t=this.boof359;this.ftext=`give a creature ${p.jr9(t,t)}.`}sbiF(t){this.logAct(!1,t);const e=this.boof359;t.buff(e,e)}cindC(){this.faction="T",this.rarity="C",this.name="Cinderbound Barbarian",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("FR","AS");const t=this.boof6912;this.enemy=!0,this.ftext=`deal ${t} damage to an enemy creature.`}cindF(t){t.hurtDirect(this.boof6912,this.code)}ibrfC(){this.faction="A",this.rarity="C",this.name="Ironbound Reinforcements",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("GN");const t=this.boof5812;this.ftext=`give a creature ${p.jr9(t,0)}.`}ibrfF(t){this.logAct(!1,t),t.buff(this.boof5812,0)}}class as extends M{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Uranti Elementalist",this.iAttack=this.boof4712,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.text=`Forge: You may move another friendly creature to an available lane adjacent to ${this.name}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){const e=g.jr5(t.creatId);if(this.emptySloots(e).length>0){const i=y.crFriendNotMeActTarg("CARD",e.id,this.code,T.enTil("P1",e.id)),s=D.toActions(i);s.length>0?(s.push(S.noneEndTrigger()),S.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=g.jr5(e[1]),h=this.emptySloots(s,i.id);h.push(S.cancelAction()),S.ddf5(h)}else{const i=g.jr5(e[1]);this.logAct(!1,i),i.move(t.lane),S.actionDone(!0)}}emptySloots(t,e=""){return S.emptyAdjacents(t,T.enTil("P2",e))}}class ns extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Uranti Heartseeker",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("YT"),this.addSp("D",this.iAttack),this.text=`Activate: Deal ${this.iAttack} damage to an enemy creature or player with exactly ${this.iAttack} health.`,this.bonus={activ8:this.buffNug(this.iAttack/2,0)}}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){const e=this.findVictims(t.id);e.push(S.cancelAction()),S.ddf5(e)}handleAction(t){if(t.zone==="F"){const i=g.ddf6(t);this.logAct(!0,i),i.hurtDirect(this.iAttack,this.code)}else{this.logAct(!0);const i=t;v.hurtDirect(i.playerA,this.iAttack,this.code)}g.jr5(t.param).endActivation()}findVictims(t){const e=this.iAttack,i=y.crEnemyTarg(),h=g.creatByTarget(i).filter(m=>m.health===e).map(m=>y.fieldSelectAction("CARD",m.lane,m.owner)),f=v.toPlayer("E");return f.health===e&&h.push(y.playerSelectAction("CARD",f.isPlayerA)),h.forEach(m=>{m.host=this.code,m.param=t}),h}}class os extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Vaerus, Herald of Fury",this.iAttack=15,this.iHealth=12,this.iMobile=2,this.tribe.push("DG"),this.hints=["OL"],this.text="Each friendly creature battles an additional time on each of your turns."}jr3(t,e){const i=super.jr3(t,e);i.jr4("EF");const s=i.jr4("TS");return s.bonus=this.buffNug(20,0),i}ddf8(t){if(t.event.code==="ENT"){const e=V.toCreature(t.event);return t.owner===e.creature.owner&&t.owner===v.getActiveB()}else if(t.event.code==="TRS")return t.event.playerA===t.owner;return!1}giveXtra(t,e){t.hasMod(e)||(t.extraBattles+=1,t.addMod(y.mod("TK",!0,e)))}jr8(t){if(t.event.code==="ENT"){const e=V.toCreature(t.event);e.creature.id===t.creatId?g.ddf1().forEach(i=>{this.giveXtra(i,t.creatId)}):vt.itBirthedFirst(e.creature.id,t.creatId)&&this.giveXtra(e.creature,t.creatId)}else t.event.code==="TRS"&&g.ddf1().forEach(e=>{e.extraBattles+=1,e.hasMod(t.creatId)||e.addMod(y.mod("TK",!0,t.creatId))});x.triggerDone()}}class W extends M{constructor(t){super(t),this.cardConstruct(this.cardCode())}cardConstruct(t){({["AEN"]:()=>this.anvenf(),["AGU"]:()=>this.avguard(),["BTH"]:()=>this.batthid(),["BBB"]:()=>this.bart(),["BLW"]:()=>this.blitwi(),["BWG"]:()=>this.brambleguard(),["CHY"]:()=>this.cavernhyd(),["CDC"]:()=>this.cindcol(),["CNM"]:()=>this.cindmy(),["CTG"]:()=>this.citg(),["CWK"]:()=>this.crag(),["DBP"]:()=>this.prowler(),["DMR"]:()=>this.raptor(),["DBR"]:()=>this.bearride(),["DTD"]:()=>this.dmaw(),["DSZ"]:()=>this.duskzomb(),["FWB"]:()=>this.fangbear(),["FWR"]:()=>this.ravager(),["FFG"]:()=>this.ffang(),["FMS"]:()=>this.firemane(),["FPR"]:()=>this.flop(),["FGA"]:()=>this.falpha(),["FGB"]:()=>this.fbeta(),["FGO"]:()=>this.fomega(),["FPM"]:()=>this.minot(),["FPS"]:()=>this.forgeplate(),["GGE"]:()=>this.geist(),["GGH"]:()=>this.ghast(),["GGS"]:()=>this.ggs(),["GCL"]:()=>this.glacial(),["IWC"]:()=>this.warcharger(),["LWY"]:()=>this.lwyrm(),["LHY"]:()=>this.lyshyd(),["KDC"]:()=>this.kadc(),["MRF"]:()=>this.marrow(),["MMI"]:()=>this.mmin(),["MMO"]:()=>this.mmop(),["NGW"]:()=>this.narg(),["NCW"]:()=>this.necrotic(),["NXC"]:()=>this.nexcore(),["NAM"]:()=>this.nyam(),["OBD"]:()=>this.battledroid(),["OSP"]:()=>this.oss(),["OSL"]:()=>this.ogsl(),["PRG"]:()=>this.perd(),["RHY"]:()=>this.ravh(),["RHC"]:()=>this.rime(),["RSP"]:()=>this.runprim(),["SCS"]:()=>this.scorp(),["SCD"]:()=>this.scout(),["SFT"]:()=>this.scrap(),["SBA"]:()=>this.sparkblade(),["SKB"]:()=>this.sparkbot(),["SBR"]:()=>this.sparkass(),["STM"]:()=>this.sparkman(),["SSN"]:()=>this.sfsent(),["SMN"]:()=>this.steam(),["SGI"]:()=>this.stonefist(),["SCL"]:()=>this.stormcall(),["SMA"]:()=>this.ancient(),["SML"]:()=>this.lurker(),["TGS"]:()=>this.tsprout(),["TGN"]:()=>this.tgnome(),["TWS"]:()=>this.tscout(),["TWT"]:()=>this.tund(),["URD"]:()=>this.unrelenting(),["VBK"]:()=>this.vblock(),["VTC"]:()=>this.vtech(),["WTW"]:()=>this.waterwalk(),["WPD"]:()=>this.windprime(),["XCR"]:()=>this.xithcrush(),["XHU"]:()=>this.hulk(),["YWC"]:()=>this.yetiwar(),["ZIN"]:()=>this.zombinf()})[t]()}sist(){this.rarity="R",this.level===1?this.hints=["LG"]:this.consistent=!0}ancient(){this.faction="U",this.rarity="C",this.name="Swampmoss Ancient",this.iAttack=this.lValN([7,12]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=[this.level===1?"ZZ-1":"ZZ-2"],this.maxLevel=2}anvenf(){this.faction="A",this.rarity="C",this.name="Anvillon Enforcer",this.iAttack=this.boof5711,this.iHealth=this.iAttack-1,this.iArmor=this.boof246,this.tribe.push("RB")}avguard(){this.faction="T",this.rarity="R",this.name="Avalanche Guardian",this.iAttack=this.boof5915,this.iHealth=this.lValN([8,15,23]),this.iMobile=1,this.iDefend=!0,this.tribe.push("IC","EL")}bart(){this.faction="U",this.rarity="H",this.name="Big Bad Bartok",this.iAttack=this.level+8,this.iHealth=this.iAttack,this.consistent=!0,this.level<3&&(this.hints=["LB"]),this.tribe.push("TG")}batthid(){this.faction="U",this.name="Batterhide",this.iAttack=this.boof3814,this.iHealth=this.iAttack+3,this.sist(),this.iBT=!0,this.tribe.push("DN")}battledroid(){this.faction="A",this.rarity="H",this.name="Oreian Battledroid",this.iAttack=this.lValN([5,7,17]),this.iHealth=1,this.iArmor=this.iAttack,this.tribe.push("RB")}bearride(){this.faction="U",this.rarity="C",this.name="Deepwood Bear Rider",this.iAttack=this.lValN([5,16,18]),this.iHealth=this.lValN([2,8,10]),this.tribe.push("LP"),this.level===2&&(this.hints=["LB"])}blitwi(){this.faction="N",this.name="Blight Witch",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.boof71117,this.sist(),this.iRegen=this.boof234,this.tribe.push("ZB")}brambleguard(){this.faction="U",this.rarity="C",this.name="Bramblewood Guardian",this.iAttack=this.boof2612,this.iHealth=this.lValN([9,14,24]),this.tribe.push("PL")}cavernhyd(){this.faction="U",this.rarity="C",this.name="Cavern Hydra",this.iAttack=this.boof4711,this.iHealth=this.boof71015,this.iRegen=this.boof135,this.tribe.push("HY")}cindcol(){this.faction="T",this.rarity="C",this.name="Cinder Colossus",this.iAttack=this.lValN([3,13,24]),this.iHealth=this.lValN([4,14,27]),this.iDefend=!0,this.level===1&&(this.hints=["LG"]),this.tribe.push("ER","EL")}cindmy(){this.faction="T",this.rarity="C",this.name="Cinder Mystic",this.iAttack=this.lValN([4,11,21]),this.iHealth=this.boof3714,this.tribe.push("FR","AS")}citg(){this.faction="A",this.rarity="C",this.name="Citadel Guard",this.iAttack=this.lValN([8,12,25]),this.iHealth=this.lValN([9,13,30]),this.iDefend=!0,this.hints=[this.level===3?"ZZ-5":"ZZ-1"],this.tribe.push("RB")}crag(){this.faction="T",this.rarity="C",this.name="Crag Walker",this.iAttack=this.lValN([7,12,18]),this.iHealth=this.boof246,this.iMobile=1,this.tribe.push("DN")}dmaw(){this.faction="N",this.rarity="L",this.name="Duskmaw, Twilight Drake",this.iAttack=this.boof61017,this.iHealth=this.boof5915,this.iMobile=1,this.tribe.push("ST","DG")}duskzomb(){this.faction="N",this.rarity="C",this.name="Duskspire Zombie",this.iAttack=this.lValN([2,5,16]),this.iHealth=this.lValN([5,8,19]),this.iRegen=4,this.tribe.push("ZB")}falpha(){this.faction="A",this.rarity="C",this.name="Forge Guardian Alpha",this.iAttack=this.lValN([4,8,20]),this.iHealth=this.lValN([8,14,26]),this.iDefend=!0,this.tribe.push("RB","GD")}fangbear(){this.faction="U",this.rarity="C",this.name="Fangwood Bear",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("BR")}fbeta(){this.faction="A",this.rarity="R",this.name="Forge Guardian Beta",this.iAttack=this.lValN([5,8,20]),this.iHealth=this.lValN([3,6,18]),this.iArmor=this.boof124,this.tribe.push("RB","GD"),this.level===3&&(this.hints=["ZZ-3"])}ffang(){this.faction="U",this.rarity="C",this.name="Featherfang",this.iAttack=this.boof61218,this.iHealth=this.boof4812,this.tribe.push("DN")}firemane(){this.faction="T",this.rarity="C",this.name="Firemane Steed",this.iAttack=this.lValN([3,6,16]),this.iHealth=this.lValN([6,9,19]),this.iMobile=2,this.tribe.push("FR","EL")}flop(){this.faction="T",this.rarity="C",this.name="Flowstone Primordial",this.iAttack=this.lValN([6,7,15]),this.iHealth=this.iAttack+1,this.tribe.push("FR","EL")}fomega(){this.faction="A",this.rarity="L",this.name="Forge Guardian Omega",this.iAttack=this.boof255080,this.iHealth=this.iAttack,this.iMobile=this.boof124,this.iArmor=this.iMobile*10,this.iBT=!0,this.iAggro=!0,this.consistent=!0,this.tribe.push("RB","GD")}forgeplate(){this.faction="A",this.rarity="C",this.name="Forgeplate Sentry",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iArmor=this.boof135,this.tribe.push("RB")}ggs(){this.faction="N",this.rarity="C",this.name="Grimgaunt Spectre",this.iAttack=this.lValN([3,11,14]),this.iHealth=this.iAttack,this.iMobile=1,this.level===1?this.hints=["LG"]:this.level===2&&(this.hints=["LB"]),this.tribe.push("GG")}geist(){this.faction="N",this.rarity="C",this.name="Grave Geist",this.iAttack=this.boof71118,this.iHealth=this.boof4711,this.tribe.push("ST")}ghast(){this.faction="N",this.rarity="C",this.name="Grave Ghast",this.iHealth=this.boof71013,this.iAttack=this.iHealth-2,this.iRegen=this.boof246,this.tribe.push("ZB")}glacial(){this.faction="T",this.rarity="C",this.name="Glacial Colossus",this.iAttack=this.boof61016,this.iHealth=this.lValN([8,13,19]),this.tribe.push("IC","EL"),this.iDefend=!0}hulk(){this.faction="N",this.rarity="C",this.name="Xithian Hulk",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("AB")}kadc(){this.faction="T",this.rarity="C",this.name="Kadras Colossus",this.iAttack=this.lValN([6,11,13]),this.iHealth=this.iAttack,this.tribe.push("GT"),this.level<3&&(this.hints=["LB"],this.level===1&&this.hints.push("ZZ+1"))}lurker(){this.faction="U",this.rarity="C",this.name="Swampmoss Lurker",this.iAttack=this.lValN([8,13,22]),this.iHealth=this.lValN([4,6,15]),this.tribe.push("DN"),this.level===3?this.hints=["ZZ-5"]:this.hints=["ZZ-1"]}lwyrm(){this.faction="T",this.rarity="C",this.name="Lightning Wyrm",this.iAttack=this.boof4711,this.iHealth=this.boof258,this.tribe.push("LT","EL"),this.iAggro=!0}lyshyd(){this.faction="U",this.rarity="C",this.name="Lysian Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.level,this.tribe.push("HY")}marrow(){this.faction="N",this.rarity="C",this.name="Marrow Fiend",this.iAttack=this.boof81117,this.iHealth=this.lValN([1,5,13]),this.tribe.push("SK")}minot(){this.faction="A",this.name="Forgeplate Minotaur",this.iAttack=this.lValN([2,8,16]),this.iHealth=this.lValN([4,9,17]),this.sist(),this.iArmor=this.level,this.tribe.push("RB")}mmin(){this.faction="A",this.rarity="C",this.name="Metamind Infiltrator",this.iAttack=this.boof5917,this.iHealth=this.iAttack-1,this.tribe.push("MM")}mmop(){this.faction="A",this.rarity="C",this.name="Metamind Operator",this.iAttack=this.boof4610,this.iHealth=this.lValN([10,14,18]),this.tribe.push("MM")}narg(){this.faction="T",this.rarity="C",this.name="Nargath Warrior",this.iAttack=this.boof51014,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS")}necrotic(){this.faction="N",this.rarity="C",this.name="Necrotic Wurm",this.iAttack=this.lValN([4,7,18]),this.iHealth=this.lValN([5,8,19]),this.tribe.push("WR")}nexcore(){this.faction="A",this.rarity="C",this.name="Nexus Core",this.iAttack=0,this.iHealth=this.lValN([15,25,40]),this.tribe.push("RB"),this.iDefend=!0}nyam(){this.faction="N",this.rarity="C",this.name="Nyrali Ambusher",this.iAttack=this.boof71117,this.iHealth=this.lValN([3,6,13]),this.tribe.push("OZ")}ogsl(){this.faction="U",this.rarity="C",this.name="Overgrown Spineleaf",this.iAttack=this.lValN([6,12,16]),this.iHealth=this.boof4812,this.tribe.push("PL")}oss(){this.faction="N",this.rarity="R",this.name="Ossuary Spirit",this.iAttack=this.lValN([1,3,6]),this.iHealth=this.boof91420,this.iRegen=this.iAttack+2,this.tribe.push("ST")}perd(){this.faction="N",this.rarity="C",this.name="Perdition Guard",this.iAttack=this.lValN([3,12,15]),this.iHealth=this.iAttack-1,this.tribe.push("NG"),this.level===1?this.hints=["LG","ZZ-1"]:this.level===2&&(this.hints=["LB"])}prowler(){this.faction="U",this.rarity="C",this.name="Deepbranch Prowler",this.iAttack=this.lValN([8,9,10]),this.iHealth=this.iAttack,this.tribe.push("CT"),this.level<3&&(this.hints=["LB"]),this.iBT=!0}raptor(){this.faction="U",this.rarity="C",this.name="Deepmoss Raptor",this.iAttack=this.lValN([2,13,16]),this.iHealth=this.iAttack,this.level===1?this.hints=["LG","RT"]:this.level===2&&(this.hints=["LB"]),this.tribe.push("DN")}ravager(){this.faction="U",this.rarity="C",this.name="Fangwood Ravager",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("BE")}ravh(){this.faction="U",this.rarity="C",this.name="Ravenous Hydra",this.iAttack=this.boof5813,this.iHealth=this.iAttack+this.level,this.iRegen=this.level,this.iBT=!0,this.tribe.push("HY")}rime(){this.faction="T",this.rarity="C",this.name="Rimehorn Charger",this.iAttack=this.lValN([5,8,10]),this.iHealth=this.iAttack+3,this.iMobile=1,this.level<3&&(this.hints=["LB"]),this.tribe.push("RM")}runprim(){this.faction="T",this.name="Runestorm Primordial",this.iAttack=this.boof3714,this.iHealth=this.iAttack-1,this.sist(),this.iAggro=!0,this.tribe.push("LT","EL")}scorp(){this.faction="N",this.rarity="C",this.name="Scavenger Scorpion",this.iAttack=this.lValN([6,9,11]),this.iHealth=this.iAttack,this.iRegen=this.level,this.level<3&&(this.hints=["LB"]),this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.isFree=this.level>1,this.level<3&&(this.hints=[this.level===1?"LG":"LB"]),this.tribe.push("RB")}scrap(){this.faction="A",this.rarity="H",this.name="Scrapforge Titan",this.iAttack=this.lValN([1,5,20]),this.iHealth=this.iAttack,this.iArmor=this.lValN([1,5,10]),this.level===1&&(this.hints=["LG","LM","RT"]),this.tribe.push("RB")}sfsent(){this.faction="A",this.rarity="C",this.name="Spiritforge Sentinel",this.iAttack=this.lValN([3,6,9]),this.iHealth=this.iAttack*2,this.iArmor=this.lValN([1,2,6]),this.tribe.push("RB")}sparkbot(){this.faction="A",this.rarity="C",this.name="Spark Bot",this.iAttack=this.boof5914,this.iHealth=this.lValN([6,11,16]),this.tribe.push("RB")}sparkblade(){this.faction="A",this.rarity="C",this.name="Sparkblade Assassin",this.iAttack=this.lValN([4,12,14]),this.iHealth=this.lValN([5,13,15]),this.tribe.push("HM")}sparkass(){this.faction="T",this.rarity="C",this.name="Sparkbrand Asir",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.lValN([6,11,13]),this.iAggro=!0,this.tribe.push("LT","AS")}sparkman(){this.faction="T",this.rarity="R",this.name="Sparktail Manticore",this.iAttack=this.boof369,this.iHealth=this.boof71116,this.iAggro=!0,this.iMobile=1,this.tribe.push("MT")}steam(){this.faction="T",this.rarity="C",this.name="Steam Sentinel",this.iAttack=this.lValN([8,14,20]),this.iHealth=this.boof61016,this.iDefend=!0,this.tribe.push("WT","EL")}stonefist(){this.faction="T",this.rarity="C",this.name="Stonefist Giant",this.iAttack=this.lValN([3,7,16]),this.iHealth=this.lValN([6,10,24]),this.tribe.push("ER","EL")}stormcall(){this.faction="T",this.rarity="C",this.name="Storm Caller",this.iAttack=this.lValN([8,11,14]),this.iHealth=this.iAttack-2,this.tribe.push("WN","AS")}tgnome(){this.faction="A",this.rarity="C",this.name="Technognome",this.iAttack=this.lValN([3,9,19]),this.iHealth=this.iAttack,this.level===1&&(this.hints=["LG"]),this.tribe.push("GN")}tscout(){this.faction="A",this.rarity="C",this.name="Tower Scout",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("HM")}tund(){this.faction="A",this.rarity="C",this.name="Tundra Watcher",this.iAttack=this.lValN([5,10,12]),this.iHealth=this.lValN([8,11,13]),this.level<3&&(this.hints=["LB"]),this.tribe.push("RB")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.iAttack=this.boof7911,this.iHealth=this.iAttack+1,this.level<3&&(this.hints=["LB"]),this.tribe.push("PL")}unrelenting(){this.faction="N",this.rarity="H",this.name="Unrelenting Dead",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.iRegen=this.iAttack,this.tribe.push("ZB")}vblock(){this.faction="A",this.rarity="R",this.name="Vault Blockade",this.iAttack=0,this.iHealth=this.boof135,this.iArmor=this.boof101520,this.iDefend=!0,this.tribe.push("RB")}vtech(){this.faction="A",this.rarity="C",this.name="Vault Technician",this.iAttack=this.boof61218,this.iHealth=this.boof3915,this.tribe.push("HM")}warcharger(){this.faction="A",this.rarity="C",this.name="Ionic Warcharger",this.iAttack=this.boof4915,this.iHealth=this.lValN([7,12,18]),this.iMobile=1,this.tribe.push("RB")}waterwalk(){this.faction="T",this.rarity="C",this.name="Water Walker",this.iAttack=this.lValN([5,12,14]),this.iHealth=this.lValN([2,9,11]),this.tribe.push("WT","AS")}windprime(){this.faction="T",this.rarity="C",this.name="Wind Primordial",this.iHealth=this.boof4814,this.iAttack=this.iHealth+2,this.iMobile=this.level,this.tribe.push("WN","EL")}xithcrush(){this.faction="N",this.rarity="C",this.name="Xithian Crusher",this.iAttack=this.lValN([4,10,16]),this.iHealth=this.iAttack+2,this.tribe.push("AB")}yetiwar(){this.faction="T",this.rarity="C",this.name="Yeti Warcaller",this.iAttack=this.boof248,this.iHealth=this.lValN([10,15,23]),this.tribe.push("YT")}zombinf(){this.faction="N",this.rarity="C",this.name="Zombie Infantry",this.iAttack=this.boof61015,this.iHealth=this.iAttack-1,this.tribe.push("ZB")}}class hs extends kt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Varna's Pact";const e=this.lValS(["a","two","three"]),i=this.level===1?"":"s",s=this.level===1?"was":"were";this.text=`Put ${e} random creature${i} that ${s} destroyed this game into ${e} lane${i}.`}playTargets(){const t=super.playTargets();return t.push(this.fieldTarget("P1",[])),t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")if(this.level===1)this.endSpell([t.lane],t.playerA);else{const i=this.fieldTarget("P2",[t.lane]);S.ddf5(D.toActions(i))}else if(e[0]==="P2"){const i=[t.lane,parseInt(e[1])];if(this.level===2)this.endSpell(i,t.playerA);else{const s=this.fieldTarget("P3",i);S.ddf5(D.toActions(s))}}else this.endSpell([t.lane,parseInt(e[1]),parseInt(e[2])],t.playerA)}endSpell(t,e){this.logSpell();const i=R.tick();t.forEach(s=>{const h=U.gravedigger();h&&g.birth(h,"R",e,s,i)}),S.spellCast()}fieldTarget(t,e){const i=y.actionTarget("TF","CARD",this.code,T.enTil(t,...e));return i.player="F",i.hint=["FL"],i.lanes=g.laneIdx.filter(s=>!e.includes(s)),i}}class ls extends me{jr3(t,e){const i=super.jr3(t,e),s=i.jr4("LG",this.code),h=this.boof124*5;return s.bonus=this.buffNug(h,h),i}ddf8(t){const e=t.event;return t.trigger.type==="LG"&&t.owner===e.playerA}jr8(t){const e=t.event,i=this.boof124*e.healAmt;g.jr5(t.creatId).buff(i,i),x.triggerDone()}}class cs extends M{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Wildwood Sower",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,11,18]),this.tribe.push("HM");const e=L.getCard(z.minionCode(this.level));this.text=`When you play a spell, you may put a ${p.tokName(e)} into an available lane.`,this.spB=this.spawnNug(e)}spB;jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.interactive=!0,s.bonus=this.spB,i}handleAction(t){g.birth(z.minionCode(this.level),"P",t.playerA,t.lane),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;return e.playerA===t.owner&&L.getCard(e.cardCode).type==="S"}return!1}jr8(t){const e=y.emptyPlayerActTarg("F","CARD",this.code,""),i=D.toActions(e);i.length===0?x.triggerDone():(i.push(S.noneEndTrigger()),S.ddf5(i))}}class ds extends M{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Windcaller Shaman",this.iAttack=this.boof3713,this.iHealth=this.iAttack+4,this.tribe.push("WN","AS"),this.text=`Forge: You may move another friendly ${p.levelGateText(this.level,!0)}creature to an available lane adjacent to ${this.name}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){const e=g.jr5(t.creatId);if(this.emptySloots(e).length>0){const i=y.crFriendNotMeActTarg("CARD",e.id,this.code,T.enTil("P1",e.id));i.level=D.ddf2(this.level);const s=D.toActions(i);s.length>0?(s.push(S.noneEndTrigger()),S.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=g.jr5(e[1]),h=this.emptySloots(s,i.id);h.push(S.cancelAction()),S.ddf5(h)}else{const i=g.jr5(e[1]);this.logAct(!1,i),i.move(t.lane),S.actionDone(!0)}}emptySloots(t,e=""){return S.emptyAdjacents(t,T.enTil("P2",e))}}class us extends M{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Windspark Elemental",this.iAttack=this.boof258,this.iHealth=this.lValN([7,14,21]),this.tribe.push("LT","EL"),this.text=`When an enemy creature is delt non-battle damage, deal ${this.boof246} damage to the enemy player.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.playerNug(this.boof246),i}ddf8(t){if(t.trigger.type==="DM"){const e=V.toDamage(t.event);return!e.battle&&e.isCreatTarg&&e.hurtCreat.owner!==t.owner}return!1}jr8(t){v.hurtDirect(!t.owner,this.boof246,this.code),x.triggerDone()}}class fs extends M{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Xithian Rotfiend",this.iAttack=this.lValN([7,12,20]),this.iHealth=this.iAttack+1,this.tribe.push("AB");const e=-this.boof135;this.text=`When ${this.name} becomes opposed, it gets ${p.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("EF");const s=i.jr4("MV"),h=-this.boof135;return s.bonus=this.buffNug(h,h),i}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const e=V.toCreature(t.event);return t.trigger.creatId===e.creature.id&&t.trigger.type==="MV"||e.creature.owner!==t.owner}return!1}jr8(t){let e=!1;const i=g.jr5(t.creatId),s=V.toCreature(t.event);if((i.id===s.creature.id&&i.opposed||s.creature.lane===g.oppositeLane(i.lane))&&(e=!0),e){const h=-this.boof135;i.buff(h,h)}x.triggerDone()}}class gs extends M{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Zarox, the Raging",this.iAttack=this.lValN([2,4,10]),this.iHealth=this.lValN([8,12,18]),this.tribe.push("FR","EL"),this.text=`When Zaxox ${p.dbdtap()} on your turn, you may deal that much damage to an enemy creature.~Allied Nekrium: When a creature is destroyed, Zarox gets ${p.jr9(this.boof124,0)}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.interactive=!0,s.bonus=this.buffNug(this.lValN([3,6,14]),0),i}handleAction(t){g.ddf6(t).hurtDirect(parseInt(t.param),this.code),S.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=V.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===v.getActiveB()}else if(t.trigger.type==="DS")return!0;return!1}jr8(t){if(t.trigger.type==="FR"){if(E.allied("N")){const e=g.jr5(t.creatId),i=e.jr4("DS");i.bonus=this.buffNug(this.boof124,0),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,i=D.toActions(y.crEnemyActTarg("CARD",this.code,e.dmg.toString()));i.length>0?(i.push(S.noneEndTrigger()),S.ddf5(i)):x.triggerDone()}else if(t.trigger.type==="DS"){const e=g.jr5(t.creatId);this.logAct(!1),e.buff(this.boof124,0),x.triggerDone()}}}class ms extends M{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Zombie Titan",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("ZB");const e=this.boof234;this.text=`While ${this.name} is in a side lane, it gets ${p.jr9(e,e,!0)} and Regenerate ${this.level}.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){if(e.lane===1||e.lane===5){const i=this.boof234;[y.mod("AT",i,e.id),y.mod("HL",i,e.id),y.mod("MH",i,e.id),y.mod("RG",this.level,e.id)].forEach(h=>{e.addModSafe(h)})}else e.removeModSafe(e.id)}}class ps{cardCache=new Map;mapper={["AAK"]:Pi,["ABB"]:Mi,["ABM"]:yt,["AGC"]:yt,["AGK"]:Z,["AGP"]:ft,["AGW"]:G,["ASG"]:G,["AMS"]:Z,["AFO"]:ce,["ATG"]:qt,["ART"]:qt,["ATP"]:He,["AGM"]:oe,["ALG"]:pe,["AHL"]:_i,["ALS"]:pe,["AAA"]:Ri,["ABE"]:ft,["ATZ"]:G,["AEC"]:Ut,["ARB"]:qt,["AEN"]:W,["APM"]:Ei,["AQE"]:G,["AGD"]:Ii,["AFS"]:ne,["AMD"]:Li,["ABR"]:Wt,["AFR"]:Z,["AMY"]:Wt,["ABL"]:G,["ATT"]:vt,["AGU"]:W,["AIV"]:Et,["BRS"]:ni,["BTB"]:ri,["BTH"]:W,["BTI"]:yt,["BTN"]:pe,["BBB"]:W,["BLH"]:qt,["BFT"]:G,["BSP"]:Et,["BWK"]:oe,["BLW"]:W,["BZS"]:Z,["BSR"]:yt,["BMY"]:Gi,["BSW"]:mt,["BWW"]:Ne,["BTM"]:G,["BOS"]:z,["BAW"]:yt,["BWG"]:W,["BTR"]:Z,["BWD"]:ye,["BSG"]:Wi,["BSS"]:Z,["BTS"]:ye,["BST"]:de,["BWT"]:$i,["BRF"]:oe,["BRH"]:vt,["BWH"]:Ui,["BRN"]:ae,["BZD"]:Z,["BFM"]:Z,["BSM"]:Vi,["CKB"]:yt,["CDT"]:oe,["CMF"]:Ve,["CTL"]:ft,["CCS"]:mt,["CHY"]:W,["CSR"]:ni,["CHV"]:Oi,["CRS"]:ce,["COD"]:ft,["CTI"]:Z,["CHA"]:yt,["CHH"]:Z,["CHR"]:be,["CBB"]:Ee,["CDC"]:W,["CFB"]:Wt,["CNM"]:W,["CSW"]:Z,["CTG"]:W,["CCT"]:Oe,["CFG"]:Re,["CGF"]:Tt,["CGL"]:mt,["CSU"]:G,["CCR"]:yt,["CSB"]:Tt,["CNT"]:G,["CWK"]:W,["CRC"]:Et,["CYC"]:qt,["COZ"]:z,["CYS"]:Tt,["CTW"]:G,["CTV"]:G,["CAG"]:G,["CBS"]:G,["CIN"]:me,["CSH"]:mt,["CSG"]:Re,["DFR"]:Z,["DHW"]:qt,["DSS"]:Me,["DCR"]:ft,["DSK"]:Tt,["DBA"]:Z,["DBP"]:W,["DMR"]:W,["DBR"]:W,["DCS"]:Vt,["DDF"]:G,["DGZ"]:ft,["DNK"]:Zi,["DBN"]:Z,["DDS"]:Yi,["DIS"]:Ut,["DSV"]:Ki,["DDD"]:Z,["DPB"]:Xi,["DZA"]:z,["DZD"]:be,["DRE"]:Ut,["DGW"]:ft,["DBT"]:G,["DFB"]:Rt,["DMW"]:ne,["DCH"]:Ut,["DTD"]:W,["DSZ"]:W,["DYB"]:G,["DBQ"]:qi,["DYS"]:ji,["DYL"]:Ji,["EBW"]:Ee,["ESK"]:Et,["EHW"]:Qi,["ETN"]:G,["EWE"]:Fe,["ENP"]:G,["ESU"]:Ut,["ENR"]:G,["EPD"]:ft,["EPH"]:tr,["EPS"]:Wt,["ESG"]:er,["ESC"]:ye,["ESP"]:ir,["EWT"]:Z,["EHN"]:ye,["EFA"]:G,["EFM"]:Wt,["EFP"]:rr,["EFE"]:sr,["EXD"]:G,["FWB"]:W,["FWR"]:W,["FFG"]:W,["FST"]:Tt,["FWK"]:Tt,["FIN"]:G,["FRR"]:ft,["FVA"]:G,["FWG"]:z,["FWC"]:Et,["FFU"]:mt,["FLH"]:Ve,["FMS"]:W,["FSM"]:ft,["FBC"]:Wt,["FBI"]:qt,["FFS"]:mt,["FLN"]:G,["FJT"]:G,["FRI"]:yt,["FSS"]:Me,["FLS"]:qt,["FSH"]:mt,["FFD"]:Tt,["FRV"]:yt,["FSP"]:vt,["FPR"]:W,["FFL"]:G,["FGA"]:W,["FGB"]:W,["FGD"]:vt,["FGG"]:ne,["FGO"]:W,["FOL"]:ce,["FPM"]:W,["FPS"]:W,["FFM"]:Fe,["FMD"]:ar,["FME"]:Et,["FSK"]:nr,["FWT"]:Z,["FZS"]:G,["FUN"]:z,["GOS"]:or,["GHS"]:ne,["GHB"]:Oe,["GHR"]:hr,["GRN"]:Re,["GTH"]:G,["GSC"]:oe,["GMP"]:Vt,["GTT"]:lr,["GCL"]:W,["GCR"]:G,["GLF"]:yt,["GRW"]:yt,["GSW"]:Z,["GVS"]:Tt,["GSS"]:Z,["GBG"]:Tt,["GGE"]:W,["GGH"]:W,["GRP"]:cr,["GGD"]:Rt,["GGR"]:Rt,["GGP"]:Rt,["GGS"]:W,["GRM"]:ft,["GHT"]:yt,["GMR"]:Tt,["HMF"]:vt,["HTR"]:Ne,["HAR"]:G,["HFA"]:Be,["HOD"]:vt,["HWM"]:me,["HOX"]:Ut,["HGS"]:dr,["HTP"]:ur,["IBF"]:ft,["ITO"]:Ut,["IME"]:Ut,["IVS"]:ft,["ICD"]:fr,["IWC"]:W,["IHA"]:oe,["IBR"]:Ee,["IMD"]:be,["IMA"]:Z,["IZL"]:gr,["IZR"]:mr,["IZK"]:qt,["IFL"]:ae,["IFR"]:G,["JPK"]:G,["KDC"]:W,["KAW"]:qt,["KOD"]:mt,["KBE"]:pr,["KIW"]:yr,["KTS"]:Pe,["KKK"]:Ne,["LOD"]:ft,["LFA"]:br,["LKP"]:Ar,["LGT"]:Z,["LLD"]:xe,["LLG"]:xe,["LLS"]:xe,["LLT"]:xe,["LBR"]:G,["LSK"]:ae,["LWY"]:W,["LBD"]:Z,["LSS"]:Me,["LBL"]:Vt,["LSP"]:me,["LCE"]:Ut,["LUC"]:Fe,["LMV"]:Z,["LHY"]:W,["LYR"]:ae,["LYS"]:G,["MMH"]:yt,["MHR"]:kr,["MRF"]:W,["MOE"]:Z,["MXW"]:yt,["MSP"]:Ut,["MMA"]:Z,["MMR"]:Z,["MMX"]:Tt,["MMI"]:W,["MMO"]:W,["MMV"]:Et,["MPH"]:G,["MSC"]:G,["MTS"]:hi,["MTT"]:vr,["MML"]:Tr,["MMW"]:Sr,["MDE"]:oi,["MBP"]:mt,["MND"]:mt,["NNS"]:G,["NGB"]:yt,["NGW"]:W,["NSL"]:G,["NCF"]:G,["NCM"]:be,["POZ"]:z,["NCS"]:mt,["NCW"]:W,["NCV"]:G,["NSW"]:Cr,["NDR"]:wr,["NEM"]:Ut,["NSH"]:ft,["NXA"]:Dr,["NXC"]:W,["NXG"]:mt,["NXO"]:ce,["NXP"]:ai,["NXT"]:pe,["NGT"]:Rt,["NGQ"]:xr,["NSD"]:z,["NCL"]:ft,["NFF"]:mt,["NAM"]:W,["NOZ"]:Tt,["NSY"]:Z,["ONN"]:Br,["OXA"]:Hr,["OXM"]:Z,["OXP"]:Nr,["OOZ"]:z,["OBB"]:Fr,["OEX"]:G,["OWH"]:Pr,["OBD"]:W,["OFM"]:Z,["OJC"]:vt,["OPK"]:Z,["OSV"]:de,["OSS"]:G,["OWW"]:ne,["OHV"]:mt,["ODC"]:Mr,["OSP"]:W,["OSL"]:W,["OWF"]:ft,["OXS"]:Rr,["PHM"]:Z,["PPM"]:mt,["PSM"]:Z,["PLW"]:ft,["PRG"]:W,["PRI"]:hi,["PHS"]:yt,["PTB"]:ft,["PSC"]:mt,["PSH"]:Et,["PTR"]:G,["PSG"]:G,["PMI"]:Z,["PMS"]:G,["POX"]:Tt,["PYG"]:Oe,["PYS"]:ft,["RBH"]:Er,["ROK"]:ft,["RPT"]:z,["RHY"]:W,["RTS"]:Wt,["RHU"]:de,["RSC"]:Pe,["RLW"]:vt,["RFL"]:Ir,["RHC"]:W,["ROG"]:G,["RWC"]:ye,["RFA"]:Be,["RWD"]:yt,["RSE"]:Lr,["RBG"]:Ze,["RGG"]:Et,["RSZ"]:Tt,["RSP"]:W,["RHW"]:vt,["SBF"]:Vt,["SAP"]:G,["SPL"]:z,["SVO"]:G,["SSE"]:Vt,["SXP"]:z,["SXD"]:z,["SXT"]:z,["STS"]:ft,["SCS"]:W,["SMD"]:Z,["SFS"]:Gr,["SHY"]:yt,["SCD"]:W,["SFT"]:W,["SOC"]:G,["SOA"]:G,["SOD"]:G,["SOK"]:ae,["SOT"]:G,["SDL"]:z,["SAD"]:$r,["SHG"]:G,["SBI"]:Ee,["SCC"]:Pe,["SPB"]:Wr,["SPD"]:Vt,["SPM"]:Vt,["STD"]:yt,["STB"]:ae,["SHS"]:oe,["SGF"]:mt,["SKG"]:ai,["SSD"]:Ye,["SDA"]:Ur,["SSR"]:Et,["SNB"]:G,["SNP"]:ft,["SRD"]:ft,["SSH"]:He,["SRM"]:mt,["SRH"]:Rt,["SDN"]:Z,["SHV"]:G,["SRP"]:G,["SGG"]:Z,["SBA"]:W,["SKB"]:W,["SBR"]:W,["SKS"]:de,["SEL"]:Vr,["STM"]:W,["SBD"]:Z,["SCV"]:Or,["SFM"]:Tt,["SSN"]:W,["SSM"]:Et,["SLH"]:zr,["SPN"]:z,["SSI"]:me,["SND"]:Pe,["SNT"]:Tt,["SRV"]:Ze,["STR"]:G,["SPU"]:z,["XYR"]:z,["SPH"]:Zr,["SSA"]:mt,["STO"]:G,["SDR"]:vt,["SOL"]:Ye,["SOV"]:G,["SHK"]:ae,["SWR"]:Yr,["SMN"]:W,["SER"]:Kr,["SES"]:Xr,["SFA"]:Be,["STG"]:qr,["SSS"]:Me,["SSK"]:Z,["SWG"]:de,["SWM"]:mt,["SIV"]:ft,["STN"]:G,["SGI"]:W,["SBG"]:jr,["SCL"]:W,["SGA"]:Be,["STP"]:G,["SSG"]:Et,["SVH"]:Wt,["SIN"]:G,["SYL"]:Z,["SEV"]:yt,["SMA"]:W,["SML"]:W,["SYO"]:Qr,["TST"]:ft,["TBA"]:Vt,["TGL"]:G,["TGS"]:W,["TPT"]:G,["TDW"]:vt,["TNL"]:_r,["TEX"]:ce,["TGN"]:W,["TSM"]:ce,["TUP"]:G,["TOT"]:G,["TAB"]:oi,["TGI"]:Z,["TDS"]:be,["TSP"]:ts,["TPG"]:He,["TMG"]:He,["TMM"]:es,["TRA"]:Z,["TRS"]:Z,["TRV"]:Z,["TRW"]:Z,["TBB"]:Ve,["TOB"]:G,["TWS"]:W,["TVG"]:ri,["TXB"]:G,["TXS"]:G,["TFK"]:z,["TFD"]:z,["TFF"]:z,["TCG"]:G,["TWT"]:W,["TRN"]:ft,["TGK"]:Ze,["TSL"]:is,["TTF"]:z,["TWG"]:Re,["UGM"]:Et,["UGL"]:Z,["UIC"]:rs,["ULR"]:ss,["URD"]:W,["UBL"]:G,["UCM"]:mt,["UEM"]:as,["UHS"]:ns,["UIM"]:mt,["UWL"]:Z,["UWS"]:Z,["UIW"]:Z,["URS"]:G,["UTM"]:Z,["UTR"]:vt,["URB"]:Wt,["UPM"]:ne,["VIK"]:Z,["VRP"]:hs,["VBK"]:W,["VTC"]:W,["VTW"]:de,["VGN"]:Tt,["VND"]:Z,["VNF"]:yt,["VNS"]:Z,["VSK"]:G,["VCH"]:ft,["VGR"]:G,["VGL"]:G,["VOB"]:G,["VCG"]:Vt,["VES"]:Wt,["VYE"]:G,["WBY"]:yt,["WBU"]:yt,["WMC"]:Z,["WMR"]:mt,["WMM"]:G,["WTK"]:Ye,["WTW"]:W,["WTA"]:ls,["WWP"]:Z,["WWR"]:mt,["WOD"]:ft,["WFM"]:ne,["WWS"]:cs,["WBH"]:Fe,["WCS"]:ds,["WPD"]:W,["WSE"]:us,["WFB"]:Z,["WFS"]:mt,["WBG"]:Vt,["XCR"]:W,["XDH"]:yt,["XHS"]:Tt,["XHU"]:W,["XRF"]:fs,["XSH"]:mt,["XTR"]:Z,["XDV"]:Ne,["XRW"]:G,["YWC"]:W,["YNS"]:Rt,["ZXR"]:gs,["ZPM"]:mt,["ZTR"]:z,["ZTU"]:Tt,["ZIN"]:W,["ZBS"]:z,["ZST"]:z,["ZMT"]:ms,["ZMB"]:z,["ZSH"]:Vt};makeCard(t){try{let e;if(t==="SOV3"?e=new os(t):t==="SOC3"?e=new Z(t):t==="LOD3"?e=new zi(t):t==="GOS3"?e=new Jr(t):e=new this.mapper[Dt.extractCardCode(t)](t),e.type==="C"){const i=e;i.spice=[{icon:"A",num:i.iAttack},{icon:"H",num:i.iHealth}].concat(i.spice??[])}return e}catch(e){throw console.error("Make card screwed up on code: "+t),e}}getCard(t){let e=this.cardCache.get(t);return e||(e=this.makeCard(t),this.cardCache.set(t,e)),e}}const L=new ps;class ys{registry;constructor(){this.registry=[]}find(t){const e=this.registry.find(i=>i.action===t);if(e)return e;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,e){const i=this.find(t);i.enabled=e}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const e=this.registry.findIndex(i=>i.action===t);e>-1&&this.registry.splice(e,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,e,i){if(R.ui.animating)return;let s,h;this.scaleFactor===1?(s=t,h=e):(s=Math.round(t*this.scaleFactor),h=Math.round(e*this.scaleFactor));let f,m=T.clickMode;return m==="M"?f=i:i===st.ForceRight?f=st.Right:m==="T"?f=st.Left:f=st.Right,We.arrayHit(this.registry,s,h,f)}updateScale(t){t===1?this.scaleFactor=1:this.scaleFactor=1/t}scaleFactor=1}const tt=new ys;class bs{memLoad=!0;step="O";vsAI=!0;p1=this.dud();p2=this.dud();initConstructed(){this.step="O",this.memLoad&&(this.memLoad=!1,this.p1.mode=T.readStringStorage("cMode"+"A","CP"),this.p2.mode=T.readStringStorage("cMode"+"B","CP"),this.p1.mode==="LK"&&(this.p1.mode="CP"),this.p2.mode==="LK"&&(this.p2.mode="CP"),this.vsAI=T.readBoolStorage("cAI",!0)),gt.drawAll()}handleMenuPick(t,e){if(t==="CI"||t==="CV")this.vsAI=t==="CI",T.writeBoolStorage("cAI",this.vsAI);else if(t==="CN")this.ezDeck(this.p1)?this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",S.ddf5(this.generateDeckPickerActions())):(this.step="A",S.ddf5(this.generateDeckPickerActions()));else{const i=e==="A"?this.p1:this.p2;t==="LK"?Jt.loadFromFile().then(s=>{typeof s=="string"?new Ge().iAmError(s):(i.deck=s,i.mode=t,T.writeStorage("cMode"+e,t),gt.drawAll())}):(i.mode=t,T.writeStorage("cMode"+e,t))}gt.drawAll()}ezDeck(t){return t.mode==="CP"?!1:(t.mode==="CR"?t.deck=Jt.randomStockDeck():t.mode==="CX"&&(t.deck=Jt.treatsAbound(!0)),!0)}handleDeckPick(t){const e=T.deTil(t.param),i=Jt.stockDeckByName(e[0],e[1]);this.step==="A"?(this.p1.deck=i,this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",S.ddf5(this.generateDeckPickerActions()))):(this.p2.deck=i,this.launchConstructed())}generateDeckPickerActions(t=-1){const e=ge.map((i,s)=>{const h=y.basicAction("DSET");return h.param=s.toString(),h});if(t>-1){const i=ge[t],s=i.decks.map(h=>{const f=y.basicAction("DECK");return f.param=T.enTil(i.id,h.name),f});return e.concat(s)}return e}launchConstructed(){R.aiMode=this.vsAI,bt.setMode("G"),R.newGame(this.p1.deck.cards,this.p2.deck.cards)}replay(){R.newGame(this.p1.deck.cards,this.p2.deck.cards)}dud(){return{mode:"CP",deck:{cards:[],name:"",factions:[]}}}}const Pt=new bs;class As{deathOrder=[];graveyard=[];reset(){this.graveyard=[],this.deathOrder=[]}purge(){this.deathOrder=[]}getState(){const t={dO:this.deathOrder,gY:this.graveyard};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.deathOrder=e.dO,this.graveyard=e.gY}deathCheck(){const t=R.tick();g.qActiveCreats().forEach(s=>{s.health<1&&(p.new().crd(s.code).txt(" died.").go(),this.smite(s,t))});const e=v.toPlayer(!0),i=v.toPlayer(!1);(e.health<1||i.health<1)&&(e.healthi.creatId===t.id)&&(this.deathOrder=this.deathOrder.filter(i=>i.creatId!==t.id))}findDeathTime(t){const e=this.deathOrder.filter(i=>i.creatId===t).map(i=>i.time);if(e.length!==0)return Math.min(...e)}destroy(t,e,i=void 0){t.status==="A"?(p.new().crd(t.code).txt(" was destroyed by ").crd(e).txt(".").go(),this.smite(t,i)):(console.warn(`Attempted to destroy creature that was not active. Targ creat ${t.code}; Killer creat ${e}`),console.trace())}gravedigger(t="X",e="LA"){if(t==="X"&&e==="LA"){const i=this.graveyard.length;return i===0?"":this.graveyard[T.randInt(0,i)].cardCode}else{const i=v.toBool(t);let s=this.graveyard.filter(f=>f.owner===i);e!=="LA"&&(s=s.filter(f=>D.levelTargetTest(e,parseInt(f.cardCode.slice(3)))));const h=s.length;return h===0?"":s[T.randInt(0,h)].cardCode}}smite(t,e=void 0){t.status="D",this.deathOrder.push({creatId:t.id,time:e||R.tick()}),this.graveyard.push({cardCode:t.code,owner:t.owner}),x.addEvents(V.creature("DIE",t)),re.positionChange(t.owner),t.owner?E.deathsA.push(t.code):E.deathsB.push(t.code)}}const U=new As;class ks{get youi(){return R.ui}initDeck(t,e){this.youi.deckContents=t,this.youi.deckScroll=0,this.youi.deckSummary=e,bt.setMode("T")}get canPageDown(){return this.youi.deckContents.length-this.youi.deckScroll>15}get canPageUp(){return this.youi.deckScroll>0}paginate(t){t?this.youi.deckScroll+=15:this.youi.deckScroll-=15}visibleContent(){const t=this.youi.deckScroll;return this.youi.deckContents.slice(t,t+15)}generateContent(t,e,i){const s=D.cardByTarget(t,i);if(s.sort((h,f)=>{const m=h[0],A=f[0];return A===m?0:m>A?1:-1}),e){const h=s.length;let f=0,m="",A=0;const C=[];for(;f0&&C.push({cardCode:m,sourceIdx:-1,cardCount:A}),m=s[f][0],A=1),f++;return h>0&&C.push({cardCode:m,sourceIdx:-1,cardCount:A}),C}else return s.map(h=>({cardCode:h[0],sourceIdx:h[1],cardCount:0}))}handleShowDeck(t){const e=v.getActive();this.showDeck(e,t.param==="VD")}handleDeckScroll(t){this.paginate(t.param==="D"),gt.drawAll()}showPlayerDeck(t){this.showDeck(t,!1)}showPlayerDiscard(t){this.showDeck(t,!1)}showCustomDeck(t,e){this.initDeck(t,!1);const i=this.rightClickers();S.ddf5(e.concat(i))}showDeck(t,e){const i=v.toPlayer(t);this.initDeck(this.generateContent(e?i.discard:i.deck,!0),!0);const s=S.cancelAction();s.key="CNCL",s.param="PM";const h=this.rightClickers();h.push(s),S.ddf5(h)}rightClickers(){return R.aiActive?[]:this.youi.deckContents.map((t,e)=>{const i=y.deckSelectAction("DEET",t.cardCode,e);return i.param=t.cardCode,i})}}const Ft=new ks;class vs{friends;friendText;get browseStack(){return R.ui.detailStack}n(t,e){return`${t}${e}`}friendo(t,e){const i=Array.isArray(e)?e:[e];[1,2,3].forEach(s=>{this.friends[this.n(t,s)]=i.map(h=>this.n(h,s))})}plont(t){this.friends[this.n(t,1)]=[this.n("SDL",1)],this.friends[this.n(t,2)]=[this.n("SPL",2)],this.friends[this.n(t,3)]=[this.n("TFK",3)]}constructor(){const t=this.n("FWC",1);this.friends={[this.n("CGL",1)]:[this.n("CGF",1)],[this.n("DTD",1)]:[this.n("TOT",1)],[t]:[this.n("FWG",1)],[this.n("MPH",1)]:[t],[this.n("MPH",2)]:[t],[this.n("MPH",3)]:[t],[this.n("NGQ",4)]:[this.n("NSD",4)],[this.n("RHU",1)]:[this.n("RSC",1)],[this.n("SSE",1)]:[this.n("SXD",1)],[this.n("SSE",2)]:[this.n("SXP",2)],[this.n("SSE",3)]:[this.n("SXT",3)],[this.n("TRA",2)]:[this.n("PTR",2)],[this.n("TRA",3)]:[this.n("PTR",3)],[this.n("TRS",2)]:[this.n("STO",2)],[this.n("TRS",3)]:[this.n("STO",3)],[this.n("TRV",2)]:[this.n("ITO",2)],[this.n("TRV",3)]:[this.n("ITO",3)],[this.n("TRW",2)]:[this.n("STR",2)],[this.n("TRW",3)]:[this.n("STR",3)],[this.n("TGK",1)]:[this.n("SXD",1)],[this.n("TGK",2)]:[this.n("SPL",2)],[this.n("TGK",3)]:[this.n("TTF",3)],[this.n("TSL",1)]:[this.n("FUN",1)],[this.n("ZTU",2)]:[this.n("ZTR",2)]},this.friendo("BLH","LWY"),this.friendo("BTM","BOS"),this.friendo("BWD","TFD"),this.plont("BTS"),this.friendo("BWT","DNK"),this.friendo("CSB","ZBS"),this.friendo("CYS","COZ"),this.friendo("DSK","SPN"),this.friendo("DDF","SXT"),this.friendo("DNK","BWT"),this.friendo("DZD","DZA"),this.friendo("DBQ","BRF"),this.friendo("EPH","EPS"),this.friendo("FST","ZST"),this.friendo("FWK","ZMB"),this.friendo("FGD",["FGA","FGB","FGG","FGO"]),this.friendo("FGG","FGO"),this.friendo("FMD","FME"),this.plont("GMR"),this.friendo("IZL",["IFL","IFR","IZR"]),this.friendo("IZR",["IFL","IFR","IZL"]),this.friendo("IZK",["IFL","IFR","IZL","IZR"]),this.friendo("NCM","POZ"),this.friendo("NSW","SPN"),this.friendo("NSH","NDR"),this.friendo("NGQ","NSD"),this.friendo("NFF","TFF"),this.friendo("NOZ","OOZ"),this.plont("PTB"),this.friendo("RWC","RPT"),this.plont("STS"),this.friendo("SDA","HTP"),this.friendo("SND","SPU"),this.friendo("SIV","KBE"),this.friendo("TNL","ZMB"),this.plont("WWS"),this.friendo("YNS","XYR");const e=42,i=31,s=40,h=51,f=38,m=52,A=66;this.friendText={["BOS"]:[h,""],["BWT"]:[68,"Bron"],["BRF"]:[18,""],["CGF"]:[65,"Fiend"],["COZ"]:[i,""],["DNK"]:[8,""],["DZA"]:[59,"Dozer"],["EPS"]:[49,"Soldier"],["FWG"]:[44,""],["FWC"]:[28,"Chrysalis"],["FGA"]:[65,"Alpha"],["FGB"]:[77,"Beta"],["FGG"]:[53,"Gamma"],["FGO"]:[57,"Omega"],["FME"]:[78,"Egg"],["FUN"]:[49,""],["HTP"]:[38,"Hunting"],["ITO"]:[e,"Torrent"],["IZL"]:[42,"Av Flame"],["IZR"]:[44,"Av Frost"],["IFL"]:[65,"Flame"],["IFR"]:[67,"Frost"],["KBE"]:[78,"Bee"],["LWY"]:[65,"Wyrm"],["POZ"]:[i,""],["NDR"]:[3,""],["NSD"]:[s,""],["OOZ"]:[i,""],["PTR"]:[e,"Torrent"],["RPT"]:[51,""],["RSC"]:[60,"Scout"],["SPL"]:[h,""],["SXP"]:[h,""],["SXD"]:[s,""],["SXT"]:[f,""],["SDL"]:[s,""],["SPN"]:[A,""],["STR"]:[e,"Torrent"],["SPU"]:[A,""],["XYR"]:[A,""],["STO"]:[e,"Torrent"],["TOT"]:[40,"Tendrils"],["TFK"]:[f,""],["TFD"]:[f,""],["TFF"]:[f,""],["TTF"]:[f,""],["ZTR"]:[32,"Returned"],["ZBS"]:[m,""],["ZST"]:[m,""],["ZMB"]:[m,""]}}get currentCard(){const t=this.browseStack;return t[t.length-1]}get friendos(){return this.friends[this.currentCard]??[]}get canGoBack(){return this.browseStack.length>1}init(t){if(!R.aiActive)if(R.ui.detailStack=[t],bt.mode!=="R"){bt.setMode("R");const e=y.basicAction("CNCL");e.zone=bt.baseMode==="G"?"B":"N",e.param="PM",S.ddf5([e])}else gt.drawAll()}changeLevel(t){const e=this.browseStack,i=e.length-1,s=e[i];e[i]=this.n(Dt.extractCardCode(s),t)}goBack(){this.browseStack.pop()}goToFriend(t){this.browseStack.push(t)}friendTxt(t){const e=this.friendText[t];return e||[3,"I am error"]}goBackAction(){const t=y.basicAction("DTUP");return t.param="DB",t}levelAction(t){const e=y.basicAction("DTUP");return e.param=T.enTil("DL",t),e}friendAction(t){const e=y.basicAction("DTUP");return e.param=T.enTil("DF",t),e}updateDetails(t){const e=T.deTil(t.param),i=e[0];i==="DB"?this.goBack():i==="DF"?this.goToFriend(e[1]):i==="DL"?this.changeLevel(parseInt(e[1])):console.error("Unknown detail arg",t)}}const jt=new vs,Ke=[1,2,3,4,5].map(n=>n.toString());class Ts{rarityCache={["L"]:[],["H"]:[],["R"]:[],["C"]:[],["T"]:[]};faction1="X";faction2="X";factionLock=!1;picks=[];picksAsDeck=[];currentPack=[];scrollIdx=0;memLoad=!0;step="O";stats;vsAI=!0;legDraft=!1;fatPacks=!1;overdraft=!1;rarityFilters;setFilters;pAdeck=[];pBdeck=[];get aiPicking(){return this.vsAI&&this.step==="B"}packOdds=[];constructor(){this.rarityFilters=new Map(le.map(t=>[t,!0])),this.setFilters=new Map(Ke.map(t=>[t,!0])),this.stats=new ei}getRarity(t){return this.rarityFilters.get(t)??!0}toggleRarity(t){const e=!this.rarityFilters.get(t);return this.rarityFilters.set(t,e),e}getSet(t){return this.setFilters.get(t.toString())??!0}toggleSet(t){const e=t.toString(),i=!this.setFilters.get(e);return this.setFilters.set(e,i),i}get canPageDown(){return this.picksAsDeck.length-this.scrollIdx>15}get canPageUp(){return this.scrollIdx>0}paginate(t){t?this.scrollIdx+=15:this.scrollIdx-=15}initDraft(){this.step="O",this.memLoad&&(this.memLoad=!1,this.vsAI=T.readBoolStorage("dAI",!0),this.legDraft=T.readBoolStorage("legDraft",!1),this.fatPacks=T.readBoolStorage("fatPacks",!1),this.overdraft=T.readBoolStorage("overD",!1),Ke.forEach(t=>{this.setFilters.set(t,T.readBoolStorage("dSet"+t,!0))}),le.forEach(t=>{this.rarityFilters.set(t,T.readBoolStorage("dRare"+t,!0))})),gt.drawAll()}setFArr(){let t=Ke.filter(e=>this.setFilters.get(e)).map(e=>parseInt(e));return t.length===5&&(t=[]),t}validRarities(){return le.filter(t=>this.rarityFilters.get(t))}startDraftPicks(){const t=this.setFArr();le.forEach(e=>{this.getRarity(e)?this.rarityCache[e]=Jt.getDeckCards([e],[],t):this.rarityCache[e]=[]}),le.every(e=>this.rarityCache[e].length===0)&&(this.rarityCache["C"]=this.fun()),this.packOdds=this.fatPacks?[9,31,40]:[5,25,40],this.faction1="X",this.faction2="X",this.factionLock=!1,this.picks=[],this.picksAsDeck=[],this.scrollIdx=0,this.stats=new ei,this.resumeDraft("")}resumeDraft(t){if(t){this.picks.push(t),this.picksAsDeck=this.picksToDeck();const s=this.overdraft?60:30;if(this.picks.length===s){this.step==="A"?(this.pAdeck=this.picksAsDeck.slice(),this.step="B",this.startDraftPicks()):(this.pBdeck=this.picksAsDeck.slice(),this.launchDraft());return}const h=L.getCard(t);if(this.aiPicking||this.stats.addStat(h.type,h.faction),!this.factionLock){const f=h.faction;if(this.faction1==="X")this.faction1=f;else if(f!==this.faction1){this.faction2=f,this.factionLock=!0;const m=this.setFArr();this.validRarities().forEach(A=>{this.rarityCache[A]=Jt.getDeckCards([A],[this.faction1,this.faction2],m)})}}}const e=this.generatePack().slice(-1*(6-this.picks.length%5)),i=this.fillPack(e);if(this.aiPicking)this.resumeDraft(i[i.length-1]);else{this.currentPack=i;const s=i.map((h,f)=>{const m=y.draftSelectAction("DRFT",f,!0);return m.param=h,m});S.ddf5(s)}}replay(){this.launchDraft()}picksToDeck(){const t=[];return this.picks.forEach(e=>{const i=t.findIndex(s=>s.card===e);i===-1?t.push({card:e,num:1}):t[i].num+=1}),t.sort((e,i)=>{const s=L.getCard(e.card+"1"),h=L.getCard(i.card+"1");return s.name.toLowerCase(){const s=this.rarityCache[i].length;let h=!0;for(;h;){const f=this.rarityCache[i][T.randInt(0,s)];e.includes(f)||(e.push(f),h=!1)}}),e}handleMenuPick(t,e){if(t==="DI"||t==="DV")this.vsAI=t==="DI",T.writeBoolStorage("dAI",this.vsAI);else if(t==="DN")this.step="A",this.startDraftPicks();else if(t==="DR"){const i=e;T.writeBoolStorage("dRare"+e,this.toggleRarity(i))}else t==="DT"?T.writeBoolStorage("dSet"+e,this.toggleSet(e)):t==="LD"?(this.legDraft=!this.legDraft,T.writeBoolStorage("legDraft",this.legDraft)):t==="GP"?(this.fatPacks=!this.fatPacks,T.writeBoolStorage("fatPacks",this.fatPacks)):t==="OD"&&(this.overdraft=!this.overdraft,T.writeBoolStorage("overD",this.overdraft));gt.drawAll()}launchDraft(){R.aiMode=this.vsAI,bt.setMode("G"),R.newGame(this.pAdeck,this.pBdeck)}fun(){return[["ART","SVO","MPH","VSK","MSP","LYS"],["CAG","ATG","WMM","ESU","BWH","CBS"],["DHW","NCF","ROG","EXD","TPT","HOX"],["FLS","STP","BRN","TCG","AQE","VOB"]][T.randInt(0,4)]}}const pt=new Ts;class Ss{async drawAll(){if(ot.simOn)return;const t=bt.mode;tt.removeAll(),this.clearDetails(),t==="G"?(this.clearDeck(),await Promise.all([this.drawHand(v.getLocal()),this.drawPlayers(),this.drawField(),this.drawActions(S.activeActions)]),R.winFlag!==0?await this.drawGameOver():await this.drawCommonButtons(!0,!0,!0)):t==="R"?await this.drawDetails(S.activeActions):t==="T"?R.aiActive||await this.drawDeck(S.activeActions):t==="D"?await this.drawDraft(S.activeActions):t==="C"?await this.drawConstructed():t==="I"?await this.drawInfoMenu():t==="X"?await this.drawExit(S.activeActions):t==="S"?await this.drawSwap():await this.drawMenu()}async drawGameOver(){await new Ae().drawGameOver()}async drawHand(t){await new fi().drawCards(t)}async drawField(){await new Je().drawCards()}async drawPlayers(){await new Ae().drawAllPlayers()}async drawDeck(t){const e=t.find(f=>f.zone==="B"),i=[];e&&i.push(e),await new Ie().drawActions(i);const h=new Ws;await h.drawCards(),await h.drawActions(t),await this.drawCommonButtons(!0,!0,!1)}async drawActions(t){if(ot.simOn)return;const e=new Ie;if(R.aiActive)await e.drawActions([]);else{rt.get("effects").clear();const s=new fi,h=new Je,f=new Ae;await Promise.all([s.drawActions(t),h.drawActions(t),e.drawActions(t),f.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;R.ui.animating=!0,rt.get("effects").clear(),await new Je().drawFight(t),R.ui.animating=!1}async drawDraft(t){rt.get("effects").clear();const i=new Vs,s=rt.get("game-ui");s.clear(),tt.removeAll(),pt.step==="O"?await i.drawDraftMenu(s):(await new ke().drawPickerPlayer(s,pt.step==="A",!1),await i.drawPack(t,s),await i.drawList(t,s),await i.drawStats(s),await this.drawCommonButtons(!0,!0,!1))}async drawMenu(){const t=new Os,e=rt.get("game-ui");e.clear(),tt.removeAll(),await t.drawMenu(e)}async drawInfoMenu(){const t=new ke,e=rt.get("game-ui");e.clear(),tt.removeAll(),await t.drawExtrasMenu(e)}async drawConstructed(){if(Pt.step==="O"){const t=new Ge,e=rt.get("game-ui");e.clear(),tt.removeAll(),await t.drawConstrMenu(e)}else await this.drawDeckPick(S.activeActions)}async drawDeckPick(t){const e=new Ge,i=new ke,s=rt.get("game-ui");s.clear(),tt.removeAll(),await i.drawPickerPlayer(s,Pt.step==="A",Pt.vsAI),await e.drawSets(t,s),await e.drawList(t,s)}clearDetails(){rt.get("card").clear()}clearDeck(){rt.get("decklist").clear()}async drawDetails(t){await this.drawActions(t),await this.drawCommonButtons(!0,!0,!1),rt.get("card").clear();const i=new Us,s=t.find(h=>h.key==="CNCL");s?await i.drawDetails(s):console.error("Attempted to show details view with no cancel action")}async drawCommonButtons(t,e,i){let s=979;const h=723,f=new je,m=rt.get("game-ui");if(i&&m.clear(),t&&(await f.makeIconButton(m,s,h,"EX"),s-=50),e){const A=T.clickMode;A!=="M"&&await f.makeIconButton(m,s,h,A==="I"?"TM":"DM")}}async drawExit(t){rt.get("decklist").clear();const i=rt.get("effects"),s=new fe;await s.drawButton(i,151,488,t[1],"Quit Game",24,!1),await s.drawButton(i,478,488,t[0],"Resume",52,!1)}async drawSwap(){const t=rt.get("decklist");t.clear(),t.context.fillStyle="#000000",t.context.fillRect(0,0,T.gameWidth,T.gameHeight);const e=new Ae,i=v.getActive(),s="#AAF0C1",h=y.basicAction("USWP");h.param="PM",await e.drawPlayer(i,t,200,300);const f={fontSize:22,colour:s};await e.drawText(t,"Player "+(i.isPlayerA?"1":"2"),480,360,f),await e.drawText(t,"Click to start turn",480,420,f);const m=new dt(h,0,0,T.gameWidth,T.gameHeight,st.Both);tt.add(m)}setBackground(t){const e="hide";this.allBackgrounds.forEach(i=>{const s=document.getElementById(i);s&&(t===i?s.classList.remove(e):s.classList.add(e))})}playmatSetup(){let t=!1;const e=T.options.playmat,i=document.getElementById("playmat");if(i?i.dataset.pic!==e&&(t=!0,i.remove()):t=!0,t){const s=new Image(T.gameWidth,T.gameHeight);s.id="playmat",s.classList.add("hide",this.scaleCSS(T.options.scale)),s.dataset.pic=e,s.src=T.imgRoot+`background/playfield-${e}.jpg`,document.getElementById("mainmenu").before(s)}}scaleCSS(t){return`uiSize${t}`}changeScale(t){this.clearAll();let e=T.options.scale;e===t&&(e="100");const i=t==="100"?1:.90625;tt.updateScale(i);const s=this.scaleCSS(e),h=this.scaleCSS(t);this.allCanvases.forEach(A=>{rt.get(A).dom.classList.replace(s,h)}),this.allBackgrounds.forEach(A=>{const C=document.getElementById(A);C&&C.classList.replace(s,h)}),document.getElementById("solforge").classList.replace(`gameSize${e}`,`gameSize${t}`),document.getElementById("log").classList.replace(`logSize${e}`,`logSize${t}`),T.options.scale=t,T.writeStorage("scale",t)}clearAll(){this.allCanvases.forEach(t=>{rt.get(t).clear()})}allCanvases=["game-ui","field","player","hand","effects","decklist","card"];allBackgrounds=["playmat","blueface","mainmenu"]}const gt=new Ss;class Cs{positionChange(t){g.creatByTarget().forEach(e=>{e.enforceEffects("PS",t)})}defenderChange(t){g.qActiveCreats().forEach(i=>{i.effects.filter(s=>s.watch==="DF").filter(s=>s.area==="C"&&i.owner===t||s.area==="A").forEach(s=>L.getCard(s.logicCode).enforceEffect(s,i))})}playerHealthChange(){g.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){g.qActiveCreats().forEach(e=>{e.enforceEffects("AT"),e.enforceEffects("AR"),e.enforceEffects("CH"),e.enforceEffects("DF",e.owner)})}}const re=new Cs;class ws{getC(t){return g.jr5(t)}creature(t,e){return{code:t,creatId:e.id}}creatHeal(t,e){return{code:"CHL",creatId:t.id,healAmt:e}}damage(t,e,i,s,h,f){let m;return h instanceof Ce?m=h.id:m=h,{code:"DMG",battle:t,dmg:e,isCreatSrc:i,isCreatTarg:s,target:m,srcId:f?.id}}enterField(t){return{code:"ENT",creatId:t.id,forged:!1}}playCard(t,e){return{code:"PLC",playerA:e,cardCode:t}}player(t,e){return{code:t,playerA:e}}playerHeal(t,e){return{code:"PHL",playerA:t,healAmt:e}}replaced(t,e){return{code:"RPL",creatId:t.id,replCreatId:e.id}}toCreature(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId)}}toDamage(t){const e=t;let i,s,h;return e.isCreatTarg?h=this.getC(e.target):s=v.toPlayer(e.target),e.isCreatSrc&&(i=this.getC(e.srcId)),{code:e.code,battle:e.battle,dmg:e.dmg,isCreatSrc:e.isCreatSrc,srcId:e.srcId,target:e.target,isCreatTarg:e.isCreatTarg,srcCreat:i,hurtCreat:h,hurtPlayer:s}}toEnterField(t){const e=t;return{code:e.code,creatId:e.creatId,forged:e.forged,creature:this.getC(e.creatId)}}toReplaced(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId),replCreatId:e.replCreatId,replCreat:this.getC(e.replCreatId)}}}const V=new ws;class Ds{field=[];birthOrder=[];laneIdx=[1,2,3,4,5];reset(){this.field=[],this.birthOrder=[]}purge(){this.field=this.field.filter(t=>t.status==="A"),this.birthOrder=[]}getState(){const t={field:this.field.map(e=>e.getState()),bO:this.birthOrder};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.field=e.field.map(i=>new Ce(i)),this.birthOrder=e.bO}jr5(t){const e=this.searchById(t);if(e)return e;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByLane(t,e){const i=this.searchByLane(t,e);if(i)return i;throw console.error("naughty creature lane ",t,e),new Error("Could not find creature by lane")}ddf6(t){const e=this.searchByFSA(t);if(e)return e;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return this.field.find(e=>e.id===t)}searchByLane(t,e){return this.field.find(i=>i.lane===t&&i.owner===e&&i.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let e=this.field;if(t){if(t.player!=="X"){const i=v.toBool(t.player);e=e.filter(s=>s.owner===i)}if(t.creatStatus!=="A"){const i=this.creatStatusTargetToCS(t.creatStatus);e=e.filter(s=>s.status===i)}if(!T.isUn(t.lanes)){const i=D.lanesToArr(t.lanes);e=e.filter(s=>i.includes(s.lane))}if(T.isUn(t.maxAttack)||(e=e.filter(i=>i.attack<=t.maxAttack)),t.notMe&&(e=e.filter(i=>i.id!==t.notMe)),t.victims){const i=T.deTil(t.victims);e=e.filter(s=>i.includes(s.id))}if(t.tribe!=="AN"&&(e=e.filter(i=>i.isTribe(t.tribe))),t.canLevel&&(e=e.filter(i=>L.getCard(i.code).canLevel())),t.level!=="LA"){const i=D.levelTargetToLevel(t.level);e=e.filter(s=>i.includes(s.level))}t.cardCode&&(e=e.filter(i=>L.getCard(i.code).cardCode()===t.cardCode)),t.canDefender&&(e=e.filter(i=>!i.negateDefender)),t.hasDefender&&(e=e.filter(i=>i.defender)),t.canArmor&&(e=e.filter(i=>!i.negateArmor)),t.hasArmor&&(e=e.filter(i=>i.armor>0)),t.canMove&&(e=e.filter(i=>!i.negateMobility)),t.hasMobility&&(e=e.filter(i=>i.mobility>0)),t.hasPoison&&(e=e.filter(i=>i.poison>0)),t.canRegen&&(e=e.filter(i=>!i.negateRegen)),t.hasRegen&&(e=e.filter(i=>i.regen>0)),t.faction!=="X"&&(e=e.filter(i=>i.faction===t.faction))}return e}cst2cs={["A"]:()=>{throw new Error("goof passed any to field state target mapper")},["V"]:()=>"A",["D"]:()=>"D",["R"]:()=>"R"};creatStatusTargetToCS(t){return this.cst2cs[t]()}emptyLanes(t){return this.laneIdx.filter(e=>!this.field.find(s=>s.owner===t&&s.lane===e&&s.status==="A"))}oppositeLane(t){return 6-t}adjacentPositions(t){return[[2],[1,3],[2,4],[3,5],[4]][t-1]}canMove(t){return t.mobility>0&&t.mobilityAvailable&&(!t.sleeping||t.aggressive)?this.emptyLanes(t.owner).filter(e=>Math.abs(t.lane-e)<=t.mobility):[]}birth(t,e,i,s=0,h=void 0){if(e==="S"){const C=this.emptyLanes(i);if(C.length===0)return;s=C[T.randInt(0,C.length)]}else if(e==="P"&&!this.emptyLanes(i).includes(s))return;const m=(typeof t=="string"?L.getCard(t):t).jr3(i,s);if(i===v.getActiveB()&&E.birthRegistrar(m.id),e==="F"||e==="R"){const C=g.searchByLane(s,i);if(C){const B=p.new().crd(C.code).txt(" was replaced");e==="R"?B.txt(" with ").crd(m.code).txt(".").go():B.txt(".").go(),C.status="R",x.addEvents(V.replaced(m,C))}}this.field.push(m);const A=V.enterField(m);return A.forged=e==="F",this.birthOrder.push({creatId:m.id,time:h||R.tick()}),x.addEvents(A),m.enforceEffects("PH"),re.positionChange(i),m}findBirthTime(t){const e=this.birthOrder.filter(i=>i.creatId===t).map(i=>i.time);if(e.length!==0)return e.length>1&&console.warn("wery curious, more than one birth record for creat "+t),e[0]}qActiveCreats(){return this.creatByTarget(y.crTarg())}qPlayerCreats(t){const e=y.crTarg();return e.player=v.toTarget(t),this.creatByTarget(e)}ddf1(){return this.creatByTarget(y.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(y.crEnemyTarg())}}const g=new Ds;class xs{creatFightState(t,e){return t?e===1||t.defender||t.sleeping&&!t.aggressive?1:e===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t,e,i,s){if(t>0){let h=0;if(e>0){const f=t===2&&i.breakthrough;h=s.hurtBattle(i.attack,i,f)}else t===2&&(h=i.attack);h>0&&v.hurtBattle(!i.owner,h,i)}}fight(t){const e=!ot.simOn;e&&p.add("FIGHT!");let i=2,s=1;t&&(E.mainBattle=!1,i=0,s=0);const h=v.getActiveB(),f=[],m=[];g.laneIdx.forEach(C=>{const B=g.searchByLane(C,h),$=g.searchByLane(6-C,!h),Y=this.creatFightState(B,i),J=this.creatFightState($,s);(Y===2||J===2)&&(m.push([Y,J,B,$],[J,Y,$,B]),Y===2&&(E.ffs++,f.push([C,h])),J===2&&f.push([g.oppositeLane(C),!h]))}),this.barking&&f.length>0&&e&&T.dogBark();let A;e?A=gt.drawCombat(f):A=Promise.resolve(),A.then(()=>{m.forEach(C=>this.dukeItOut(...C)),re.playerHealthChange(),U.deathCheck(),x.type="C0",S.actionDone()})}barking=!0}const li=new xs;class Bs{aiMode=!1;aiActive=!1;winFlag=0;ui=this.freshUI();idnum=0;clock=0;genId(){return this.idnum++,"@"+this.idnum.toString(36)}tick(){return this.clock++,this.clock}getState(){return{i:this.idnum,t:this.clock}}setState(t,e){this.idnum=t,this.clock=e}newGame(t,e){this.idnum=0,this.clock=0,li.barking=T.options.bark,v.activePlayer=T.randInt(0,2)===0,this.aiActive=!v.activePlayer&&this.aiMode,v.isLocalA=this.aiMode||v.activePlayer,S.actionHistory=[],ot.turnSims=0,ot.turnTime=0,g.reset(),U.reset(),this.ui=this.freshUI(),E.firstTurn=!0,this.winFlag=0;const i=v.nameOSaurus();v.initPlayer(!0,t,"Forgy McGhee",25),v.initPlayer(!1,e,i[0],i[1]),p.setup(),p.add("Ready...FIGHT!"),E.startTurn()}freshUI(){return{handScrollLeft:0,detailStack:[],deckContents:[],deckScroll:0,deckSummary:!1,animating:!1}}}const R=new Bs;class Hs{loglist;you=!0;localPlayerKey="";oppPlayerKey="";localPlayerSpan="";oppPlayerSpan="";constructor(){this.loglist=document.getElementById("loglist")}setup(){this.you=v.getLocalB(),this.localPlayerKey=this.you?"^pa":"^pb",this.oppPlayerKey=this.you?"^pb":"^pa",this.localPlayerSpan=this.span(v.toPlayer(this.you).name,"green"),this.oppPlayerSpan=this.span(v.toPlayer(!this.you).name,"red")}addLi(t){const e=document.createElement("li");e.innerHTML=t,this.loglist.appendChild(e),e.scrollIntoView({behavior:"smooth",block:"end"})}span(t,e,i=""){const s=i.length>0?` onclick="sfapi.details('${i}')"`:"";return`${t}`}add(t){this.addLi(t)}debug(t,e=!0){(e||T.options.debug)&&this.addLi(this.span(t,"debug"))}clearAll(){this.loglist.innerHTML=""}new(){return new Si}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let e=!0;for(;e;){const i=t.indexOf("^c");if(i===-1)e=!1;else{const s=t.slice(i+2,i+6);if(s==="POIS")t=t.replaceAll("^c"+s,this.span("Poison","green"));else{const h=L.getCard(s);t=t.replaceAll("^c"+s,this.span(`${h.name} ${h.level}`,this.factMap[h.faction],s))}}}return t}parse(t){const i=t.guts.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),s=this.parseCards(i);this.add(s)}cardText(t){let e;if(t.type==="C"){const i=t,s=[];i.iRegen>0&&s.push("Regenerate "+i.iRegen),i.iArmor>0&&s.push("Armor "+i.iArmor),i.iMobile>0&&s.push("Mobility "+i.iMobile),i.iBT&&s.push("Breakthrough"),i.iDefend&&s.push("Defender"),i.iAggro&&s.push("Aggressive"),i.consistent&&s.push("Consistent"),s.length>0&&s.push(""),e=s.join(". ")+t.text}else e=t.text;return(t.isFree?"Free. ":"")+(t.overload?"Overload. ":"")+e}cardTextSplit(t){const e=[];if(t.isFree&&e.push("Free"),t.consistent&&e.push("Consistent"),t.overload&&e.push("Overload"),t.type==="C"){const i=t;i.iRegen>0&&e.push("Regenerate "+i.iRegen),i.iArmor>0&&e.push("Armor "+i.iArmor),i.iMobile>0&&e.push("Mobility "+i.iMobile),i.iBT&&e.push("Breakthrough"),i.iDefend&&e.push("Defender"),i.iAggro&&e.push("Aggressive")}if(t.text.length>0&&e.push(...t.text.split("~")),t.level===1){const i=t.cardCode(),s=ti.find(h=>h[0]===i);if(s){let h;const f=s[1];f.length===2&&f[0]===f[1]?h="2x "+L.getCard(`${f[0]}1`).name:h=f.map(m=>L.getCard(`${m}1`).name).join(", "),e.push("Solbind: "+h)}}return e}factionText(t){switch(t){case "A":return"Alloyin";case "N":return"Nekrium";case "T":return"Tempys";case "U":return"Uterra";case "X":return""}}cardTypeText(t){return t==="C"?"Creature":"Spell"}rarityText(t){switch(t){case "C":return"Common";case "R":return"Rare";case "H":return"Heroic";case "L":return"Legendary";case "T":return"Token"}}levelGateText(t,e=!1){const i=e?" ":"";return t===1?`level 1${i}`:t===2?`level 2 or lower${i}`:""}jr9(t,e,i=!1){return t!==0&&e!==0?`${this.bufferson(t,!0)}${i?",":" and"} ${this.bufferson(e,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(e,!1)}bufferson(t,e){return`${t>0?"+":""}${t} ${e?"attack":"health"}`}dbdtac(t=-1){return`deals battle damage to a ${t===-1?"":this.levelGateText(t,!0)}creature`}dbdtap(){return"deals battle damage to a player"}daluac(t=!1){return(t?"D":"d")+"iscard and level up a card"}forglied(t){return t==="X"?"Forge":`Allied ${this.factionText(t)}`}fastName(t){t.length===3&&(console.warn("HEY a 3 char card code was passed to fastName, why?: "+t),t=`${t}1`);const e=L.getCard(t);return e.name+" "+e.level}pName(t){return t?"A":"B"}tokName(t){return`${t.iAttack}/${t.iHealth} ${t.name}`}cardActionText(t){let e=`Card (${this.fastName(t.host)}) `;if(t.zone==="F"){const i=t,s=i.playerA?i.lane:6-i.lane,h=g.searchByFSA(i),f=h?this.fastName(h.code):"Empty";e+=`Lane ${s}${this.pName(i.playerA)} ${f}`}else if(t.zone==="H"){const i=t;e+=`Hand (${this.fastName(i.card)})`}else if(t.zone==="P"){const i=t;e+=`Player (${this.pName(i.playerA)})`}else t.zone==="R"?e+="Full Board":t.zone==="B"?e+="Button":t.zone==="N"&&(e+="Special");return e}actionText(t){switch(t.key){case "ACTV":return`Activate (${this.fastName(t.host)})`;case "CARD":return this.cardActionText(t);case "FITE":return"Fight";case "FORG":return`Forge to Lane ${6-t.lane}`;case "HDSC":return`Hand Discard (${this.fastName(t.host)})`;case "HPLY":const i=t;return`Play (${this.fastName(i.card)})`;case "MEND":return"Move End";case "MOVE":return"Move Start";case "NOTR":return"Pick None";case "ENDT":return"Donethanks";case "CANC":return"Cancel";default:return t.key}}tribeT={["AN"]:"Any",["AB"]:"Abomination",["AG"]:"Angel",["AS"]:"Asir",["BR"]:"Bear",["BE"]:"Beast",["CT"]:"Cat",["CR"]:"Chrysalis",["CY"]:"Cyborg",["DF"]:"Darkforged",["DM"]:"Demon",["DN"]:"Dinosaur",["DG"]:"Dragon",["DK"]:"Drakin",["DY"]:"Dryad",["ER"]:"Earth",["EL"]:"Elemental",["EN"]:"Energeist",["FY"]:"Fairy",["FR"]:"Fire",["FB"]:"Forgeborn",["FT"]:"Frost",["GT"]:"Giant",["GN"]:"Gnome",["GL"]:"Golem",["GG"]:"Grimgaunt",["GD"]:"Guardian",["HM"]:"Human",["HY"]:"Hydra",["IC"]:"Ice",["IN"]:"Insect",["LT"]:"Lightning",["LP"]:"Lupin",["MT"]:"Manticore",["MC"]:"Mech",["MM"]:"Metamind",["NG"]:"Naga",["OZ"]:"Ooze",["PX"]:"Phoenix",["PL"]:"Plant",["RM"]:"Ram",["RB"]:"Robot",["SY"]:"Satyr",["SE"]:"Seraph",["SH"]:"Shaman",["SS"]:"Shapeshifter",["SK"]:"Skeleton",["SN"]:"Snake",["SP"]:"Spider",["ST"]:"Spirit",["TG"]:"Tigrin",["TK"]:"Tuskin",["VP"]:"Vampire",["WD"]:"Wanderer",["WT"]:"Water",["WN"]:"Wind",["WF"]:"Wolf",["WR"]:"Wurm",["YT"]:"Yeti",["ZB"]:"Zombie"};tribeText(t){return this.tribeT[t]}}const p=new Hs;class Ns{handleMainMenuButton(t){t.param==="D"?(bt.setMode("D"),T.options.wasDrafting=!0,gt.playmatSetup(),pt.initDraft()):t.param==="C"?(bt.setMode("C"),T.options.wasDrafting=!1,gt.playmatSetup(),Pt.initConstructed()):t.param==="I"?(bt.setMode("I"),gt.drawAll()):window.open("deckbuilder.html")}handleMenuButton(t){const e=T.deTil(t.param),i=e[0];let s=!0;if(i==="RP")s=!1,p.clearAll(),T.options.wasDrafting?pt.replay():Pt.replay();else if(i==="MM")bt.setMode("M"),p.clearAll();else if(i==="CN"||i==="CP"||i==="CX"||i==="CR"||i==="CI"||i==="CV"||i==="LK")Pt.handleMenuPick(i,e[1]);else if(i==="DN"||i==="DR"||i==="DI"||i==="DV"||i==="LD"||i==="GP"||i==="OD"||i==="DT")pt.handleMenuPick(i,e[1]);else if(i==="alloyin"||i==="nekrium"||i==="tempys"||i==="uterra"||i==="vanilla")T.options.playmat=i,T.writeStorage("playmat",i);else if(i==="HH")T.toggleOption("highHealth");else if(i==="CH")T.toggleOption("cheater");else if(i==="BB")T.toggleOption("bark");else if(t.param==="BC")T.toggleOption("bigCards");else if(i==="90"){const h=T.options.scale==="90"?"100":"90";gt.changeScale(h)}else i==="RU"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/rules")):i==="FQ"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/faq")):(s=!1,console.error("missing handler for menu button param "+t.param));s&>.drawAll()}handleUIButton(t){t.param==="DM"?(T.setClickMode("I"),gt.drawAll()):t.param==="TM"?(T.setClickMode("T"),gt.drawAll()):t.param==="EX"?(bt.setMode("X"),S.ddf5(this.generateExitActions())):console.error("missing handler for common button param "+t.param)}generateExitActions(){const t=y.basicAction("CANC");return t.param="PM",[t,y.menuButtonAction("MM")]}}const Xe=new Ns;class Fs{stack=["M"];setMode(t){this.deetMode(t)||t==="X"||t==="S"?this.stack.push(t):(this.stack=[t],t==="G"?(rt.get("game-ui").clear(),gt.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(rt.get("game-ui").clear(),gt.setBackground("blueface")):t==="M"&&(gt.clearAll(),gt.setBackground("mainmenu")))}popMode(){this.stack.pop()}get mode(){const t=this.stack;return t[t.length-1]}get isDetailMode(){return this.deetMode(this.mode)}get baseMode(){return this.stack[0]}deetMode(t){return t==="R"||t==="T"}}const bt=new Fs;class Ps{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const e=v.toPlayer(t),i=[],s=[];if(e.deck.forEach(h=>{L.getCard(h).consistent?i.push(h):s.push(h)}),i.length===0)this.shuffle(e.deck);else{this.shuffle(s);const h=20-i.length,f=i.concat(s.slice(0,h));this.shuffle(f),e.deck=s.slice(h).concat(f)}}shuffle(t){const e=t.length,i=(s,h)=>{const f=t[s];t[s]=t[h],t[h]=f};if(e>0){let s,h;const f=e*4;for(let m=0;mi.decks).flat(),e=T.randInt(0,t.length);return t[e]}stockDeckByName(t,e){let i;if(ge.some(s=>s.id===t?s.decks.some(h=>{h.name===e&&(i=h)}):!1),i)return i;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+e)}ripper(t,e,i){const s=[[15,8,5],[30,15,10]],h=this.getDeckCards([],[t]),f=[],m=s[i===15?0:1][e-1];for(;f.length$===B)||f.push(B)}const A=f.map(C=>({card:C,num:e}));return e===2&&i===15&&(A[0].num=1),A}deckify(t){const e=t.map(i=>{const s=ti.find(h=>h[0]===i);return s?s[1]:[]}).flat();return t.concat(e).map(i=>`${i}1`)}parseDeck(t){const e=t.map(i=>Array(i.num).fill(i.card)).flat();return this.deckify(e)}validDeck(t){const e={};t.forEach(C=>{e[C.card]?e[C.card]+=C.num:e[C.card]=C.num});const i=Object.entries(e).map(C=>({card:C[0],num:C[1]})),s=i.map(C=>C.num).reduce((C,B)=>C+B,0);if(s!==30)return"Deck must have 30 cards, found "+s;const h=[];let f="";if(i.some(C=>{const B=Mt.findIndex($=>$.c===C.card);return B===-1?(f=C.card,!0):(h.push(Mt[B].f),!1)}))return`Invalid card code: '${f}'`;let m=0;if(i.some(C=>C.num>3?(f=C.card,m=C.num,!0):!1))return`${m} copies of '${f}' ${p.fastName(f).slice(0,-2)}`;const A=[...new Set(h)];return A.length>2?"Deck must have two or less factions, found: "+A.join():""}getDeckCards(t=[],e=[],i=[]){return t.length===0&&e.length===0&&i.length===0?Mt.map(s=>s.c):t.length>0&&e.length>0&&i.length===0?Mt.filter(s=>t.includes(s.r)&&e.includes(s.f)).map(s=>s.c):t.length>0&&e.length===0&&i.length===0?Mt.filter(s=>t.includes(s.r)).map(s=>s.c):t.length===0&&e.length>0&&i.length===0?Mt.filter(s=>e.includes(s.f)).map(s=>s.c):t.length>0&&e.length>0&&i.length>0?Mt.filter(s=>t.includes(s.r)&&e.includes(s.f)&&i.includes(Math.floor(s.s))).map(s=>s.c):t.length>0&&e.length===0&&i.length>0?Mt.filter(s=>t.includes(s.r)&&i.includes(Math.floor(s.s))).map(s=>s.c):t.length===0&&e.length>0&&i.length>0?Mt.filter(s=>e.includes(s.f)&&i.includes(Math.floor(s.s))).map(s=>s.c):Mt.filter(s=>i.includes(Math.floor(s.s))).map(s=>s.c)}getCardFaction(t){const e=Mt.find(i=>i.c===t);return e?e.f:"X"}getCardRarity(t){const e=Mt.find(i=>i.c===t);return e?e.r:"T"}cardStats(){Se.forEach(t=>{const e=`${p.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,i=le.map(s=>`${p.rarityText(s)}: ${this.getDeckCards([s],[t]).length}`).join("; ");console.log(e+i)})}loadPromise=new De;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new De,this.loader.click(),await this.loadPromise.getPromise(),this.fileguts==="")return"";if(this.fileguts.startsWith("!")){const s=this.fileguts.substring(1);return this.fileguts="",s}const t=JSON.parse(this.fileguts);this.fileguts="";const e=t.cards,i=this.validDeck(e);return i||t}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const e=this.loader.files;if(e&&e.length>0){const s=e[0];var i=new FileReader;i.onload=h=>{try{var f=i.result;if(f){var m=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(f)));m.cards&&Array.isArray(m.cards)&&!m.cards.some(A=>!(A&&typeof A.card=="string"&&Number.isInteger(A.num)))?(this.fileguts=JSON.stringify(m),this.loadPromise.resolveMe()):this.readError("File format is invalid.")}else this.readError("File read was empty.")}catch(A){console.error(A),this.readError("Error reading file.")}};try{i.readAsArrayBuffer(s)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}const Jt=new Ps;class Ms{phase="ST";enterMainPhase(){this.phase="MN";const t=v.getActive(),e=this.getMainPhaseActions(t);R.aiActive&&ot.hitMainPhase(),S.ddf5(e,!0)}async whatNext(t=!1){if(R.winFlag!==0){ot.simOn?(ot.simEndpoint(R.winFlag===1?"L":"W"),R.winFlag=0):(S.actionHistory=[],R.aiActive=!1,R.ui.animating=!1,await gt.drawAll());return}if(await gt.drawAll(),S.actionHistory.length>0)S.ddf5();else if(t)bt.setMode("S"),gt.drawAll();else if(x.getNextTrigger())qe.resolve(x.getNextTrigger());else if(!x.deathCheck)U.deathCheck(),this.whatNext();else if(x.events.length>0)x.startBatch();else switch(g.purge(),U.purge(),this.phase){case "MN":this.enterMainPhase();break;case "ET":this.phase="PT",x.addEvents(V.player("PTN",v.getActiveB())),Lt.expireMods(),this.whatNext();break;case "PT":E.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),this.phase="MN",this.whatNext();break;case "ST":ot.simOn?ot.simEndpoint("T"):(this.phase="MN",ot.cheater()?T.sleep(500).then(()=>this.whatNext()):T.sleep(100).then(()=>this.whatNext()));break}}expireatron(t,e,i,s){e.mods.forEach(h=>{h.expiry===s?h.expiry=i:h.expiry===i&&t.push([e,h])})}expireMods(){const t=g.creatByTarget(y.crTarg());t.push(v.playerA,v.playerB);let e=[];this.phase==="PT"?t.forEach(i=>{this.expireatron(e,i,"ET","EN")}):this.phase==="ST"&&t.forEach(i=>{this.expireatron(e,i,"ST","SN")}),e.length>0&&(e.forEach(i=>{const s=i[0];s instanceof Ce?s.expireMod(i[1]):v.expireMod(s,i[1])}),re.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const e=this.getHandActions(t),i=this.getFieldActions(t);let s=E.mainBattle,h="M";return s||(s=g.ddf1().some(m=>m.extraBattles>0&&m.isActive&&!m.defender),h="E"),s&&e.push({key:"FITE",zone:"B",param:h,host:""}),s||e.push({key:"ENDT",zone:"B",param:"",host:""}),[e,i].flat()}getHandActions(t){const e=[...new Set(t.hand)],i=[],s=[];e.forEach(A=>{L.getCard(A).isFree?i.push(A):s.push(A)});const h=i.map(A=>[A,"FREE"]);E.freeCards.forEach(A=>{D.cardByTarget(s,A.condition).forEach(B=>{h.push([B[0],A.id]),s.splice(s.indexOf(B[0]),1)})}),h.push(...s.map(A=>[A,""]));const f=E.regularPlays>0;let m=t.hand.map((A,C)=>[A,C]);return f||(m=m.filter(A=>!s.includes(A[0]))),m.map(A=>{const C=h.find(B=>B[0]===A[0]);return C||console.error("No cost found for card"+A[0]),y.handSelectAction("HPLY",A[0],C[1],A[1])})}getFieldActions(t){const e=g.qPlayerCreats(t.isPlayerA),i=e.filter(h=>g.canMove(h).length>0).map(h=>y.fieldSelectAction("MOVE",h.lane,h.owner)),s=e.filter(h=>h.isActive&&h.activationAvailable?L.getCard(h.code).canActivate(h):!1).map(h=>{const f=y.fieldSelectAction("ACTV",h.lane,h.owner);return f.host=h.code,f.param=h.id,f});return i.forEach(h=>{const f=s.findIndex(m=>m.lane===h.lane);f>-1&&(s.splice(f,1),h.param="ACTV")}),i.concat(s)}}const Lt=new Ms;class Rs{playerA;playerB;activePlayer;isLocalA;constructor(){this.playerA=this.newPlayer(!0),this.playerB=this.newPlayer(!1),this.activePlayer=!0,this.isLocalA=!0}getPlayerState(t){return{deck:t.deck,discard:t.discard,hand:t.hand,health:t.health,triggers:t.triggers,turn:t.turn,rank:t.rank,poison:t.poison,armor:t.armor,armorDmg:t.armorDmg,mods:t.mods}}setPlayerState(t,e){e.deck=t.deck,e.discard=t.discard,e.hand=t.hand,e.health=t.health,e.triggers=t.triggers,e.turn=t.turn,e.rank=t.rank,e.poison=t.poison,e.mods=t.mods,e.armor=t.armor,e.armorDmg=t.armorDmg}getState(){const t={pA:this.getPlayerState(this.playerA),pB:this.getPlayerState(this.playerB),actP:this.activePlayer};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.setPlayerState(e.pA,this.playerA),this.setPlayerState(e.pB,this.playerB),this.activePlayer=e.actP}pt2pb={["X"]:()=>{throw new Error("goof passed any to player target boolean-o-fier")},["A"]:()=>!0,["B"]:()=>!1,["F"]:()=>this.getActiveB(),["E"]:()=>!this.getActiveB()};b2p(t){return t?this.playerA:this.playerB}toPlayer(t){return typeof t=="boolean"?this.b2p(t):typeof t=="string"?this.b2p(this.pt2pb[t]()):t}toBool(t){return typeof t=="boolean"?t:typeof t=="string"?this.pt2pb[t]():t.isPlayerA}toTarget(t){return typeof t=="string"?t:(typeof t=="boolean"?t:t.isPlayerA)?"A":"B"}getActive(){return this.b2p(this.activePlayer)}getActiveB(){return this.activePlayer}getLocal(){return this.b2p(this.isLocalA)}getLocalB(){return this.isLocalA}hurtPlayer(t,e){if(e<1)return 0;const i=this.totalArmor(t),s=Math.max(Math.min(e,i-t.armorDmg),0);let h=e-s;return t.armorDmg+=s,t.health-=h,h}hurtDirect(t,e,i){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(p.new().crd(i).txt(` dealt ${h} dmg to `).plr(s).txt(".").go(),x.addEvents(V.damage(!1,h,!1,!1,s.isPlayerA,void 0)),re.playerHealthChange())}hurtBattle(t,e,i){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(p.new().crd(i.code).txt(` dealt ${h} battle dmg to `).plr(s).txt(".").go(),x.addEvents(V.damage(!0,h,!0,!1,s.isPlayerA,i)))}heal(t,e){const i=this.toPlayer(t);i.health+=e,p.new().plr(i).txt(` gained ${e} health.`).go(),x.addEvents(V.playerHeal(i.isPlayerA,e)),re.playerHealthChange()}drawCard(t,e){const i=this.toPlayer(t);for(let s=0;ss.granter===e?(s.type==="AR"&&(i.armorDmg=Math.max(0,i.armorDmg-s.value)),!1):!0)}removeModSafe(t,e){const i=this.toPlayer(t);this.hasMod(i,e)&&this.removeMod(i,e)}expireMod(t,e){const i=this.toPlayer(t);i.mods.splice(y.modIdx(i.mods,e),1)}newPlayer(t){return{hand:[],deck:[],discard:[],isPlayerA:t,health:120,mods:[],name:"",nameOffset:0,triggers:[],turn:1,rank:1,armor:0,armorDmg:0,poison:0,avatar:Math.floor(Math.random()*17)}}initPlayer(t,e,i,s){const h=this.toPlayer(t);h.name=i,h.nameOffset=s,h.turn=1,h.rank=1,h.health=T.options.highHealth?360:120,h.discard=[],h.deck=Jt.parseDeck(e),h.mods=[],h.triggers=[],h.poison=0,h.armor=0,h.armorDmg=0,this.ambushScan(h),Jt.shuffleDeck(h),h.hand=h.deck.splice(-5,5)}ambushScan(t){this.boosh(t,"LLD","PC"),this.boosh(t,"LLG","MV"),this.boosh(t,"LLS","EF"),this.boosh(t,"LLT","LG")}boosh(t,e,i){const s=e+"1";if(t.deck.includes(s)){const h=y.trigger(i,s);h.cardCode=s,h.customCode="AB",t.triggers.push(h)}}nameOSaurus(){const t=[["The Garmgunt",5],["Dr. Lucksack",15],["Sgt. Misplay",22],["Salty O'Teary",12],["M.V.P. Sprout",19],["Uncle Punchy",7],["Yesetherian",20],["Rubbish Asir",20],["Hogwash Druid",0],["Offal Savant",15],["Filth Knight",17],["Dirty Mystic",16],["Ether Buffoon",6],["Nexus Dimwit",12],["Hairy Poppins",11],["Al E. Gator",26],["Anita Bath",28],["Bennie Factor",9],["Chris P. Bacon",9],["Don Keigh",29],["Earl E. Bird",25],["Hugh Jass",34],["Jay Walker",28],["Barb Dwyer",22],["Robyn Banks",18],["Anna Graham",9],["Holly Graham",6],["Justin Case",26],["Sir Loins",39]],e=t[T.randInt(0,t.length)];return[e[0],e[1]+18]}}const v=new Rs;class Es{stateStack=[];popCheck(){if(this.stateStack.length===0)throw new Error("Attempted to manipulate empty stack")}saveState(){const t={action:S.getState(),aiInPhase:ot.inPhase,batch:x.getState(),death:U.getState(),field:g.getState(),game:R.getState(),mode:JSON.stringify(bt.stack),phase:Lt.phase,player:v.getState(),turn:E.getState()};this.stateStack.push(t)}restoreState(){this.popCheck();const t=this.stateStack[this.stateStack.length-1];S.setState(t.action),ot.inPhase=t.aiInPhase,x.setState(t.batch),U.setState(t.death),g.setState(t.field),R.setState(t.game.i,t.game.t),bt.stack=JSON.parse(t.mode),Lt.phase=t.phase,v.setState(t.player),E.setState(t.turn)}popState(){this.popCheck(),this.stateStack.pop()}}const ue=new Es;class Is{toActions(t){return(Array.isArray(t)?t:[t]).map(i=>{const s=this.actionTargGuts(i);return s.forEach(h=>{h.host=i.host,h.param=i.param,h.hint=i.hint}),s}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(e=>y.handSelectAction(t.key,e[0],"",e[1]));if(t.target==="TF"){if(t.field==="O")return g.creatByTarget(t).map(e=>y.fieldSelectAction(t.key,e.lane,e.owner));{const e=t.player==="X"?[!0,!1]:[v.toBool(t.player)],i=T.isUn(t.lanes)?g.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return e.map(s=>i.map(h=>y.fieldSelectAction(t.key,h,s))).flat();if(t.field==="E")return e.map(s=>g.emptyLanes(s).filter(h=>i.includes(h)).map(h=>y.fieldSelectAction(t.key,h,s))).flat()}}if(t.target==="TP")return t.player==="X"?[y.playerSelectAction(t.key,!0),y.playerSelectAction(t.key,!1)]:[y.playerSelectAction(t.key,v.toBool(t.player))];if(t.target==="TB")return[{key:t.key,zone:"B",host:t.host,param:""}];if(t.target==="TR")return[{key:t.key,zone:"R",host:t.host,param:""}];if(t.target==="TD")return[];throw new Error("Target encountered that doesnt have mappings to actions: "+t.target)}cardByTarget(t,e){let i=t.map((s,h)=>[s,h]);if(e){if(T.isUn(e.deckPositionSkip)||(i=i.filter(s=>s[1]!==e.deckPositionSkip)),e.faction!=="X"&&(i=i.filter(s=>L.getCard(s[0]).faction===e.faction)),e.tribe!=="AN"&&(i=i.filter(s=>{const h=L.getCard(s[0]);return h.type==="C"?h.isTribe(e.tribe):!1})),e.canLevel&&(i=i.filter(s=>L.getCard(s[0]).canLevel())),e.level!=="LA"){const s=D.levelTargetToLevel(e.level);i=i.filter(h=>{const f=parseInt(h[0].substring(3,4));return s.includes(f)})}if(e.card!=="A"){const s=e.card==="C"?"C":"S";i=i.filter(h=>L.getCard(h[0]).type===s)}e.cardCode&&(i=i.filter(s=>L.getCard(s[0]).cardCode()===e.cardCode))}return i}deckByTarget(t){const e=v.toPlayer(t.player);let i;if(t.target==="TH")i=e.hand;else if(t.target==="TD")i=e.discard;else if(t.target==="DK")i=e.deck;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(i,t)}buttonTarget(t,e="",i=""){return y.actionTarget("TB",t,e,i)}boardTarget(t,e){return y.actionTarget("TR",t,e,"")}ddf2(t){return t===1?"L1":t===2?"LN":"LA"}lt2l={["LA"]:()=>[1,2,3,4],["L1"]:()=>[1],["L2"]:()=>[2],["L3"]:()=>[3],["LN"]:()=>[1,2]};levelTargetToLevel(t){return this.lt2l[t]()}levelTargetTest(t,e){return this.levelTargetToLevel(t).includes(e)}levelTestCommon(t,e){return this.levelTargetTest(this.ddf2(e),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}const D=new Is;class Ls{ddf8(t){return t.trigger.type==="FR"?this.forgeTriggerTest(t,!1):t.trigger.type==="VN"?this.vengeanceTriggerTest(t):t.trigger.type==="FK"?this.flankTriggerTest(t):t.trigger.type==="AS"?this.forgeTriggerTest(t,!0):t.trigger.type==="UP"?this.upgradeTriggerTest(t):t.trigger.type==="DM"&&t.event.code==="DMG"||t.trigger.type==="HG"&&t.event.code==="CHL"||t.trigger.type==="EF"&&t.event.code==="ENT"||t.trigger.type==="DS"&&t.event.code==="DIE"||t.trigger.type==="PC"&&t.event.code==="PLC"||t.trigger.type==="MV"&&t.event.code==="MOV"||t.trigger.type==="RP"&&t.event.code==="RPL"||t.trigger.type==="LG"&&t.event.code==="PHL"||t.trigger.type==="TS"&&t.event.code==="TRS"||t.trigger.type==="TE"&&t.event.code==="TRE"||t.trigger.type==="PT"&&t.event.code==="PTN"||t.trigger.type==="RU"&&t.event.code==="RKU"?this.generalTriggerTest(t):!1}resolve(t){t.trigger.interactive&&(t.host==="P"?console.error("Encountered player hosted trigger that is interactive!!"):x.iaTrigLane=g.jr5(t.creatId).lane),L.getCard(t.trigger.logicCode).jr8(t)}forgeTriggerTest(t,e){if(t.event.code==="ENT"){const i=t.event;if(i.forged){const s=g.jr5(t.creatId),h=s.id===i.creatId&&s.status==="A";return e&&h?!s.opposed:h}}return!1}upgradeTriggerTest(t){if(t.event.code==="RPL"){const e=t.event,i=g.searchById(t.creatId);if(i)return i.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const e=t.event,i=g.searchById(t.creatId);if(i)return i.status==="D"&&i.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const e=t.event,i=g.jr5(t.creatId);return i.status==="A"&&i.id===e.creatId}return!1}generalTriggerTest(t){return L.getCard(t.trigger.logicCode).ddf8(t)}}const qe=new Ls;class Gs{firstTurn=!0;mainBattle=!0;deathsA=[];deathsB=[];ffs=0;regularPlays=2;cardsPlayed=0;freeCards=[];newPre=[];newPost=[];getState(){const t={mB:this.mainBattle,dA:this.deathsA,dB:this.deathsB,cP:this.cardsPlayed,ffs:this.ffs,fC:this.freeCards,rP:this.regularPlays,n1:this.newPre,n2:this.newPost};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.mainBattle=e.mB,this.deathsA=e.dA,this.deathsB=e.dB,this.cardsPlayed=e.cP,this.ffs=e.ffs,this.freeCards=e.fC,this.regularPlays=e.rP,this.newPre=e.n1,this.newPost=e.n2}resetTurnData(){this.mainBattle=!0,this.deathsA=[],this.deathsB=[],this.ffs=0,this.regularPlays=2,this.cardsPlayed=0,this.freeCards=[],this.newPre=[],this.newPost=[],this.firstTurn&&(this.firstTurn=!1,this.regularPlays=1)}forgeCard(t,e,i,s){const h=this.cardPlayed(e,i,s),f=v.getActive();p.new().txt("Forged ").crd(h.code).txt(".").go(),g.birth(h,"F",f.isPlayerA,t.lane),S.actionDone()}levelAndDiscardA(t){return this.levelAndDiscard(t.card,t.position)}levelAndDiscard(t,e,i=!0,s="F"){const h=L.getCard(t),f=v.toPlayer(s);if(e>-1?f.hand.splice(e,1):p.debug("Bad play index: "+e+" ("+t+")"),!h.overload){const m=h.levelUpCard();f.discard.push(m),i&&m!==t&&p.new().plr(f).txt(" leveled a card.").go()}return h}cardPlayed(t,e,i,s=!1){const h=this.levelAndDiscard(t,i,s),f=v.getActive();if(e==="")this.regularPlays-=1;else if(e!=="FREE"){const m=this.freeCards.findIndex(A=>A.id===e);m>-1?this.freeCards.splice(m,1):console.error("Could not find free card rule!")}if(this.cardsPlayed+=1,!s){const m=V.playCard(t,f.isPlayerA);x.addEvents(m)}return h}passTheTurn(){if(v.activePlayer=!v.activePlayer,Lt.phase="WT",R.aiMode){if(!ot.simOn)if(R.aiActive=!R.aiActive,R.aiActive)ot.turnSims=0,ot.turnTime=0;else{const t=`🤖: ${this.calma(ot.turnSims)} pontifications in ${(ot.turnTime/1e3).toFixed(1)} seconds.`;p.new().txt(t).go()}}else v.isLocalA=v.activePlayer;this.startTurn()}calma(t){let e=t.toString();return e.length<4?e:e.length>6?e.slice(0,-6)+","+e.slice(-6,-3)+","+e.slice(-3):e.slice(0,-3)+","+e.slice(-3)}startTurn(){const t="------";ot.log&&R.aiActive&&R.aiMode&&console.log(t+" AI Turn Start "+t),ot.simOn||(p.new().txt(t).go(),p.new().plr(v.getActiveB()).txt(" starts turn.").go()),this.resetTurnData(),Lt.phase="ST",x.addEvents(V.player("TRS",v.getActiveB())),Lt.expireMods(),Lt.whatNext(!R.aiMode)}endTurn(){const t=v.getActive();t.discard.push(...t.hand),t.hand=[],t.turn++;const e=t.turn>4;x.addEvents(V.player("TRE",t.isPlayerA)),e&&(t.turn=1,t.rank++,p.new().plr(t).txt(" hits Rank "+t.rank+".").go(),x.addEvents(V.player("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],Jt.shuffleDeck(t.isPlayerA)),g.qActiveCreats().forEach(i=>{i.extraBattles=0}),v.drawCard(t,5),Lt.phase="ET",S.actionDone()}mobility(t){const e=g.jr5(t.param);p.new().crd(e.code).txt(" moved.").go(),e.mobilityAvailable=!1,e.move(t.lane),S.actionDone()}allied(t,e){const i=e??v.getActive(),s=y.target("TH");return s.player=v.toTarget(i),s.faction=t,D.deckByTarget(s).length>0}freeCard(t){const e=y.freeCard(t);return this.freeCards.push(e),e}birthRegistrar(t){this.mainBattle?this.newPre.push(t):this.newPost.push(t)}}const E=new Gs;class ci{id;dom;context;width;height;constructor(t){if(this.id=t,this.dom=document.getElementById(t),!this.dom)throw new Error(`Could not find canvas id ${t}`);this.context=this.dom.getContext("2d"),this.width=this.dom.width,this.height=this.dom.height,this.context.textBaseline="top",this.context.shadowOffsetX=1,this.context.shadowOffsetY=1}show(){this.dom.hidden=!1}hide(){this.dom.hidden=!0}get visible(){return!this.dom.hidden}clear(){this.context.clearRect(0,0,this.width,this.height)}sprite(t,e,i){this.context.drawImage(t,e,i)}updateScale(t){this.context.scale(t,t)}}class It{getCanv(t){return t instanceof ci?t:rt.get(t)}async drawSprite(t,e,i,s,h={}){const f=this.getCanv(t).context,m=await T.getSprite(T.imgRoot+e);let A=1;h&&(A=h.alpha??1),A<1&&(f.globalAlpha=A),f.drawImage(m,i,s,m.naturalWidth,m.naturalHeight),A<1&&(f.globalAlpha=1)}async drawText(t,e,i,s,h={}){const f=this.getCanv(t).context,m=h.fontSize??24;T.pxRatio===2&&(s=this.retinaTextY(s,m)),f.fillStyle=h.colour||"#000000",f.font=`${m}px ${h.fontName||"cinzel"}`,f.shadowColor=h.shadow?"#000000":"#00000000",f.fillText(e,i,s),f.shadowColor="#00000000"}async spriteNumber(t,e,i,s,h,f){let m=i-this.numOffset(e,h);const A=[];e.toString().split("").forEach(C=>{A.push(this.drawSprite(t,this.numSpriteUrl(C,h,f),m,s)),m+=this.numSize(C,h)}),await Promise.all(A)}async drawHighlight(t,e,i,s,h,f="#00FF00"){const m=f.length===7?f.concat("aa"):f,A=this.getCanv(t);A.context.strokeStyle=m,A.context.beginPath(),A.context.rect(e,i,s,h),A.context.stroke()}hlColour(t){return t==="CANC"?"#FF0000":"#00FF00"}drawRarity(t,e,i,s){return this.drawSprite(t,`icons/rarity/new/${p.rarityText(e).toLowerCase()}.png`,i,s)}drawFaction(t,e,i,s){const h=e==="T"?2:0;return this.drawSprite(t,`icons/faction/${p.factionText(e).toLowerCase()}.png`,i+h,s+3)}retinaTextY(t,e){let i;return e<21?i=6:e<27?i=7:i=8,t-i}smallNumSize={"-":7,0:10,1:9,2:10,3:8,4:10,5:9,6:10,7:9,8:8,9:9};bigNumSize={"-":8,0:13,1:9,2:13,3:11,4:14,5:12,6:12,7:12,8:12,9:12};numSize(t,e){return e==="S"?this.smallNumSize[t]:this.bigNumSize[t]}numOffset(t,e){const i=t.toString().split("").reduce((s,h)=>s+this.numSize(h,e),0)-(e==="B"?2:1);return Math.floor(i/2)}numSpriteUrl(t,e,i){return`text/nums/${e}/${i}/${t}.png`}haze="#222222d8"}class fe extends It{async drawButton(t,e,i,s,h,f=7,m=!1,A=!0){let C,B;m?(C="ui/button/menu_on.png",B="#d7fc03"):(C="ui/button/menu_off.png",B="#00DEF7");const $=this.buttonBounds(e,i);if(await this.drawSprite(t,C,$[0],$[1]),await this.drawText(t,h,$[0]+7+f,$[1]+24,{colour:B,fontSize:30}),!m||A){const Y=new dt(s,...$,st.Both);tt.add(Y)}}async buttonMaker(t,e,i,s,h,f=7,m=!1,A=!0){const C={key:"MNBT",zone:"N",host:"",param:s};await this.drawButton(t,e,i,C,h,f,m,A)}buttonBounds(t,e){return[t-7,e-7,232,69]}}class je extends It{async makeIconButton(t,e,i,s){let f;f=`ui/button/ui_${s}.png`,await this.drawSprite(t,f,e,i);const m=y.basicAction("UIBT");m.param=s;const A=new dt(m,e,i,40,40,st.Both);tt.add(A)}async makeVScroller(t,e,i,s,h){const f=this.vScrollHilightBounds(e,i);await this.drawSprite(t,`ui/arrow/${s?"up":"down"}.png`,e,i);const m={zone:"N",key:h,host:"",param:s?"U":"D"},A=new dt(m,...f,st.Both);tt.add(A)}vScrollHilightBounds(t,e){return[t-3,e-3,40,27]}}class Ie extends It{async drawActions(t){if(bt.baseMode==="G"){const e=rt.get("effects"),i=t.filter(s=>s.zone==="B");if(i.length>1&&console.error("Two button actions encountered in one batch",i),i.length===0||R.aiActive||T.clickMode==="I"&&!bt.isDetailMode){const s=this.buttonBounds();await this.drawSprite(e,"ui/button/off.png",s[0],s[1])}else{const s=i[0],h=this.buttonBounds();await this.drawSprite(e,"ui/button/on.png",h[0],h[1]);let f;s.key==="CARD"?f=s.param:f=s.key,await this.drawSprite(e,`text/butt/${f}.png`,h[0]+23,h[1]+18);const m=this.highlightBounds(),A=new dt(s,...m);s.key==="CNCL"&&(A.mouse=st.Both),tt.add(A)}}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),e=5,i=[-1,-1,2,2];return t.map((s,h)=>s+e*i[h])}}class Zt extends It{async drawCard(t,e,i,s){const h=this.getCanv(e),f=this.extractStats(t),m=f.cardClass;if(await this.drawSprite(h,m.image(!1),i+14,s+35),await this.drawSprite(h,this.frameImg(m.level,m.faction,m.type,!1),i,s),await this.drawSprite(h,`text/card/${m.cardCode()}.png`,i+12,s+16),f.isCreature){const A=s+178;await this.spriteNumber(h,f.att,i+24,A,"S","Y"),await this.spriteNumber(h,f.hlt,i+127,A,"S","Y")}if(f.sleeping&&await this.drawSprite(h,"icons/effects/defensive.png",i+5,s+40,{alpha:.7}),f.iconList.length>0){const A=i+57-17*(f.iconList.length-1);await Promise.all(f.iconList.map(async(C,B)=>this.drawIcon(h,A+B*35,s+140,C[0],C[1])))}}async drawBigCard(t,e,i,s){const h=this.extractStats(e);if(await this.drawSprite(t,e.image(!0),i+38,s+117),await this.drawSprite(t,this.frameImg(e.level,e.faction,e.type,!0),i,s),e.rarity!=="T"&&await this.drawRarity(t,e.rarity,i+309,s+394),h.isCreature){const f=s+555;await this.spriteNumber(t,h.att,i+44,f,"B","Y"),await this.spriteNumber(t,h.hlt,i+325,f,"B","Y")}}async drawIcon(t,e,i,s,h=0){const f=this.getCanv(t);if(await this.drawSprite(f,`icons/effects/${s}.png`,e,i),h>0){const m=s==="poison"?12:9;await this.spriteNumber(f,h,e+17,i+m,"S","B")}}extractStats(t){let e,i=!1,s=0,h=0,f=!1,m=0,A=!1,C=!1,B=!1,$=!1,Y=0,J=0,ut=0,O=!1,it=!1;if(!(t instanceof Dt))i=!0,s=t.attack,h=t.health,f=t.sleeping&&!t.aggressive,m=t.regen,A=t.breakthrough,C=t.defender,B=t.aggressive,Y=t.armor,J=t.poison,ut=t.mobility,$=t.changed,e=L.getCard(t.code);else{if(t.type==="C"){i=!0;const At=t;s=At.iAttack,h=At.iHealth,m=At.iRegen,A=At.iBT,C=At.iDefend,B=At.iAggro,Y=At.iArmor,ut=At.iMobile}O=t.overload,it=t.consistent,e=t}const et=[];return O&&et.push(["overload",0]),it&&et.push(["consistent",0]),m>0&&et.push(["regenerate",m]),A&&et.push(["breakthrough",0]),C&&et.push(["defender",0]),B&&et.push(["aggressive",0]),Y>0&&et.push(["armor",Y]),J>0&&et.push(["poison",J]),ut>0&&et.push(["mobility",ut]),$&&et.push(["changed",0]),{cardClass:e,isCreature:i,iconList:et,hlt:h,att:s,sleeping:f}}async drawHilight(t,e,i,s="#00FF00"){await super.drawHighlight(t,...this.highlightBounds(e,i),s)}cardBounds(t,e){return[t,e,150,205]}highlightBounds(t,e){const i=this.cardBounds(t,e),s=5,h=[-1,-1,2,2];return i.map((f,m)=>f+s*h[m])}frameImg(t,e,i,s){return`frames/${s?"big":"small"}/lvl${t}_${e}${i}.png`}levelImg(t){return`icons/frame/lvl${t}.png`}oldFrameImg(t){return`icons/frame/frame${t}.png`}factionImg(t){return`icons/faction/orb${t}.png`}}const di=30,Le=540,ui=5;class fi extends It{async drawCards(t){const e=rt.get("hand");e.clear();const i=new Zt,s=i.highlightBounds(0,0)[2]+ui;let h=di;const f=this.paginatron(t);for(let m=f[0];m<=f[1];m++){const A=L.getCard(t.hand[m]);await i.drawCard(A,e,h,Le),h+=s}}async drawActions(t){const e=T.clickMode!=="I",i=rt.get("effects"),s=new Zt,h=s.highlightBounds(0,0)[2]+ui,f=new $t(0,520,1e3,250),m=new $t(0,520,1e3,250,st.Right),A=this.paginatron(v.getActive());await Promise.all(t.filter(C=>C.zone==="H").map(async C=>{const B=C;if(B.position>=A[0]&&B.position<=A[1]){const $=di+(B.position-A[0])*h;if(C.key==="DEET"){const Y=new dt(C,...s.highlightBounds($,Le),st.Right);m.addChild(Y)}else if(e){const Y=new dt(C,...s.highlightBounds($,Le));f.addChild(Y),await s.drawHilight(i,$,Le,this.hlColour(B.key))}}})),e&&tt.add(f),tt.add(m),A[0]>0&&await this.makeScroller(i,!1),A[1]0&&t.hand.length-e<5&&(e=Math.max(0,t.hand.length-5),R.ui.handScrollLeft=e),[e,Math.min(e+4,t.hand.length-1),t.hand.length-1]}scrollHilightBounds(t,e){return[t-3,e-2,27,38]}async makeScroller(t,e){const i=e?894:856,s=726,h=this.scrollHilightBounds(i,s);await this.drawSprite(t,`ui/arrow/${e?"right":"left"}.png`,i,s),await this.drawHighlight(t,...h);const f={zone:"N",key:"SCRH",host:"",param:e?"R":"L"},m=new dt(f,...h,st.Both);tt.add(m)}}class Je extends It{fieldBoundary=[17,62,821,443];async drawCards(t){const e=v.getLocalB(),i=rt.get("field");i.clear();const s=new Zt,h=g.qActiveCreats().map(f=>{let m=0;t&&t.scrappers.some(C=>C[0]===f.lane&&C[1]===f.owner)&&(m=t.battlePhase);const A=this.coordCalc(f.lane,f.owner,e,m);return s.drawCard(f,i,...A)});if(await Promise.all(h),x.iaTrigLane>0){const f=this.coordCalc(x.iaTrigLane,v.getActiveB(),e),m=s.cardBounds(...f),A=m[1]+m[3]+11,C=m[0]+m[2]/2;await this.drawSprite(i,"icons/rewards/gold.png",C-10,A),await this.drawSprite(i,"icons/rewards/gold.png",C-35,A),await this.drawSprite(i,"icons/rewards/gold.png",C-60,A),await this.drawSprite(i,"icons/rewards/gold.png",C+15,A),await this.drawSprite(i,"icons/rewards/gold.png",C+40,A)}}async drawActions(t){const e=T.clickMode!=="I",i=v.getLocalB(),s=rt.get("effects"),h=new Zt,f=new $t(...this.fieldBoundary),m=new $t(...this.fieldBoundary,st.Right);await Promise.all(t.filter(A=>A.zone==="F"||A.zone==="R").map(async A=>{if(A.zone==="R"&&e){const C=new dt(A,...this.fieldBoundary);tt.add(C),await this.drawHighlight(s,...this.fieldBoundary)}else{const C=A,B=this.coordCalc(C.lane,C.playerA,i);if(A.key==="DEET"){const $=new dt(A,...h.highlightBounds(...B),st.Right);m.addChild($)}else if(e){const $=new dt(A,...h.highlightBounds(...B));f.addChild($),await h.drawHilight(s,...B,this.hlColour(C.key))}}})),e&&f.childs.length>0&&tt.add(f),m.childs.length>0&&tt.add(m)}async drawFight(t){if(t.length>0){const e={battlePhase:1,scrappers:t},i=72;await new Ie().drawActions([]),await this.drawCards(e),await T.sleep(i),e.battlePhase=2,await this.drawCards(e),await T.sleep(i),e.battlePhase=3,await this.drawCards(e),await T.sleep(i),e.battlePhase=4,await this.drawCards(e),await T.sleep(i+70),e.battlePhase=3,await this.drawCards(e),await T.sleep(i),e.battlePhase=2,await this.drawCards(e),await T.sleep(i),e.battlePhase=1,await this.drawCards(e),await T.sleep(i)}}coordCalc(t,e,i,s=0){const h=i===e,f=166,m=5;let A,C,B;return[A,B,C]=h?[22,290,1]:[687,65,-1],[A+(t-1)*f*C,B+s*m*(-1*C)]}}class Ae extends It{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,e,i,s){const h=this.getCanv(e);await this.drawSprite(h,`avatar/${this.avatars[t.avatar]}.jpg`,i+46,s+48),await this.drawSprite(h,"ui/player_frame.png",i,s),await this.drawSprite(h,"ui/player_health.png",i+10,s+102),await this.spriteNumber(h,t.health,i+45,s+149,"B","G"),await this.drawText(h,`Turn: ${t.turn} Rank: ${t.rank}`,i+25,s+210,{colour:"#f5f242",fontSize:20}),await this.drawText(h,t.name,i+t.nameOffset,s+185,{colour:"#42a4f5",fontSize:20});const f=v.totalPoison(t),m=v.totalArmor(t);if(f>0||m>0){const A=new Zt,C=s+9;f>0&&await A.drawIcon(h,i+15,C,"poison",f),m>0&&await A.drawIcon(h,i+150,C,"armor",m)}}async drawAllPlayers(){const t=rt.get("player");t.clear();const e=!R.aiActive,i=v.getLocal(),s=v.toPlayer(!i.isPlayerA);if(await this.drawPlayer(i,t,...this.playerOrigin(!0)),await this.drawPlayer(s,t,...this.playerOrigin(!1)),i.isPlayerA===v.getActiveB()){let h=862;const f=295,m=Array(E.regularPlays).fill("blue").concat(E.freeCards.map(C=>C.sourceCard)),A=[];m.forEach(C=>{let B;if(C==="blue")B=C;else if(B="green",e){const $={key:"DEET",zone:"N",host:"",param:C},Y=new dt($,h-1,f-1,28,41,st.Both);tt.add(Y)}A.push(this.drawSprite(t,`ui/${B}card.png`,h,f)),h+=30}),await Promise.all(A)}await this.drawDeckButton(t,i,!0,e),await this.drawDeckButton(t,i,!1,e)}async drawDeckButton(t,e,i,s){let h,f,m;if(i?(h=e.discard.length,f=935,m="T"):(h=e.deck.length,f=858,m="U"),await this.drawSprite(t,`ui/button/faction_${m}.png`,f,350),await this.spriteNumber(t,h,f+38,350+14,"S","Y"),h>0&&s){const C=y.basicAction("VWDK");C.param=i?"VD":"VR";const B=new dt(C,f,350,77,44,st.Both);tt.add(B)}}async drawActions(t){if(T.clickMode==="I")return;const e=rt.get("effects"),i=v.getLocalB();await Promise.all(t.filter(s=>s.zone==="P").map(s=>{const h=s,f=this.playerOrigin(h.playerA===i),m=this.highlightBounds(...f),A=new dt(s,...m);return tt.add(A),this.drawHighlight(e,...m)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,e){return[t+18,e+18,170,170]}highlightBounds(t,e){return this.playerBounds(t,e)}async drawGameOver(){const t=rt.get("field"),e=94,i=v.getLocalB(),s=R.winFlag,h=i&&s===1||!i&&s===-1;await this.drawSprite(t,`ui/you-${h?"win":"lose"}.png`,e,89),tt.removeAll();const f=new fe,m=rt.get("effects");await f.drawButton(m,e+62,520,y.menuButtonAction("MM"),"Main Menu",20,!1),await f.drawButton(m,e+389,520,y.menuButtonAction("RP"),"Replay",55,!1)}async drawAiGear(t,e){const h=t%6,f=Math.floor(t/6),m=rt.get("effects"),A=`icons/rewards/${e?"gold":"silver"}.png`;await this.drawSprite(m,A,862+h*24,255+f*24)}hwhipe(){rt.get("effects").clear()}}const gi=15,mi=15,$s=5;class Ws extends It{constructor(){super();const e=new Zt().highlightBounds(0,0);this.xOffset=e[2]+$s,this.yOffset=e[3]+25}xOffset;yOffset;async drawCards(){const t=rt.get("decklist");t.clear(),t.context.fillStyle=this.haze,t.context.fillRect(0,0,849,T.gameHeight);const e=new Zt,s=Ft.visibleContent().map((h,f)=>{const m=L.getCard(h.cardCode),A=this.listXY(f);return e.drawCard(m,t,...A).then(()=>{if(h.cardCount>0)return this.drawCount(t,A[0]+62,A[1]+163,h.cardCount)})});await Promise.all(s)}async drawActions(t){const e=rt.get("decklist"),i=new Zt,s=new je,h=T.clickMode!=="I",f=Ft.visibleContent(),m=R.ui,A=m.deckScroll,C=A+15,$=m.deckSummary?st.Both:st.Right,Y=new $t(...this.deckBoundary()),J=new $t(...this.deckBoundary(),$),ut=[];t.forEach(O=>{if(O.key==="DEET"){const it=O;if(it.position>=A&&it.positionAt.sourceIdx===it.position);if(et>-1){const At=this.listXY(et-A),ve=new dt(O,...i.highlightBounds(...At));Y.addChild(ve),ut.push(i.drawHilight(e,...At,this.hlColour(O.key)))}}}),h&&Y.childs.length>0&&tt.add(Y),J.childs.length>0&&tt.add(J),Ft.canPageDown&&ut.push(s.makeVScroller(e,319,723,!1,"SCRK")),Ft.canPageUp&&ut.push(s.makeVScroller(e,487,723,!0,"SCRK")),await Promise.all(ut)}async drawCount(t,e,i,s){await this.drawSprite(t,"ui/dullcard.png",e,i),await this.spriteNumber(t,s,e+13,i+13,"S","Y")}listXY(t){return[gi+t%5*this.xOffset,mi+Math.floor(t/5)*this.yOffset]}deckBoundary(){return[gi,mi,this.xOffset*5,this.yOffset*3]}}class Us extends It{async drawDetails(t){const e=[],i=rt.get("card");i.clear(),i.context.fillStyle=this.haze,i.context.fillRect(0,0,849,T.gameHeight);const s=30,h=30,f=L.getCard(jt.currentCard),m=new Zt;T.options.bigCards?e.push(m.drawBigCard(i,f,s,h)):e.push(m.drawCard(f,i,134,280));const A=435;let C=30;const B="#f5f242",$="#03fcfc",Y=33,J=23,ut=28;let O=f.name;for(;O.length>0;){C+=36;let St;if(O.length{for(;St.length>0;){let Yt;if(St.length1){const St=f.cardCode(),Yt=At===3?[19,147,270]:At===2?[78,216]:[0,98,196,294];et.forEach((he,$e)=>{e.push(this.drawLevelButton(i,St,he,40+Yt[$e],658,he===f.level))})}const ve=new fe;let Te=0;const Qe=513,_e=697,pi=74;bt.baseMode!=="G"&&(e.push(ve.drawButton(i,Qe,_e,t,"Close",62,!1)),Te++);const Ys=new dt(t,s,h,377,603,st.Both);if(tt.add(Ys),jt.canGoBack){const St=jt.goBackAction();e.push(ve.drawButton(i,Qe,this.buttonY(_e,Te,pi),St,"Back",72,!1)),Te++}jt.friendos.forEach(St=>{const Yt=L.getCard(St),he=jt.friendAction(St),$e=jt.friendTxt(Yt.cardCode());e.push(ve.drawButton(i,Qe,this.buttonY(_e,Te,pi),he,$e[1]||Yt.name,$e[0],!1)),Te++}),await Promise.all(e)}buttonY(t,e,i){return t-e*i}cardSummary(t){const e=p.factionText(t.faction),i=p.rarityText(t.rarity),s=p.cardTypeText(t.type);return`${e}, ${i} ${s}`}tribeSummary(t){return t.tribe.map(e=>p.tribeText(e)).join(" ")}async drawLevelButton(t,e,i,s,h,f){if(await this.drawSprite(t,`icons/frame/level${i}.png`,s,h),!f){const B=jt.levelAction(i),$=new dt(B,s-15,h-5,88,112,st.Both);tt.add($)}const A=L.getCard(`${e}${i}`).levelSpice(),C=[[-16,55],[41,55],[11,79]];await Promise.all(A.map((B,$)=>{const Y=s+C[$][0],J=h+C[$][1];if(B.icon==="A"||B.icon==="H"){let ut,O;return B.icon==="A"?(ut="icons/frame/attack.png",O=Y+17):(ut="icons/frame/health.png",O=Y+16),this.drawSprite(t,ut,Y-1,J-1).then(()=>this.spriteNumber(t,B.num,O,J+10,"S","Y"))}else{let ut=this.spiceIcon(B.icon);if(B.icon==="U"||B.icon==="D"||B.icon==="L"||B.icon==="N"){const O=`icons/effects/${ut}.png`;return this.drawSprite(t,O,Y-1,J-1).then(()=>this.spriteNumber(t,B.num,Y+16,J+10,"S","B"))}else return new Zt().drawIcon(t,Y,J,ut,B.num)}}))}spiceIcon(t){return t==="N"?"new":t==="D"?"damage":t==="U"?"buff":t==="V"?"mobility":t==="P"?"poison":t==="M"?"armor":t==="G"?"aggressive":t==="F"?"defender":t==="B"?"breakthrough":t==="R"?"regenerate":t==="L"?"life":t==="C"?"consistent":t==="O"?"overload":"whoops"}levelFun(t){return t.maxLevel===3?t.minLevel===1?[1,2,3]:[3]:t.maxLevel===t.minLevel?[t.minLevel]:t.maxLevel===4?[1,2,3,4]:[1,2]}}class Vs extends It{packLeft=22;packTop=190;packBoundary=[this.packLeft-5,this.packTop-10,537,480];async drawPack(t,e){const i=new Zt,s=T.clickMode!=="I",h=[],f=new $t(...this.packBoundary),m=new $t(...this.packBoundary,st.Right);t.filter(C=>C.pack).forEach(C=>{const B=this.coordCalcPack(C.index);if(C.key==="DRFT"){const $=L.getCard(C.param+"1");if(h.push(i.drawCard($,e,...B).then(()=>this.drawRarity(e,$.rarity,B[0]+112,B[1]+4))),s){const Y=new dt(C,...i.highlightBounds(...B));f.addChild(Y)}}else{const $=new dt(C,...i.highlightBounds(...B),st.Right);m.addChild($)}}),s&&f.childs.length>0&&tt.add(f),m.childs.length>0&&tt.add(m),await Promise.all(h)}async drawList(t,e){let i=170;const s=570,h=[],f=pt.picksAsDeck,m=new $t(s,i,600,600,st.Both),A=t,C=15,B=pt.scrollIdx;pt.canPageDown&&await this.makeScroller(e,!1),pt.canPageUp&&await this.makeScroller(e,!0),A.filter($=>!$.pack).forEach($=>{if($.index>=B&&$.index{const f=e.getFactTotal(h);if(f[2]===0)return[Promise.resolve()];{i+=75;const m=this.threeLine(t,i,s,f),A=this.drawFaction(t,h,i-8,s-39);return[m,A]}}).flat())}async threeLine(t,e,i,s){const h={colour:"#ffd865",fontSize:18,fontName:"serif"},f=30;await Promise.all(s.map((m,A)=>this.drawText(t,m.toString(),e,i+f*A,h)))}async drawDraftMenu(t){const e=new fe,i=new ke,s=240,h=80,f=45,m=34;let A=50,C=s;await i.headerText(A+28,C,"Opponent",t),C+=f,await e.buttonMaker(t,A,C,"DI","DUMB BOT",27,pt.vsAI,!1),C+=h,await e.buttonMaker(t,A,C,"DV","HUMAN",47,!pt.vsAI,!1),C+=h+16,await i.headerText(A+17,C,"Rarity Filter",t),C+=h-m-6,await this.rarityButton(t,A+20,C,"L",pt.getRarity("L")),await this.rarityButton(t,A+125,C,"H",pt.getRarity("H")),C+=h,await this.rarityButton(t,A+20,C,"R",pt.getRarity("R")),await this.rarityButton(t,A+125,C,"C",pt.getRarity("C")),C=s+f+h*5,await e.buttonMaker(t,A,C,"MM","MAIN MENU",16),A=404,C=s,await i.headerText(A+5,C,"Draft Modes",t),C+=f,await e.buttonMaker(t,A,C,"GP","GOOD PACKS",9,pt.fatPacks),C+=h,await e.buttonMaker(t,A,C,"LD","LEGENDARY",17,pt.legDraft),C+=h,await e.buttonMaker(t,A,C,"OD","OVERDRAFT",17,pt.overdraft),A=757,C=s,await i.headerText(A+76,C,"Sets",t),C+=f,await this.chestButton(t,A+3,C,1,pt.getSet(1)),await this.chestButton(t,A+124,C,2,pt.getSet(2)),C+=88,await this.chestButton(t,A+3,C,3,pt.getSet(3)),await this.chestButton(t,A+124,C,4,pt.getSet(4)),C+=88,await this.chestButton(t,A+3,C,5,pt.getSet(5)),C=s+f+h*5,await e.buttonMaker(t,A,C,"DN","NEXT",68)}async rarityButton(t,e,i,s,h){const f={key:"MNBT",zone:"N",host:"",param:T.enTil("DR",s)},m=`ui/button/rarity_${s}${h?"y":"n"}.png`;await this.drawSprite(t,m,e,i);const A=new dt(f,e,i,75,65,st.Both);tt.add(A)}async chestButton(t,e,i,s,h){const f={key:"MNBT",zone:"N",host:"",param:T.enTil("DT",s)},m=`icons/sets/Chest_Set${s}${h?"y":"n"}.png`;await this.drawSprite(t,m,e,i);const A=new dt(f,e,i,90,74,st.Both);tt.add(A)}}class Ge extends It{async drawSets(t,e){let i=200;const s=100,h=[],f=new $t(s,i,400,600);t.filter(m=>m.key==="DSET").forEach(m=>{const A=ge[parseInt(m.param)];h.push(this.drawText(e,A.name,s,i,{colour:"#f5f242"}),this.drawSprite(e,"icons/chest_small.png",s-48,i-5));const C=new dt(m,s,i-2,400,35,st.Both);f.addChild(C),i+=45}),tt.add(f),await Promise.all(h)}async drawList(t,e){let i=170;const s=570,h=[],f=new $t(s,i,600,600);t.filter(m=>m.key==="DECK").forEach(m=>{const A=T.deTil(m.param),C=Jt.stockDeckByName(A[0],A[1]);h.push(this.drawFaction(e,C.factions[0],s,i),this.drawText(e,C.name,s+65,i+7,{colour:"#f5f242"})),C.factions.length===2&&h.push(this.drawFaction(e,C.factions[1],s+28,i));const B=new dt(m,s,i-2,600,35,st.Both);f.addChild(B),i+=35}),await Promise.all(h),tt.add(f)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,h=Math.floor(t/3);return[22+s*176,200+h*235]}iAmError(t){const e=rt.get("game-ui");this.drawText(e,t,295,655,{colour:"#f5142e",fontSize:26})}async drawConstrMenu(t){const e=new fe,i=new ke,s=240,h=80,f=45;let m=50,A=s;await i.headerText(m+28,A,"Opponent",t),A+=f,await e.buttonMaker(t,m,A,"CI","DUMB BOT",27,Pt.vsAI,!1),A+=h,await e.buttonMaker(t,m,A,"CV","HUMAN",47,!Pt.vsAI,!1),A+=h*4,await e.buttonMaker(t,m,A,"MM","MAIN MENU",16),m=404,A=s,await i.headerText(m+46,A,"Player 1",t);const C=Pt.p1.mode;A+=f,await e.buttonMaker(t,m,A,T.enTil("CP","A"),"PRE-CON",39,C==="CP",!1),A+=h,await e.buttonMaker(t,m,A,T.enTil("CR","A"),"RANDOM",36,C==="CR",!1),A+=h,await e.buttonMaker(t,m,A,T.enTil("CX","A"),"SCRAMBLE",30,C==="CX",!1),A+=h,await e.buttonMaker(t,m,A,T.enTil("LK","A"),"LOAD FILE",32,C==="LK"),C==="LK"&&await this.drawFileDeck(t,m,A,Pt.p1.deck),m=757,A=s,await i.headerText(m+44,A,"Player 2",t);const B=Pt.p2.mode;A+=f,await e.buttonMaker(t,m,A,T.enTil("CP","B"),"PRE-CON",39,B==="CP",!1),A+=h,await e.buttonMaker(t,m,A,T.enTil("CR","B"),"RANDOM",36,B==="CR",!1),A+=h,await e.buttonMaker(t,m,A,T.enTil("CX","B"),"SCRAMBLE",30,B==="CX",!1),A+=h,await e.buttonMaker(t,m,A,T.enTil("LK","B"),"LOAD FILE",32,B==="LK"),B==="LK"&&await this.drawFileDeck(t,m,A,Pt.p2.deck),A+=h*2,await e.buttonMaker(t,m,A,"CN","NEXT",68)}async drawFileDeck(t,e,i,s){const h=i+89;await this.drawText(t,s.name.slice(0,20),e,i+70,{colour:"#f5f242",fontSize:18}),s.factions.length===1?await this.drawFaction(t,s.factions[0],e+96,h):(await this.drawFaction(t,s.factions[0],e+78,h),await this.drawFaction(t,s.factions[1],e+113,h))}}class ke extends It{async drawExtrasMenu(t){const e=new fe,i=240,s=80,h=45,f=34;let m=50,A=i;await this.headerText(m+28,A,"More Info",t),A+=h,await e.buttonMaker(t,m,A,"RU","RULES",66),A+=s,await e.buttonMaker(t,m,A,"FQ","INFO & FAQ",20),A+=s*4,await e.buttonMaker(t,m,A,"MM","MAIN MENU",16),m=404,A=i,await this.headerText(m+37,A,"UI Modes",t),A+=h,await e.buttonMaker(t,m,A,"90","90% SIZE",47,T.options.scale==="90"),A+=s,await e.buttonMaker(t,m,A,"BC","BIG CARDS",29,T.options.bigCards),A+=s+f,await this.headerText(m+12,A,"Game Modes",t),A+=s-f,await e.buttonMaker(t,m,A,"HH","BIG HEALTH",20,T.options.highHealth),A+=s,await e.buttonMaker(t,m,A,"CH","CHEATER",39,T.options.cheater),A+=s,await e.buttonMaker(t,m,A,"BB","BATTLE BARK",13,T.options.bark),m=757,A=i,await this.headerText(m+43,A,"Playmat",t),A+=h;const C=T.options.playmat==="vanilla";await e.buttonMaker(t,m,A,"vanilla","VANILLA",43,C,!C),A+=s;const B=T.options.playmat==="alloyin";await e.buttonMaker(t,m,A,"alloyin","ALLOYIN",43,B,!B),A+=s;const $=T.options.playmat==="nekrium";await e.buttonMaker(t,m,A,"nekrium","NEKRIUM",38,$,!$),A+=s;const Y=T.options.playmat==="tempys";await e.buttonMaker(t,m,A,"tempys","TEMPYS",51,Y,!Y),A+=s;const J=T.options.playmat==="uterra";await e.buttonMaker(t,m,A,"uterra","UTERRA",52,J,!J),await this.drawText(t,"v0.7.8",890,46,{fontSize:16,colour:"#7b68ee"})}async headerText(t,e,i,s){await this.drawText(s,i,t,e,{colour:"#f5f242",fontSize:30})}async drawPickerPlayer(t,e,i){let s;e?s="Player 1":i?s="Dumb Bot":s="Player 2",await this.headerText(54,75,s,t)}}class Os extends It{async drawMenu(t){let i=22;await this.drawSprite(t,"ui/button/constructed.png",778,i);const s=new dt(this.makeAction("C"),...this.buttHilightBounds(778,i),st.Both);tt.add(s),i=148,await this.drawSprite(t,"ui/button/draft.png",778,i);const h=new dt(this.makeAction("D"),...this.buttHilightBounds(778,i),st.Both);tt.add(h),i=508,await this.drawSprite(t,"ui/button/deck.png",778,i);const f=new dt(this.makeAction("B"),...this.buttHilightBounds(778,i),st.Both);tt.add(f),i=634,await this.drawSprite(t,"ui/button/info.png",778,i);const m=new dt(this.makeAction("I"),...this.buttHilightBounds(778,i),st.Both);tt.add(m);const A=y.basicAction("DBUG"),C=new dt(A,757,349,74,70,st.Right);tt.add(C),await this.drawSprite(t,"gwg/gwg_red.png",58,0)}buttBounds(t,e){return[t,e,242,113]}buttHilightBounds(t,e){const s=[-3,-3,6,6];return this.buttBounds(t,e).map((h,f)=>h+s[f])}makeAction(t){return{zone:"N",key:"MENU",host:"",param:t}}}class zs{gameWidth;gameHeight;spriteCache;dogAudio;_clickMode;pxRatio=1;options;imgRoot;constructor(){this.spriteCache={},this.imgRoot="./img/",this.gameWidth=1024,this.gameHeight=768,this.dogAudio=document.getElementById("dogbark"),this._clickMode="M",this.options={bark:!0,bigCards:!0,highHealth:!1,cheater:!1,playmat:"uterra",wasDrafting:!1,scale:"100",debug:!1}}randInt(t,e){return Math.floor(Math.random()*(e-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async getSprite(t){return this.spriteCache[t]||(this.spriteCache[t]=this.imageLoader(t)),this.spriteCache[t]}async bulkLoadSprite(t){await Promise.all(t.map(e=>this.getSprite(`${this.imgRoot}${e}`)))}dogBark(){this.dogAudio.volume=.2,this.dogAudio.play()}toggleDebug(){const t=!this.options.debug;this.options.debug=t,new Ge().iAmError("Debug mode "+(t?"ON":"OFF"))}enTil(...t){return t.join("~")}deTil(t){return t.split("~")}imageLoader(t){return new Promise(e=>{const i=new Image;i.onload=()=>{e(i)},i.src=t})}writeStorage(t,e){localStorage.setItem(t,e)}readStorage(t){return localStorage.getItem(t)}readStringStorage(t,e){const i=this.readStorage(t);return i===null?e:i}readBoolStorage(t,e){const i=this.readStorage(t);return i===null?e:i==="Y"}writeBoolStorage(t,e){this.writeStorage(t,e?"Y":"N")}restoreOptions(){const t=this.options;t.bark=this.readBoolStorage("bark",!1),t.bigCards=this.readBoolStorage("bigCards",!0),t.cheater=this.readBoolStorage("cheater",!1),t.highHealth=this.readBoolStorage("highHealth",!1),t.playmat=this.readStringStorage("playmat","uterra"),t.scale=this.readStringStorage("scale","100")}toggleOption(t){T.options[t]=!T.options[t],this.writeBoolStorage(t,T.options[t])}setClickMode(t){this._clickMode=t}get clickMode(){return this._clickMode}}const T=new zs;class Zs{log=!1;file=!1;makeReport(){if(!this.file&&!this.log)return;const t=Mt.map(s=>s.c);t.push("NDR","RSC","CGF","IZL","IZR","FUN","FWG","FWC","DZA");const e=t.map(s=>{const h=L.getCard(s+"1");return h.type==="C"?h.name+" "+this.cardGuts(h):""}).filter(Boolean).sort().join(` +`);if(this.file){var i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),i.setAttribute("download","guts.txt"),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}}cardGuts(t){const e=t.jr3(!0,3);e.sleeping=!1;const i=e.bonusTotal(),s=ot.levelBonusFormula(t,!1,!1)+ot.hintAdjuster(t);let h=ht.creatValueFormula(e),f=ht.threatFormula(e,[]),m=i.pHealth,A=i.bonus+s,C=1+i.count,B=h+i.value,$=f+i.attack,J=ht.ddp9Nugget(C,B,$,m,A).map(ut=>ut.toFixed(1)).join(" ");if(this.log&&(console.group("---- "+t.name+" "+t.level+" ----"),console.log("Attack: "+e.attack+"; Health: "+e.health),console.log("Creat Value Weight: "+h+"; Creat Threat Weight: "+f),console.log("Creat Value Bonus: "+i.value+"; Creat Threat Bonus: "+i.attack),console.log("Level Bonus: "+s+"; Raw Bonus: "+i.bonus),console.log("Player Bonus: "+i.pHealth+"; Count Bonus: "+i.count),console.log("Formula: Total, Count, Value, Threat, Player, Bonus"),console.log(J),console.groupEnd()),t.level{await document.fonts.ready;let n=[];document.fonts.forEach(O=>{O.load(),n.push(O.loaded)}),await Promise.all(n),["game-ui","field","player","hand","effects","decklist","card"].forEach(O=>{rt.register(O)});const e=rt.get("effects");e.context.lineWidth=2,T.pxRatio=window.devicePixelRatio;let i;(O=>{O.Neutral="N",O.Cancel="C",O.Down="D"})(i||(i={}));let s=!0,h=800,f="N",m;try{document.createEvent("TouchEvent"),T.setClickMode("T"),s=!1}catch{}const A=()=>{m&&(clearTimeout(m),m=void 0)},C=(O,it,et)=>{const At=tt.hitTest(O,it,et);At&&S.handleAction(At)},B=O=>{C(O.pageX,O.pageY,O.button)},$=O=>{O.touches.length>1?(f="C",A()):f==="N"&&(f="D",m=setTimeout(()=>{f="C";const it=O.touches[0];C(it.pageX,it.pageY,st.ForceRight),m=void 0},h))},Y=O=>{if(f==="D"){if(A(),f="N",O.changedTouches.length>0){const it=O.changedTouches[0];C(it.pageX,it.pageY,st.Left)}}else O.touches.length===0&&(f="N")},J=document.getElementById("solforge");s?(J.addEventListener("click",B),J.addEventListener("contextmenu",O=>(O.preventDefault(),B(O),!1))):(J.addEventListener("touchstart",$),J.addEventListener("touchend",Y)),window.sfapi={details:O=>{jt.init(O)},setLog:O=>{ot.setLog(O)},peekAll:()=>{ot.peekAllCards()},peekDeck:()=>{ot.peekDecks()},peekField:()=>{console.log(g.field)},dumb:()=>{console.log("Am I dumb? "+ot.dumb)},debug:()=>{T.toggleDebug()}},T.restoreOptions(),T.options.scale!=="100"&>.changeScale(T.options.scale),gt.drawAll(),new Zs().makeReport()}})();