diff --git a/play/dist/solforge.js b/play/dist/solforge.js index 02029c2..c341788 100644 --- a/play/dist/solforge.js +++ b/play/dist/solforge.js @@ -1 +1 @@ -(function(){"use strict";const se=["A","N","T","U"];const jt=["C","R","H","L"];const xt=[{crd:"AAK",fct:"T",rty:"L",set:1,typ:"C"},{crd:"AGC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"AGK",fct:"A",rty:"L",set:2.1,typ:"C"},{crd:"AGP",fct:"A",rty:"C",set:1.1,typ:"S"},{crd:"ASG",fct:"T",rty:"R",set:1,typ:"S"},{crd:"AFO",fct:"A",rty:"C",set:2.1,typ:"C"},{crd:"ATG",fct:"A",rty:"C",set:2,typ:"C"},{crd:"ART",fct:"U",rty:"H",set:2.1,typ:"C"},{crd:"AGM",fct:"T",rty:"L",set:2.2,typ:"C"},{crd:"ALG",fct:"A",rty:"R",set:1,typ:"C"},{crd:"AHL",fct:"A",rty:"H",set:1,typ:"C"},{crd:"ALS",fct:"A",rty:"H",set:2,typ:"C"},{crd:"AEN",fct:"A",rty:"C",set:2,typ:"C"},{crd:"APM",fct:"A",rty:"H",set:2,typ:"C"},{crd:"AQE",fct:"T",rty:"C",set:1,typ:"S"},{crd:"AGD",fct:"U",rty:"L",set:1,typ:"C"},{crd:"AFS",fct:"A",rty:"L",set:1,typ:"C"},{crd:"ABR",fct:"T",rty:"C",set:2,typ:"C"},{crd:"AMY",fct:"T",rty:"C",set:1,typ:"C"},{crd:"ABL",fct:"T",rty:"R",set:1,typ:"S"},{crd:"AGU",fct:"T",rty:"R",set:2.1,typ:"C"},{crd:"AIV",fct:"T",rty:"H",set:1,typ:"C"},{crd:"BTN",fct:"A",rty:"H",set:1,typ:"C"},{crd:"BLH",fct:"T",rty:"L",set:2,typ:"C"},{crd:"BSP",fct:"N",rty:"C",set:2.2,typ:"C"},{crd:"BWK",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BSR",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BMY",fct:"T",rty:"H",set:2.1,typ:"C"},{crd:"BTM",fct:"U",rty:"H",set:1,typ:"S"},{crd:"BAW",fct:"U",rty:"R",set:2,typ:"C"},{crd:"BWG",fct:"U",rty:"C",set:1,typ:"C"},{crd:"BWD",fct:"U",rty:"C",set:2,typ:"C"},{crd:"BSG",fct:"A",rty:"L",set:1,typ:"C"},{crd:"BSS",fct:"A",rty:"L",set:1,typ:"C"},{crd:"BTS",fct:"U",rty:"C",set:1.1,typ:"C"},{crd:"BWH",fct:"A",rty:"R",set:1,typ:"S"},{crd:"BZD",fct:"N",rty:"R",set:2,typ:"C"},{crd:"BFM",fct:"N",rty:"H",set:2.3,typ:"C"},{crd:"BSM",fct:"T",rty:"H",set:2,typ:"C"},{crd:"CDT",fct:"U",rty:"R",set:1,typ:"C"},{crd:"CTL",fct:"T",rty:"L",set:1,typ:"S"},{crd:"CHY",fct:"U",rty:"C",set:1,typ:"C"},{crd:"CHV",fct:"N",rty:"L",set:2,typ:"C"},{crd:"CTI",fct:"N",rty:"C",set:1.1,typ:"C"},{crd:"CHA",fct:"U",rty:"R",set:2.1,typ:"C"},{crd:"CHH",fct:"U",rty:"C",set:2,typ:"C"},{crd:"CHR",fct:"U",rty:"L",set:1,typ:"C"},{crd:"CDC",fct:"T",rty:"C",set:2,typ:"C"},{crd:"CFB",fct:"T",rty:"H",set:1,typ:"C"},{crd:"CNM",fct:"T",rty:"C",set:2,typ:"C"},{crd:"CSW",fct:"T",rty:"L",set:2.3,typ:"C"},{crd:"CCT",fct:"T",rty:"R",set:2,typ:"C"},{crd:"CFG",fct:"T",rty:"C",set:2,typ:"S"},{crd:"CSU",fct:"N",rty:"R",set:1,typ:"S"},{crd:"CCR",fct:"N",rty:"C",set:1,typ:"C"},{crd:"CSB",fct:"N",rty:"C",set:2,typ:"C"},{crd:"CRC",fct:"A",rty:"R",set:2,typ:"C"},{crd:"CYC",fct:"N",rty:"H",set:2,typ:"C"},{crd:"CTW",fct:"N",rty:"C",set:1,typ:"S"},{crd:"CTV",fct:"U",rty:"H",set:1,typ:"S"},{crd:"CAG",fct:"A",rty:"R",set:1,typ:"S"},{crd:"CBS",fct:"A",rty:"C",set:2.1,typ:"S"},{crd:"CIN",fct:"A",rty:"R",set:1.1,typ:"C"},{crd:"CSG",fct:"A",rty:"C",set:2,typ:"S"},{crd:"DFR",fct:"N",rty:"H",set:2,typ:"C"},{crd:"DHW",fct:"N",rty:"R",set:1,typ:"C"},{crd:"DSS",fct:"N",rty:"R",set:1,typ:"C"},{crd:"DCR",fct:"N",rty:"R",set:2,typ:"S"},{crd:"DSK",fct:"N",rty:"C",set:1,typ:"C"},{crd:"DBA",fct:"U",rty:"H",set:1,typ:"C"},{crd:"DBP",fct:"U",rty:"C",set:1,typ:"C"},{crd:"DMR",fct:"U",rty:"C",set:2,typ:"C"},{crd:"DBR",fct:"U",rty:"C",set:1,typ:"C"},{crd:"DCS",fct:"A",rty:"L",set:2,typ:"C"},{crd:"DGZ",fct:"A",rty:"R",set:2,typ:"S"},{crd:"DIS",fct:"T",rty:"R",set:1,typ:"S"},{crd:"DSV",fct:"U",rty:"R",set:2,typ:"S"},{crd:"DDD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"DBT",fct:"N",rty:"H",set:1,typ:"S"},{crd:"DFB",fct:"N",rty:"R",set:1,typ:"C"},{crd:"DMW",fct:"A",rty:"L",set:1.1,typ:"C"},{crd:"DCH",fct:"U",rty:"C",set:1,typ:"S"},{crd:"DSZ",fct:"N",rty:"C",set:2,typ:"C"},{crd:"DYB",fct:"U",rty:"R",set:2,typ:"S"},{crd:"ESK",fct:"N",rty:"H",set:2,typ:"C"},{crd:"EHW",fct:"U",rty:"L",set:1,typ:"C"},{crd:"ETN",fct:"A",rty:"C",set:1,typ:"S"},{crd:"EWE",fct:"T",rty:"H",set:2,typ:"C"},{crd:"ENP",fct:"A",rty:"H",set:1,typ:"S"},{crd:"ESU",fct:"A",rty:"R",set:1,typ:"S"},{crd:"ENR",fct:"U",rty:"C",set:1,typ:"S"},{crd:"EPD",fct:"N",rty:"H",set:1,typ:"S"},{crd:"ESC",fct:"A",rty:"H",set:2,typ:"C"},{crd:"ESP",fct:"U",rty:"H",set:2.3,typ:"C"},{crd:"EWT",fct:"U",rty:"R",set:2,typ:"C"},{crd:"EHN",fct:"U",rty:"C",set:1,typ:"C"},{crd:"EFM",fct:"T",rty:"L",set:2.1,typ:"C"},{crd:"EFP",fct:"T",rty:"L",set:1,typ:"C"},{crd:"EXD",fct:"N",rty:"H",set:1,typ:"S"},{crd:"FWB",fct:"U",rty:"C",set:2.3,typ:"C"},{crd:"FWR",fct:"U",rty:"C",set:1,typ:"C"},{crd:"FWK",fct:"N",rty:"C",set:1,typ:"C"},{crd:"FIN",fct:"U",rty:"C",set:1,typ:"S"},{crd:"FRR",fct:"U",rty:"H",set:1,typ:"S"},{crd:"FVA",fct:"T",rty:"H",set:1,typ:"S"},{crd:"FFU",fct:"T",rty:"H",set:1,typ:"C"},{crd:"FMS",fct:"T",rty:"C",set:2,typ:"C"},{crd:"FSM",fct:"T",rty:"H",set:1,typ:"S"},{crd:"FBC",fct:"T",rty:"L",set:1,typ:"C"},{crd:"FBI",fct:"T",rty:"H",set:2.2,typ:"C"},{crd:"FFS",fct:"T",rty:"R",set:2,typ:"C"},{crd:"FLN",fct:"T",rty:"R",set:2,typ:"S"},{crd:"FSS",fct:"T",rty:"R",set:1,typ:"C"},{crd:"FLS",fct:"T",rty:"C",set:1,typ:"C"},{crd:"FSH",fct:"T",rty:"R",set:1,typ:"C"},{crd:"FFD",fct:"N",rty:"H",set:1,typ:"C"},{crd:"FSP",fct:"A",rty:"L",set:1,typ:"C"},{crd:"FPR",fct:"T",rty:"C",set:2.1,typ:"C"},{crd:"FFL",fct:"A",rty:"C",set:1,typ:"S"},{crd:"FGA",fct:"A",rty:"C",set:1,typ:"C"},{crd:"FGB",fct:"A",rty:"R",set:1,typ:"C"},{crd:"FGG",fct:"A",rty:"H",set:1,typ:"C"},{crd:"FPS",fct:"A",rty:"C",set:1,typ:"C"},{crd:"FSK",fct:"T",rty:"C",set:2.3,typ:"S"},{crd:"FWT",fct:"U",rty:"H",set:1,typ:"C"},{crd:"FZS",fct:"T",rty:"R",set:1,typ:"S"},{crd:"GHS",fct:"U",rty:"C",set:2.2,typ:"C"},{crd:"GHB",fct:"U",rty:"R",set:1,typ:"C"},{crd:"GRN",fct:"N",rty:"C",set:2,typ:"S"},{crd:"GTH",fct:"N",rty:"C",set:1,typ:"S"},{crd:"GSC",fct:"U",rty:"C",set:1,typ:"C"},{crd:"GMP",fct:"A",rty:"L",set:1,typ:"C"},{crd:"GTT",fct:"T",rty:"L",set:2,typ:"C"},{crd:"GCL",fct:"T",rty:"C",set:1,typ:"C"},{crd:"GCR",fct:"T",rty:"C",set:2,typ:"S"},{crd:"GLF",fct:"N",rty:"C",set:2,typ:"C"},{crd:"GRW",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GSW",fct:"N",rty:"C",set:2,typ:"C"},{crd:"GVS",fct:"U",rty:"C",set:2,typ:"C"},{crd:"GSS",fct:"U",rty:"C",set:1,typ:"C"},{crd:"GBG",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GGE",fct:"N",rty:"C",set:2,typ:"C"},{crd:"GGH",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GRP",fct:"N",rty:"R",set:1,typ:"S"},{crd:"GGD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"GGP",fct:"N",rty:"H",set:1,typ:"C"},{crd:"GGS",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GRM",fct:"N",rty:"R",set:2,typ:"S"},{crd:"GHT",fct:"U",rty:"C",set:1,typ:"C"},{crd:"GMR",fct:"U",rty:"C",set:1,typ:"C"},{crd:"HTR",fct:"U",rty:"L",set:1,typ:"C"},{crd:"HAR",fct:"A",rty:"C",set:1,typ:"C"},{crd:"HFA",fct:"N",rty:"H",set:1,typ:"C"},{crd:"HWM",fct:"A",rty:"L",set:1,typ:"C"},{crd:"HGS",fct:"N",rty:"R",set:1,typ:"C"},{crd:"HTP",fct:"U",rty:"C",set:1,typ:"C"},{crd:"IBF",fct:"T",rty:"R",set:1,typ:"S"},{crd:"ITO",fct:"T",rty:"R",set:2,typ:"S"},{crd:"IWC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"IHA",fct:"A",rty:"L",set:2,typ:"C"},{crd:"IMA",fct:"A",rty:"L",set:2.3,typ:"C"},{crd:"JPK",fct:"A",rty:"C",set:1,typ:"S"},{crd:"KAW",fct:"T",rty:"L",set:1.1,typ:"C"},{crd:"KOD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"KKK",fct:"T",rty:"L",set:2,typ:"C"},{crd:"LKP",fct:"U",rty:"L",set:1,typ:"C"},{crd:"LGT",fct:"N",rty:"R",set:2.3,typ:"C"},{crd:"LBD",fct:"U",rty:"H",set:1,typ:"C"},{crd:"LSS",fct:"U",rty:"R",set:1,typ:"C"},{crd:"LBL",fct:"U",rty:"R",set:1,typ:"C"},{crd:"LBR",fct:"T",rty:"C",set:1,typ:"S"},{crd:"LSK",fct:"T",rty:"C",set:1,typ:"S"},{crd:"LWY",fct:"T",rty:"C",set:1,typ:"C"},{crd:"LSP",fct:"A",rty:"C",set:1,typ:"C"},{crd:"LMV",fct:"N",rty:"L",set:1,typ:"C"},{crd:"LHY",fct:"U",rty:"C",set:2,typ:"C"},{crd:"MMH",fct:"T",rty:"C",set:1,typ:"C"},{crd:"MRF",fct:"N",rty:"C",set:1,typ:"C"},{crd:"MOE",fct:"T",rty:"H",set:1,typ:"C"},{crd:"MXW",fct:"A",rty:"C",set:1,typ:"C"},{crd:"MSP",fct:"U",rty:"R",set:2,typ:"S"},{crd:"MMA",fct:"A",rty:"C",set:1,typ:"C"},{crd:"MMX",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMO",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMV",fct:"A",rty:"C",set:2.2,typ:"C"},{crd:"MSC",fct:"A",rty:"H",set:1,typ:"S"},{crd:"MTS",fct:"A",rty:"C",set:1.1,typ:"S"},{crd:"MTT",fct:"A",rty:"C",set:2,typ:"S"},{crd:"MML",fct:"U",rty:"H",set:2,typ:"C"},{crd:"MMW",fct:"U",rty:"L",set:2.2,typ:"C"},{crd:"MBP",fct:"U",rty:"H",set:1,typ:"C"},{crd:"MND",fct:"A",rty:"R",set:1,typ:"C"},{crd:"NGB",fct:"T",rty:"C",set:1,typ:"C"},{crd:"NSL",fct:"U",rty:"R",set:1,typ:"S"},{crd:"NCS",fct:"N",rty:"R",set:1,typ:"C"},{crd:"NCW",fct:"N",rty:"C",set:1,typ:"C"},{crd:"NCV",fct:"N",rty:"C",set:1,typ:"S"},{crd:"NEM",fct:"N",rty:"C",set:1,typ:"S"},{crd:"NSH",fct:"N",rty:"L",set:2.3,typ:"S"},{crd:"NXC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"NXP",fct:"A",rty:"C",set:1,typ:"C"},{crd:"NXT",fct:"A",rty:"H",set:2,typ:"C"},{crd:"NGT",fct:"N",rty:"R",set:2,typ:"C"},{crd:"NCL",fct:"U",rty:"R",set:1.1,typ:"S"},{crd:"NFF",fct:"U",rty:"L",set:2,typ:"C"},{crd:"NOZ",fct:"N",rty:"R",set:2,typ:"C"},{crd:"NSY",fct:"N",rty:"C",set:2.1,typ:"C"},{crd:"ONN",fct:"N",rty:"H",set:1.1,typ:"S"},{crd:"OXA",fct:"A",rty:"H",set:2.3,typ:"C"},{crd:"OXM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"OXP",fct:"N",rty:"H",set:2,typ:"C"},{crd:"OBD",fct:"A",rty:"H",set:1,typ:"C"},{crd:"OFM",fct:"A",rty:"R",set:2.1,typ:"C"},{crd:"OJC",fct:"A",rty:"H",set:1.1,typ:"C"},{crd:"OPK",fct:"A",rty:"R",set:2,typ:"C"},{crd:"OWW",fct:"A",rty:"L",set:1,typ:"C"},{crd:"OHV",fct:"N",rty:"R",set:2,typ:"C"},{crd:"ODC",fct:"U",rty:"L",set:2,typ:"C"},{crd:"OSP",fct:"N",rty:"R",set:2,typ:"C"},{crd:"OWF",fct:"A",rty:"H",set:2,typ:"S"},{crd:"OXS",fct:"U",rty:"R",set:1,typ:"C"},{crd:"PHM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"PPM",fct:"A",rty:"R",set:1,typ:"C"},{crd:"PSM",fct:"A",rty:"L",set:2.2,typ:"C"},{crd:"PHS",fct:"A",rty:"R",set:2.2,typ:"C"},{crd:"PTB",fct:"U",rty:"H",set:1,typ:"S"},{crd:"PSC",fct:"U",rty:"R",set:2,typ:"C"},{crd:"PTR",fct:"A",rty:"R",set:2,typ:"S"},{crd:"PSG",fct:"U",rty:"R",set:1,typ:"S"},{crd:"PMS",fct:"T",rty:"C",set:1,typ:"S"},{crd:"PYG",fct:"T",rty:"H",set:1,typ:"C"},{crd:"PYS",fct:"T",rty:"C",set:1.1,typ:"S"},{crd:"RBH",fct:"T",rty:"L",set:1,typ:"C"},{crd:"RTS",fct:"T",rty:"C",set:2.2,typ:"C"},{crd:"RLW",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RFL",fct:"T",rty:"R",set:1,typ:"C"},{crd:"RHC",fct:"T",rty:"C",set:1,typ:"C"},{crd:"ROG",fct:"N",rty:"H",set:1,typ:"S"},{crd:"RFA",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RBG",fct:"U",rty:"H",set:2,typ:"C"},{crd:"RGG",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RSZ",fct:"N",rty:"R",set:1.1,typ:"C"},{crd:"SAP",fct:"A",rty:"C",set:2,typ:"S"},{crd:"SVO",fct:"U",rty:"C",set:2.1,typ:"S"},{crd:"SSE",fct:"U",rty:"L",set:2.1,typ:"C"},{crd:"SCS",fct:"N",rty:"C",set:1,typ:"C"},{crd:"SMD",fct:"T",rty:"L",set:1,typ:"C"},{crd:"SFS",fct:"N",rty:"L",set:1,typ:"C"},{crd:"SCD",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SFT",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SAD",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SHG",fct:"N",rty:"L",set:2,typ:"S"},{crd:"SPD",fct:"U",rty:"R",set:1,typ:"C"},{crd:"SPM",fct:"U",rty:"L",set:1,typ:"C"},{crd:"STD",fct:"A",rty:"H",set:2.2,typ:"C"},{crd:"SHS",fct:"U",rty:"R",set:2.2,typ:"C"},{crd:"SGF",fct:"N",rty:"H",set:2.2,typ:"C"},{crd:"SKG",fct:"A",rty:"C",set:2,typ:"C"},{crd:"SSR",fct:"U",rty:"L",set:2,typ:"C"},{crd:"SNB",fct:"A",rty:"C",set:2.3,typ:"S"},{crd:"SNP",fct:"A",rty:"H",set:1,typ:"S"},{crd:"SRD",fct:"U",rty:"C",set:1,typ:"S"},{crd:"SRH",fct:"N",rty:"C",set:2.3,typ:"C"},{crd:"SDN",fct:"N",rty:"L",set:1,typ:"C"},{crd:"SHV",fct:"N",rty:"H",set:1,typ:"S"},{crd:"SBA",fct:"A",rty:"C",set:1,typ:"C"},{crd:"SKB",fct:"A",rty:"C",set:1,typ:"C"},{crd:"SBR",fct:"T",rty:"C",set:2,typ:"C"},{crd:"SBD",fct:"U",rty:"C",set:2.1,typ:"C"},{crd:"SFM",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SSN",fct:"A",rty:"C",set:2.2,typ:"C"},{crd:"SSM",fct:"T",rty:"C",set:2.2,typ:"C"},{crd:"SLH",fct:"N",rty:"C",set:2,typ:"S"},{crd:"SRV",fct:"N",rty:"R",set:2.2,typ:"C"},{crd:"STR",fct:"N",rty:"R",set:2,typ:"S"},{crd:"SSA",fct:"N",rty:"H",set:2.1,typ:"C"},{crd:"STO",fct:"U",rty:"R",set:2,typ:"S"},{crd:"SDR",fct:"U",rty:"R",set:1,typ:"C"},{crd:"SHK",fct:"T",rty:"H",set:1,typ:"S"},{crd:"SWR",fct:"A",rty:"R",set:1,typ:"C"},{crd:"SFA",fct:"A",rty:"H",set:1,typ:"C"},{crd:"STG",fct:"A",rty:"L",set:2,typ:"C"},{crd:"SSS",fct:"A",rty:"R",set:1,typ:"C"},{crd:"SWM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"STN",fct:"T",rty:"R",set:2,typ:"S"},{crd:"SGI",fct:"T",rty:"C",set:1,typ:"C"},{crd:"SBG",fct:"T",rty:"L",set:1,typ:"C"},{crd:"SCL",fct:"T",rty:"C",set:1,typ:"C"},{crd:"SGA",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SSG",fct:"U",rty:"C",set:2,typ:"C"},{crd:"SVH",fct:"U",rty:"C",set:2.3,typ:"C"},{crd:"SIN",fct:"U",rty:"C",set:1.1,typ:"S"},{crd:"SYL",fct:"U",rty:"H",set:2.2,typ:"C"},{crd:"SML",fct:"U",rty:"C",set:1,typ:"C"},{crd:"SYO",fct:"A",rty:"L",set:1,typ:"C"},{crd:"TST",fct:"T",rty:"C",set:2,typ:"S"},{crd:"TBA",fct:"U",rty:"L",set:1,typ:"C"},{crd:"TGS",fct:"U",rty:"C",set:2,typ:"C"},{crd:"TPT",fct:"N",rty:"C",set:2.1,typ:"S"},{crd:"TDW",fct:"N",rty:"R",set:1.1,typ:"C"},{crd:"TGN",fct:"A",rty:"C",set:2,typ:"C"},{crd:"TSM",fct:"A",rty:"C",set:1,typ:"C"},{crd:"TUP",fct:"A",rty:"R",set:1,typ:"S"},{crd:"TGI",fct:"T",rty:"R",set:2,typ:"C"},{crd:"TDS",fct:"U",rty:"L",set:1.1,typ:"C"},{crd:"TOB",fct:"N",rty:"R",set:1,typ:"S"},{crd:"TWS",fct:"A",rty:"C",set:2,typ:"C"},{crd:"TVG",fct:"A",rty:"R",set:1.1,typ:"C"},{crd:"TXS",fct:"U",rty:"C",set:1,typ:"S"},{crd:"TCG",fct:"T",rty:"C",set:2.1,typ:"S"},{crd:"TRN",fct:"T",rty:"H",set:2,typ:"S"},{crd:"TWG",fct:"U",rty:"C",set:2,typ:"S"},{crd:"UGM",fct:"U",rty:"C",set:2.2,typ:"C"},{crd:"UGL",fct:"T",rty:"R",set:2,typ:"C"},{crd:"UIC",fct:"T",rty:"H",set:2.3,typ:"C"},{crd:"ULR",fct:"U",rty:"H",set:2,typ:"C"},{crd:"URD",fct:"N",rty:"H",set:1,typ:"C"},{crd:"UBL",fct:"T",rty:"R",set:1,typ:"S"},{crd:"UCM",fct:"T",rty:"R",set:1,typ:"C"},{crd:"UHS",fct:"T",rty:"H",set:2,typ:"C"},{crd:"UIM",fct:"T",rty:"C",set:2,typ:"C"},{crd:"UWL",fct:"T",rty:"H",set:2,typ:"C"},{crd:"UWS",fct:"T",rty:"R",set:2.3,typ:"C"},{crd:"UTM",fct:"U",rty:"C",set:2,typ:"C"},{crd:"UTR",fct:"U",rty:"H",set:2,typ:"C"},{crd:"URB",fct:"U",rty:"L",set:2.3,typ:"C"},{crd:"UPM",fct:"U",rty:"L",set:1,typ:"C"},{crd:"VRP",fct:"N",rty:"L",set:2,typ:"S"},{crd:"VBK",fct:"A",rty:"R",set:2,typ:"C"},{crd:"VTC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"VGN",fct:"N",rty:"C",set:1,typ:"C"},{crd:"VNF",fct:"U",rty:"R",set:1.1,typ:"C"},{crd:"VNS",fct:"U",rty:"H",set:2,typ:"C"},{crd:"VGR",fct:"U",rty:"C",set:2,typ:"S"},{crd:"VCG",fct:"T",rty:"C",set:1,typ:"C"},{crd:"VES",fct:"N",rty:"L",set:2.1,typ:"C"},{crd:"VYE",fct:"N",rty:"C",set:2,typ:"S"},{crd:"WBY",fct:"T",rty:"R",set:2,typ:"C"},{crd:"WBU",fct:"T",rty:"C",set:1.1,typ:"C"},{crd:"WMR",fct:"A",rty:"H",set:2.1,typ:"C"},{crd:"WMM",fct:"A",rty:"H",set:1,typ:"C"},{crd:"WTW",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WWP",fct:"U",rty:"H",set:1.1,typ:"C"},{crd:"WFM",fct:"T",rty:"H",set:1.1,typ:"C"},{crd:"WWS",fct:"U",rty:"R",set:1,typ:"C"},{crd:"WBH",fct:"T",rty:"R",set:1.1,typ:"C"},{crd:"WCS",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WPD",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WFB",fct:"N",rty:"C",set:1.1,typ:"C"},{crd:"WFS",fct:"N",rty:"H",set:1,typ:"C"},{crd:"WBG",fct:"N",rty:"L",set:1.1,typ:"C"},{crd:"XCR",fct:"N",rty:"C",set:2,typ:"C"},{crd:"XHS",fct:"N",rty:"C",set:2.2,typ:"C"},{crd:"XHU",fct:"N",rty:"C",set:1,typ:"C"},{crd:"XRF",fct:"N",rty:"C",set:2,typ:"C"},{crd:"XSH",fct:"N",rty:"L",set:1,typ:"C"},{crd:"XDV",fct:"N",rty:"H",set:1,typ:"C"},{crd:"XRW",fct:"N",rty:"H",set:2,typ:"S"},{crd:"YWC",fct:"T",rty:"C",set:2,typ:"C"},{crd:"YNS",fct:"N",rty:"L",set:2.2,typ:"C"},{crd:"ZPM",fct:"T",rty:"R",set:1.1,typ:"C"},{crd:"ZTU",fct:"N",rty:"L",set:1,typ:"C"},{crd:"ZIN",fct:"N",rty:"C",set:1,typ:"C"},{crd:"ZSH",fct:"T",rty:"L",set:1,typ:"C"}],ke=[["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"]]],h=(n,t)=>({card:n,num:t}),Te={name:"Official",id:"SBE",decks:[{name:"Alloyin Starter",factions:["A"],cards:[h("SYO",1),h("BSS",1),h("SFT",2),h("SNP",2),h("TSM",2),h("SSS",2),h("ALG",2),h("MXW",3),h("TUP",3),h("FPS",3),h("MND",3),h("IWC",3),h("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[h("SFS",1),h("GGD",1),h("FFD",3),h("EPD",2),h("CCR",2),h("HGS",2),h("DSS",2),h("BWK",2),h("GBG",3),h("DSK",3),h("GRP",3),h("VGN",3),h("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[h("FBC",1),h("RBH",1),h("CFB",3),h("FSM",2),h("FSH",2),h("FSS",2),h("PMS",2),h("RFL",2),h("UBL",3),h("WPD",3),h("SGI",3),h("AMY",3),h("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[h("UPM",1),h("EHW",1),h("FRR",3),h("SPD",2),h("HTP",2),h("LSS",2),h("SDR",2),h("SRD",2),h("FWR",3),h("DBP",3),h("GHT",3),h("GSS",3),h("TXS",3)]},{name:"Cruel Corrosion",factions:["A","N"],cards:[h("IHA",1),h("WBG",1),h("OXP",1),h("DFR",1),h("APM",1),h("SNP",1),h("GRM",2),h("ETN",2),h("DHW",2),h("OXM",2),h("AEN",2),h("ATG",2),h("CTI",2),h("CTW",2),h("FPS",2),h("GRW",2),h("MTT",2),h("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[h("ZTU",1),h("VRP",1),h("GGP",1),h("EPD",1),h("DBT",1),h("BSM",1),h("TDW",2),h("NGT",2),h("UBL",2),h("FWK",2),h("BZD",2),h("CSB",2),h("SLH",2),h("MMH",2),h("LSK",2),h("GBG",2),h("CFG",2),h("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[h("TDS",1),h("SSR",1),h("FRR",1),h("ULR",1),h("UTR",1),h("BTM",1),h("UGL",2),h("EHN",2),h("SPD",2),h("GHB",2),h("FLN",2),h("SML",2),h("RFL",2),h("OXS",2),h("UTM",2),h("TWG",2),h("ENR",2),h("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[h("CSW",1),h("SMD",1),h("FRR",1),h("UIC",1),h("CFB",1),h("UGL",2),h("FSH",2),h("FLN",2),h("WPD",1),h("TWG",2),h("TCG",2),h("TGS",2),h("SVH",1),h("SCL",2),h("RTS",1),h("FWB",1),h("ENR",2),h("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[h("IMA",1),h("GMP",1),h("OXA",1),h("EPD",1),h("OJC",1),h("ESU",2),h("OXM",2),h("MMA",2),h("SAP",1),h("AFO",2),h("GBG",2),h("CTW",2),h("SRH",1),h("TSM",2),h("SLH",1),h("MTT",1),h("DCR",1),h("DFB",1),h("BSR",1),h("LGT",1),h("XRF",2),h("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[h("SBG",1),h("NSH",1),h("FFU",1),h("EWE",1),h("BFM",1),h("WBH",1),h("UWS",1),h("TGI",2),h("RFL",2),h("GRM",1),h("ASG",1),h("YWC",2),h("XRF",2),h("WPD",2),h("WCS",2),h("WBU",2),h("TCG",1),h("FSK",1),h("SLH",2),h("CFG",1),h("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[h("URB",1),h("AGK",1),h("ESP",1),h("FRR",1),h("NXT",1),h("ALG",1),h("FGB",1),h("PHS",2),h("TUP",1),h("EWT",2),h("PTR",1),h("VBK",1),h("AGC",1),h("AEN",2),h("ETN",1),h("FPS",2),h("MXW",2),h("GHT",1),h("TWG",2),h("SNB",1),h("SML",1),h("JPK",1),h("ENR",1),h("IWC",1)]}]},Ce={name:"Sept 2013 Reddit Tourney",id:"T1309",decks:[{name:"Axel: Lifegain",factions:["T","U"],cards:[h("AGD",3),h("EHW",3),h("FRR",3),h("FIN",1),h("UPM",1),h("LKP",2),h("BTM",2),h("LBL",3),h("GSS",3),h("RFA",3),h("GHB",3),h("EFP",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[h("DBP",3),h("EHW",2),h("FRR",3),h("FWT",3),h("UPM",3),h("LKP",2),h("BTM",3),h("HTR",2),h("LBD",2),h("RFA",3),h("GHB",2),h("SDR",2)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[h("SHK",3),h("MOE",3),h("FRR",3),h("LSK",3),h("FFU",3),h("UBL",3),h("WWS",3),h("FSS",3),h("ENR",3),h("MMH",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[h("SCS",3),h("ROG",1),h("GGP",1),h("GGD",3),h("WFS",1),h("DSS",3),h("ZTU",1),h("GBG",3),h("HFA",3),h("EXD",1),h("EPD",1),h("BSR",1),h("MRF",2),h("HGS",3),h("GTH",3)]},{name:"Shabbit: Zimus",factions:["N","T"],cards:[h("FSS",3),h("GGD",2),h("GGP",3),h("KOD",1),h("MOE",2),h("ZTU",3),h("EFP",2),h("LSK",2),h("FVA",1),h("EPD",3),h("CTW",1),h("SHV",1),h("UBL",3),h("SHK",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[h("DBP",2),h("EHW",2),h("FRR",3),h("HTP",2),h("UPM",3),h("LKP",2),h("GHT",3),h("GGP",2),h("LBD",1),h("EPD",2),h("DBT",2),h("SPD",3),h("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[h("IWC",3),h("FSS",3),h("ETN",1),h("WPD",2),h("FSM",1),h("AHL",1),h("UBL",3),h("SMD",2),h("BTN",3),h("LSK",1),h("MMH",3),h("FFU",1),h("TSM",3),h("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[h("DSS",3),h("FSS",3),h("EPD",2),h("GTH",3),h("FSM",1),h("MOE",1),h("UBL",3),h("GGP",3),h("GBG",1),h("LSK",3),h("HGS",1),h("CTW",1),h("SHK",3),h("GGD",1),h("DBT",1)]}]},Se={name:"June 2014 FWIQ Top 8",id:"T1406",decks:[{name:"CarlChu: Dreadbots",factions:["A","N"],cards:[h("MXW",1),h("TDW",3),h("BSG",3),h("BSS",2),h("IWC",1),h("OJC",2),h("EPD",3),h("ALS",3),h("ESK",2),h("OWF",2),h("CHV",3),h("VRP",3),h("BTN",2)]},{name:"Derk: Metaminds",factions:["A"],cards:[h("OJC",3),h("DMW",3),h("MMV",3),h("JPK",3),h("MMO",3),h("GMP",3),h("ALS",3),h("MMA",3),h("SFA",3),h("BTN",3)]},{name:"Hans: Farmer Tarsus",factions:["N","U"],cards:[h("LKP",2),h("CHR",2),h("FRR",3),h("VRP",3),h("SHG",2),h("SSE",3),h("EPD",3),h("SYL",3),h("WWP",3),h("NFF",3),h("TDW",3)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[h("ALS",3),h("TDS",3),h("FRR",3),h("WWP",3),h("SML",2),h("BSG",3),h("JPK",2),h("ODC",3),h("NXT",2),h("WMM",3),h("GHB",3)]},{name:"Jabor: Control",factions:["N","T"],cards:[h("CTW",2),h("BSM",3),h("SCL",3),h("EPD",3),h("VYE",3),h("ESK",3),h("UWL",3),h("SMD",3),h("ZTU",3),h("EFP",3),h("DBT",1)]},{name:"StillHadAllDeez: Necromancer",factions:["N","U"],cards:[h("ZTU",3),h("CTW",2),h("FRR",3),h("VRP",3),h("SHG",2),h("ESK",3),h("EPD",3),h("SYL",3),h("ODC",3),h("GGD",2),h("TDW",3)]},{name:"Tetrarain: Big n Small",factions:["N","U"],cards:[h("ZTU",2),h("TDS",3),h("ODC",3),h("WWP",3),h("CTW",1),h("SSE",1),h("EHW",2),h("EPD",3),h("GGD",2),h("CHA",2),h("ESK",3),h("CHV",2),h("FRR",3)]},{name:"Zecrus: Necro Growwide",factions:["N","U"],cards:[h("EHW",3),h("SSR",2),h("FRR",2),h("VRP",3),h("SHG",2),h("ESK",2),h("EPD",2),h("LBD",3),h("SSE",3),h("BWD",2),h("GGD",1),h("ZTU",1),h("SYL",1),h("TDW",3)]}]},we={name:"July 2014 FWIQ Top 8",id:"T1407",decks:[{name:"Bryan: Knightbots",factions:["A","U"],cards:[h("AGK",3),h("AFS",3),h("BSG",2),h("BSS",3),h("JPK",3),h("VBK",2),h("FRR",3),h("TDS",3),h("WWP",3),h("MXW",2),h("OJC",3)]},{name:"Busti: Tempo",factions:["N","T"],cards:[h("GGP",3),h("FZS",1),h("EPD",2),h("EFP",3),h("GGD",1),h("FBI",3),h("ZTU",2),h("FLN",3),h("LSK",3),h("ESK",3),h("SHK",3),h("KKK",1),h("CHV",1),h("GCR",1)]},{name:"Khaldrogo: Knightmind",factions:["A"],cards:[h("AGK",2),h("DMW",3),h("BSG",3),h("BSS",3),h("JPK",1),h("MMO",1),h("STD",2),h("GMP",3),h("ALS",3),h("MMA",3),h("SFA",3),h("BTN",3)]},{name:"Klematisse: Flamebreak",factions:["N","T"],cards:[h("GTT",3),h("FZS",2),h("EPD",2),h("SMD",3),h("UBL",2),h("FBI",3),h("ZTU",3),h("FLN",2),h("LSK",2),h("ESK",3),h("SHK",3),h("GCR",2)]},{name:"SilverTail: Dreadbots",factions:["A","N"],cards:[h("MXW",2),h("ZTU",3),h("BSG",3),h("BSS",3),h("GGD",2),h("OJC",2),h("EPD",3),h("ALS",3),h("ESK",3),h("CHV",3),h("BTN",3)]},{name:"Skitzo: Yeti",factions:["T","U"],cards:[h("WBY",3),h("TDS",3),h("FRR",3),h("WWP",3),h("ODC",2),h("UWL",3),h("SSR",1),h("RBH",1),h("EFP",2),h("UIM",3),h("UBL",3),h("GCR",3)]},{name:"V3ng3vin3: Farmer Tarsus",factions:["N","U"],cards:[h("LKP",2),h("CHR",2),h("FRR",3),h("VRP",3),h("SHG",2),h("SSE",3),h("EPD",3),h("SYL",3),h("WWP",3),h("NFF",3),h("TDW",3)]},{name:"Zwaxor: Control",factions:["N","T"],cards:[h("BSM",3),h("DBT",1),h("EPD",3),h("EFP",3),h("GGD",1),h("VYE",3),h("ZTU",3),h("SMD",3),h("SCL",3),h("ESK",3),h("CTW",2),h("SHG",1),h("GCR",1)]}]},Ee={name:"The Forge Season 1",id:"TG10",decks:[{name:"Aje8: Dinobots",factions:["A","U"],cards:[h("HTR",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",3),h("MXW",3),h("GHB",3)]},{name:"Btenant: Dinobots",factions:["A","U"],cards:[h("JPK",1),h("OWW",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",2),h("MXW",3),h("GHB",3)]},{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[h("BWK",3),h("TDS",2),h("FRR",3),h("WWP",3),h("GGP",3),h("GGD",3),h("DBT",1),h("WFS",3),h("CTW",3),h("EPD",3),h("GHB",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[h("DDD",3),h("DBT",3),h("EPD",3),h("EFP",3),h("GGP",3),h("LSK",3),h("SHK",3),h("UBL",3),h("WCS",3),h("ZTU",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[h("RBH",3),h("TDS",3),h("FRR",3),h("WWP",3),h("EFP",3),h("AMY",2),h("FVA",2),h("ENR",3),h("ZSH",3),h("EHW",3),h("GHB",2)]},{name:"PTKtempo: Dinobots",factions:["A","U"],cards:[h("EHW",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",3),h("MXW",3),h("GHB",3)]},{name:"SeomanReborn: Metamind Control",factions:["A","N"],cards:[h("MSC",1),h("JPK",1),h("ZTU",3),h("GGD",2),h("DBT",3),h("CTW",3),h("BSG",2),h("GMP",3),h("DMW",3),h("MMA",3),h("MXW",3)]},{name:"StillHadAllDeez: Dinobots",factions:["A","U"],cards:[h("OJC",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",3),h("MXW",3),h("GHB",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[h("LSK",2),h("WBG",3),h("EPD",3),h("DDD",3),h("SHK",3),h("EFP",3),h("ZTU",2),h("GGD",2),h("GGP",3),h("CTW",3),h("DBT",3)]},{name:"Zrandles: Dinobots",factions:["A","U"],cards:[h("HTR",1),h("JPK",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",2),h("MXW",2),h("GHB",2),h("OWW",2)]}]},xe={name:"The Forge Season 2.1",id:"TG21",decks:[{name:"Dbatterskull: Control",factions:["N","T"],cards:[h("CTW",2),h("GCR",1),h("VYE",2),h("ESK",3),h("SMD",3),h("EFP",3),h("ZTU",3),h("FLN",2),h("BSM",3),h("EPD",3),h("GGP",3),h("CHV",2)]},{name:"EvilWeevil: Control",factions:["N","U"],cards:[h("ZTU",3),h("TDS",3),h("GGP",3),h("WWP",3),h("CTW",2),h("EHW",2),h("EPD",3),h("GGD",2),h("DBT",2),h("ESK",3),h("CHV",2),h("FRR",2)]},{name:"EvilWeevil: Dino Knightbots",factions:["A","U"],cards:[h("AGK",3),h("GHB",1),h("NXT",2),h("BSG",3),h("BSS",3),h("JPK",2),h("VBK",2),h("WMM",1),h("FRR",3),h("TDS",3),h("WWP",3),h("MXW",2),h("BTM",1),h("OJC",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[h("UWL",3),h("FFU",3),h("WBY",3),h("UIM",3),h("WBU",3),h("SSR",1),h("TRN",1),h("GTT",1),h("GCR",3),h("FRR",3),h("UBL",3),h("WWP",3)]},{name:"Hans: Dino Knightbots",factions:["A","U"],cards:[h("AGK",3),h("ALS",3),h("BTN",2),h("BSG",3),h("BSS",3),h("JPK",2),h("VBK",2),h("WMM",3),h("FRR",3),h("TDS",3),h("WWP",3)]},{name:"Jran74: Control",factions:["N","T"],cards:[h("CTW",2),h("GGD",3),h("SHK",3),h("EPD",3),h("GGP",3),h("DCR",2),h("UBL",2),h("SMD",3),h("ZTU",3),h("EFP",3),h("DBT",3)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[h("BWK",2),h("KOD",2),h("CYC",3),h("GRM",3),h("VYE",3),h("XRW",3),h("MOE",2),h("ZTU",3),h("BSM",3),h("EPD",3),h("DSS",3)]},{name:"S1al: Tempo",factions:["T","U"],cards:[h("FSS",3),h("SCL",3),h("FRR",3),h("MOE",3),h("EFP",3),h("EHW",3),h("FLN",3),h("SHK",3),h("LSK",3),h("TCG",3)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[h("CTW",1),h("GCR",1),h("CFG",1),h("FZS",1),h("FBI",3),h("MOE",3),h("EFP",3),h("LSK",3),h("FLN",3),h("SHK",3),h("RTS",3),h("GGP",3),h("UBL",2)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[h("DMW",3),h("GMP",3),h("MMA",3),h("MMV",2),h("TDW",3),h("VRP",3),h("EPD",3),h("SHG",2),h("OJC",2),h("ESK",2),h("CHV",2),h("CTW",2)]}]},De={name:"The Forge Season 2.2",id:"TG22",decks:[{name:"ErrorAsh: Burn",factions:["N","T"],cards:[h("UBL",2),h("EFM",2),h("FBI",3),h("ESK",3),h("FLN",3),h("EFP",3),h("MOE",3),h("FSS",3),h("SHK",3),h("EPD",3),h("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[h("WWS",3),h("DYB",3),h("FRR",3),h("SYL",3),h("EPD",3),h("SSE",2),h("NSH",2),h("TDW",3),h("NFF",2),h("CHR",2),h("LKP",2),h("EXD",1)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[h("NSH",2),h("SMD",2),h("DDD",3),h("TDW",3),h("VRP",3),h("WCS",3),h("BSM",3),h("SHG",2),h("TGI",2),h("EPD",3),h("FVA",2),h("DBT",1),h("TRN",1)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[h("XSH",3),h("SPM",3),h("FRR",3),h("ODC",3),h("SSE",3),h("ESK",3),h("TGS",3),h("XRF",3),h("VRP",3),h("URB",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[h("AGM",3),h("TDS",2),h("FRR",3),h("WWP",3),h("CSW",3),h("FLN",3),h("EFP",2),h("UWL",3),h("WBY",2),h("WCS",2),h("EHW",2),h("SHS",2)]},{name:"Stautmeister: Necro Bigstuff",factions:["N","U"],cards:[h("ESK",3),h("CTW",2),h("FRR",2),h("SSE",3),h("EPD",3),h("WBG",3),h("DBT",2),h("SHG",3),h("XSH",2),h("GGD",2),h("EHW",2),h("KOD",3)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[h("UHS",2),h("FLN",3),h("STG",3),h("CRC",3),h("SHK",3),h("EFP",2),h("WMR",2),h("WMM",3),h("JPK",3),h("SMD",3),h("FVA",3)]},{name:"Tetrarain: Aggro",factions:["T","U"],cards:[h("SMD",2),h("TDS",3),h("FRR",2),h("WWP",3),h("ODC",2),h("UWL",3),h("SSE",2),h("RBH",3),h("EFP",2),h("KKK",2),h("AAK",2),h("IBF",2)]},{name:"V3ng3vin3: Attack Plants",factions:["A","U"],cards:[h("CHR",1),h("JPK",1),h("FRR",3),h("ALS",2),h("ODC",3),h("SSE",3),h("BTN",2),h("SYL",3),h("TDS",3),h("WWP",3),h("NFF",2),h("GHB",1),h("WMM",1),h("OJC",2)]},{name:"V3ng3vin3: Control",factions:["N","U"],cards:[h("GGD",1),h("CTW",2),h("FRR",3),h("CHV",3),h("ODC",3),h("SSE",2),h("EPD",3),h("SYL",3),h("TDS",3),h("WWP",3),h("NFF",1),h("SHS",3)]}]},Pe={name:"Set 1 Fundecks",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[h("DFB",3),h("BSR",3),h("HGS",3),h("HFA",3),h("FFD",3),h("XSH",3),h("XHU",3),h("WBG",3),h("GBG",3),h("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[h("TBA",3),h("TDS",3),h("MBP",3),h("FSH",3),h("RBH",3),h("FBC",3),h("LBR",3),h("CFB",3),h("AAK",3),h("FRR",1),h("FIN",1),h("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[h("MMA",3),h("DMW",3),h("GMP",3),h("SYO",3),h("KAW",3),h("SHK",3),h("CTL",2),h("CAG",2),h("MSC",2),h("MTS",2),h("ASG",2),h("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[h("CTV",3),h("TDW",3),h("BTS",3),h("CHR",3),h("GMR",3),h("KOD",2),h("LKP",2),h("SHV",2),h("DBA",2),h("CCR",2),h("PTB",2),h("FIN",1),h("DBT",2)]},{name:"Voltron",factions:["A"],cards:[h("FGA",3),h("FGB",3),h("FGG",3),h("AFS",3),h("BSG",3),h("BSS",3),h("SCD",2),h("TUP",3),h("JPK",2),h("BWH",2),h("SFT",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[h("DDD",3),h("WBH",3),h("ZPM",3),h("WCS",3),h("GGP",3),h("SAD",3),h("SDN",3),h("WFB",3),h("SBG",3),h("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[h("WWP",3),h("EHN",3),h("SDR",3),h("HTR",3),h("HTP",3),h("MXW",3),h("MND",2),h("NXC",2),h("CDT",3),h("PTB",2),h("FIN",1),h("SYO",2)]},{name:"Zombies",factions:["N"],cards:[h("XDV",3),h("ONN",3),h("FWK",3),h("BWK",3),h("URD",3),h("KOD",3),h("DSS",3),h("TDW",3),h("GRP",3),h("SHV",3)]}]},Mt=[Te,Ce,Se,we,Ee,xe,De,Pe];class Fe{state;constructor(t){this.state=t}get adjacent(){return a.field.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 bonus(){return this.state.bonus}set bonus(t){this.state.bonus=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 a.cards.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 a.cards.getCard(this.code).isTribe(t)}get level(){return a.cards.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=d.crTarg();return t.player=a.player.toTarget(!this.owner),t.lanes=a.field.oppositeLane(this.lane),a.field.creatByTarget(t)[0]}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get lane(){return this.state.lane}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,r,e=void 0){t!==0&&(this.state.attack+=t,this.enforceEffects("AT")),r!==0&&(this.state.health+=r,this.state.maxHealth+=r,this.enforceEffects("CH"),a.death.deathProdder(this,e))}addArmor(t){if(!this.negateArmor){const r=this.state.armor+t;this.state.armor=Math.max(0,r),this.enforceEffects("AR")}}addMobility(t){if(!this.negateMobility){const r=this.state.mobility+t;this.state.mobility=Math.max(0,r)}}addPoison(t){const r=this.state.poison+t;this.state.poison=Math.max(0,r)}addRegen(t){if(!this.negateRegen){const r=this.state.regen+t;this.state.regen=Math.max(0,r)}}heal(t){if(t===0)return 0;const r=Math.min(this.health+t,this.maxHealth)-this.health;return this.state.health+=r,r}hurt(t,r=!1){if(t<1)return[0,0];const e=Math.max(Math.min(t,this.armor-this.armorDmg),0);let s=t-e,c=this.health-s;this.state.armorDmg+=e;let u=0;return r&&c<0&&(u=s-this.health,s=this.health),s>0&&(this.state.health-=s),[s,u]}hurtBattle(t,r,e=!1){const s=this.hurt(t,e);return s[0]>0&&a.batch.addEvents(d.damageEvent(!0,s[0],!0,!0,this,r)),s[1]}hurtDirect(t,r,e=void 0){const s=this.hurt(t,!1);return s[0]>0&&(a.log.new().crd(r).txt(` dealt ${t} dmg to `).crd(this.code).txt(".").go(),a.batch.addEvents(d.damageEvent(!1,s[0],!1,!0,this,void 0)),a.death.deathProdder(this,e)),s[0]}modIdx(t){return this.mods.findIndex(r=>r.granter===t)}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),a.death.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF")}modSum(t){return this.mods.filter(r=>r.type===t).map(r=>r.value).reduce((r,e)=>r+e,0)}modBool(t){return this.mods.some(r=>r.type===t&&r.value===1)}hasMod(t){return this.modIdx(t)>-1}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){this.mods.findIndex(e=>e.granter===t.granter&&e.type===t.type)===-1&&this.addMod(t)}removeMod(t){const r=this.state.mods.filter(e=>e.granter===t);this.state.mods=this.state.mods.filter(e=>e.granter!==t),r.forEach(e=>this.modEffectPropagator(e))}removeModSafe(t){this.hasMod(t)&&this.removeMod(t)}expireMod(t){this.state.mods.splice(this.state.mods.indexOf(t),1)}endActivation(){this.state.activationAvailable=!1,a.death.deathCheck(),a.action.actionDone()}move(t){this.state.lane=t,a.effect.positionChange(this.owner),a.batch.addEvents(d.creatureEvent("MOV",this))}addEffect(t,r){const e=d.effect(t,r);return this.effects.push(e),e}enforceEffects(t,r=!1){this.effects.filter(e=>e.watch===t).filter(e=>e.area==="A"||e.area==="C"&&this.owner===r).forEach(e=>a.cards.getCard(e.logicCode).enforceEffect(e,this))}jr4(t,r){const e=d.trigger(t,r);return e.cardCode=this.code,e.creatId=this.id,this.triggers.push(e),e}removeTrigger(t){const r=this.triggers.indexOf(t);r>-1?this.triggers.splice(r,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.bonus=0,this.state.changed=!0,this.state.negateActivate=!0,a.field.creatByTarget(d.crTarg()).forEach(t=>t.removeMod(this.id)),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),a.effect.defenderChange(this.owner)}get hints(){return this.state.hints}aiHints(){return this.hints}}var L=(n=>(n[n.Never=-999]="Never",n[n.Horrid=-2]="Horrid",n[n.Bad=-1]="Bad",n[n.Noice=1]="Noice",n[n.Grand=2]="Grand",n))(L||{});const Ht=10218;class Be{appMode="M";clickMode="M";options={bark:!0,highHealth:!1,cheater:!1,legDraft:!1,fatPacks:!1,playerDeck:[],wasDrafting:!1};playerA=d.player(!0);playerB=d.player(!1);activePlayer=!0;isLocalA=!0;aiMode=!1;aiActive=!1;firstTurn=!0;winFlag=0;field=[];phase="ST";batch={type:"N0",events:[],triggerActions:[],deathCheck:!0,iatLane:0};turn=d.freshTurn();ui=d.freshUI();deathOrder=[];birthOrder=[];graveyard=[];newGame(t,r){this.aiMode=!0,a.fight.barking=a.state.gs.options.bark,this.activePlayer=a.randInt(0,2)===0,this.aiActive=!this.activePlayer,this.playerA.name="Forgy McGhee",this.playerA.nameOffset=25;const e=a.player.nameOSaurus();this.playerB.name=e[0],this.playerB.nameOffset=e[1],a.log.setup(),a.action.actionHistory=[],this.graveyard=[],this.field=[],this.deathOrder=[],this.birthOrder=[],this.ui=d.freshUI(),this.firstTurn=!0,this.winFlag=0,this.playerA.turn=1,this.playerB.turn=1,this.playerA.rank=1,this.playerB.rank=1;const s=a.state.gs.options.highHealth?360:120;this.playerA.health=s,this.playerB.health=s,this.playerA.discard=[],this.playerB.discard=[],this.playerA.deck=a.deck.parseDeck(t),this.playerB.deck=a.deck.parseDeck(r),a.deck.shuffleDeck(!1),this.playerB.hand=this.playerB.deck.splice(0,5),a.deck.shuffleDeck(!0),this.playerA.hand=this.playerA.deck.splice(0,5),a.log.add("Ready...FIGHT!"),a.phase.startTurn()}}class d{static creatureState(t,r){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,bonus:0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:r,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,r){return{area:"A",watch:t,logicCode:r}}static freeCard(t){return{id:a.genId(),condition:d.target("TH"),sourceCard:t}}static mod(t,r,e=""){return{type:t,value:typeof r=="boolean"?r?1:0:r,granter:e,expiry:"NN"}}static player(t){return{hand:[],deck:[],discard:[],isPlayerA:t,health:120,name:"",nameOffset:0,turn:1,rank:1,avatar:Math.floor(Math.random()*17)}}static trigger(t,r){return{type:t,logicCode:r,cardCode:"",creatId:"",customCode:"",interactive:!1,changes:!1}}static triggerReaction(t,r,e,s){return{event:t,ownerPlayerA:e,creatId:"",cardCode:"",trigger:r,host:s}}static freshTurn(){return{mainBattle:!1,creaturesKilled:0,friendlyFightStarters:0,regularPlays:2,cardsPlayed:0,freeCards:[]}}static freshUI(){return{handScrollLeft:0,detailsMode:!1}}static fieldSelectAction(t,r=-1,e=!0){return{zone:"F",actionKey:t,playerA:e,lane:r,hostCard:"",param:""}}static handSelectAction(t,r="",e="",s=-1){return{zone:"H",actionKey:t,card:r,cost:e,position:s,hostCard:"",param:""}}static playerSelectAction(t,r){return{zone:"P",actionKey:t,playerA:r,hostCard:"",param:""}}static draftSelectAction(t,r,e){return{zone:"N",actionKey:t,index:r,pack:e,hostCard:"",param:""}}static ddf4(){return{zone:"N",actionKey:"ACTV",hostCard:"",param:""}}static menuButtonAction(t){return{zone:"N",actionKey:"MNBT",hostCard:"",param:t}}static creatureEvent(t,r){return{code:t,creature:r}}static enterFieldEvent(t){return{code:"ENT",creature:t,forged:!1}}static creatStatEvent(t,r,e){return{code:t,creature:r,newValue:e}}static playCardEvent(t,r){const e=d.playerEvent("PLC",r);return e.cardCode=t,e}static playerEvent(t,r){return{code:t,playerA:r}}static playerHealEvent(t,r,e){return{code:t,playerA:r,healAmt:e}}static damageEvent(t,r,e,s,c,u){return{code:"DMG",battle:t,dmg:r,creatureSrc:e,creatureTarg:s,target:c,source:u}}static actionifier(t,r,e,s=""){const c=t;return c.actionKey=r,c.hostCard=e,c.param=s,c}static target(t){return{target:t,level:"LA",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:""}}static actionTarget(t,r,e,s=""){return d.actionifier(d.target(t),r,e,s)}static crTarg(){const t=d.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,r,e=""){return d.actionifier(d.crTarg(),t,r,e)}static crNotMeTarg(t){const r=d.target("TF");return r.field="O",r.creatStatus="V",r.notMe=t,r}static crNotMeActTarg(t,r,e,s=""){return d.actionifier(d.crNotMeTarg(r),t,e,s)}static crFriendTarg(){const t=d.crTarg();return t.player="F",t}static crFriendActTarg(t,r,e=""){return d.actionifier(d.crFriendTarg(),t,r,e)}static crFriendNotMeTarg(t){const r=d.crNotMeTarg(t);return r.player="F",r}static crFriendNotMeActTarg(t,r,e,s=""){return d.actionifier(d.crFriendNotMeTarg(r),t,e,s)}static crEnemyTarg(){const t=d.crTarg();return t.player="E",t}static crEnemyActTarg(t,r,e=""){return d.actionifier(d.crEnemyTarg(),t,r,e)}static playerTarg(t){const r=d.target("TP");return r.player=a.player.toTarget(t),r}static playerActTarg(t,r,e,s=""){return d.actionifier(d.playerTarg(t),r,e,s)}static lvlHandActTarg(t,r=""){const e=this.actionTarget("TH","CARD",t,r);return e.player="F",e.level="LG",e}static actionEval(t,r,e){const s=e??[];return{type:r,hints:Array.isArray(s)?s:[s],vectors:[],action:t,final:!0,bonus:0}}static ddp5(t){const r=d.actionEval(t,"PS");return r.final=!1,r}static ddp7(t,r,e,s){const c=d.actionEval(t,"ST",s),u=d.ddp1(r,e);return u.destroy=!0,c.vectors=[u],c}static ddp8(t,r,e){return d.ddp7(t,r.owner,r.lane,e)}static ddp2(t,r,e,s={},c){const u=d.actionEval(t,"ST",c);return u.vectors=[d.ddp1(r,e,s)],u}static ddp3(t,r,e={},s){return d.ddp2(t,r.owner,r.lane,e,s)}static actionEvalBuffN(t,r,e,s=0,c=0,u){return d.ddp2(t,r,e,{att:s,hlt:c},u)}static actionEvalBuffC(t,r,e=0,s=0,c){return d.ddp3(t,r,{att:e,hlt:s},c)}static ddp4(t,r,e,s,c=!1){const u=d.actionEval(t,"PC"),m=a.cards.getCard(s);u.hints=m.aiHints();const y=d.evalVectorCreatureFromClass(m,r,e);return y.type="R",u.vectors.push(y),c&&(u.bonus=m.bonusPlay()),u}static evalVectorEmpty(t,r){return{shape:"B",type:"E",playerA:t,lane:r,destroy:!1,dirDmg:0,moveTo:0,health:0,attack:0,aggressive:!1,armor:0,armorDmg:0,breakthrough:!1,defender:!1,negateDefender:!1,poison:0,regen:0,sleeping:!1,bonus:0}}static evalVectorCreatureFromCode(t,r,e){const s=a.cards.getCard(t);return d.evalVectorCreatureFromClass(s,r,e)}static evalVectorCreatureFromClass(t,r,e){const s=t.jr3(r,e);return d.evalVectorCreature(s)}static evalVectorCreature(t){return{shape:"B",type:"C",playerA:t.owner,lane:t.lane,destroy:!1,dirDmg:0,moveTo:0,health:t.health,attack:t.attack,aggressive:t.aggressive,armor:t.armor,armorDmg:t.armorDmg,breakthrough:t.breakthrough,defender:t.defender,negateDefender:t.negateDefender,poison:t.poison,regen:t.regen,sleeping:t.sleeping,bonus:t.bonus}}static evalVectorPlayerLife(t,r){const e=d.evalVectorEmpty(t,0);return e.shape="P",e.type="M",e.health=r,e}static evalVectorPlayerDmg(t,r){const e=d.evalVectorEmpty(t,0);return e.shape="P",e.type="M",e.dirDmg=r,e}static evalVectorPlayer(t){const r=d.evalVectorEmpty(t,0);return r.shape="P",r.type="P",r}static ddp1(t,r,e){const s=d.evalVectorEmpty(t,r);return s.type="M",e&&(s.attack=e.att??0,s.health=e.hlt??0,s.armor=e.arm??0,s.regen=e.rgn??0,s.poison=e.psn??0,s.dirDmg=e.dmg??0,s.defender=e.def??!1,s.breakthrough=e.brt??!1,s.aggressive=e.agr??!1,s.negateDefender=e.noD??!1),s}}class ut{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return ut.extractCardCode(this.code)}get image(){return this.type==="S"?this.fixedImage():this.leveledImage()}leveledImage(){return this.rawImage(this.code)}fixedImage(){return this.rawImage(this.cardCode())}rawImage(t){return`card/${this.faction}/${t}.jpg`}isFree=!1;level;maxLevel=3;name="";overload=!1;rarity="T";text="";get type(){return "C"}hints;aiHints(){return this.hints??[]}bonus;bonusPlay(){return this?.bonus?.play??0}bonusExist(){return this?.bonus?.exist??0}canLevel(){return this.level{c+=s[m]*e[0][m],u+=s[m]*e[1][m]}),[c,u]}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 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 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 x extends ut{constructor(t){super(t)}jr2=0;jr1=0;initAggro=!1;initArmor=0;initBT=!1;initDefend=!1;initMobile=0;initRegen=0;tribe=[];isTribe(t){return(Array.isArray(t)?t:[t]).every(e=>this.tribe.includes(e))}jr3(t,r){const e=d.creatureState(t,r);return e.id=a.genId(),e.code=this.code,e.health=this.jr2,e.attack=this.jr1,e.maxHealth=e.health,e.regen=this.initRegen,e.breakthrough=this.initBT,e.defender=this.initDefend,e.aggressive=this.initAggro,e.armor=this.initArmor,e.mobility=this.initMobile,e.hints=this.aiHints(),e.bonus=this.bonusExist(),new Fe(e)}playTargets(){const t=super.playTargets(),r=d.actionTarget("TF","FORG",this.code);return r.player="F",t.push(r),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}ddf8(t){return!1}}class Q extends ut{constructor(t){super(t)}get type(){return "S"}logSpell(){a.log.new().txt("Casted ").crd(this.code).txt(".").go()}}class He extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Abraxas, Avatar of Kadras",this.jr1=this.boof4712,this.jr2=this.lValN([7,11,21]),this.tribe.push("HY"),this.hints=["LJ"];const r=this.lValS(["Give an adjacent creature","Each adjacent creature gets","Each other friendly creature gets"]);this.text=`Activate: ${r} 2x attack this turn.`}targ(t){const r=d.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(r.lanes=t.adjacent),r}canActivate(t){return a.field.creatByTarget(this.targ(t)).length>0}startActivation(t){if(this.level===1)a.action.ddf5(this.getCardActions(d.ddf4(),t));else{const r=this.targ(t);a.field.creatByTarget(r).forEach(e=>{this.applyMod(e,t.id)}),t.endActivation()}}handleAction(t){const r=a.field.ddf6(t),e=a.field.jr5(t.param);this.applyMod(r,e.id),e.endActivation()}getCardActions(t,r){if(t.actionKey==="ACTV"){this.level>1&&console.error("Abraxis asking for activate actions after level 1. Something in your code is wrong");const e=r??a.field.jr5(t.param),s=this.targ(e);return a.target.toActions([s,a.target.buttonTarget("CANC")])}return super.getCardActions(t,r)}ddf7(t){const r=Ht+1,e=d.actionEval(t,"ST");if(t.actionKey==="ACTV")if(this.level>1){const s=a.field.jr5(t.param);let c;this.level===3?c=a.field.laneIdx.filter(u=>u!==s.lane):c=s.adjacent,e.vectors=c.map(u=>d.ddp1(s.owner,u,{att:r}))}else return d.ddp5(t);else{const s=t;e.vectors.push(d.ddp1(s.playerA,s.lane,{att:r}))}return e}applyMod(t,r){const e=d.mod("AT",t.attack,r);e.expiry="ET",t.addMod(e)}}class Ne extends x{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Apocrymancer",this.jr1=this.boof3713,this.jr2=this.jr1+3,this.tribe.push("HM"),this.text="When you play an Alloyin spell, you may discard and level up a card."}jr3(t,r){const e=super.jr3(t,r);return e.jr4("PC",this.code),e}handleAction(t){a.turn.levelAndDiscard(t),a.action.actionDone(!0)}ddf8(t){if(t.event.code==="PLC"){const r=t.event;if(r.playerA===t.ownerPlayerA){const e=a.cards.getCard(r.cardCode);if(e.type==="S"&&e.faction==="A")return!0}}return!1}jr8(t){const r=d.lvlHandActTarg(this.code,t.creatId);a.action.ddf5(a.target.toActions([r,a.target.buttonTarget("NOTR")]))}ddf7(t){return t.actionKey==="CARD"?d.actionEval(t,"DC"):super.ddf7(t)}}class Me extends x{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Arboris, Grove Dragon",this.jr1=this.lValN([5,9,20]),this.jr2=this.jr1,this.tribe.push("DG");const r=this.boof;this.text=`While you have over 120 health, Arboris gets ${a.log.jr9(r,r)}.`}jr3(t,r){const e=super.jr3(t,r);return e.addEffect("PH",this.code),e}enforceEffect(t,r){if(a.state.getPlayer(r.owner).health>120&&r.status==="A"){const s=this.boof;r.addModSafe(d.mod("HL",s,r.id)),r.addModSafe(d.mod("MH",s,r.id)),r.addModSafe(d.mod("AT",s,r.id))}else r.removeModSafe(r.id)}get boof(){return this.lValN([4,8,80])}}class Vt extends x{constructor(t){super(t),this.rarity="H",this.jr1=this.level+2,this.jr2=this.jr1;const r=this.cardCode();r==="SFA"?this.steel():r==="RFA"?this.root():r==="HFA"?this.hell():r==="SGA"&&this.storm(),this.hints=["P1",a.ai.alliedHint(this.faction)],this.text=`Forge: ${this.name} gets ${a.log.jr9(this.level,this.level)} for each ${a.log.factionText(this.faction)} card in your hand.`}hell(){this.faction="N",this.name="Hellforged Avatar",this.initRegen=this.level,this.tribe.push("AB")}root(){this.faction="U",this.name="Rootforged Avatar",this.initBT=!0,this.tribe.push("HM")}steel(){this.faction="A",this.name="Steelforged Avatar",this.initArmor=this.level,this.tribe.push("CY")}storm(){this.faction="T",this.name="Stormforged Avatar",this.initMobile=this.level,this.tribe.push("MT")}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}jr8(t){const r=t.event,e=a.state.getPlayer(t.ownerPlayerA).hand.filter(s=>a.cards.getCard(s).faction===this.faction).length;if(e>0){const s=e*this.level;r.creature.buff(s,s)}a.batch.triggerDone()}}class N extends x{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["OOZ"]:()=>this.ooze(),["SPL"]:()=>this.minion(),["SXP"]:()=>this.fixedSapling(5),["SXD"]:()=>this.fixedSeedling(3),["SXT"]:()=>this.fixedTreefolk(7),["SDL"]:()=>this.minion(),["SPN"]:()=>this.nekSpirit(),["XYR"]:()=>this.yuruSpirit(),["TFK"]:()=>this.minion(),["TFD"]:()=>this.fixedTreefolk(this.boof5714),["TFF"]:()=>this.tfFight(),["ZTR"]:()=>this.zimus(),["ZBS"]:()=>this.threeZomb(),["ZMB"]:()=>this.commonZomb()}[t]}constructor(t){super(t),this.rarity="T";const r=this.cardCode();this.imgKey=r,this.lookup(r)()}get image(){return this.rawImage(this.imgKey)}fixedNekSpirit(t){this.faction="N",this.rarity="T",this.name="Spirit",this.tribe.push("ST"),this.jr1=t,this.jr2=t,this.imgKey=`${"SPN"}${this.level}`}nekSpirit(){this.fixedNekSpirit(this.boof51015)}yuruSpirit(){this.fixedNekSpirit(this.boof5814)}ooze(){this.faction="N",this.rarity="T",this.name="Oozeling",this.tribe.push("OZ"),this.jr1=this.boof4711,this.jr2=this.jr1,this.imgKey="OOZ"}minion(){this.jr1=N.minionBuff(this.level),this.plont(),this.name=N.minionName(this.level)}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.jr2=this.jr1,this.tribe.push("PL")}fixedSapling(t){this.jr1=t,this.plont(),this.name=N.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.jr1=t,this.plont(),this.name=N.minionName(1),this.imgKey="SDL"}fixedTreefolk(t){this.jr1=t,this.plont(),this.name=N.minionName(3),this.imgKey="TFK"}tfFight(){this.jr1=this.boof91421,this.plont(),this.name=N.minionName(3),this.imgKey="TFK"}zimus(){this.faction="N",this.rarity="L",this.name="Zimus, the Returned",this.tribe.push("ZB"),this.jr1=10,this.jr2=5,this.imgKey=`${"ZTU"}2`}zomb(t,r){this.faction="N",this.rarity="T",this.name="Zombie",this.tribe.push("ZB"),this.jr1=t,this.jr2=r,this.imgKey="ZMB"}commonZomb(){const t=this.boof359;this.zomb(t,t)}threeZomb(){this.zomb(3,3)}}class Y extends Q{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ(),e:e=>this.apulseE(e)},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ(),e:e=>this.ctlE(e)},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ(),e:e=>this.dcurE(e)},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ(),e:e=>this.digiE(e)},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ(),e:e=>this.epiE(e)},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ(),e:e=>this.roarE(e)},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ(),e:e=>this.fstormE(e)},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ(),e:e=>this.mealE(e)},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ(),e:e=>this.ibfE(e)},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ(),e:e=>this.shriekE(e)},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ(),e:e=>this.noxE(e)},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ(),e:e=>this.oforceE(e)},["PTB"]:{c:()=>this.phyC(),z:()=>this.phyZ(),e:e=>this.phyE(e)},["PYS"]:{c:()=>this.pyreC(),z:()=>this.pyreZ(),e:e=>this.pyreE(e)},["SNP"]:{c:()=>this.pulseC(),z:()=>this.pulseZ(),e:e=>this.pulseE(e)},["SRD"]:{c:()=>this.sradC(),z:()=>this.sradZ(),e:e=>this.sradE(e)},["TST"]:{c:()=>this.talinC(),z:()=>this.talinZ(),e:e=>this.talinE(e)},["TRN"]:{c:()=>this.turnbC(),z:()=>this.turnbZ(),e:e=>this.turnbE(e)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}get image(){return this.cardCode()==="NSH"?this.leveledImage():this.fixedImage()}playTargets(){const t=super.playTargets(),r=a.target.boardTarget("CARD",this.code);return t.push(r),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),a.turn.spellCast()}ddf7(t){return this.lookup(this.cardCode()).e(t)}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;a.field.ddf1().forEach(r=>{r.addArmor(t)})}apulseE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof234;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{arm:s})),r}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 ${a.log.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;a.field.ddf1().forEach(r=>{const e=d.mod("AT",t,this.code);e.expiry="ET",r.addMod(e),r.extraBattles+=1})}ctlE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.ctlboof;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s})),r}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(),r=t.length;if(r>0){const e=a.randInt(0,r),s=Date.now();a.death.destroy(t[e],this.code,s),this.level===3&&r>1&&(t.splice(e,1),a.death.destroy(t[a.randInt(0,r-1)],this.code,s))}}dcurE(t){let r;const e=this.dCurrHunter(),s=e.length;if(s>0){const c=a.randInt(0,s);if(r=d.ddp8(t,e[c]),this.level===3&&s>1){e.splice(c,1);const u=d.ddp1(e[0].owner,a.randInt(0,s-1));u.destroy=!0,r.vectors.push(u)}}else r=d.actionEval(t,"NR");return r}dCurrHunter(){const t=d.crEnemyTarg();return t.level=a.target.ddf2(this.level+1),a.field.creatByTarget(t)}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${a.log.jr9(this.boof4812n,0)}.`}digiZ(){const t=this.boof4812n;a.field.qEnemyCreats().forEach(r=>{r.buff(t,0)})}digiE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.boof4812n;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s})),r}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${a.log.jr9(t,t)}.`}epiZ(){const t=this.boof246n,r=d.crEnemyTarg();a.field.creatByTarget(r).forEach(e=>{e.buff(t,t)})}epiE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.boof246n;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s,hlt:s})),r}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${a.log.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;a.field.ddf1().forEach(r=>{r.buff(t,t),this.level===3&&(r.breakthrough=!0)})}roarE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof235,c=this.level===3;return r.vectors=a.field.laneIdx.map(u=>d.ddp1(e,u,{att:s,hlt:s,brt:c})),r}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,r=Date.now();a.field.qActiveCreats().forEach(e=>{e.hurtDirect(t,this.code,r)})}fstormE(t){const r=d.actionEval(t,"ST"),e=this.fszap;return r.vectors=[!0,!1].map(s=>a.field.laneIdx.map(c=>d.ddp1(s,c,{dmg:e}))).flat(),r}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${a.log.jr9(-1*t,0)}. Each friendly creature gets ${a.log.jr9(t,0)}.`}mealZ(){const t=this.boof234,r=a.state.ddf9();a.field.qActiveCreats().forEach(e=>{const s=e.owner===r?t:-1*t;e.buff(s,0)})}mealE(t){const r=d.actionEval(t,"ST"),e=this.boof234,s=a.state.ddf9();return r.vectors=[!0,!1].map(c=>a.field.laneIdx.map(u=>d.ddp1(c,u,{att:c===s?e:-e}))).flat(),r}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${a.log.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,r=d.crFriendTarg();a.field.creatByTarget(r).forEach(e=>{e.buff(0,t)})}ibfE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof3510;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{hlt:s})),r}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=this.boof4815;this.text=`Spawn a ${t}/${t} Netherdrake.`}shriekZ(){a.field.birthCreature(`${"NDR"}${this.level}`,"S",a.state.ddf9())}shriekE(t){const r=a.state.ddf9(),e=a.field.emptyLanes(r);if(e.length===0)return d.actionEval(t,"NR");{const s=d.ddp4(t,r,e[a.randInt(0,e.length)],`${"NDR"}${this.level}`);return s.type="ST",s.hints.push("ENF"),s}}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;a.field.qEnemyCreats().forEach(r=>{r.addPoison(t)})}noxE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.boof246;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{psn:s})),r}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${a.log.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)a.field.ddf1().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;a.field.ddf1().forEach(r=>{r.buff(t,0)})}}oforceE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.lValN([3,6,Ht+1]);return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s})),r}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=N.minionBuff(this.level);this.text=`Put a ${t}/${t} ${N.minionName(this.level)} into each players available spaces.`}phyZ(){const t=N.minionCode(this.level),r=Date.now();[!0,!1].forEach(e=>{a.field.emptyLanes(e).forEach(s=>{a.field.birthCreature(t,"P",e,s,r)})})}phyE(t){const r=N.minionCode(this.level),e=d.actionEval(t,"ST");return e.vectors=[!0,!1].map(s=>a.field.emptyLanes(s).map(c=>{const u=d.evalVectorCreatureFromCode(r,s,c);return u.type="R",u})).flat(),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,r=Date.now(),e=a.field.qEnemyCreats();a.field.ddf1().forEach(s=>{e.forEach(c=>{c.hurtDirect(t,s.code,r)})})}pyreE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.level*a.field.ddf1().length;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{dmg:s})),r}get spboof(){return(this.level+1)*-2}pulseC(){this.faction="A",this.rarity="H",this.name="Sonic Pulse",this.text=`Each enemy creature gets ${a.log.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;a.field.qEnemyCreats().forEach(r=>{r.buff(t,0)})}pulseE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.spboof;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s})),r}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;a.field.ddf1().forEach(r=>{r.heal(t)})}sradE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof3612;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{hlt:s})),r}talinC(){this.faction="T",this.rarity="C",this.name="Talin Stampede",this.text=`Each friendly Tempys creature gets ${a.log.jr9(this.boof5814,0)} this turn.`}talinZ(){const t=this.boof5814;this.talinTarg().forEach(r=>{const e=d.mod("AT",t);e.expiry="ET",r.addMod(e)})}talinE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof5814;return r.vectors=this.talinTarg().map(c=>d.ddp1(e,c.lane,{att:s})),r}talinTarg(){const t=d.crFriendTarg();return t.faction="T",a.field.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 ${a.log.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,r=-1*t;a.field.qActiveCreats().forEach(e=>{const s=d.mod("AT",t),c=d.mod("HL",r),u=d.mod("MH",r);s.expiry="ET",c.expiry="ET",u.expiry="ET",e.addMod(s),e.addMod(c),e.addMod(u)})}turnbE(t){const r=d.actionEval(t,"ST"),e=this.boof235,s=-1*e;return r.vectors=[!0,!1].map(c=>a.field.laneIdx.map(u=>d.ddp1(c,u,{att:e,hlt:s}))).flat(),r}}class Re extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Borean Mystic",this.jr1=this.boof4814,this.jr2=this.boof71118,this.tribe.push("WN","AS"),this.text=`Activate: Move another friendly creature to an available space adjacent to ${this.name}.`}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{const e=a.field.jr5(r[1]);a.field.jr5(r[2]).move(t.lane),e.endActivation()}}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=this.buddies(e.id);return s.push(a.action.cancelAction()),s}else if(t.actionKey==="CARD"){const e=a.field.ddf6(t),s=a.deTil(t.param),c=a.field.jr5(s[1]),u=this.emptySloots(c,e.id);return u.push(a.action.cancelAction()),u}return super.getCardActions(t,r)}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=d.actionEval(t,"ST"),s=t,c=a.field.jr5(r[2]),u=d.ddp1(c.owner,c.lane);return u.moveTo=s.lane,e.vectors.push(u),e}}}emptySloots(t,r=""){return a.action.emptyAdjacents(t,a.enTil("P2",t.id,r))}buddies(t){return a.target.toActions(d.crFriendNotMeActTarg("CARD",t,this.code,a.enTil("P1",t)))}}class Ge extends x{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Brightsteel Gargoyle",this.jr1=this.boof61016,this.jr2=this.jr1,this.initMobile=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,r){const e=super.jr3(t,r);return e.jr4("PT",this.code),e}ddf8(t){return t.trigger.type==="PT"?t.event.playerA===t.ownerPlayerA:!1}jr8(t){const r=d.mod("AR",this.boof2510,t.creatId),e=d.mod("DF",!0,t.creatId);r.expiry="ET",e.expiry="ET";const s=a.field.jr5(t.creatId);s.addMod(r),s.addMod(e),a.batch.triggerDone()}}class Le extends Q{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 r=d.crFriendActTarg("CARD",this.code,"P1");r.hasArmor=!0,t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]);e.hurtDirect(s.armor*this.level,this.code),a.turn.spellCast()}}enemyTargActions(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r)}getCardActions(t){const r=a.field.ddf6(t),e=this.enemyTargActions(r.id);return e.push(a.action.cancelAction()),e}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=t,s=a.field.jr5(r[1]);return d.ddp2(t,e.playerA,e.lane,{dmg:s.armor*this.level})}}}class Ie extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Byzerak Spitemage",this.jr1=this.boof369,this.jr2=this.level,this.initAggro=!0,this.tribe.push("HM"),this.hints=["ALN"],this.bonus={play:this.level*.5},this.text=`Allied Nekrium: When ${this.name} ${a.log.dbdtac(this.level)}, destroy it.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&r.creatureSrc&&r.creatureTarg&&r.dmg>0&&r.source.id===t.creatId&&a.target.levelTestCommon(r.target.level,this.level)}else return!1}jr8(t){if(t.trigger.type==="FR"&&a.turn.allied("N")){const r=a.field.jr5(t.creatId);r.jr4("DM",this.code),r.hints.push("BX"),r.changed=!0}else if(t.trigger.type==="DM"){const e=t.event.target;a.death.destroy(e,this.code)}a.batch.triggerDone()}}class $e extends x{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Cercee, Hand of Varna",this.jr1=this.lValN([1,3,5,7]),this.jr2=this.lValN([6,10,20,40]),this.tribe.push("FB"),this.initMobile=1,this.maxLevel=4,this.level===4?this.hints=["OL","LKV","BX"]:this.hints=["OP","BX"];const r=this.level===4?`When ${this.name} ${a.log.dbdtap()}, deal damamge to that player equal to their health. `:"";this.text=r+`When ${this.name} ${a.log.dbdtac(this.level)}, destroy that creature.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;if(r.battle&&r.creatureSrc&&r.source.id===t.creatId){if(this.level===4)return!0;if(r.creatureTarg){const e=r.target;return a.target.levelTestCommon(e.level,this.level)}}}return!1}jr8(t){const r=t.event;if(r.creatureTarg){const e=r.target;e.status==="A"&&a.death.destroy(e,this.code)}else{const e=a.player.toPlayer(r.target);a.player.ddf3(e,e.health,this.code)}a.batch.triggerDone()}}class ne extends x{constructor(t){super(t)}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.creatureTarg&&r.target.id===t.creatId}return!1}}class Ve extends ne{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Chrogias",this.jr1=this.lValN([1,0,40]),this.jr2=this.lValN([1,15,40]),this.tribe.push("PL"),this.level===1?(this.hints=["LV","ST"],this.bonus={play:1}):this.level===2?(this.initRegen=2,this.initDefend=!0,this.bonus={play:1}):this.level===3&&(this.initBT=!0,this.initRegen=5),this.level>1&&(this.hints=["DLK"],this.text="When Chrogias is dealt damage, you gain that much health.")}jr8(t){if(this.level>1){const r=t.event;a.player.healPlayer(t.ownerPlayerA,r.dmg)}a.batch.triggerDone()}}class z extends x{lookup(t){return{["FFU"]:{c:()=>this.ffuC(),a:(e,s)=>this.ffuA(e,s),t:e=>this.ffuT(e),e:(e,s)=>this.ffuE(e,s)},["FFS"]:{c:()=>this.ffsC(),a:(e,s)=>this.ffsA(e,s),t:e=>this.ffsT(e),e:(e,s)=>this.ffsE(e,s)},["FSH"]:{c:()=>this.fssC(),a:(e,s)=>this.fssA(e,s),t:e=>this.fssT(e),e:(e,s)=>this.fssE(e,s)},["KOD"]:{c:()=>this.kodC(),a:(e,s)=>this.kodA(e,s),t:e=>this.kodT(e),e:(e,s)=>this.kodE(e,s)},["MBP"]:{c:()=>this.mbpC(),a:(e,s)=>this.mbpA(e,s),t:e=>this.mbpT(e),e:(e,s)=>this.mbpE(e,s)},["MND"]:{c:()=>this.mndC(),a:(e,s)=>this.mndA(e,s),t:e=>this.mndT(e),e:(e,s)=>this.mndE(e,s)},["NCS"]:{c:()=>this.ncsC(),a:(e,s)=>this.ncsA(e,s),t:e=>this.ncsT(e),e:(e,s)=>this.ncsE(e,s)},["NFF"]:{c:()=>this.nffC(),a:(e,s)=>this.nffA(e,s),t:e=>this.nffT(e),e:(e,s)=>this.nffE(e,s)},["OHV"]:{c:()=>this.orghC(),a:(e,s)=>this.orghA(e,s),t:e=>this.orghT(e),e:(e,s)=>this.orghE(e,s)},["PPM"]:{c:()=>this.ppmC(),a:(e,s)=>this.ppmA(e,s),t:e=>this.ppmT(e),e:(e,s)=>this.ppmE(e,s)},["PSC"]:{c:()=>this.pcoilC(),a:(e,s)=>this.pcoilA(e,s),t:e=>this.pcoilT(e),e:(e,s)=>this.pcoilE(e,s)},["SGF"]:{c:()=>this.siggyC(),a:(e,s)=>this.siggyA(e,s),t:e=>this.siggyT(e),e:(e,s)=>this.siggyE(e,s)},["SSA"]:{c:()=>this.ssaC(),a:(e,s)=>this.ssaA(e,s),t:e=>this.ssaT(e),e:(e,s)=>this.ssaE(e,s)},["SWM"]:{c:()=>this.swmC(),a:(e,s)=>this.swmA(e,s),t:e=>this.swmT(e),e:(e,s)=>this.swmE(e,s)},["UCM"]:{c:()=>this.ucmC(),a:(e,s)=>this.ucmA(e,s),t:e=>this.ucmT(e),e:(e,s)=>this.ucmE(e,s)},["UIM"]:{c:()=>this.uimC(),a:(e,s)=>this.uimA(e,s),t:e=>this.uimT(e),e:(e,s)=>this.uimE(e,s)},["WMR"]:{c:()=>this.warmC(),a:(e,s)=>this.warmA(e,s),t:e=>this.warmT(e),e:(e,s)=>this.warmE(e,s)},["WFS"]:{c:()=>this.wfsC(),a:(e,s)=>this.wfsA(e,s),t:e=>this.wfsT(e),e:(e,s)=>this.wfsE(e,s)},["ZPM"]:{c:()=>this.zpmC(),a:(e,s)=>this.zpmA(e,s),t:e=>this.zpmT(e),e:(e,s)=>this.zpmE(e,s)}}[t]}targAction(t,r,e){this.lookup(t).a(r,e)}actTargets(t,r){return this.lookup(t).t(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=t,e=a.field.jr5(t.param);return this.lookup(this.cardCode()).e(r,e)}}canActivate(t){return a.target.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.ddf6(t),e=a.field.jr5(t.param);this.targAction(this.cardCode(),r,e),e.endActivation()}makeCreatTarg(t){return d.crActTarg("CARD",this.code,t.id)}ddf8(t){return ut.extractCardCode(t.trigger.logicCode)==="KOD"&&(t.trigger.type==="PT"||t.trigger.type==="VN")?!0:super.ddf8(t)}jr8(t){if(t.trigger.type==="VN"){const r=t.event;a.field.birthCreature(r.creature.code,"S",t.ownerPlayerA),a.batch.triggerDone()}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,e=a.field.jr5(t.creatId);e.triggers.filter(c=>c.customCode===r).forEach(c=>e.removeTrigger(c)),a.batch.triggerDone()}}getCardActions(t,r){const e=r??a.field.jr5(t.param);return a.target.toActions([this.actTargets(this.cardCode(),e),a.target.buttonTarget("CANC")])}ffuC(){this.faction="T",this.rarity="H",this.name="Firefist Uranti",this.jr1=this.boof357,this.jr2=this.boof71116,this.tribe.push("FR","YT"),this.text=`Activate: Deal damage equal to ${this.name}'s attack to a creature.`}ffuT(t){return this.makeCreatTarg(t)}ffuA(t,r){t.hurtDirect(r.attack,this.code)}ffuE(t,r){return d.ddp2(t,t.playerA,t.lane,{dmg:r.attack})}ffsC(){this.faction="T",this.rarity="R",this.name="Flamefury Shaman",this.jr1=this.boof369,this.jr2=this.boof81116,this.tribe.push("HM"),this.text=`Activate: Grant another creature ${a.log.jr9(this.jr1,0)} this turn.`}ffsT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}ffsA(t,r){const e=d.mod("AT",this.jr1,r.id);e.expiry="ET",t.addMod(e)}ffsE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.jr1)}fssC(){this.faction="T",this.rarity="R",this.name="Flamestoke Shaman",this.jr1=this.boof61218,this.jr2=this.boof3712,this.tribe.push("HM"),this.text=`Activate: Grant an adjacent ${a.log.levelGateText(this.level,!0)}creature Aggressive.`}fssT(t){const r=this.makeCreatTarg(t);return r.level=a.target.ddf2(this.level),r.lanes=t.adjacent,r.player=a.player.toTarget(t.owner),r}fssA(t,r){t.aggressive=!0}fssE(t,r){return d.ddp2(t,t.playerA,t.lane,{agr:!0})}kodC(){this.faction="N",this.rarity="L",this.name="Keeper of the Damned",this.jr1=this.boof5815,this.jr2=this.boof61017,this.tribe.push("ZB"),this.text=`Activate: another friendly ${a.log.levelGateText(this.level,!0)}creature gets "Vengeance: Spawn this" this turn.`}kodT(t){const r=this.makeCreatTarg(t);return r.level=a.target.ddf2(this.level),r.player=a.player.toTarget(t.owner),r.notMe=t.id,r}kodA(t,r){const e=t.jr4("VN",this.code);e.customCode=r.id,e.changes=!0;const s=t.jr4("PT",this.code);s.customCode=r.id}kodE(t,r){const e=d.ddp2(t,t.playerA,t.lane,void 0,"LZ");return e.bonus=2,e}mbpC(){this.faction="U",this.rarity="H",this.name="Mossbeard Patriarch",this.jr1=this.boof137,this.jr2=this.boof81220,this.tribe.push("PL"),this.text=`Activate: Give another creature ${a.log.jr9(0,this.boof468)}.`}mbpT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}mbpA(t,r){t.buff(0,this.boof468)}mbpE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,0,this.boof468)}mndC(){this.faction="A",this.rarity="R",this.name="Munitions Drone",this.jr1=this.boof137,this.jr2=this.boof6814,this.tribe.push("RB"),this.text=`Activate: Give another creature ${a.log.jr9(this.boof357,0)}.`}mndT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}mndA(t,r){t.buff(this.boof357,0)}mndE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof357)}ncsC(){this.faction="N",this.rarity="R",this.name="Necroslime",this.jr1=this.boof4814,this.jr2=this.jr1,this.tribe.push("OZ");const t=this.boof248;this.text=`Activate, deal 3 damage to another friendly creature: ${this.name} gets ${a.log.jr9(t,t)}.`}ncsT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r.player="F",r}ncsA(t,r){const e=this.boof248;t.hurtDirect(3,this.code),r.buff(e,e)}ncsE(t,r){const e=this.boof248,s=d.actionEvalBuffC(t,r,e,e);return s.vectors.push(d.ddp1(t.playerA,t.lane,{dmg:3})),s}nffC(){this.faction="U",this.rarity="L",this.name="Nuada, Faith's Flourish",this.jr1=this.boof246,this.jr2=this.lValN([10,17,25]),this.initDefend=!0,this.tribe.push("TK");const t=this.boof91421;this.text=`Activate: Give a friendly Plant with a ${t}/${t} Treefolk.`}nffT(t){const r=this.makeCreatTarg(t);return r.player="F",r.tribe="PL",r}nffA(t,r){a.field.birthCreature(`${"TFF"}${this.level}`,"R",r.owner,t.lane)}nffE(t,r){const e=d.ddp4(t,t.playerA,t.lane,`${"TFF"}${this.level}`);return e.hints=["RE"],e}orghC(){this.faction="N",this.rarity="R",this.name="Organ Harvester",this.jr1=this.lValN([2,6,9]),this.jr2=this.jr1+1,this.tribe.push("AB"),this.text=`Activate, destroy ${this.name}: Destroy a ${a.log.levelGateText(this.level,!0)}creature.`}orghT(t){const r=this.makeCreatTarg(t);return r.level=a.target.ddf2(this.level),r.notMe=t.id,r}orghA(t,r){const e=Date.now();a.death.destroy(t,this.code,e),a.death.destroy(r,this.code,e)}orghE(t,r){const e=d.ddp7(t,t.playerA,t.lane),s=d.ddp1(r.owner,r.lane);return s.destroy=!0,e.vectors.push(s),e}ppmC(){this.faction="A",this.rarity="R",this.name="Palladium Pulsemage",this.jr1=this.lValN([2,8,12]),this.jr2=this.lValN([7,12,15]),this.tribe.push("HM"),this.text=`Activate: give a creature ${a.log.jr9(this.boof4812n,0)} this turn.`}ppmT(t){return this.makeCreatTarg(t)}ppmA(t,r){const e=d.mod("AT",this.boof4812n,r.id);e.expiry="ET",t.addMod(e)}ppmE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof4812n)}pcoilC(){this.faction="U",this.rarity="R",this.name="Poisoncoil",this.jr1=this.boof357,this.jr2=this.boof71013,this.initDefend=!0,this.tribe.push("SN"),this.text=`Activate: Give another creature Poison ${this.boof135}.`}pcoilT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}pcoilA(t,r){t.addPoison(this.boof135)}pcoilE(t,r){return d.ddp2(t,t.playerA,t.lane,{psn:this.boof135})}siggyC(){this.faction="N",this.rarity="H",this.name="Sigmund Fraud",this.jr1=this.boof357,this.jr2=this.lValN([9,14,19]),this.initDefend=!0,this.tribe.push("AB");const t=this.boof4812;this.text=`Activate, destroy another friendly creature: Deal ${t} damage to the enemy player and you gain ${t} health.`}siggyT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r.player="F",r}siggyA(t,r){a.death.destroy(t,this.code);const e=this.boof4812;a.player.ddf3(!r.owner,e,this.code),a.player.healPlayer(r.owner,e)}siggyE(t,r){const e=d.ddp7(t,t.playerA,t.lane,"SD"),s=this.boof4812;return e.vectors.push(d.evalVectorPlayerDmg(!r.owner,s),d.evalVectorPlayerLife(r.owner,s)),e}ssaC(){this.faction="N",this.rarity="H",this.name="Spitesower Acolyte",this.jr1=this.boof234,this.jr2=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 ${a.log.jr9(t,t)}.`}ssaT(t){return this.makeCreatTarg(t)}ssaA(t,r){const e=this.boof246n,s=Date.now();r.hurtDirect(-e,this.code,s),t.buff(e,e,s)}ssaE(t,r){const e=this.boof246n,s=d.actionEvalBuffN(t,t.playerA,t.lane,e,e);return s.vectors.push(d.ddp1(r.owner,r.lane,{dmg:-e})),s}swmC(){this.faction="A",this.rarity="R",this.name="Steelwelder Medic",this.jr1=this.lValN([3,5,13]),this.jr2=this.boof61014,this.tribe.push("HM"),this.text=`Activate: Give another creature Armor ${this.level}.`}swmT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r.canArmor=!0,r}swmA(t,r){t.addArmor(this.level)}swmE(t,r){return d.ddp2(t,t.playerA,t.lane,{arm:this.level})}ucmC(){this.faction="T",this.rarity="R",this.name="Uranti Cryomancer",this.jr1=this.boof247,this.jr2=this.lValN([8,13,17]),this.tribe.push("IC","YT"),this.text=`Activate: Deal ${this.boof135} damage to a creature.`}ucmT(t){return this.makeCreatTarg(t)}ucmA(t,r){t.hurtDirect(this.boof135,this.code)}ucmE(t,r){return d.ddp2(t,t.playerA,t.lane,{dmg:this.boof135})}uimC(){this.faction="T",this.rarity="C",this.name="Uranti Icemage",this.jr1=this.lValN([2,5,9]),this.jr2=this.lValN([8,13,20]),this.tribe.push("IC","YT"),this.text="Activate: Negate Defender this turn."}uimT(t){return this.makeCreatTarg(t)}uimA(t,r){const e=d.mod("ND",!0,r.id);e.expiry="ET",t.addMod(e)}uimE(t,r){return d.ddp2(t,t.playerA,t.lane,{noD:!0})}warmC(){this.faction="A",this.rarity="H",this.name="War Merchant",this.jr1=this.boof468,this.jr2=this.jr1,this.initDefend=!0,this.tribe.push("HM"),this.text=`Activate: Give a creature in a center space ${a.log.jr9(this.jr1,this.level===3?this.jr1:0)}.`}warmT(t){const r=this.makeCreatTarg(t);return r.lanes=3,r}warmA(t,r){t.buff(this.jr1,this.level===3?this.jr1:0)}warmE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.jr1,this.level===3?this.jr1:0)}wfsC(){this.faction="N",this.rarity="H",this.name="Witherfrost Succubus",this.jr1=this.boof147,this.jr2=this.boof61018,this.tribe.push("DM");const t=-this.boof357;this.text=`Activate: Give a creature ${a.log.jr9(t,t)} this turn.`}wfsT(t){return this.makeCreatTarg(t)}wfsA(t,r){const e=-this.boof357,s=d.mod("AT",e,r.id);s.expiry="ET",t.addMod(s);const c=d.mod("HL",e,r.id);c.expiry="ET",t.addMod(c);const u=d.mod("MH",e,r.id);u.expiry="ET",t.addMod(u)}wfsE(t,r){const e=-this.boof357;return d.actionEvalBuffN(t,t.playerA,t.lane,e,e)}zpmC(){this.faction="T",this.rarity="R",this.name="Zephyr Mage",this.jr1=this.boof4813,this.jr2=this.boof61017,this.tribe.push("WN","AS"),this.text=`Activate: Give another ${a.log.levelGateText(this.level,!0)}creature Mobility ${this.level}.`}zpmT(t){const r=this.makeCreatTarg(t);return r.level=a.target.ddf2(this.level),r.notMe=t.id,r.canMove=!0,r}zpmA(t,r){t.addMobility(this.level)}zpmE(t,r){const e=d.ddp2(t,t.playerA,t.lane);return e.bonus=.5,e}}class _ extends x{lookup(t){return{["AGC"]:{c:()=>this.aconC(),f:(e,s)=>this.aconF(e,s),e:e=>this.aconE(e)},["BSR"]:{c:()=>this.bsrC(),f:(e,s)=>this.bsrF(e,s),e:e=>this.bsrE(e)},["BAW"]:{c:()=>this.bawC(),f:(e,s)=>this.bawF(e,s),e:e=>this.bawE(e)},["CHA"]:{c:()=>this.chaC(),f:(e,s)=>this.chaF(e,s),e:e=>this.chaE(e)},["CCR"]:{c:()=>this.ccC(),f:(e,s)=>this.ccF(e,s),e:e=>this.ccE(e)},["GLF"]:{c:()=>this.gfiendC(),f:(e,s)=>this.gfiendF(e,s),e:e=>this.gfiendE(e)},["GRW"]:{c:()=>this.grwC(),f:(e,s)=>this.grwF(e,s),e:e=>this.grwE(e)},["GHT"]:{c:()=>this.grhC(),f:(e,s)=>this.grhF(e,s),e:e=>this.grhE(e)},["MMH"]:{c:()=>this.houndC(),f:(e,s)=>this.houndF(e,s),e:e=>this.houndE(e)},["MXW"]:{c:()=>this.mtxC(),f:(e,s)=>this.mtxF(e,s),e:e=>this.mtxE(e)},["NGB"]:{c:()=>this.ngbC(),f:(e,s)=>this.ngbF(e,s),e:e=>this.ngbE(e)},["PHS"]:{c:()=>this.phxsC(),f:(e,s)=>this.phxsF(e,s),e:e=>this.phxsE(e)},["STD"]:{c:()=>this.stdC(),f:(e,s)=>this.stdF(e,s),e:e=>this.stdE(e)},["VNF"]:{c:()=>this.vnfC(),f:(e,s)=>this.vnfF(e,s),e:e=>this.vnfE(e)},["WBY"]:{c:()=>this.wbyC(),f:(e,s)=>this.wbyF(e,s),e:e=>this.wbyE(e)},["WBU"]:{c:()=>this.wbuC(),f:(e,s)=>this.wbuF(e,s),e:e=>this.wbuE(e)}}[t]}targAction(t,r,e){this.lookup(t).f(r,e)}targEval(t,r){return this.lookup(t).e(r)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=d.crActTarg("CARD",this.code),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}jr3(t,r){const e=super.jr3(t,r);if(this.forges){const s=e.jr4("FR",this.code);s.interactive=!0}return e}handleAction(t){const r=a.field.ddf6(t),e=a.field.jr5(t.param);this.targAction(this.cardCode(),r,e),a.action.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const r=a.target.toActions(this.playTarg);r.length>0?(r.forEach(e=>{e.param=t.creatId}),this.optional&&r.push(a.action.noneEndTrigger()),a.action.ddf5(r)):a.batch.triggerDone()}ddf7(t){return this.targEval(this.cardCode(),t)}aconC(){this.faction="A",this.rarity="C",this.name="Aegis Conscript",this.jr1=this.boof3612,this.jr2=this.lValN([6,9,15]),this.tribe.push("HM"),this.hints=["FRO"],this.bonus={play:this.ddp9(0,this.boof248,0,0)},this.playTarg.canArmor=!0,this.playTarg.player="F",this.ftext=`Give a friendly creature Armor ${this.boof124}.`}aconF(t,r){t.addArmor(this.boof124)}aconE(t){return d.ddp2(t,t.playerA,t.lane,{arm:this.boof124})}bsrC(){this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.jr1=this.boof5813,this.jr2=this.boof3712,this.tribe.push("AB"),this.hints=["ENS"],this.bonus={play:this.ddp6()},this.forges=this.level>1,this.playTarg.level=a.target.ddf2(this.level-1),this.playTarg.player="E",this.ftext=`You may destroy a ${a.log.levelGateText(this.level-1)} enemy creature.`,this.optional=!0}bsrF(t,r){a.death.destroy(t,this.code)}bsrE(t){return d.ddp7(t,t.playerA,t.lane)}bawC(){this.faction="U",this.rarity="R",this.name="Brambleaxe Warrior",this.jr1=this.boof61014,this.jr2=this.jr1-4,this.tribe.push("HM"),this.hints=["FRO"];const t=this.avgCreatureStats()[0];this.bonus={play:this.ddp9(0,0,t,t)},this.ftext="Give a creature Breakthrough this turn."}bawF(t,r){const e=d.mod("BT",!0,r.id);e.expiry="ET",t.addMod(e)}bawE(t){return d.ddp2(t,t.playerA,t.lane,{brt:!0})}chaC(){this.faction="U",this.rarity="R",this.name="Chistlehearth Archer",this.jr1=this.boof2510,this.jr2=this.jr1+7,this.tribe.push("HM"),this.hints=["ENS"];const t=this.boof4816;this.bonus={play:this.ddp9(0,t/2,0,0)},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,r){t.hurtDirect(this.boof4816,this.code),t.negateMobility=!0}chaE(t){return d.ddp2(t,t.playerA,t.lane,{dmg:this.boof4816})}ccC(){this.faction="N",this.rarity="C",this.name="Corpse Crawler",this.jr1=this.boof81220,this.jr2=this.jr1+1,this.tribe.push("AB"),this.hints=["SD"],this.playTarg.player="F",this.ftext="Destroy a friendly creature."}ccF(t,r){a.death.destroy(t,this.code)}ccE(t){return d.ddp7(t,t.playerA,t.lane,"SD")}get fiendBof(){return this.lValN([-1,-2,-5])}gfiendC(){this.faction="N",this.rarity="C",this.name="Gloomfiend",this.jr1=this.boof4812,this.jr2=this.jr1,this.tribe.push("AB"),this.hints=["ENS"],this.playTarg.player="E";const t=this.fiendBof;this.ftext=`You may give an enemy creature ${a.log.jr9(t,t)}.`,this.optional=!0,this.bonus={play:this.ddp9(0,-2*t,-t,0)}}gfiendF(t,r){const e=this.fiendBof;t.buff(e,e)}gfiendE(t){const r=this.fiendBof;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}grwC(){this.faction="N",this.rarity="C",this.name="Gloomreaper Witch",this.jr1=this.boof5915,this.jr2=this.jr1,this.tribe.push("HM"),this.hints=["ENS"],this.bonus={play:this.ddp6()/4};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,r){a.death.destroy(t,this.code)}grwE(t){return d.ddp7(t,t.playerA,t.lane)}grhC(){this.faction="U",this.rarity="C",this.name="Grove Huntress",this.jr1=this.boof4711,this.jr2=this.jr1-1,this.tribe.push("HM"),this.playTarg.player="F";const t=this.boof135;this.ftext=`Give a friendly creature ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*2,t,0)}}grhF(t,r){const e=this.boof135;t.buff(e,e)}grhE(t){const r=this.boof135;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}houndC(){this.faction="T",this.rarity="C",this.name="Magma Hound",this.jr1=this.boof4813,this.jr2=this.jr1-1,this.tribe.push("ER","EL"),this.hints=["ENS"];const t=this.boof246;this.optional=!0,this.playTarg.player="E",this.ftext=`You may deal ${t} damage to an enemy creature.`,this.bonus={play:this.ddp9(0,t,0,0)}}houndF(t,r){t.hurtDirect(this.boof246,this.code)}houndE(t){return d.ddp2(t,t.playerA,t.lane,{dmg:this.boof246})}mtxC(){this.faction="A",this.rarity="C",this.name="Matrix Warden",this.jr1=this.lValN([3,8,12]),this.jr2=this.jr1,this.tribe.push("RB");const t=this.boof3510;this.playTarg.player="F",this.ftext=`Give a friendly creature ${a.log.jr9(t,0)}.`,this.bonus={play:this.ddp9(0,t,t,0)}}mtxF(t,r){t.buff(this.boof3510,0)}mtxE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof3510)}ngbC(){this.faction="T",this.rarity="C",this.name="Nargath Bruiser",this.jr1=this.boof5814,this.jr2=this.jr1-1,this.tribe.push("ER","AS");const t=this.boof248;this.playTarg.player="F",this.ftext=`Give a friendly creature ${a.log.jr9(0,t)}.`,this.bonus={play:this.ddp9(0,t,0,0)}}ngbF(t,r){t.buff(0,this.boof248)}ngbE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,0,this.boof248)}phxsC(){this.faction="A",this.rarity="R",this.name="Phalanx Squadron",this.jr1=this.boof3714,this.jr2=this.boof61117,this.tribe.push("HM"),this.hints=["FRO"],this.playTarg.hasArmor=!0,this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature with Armor ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t,t/2,0)}}phxsF(t,r){const e=this.boof234;t.buff(e,e)}phxsE(t){const r=this.boof234;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}stdC(){this.faction="A",this.rarity="H",this.name="Shardthief Druid",this.jr1=this.boof5813,this.jr2=this.boof81318,this.tribe.push("MM"),this.hints=["ENS"],this.playTarg.canRegen,this.playTarg.player="E",this.ftext=`Negate and remove all Regenerate from an enemy creature. ${this.name} gets that much Renerate.`,this.bonus={play:this.ddp9(0,2,0,0)}}stdF(t,r){const e=t.regen;t.negateRegen=!0,r.addRegen(e)}stdE(t){const r=a.field.ddf6(t);return d.ddp3(t,r,{rgn:-r.regen})}vnfC(){this.faction="U",this.rarity="R",this.name="Venomfang",this.jr1=this.boof61014,this.jr2=this.jr1-2,this.tribe.push("SN");const t=this.boof246;this.playTarg.player="E",this.ftext=`Give an enemy creature Poison ${t}.`,this.bonus={play:this.ddp9(0,t,0,0)}}vnfF(t,r){t.addPoison(this.boof246)}vnfE(t){return d.ddp2(t,t.playerA,t.lane,{psn:this.boof246})}wbyC(){this.faction="T",this.rarity="R",this.name="Wallbreaker Yeti",this.jr1=this.boof4712,this.jr2=this.boof71116,this.tribe.push("ER","YT"),this.hints=["ENS"],this.bonus={play:this.ddp6()/4},this.playTarg.player="E",this.playTarg.level=a.target.ddf2(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${a.log.levelGateText(this.level,!0)}enemy creature with Defender.`,this.optional=!0}wbyF(t,r){a.death.destroy(t,this.code)}wbyE(t){return d.ddp7(t,t.playerA,t.lane)}wbuC(){this.faction="T",this.rarity="C",this.name="Warbringer Uranti",this.jr1=this.boof3711,this.jr2=this.jr1,this.tribe.push("LT","YT"),this.hints=["FRO"];const t=this.boof4812;this.notme=!0,this.playTarg.player="F",this.ftext=`Give another friendly creature ${a.log.jr9(t,0)} this turn.`,this.bonus={play:this.ddp9(0,t,t,0)}}wbuF(t,r){const e=d.mod("AT",this.boof4812,r.id);e.expiry="ET",t.addMod(e)}wbuE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof4812)}}class P extends Q{lookup(t){return{["ASG"]:{c:()=>this.asurgeC(),z:e=>this.asurgeZ(e),e:e=>this.asurgeE(e)},["AQE"]:{c:()=>this.aqatC(),z:e=>this.aqatZ(e),e:e=>this.aqatE(e)},["ABL"]:{c:()=>this.ablC(),z:e=>this.ablZ(e),e:e=>this.ablE(e)},["BTM"]:{c:()=>this.botC(),z:e=>this.botZ(e),e:e=>this.botE(e)},["CSU"]:{c:()=>this.csurgeC(),z:e=>this.csurgeZ(e),e:e=>this.csurgeE(e)},["CTW"]:{c:()=>this.cullC(),z:e=>this.cullZ(e),e:e=>this.cullE(e)},["CTV"]:{c:()=>this.cultC(),z:e=>this.cultZ(e),e:e=>this.cultE(e)},["CAG"]:{c:()=>this.cypaC(),z:e=>this.cypaZ(e),e:e=>this.cypaE(e)},["CBS"]:{c:()=>this.cypbC(),z:e=>this.cypbZ(e),e:e=>this.cypbE(e)},["DBT"]:{c:()=>this.dreadC(),z:e=>this.dreadZ(e),e:e=>this.dreadE(e)},["DYB"]:{c:()=>this.drybC(),z:e=>this.drybZ(e),e:e=>this.drybE(e)},["ETN"]:{c:()=>this.elnC(),z:e=>this.elnZ(e),e:e=>this.elnE(e)},["ENP"]:{c:()=>this.enpC(),z:e=>this.enpZ(e),e:e=>this.enpE(e)},["ENR"]:{c:()=>this.rageC(),z:e=>this.rageZ(e),e:e=>this.rageE(e)},["EXD"]:{c:()=>this.expdmC(),z:e=>this.expdmZ(e),e:e=>this.expdmE(e)},["FIN"]:{c:()=>this.feralC(),z:e=>this.feralZ(e),e:e=>this.feralE(e)},["FVA"]:{c:()=>this.fervassC(),z:e=>this.fervassZ(e),e:e=>this.fervassE(e)},["FLN"]:{c:()=>this.flncC(),z:e=>this.flncZ(e),e:e=>this.flncE(e)},["FFL"]:{c:()=>this.ffldC(),z:e=>this.ffldZ(e),e:e=>this.ffldE(e)},["FZS"]:{c:()=>this.frozC(),z:e=>this.frozZ(e),e:e=>this.frozE(e)},["GTH"]:{c:()=>this.ghastC(),z:e=>this.ghastZ(e),e:e=>this.ghastE(e)},["GCR"]:{c:()=>this.crushC(),z:e=>this.crushZ(e),e:e=>this.crushE(e)},["HAR"]:{c:()=>this.hartC(),z:e=>this.hartZ(e),e:e=>this.hartE(e)},["JPK"]:{c:()=>this.jpC(),z:e=>this.jpZ(e),e:e=>this.jpE(e)},["LBR"]:{c:()=>this.lbrandC(),z:e=>this.lbrandZ(e),e:e=>this.lbrandE(e)},["MSC"]:{c:()=>this.sculptC(),z:e=>this.sculptZ(e),e:e=>this.sculptE(e)},["NSL"]:{c:()=>this.natselC(),z:e=>this.natselZ(e),e:e=>this.natselE(e)},["NCV"]:{c:()=>this.nviveC(),z:e=>this.nviveZ(e),e:e=>this.nviveE(e)},["PTR"]:{c:()=>this.pwtorC(),z:e=>this.pwtorZ(e),e:e=>this.pwtorE(e)},["PSG"]:{c:()=>this.psurgeC(),z:e=>this.psurgeZ(e),e:e=>this.psurgeE(e)},["PMS"]:{c:()=>this.pslamC(),z:e=>this.pslamZ(e),e:e=>this.pslamE(e)},["ROG"]:{c:()=>this.rotgC(),z:e=>this.rotgZ(e),e:e=>this.rotgE(e)},["SAP"]:{c:()=>this.sapC(),z:e=>this.sapZ(e),e:e=>this.sapE(e)},["SVO"]:{c:()=>this.soathC(),z:e=>this.soathZ(e),e:e=>this.soathE(e)},["SHG"]:{c:()=>this.shgrC(),z:e=>this.shgrZ(e),e:e=>this.shgrE(e)},["SNB"]:{c:()=>this.snbC(),z:e=>this.snbZ(e),e:e=>this.snbE(e)},["SHV"]:{c:()=>this.sharvC(),z:e=>this.sharvZ(e),e:e=>this.sharvE(e)},["STR"]:{c:()=>this.sttorC(),z:e=>this.sttorZ(e),e:e=>this.sttorE(e)},["STO"]:{c:()=>this.sptorC(),z:e=>this.sptorZ(e),e:e=>this.sptorE(e)},["STN"]:{c:()=>this.stbrnC(),z:e=>this.stbrnZ(e),e:e=>this.stbrnE(e)},["SIN"]:{c:()=>this.sinC(),z:e=>this.sinZ(e),e:e=>this.sinE(e)},["TPT"]:{c:()=>this.tpactC(),z:e=>this.tpactZ(e),e:e=>this.tpactE(e)},["TUP"]:{c:()=>this.tugC(),z:e=>this.tugZ(e),e:e=>this.tugE(e)},["TOB"]:{c:()=>this.blightC(),z:e=>this.blightZ(e),e:e=>this.blightE(e)},["TXS"]:{c:()=>this.sporeC(),z:e=>this.sporeZ(e),e:e=>this.sporeE(e)},["TCG"]:{c:()=>this.tremcC(),z:e=>this.tremcZ(e),e:e=>this.tremcE(e)},["VGR"]:{c:()=>this.vgraC(),z:e=>this.vgraZ(e),e:e=>this.vgraE(e)},["VYE"]:{c:()=>this.vembC(),z:e=>this.vembZ(e),e:e=>this.vembE(e)},["UBL"]:{c:()=>this.uboltC(),z:e=>this.uboltZ(e),e:e=>this.uboltE(e)},["WMM"]:{c:()=>this.warC(),z:e=>this.warZ(e),e:e=>this.warE(e)},["XRW"]:{c:()=>this.xwillC(),z:e=>this.xwillZ(e),e:e=>this.xwillE(e)}}[t]}cardCast(t,r){this.lookup(t).z(r)}castEval(t,r){return this.lookup(t).e(r)}playTarg;constructor(t){super(t),this.playTarg=d.crActTarg("CARD",this.code),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.cardCode()==="NSL"&&a.field.creatByTarget(d.crFriendTarg()).length<5||t.push(this.playTarg),t}handleAction(t){this.logSpell();const r=a.field.ddf6(t);this.cardCast(this.cardCode(),r),a.turn.spellCast()}ddf7(t){return this.castEval(this.cardCode(),t)}ddf8(t){const r=ut.extractCardCode(t.trigger.logicCode);if(r==="TOB"&&t.trigger.type==="DM"){const e=t.event;if(e.battle&&e.creatureTarg&&e.creatureSrc&&e.source.id===t.creatId)return this.level===3?!0:a.cards.getCard(e.target.code).level<=this.level}else if(r==="ABL"&&t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.creatureTarg&&e.creatureSrc&&e.source.id===t.creatId}else if(r==="FZS"&&t.trigger.type==="DM"){const e=t.event;if(e.creatureTarg&&e.target.id===t.creatId)return!0}else if(r==="DYB"&&t.trigger.type==="EF"){const e=t.event;return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.ownerPlayerA}else if(r==="FVA"&&t.trigger.type==="FK"||r==="ROG"&&t.trigger.type==="DS"||r==="SHG"&&(t.trigger.type==="PT"||t.trigger.type==="VN"))return!0;return!1}jr8(t){const r=ut.extractCardCode(t.trigger.logicCode);if(r==="TOB"){const s=t.event.target;a.death.destroy(s,this.code),a.batch.triggerDone()}else if(r==="ABL")a.field.jr5(t.creatId).buff(this.level,this.level),a.batch.triggerDone();else if(r==="FVA"){const e=a.field.jr5(t.creatId),s=a.field.searchByLane(a.field.oppositeLane(e.lane),!e.owner);s&&s.hurtDirect(this.boof3612,e.code),a.batch.triggerDone()}else if(r==="FZS"){const e=a.field.jr5(t.creatId);a.death.destroy(e,this.code),a.batch.triggerDone()}else if(r==="ROG"||r==="DYB")a.field.jr5(t.creatId).buff(this.level,this.level),a.batch.triggerDone();else if(r==="SHG"){if(t.trigger.type==="VN"){const e=t.event;a.field.birthCreature(e.creature.code,"S",t.ownerPlayerA),a.batch.triggerDone()}else if(t.trigger.type==="PT"){const e=t.trigger.customCode,s=a.field.jr5(t.creatId);s.triggers.filter(u=>u.customCode===e).forEach(u=>s.removeTrigger(u)),a.batch.triggerDone()}}else super.jr8(t)}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg.canMove=!0,this.text=`Give a creature Mobility ${this.level}.`}asurgeZ(t){t.addMobility(this.level)}asurgeE(t){return d.actionEval(t,"ST","GM")}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${a.log.jr9(0,this.boof51015)}.`}aqatZ(t){t.buff(0,this.boof51015)}aqatE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,0,this.boof51015)}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${a.log.dbdtap()}, it gets ${a.log.jr9(this.level,this.level)}."`}ablZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("OL")}ablE(t){const r=d.actionEval(t,"ST","OL");return r.bonus=.5,r}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.text=`Replace an enemy ${a.log.levelGateText(this.level,!0)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=a.target.ddf2(this.level)}botZ(t){a.field.birthCreature(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}botE(t){const r=d.ddp4(t,t.playerA,t.lane,`${"BOS"}${this.level}`);return r.hints=["RE"],r}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof123n;this.text=`Give a creature ${a.log.jr9(t,t)}.`}csurgeZ(t){const r=this.boof123n;t.buff(r,r)}csurgeE(t){const r=this.boof123n;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}cullC(){this.faction="N",this.rarity="C",this.name="Cull the Weak";const t=this.boof4814;this.text=`Destroy a creature with ${t} or less attack.`,this.playTarg.maxAttack=t}cullZ(t){a.death.destroy(t,this.code)}cullE(t){return d.ddp7(t,t.playerA,t.lane)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate";const t=this.boof91421;this.text=`Replace a friendly Plant with a ${t}/${t} Treefolk.`,this.playTarg.player="F",this.playTarg.tribe="PL"}cultZ(t){a.field.birthCreature(`${"TFF"}${this.level}`,"R",t.owner,t.lane)}cultE(t){const r=d.ddp4(t,t.playerA,t.lane,`${"TFF"}${this.level}`);return r.hints=["RE"],r}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof246;this.text=`Give a creature in a center space ${a.log.jr9(t,t)}.`,this.playTarg.lanes=3}cypaZ(t){const r=this.boof246;t.buff(r,r)}cypaE(t){const r=this.boof246;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${a.log.jr9(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.faction="A"}cypbZ(t){t.buff(this.boof51015,0),t.addArmor(this.boof124)}cypbE(t){return d.ddp2(t,t.playerA,t.lane,{att:this.boof51015,arm:this.boof124})}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.hints=["LV"],this.text=`Destroy a ${a.log.levelGateText(this.level,!0)}creature.`,this.playTarg.level=a.target.ddf2(this.level)}dreadZ(t){a.death.destroy(t,this.code)}dreadE(t){return d.ddp7(t,t.playerA,t.lane)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${a.log.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${a.log.jr9(this.level,this.level)}."`}drybZ(t){t.buff(this.level,this.level),t.changed=!0,t.jr4("EF",this.code),t.hints.push("BF")}drybE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.level,this.level,"BF")}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.isFree=this.level===3,this.text=`Give a ${a.log.levelGateText(this.level,!0)}creature Defender.`,this.playTarg.canDefender=!0}enpZ(t){t.defender=!0}enpE(t){return d.ddp2(t,t.playerA,t.lane,{def:!0})}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${a.log.jr9(-this.boof51015,0)}.`}elnZ(t){t.buff(-this.boof51015,0)}elnE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,-this.boof51015)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${a.log.jr9(t,t)}.`}rageZ(t){const r=this.boof3612;t.buff(r,r)}rageE(t){const r=this.boof3612;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}expdmC(){this.faction="N",this.rarity="H",this.name="Explosive Demise",this.text=`Destroy a friendly ${a.log.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=a.target.ddf2(this.level+1),this.playTarg.player="F"}expdmZ(t){const r=t.attack;a.death.destroy(t,this.code),a.player.ddf3("E",r,this.code),this.level===3&&a.player.healPlayer("F",r)}expdmE(t){const r=a.field.ddf6(t),e=d.ddp8(t,r);return e.vectors.push(d.evalVectorPlayerDmg(!r.owner,r.attack)),this.level===3&&e.vectors.push(d.evalVectorPlayerDmg(r.owner,r.attack)),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 ${a.log.jr9(t,t,!0)} and Breakthrough.`}feralZ(t){const r=this.fiboof;t.breakthrough=!0,t.buff(r,r)}feralE(t){const r=this.fiboof;return d.ddp2(t,t.playerA,t.lane,{att:r,hlt:r,brt:!0})}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),t.hints.push("FH")}fervassE(t){return d.actionEval(t,"ST","FH")}flncC(){this.faction="T",this.rarity="R",this.name="Flame Lance";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 r=this.boof579;t.hurtDirect(r,this.code),a.player.ddf3("E",r,this.code)}flncE(t){const r=this.boof579,e=d.ddp2(t,t.playerA,t.lane,{dmg:r});return e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r)),e}ffldC(){this.faction="A",this.rarity="C",this.name="Forcefield",this.playTarg.canArmor=!0,this.text=`Give a creature Armor ${this.boof51020} this turn.`}ffldZ(t){const r=d.mod("AR",this.boof51020,this.code);r.expiry="ET",t.addMod(r)}ffldE(t){return d.ddp2(t,t.playerA,t.lane,{arm:this.boof51020})}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=a.target.ddf2(this.level),this.text=`Give a ${a.log.levelGateText(this.level,!0)}creature "When this is dealt damage, destroy it".`}frozZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("DD")}frozE(t){return d.actionEval(t,"ST","DD")}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${a.log.jr9(t,t)}.`}ghastZ(t){const r=-this.boof3612;t.buff(r,r)}ghastE(t){const r=-this.boof3612;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.isFree=this.level>1,this.isFree||(this.hints=["LV"]),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 r=t.health;a.death.destroy(t,this.code),this.level===3&&a.player.ddf3(t.owner,r,this.code)}crushE(t){const r=a.field.ddf6(t),e=d.ddp8(t,r);return this.level===3&&e.vectors.push(d.evalVectorPlayerDmg(r.owner,r.health)),e}hartC(){this.faction="A",this.rarity="C",this.name="Heavy Artillery",this.text=`Give a creature ${a.log.jr9(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}hartE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof51015)}jpC(){this.faction="A",this.rarity="C",this.name="Jet Pack",this.text=`Give a creature ${a.log.jr9(this.boof369,0)} and Mobility 1.`}jpZ(t){t.buff(this.boof369,0),t.addMobility(1)}jpE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof369,void 0,"GM")}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=a.target.ddf2(this.level+1),this.text=`Give a ${a.log.levelGateText(this.level+1)}creature ${a.log.jr9(this.boof124,0)} and Aggressive this turn.`}lbrandZ(t){const r=d.mod("AT",this.boof124,this.code),e=d.mod("AG",!0,this.code);r.expiry="ET",e.expiry="ET",t.addMod(r),t.addMod(e)}lbrandE(t){return d.ddp2(t,t.playerA,t.lane,{att:this.boof124,agr:!0})}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.isFree=this.level===3,this.playTarg.level=a.target.ddf2(this.level+1),this.text=`Remove all abilities from a ${a.log.levelGateText(this.level+1,!0)}creature.`}sculptZ(t){t.wipeAll()}sculptE(t){return d.actionEval(t,"ST","NT")}natselC(){this.faction="U",this.rarity="R",this.name="Natural Selection",this.text=`If there is a friendly creature in each space, destroy a ${a.log.levelGateText(this.level,!0)}creature.`,this.playTarg.level=a.target.ddf2(this.level)}natselZ(t){a.death.destroy(t,this.code)}natselE(t){return d.ddp7(t,t.playerA,t.lane)}nviveC(){this.faction="N",this.rarity="C",this.name="Necrovive",this.playTarg.canRegen=!0,this.text=`Give a creature Regenerate ${this.boof3612}.`}nviveZ(t){t.addRegen(this.boof3612)}nviveE(t){return d.ddp2(t,t.playerA,t.lane,{rgn:this.boof3612})}pwtorC(){this.faction="A",this.rarity="R",this.name="Power Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature ${a.log.jr9(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}pwtorE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof234)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature ${a.log.jr9(this.level,this.level)}.`}psurgeZ(t){t.buff(this.level,this.level)}psurgeE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.level,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.text=`Give a creature ${a.log.jr9(this.boof71116,0)} this turn.`}pslamZ(t){const r=d.mod("AT",this.boof71116,this.code);r.expiry="ET",t.addMod(r)}pslamE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof71116)}rotgC(){this.faction="N",this.rarity="H",this.name="Rite of the Grimgaunt",this.text=`Give a creature "When a creature is destroyed, this gets ${a.log.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0,t.jr4("DS",this.code),t.hints.push("BD")}rotgE(t){return d.actionEval(t,"ST","BD")}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=a.target.ddf2(this.level),this.text=`Reduce a ${a.log.levelGateText(this.level,!0)}creature's attack to 0.`}sapZ(t){t.buff(-t.attack,0)}sapE(t){const r=a.field.ddf6(t);return d.actionEvalBuffC(t,r,-r.attack)}soathC(){this.faction="U",this.rarity="C",this.name="Savage Oath",this.level===1&&(this.hints=["LV"]);const t=this.saboof;this.text=`Give an Uterra creature ${a.log.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.faction="U"}soathZ(t){const r=this.saboof;t.buff(r,r),t.breakthrough=!0}soathE(t){const r=this.saboof;return d.ddp2(t,t.playerA,t.lane,{att:r,hlt:r,brt:!0})}get saboof(){return this.lValN([2,6,15])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.isFree=this.level===3,this.playTarg.level=a.target.ddf2(this.level+1),this.text=`Give a ${a.log.levelGateText(this.level+1,!0)}friendly creature "Vengeance: Spawn this" this turn.`}shgrZ(t){const r=a.genId(a.state.ddf9()),e=t.jr4("VN",this.code);e.customCode=r,e.changes=!0;const s=t.jr4("PT",this.code);s.customCode=r,t.hints.push("LZ")}shgrE(t){return d.actionEval(t,"ST","LZ")}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.text=`Give a creature ${a.log.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){const r=this.level*a.field.ddf1().length;t.buff(r,r)}sinE(t){const r=this.level*a.field.ddf1().length;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}get snbboof(){return-1*(this.level+7)}snbC(){this.faction="A",this.rarity="C",this.name="Sonic Burst",this.text=`Give a creature ${a.log.jr9(this.snbboof,0)}.`}snbZ(t){t.buff(this.snbboof,0)}snbE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.snbboof)}sharvC(){this.faction="N",this.rarity="H",this.name="Soul Harvest";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(a.death.destroy(t,this.code),this.level===1){const r=a.turn.freeCard(this.code);r.condition.level=a.target.ddf2(1)}else a.state.gs.turn.regularPlays+=this.level-1}sharvE(t){return d.ddp7(t,t.playerA,t.lane,["FRC","SD"])}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Regenerate ${this.boof234}.`,this.playTarg.canRegen=!0}sttorZ(t){t.addRegen(this.boof234)}sttorE(t){return d.ddp2(t,t.playerA,t.lane,{rgn:this.boof234})}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Poison ${this.boof234}.`}sptorZ(t){t.addPoison(this.boof234)}sptorE(t){return d.ddp2(t,t.playerA,t.lane,{psn:this.boof234})}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${a.log.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hasDefender=!0}stbrnZ(t){const r=this.boof579;t.buff(r,r),t.negateDefender=!0}stbrnE(t){const r=this.boof579;return d.ddp2(t,t.playerA,t.lane,{att:r,hlt:r,noD:!0})}tpactC(){this.faction="N",this.rarity="C",this.name="Tarsian Pact";const t=this.boof235;this.text=`Give a Nekrium creature ${a.log.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.faction="N"}tpactZ(t){const r=this.boof235;t.buff(r,r),t.addRegen(r)}tpactE(t){const r=this.boof235;return d.ddp2(t,t.playerA,t.lane,{att:r,hlt:r,rgn:r})}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.text=`Give a Robot ${a.log.jr9(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),t.buff(this.boof4612,0)}tugE(t){return d.ddp2(t,t.playerA,t.lane,{att:this.boof4612,arm:this.boof236})}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${a.log.dbdtac(this.level)}, destroy that creature."`}blightZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("BX")}blightE(t){return d.actionEval(t,"ST","BX")}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}.`}sporeZ(t){t.addPoison(this.tspois)}sporeE(t){return d.ddp2(t,t.playerA,t.lane,{psn:this.tspois})}tremcC(){this.faction="T",this.rarity="C",this.name="Tremorcharge",this.text=`Give a Tempys creature ${a.log.jr9(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T"}tremcZ(t){t.buff(0,this.boof4812),t.addMobility(this.level)}tremcE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,void 0,this.boof4812,"GM")}uboltC(){this.faction="T",this.rarity="R",this.name="Uranti Bolt",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 r=d.mod("DF",!0,this.code);r.expiry="EN",t.addMod(r)}uboltE(t){return d.ddp2(t,t.playerA,t.lane,{dmg:this.ubzap,def:!0})}get ubzap(){return this.lValN([3,10,20])}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 r=this.boof246;a.field.creatByTarget(d.crFriendNotMeTarg(t.id)).forEach(e=>{e.heal(r)})}vgraE(t){const r=this.boof246,e=a.field.ddf6(t),s=d.actionEvalBuffC(t,e,0,this.boof101520),c=a.field.creatByTarget(d.crFriendNotMeTarg(e.id)).map(u=>{const m=d.ddp1(u.owner,u.lane);return m.health=r,m});return s.vectors.push(...c),s}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace";const t=this.boof468,r=t*-1;this.text=`Give a creature ${a.log.jr9(r,r)}. You gain ${t} health.`}vembZ(t){const r=this.boof468,e=-r;t.buff(e,e),a.player.healPlayer(a.state.getActivePlayer(),r)}vembE(t){const r=this.boof468,e=-r,s=d.actionEvalBuffN(t,t.playerA,t.lane,e,e);return s.vectors.push(d.evalVectorPlayerLife(a.state.ddf9(),r)),s}warC(){this.faction="A",this.rarity="H",this.name="Warmonger Mod";let t=this.level,r=3;this.level===1&&(this.playTarg.level="LN",r=2,t=2),this.text=`Give a ${a.log.levelGateText(r,!0)}creature ${t}x attack.`}warZ(t){const r=this.level===3?2:1;t.buff(t.attack*r,0)}warE(t){const r=this.level===3?2:1;return d.actionEvalBuffN(t,t.playerA,t.lane,Ht+r)}xwillC(){this.faction="N",this.rarity="H",this.name="Xrath's Will";const t=this.boof3612;this.text=`Destroy an enemy creature with ${t} or less attack. You may play and additional Zombie this turn.`,this.playTarg.player="E",this.playTarg.maxAttack=t}xwillZ(t){a.death.destroy(t,this.code);const r=a.turn.freeCard(this.code);r.condition.tribe="ZB"}xwillE(t){return d.ddp7(t,t.playerA,t.lane,"FRZ")}}class Ue extends Q{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.isFree=this.level===3,this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}playTargets(){const t=super.playTargets(),r=this.poisTarg();return this.level===1?t.push(r):a.field.creatByTarget(r).length>0&&t.push(a.target.boardTarget("CARD",this.code)),t}handleAction(t){if(this.logSpell(),this.level===1){const r=a.field.ddf6(t);r.addPoison(r.poison)}else a.field.creatByTarget(this.poisTarg()).forEach(e=>{e.addPoison(e.poison)});a.turn.spellCast()}poisTarg(){const t=d.crEnemyActTarg("CARD",this.code);return t.hasPoison=!0,t}ddf7(t){const r=Ht+1,e=d.actionEval(t,"ST"),s=!a.state.ddf9();let c;return t.zone==="R"?c=a.field.laneIdx:c=[t.lane],e.vectors=c.map(u=>d.ddp1(s,u,{psn:r})),e}}class We extends x{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Echowisp",this.jr1=this.lValN([7,8,10]),this.jr2=this.boof135,this.tribe.push("ST"),this.level===3?(this.text="Forge: Put a copy of Echowisp into each available space.",this.hints=["EML"]):(this.text="Forge: You may put a copy of Echowisp into an adjacent space.",this.hints=["EMA"])}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("FR",this.code);return s.interactive=this.level<3,e}jr8(t){const r=d.actionTarget("TF","CARD",this.code,t.trigger.creatId);if(r.player="F",r.field="E",this.level<3){const s=a.field.jr5(t.trigger.creatId);r.lanes=s.adjacent}let e=a.target.toActions(r);if(e.length>0)if(this.level<3)a.action.ddf5([a.action.noneEndTrigger(),...e]);else{const s=Date.now();e.forEach(c=>a.field.birthCreature(this.code,"P",c.playerA,c.lane,s)),a.batch.triggerDone()}else a.batch.triggerDone()}handleAction(t){a.field.birthCreature(this.code,"P",t.playerA,t.lane),a.action.actionDone(!0)}ddf7(t){return d.ddp4(t,t.playerA,t.lane,this.code)}}class Oe extends x{lookup(t){return{["TVG"]:{c:()=>this.tvgC(),m:e=>this.tvgM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}armThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("AR",this.code);return s.area="A",e}enforceEffect(t,r){this.armThreshold<=r.armor?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}tvgC(){this.faction="A",this.rarity="R",this.name="Tower Vanguard",this.jr1=this.lValN([3,6,11]),this.jr2=this.lValN([7,13,21]),this.tribe.push("RB"),this.hints=["LKA"],this.armThreshold=1;const t=this.boof247;this.text=`While ${this.name} has Armor, it gets ${a.log.jr9(t,0)}.`,this.bonus={play:this.ddp9(0,t,t,0)}}tvgM(t){return[d.mod("AT",this.boof247,t.id)]}}class Jt extends x{lookup(t){return{["CIN"]:{c:()=>this.cyinC(),m:e=>this.cyinM(e)},["HWM"]:{c:()=>this.hlwmC(),m:e=>this.hlwmM(e)},["LSP"]:{c:()=>this.lspC(),m:e=>this.lspM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=["ATH"]}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("AT",this.code);return s.area="A",e}enforceEffect(t,r){this.attThreshold<=r.attack?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}cyinC(){this.faction="A",this.rarity="R",this.name="Cypien Infiltrator",this.jr1=this.boof61117,this.jr2=this.jr1-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[d.mod("BT",!0,t.id)]}hlwmC(){this.faction="A",this.rarity="L",this.name="Hinterland Watchman",this.jr1=this.lValN([4,7,15]),this.jr2=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}.`,this.bonus={exist:this.ddp9(0,this.lValN([1,9,17]),0,0)*2}}hlwmM(t){const r=[d.mod("MB",3,t.id)];return this.level>1&&r.push(d.mod("AR",5,t.id)),this.level===3&&(r.push(d.mod("BT",!0,t.id)),r.push(d.mod("AG",!0,t.id)),r.push(d.mod("RG",5,t.id))),r}lspC(){this.faction="A",this.rarity="C",this.name="Lightshield Patrol",this.jr1=this.lValN([4,7,15]),this.jr2=this.boof51020,this.tribe.push("HM"),this.attThreshold=this.jr2,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Armor ${this.boof234}.`}lspM(t){return[d.mod("AR",this.boof234,t.id)]}}class oe extends x{friendNotMe(t){const r=d.crNotMeTarg(t.id);return r.player=a.player.toTarget(t.owner),r}friendNone(t){const r=d.crTarg();return r.player=a.player.toTarget(t.owner),r.lanes=[],r}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("PS",this.code);return s.area="C",e}enforcementActive(t){return t.status==="A"}applyEffect(t,r,e){const s=this.friendNotMe(t),c=a.field.creatByTarget(s),u=a.field.creatByTarget(e);c.forEach(m=>{u.includes(m)?m.addModSafe(r):m.removeModSafe(t.id)})}}class Qt extends oe{lookup(t){return{["HTR"]:{c:()=>this.hrtC(),m:e=>this.hrtM(e),t:e=>this.hrtT(e)},["KKK"]:{c:()=>this.kkkC(),m:e=>this.kkkM(e),t:e=>this.kkkT(e)},["XDV"]:{c:()=>this.xdvC(),m:e=>this.xdvM(e),t:e=>this.xdvT(e)}}[t]}createMod(t,r){return this.lookup(t).m(r)}effTargs(t,r){return this.lookup(t).t(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t,r){const e=this.cardCode(),s=this.createMod(e,r),c=this.enforcementActive(r)?this.effTargs(e,r):this.friendNone(r);this.applyEffect(r,s,c)}hrtC(){this.faction="U",this.rarity="L",this.name="Heart Tree",this.jr1=0,this.jr2=this.lValN([10,15,30]),this.initRegen=this.boof246,this.initDefend=!0,this.tribe.push("PL"),this.hints=["FRS"],this.text=`Each other friendly creature gets Regenerate ${this.initRegen}.`,this.bonus={exist:this.ddp9(0,this.initRegen,0,0)*2}}hrtM(t){return d.mod("RG",this.initRegen,t.id)}hrtT(t){return this.friendNotMe(t)}kkkC(){if(this.faction="T",this.rarity="L",this.name="Korok, Khan of Kadras",this.jr1=this.lValN([4,7,12,18]),this.jr2=this.lValN([7,12,18,26]),this.initAggro=!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.`,this.hints=["FRS"],this.bonus={exist:(this.level-1)*.5}}}kkkM(t){return d.mod("AG",!0,t.id)}kkkT(t){const r=this.friendNotMe(t);return this.level===1?r.lanes=[]:r.level=a.target.ddf2(this.level-1),r}xdvC(){this.faction="N",this.rarity="H",this.name="Xrath, Dreadnight Of Varna",this.jr1=this.boof5914,this.jr2=this.jr1+1,this.initRegen=this.boof248,this.tribe.push("ZB"),this.text=`Each other friendly Zombie gets Regenerate ${this.initRegen}`,this.bonus={exist:this.ddp9(0,this.initRegen,0,0)}}xdvM(t){return d.mod("RG",this.initRegen,t.id)}xdvT(t){const r=this.friendNotMe(t);return r.tribe="ZB",r}}class Ze extends x{lookup(t){return{["AHL"]:{c:()=>this.ahlC(),m:e=>this.ahlM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("PS",this.code);return s.area="C",e}enforceEffect(t,r){const e=d.crNotMeTarg(r.id);e.player=a.player.toTarget(r.owner),a.field.creatByTarget(e).length===0?this.createMods(this.cardCode(),r).forEach(c=>{r.addModSafe(c)}):r.removeModSafe(r.id)}ahlC(){this.faction="A",this.rarity="H",this.name="Alloyin Highlander",this.jr1=this.lValN([5,7,10]),this.jr2=this.boof6914,this.tribe.push("HM"),this.text=`While ${this.name} is your only friendly creature, it gets ${a.log.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}ahlM(t){return[d.mod("AT",this.boof4812,t.id),d.mod("AR",this.boof248,t.id)]}}class he extends x{lookup(t){return{["NXP"]:{c:()=>this.nxpC(),m:e=>this.nxpM(e)},["SKG"]:{c:()=>this.skgC(),m:e=>this.skgM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=["NX"]}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("PS",this.code);return s.area="C",e}enforceEffect(t,r){r.lane===3?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}nxpC(){this.faction="A",this.rarity="C",this.name="Nexus Pilot",this.jr1=this.boof358,this.jr2=this.boof4710,this.tribe.push("HM"),this.text=`While ${this.name} is in the center space, it gets ${a.log.jr9(this.jr1,this.jr2)}.`,this.bonus={play:this.ddp9(0,this.jr1+this.jr2,this.jr1,0)}}nxpM(t){return[d.mod("AT",this.jr1,t.id),d.mod("HL",this.jr2,t.id),d.mod("MH",this.jr2,t.id)]}skgC(){this.faction="A",this.rarity="C",this.name="Skyknight Glider",this.jr1=this.boof5916,this.jr2=this.jr1+1,this.tribe.push("HM"),this.text=`While ${this.name} is in the center space, it gets Mobility 2.`}skgM(t){return[d.mod("MB",2,t.id)]}}class _t extends x{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:e=>this.cctM(e)},["GHB"]:{c:()=>this.ghbC(),m:e=>this.ghbM(e)},["PYG"]:{c:()=>this.pygC(),m:e=>this.pygM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}likesOpposed=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=[this.likesOpposed?"OP":"OL"]}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("PS",this.code);return s.area="A",e}enforceEffect(t,r){!!r.opposed===this.likesOpposed?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}cctC(){this.faction="T",this.rarity="R",this.name="Cloudcleaver Titan",this.jr1=this.boof4812,this.jr2=this.lValN([7,10,16]),this.tribe.push("WN","GT"),this.initMobile=this.level;const t=this.boof246;this.bonus={play:this.ddp9(0,t,t,0)},this.text=`While ${this.name} is unopposed, it gets ${a.log.jr9(t,0)}.`}cctM(t){return[d.mod("AT",this.boof246,t.id)]}ghbC(){this.faction="U",this.rarity="R",this.name="Gemhide Basher",this.jr1=this.lValN([5,10,16]),this.jr2=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[d.mod("AG",!0,t.id)]}pygC(){this.faction="T",this.rarity="H",this.name="Pyre Giant",this.jr1=this.boof468,this.jr2=this.boof234,this.tribe.push("FR","GT"),this.initAggro=!0,this.bonus={play:this.ddp9(0,this.jr1,this.jr1,0)},this.text=`While ${this.name} is unopposed, it gets ${a.log.jr9(this.jr1,0)}.`}pygM(t){return[d.mod("AT",this.jr1,t.id)]}}class Ut extends oe{lookup(t){return{["ALG"]:{c:()=>this.algnC(),m:e=>this.algnM(e)},["ALS"]:{c:()=>this.alstC(),m:e=>this.alstM(e)},["BTN"]:{c:()=>this.btcC(),m:e=>this.btcM(e)},["NXT"]:{c:()=>this.ntcC(),m:e=>this.ntcM(e)}}[t]}createMod(t,r){return this.lookup(t).m(r)}constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=this.nexus?["NX"]:["LJ"]}nexus=!1;enforcementActive(t){return super.enforcementActive(t)?this.nexus?t.lane===3:!0:!1}enforceEffect(t,r){const e=this.cardCode(),s=this.createMod(e,r);let c;this.enforcementActive(r)?(c=this.friendNotMe(r),this.nexus?c.lanes=[1,2,4,5]:c.lanes=r.adjacent):c=this.friendNone(r),this.applyEffect(r,s,c)}algnC(){this.faction="A",this.rarity="R",this.name="Alloyin General",this.jr1=this.boof246,this.jr2=this.boof81318,this.tribe.push("HM"),this.text=`Adjacent creatures gets ${a.log.jr9(this.jr1,0)}.`,this.bonus={exist:this.ddp9(0,this.jr1,this.jr1,0)}}algnM(t){return d.mod("AT",this.jr1,t.id)}alstC(){this.faction="A",this.rarity="H",this.name="Alloyin Strategist",this.jr1=this.boof4814,this.jr2=this.jr1+1,this.initMobile=this.level,this.tribe.push("HM");const t=this.boof246;this.text=`Adjacent creatures gets ${a.log.jr9(t,0)}.`,this.bonus={exist:this.ddp9(0,t,t,0)}}alstM(t){return d.mod("AT",this.boof246,t.id)}btcC(){this.faction="A",this.rarity="H",this.name="Battle Techtician",this.jr1=this.boof3714,this.jr2=this.boof71117,this.tribe.push("HM"),this.nexus=!0;const t=this.boof248;this.text=`While ${this.name} is in the center space, each other friendly creature gets ${a.log.jr9(t,0)}.`,this.bonus={exist:this.ddp9(0,t,t,0)*2}}btcM(t){return d.mod("AT",this.boof248,t.id)}ntcC(){this.faction="A",this.rarity="H",this.name="Nexus Techtician",this.jr2=this.boof6916,this.jr1=this.jr2-3,this.tribe.push("HM"),this.nexus=!0;const t=this.boof235;this.text=`While ${this.name} is in the center space, each other friendly creature gets Armor ${this.boof235}.`,this.bonus={exist:this.ddp9(0,t,0,0)*4}}ntcM(t){return d.mod("AR",this.boof235,t.id)}}class Wt extends x{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC()})[t]()}targAction(t){a.field.birthCreature(this.spawnCode,"P",t.playerA,t.lane)}adjacent=!1;optional=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const r=a.log.forglied(this.allied);this.text=r+": "+this.ftext}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("FR",this.code);return s.interactive=!0,e}jr8(t){if(this.allied==="X"||a.turn.allied(this.allied)){const r=d.actionTarget("TF","CARD",this.code,t.trigger.creatId);if(r.player="F",r.field="E",this.adjacent){const s=a.field.jr5(t.trigger.creatId);r.lanes=s.adjacent}const e=a.target.toActions(r);e.length>0?(this.optional&&e.push(a.action.noneEndTrigger()),a.action.ddf5(e)):a.batch.triggerDone()}else a.batch.triggerDone()}handleAction(t){this.targAction(t),a.action.actionDone(!0)}ddf7(t){return d.ddp4(t,t.playerA,t.lane,this.spawnCode)}bwdC(){this.faction="U",this.rarity="C",this.name="Branchweaver Druid",this.jr1=1,this.jr2=1,this.tribe.push("HM"),this.hints=["EMO"],this.spawnCode=`${"TFD"}${this.level}`,this.optional=!0;const t=this.boof5714;this.ftext=`You may put a ${t}/${t} ${N.minionName(3)} into another space.`}btsC(){this.faction="U",this.rarity="C",this.name="Brighttusk Sower",this.jr1=this.lValN([6,8,10]),this.jr2=this.jr1,this.tribe.push("TK"),this.hints=["EMA"],this.spawnCode=N.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=N.minionBuff(this.level);this.ftext=`You may put a ${t}/${t} ${N.minionName(this.level)} into an adjacent space.`}escarC(){this.faction="A",this.rarity="H",this.name="Esperian Scarab",this.jr1=this.lValN([3,4,7]),this.jr2=this.boof5711,this.initArmor=this.boof135,this.tribe.push("RB"),this.allied="U",this.hints=["EMO","ALU"],this.spawnCode=this.code,this.optional=!0,this.ftext=`You may but a copy of ${this.name} another space.`}ethhC(){this.faction="U",this.rarity="C",this.name="Ether Hounds",this.jr1=this.boof369,this.jr2=this.jr1,this.tribe.push("ST"),this.hints=["EMO"],this.spawnCode=this.code,this.ftext="Put a copy of this into an available space."}}class ze extends x{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Esperian Steelplate",this.jr1=this.boof369,this.jr2=this.boof6916,this.tribe.push("IN"),this.hints=["ALA"],this.text=`Activate: Heal ${this.boof358} damage from each other friendly creature. Allied Alloyin: Armor ${this.boof247}.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}canActivate(t){const r=d.crFriendNotMeTarg(t.id);return a.field.creatByTarget(r).length>0}startActivation(t){const r=this.boof358,e=d.crFriendNotMeTarg(t.id);a.field.creatByTarget(e).forEach(s=>{s.heal(r)}),t.endActivation()}jr8(t){a.turn.allied("A")&&a.field.jr5(t.creatId).addArmor(this.boof247),a.batch.triggerDone()}}class Ke extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Everflame Phoenix",this.jr1=this.lValN([7,0,22]),this.jr2=this.lValN([6,1,15]),this.tribe.push("PX"),this.initMobile=this.lValN([1,0,2]),this.level===2?(this.initDefend=!0,this.text=`When you gain a rank, replace ${this.name} with a level 3 ${this.name}.`,this.hints=["RH","LV"],this.bonus={exist:this.ddp9(1,37,22,0)}):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this space.`,this.bonus={exist:this.ddp9(1,1,0,0)})}jr3(t,r){const e=super.jr3(t,r);return this.level===2?e.jr4("RU",this.code):this.level===3&&e.jr4("VN",this.code),e}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.ownerPlayerA:super.ddf8(t)}jr8(t){if(t.trigger.type==="RU"){const r=a.field.jr5(t.creatId);a.field.birthCreature(`${"EFP"}3`,"R",r.owner,r.lane)}else if(t.trigger.type==="VN"){const e=t.event.creature;a.field.birthCreature(`${"EFP"}2`,"P",e.owner,e.lane)}a.batch.triggerDone()}}class Ye extends Q{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const r=this.boof4711;this.text=`Deal ${r} damage to an enemy creature. Give a friendly creature ${a.log.jr9(r,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(d.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=this.boof4711;s.hurtDirect(c,this.code);const u=d.mod("AT",c,this.code);u.expiry="ET",e.addMod(u),a.turn.spellCast()}}friends(t=""){const r=d.crFriendActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r)}getCardActions(t,r){const e=a.field.ddf6(t),s=this.friends(e.id);return s.push(a.action.cancelAction()),s}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=this.boof359,s=d.actionEvalBuffN(t,t.playerA,t.lane,e),c=a.field.jr5(r[1]);return s.vectors.push(d.ddp1(c.owner,c.lane,{dmg:e})),s}}}class qe extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Glaceus, Tundra Tyrant",this.jr1=this.boof5916,this.jr2=this.jr1+2,this.tribe.push("IC","EL"),this.hints=["TL"];const r=`Gain Rank: each enemy ${a.log.levelGateText(this.level,!0)}creature gets "When this is dealt damage, destroy it."`,e=this.level===3?"At the start of each turn, deal 1 damage to each enemy creature. ":"";this.text=e+r}jr3(t,r){const e=super.jr3(t,r);return e.jr4("RU",this.code),this.level===3&&e.jr4("TS",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;if(r.creatureTarg&&r.target.id===t.creatId)return!0}return t.trigger.type==="RU"||t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="RU"){const r=d.crEnemyTarg();r.level=a.target.ddf2(this.level),a.field.creatByTarget(r).forEach(e=>{e.jr4("DM",this.code),e.hints.push("DD"),e.changed=!0})}else if(t.trigger.type==="TS"){const r=Date.now();a.field.qEnemyCreats().forEach(e=>{e.hurtDirect(1,this.code,r)})}else if(t.trigger.type==="DM"){const r=a.field.jr5(t.creatId);a.death.destroy(r,this.code),a.batch.triggerDone()}a.batch.triggerDone()}}class Xe extends Q{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 ${a.log.levelGateText(this.level+1,!0)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=Date.now();a.death.destroy(s,this.code,c),a.death.destroy(e,this.code,c),a.turn.spellCast()}}enemyTargActions(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return r.level=a.target.ddf2(this.level+1),a.target.toActions(r)}getCardActions(t,r){const e=a.field.ddf6(t),s=this.enemyTargActions(e.id);return s.push(a.action.cancelAction()),s}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=a.field.jr5(r[1]),s=d.ddp8(t,e,"SD"),c=d.ddp1(t.playerA,t.lane);return c.destroy=!0,s.vectors.push(c),s}}}class je extends Q{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const r=this.boof359;this.text=`Give a friendly creature +${r} attack. Give an enemy creature -${r} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=this.boof359;s.buff(c,0),e.buff(-c,0),a.turn.spellCast()}}getCardActions(t,r){const e=a.field.ddf6(t),s=this.enemyTargActions(e.id);return s.push(a.action.cancelAction()),s}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=d.actionEval(t,"ST"),s=a.field.ddf6(t),c=a.field.jr5(r[1]),u=this.boof359;return e.vectors.push(d.ddp1(s.owner,s.lane,{att:-u}),d.ddp1(c.owner,c.lane,{att:u})),e}}enemyTargActions(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r)}}class Je extends x{constructor(t){super(t),this.faction="U",this.rarity="C",this.name="Hunting Pack",this.jr1=this.boof3612,this.jr2=this.boof248,this.tribe.push("WF"),this.hints=["EML"],this.text=`When ${this.name} enters play, you have a 50% chance to put a copy of ${this.name} into an available space.`}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("EF",this.code);return s.interactive=!0,e}handleAction(t){a.field.birthCreature(this.code,"P",t.playerA,t.lane),a.action.actionDone(!0)}ddf8(t){return t.trigger.type==="EF"&&t.event.creature.id===t.creatId}jr8(t){if(a.randInt(0,2)===1){const e=d.actionTarget("TF","CARD",this.code);e.player="F",e.field="E";const s=d.actionTarget("TB","NOTR",this.code),c=a.target.toActions([e,s]);c.length===1?a.batch.triggerDone():a.action.ddf5(c)}else a.batch.triggerDone()}ddf7(t){return d.ddp4(t,t.playerA,t.lane,this.code)}}class Qe extends x{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Leafkin Progenitor",this.jr1=this.boof3711,this.jr2=this.jr1,this.tribe.push("PL"),this.level===3?(this.text=`Activate: Put a level 1 ${this.name} into an adjacent available space.`,this.bonus={exist:this.ddp9(1,6,3,0)}):(this.text=`Activate: Replace this with a level ${this.level+1} ${this.name}.`,this.bonus={exist:this.ddp9(0,12*this.level,6*this.level,0)})}canActivate(t){return this.level===3?a.action.emptyAdjacents(t).length>0:!0}startActivation(t){this.level===3?a.action.ddf5(this.getCardActions(d.ddf4(),t)):(a.field.birthCreature(this.leafCode(this.level+1),"R",t.owner,t.lane),t.endActivation())}handleAction(t){const r=a.field.jr5(t.param);a.field.birthCreature(this.leafCode(1),"P",t.playerA,t.lane),r.endActivation()}getCardActions(t,r){const e=r??a.field.jr5(t.param),s=a.action.emptyAdjacents(e);return s.push(a.action.cancelAction()),s}ddf7(t){if(t.actionKey==="ACTV"){if(this.level===3)return d.ddp5(t);{const r=a.field.jr5(t.param),e=d.ddp4(t,r.owner,r.lane,this.leafCode(this.level+1));return e.hints=["RE"],e}}else{const r=t;return d.ddp4(t,r.playerA,r.lane,this.leafCode(1))}}leafCode(t){return`${"LKP"}${t}`}}class le extends x{cardConstruct(t){({["AFO"]:()=>this.aetorC(),["TSM"]:()=>this.tsmithC()})[t]()}targAction(t,r,e){({["AFO"]:(c,u)=>this.doNossing(c,u),["TSM"]:(c,u)=>this.doNossing(c,u)})[t](r,e)}playTarg;optional=!1;ftext="";forgeLevels=[1,2,3,4];constructor(t){super(t),this.playTarg=d.lvlHandActTarg(this.code),this.cardConstruct(this.cardCode()),this.forgeLevels.includes(this.level)&&(this.text="Forge: "+this.ftext)}jr3(t,r){const e=super.jr3(t,r);if(this.forgeLevels.includes(this.level)){const s=e.jr4("FR",this.code);s.interactive=!0}return e}handleAction(t){a.turn.levelAndDiscard(t);const r=a.field.jr5(t.param);this.targAction(this.cardCode(),t,r),a.action.actionDone(!0)}jr8(t){const r=a.target.toActions(this.playTarg);r.length>0?(r.forEach(e=>{e.param=t.creatId}),this.optional&&r.push(a.action.noneEndTrigger()),a.action.ddf5(r)):a.batch.triggerDone()}doNossing(t,r){}ddf7(t){return d.actionEval(t,"DC")}aetorC(){this.faction="A",this.rarity="C",this.name="Aetherforge Oracle",this.jr1=this.boof61218,this.jr2=this.boof246,this.tribe.push("HM"),this.optional=!0,this.playTarg.card="S",this.ftext="You may discard and level up a spell.",this.bonus={play:.5}}tsmithC(){this.faction="A",this.rarity="C",this.name="Technosmith",this.jr1=this.boof5915,this.jr2=this.jr1-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`You may ${a.log.daluac()}.`,this.bonus={play:.5}}}class _e extends Q{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Lightning Spark",this.text=`Deal ${this.boof6812} damage to a creature or player.`}playTargets(){const t=super.playTargets();return t.push(d.crActTarg("CARD",this.code)),t.push(d.actionTarget("TP","CARD",this.code)),t}handleAction(t){this.logSpell();const r=this.boof6812;t.zone==="P"?a.player.ddf3(t.playerA,r,this.code):a.field.ddf6(t).hurtDirect(r,this.code),a.turn.spellCast()}ddf7(t){const r=this.boof6812,e=d.actionEval(t,"ST");if(t.zone==="P")e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r));else{const s=t;e.vectors.push(d.ddp1(s.playerA,s.lane,{dmg:r}))}return e}}class tr extends Q{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metasight",this.maxLevel=2,this.isFree=this.level===2,this.text="Discard two cards and level them."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(t.position0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.jr5(t.param);a.field.birthCreature(r.code,"P",t.playerA,t.lane),r.endActivation()}getCardActions(t,r){const e=r??a.field.jr5(t.param),s=a.action.emptyAdjacents(e);return s.push(a.action.cancelAction()),s}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=t;return d.ddp4(t,r.playerA,r.lane,this.code)}}}class ir extends x{constructor(t){if(super(t),this.faction="U",this.rarity="L",this.name="Mimicwurm",this.jr1=7,this.jr2=this.jr1,this.tribe.push("WR"),this.level>1){this.hints=[this.level===2?"EMO":"EML"];const r=this.level-1;this.bonus={play:this.ddp9(r,14*r,7*r,0)}}this.text=this.lValS(["","Forge: You may put a level 1 Mimicwurm into another space.","Forge: You may put a level 2 Mimicwurm into another space. Then you may put a level 1 Mimicwurm into another space."])}jr3(t,r){const e=super.jr3(t,r);if(this.level>1){const s=e.jr4("FR",this.code);s.interactive=!0}return e}handleAction(t){a.deTil(t.param)[0]==="P1"?this.level===3?(this.wurmsign(2,t),a.action.ddf5(this.getCardActions(t))):(this.wurmsign(1,t),a.action.actionDone(!0)):(this.wurmsign(1,t),a.action.actionDone(!0))}jr8(t){a.action.ddf5(this.fieldActions("P1",[t.event.creature.lane]))}fieldActions(t,r){const e=d.actionTarget("TF","CARD",this.code,a.enTil(t,r[0]));e.player="F",e.lanes=a.field.laneIdx.filter(c=>!r.includes(c));const s=a.target.toActions(e);return s.push(a.action.noneEndTrigger()),s}wurmsign(t,r){a.field.birthCreature(this.wurmCode(t),"R",r.playerA,r.lane)}wurmCode(t){return`${"MMW"}${t}`}getCardActions(t,r){const e=a.deTil(t.param),s=[t.lane,parseInt(e[1])];return this.fieldActions("P2",s)}ddf7(t){const r=a.deTil(t.param),e=this.level===2||r[0]==="P2"?1:2,s=d.ddp4(t,t.playerA,t.lane,this.wurmCode(e));return s.final=e===1,s.hints=["RE"],s}}class ar extends x{constructor(t){super(t),this.faction="N",this.rarity="T",this.name="Netherdrake",this.jr1=this.boof4815,this.jr2=this.jr1,this.initMobile=this.lValN([0,0,1]),this.tribe.push("DG"),this.hints=["FK"],this.text=`When this enters play or moves into a lane, destroy the opposing ${a.log.levelGateText(this.level,!0)}creature.`}get image(){return this.rawImage(`${"NSH"}${this.level}`)}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FK",this.code),e.jr4("EF",this.code),e}ddf8(t){return t.trigger.type==="EF"&&t.event.creature.id===t.creatId}jr8(t){const e=t.event.creature.opposed;e&&a.target.levelTestCommon(e.level,this.level)&&a.death.destroy(e,this.code),a.batch.triggerDone()}}class sr extends Q{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const r=this.boof246,e=r*-1;this.text=`Give a friendly Zombie ${a.log.jr9(r,r,!0)}, and Regenerate ${r}. Then give an enemy non-Zombie ${a.log.jr9(e,e)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");r.tribe="ZB",t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=this.boof246;s.buff(c,c),s.addRegen(c),e.buff(-c,-c),a.turn.spellCast()}}nonZombies(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r).filter(e=>{const s=e;return!a.field.ddf6(s).isTribe("ZB")})}getCardActions(t,r){if(t.actionKey==="CARD"){const e=a.field.ddf6(t),s=a.action.cancelAction(),c=this.nonZombies(e.id);return c.push(s),c}return super.getCardActions(t,r)}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=a.field.jr5(r[1]),s=this.boof246,c=d.ddp3(t,e,{att:s,hlt:s,rgn:s});return c.vectors.push(d.ddp1(t.playerA,t.lane,{att:-s,hlt:-s})),c}}}class nr extends x{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Onyxium Allomancer",this.jr1=this.boof248,this.jr2=this.boof61016,this.tribe.push("HM"),this.hints=["ALN","OL"];const r=this.boof358;this.text=`Activate: Discard and level up a card. Allied Nekrium: Regenerate ${r}.`,this.bonus={exist:this.ddp9(0,r,0,0,.5)}}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}canActivate(t){return a.state.getPlayer(t.owner).hand.some(e=>a.cards.getCard(e).canLevel())}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.jr5(t.param);a.turn.levelAndDiscard(t),r.endActivation()}jr8(t){a.turn.allied("N")&&a.field.jr5(t.creatId).addRegen(this.boof358),a.batch.triggerDone()}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=d.lvlHandActTarg(this.code,e.id);return a.target.toActions([s,a.target.buttonTarget("CANC")])}return super.getCardActions(t,r)}ddf7(t){return t.actionKey==="ACTV"?d.ddp5(t):d.actionEval(t,"DC")}}class or extends x{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Onyxium Phantasm",this.jr1=this.boof246,this.jr2=this.lValN([9,12,19]),this.initRegen=this.boof124,this.tribe.push("ST"),this.text=`Allied Alloyin: Activate: Give a creature ${a.log.jr9(this.boof4812n,0)}`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}canActivate(t){return t.hasMod(t.id)}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.jr5(t.param);a.field.ddf6(t).buff(this.boof4812n,0),r.endActivation()}jr8(t){if(a.turn.allied("A")){const r=a.field.jr5(t.creatId);r.addMod(d.mod("AL",!0,r.id)),r.changed=!0}a.batch.triggerDone()}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=d.crActTarg("CARD",this.code,e.id),c=a.target.toActions(s);return c.push(a.action.cancelAction()),c}return super.getCardActions(t,r)}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=t;return d.actionEvalBuffN(t,r.playerA,r.lane,this.boof4812n)}}}class te extends x{hitCreature;constructor(t,r){super(t),this.hitCreature=r}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&r.creatureTarg===this.hitCreature&&r.creatureSrc&&r.source.id===t.creatId}return!1}}class hr extends te{constructor(t){super(t,!1),this.faction="U",this.rarity="L",this.name="Oros, Deepwood's Chosen",this.jr1=this.lValN([7,11,16,0]),this.jr2=this.jr1,this.initBT=!0,this.maxLevel=4,this.tribe.push("FB"),this.hints=["OL","LKV"];const r=`When Oros ${a.log.dbdtap()}, you gain that much health.`,e=this.level===4?"Oros gets +attack and +health equal to your health. ":"";this.text=e+r}jr3(t,r){const e=super.jr3(t,r);return this.level===4&&e.addEffect("PH",this.code),e}jr8(t){const r=t.event;a.player.healPlayer(t.ownerPlayerA,r.dmg),a.batch.triggerDone()}enforceEffect(t,r){const e=a.state.getPlayer(r.owner).health;r.status==="A"&&(r.removeModSafe(r.id),r.addModSafe(d.mod("HL",e,r.id)),r.addModSafe(d.mod("MH",e,r.id)),r.addModSafe(d.mod("AT",e,r.id)))}}class lr extends x{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Oxidon Spitter",this.jr1=this.boof7914,this.jr2=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,r){const e=super.jr3(t,r),s=e.jr4("FR",this.code);return s.interactive=!this.l3,e}jr8(t){if(this.l3)a.field.creatByTarget(d.crEnemyTarg()).forEach(r=>{r.negateArmor=!0}),a.batch.triggerDone();else{const r=d.crEnemyActTarg("CARD",this.code),e=a.target.toActions(r);e.length>0?a.action.ddf5(e):a.batch.triggerDone()}}handleAction(t){const r=a.field.ddf6(t);r.negateArmor=!0,a.action.actionDone(!0)}ddf7(t){const r=a.field.ddf6(t);return d.ddp3(t,r,{arm:-r.armor})}}class Nt extends x{lookup(t){return{["AFS"]:{c:()=>this.afsC(),a:e=>this.afsA(e),t:e=>this.afsT(e),e:e=>this.afsE(e)},["DMW"]:{c:()=>this.drixC(),a:e=>this.drixA(e),t:e=>this.drixT(e),e:e=>this.drixE(e)},["FGG"]:{c:()=>this.fggC(),a:e=>this.fggA(e),t:e=>this.fggT(e),e:e=>this.fggE(e)},["GHS"]:{c:()=>this.mvpC(),a:e=>this.mvpA(e),t:e=>this.mvpT(e),e:e=>this.mvpE(e)},["OWW"]:{c:()=>this.owwC(),a:e=>this.owwA(e),t:e=>this.owwT(e),e:e=>this.owwE(e)},["UPM"]:{c:()=>this.upakC(),a:e=>this.upakA(e),t:e=>this.upakT(e),e:e=>this.upakE(e)},["WFM"]:{c:()=>this.wfmC(),a:e=>this.wfmA(e),t:e=>this.wfmT(e),e:e=>this.wfmE(e)}}[t]}runAct(t,r){this.lookup(t).a(r)}testAct(t,r){return this.lookup(t).t(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){this.runAct(this.cardCode(),t),t.endActivation()}ddf7(t){return this.lookup(this.cardCode()).e(t)}evalAfterPlayCards(t){return a.state.gs.turn.regularPlays>0||a.state.gs.turn.freeCards.length>0?d.actionEval(t,"NR"):d.actionEval(t,"ST")}afsC(){this.faction="A",this.rarity="L",this.name="Arcflight Squadron",this.jr1=this.boof4710,this.jr2=this.jr1+2,this.tribe.push("RB"),this.hints=["OL"],this.text=`Activate: You may play an additional ${a.log.levelGateText(this.level,!0)}Robot this turn.`}afsT(t){return!0}afsA(t){const r=a.turn.freeCard(this.code);r.condition.tribe="RB",r.condition.level=a.target.ddf2(this.level)}afsE(t){return d.actionEval(t,"ST")}drixC(){this.faction="A",this.rarity="L",this.name="Drix, the Mindwelder",this.jr1=this.boof3612,this.jr2=this.lValN([6,12,21]),this.tribe.push("MM"),this.text=`Activate, discard your hand: Each friendly Metamind gets ${a.log.jr9(this.level,0)} for each card discarded this way.`}drixT(t){return a.state.getActivePlayer().hand.length>0}drixA(t){const r=a.state.getPlayer(t.owner),e=r.hand.length*this.level;r.discard.push(...r.hand),r.hand=[];const s=d.crFriendTarg();s.tribe="MM",a.field.creatByTarget(s).forEach(c=>{c.buff(e,0)})}drixE(t){return this.evalAfterPlayCards(t)}fggC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Gamma",this.jr1=this.boof4816,this.jr2=this.jr1,this.tribe.push("RB","GD");const t=this.boof255080;this.text=`Activate, destroy five friendly Robot Guardians: Put a ${t}/${t} Forge Guardian Omega into this space.`}fggT(t){return a.field.creatByTarget(this.fggTarg()).length===5}fggA(t){const r=t.lane,e=t.owner,s=Date.now();a.field.creatByTarget(this.fggTarg()).forEach(c=>a.death.destroy(c,this.code,s)),a.field.birthCreature(`${"FGO"}${this.level}`,"P",e,r)}fggTarg(){const t=d.crFriendTarg();return t.tribe="GD",t}fggE(t){const r=a.field.jr5(t.param),e=d.ddp4(t,r.owner,r.lane,`${"FGO"}${this.level}`);return e.hints=["RE"],e.bonus=100,e.type="ST",e}mvpC(){this.faction="U",this.rarity="C",this.name="Gemheart Sprout",this.jr1=this.boof357,this.jr2=this.jr1+this.level,this.initDefend=!0,this.tribe.push("PL"),this.text=`Activate: You gain health equal to ${this.level}x the number of friendly creatures.`}mvpT(t){return!0}mvpA(t){const r=a.field.ddf1().length;a.player.healPlayer(t.owner,r*this.level)}mvpE(t){return this.evalAfterPlayCards(t)}owwC(){this.faction="A",this.rarity="L",this.name="Oreian Warwalker",this.jr1=this.boof359,this.jr2=this.boof61018,this.tribe.push("RB"),this.text=`Activate: ${this.name} gets ${this.owwbuff+1}x attack.`}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}owwE(t){return this.evalAfterPlayCards(t)}upakC(){this.faction="U",this.rarity="L",this.name="Uterra Packmaster",this.jr1=this.boof6914,this.jr2=this.jr1,this.tribe.push("HM");const t=this.boof124;this.text=`Activate: each other friendly Uterra creature gets ${a.log.jr9(t,t)}.`}upakT(t){return a.field.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const r=this.boof124;a.field.creatByTarget(this.upakTarg(t.id)).forEach(e=>{e.buff(r,r)})}upakTarg(t){const r=d.crFriendNotMeTarg(t);return r.faction="U",r}upakE(t){return this.evalAfterPlayCards(t)}wfmC(){this.faction="T",this.rarity="H",this.name="Wildfire Maiden",this.jr1=this.boof4610,this.jr2=this.boof5814,this.tribe.push("FR","AS"),this.text=`Activate, destroy ${this.name}: Deal damage equal to its attack to each enemy creature.`}wfmT(t){return!0}wfmA(t){const r=Date.now();a.field.creatByTarget(d.crEnemyTarg()).forEach(e=>{e.hurtDirect(t.attack,this.code,r)}),a.death.destroy(t,this.code)}wfmE(t){const r=a.field.jr5(t.param),e=d.ddp8(t,r),s=!r.owner;return e.vectors.push(...a.field.laneIdx.map(c=>d.ddp1(s,c,{dmg:r.attack}))),e}}class yt extends x{lookup(t){return{["FSP"]:{c:()=>this.fspC(),t:(e,s)=>this.fspT(e,s),b:(e,s)=>this.fspB(e,s)},["OJC"]:{c:()=>this.ocarC(),t:(e,s)=>this.ocarT(e,s),b:(e,s)=>this.ocarB(e,s)},["RLW"]:{c:()=>this.restwandC(),t:(e,s)=>this.restwandT(e,s),b:(e,s)=>this.restwandB(e,s)},["SDR"]:{c:()=>this.spdryC(),t:(e,s)=>this.spdryT(e,s),b:(e,s)=>this.spdryB(e,s)},["TDW"]:{c:()=>this.tdwC(),t:(e,s)=>this.tdwT(e,s),b:(e,s)=>this.tdwB(e,s)},["UTR"]:{c:()=>this.urexC(),t:(e,s)=>this.urexT(e,s),b:(e,s)=>this.urexB(e,s)}}[t]}testBirth(t,r){return this.lookup(t).t(r,r.event)}actBirth(t,r){this.lookup(t).b(r,r.event)}iTrigger=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return this.iTrigger&&e.jr4("EF",this.code),e}ddf8(t){return t.event.code==="ENT"?this.testBirth(this.cardCode(),t):!1}jr8(t){this.actBirth(this.cardCode(),t),a.batch.triggerDone()}fspC(){if(this.faction="A",this.rarity="L",this.name="Flowsteel Prototype",this.jr1=this.lValN([3,6,8]),this.jr2=this.lValN([8,15,20]),this.tribe.push("SS"),this.hints=["P1"],this.iTrigger=this.level>1,this.iTrigger){const t=a.log.levelGateText(this.level-1);this.text=`When you Forge a ${t} creature, ${this.name} gets +attack equal to that creature's attack.`;const r=this.avgCreatureStats(this.level-1);this.bonus={exist:this.ddp9(0,r[0],r[0],0)*.5}}}fspT(t,r){return!!(r.forged&&r.creature.owner===t.ownerPlayerA&&a.cards.getCard(r.creature.code).levelthis.agamC(),h:(e,s,c,u)=>this.agamH(e,s,c,u)},["BWK"]:{c:()=>this.blwalkC(),h:(e,s,c,u)=>this.blwalkH(e,s,c,u)},["CDT"]:{c:()=>this.cadtC(),h:(e,s,c,u)=>this.cadtH(e,s,c,u)},["GSC"]:{c:()=>this.gcobC(),h:(e,s,c,u)=>this.gcobH(e,s,c,u)},["IHA"]:{c:()=>this.ibhaC(),h:(e,s,c,u)=>this.ibhaH(e,s,c,u)},["SHS"]:{c:()=>this.shimfC(),h:(e,s,c,u)=>this.shimfH(e,s,c,u)}}[t]}cardConstruct(t){this.hints=["OP"],this.lookup(t).c()}creatHit(t,r,e,s,c){this.lookup(t).h(r,e,s,c)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const r=t.event,e=r.source,s=r.target;e?this.creatHit(this.cardCode(),t,r,e,s):a.log.add("ERROR couldnt find creature - "+this.name),a.batch.triggerDone()}agamC(){this.faction="T",this.rarity="L",this.name="Agamemnon",this.jr1=this.boof4814,this.jr2=this.lValN([8,12,18]),this.level>1&&(this.initMobile=1,this.initAggro=this.level===3),this.tribe.push("GT"),this.text=`When ${this.name} ${a.log.dbdtac()} on your turn, this battles again.`}agamH(t,r,e,s){t.ownerPlayerA===a.state.ddf9()&&(e.extraBattles+=1)}blwalkC(){this.faction="N",this.rarity="R",this.name="Blight Walker",this.jr1=this.boof137,this.jr2=this.lValN([5,10,17]),this.tribe.push("ZB"),this.text=`When ${this.name} ${a.log.dbdtac(this.level)}, destroy that creature.`,this.hints.push("BX")}blwalkH(t,r,e,s){s.status==="A"&&a.target.levelTestCommon(s.level,this.level)&&a.death.destroy(s,this.code)}poisonText(t){return`When ${this.name} ${a.log.dbdtac()}, give that creature gets Poison ${t}.`}cadtC(){this.faction="U",this.rarity="R",this.name="Cadaverous Thicket",this.jr1=this.boof135,this.jr2=this.lValN([7,12,22]),this.tribe.push("PL"),this.text=this.poisonText(this.jr1)}cadtH(t,r,e,s){s.addPoison(this.jr1)}gcobC(){this.faction="U",this.rarity="C",this.name="Ghostscale Cobra",this.jr1=this.boof4610,this.jr2=this.boof135,this.tribe.push("SN"),this.text=this.poisonText(this.jr1)}gcobH(t,r,e,s){s.addPoison(this.jr1)}ibhaC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Hammer of Anvillon",this.jr1=this.lValN([4,7,12,15]),this.jr2=this.lValN([7,11,17,25]),this.initArmor=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 ${a.log.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${a.log.dbdtac()}, that creature${t}, and moves to an available enemy space at random.`}ibhaH(t,r,e,s){const c=this.level===4?s.attack*-1:this.boof246n;s.buff(c,0);const u=a.field.emptyLanes(s.owner),m=u.length;m>0&&s.move(u[a.randInt(0,m)])}shimfC(){this.faction="U",this.rarity="R",this.name="Shimmerfang Serpent",this.jr1=this.boof357,this.jr2=this.boof61016,this.tribe.push("SN"),this.text=`When ${this.name} ${a.log.dbdtac()}, that creatures gets that much Poison.`,this.hints.push("ATH")}shimfH(t,r,e,s){s.addPoison(r.dmg)}}class St extends te{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(e,s,c)=>this.ashyH(e,s,c)},["AMY"]:{c:()=>this.ashmC(),h:(e,s,c)=>this.ashyH(e,s,c)},["CFB"]:{c:()=>this.cfbC(),h:(e,s,c)=>this.cfbH(e,s,c)},["EFM"]:{c:()=>this.efmC(),h:(e,s,c)=>this.efmH(e,s,c)},["FBC"]:{c:()=>this.fbcC(),h:(e,s,c)=>this.fbcH(e,s,c)},["RTS"]:{c:()=>this.rzstC(),h:(e,s,c)=>this.rzstH(e,s,c)},["SVH"]:{c:()=>this.strhyC(),h:(e,s,c)=>this.strhyH(e,s,c)},["URB"]:{c:()=>this.uridC(),h:(e,s,c)=>this.uridH(e,s,c)},["VES"]:{c:()=>this.veskC(),h:(e,s,c)=>this.veskH(e,s,c)}}[t]}cardConstruct(t){this.hints=["OP","LKV"],this.lookup(t).c()}creatHit(t,r,e,s){this.lookup(t).h(r,e,s)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}jr8(t){const r=t.event,e=r.source;e&&(this.bothTurns||e.owner===a.state.ddf9())?this.creatHit(this.cardCode(),t,r,e):a.log.add("ERROR couldnt find creature - "+this.name),a.batch.triggerDone()}ashyC(){this.faction="T",this.rarity="C",this.tribe.push("FR","AS");const t=this.boof124;this.text=`When ${this.name} ${a.log.dbdtap()}, it gets ${a.log.jr9(t,t)}.`}ashyH(t,r,e){const s=this.boof124;e.buff(s,s)}ashbC(){this.name="Ashurian Brawler",this.jr1=this.boof7911,this.jr2=this.jr1,this.ashyC()}ashmC(){this.name="Ashurian Mystic",this.jr1=this.boof3610,this.jr2=this.boof5812,this.initAggro=!0,this.ashyC()}cfbC(){this.faction="T",this.rarity="H",this.name="Cinderfist Brawler",this.jr1=this.boof71014,this.jr2=this.boof357,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${a.log.dbdtap()}, deal that much damage to that player again.`}cfbH(t,r,e){a.player.ddf3(!e.owner,r.dmg,e.code)}efmC(){this.faction="T",this.rarity="L",this.name="Everflame Mystic",this.jr1=this.boof5813,this.jr2=this.jr1+1,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${a.log.dbdtap()} on your turn, you may play ${this.lValS(["one","two","three"])} spells this turn.`}efmH(t,r,e){if(a.state.ddf9()===e.owner)for(let s=0;sc.hurtDirect(r.dmg,this.code,s))}rzstC(){this.faction="T",this.rarity="C",this.name="Razortooth Stalker",this.jr1=this.boof4812,this.jr2=this.jr1+1,this.initMobile=1,this.tribe.push("DN");const t=this.boof235;this.text=`When ${this.name} ${a.log.dbdtap()}, it gets ${a.log.jr9(t,t)}.`}rzstH(t,r,e){const s=this.boof235;e.buff(s,s)}strhyC(){this.faction="U",this.rarity="C",this.name="Stranglevine Hydra",this.jr1=this.boof5815,this.jr2=this.jr1+1,this.tribe.push("HY"),this.text=`When ${this.name} ${a.log.dbdtap()}, it gets Regenerate ${this.level}.`}strhyH(t,r,e){e.addRegen(this.level)}uridC(){this.faction="U",this.rarity="L",this.name="Uterradon Ridgeback",this.jr1=this.boof71117,this.jr2=this.boof4713,this.initBT=!0,this.tribe.push("DN"),this.hints.push("FRS"),this.bothTurns=!1;const t=this.boof124;this.text=`When ${this.name} ${a.log.dbdtap()} on your turn, each friendly creature gets ${a.log.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}uridH(t,r,e){const s=this.boof124,c=this.level===3;a.field.ddf1().forEach(u=>{u.buff(s,s),c&&(u.breakthrough=!0)})}veskC(){this.faction="N",this.rarity="L",this.name="Vyric Ebonskull",this.jr1=this.boof3713,this.jr2=this.boof71117,this.tribe.push("VP"),this.text=`When Vyric ${a.log.dbdtap()}, destroy an enemy ${a.log.levelGateText(this.level,!0)} creature at random.${this.level===3?" Then Spawn a copy of that creature.":""}`}veskH(t,r,e){const s=d.crTarg();s.player=a.player.toTarget(r.target),s.level=a.target.ddf2(this.level);const c=a.field.creatByTarget(s);if(c.length>0){const u=Date.now(),m=c[a.randInt(0,c.length)];a.death.destroy(m,this.code,u),this.level===3&&a.field.birthCreature(m.code,"S",e.owner,void 0,u)}}}class bt extends x{lookup(t){return{["DFB"]:{c:()=>this.dfbC(),d:e=>this.dfbD(e)},["GGD"]:{c:()=>this.ggdC(),d:e=>this.ggdD(e)},["GGP"]:{c:()=>this.ggpC(),d:e=>this.ggpD(e)},["NGT"]:{c:()=>this.ngauntC(),d:e=>this.ngauntD(e)},["SRH"]:{c:()=>this.sharvC(),d:e=>this.sharvD(e)},["YNS"]:{c:()=>this.yuruC(),d:e=>this.yuruD(e)}}[t]}creatDied(t,r){this.lookup(t).d(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DS",this.code),e}ddf8(t){return t.trigger.type==="DS"}jr8(t){this.creatDied(this.cardCode(),t),a.batch.triggerDone()}dfbC(){this.faction="N",this.rarity="R",this.name="Dr. Frankenbaum",this.jr1=this.boof6914,this.jr2=this.jr1-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.bonus={exist:this.ddp9(0,0,0,t*2)}}dfbD(t){const r=a.field.jr5(t.creatId),s=t.event.creature;(r.id===s.id||s.owner===r.owner&&s.isTribe("AB")&&bt.itDiedFirst(s.id,r.id))&&a.player.ddf3(!r.owner,this.boof234,this.code)}ggdC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Devourer",this.jr1=this.boof579,this.jr2=this.jr1-2,this.tribe.push("GG"),this.hints=["OL"],this.text=`When a creature is destroyed, ${this.name} gets ${a.log.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)*2}}ggdD(t){a.field.jr5(t.creatId).buff(this.level,this.level)}ggpC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Predator",this.jr1=this.boof5914,this.jr2=this.jr1,this.initMobile=1,this.tribe.push("GG"),this.hints=["OP"];const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,2*t,t,0)}}ggpD(t){const r=a.field.jr5(t.creatId),e=a.field.oppositeLane(r.lane),s=t.event;if(s.creature.owner!==r.owner&&s.creature.lane===e){const c=this.boof246;r.buff(c,c)}}ngauntC(){this.faction="N",this.rarity="R",this.name="Nightgaunt",this.jr1=this.boof4815,this.jr2=this.jr1+1,this.tribe.push("GG"),this.text=`When a creature is destroyed, ${this.name} gets Regenerate 1.`,this.bonus={exist:this.ddp9(0,4,0,0)}}ngauntD(t){a.field.jr5(t.creatId).addRegen(1)}sharvC(){this.faction="N",this.rarity="C",this.name="Sorrow Harvester",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.tribe.push("AB"),this.text="When a friendly Abomination is destroyed on your turn, draw a card.",this.bonus={exist:.25}}sharvD(t){const e=t.event.creature;e.owner===t.ownerPlayerA&&e.isTribe("AB")&&a.state.ddf9()===t.ownerPlayerA&&bt.itDiedFirst(e.id,t.creatId)&&a.player.drawCard(t.ownerPlayerA,1)}yuruC(){this.faction="N",this.rarity="L",this.name="Yuru, the Necrosage",this.jr1=3,this.jr2=this.jr1,this.initDefend=!0,this.tribe.push("HM"),this.hints=["LJ"];const t=this.boof5814;this.text=`When an adjacent non-Spirit creature is destroyed, put a ${t}/${t} Spirit into that space.`,this.bonus={exist:this.ddp9(1,t*2,t,0)}}yuruD(t){const r=a.field.jr5(t.creatId),s=t.event.creature;s.owner===r.owner&&r.adjacent.includes(s.lane)&&!s.isTribe("ST")&&bt.itDiedFirst(s.id,r.id)&&a.field.birthCreature(`${"XYR"}${this.level}`,"P",r.owner,s.lane)}static itDiedFirst(t,r){if(t===r)return!0;let e=!1;const s=a.death.findDeathTime(r);if(a.isUn(s))e=!0;else{const c=a.death.findDeathTime(t);(a.isUn(c)||c<=s)&&(e=!0)}return e}}class M extends x{lookup(t){return{["AGK"]:{c:()=>this.agknitC(),f:e=>this.agknitF(e)},["BSS"]:{c:()=>this.bssC(),f:e=>this.bssF(e)},["BZD"]:{c:()=>this.bzdrC(),f:e=>this.bzdrF(e)},["BFM"]:{c:()=>this.bfmC(),f:e=>this.bfmF(e)},["CTI"]:{c:()=>this.charnC(),f:e=>this.charnF(e)},["CHH"]:{c:()=>this.chihC(),f:e=>this.chihF(e)},["CSW"]:{c:()=>this.chickenC(),f:e=>this.chickenF(e)},["DFR"]:{c:()=>this.dfrC(),f:e=>this.dfrF(e)},["DBA"]:{c:()=>this.dbaC(),f:e=>this.dbaF(e)},["DDD"]:{c:()=>this.dddC(),f:e=>this.dddF(e)},["EWT"]:{c:()=>this.espwrC(),f:e=>this.espwrF(e)},["FWT"]:{c:()=>this.fwtC(),f:e=>this.fwtF(e)},["GSW"]:{c:()=>this.gwurmC(),f:e=>this.gwurmF(e)},["GSS"]:{c:()=>this.gsC(),f:e=>this.gsF(e)},["IMA"]:{c:()=>this.iracoC(),f:e=>this.iracoF(e)},["LGT"]:{c:()=>this.legtitC(),f:e=>this.legtitF(e)},["LBD"]:{c:()=>this.lbdC(),f:e=>this.lbdF(e)},["LMV"]:{c:()=>this.lyrC(),f:e=>this.lyrF(e)},["MOE"]:{c:()=>this.moeC(),f:e=>this.moeF(e)},["MMA"]:{c:()=>this.mmaC(),f:e=>this.mmaF(e)},["NSY"]:{c:()=>this.nysymC(),f:e=>this.nysymF(e)},["OXM"]:{c:()=>this.onxmarC(),f:e=>this.onxmarF(e)},["OFM"]:{c:()=>this.ofmC(),f:e=>this.ofmF(e)},["OPK"]:{c:()=>this.orpC(),f:e=>this.orpF(e)},["PHM"]:{c:()=>this.phmC(),f:e=>this.phmF(e)},["PSM"]:{c:()=>this.palsC(),f:e=>this.palsF(e)},["SMD"]:{c:()=>this.scorchC(),f:e=>this.scorchF(e)},["SDN"]:{c:()=>this.souldrC(),f:e=>this.souldrF(e)},["SBD"]:{c:()=>this.sbdC(),f:e=>this.sbdF(e)},["SYL"]:{c:()=>this.lotusC(),f:e=>this.lotusF(e)},["TGI"]:{c:()=>this.tgiC(),f:e=>this.tgiF(e)},["UGL"]:{c:()=>this.umglidC(),f:e=>this.umglidF(e)},["UWL"]:{c:()=>this.uwarC(),f:e=>this.uwarF(e)},["UWS"]:{c:()=>this.ustokeC(),f:e=>this.ustokeF(e)},["UTM"]:{c:()=>this.umaulC(),f:e=>this.umaulF(e)},["VNS"]:{c:()=>this.vnsC(),f:e=>this.vnsF(e)},["WWP"]:{c:()=>this.wwpC(),f:e=>this.wwpF(e)},["WFB"]:{c:()=>this.wfbC(),f:e=>this.wfbF(e)}}[t]}cardForge(t,r){this.lookup(t).f(r)}ftext="";forges=!0;flanks=!1;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let r="";this.flanks&&(r="Flank"),this.forges&&(r?r="Forge/"+r:r=a.log.forglied(this.allied)),r&&(this.text=r+": "+this.ftext),this.ftext=""}jr3(t,r){const e=super.jr3(t,r);return this.forges&&e.jr4("FR",this.code),this.flanks&&e.jr4("FK",this.code),e}jr8(t){this.cardForge(this.cardCode(),t),a.batch.triggerDone()}agknitC(){this.faction="A",this.rarity="L",this.name="Aegis Knight",this.jr1=this.boof5814,this.jr2=this.jr1,this.tribe.push("HM"),this.initArmor=this.lValN([1,2,5]),this.hints=["P2","OP"],this.bonus={play:this.ddp9(0,this.initArmor*2,0,0)},this.ftext="Each friendly creature deals damage equal to its Armor to the opposing creature"}agknitF(t){const r=d.crFriendTarg();r.hasArmor=!0;const e=Date.now();a.field.creatByTarget(r).forEach(s=>{s.opposed&&s.opposed.hurtDirect(s.armor,s.code,e)})}bssC(){this.faction="A",this.rarity="L",this.name="Brightsteel Sentinal",this.jr1=this.boof4914,this.jr2=this.jr1+1,this.tribe.push("RB"),this.hints=["P2","OP"];const t=this.boof51015;this.bonus={play:this.ddp9(0,t*1.5,0,0)},this.ftext=`Each friendly Robot gets Armor ${t} this turn.`}bssF(t){const r=this.boof51015,e=d.crFriendTarg();e.tribe="RB",e.canArmor=!0,a.field.creatByTarget(e).forEach(c=>{const u=d.mod("AR",r,t.creatId);u.expiry="ET",c.addMod(u)})}bzdrC(){this.faction="N",this.rarity="R",this.name="Byzerak Drake",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.initRegen=this.level,this.allied="T",this.tribe.push("DG"),this.hints=["ALT"],this.ftext=`Mobility ${this.level}.`}bzdrF(t){a.turn.allied(this.allied)&&a.field.jr5(t.creatId).addMobility(this.level)}bfmC(){this.faction="N",this.rarity="H",this.name="Byzerak Frostmaiden",this.jr1=this.boof135,this.jr2=this.boof91420,this.tribe.push("HM"),this.hints=["ALT","OP","FH"],this.flanks=!0;const t=this.boof246;this.ftext=`If ${this.name} is opposed, the opposing creature gets ${a.log.jr9(-1*t,0)} and this gets ${a.log.jr9(t,0)}. Allied Tempys: Mobility ${this.level}.`;const r=this.ddp9(0,t*2,t*2,0);this.bonus={play:r,exist:r/2}}bfmF(t){const e=t.event.creature;t.trigger.type==="FR"&&a.turn.allied("T")&&e.addMobility(this.level);const s=e.opposed;if(s){const c=this.boof246;s.buff(-1*c,0),e.buff(c,0)}}charnC(){this.faction="N",this.rarity="C",this.name="Charnel Titan",this.jr1=this.boof359,this.jr2=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 ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,2*t,t,0)/2}}charnF(t){const r=this.boof357,e=d.crEnemyTarg();e.maxAttack=r,a.field.creatByTarget(e).length>0&&a.field.jr5(t.creatId).buff(r,r)}chihC(){this.faction="U",this.rarity="C",this.name="Chistlehearth Hunter",this.jr1=this.lValN([2,6,11]),this.jr2=this.boof81217,this.tribe.push("HM"),this.hints=["P2","FRF"],this.ftext=`${this.name} gets ${a.log.jr9(1,0)} for each other friendly creature.`,this.bonus={play:this.ddp9(0,2,2,0)}}chihF(t){const r=a.field.ddf1().length;r>1&&a.field.jr5(t.creatId).buff(r-1,0)}chickenC(){this.faction="T",this.rarity="L",this.name="Cindersmoke Wyvern",this.jr1=this.boof3610,this.jr2=this.lValN([7,12,17]),this.tribe.push("DG"),this.initMobile=this.boof124,this.hints=["FH"],this.forges=!1,this.flanks=!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.",this.bonus={exist:this.ddp9(0,this.jr1,this.jr1,0)}}chickenF(t){const r=t.event,e=r.creature.attack,s=r.creature.opposed;s?s.hurtDirect(e,this.code):a.player.ddf3(!t.ownerPlayerA,e,this.code)}dfrC(){this.faction="N",this.rarity="H",this.name="Darkfrost Reaper",this.jr1=this.boof6916,this.jr2=this.boof3713,this.tribe.push("SK"),this.ftext="Destroy each creature with 1 or less attack.",this.bonus={play:this.ddp6()/5}}dfrF(t){const r=d.crTarg();r.maxAttack=1;const e=a.field.creatByTarget(r),s=Date.now();e.forEach(c=>{a.death.destroy(c,this.code,s)})}dbaC(){this.faction="U",this.rarity="H",this.name="Deepbranch Ancient",this.jr1=this.boof4812,this.jr2=this.jr1,this.tribe.push("HY"),this.hints=["FRF"],this.ftext=`If there is a friendly creature in each space, ${this.name} gets ${a.log.jr9(this.jr1,this.jr2)}.`,this.bonus={play:this.ddp9(0,this.jr1*2,this.jr1,0)/4}}dbaF(t){a.field.ddf1().length===5&&a.field.jr5(t.creatId).buff(this.jr1,this.jr2)}dddC(){this.faction="N",this.rarity="L",this.name="Doomwing, Dire Drake",this.jr1=this.boof61018,this.jr2=this.lValN([2,6,10]),this.initMobile=this.level,this.tribe.push("DG"),this.hints=["FK"],this.forges=!1,this.flanks=!0,this.ftext=`Destroy the opposing ${a.log.levelGateText(this.level,!0)}creature.`,this.bonus={exist:this.ddp6()/2}}dddF(t){const e=t.event.creature.opposed;e&&a.target.levelTestCommon(e.level,this.level)&&a.death.destroy(e,this.code)}espwrC(){this.faction="U",this.rarity="R",this.name="Esperian Wartusk",this.jr1=this.boof5916,this.jr2=this.jr1-1,this.initBT=!0,this.allied="A",this.tribe.push("TK"),this.hints=["ALA"];const t=this.boof124;this.ftext=`Armor ${t}.`,this.bonus={play:this.ddp9(0,t,0,0)}}espwrF(t){a.turn.allied(this.allied)&&a.field.jr5(t.creatId).addArmor(this.boof124)}fwtC(){this.faction="U",this.rarity="H",this.name="Frostwild Tracker",this.jr1=this.boof4712,this.jr2=this.boof248,this.tribe.push("TG"),this.forges=this.level>1;const t=this.level-1;this.ftext=`You may play an additional ${a.log.levelGateText(t)} creature this turn.`,this.level>1?this.bonus={play:this.ddp6(t)}:this.hints=["LV"]}fwtF(t){const r=a.turn.freeCard(this.code);r.condition.card="C",r.condition.level=a.target.ddf2(this.level-1)}gwurmC(){this.faction="N",this.rarity="C",this.name="Gloomspire Wurm",this.jr1=this.boof4813,this.jr2=this.jr1,this.tribe.push("WR"),this.hints=["ENN"],this.ftext=`If there are no enemy creatures, ${this.name} gets ${a.log.jr9(4,4)}.`}gwurmF(t){a.field.qEnemyCreats().length===0&&a.field.jr5(t.creatId).buff(4,4)}gsC(){this.faction="U",this.rarity="C",this.name="Glowstride Stag",this.jr1=this.boof5812,this.jr2=this.jr1+this.level,this.tribe.push("ST");const t=this.boof51015;this.ftext=`You gain ${t} health.`,this.bonus={play:this.ddp9(0,0,0,t)}}gsF(t){const r=this.boof51015;a.player.healPlayer(t.ownerPlayerA,r),a.log.add("Glowstride flexed for "+r)}iracoC(){this.faction="A",this.rarity="L",this.name="Ironmind Acolyte",this.jr1=this.boof61015,this.jr2=this.jr1-2,this.tribe.push("GN"),this.hints=["P1"],this.ftext="If you have five or more cards in your hand, you may play an additional card this turn.",this.bonus={play:this.ddp6()/5}}iracoF(t){a.player.toPlayer(t.ownerPlayerA).hand.length>4&&(a.state.gs.turn.regularPlays+=1)}legtitC(){this.faction="N",this.rarity="R",this.name="Legion Titan",this.jr1=this.boof4812,this.jr2=this.jr1,this.tribe.push("ZB"),this.hints=["ENF"],this.ftext=`${this.name} gets ${a.log.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`,this.bonus={play:this.ddp9(0,this.level*2,this.level,0)/2}}legtitF(t){const r=d.crEnemyTarg();r.maxAttack=this.boof357;const e=a.field.creatByTarget(r);if(e.length>0){const s=this.level*e.length;a.field.jr5(t.creatId).buff(s,s)}}lbdC(){this.faction="U",this.rarity="H",this.name="Lifeblood Dryad",this.jr1=this.lValN([4,7,9]),this.jr2=this.jr1,this.tribe.push("DY"),this.hints=["FRF"];const t=this.boof236;this.ftext=`If there is a friendly creature in each space, each other friendly creature gets ${a.log.jr9(t,t)}`,this.bonus={play:this.ddp9(0,t*2,t,0)}}lbdF(t){const r=a.field.creatByTarget(d.crFriendNotMeTarg(t.creatId));if(r.length===4){const e=this.boof236;r.forEach(s=>s.buff(e,e))}}lyrC(){this.faction="N",this.rarity="L",this.name="Lyria, Muse of Varna",this.jr1=this.boof5815,this.jr2=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 spaces.",this.forges?(this.hints=["EML"],this.bonus={play:this.ddp6(1)*(this.level-1)}):this.hints=["LV"]}lyrF(t){if(this.level===2){const r=a.death.gravedigger();r&&a.field.birthCreature(r,"S",t.ownerPlayerA)}else if(this.level===3){const r=a.field.emptyLanes(t.ownerPlayerA),e=r.map(s=>a.death.gravedigger());if(r.length>0&&e[0]){const s=Date.now();r.forEach((c,u)=>{a.field.birthCreature(e[u],"P",t.ownerPlayerA,c,s)})}}}moeC(){this.faction="T",this.rarity="H",this.name="Master of Elements",this.jr1=this.boof5917,this.jr2=this.jr1,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=`You may play an additional ${a.log.levelGateText(this.level-1)} spell this turn.`,this.forges&&(this.bonus={play:this.ddp9(0,0,0,0,(this.level-1)/2)})}moeF(t){const r=a.turn.freeCard(this.code);r.condition.card="S",r.condition.level=a.target.ddf2(this.level-1)}mmaC(){this.faction="A",this.rarity="C",this.name="Metamind Adept",this.jr1=this.boof5915,this.jr2=this.boof4813,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`Draw ${this.level} card${t}.`,this.bonus={play:this.ddp9(0,0,0,0,this.level/4)}}mmaF(t){a.player.drawCard(t.ownerPlayerA,this.level)}nysymC(){this.faction="N",this.rarity="C",this.name="Nyrali Symbiote",this.jr1=this.boof51015,this.jr2=this.jr1,this.tribe.push("OZ"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`,this.bonus={play:this.ddp9(0,t,0,0)}}nysymF(t){const r=t.event;r.creature.opposed&&r.creature.addRegen(this.boof246)}ofmC(){this.faction="A",this.rarity="R",this.name="Oreian Fieldmarshal",this.jr1=this.boof5914,this.jr2=this.jr1-2,this.tribe.push("HM"),this.hints=["FRS"];const t=this.boof135;this.ftext=`Each other friendly creature gets ${a.log.jr9(t,0)}.`,this.bonus={play:this.ddp9(0,t*2,t*2,0)}}ofmF(t){const r=this.boof135;a.field.creatByTarget(d.crFriendNotMeTarg(t.creatId)).forEach(s=>{s.buff(r,0)})}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.jr1=this.boof4816,this.jr2=this.boof248,this.tribe.push("RB"),this.hints=["OP"],this.ftext=`${this.name} gets Armor ${this.jr1} this turn.`,this.bonus={play:this.ddp9(0,this.jr1,0,0)}}orpF(t){const r=a.field.jr5(t.creatId),e=d.mod("AR",this.jr1,t.creatId);e.expiry="ET",r.addMod(e)}onxmarC(){this.faction="A",this.rarity="R",this.name="Onyxium Marauder",this.jr1=this.boof4714,this.jr2=this.lValN([6,9,17]),this.initArmor=this.level,this.allied="N",this.tribe.push("HM"),this.hints=["ALN"],this.ftext=`Regenerate ${this.level}.`,this.bonus={play:this.ddp9(0,this.level,0,0)}}onxmarF(t){a.turn.allied(this.allied)&&a.field.jr5(t.creatId).addRegen(this.level)}phmC(){this.faction="A",this.rarity="R",this.name="Palladium Hindermind",this.jr1=this.boof2612,this.jr2=this.boof61016,this.tribe.push("HM"),this.hints=["ENF"],this.ftext=`Each enemy creature gets ${a.log.jr9(this.boof123n,0)}.`;const t=this.level*2;this.bonus={play:this.ddp9(0,t,t,0)}}phmF(t){const r=this.boof123n;a.field.qEnemyCreats().forEach(e=>{e.buff(r,0)})}palsC(){this.faction="A",this.rarity="L",this.name="Palladium Simulacrum",this.jr1=this.boof4816,this.jr2=this.boof248,this.initMobile=this.level-1,this.tribe.push("SS"),this.hints=["NX"],this.flanks=!0,this.ftext=`If ${this.name} is in the center space, Spawn a copy.`,this.bonus={play:this.ddp9(1,this.jr1+this.jr2,this.jr1,0)}}palsF(t){t.event.creature.lane===3&&a.field.birthCreature(this.code,"S",t.ownerPlayerA)}scorchC(){this.faction="T",this.rarity="L",this.name="Scorchmane Dragon",this.jr1=this.lValN([0,12,24]),this.jr2=this.boof61224,this.tribe.push("DG"),this.initDefend=this.level===1,this.initMobile=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=["LV"]:this.level===2?(this.hints=["OP"],this.bonus={play:this.ddp9(0,5,0,0)}):this.bonus={play:this.ddp9(0,10,0,5)}}scorchF(t){const r=t.event,e=!t.ownerPlayerA;if(this.level===2){const s=r.creature.opposed;s&&s.hurtDirect(5,this.code)}else if(this.level===3){const s=Date.now();a.field.qPlayerCreats(e).forEach(c=>c.hurtDirect(5,this.code,s)),a.player.ddf3(e,5,this.code)}}souldrC(){this.faction="N",this.rarity="L",this.name="Soul Drinker",this.jr1=1,this.jr2=this.boof4814,this.initMobile=this.level===3?1:0,this.tribe.push("VP"),this.hints=["OP"],this.flanks=this.level===3,this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`;const t=this.avgCreatureStats()[0]*2;this.bonus={play:this.ddp9(0,t,t,0)}}souldrF(t){const r=t.event,e=r.creature.opposed;if(e){const s=e.attack;r.creature.buff(s,0),e.buff(-1*s,0)}}sbdC(){this.faction="U",this.rarity="C",this.name="Spiritbloom Dryad",this.jr1=this.boof6812,this.jr2=this.jr1+this.level,this.tribe.push("DY"),this.ftext=`Each player gains ${this.boof468} health.`}sbdF(t){const r=this.boof468;a.player.healPlayer(!0,r),a.player.healPlayer(!1,r)}lotusC(){this.faction="U",this.rarity="H",this.name="Stygian Lotus",this.jr1=this.boof468,this.jr2=this.jr1-1,this.tribe.push("PL"),this.hints=["ENF","EML","OP"],this.ftext=`If ${this.name} is opposed, spawn a copy of it. Then repeat this for each copy.`,this.bonus={play:this.ddp9(1,this.jr1+this.jr2,this.jr1,0)}}lotusF(t){if(t.event.creature.opposed){let e=!0;for(;e;){const s=a.field.emptyLanes(t.ownerPlayerA),c=s.length;if(c===0)e=!1;else{const u=s[a.randInt(0,c)];a.field.birthCreature(this.code,"P",t.ownerPlayerA,u).opposed||(e=!1)}}}}tgiC(){this.faction="T",this.rarity="R",this.name="Thundergale Invoker",this.jr1=this.boof3711,this.jr2=this.jr1,this.tribe.push("WN","GT"),this.hints=["LJ"],this.ftext=`Each creature adjacent to ${this.name} moves one space away if possible.`}tgiF(t){const r=a.field.jr5(t.creatId),e=r.lane,s=r.owner;if(e>2){const c=a.field.searchByLane(e-1,s);c&&(a.field.searchByLane(e-2,s)||c.move(e-2))}if(e<4){const c=a.field.searchByLane(e+1,s);c&&(a.field.searchByLane(e+2,s)||c.move(e+2))}}umglidC(){this.faction="T",this.rarity="R",this.name="Umbruk Glider",this.jr1=this.boof71117,this.jr2=this.jr1-4,this.initMobile=this.level,this.allied="U",this.tribe.push("DN"),this.hints=["ALU"],this.ftext="Breakthrough."}umglidF(t){if(a.turn.allied(this.allied)){const r=a.field.jr5(t.creatId);r.breakthrough=!0}}uwarC(){this.faction="T",this.rarity="H",this.name="Uranti Warlord",this.jr1=this.boof3713,this.jr2=this.boof71117,this.tribe.push("FR","YT"),this.hints=["OP"],this.ftext=`Each friendly Yeti deals ${this.jr1} damage to the opposing creature.`,this.bonus={play:this.ddp9(0,this.jr1,0,0)}}uwarF(t){const r=d.crFriendTarg();r.tribe="YT";const e=a.field.creatByTarget(r),s=Date.now();e.forEach(c=>{const u=c.opposed;u&&u.hurtDirect(this.jr1,c.code,s)})}ustokeC(){this.faction="T",this.rarity="R",this.name="Uranti Warstoker",this.jr1=this.boof6812,this.jr2=this.jr1-1,this.tribe.push("YT"),this.ftext=`Each other friendly Yeti get ${a.log.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const r=d.crFriendNotMeTarg(t.creatId);r.tribe="YT";const e=a.field.creatByTarget(r),s=this.stokeboof;e.forEach(c=>{const u=d.mod("AT",s,t.creatId);u.expiry="ET",c.addMod(u)})}get stokeboof(){return this.lValN([3,4,6])}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.jr1=this.boof4712,this.jr2=this.jr1,this.tribe.push("DN"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*2,t,0)}}umaulF(t){const r=t.event;if(r.creature.opposed){const e=this.boof246;r.creature.buff(e,e)}}vnsC(){this.faction="U",this.rarity="H",this.name="Venomous Netherscale",this.jr1=this.boof4713,this.jr2=this.jr1+4,this.tribe.push("NG"),this.ftext=`Double the Poison on each enemy creature${this.level===3?" and the enemy player":""}.`}vnsF(t){const r=d.crEnemyTarg();r.hasPoison=!0,a.field.creatByTarget(r).forEach(s=>{s.addPoison(s.poison)})}wwpC(){this.faction="U",this.rarity="H",this.name="Weirwood Patriarch",this.jr1=this.boof5714,this.jr2=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 ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t,t,0)}}wwpF(t){const r=this.boof235,e=d.crFriendNotMeTarg(t.creatId);e.maxAttack=this.boof357,a.field.creatByTarget(e).forEach(s=>s.buff(r,r))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.jr1=this.boof3612,this.jr2=this.jr1,this.tribe.push("ST"),this.hints=["OP"],this.flanks=!0;const t=this.boof247n;this.ftext=`The opposing creature gets ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*2,t,0)}}wfbF(t){const e=t.event.creature.opposed;if(e){const s=this.boof247n;e.buff(s,s)}}}class ce extends x{lookup(t){return{["RBG"]:{c:()=>this.rbgC(),g:(e,s)=>this.rbgG(e,s)},["SRV"]:{c:()=>this.sprvC(),g:(e,s)=>this.sprvG(e,s)}}[t]}onGain(t,r){this.lookup(t).g(r,r.event)}hPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return e.jr4("LG",this.code),e}ddf8(t){return t.trigger.type==="LG"&&this.validPlayer(t)}jr8(t){this.onGain(this.cardCode(),t),a.batch.triggerDone()}validPlayer(t){if(this.hPlayer===0)return!0;const r=t.event;return this.hPlayer===1?t.ownerPlayerA===r.playerA:t.ownerPlayerA!==r.playerA}rbgC(){this.faction="U",this.rarity="H",this.name="Runebark Guardian",this.jr1=this.boof5916,this.jr2=this.jr1,this.tribe.push("HM"),this.hPlayer=1;const t=this.boof135;this.text=`When you gain health, ${this.name} gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}rbgG(t,r){const e=a.field.jr5(t.creatId),s=this.boof135;e.buff(s,s)}sprvC(){this.faction="N",this.rarity="R",this.name="Spirit Reaver",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.tribe.push("DM"),this.hPlayer=-1;const t=this.boof234;this.text=`When an enemy player gains health, ${this.name} gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}sprvG(t,r){const e=a.field.jr5(t.creatId),s=this.boof234;e.buff(s,s)}}class de extends x{lookup(t){return{["EWE"]:{c:()=>this.eweC(),m:(e,s)=>this.eweM(e,s)},["WBH"]:{c:()=>this.rbgC(),m:(e,s)=>this.rbgM(e,s)}}[t]}onMove(t,r){this.lookup(t).m(r,r.event)}mPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return e.jr4("MV",this.code),e}ddf8(t){return t.trigger.type==="MV"&&this.validPlayer(t)}jr8(t){this.onMove(this.cardCode(),t),a.batch.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const r=t.event;return this.mPlayer===1?t.ownerPlayerA===r.creature.owner:t.ownerPlayerA!==r.creature.owner}eweC(){this.faction="T",this.rarity="H",this.name="Emberwind Evoker",this.jr1=this.boof4914,this.jr2=this.jr1+2,this.tribe.push("HM"),this.mPlayer=1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)}}eweM(t,r){const e=this.boof124;r.creature.buff(e,e)}rbgC(){this.faction="T",this.rarity="R",this.name="Windborn Hellion",this.jr1=this.boof4812,this.jr2=this.boof81217,this.tribe.push("WN","EL"),this.mPlayer=1,this.text=`When a friendly creature moves, ${this.name} gets ${a.log.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)}}rbgM(t,r){a.field.jr5(t.creatId).buff(this.level,this.level)}}class Pt extends x{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.agrdP(e,s)},["ART"]:{c:()=>this.arootC(),t:(e,s)=>this.factionSpellMyTurn(e,s,"U"),p:(e,s)=>this.arootP(e,s)},["BLH"]:{c:()=>this.bblhC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.bblhP(e,s)},["CYC"]:{c:()=>this.ccC(),t:(e,s)=>this.factionSpellMyTurn(e,s,"N"),p:(e,s)=>this.ccP(e,s)},["DHW"]:{c:()=>this.dhwC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.dhwP(e,s)},["FBI"]:{c:()=>this.fbiC(),t:(e,s)=>this.factionSpellMyTurn(e,s,"T"),p:(e,s)=>this.fbiP(e,s)},["FLS"]:{c:()=>this.flspkC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.flspkP(e,s)},["KAW"]:{c:()=>this.kasC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.kasP(e,s)}}[t]}testPlay(t,r){return this.lookup(t).t(r,r.event)}actPlay(t,r){this.lookup(t).p(r,r.event)}triggerLevels=[1,2,3,4];constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return this.triggerLevels.includes(this.level)&&e.jr4("PC",this.code),e}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 r=a.field.jr5(t.creatId);a.death.destroy(r,this.code)}a.batch.triggerDone()}spellMyTurn(t,r){return r.playerA===t.ownerPlayerA&&a.cards.getCard(r.cardCode).type==="S"}factionSpellMyTurn(t,r,e){if(r.playerA===t.ownerPlayerA){const s=a.cards.getCard(r.cardCode);if(s.type==="S"&&s.faction===e)return!0}return!1}agrdC(){this.faction="A",this.rarity="C",this.name="Aetherguard",this.jr1=this.boof6814,this.jr2=this.jr1-1,this.tribe.push("RB"),this.bonus={exist:this.ddp9(0,this.level,0,0)},this.text=`When you play a spell, ${this.name} gets Armor ${this.level}.`}agrdP(t,r){a.field.jr5(t.trigger.creatId).addArmor(this.level)}arootC(){this.faction="U",this.rarity="H",this.name="Aether Root",this.jr1=this.boof3610,this.jr2=this.jr1,this.tribe.push("PL");const t=this.boof234;this.text=`When you play an Uterra spell, ${this.name} gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}arootP(t,r){const e=a.field.jr5(t.trigger.creatId),s=this.boof234;e.buff(s,s)}bblhC(){this.faction="T",this.rarity="L",this.name="Binben, Lightning Herald",this.jr1=this.boof61017,this.jr2=this.boof468,this.tribe.push("LT","AS");const t=this.boof4711,r=this.boof258;this.text=`When you play a spell, Spawn a ${t}/${r} Lightning Elemental. At the end of your turn, destroy it.`,this.bonus={exist:this.ddp9(1,t+r,t,0)*.5}}bblhP(t,r){const e=a.field.birthCreature(`${"LWY"}${this.level}`,"S",t.ownerPlayerA);e&&e.jr4("TE",this.code)}ccC(){this.faction="N",this.rarity="H",this.name="Crypt Conjurer",this.jr1=this.boof258,this.jr2=this.lValN([8,14,20]),this.tribe.push("VP"),this.text=`When you play a Nekrium spell, deal ${this.jr1} damage to the enemy player and you gain ${this.jr1} health.`,this.bonus={exist:this.ddp9(0,0,0,this.jr1)}}ccP(t,r){a.player.ddf3(!t.ownerPlayerA,this.jr1,t.cardCode),a.player.healPlayer(t.ownerPlayerA,this.jr1)}dhwC(){this.faction="N",this.rarity="R",this.name="Darkheart Wanderer",this.jr1=this.boof3612,this.jr2=this.boof81116,this.tribe.push("HM");const t=this.boof124;this.text=`When you play a spell, ${this.name} gets Regenerate ${t}.`,this.bonus={exist:this.ddp9(0,t,0,0)}}dhwP(t,r){a.field.jr5(t.trigger.creatId).addRegen(this.boof124)}fbiC(){this.faction="T",this.rarity="H",this.name="Flamebreak Invoker",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.tribe.push("FR","GT"),this.text=`When you play a Tempys spell, deal ${this.level} damage to each enemy creature.`,this.bonus={exist:this.ddp9(0,this.level*2,0,0)*.5}}fbiP(t,r){const e=Date.now();a.field.qEnemyCreats().forEach(s=>{s.hurtDirect(this.level,this.code,e)})}flspkC(){this.faction="T",this.rarity="C",this.name="Flame Speaker",this.jr1=this.lValN([2,6,13]),this.jr2=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.bonus={exist:this.ddp9(0,0,0,t)*.5}}flspkP(t,r){a.player.ddf3(!t.ownerPlayerA,this.boof235,t.cardCode)}kasC(){this.faction="T",this.rarity="L",this.name="Kas, Arcweaver",this.jr1=this.boof4814,this.jr2=this.jr1,this.tribe.push("LT","AS"),this.hints=["OL","LKV"],this.text="When you play a spell, Kas battles an additional time this turn.",this.bonus={exist:this.ddp9(0,this.jr1,this.jr1,0)*.5}}kasP(t,r){const e=a.field.jr5(t.trigger.creatId);e.extraBattles+=1}}class rt extends x{lookup(t){return{["CSB"]:{c:()=>this.corpsC(),v:e=>this.corpsV(e)},["DSK"]:{c:()=>this.dskC(),v:e=>this.dskV(e)},["FWK"]:{c:()=>this.fwlkC(),v:e=>this.fwlkV(e)},["FFD"]:{c:()=>this.ffC(),v:e=>this.ffV(e)},["GVS"]:{c:()=>this.ghsC(),v:e=>this.ghsV(e)},["GBG"]:{c:()=>this.ggC(),v:e=>this.ggV(e)},["GMR"]:{c:()=>this.gromC(),v:e=>this.gromV(e)},["MMX"]:{c:()=>this.mmeC(),v:e=>this.mmeV(e)},["NOZ"]:{c:()=>this.nyozC(),v:e=>this.nyozV(e)},["RSZ"]:{c:()=>this.rszC(),v:e=>this.rszV(e)},["SFM"]:{c:()=>this.spirmC(),v:e=>this.spirmV(e)},["VGN"]:{c:()=>this.vgfsC(),v:e=>this.vgfsV(e)},["XHS"]:{c:()=>this.xhostC(),v:e=>this.xhostV(e)},["ZTU"]:{c:()=>this.zimusC(),v:e=>this.zimusV(e)}}[t]}cardVengeance(t,r){this.lookup(t).v(r)}vtext="";venges=!0;fixedImgCreat=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.venges&&(this.text="Vengeance: "+this.vtext),this.vtext=""}get image(){return this.fixedImgCreat?this.fixedImage():super.image}jr3(t,r){const e=super.jr3(t,r);return this.venges&&e.jr4("VN",this.code),e}jr8(t){this.cardVengeance(this.cardCode(),t),a.batch.triggerDone()}corpsC(){this.faction="N",this.rarity="C",this.name="Corpulent Shambler",this.jr1=this.lValN([5,7,15]),this.jr2=this.jr1,this.tribe.push("ZB"),this.vtext="Put a 3/3 Zombie into this space.",this.bonus={play:this.ddp9(1,6,3,0)}}corpsV(t){const r=t.event,e=`${"ZBS"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}dskC(){this.faction="N",this.rarity="C",this.name="Death Seeker",this.jr1=1,this.jr2=1,this.tribe.push("HM"),this.fixedImgCreat=!0,this.hints=["ST"];const t=this.boof51015;this.vtext=`Put a ${t}/${t} Spirit into this space.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}dskV(t){const r=t.event,e=`${"SPN"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}fwlkC(){this.faction="N",this.rarity="C",this.name="Fell Walker",this.jr1=this.boof359,this.jr2=this.jr1,this.tribe.push("ZB"),this.vtext=`Put a ${this.jr1}/${this.jr1} Zombie into this space.`,this.bonus={play:this.ddp9(1,this.jr1*2,this.jr1,0)}}fwlkV(t){const r=t.event,e=`${"ZMB"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}ffC(){if(this.faction="N",this.rarity="H",this.name="Fleshfiend",this.jr1=this.boof6812,this.jr2=this.jr1,this.tribe.push("AB"),this.venges=this.level>1,this.vtext=`Put a level ${this.level-1} ${this.name} into this space.`,this.venges){const t=this.lValN([0,6,15]);this.bonus={play:this.ddp9(1,t*2,t,0)}}}ffV(t){const r=t.event,e=`${"FFD"}${this.level-1}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}ghsC(){this.faction="U",this.rarity="C",this.name="Glowhive Siren",this.jr1=this.boof3814,this.jr2=this.boof61117,this.tribe.push("IN"),this.vtext=`You gain ${this.boof124} to ${this.gghigh-1} health.`,this.bonus={play:this.ddp9(0,0,0,this.boof258)}}ghsV(t){const r=a.randInt(this.boof124,this.gghigh);a.player.healPlayer(t.ownerPlayerA,r)}get gghigh(){return this.lValN([5,9,13])}ggC(){this.faction="N",this.rarity="C",this.name="Graveborn Glutton",this.jr1=this.boof61117,this.jr2=this.boof3814,this.tribe.push("AB"),this.vtext=`Deal ${this.boof124} to ${this.gghigh-1} damage to the enemy player.`,this.bonus={play:this.ddp9(0,0,0,this.boof258)}}ggV(t){const r=a.randInt(this.boof124,this.gghigh);a.player.ddf3(!t.ownerPlayerA,r,this.code)}gromC(){this.faction="U",this.rarity="C",this.name="Grove Matriarch",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.tribe.push("PL");const t=N.minionBuff(this.level),r=N.minionName(this.level);this.vtext=`Put a ${t}/${t} ${r} into this space.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}gromV(t){const r=t.event,e=N.minionCode(this.level);a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}mmeC(){this.faction="A",this.rarity="C",this.name="Metamind Explorer",this.jr1=this.boof3713,this.jr2=this.jr1+2,this.tribe.push("MM"),this.vtext=`Draw ${this.level} cards.`,this.bonus={play:this.ddp9(0,0,0,0,this.level/4)}}mmeV(t){a.player.drawCard(t.ownerPlayerA,this.level)}nyozC(){this.faction="N",this.rarity="R",this.name="Nyrali Ooze",this.jr1=this.boof247,this.jr2=this.jr1,this.tribe.push("OZ");const t=this.level+this.jr1+1;this.vtext=`Put a ${t}/${t} Oozeling into this space.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}nyozV(t){const r=t.event,e=`${"OOZ"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}rszC(){this.faction="N",this.rarity="R",this.name="Runescarred Zombie",this.jr1=this.lValN([5,8,16]),this.jr2=this.boof359,this.tribe.push("ZB"),this.vtext=`Put a ${a.log.levelGateText(this.level,!0)}spell at random from your discard pile into your hand.`,this.bonus={play:this.ddp9(0,0,0,0,.25)}}rszV(t){const r=a.player.toPlayer(t.ownerPlayerA),e=d.target("TD");e.player=a.player.toTarget(r),e.card="S",e.level=a.target.ddf2(this.level);const s=a.target.deckByTarget(e);if(s.length>0){const c=s[a.randInt(0,s.length)];r.discard.splice(c[1],1),r.hand.push(c[0])}}spirmC(){this.faction="T",this.rarity="H",this.name="Spiritflame Mystic",this.jr1=this.boof6912,this.jr2=this.jr1-3,this.tribe.push("HM"),this.hints=["ENF","EML","OP"],this.vtext=`Deal ${this.boof246} damage to each creature.`}spirmV(t){const r=this.boof246,e=Date.now();a.field.qActiveCreats().forEach(s=>s.hurtDirect(r,this.code,e))}vgfsC(){this.faction="N",this.rarity="C",this.name="Vengeful Spirit",this.jr1=this.boof357,this.jr2=this.jr1-2,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof369n;this.vtext=`Give the opposing creature ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*-2,-t,0)}}vgfsV(t){const e=t.event.creature.opposed;if(e){const s=this.boof369n;e.buff(s,s)}}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.jr1=this.boof359,this.jr2=this.boof135,this.tribe.push("AB"),this.vtext=`Deal ${this.jr1} damage to the enemy player and you gain ${this.jr1} health.`,this.bonus={play:this.ddp9(0,0,0,this.jr1*2)}}xhostV(t){const r=this.jr1;a.player.ddf3(!t.ownerPlayerA,r,this.code),a.player.healPlayer(t.ownerPlayerA,r)}zimusC(){this.faction="N",this.rarity="L",this.name="Zimus, the Undying",this.jr1=this.boof51014,this.jr2=this.lValN([2,5,7]),this.tribe.push(this.level===1?"HM":"ZB"),this.venges=this.level>1,this.vtext=`Spawn a Zimus, the ${this.level===2?"Returned":"Undying"}.`,this.level<3?(this.hints=["LV"],this.level===2&&(this.bonus={play:this.ddp9(1,15,10,0)})):(this.hints=["ST"],this.bonus={play:this.ddp9(0,0,0,0,8)})}zimusV(t){let r;this.level===2?r=`${"ZTR"}2`:r=`${"ZTU"}3`,a.field.birthCreature(r,"S",t.ownerPlayerA)}}class Gt extends Q{lookup(t){return{["DIS"]:{c:()=>this.disnC(),p:e=>this.disnZ(e),e:e=>this.disnE(e)},["DCH"]:{c:()=>this.dchantC(),p:e=>this.dchantZ(e),e:e=>this.dchantE(e)},["ESU"]:{c:()=>this.esrgC(),p:e=>this.esrgZ(e),e:e=>this.esrgE(e)},["ITO"]:{c:()=>this.itorC(),p:e=>this.itorZ(e),e:e=>this.itorE(e)},["MSP"]:{c:()=>this.mendC(),p:e=>this.mendZ(e),e:e=>this.mendE(e)},["NEM"]:{c:()=>this.netherC(),p:e=>this.netherZ(e),e:e=>this.netherE(e)}}[t]}cardCast(t,r){this.lookup(t).p(r)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(d.playerActTarg(this.playTarg,"CARD",this.code)),t}handleAction(t){this.logSpell();const r=a.state.getPlayer(t.playerA);this.cardCast(this.cardCode(),r),a.turn.spellCast()}ddf7(t){return this.lookup(this.cardCode()).e(t)}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){a.player.ddf3(t,a.randInt(1,this.dshigh),this.code)}get dshigh(){return this.lValN([9,16,26])}disnE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerDmg(t.playerA,this.dshigh/2)],r}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){a.player.healPlayer(t,this.boof81220)}dchantE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerLife(t.playerA,this.boof81220)],r}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=["LV"]),this.playTarg="F",this.text=`Draw ${this.level} card.`}esrgZ(t){a.player.drawCard(t,this.level)}esrgE(t){return d.actionEval(t,"ST")}itorC(){this.faction="T",this.rarity="R",this.name="Ice Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg="E",this.text=`Deal ${this.boof234} damage to the enemy player.`}itorZ(t){a.player.ddf3(t,this.boof234,this.code)}itorE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerDmg(t.playerA,this.boof234)],r}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){a.player.healPlayer(t,a.randInt(1,this.mendboof+1))}get mendboof(){return this.lValN([10,20,40])}mendE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerLife(t.playerA,this.mendboof/2)],r}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 r=this.boof4712;a.player.ddf3(t,r,this.code),a.player.healPlayer(!t.isPlayerA,r)}netherE(t){const r=this.boof4712,e=d.actionEval(t,"ST");return e.vectors=[d.evalVectorPlayerLife(!t.playerA,r),d.evalVectorPlayerDmg(t.playerA,r)],e}}class cr extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Rageborn Hellion",this.jr1=this.boof469,this.jr2=this.jr1*2,this.tribe.push("FR","EL"),this.hints=["OL","LKV"],this.text=`When a friendly creature ${a.log.dbdtap()}, ${this.name} gets ${a.log.jr9(this.level,this.level)}.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.owner===t.ownerPlayerA}return!1}jr8(t){a.field.jr5(t.creatId).buff(this.level,this.level),a.batch.triggerDone()}}class vt extends x{lookup(t){return{["AIV"]:{c:()=>this.avinvC(),r:e=>this.avinvR(e)},["BSP"]:{c:()=>this.bskphC(),r:e=>this.bskphR(e)},["CRC"]:{c:()=>this.crucC(),r:e=>this.crucR(e)},["ESK"]:{c:()=>this.ebknC(),r:e=>this.ebknR(e)},["MMV"]:{c:()=>this.mmovC(),r:e=>this.mmovR(e)},["RGG"]:{c:()=>this.runegC(),r:e=>this.runegR(e)},["SSR"]:{c:()=>this.solrevC(),r:e=>this.solrevR(e)},["SSM"]:{c:()=>this.spshamC(),r:e=>this.spshamR(e)},["SSG"]:{c:()=>this.snoutC(),r:e=>this.snoutR(e)},["UGM"]:{c:()=>this.mantisC(),r:e=>this.mantisR(e)}}[t]}rtext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Gain Rank: "+this.rtext}jr3(t,r){const e=super.jr3(t,r);return e.jr4("RU",this.code),e}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.ownerPlayerA:!1}jr8(t){this.lookup(this.cardCode()).r(t),a.batch.triggerDone()}avinvC(){this.faction="T",this.rarity="H",this.name="Avalanche Invoker",this.jr1=this.boof6914,this.jr2=this.jr1+1,this.tribe.push("ER","AS"),this.hints=["TL"],this.rtext=`Deal ${this.boof3612} damage to each non-Tempys creature.`}avinvR(t){const r=this.boof3612,e=Date.now();a.field.qActiveCreats().filter(s=>s.faction!=="T").forEach(s=>s.hurtDirect(r,this.code,e))}bskphC(){this.faction="N",this.rarity="C",this.name="Blightskull Phantasm",this.jr1=this.boof5814,this.jr2=this.boof61017,this.tribe.push("ST"),this.hints=["TL","OP"];const t=this.boof369n;this.rtext=`the opposing creature gets ${a.log.jr9(t,t)}.`}bskphR(t){const e=a.field.jr5(t.creatId).opposed;if(e){const s=this.boof369n;e.buff(s,s)}}crucC(){this.faction="A",this.rarity="R",this.name="Crucible Colossus",this.jr1=this.boof61016,this.jr2=this.jr1+2,this.tribe.push("RB"),this.initDefend=!0,this.hints=["TL"],this.rtext=`Negate Defender from ${this.name}.`}crucR(t){const r=a.field.jr5(t.creatId);r.negateDefender=!0}ebknC(){this.faction="N",this.rarity="H",this.name="Ebonskull Knight",this.jr1=this.lValN([9,13,18]),this.jr2=this.jr1-2,this.tribe.push("VP"),this.hints=["TL"],this.rtext=`Destroy ${this.name}.`}ebknR(t){const r=a.field.jr5(t.creatId);a.death.destroy(r,this.code)}mmovC(){this.faction="A",this.rarity="C",this.name="Metamind Overseer",this.jr1=this.boof5915,this.jr2=this.jr1+1,this.tribe.push("MM"),this.hints=["TL"],this.rtext="Draw 2 cards."}mmovR(t){a.player.drawCard(t.ownerPlayerA,2)}runegC(){this.faction="U",this.rarity="H",this.name="Runegrove Guardian",this.jr1=this.boof4814,this.jr2=this.jr1,this.tribe.push("PL"),this.hints=["TL"],this.rtext=`${this.name} gets ${a.log.jr9(this.jr1,this.jr1)}.`}runegR(t){a.field.jr5(t.creatId).buff(this.jr1,this.jr1)}solrevC(){this.faction="U",this.rarity="L",this.name="Solstice Reveler",this.jr1=this.boof4816,this.jr2=this.jr1,this.tribe.push("HM"),this.hints=["TL","FRS"];const t=this.solbof;this.rtext=`each friendly creature gets ${a.log.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}solrevR(t){const r=this.solbof;a.field.ddf1().forEach(e=>{e.buff(r,r),this.level===3&&(e.breakthrough=!0)})}get solbof(){return this.jr1/2}spshamC(){this.faction="T",this.rarity="C",this.name="Spiritfrost Shaman",this.jr1=this.boof71117,this.jr2=this.boof4610,this.tribe.push("HM"),this.hints=["TL"],this.rtext=`Deal ${this.boof579} damage to the enemy player.`}spshamR(t){a.player.ddf3(!t.ownerPlayerA,this.boof579,this.code)}snoutC(){this.faction="U",this.rarity="C",this.name="Stouthide Stegadon",this.jr1=this.boof4714,this.jr2=this.boof71117,this.tribe.push("DN"),this.hints=["TL"],this.rtext=`Heal ${this.snoutbof} damage from ${this.name}.`}snoutR(t){a.field.jr5(t.creatId).heal(this.snoutbof)}get snoutbof(){return this.level*10}mantisC(){this.faction="U",this.rarity="C",this.name="Umbraglim Mantis",this.jr1=this.boof6914,this.jr2=this.jr1-1,this.tribe.push("IN"),this.hints=["TL"],this.rtext=`You gain ${this.mantbof} health.`}mantisR(t){a.player.healPlayer(t.ownerPlayerA,this.mantbof)}get mantbof(){return this.lValN([8,10,12])}}class dr extends x{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Riftlasher",this.jr1=this.boof359,this.jr2=this.boof61016,this.tribe.push("FR","EL"),this.hints=["OL","LKV","ATH"],this.text=`When ${this.name} ${a.log.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.ddp9(0,this.jr1,0,0)}}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("DM",this.code);return s.interactive=!0,e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.id===t.creatId&&t.ownerPlayerA===a.state.ddf9()}return!1}jr8(t){const r=t.event,e=a.target.toActions(d.crEnemyActTarg("CARD",this.code,a.enTil(t.creatId,r.dmg)));e.length>0?(e.push(a.action.noneEndTrigger()),a.action.ddf5(e)):a.batch.triggerDone()}handleAction(t){const r=a.deTil(t.param);a.field.ddf6(t).hurtDirect(parseInt(r[1]),this.code),a.action.actionDone(!0)}ddf7(t){const r=a.deTil(t.param);return d.ddp2(t,t.playerA,t.lane,{dmg:parseInt(r[1])})}}class ur extends x{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Scourgeflame Sorcerer",this.jr1=this.boof358,this.jr2=this.boof5914,this.tribe.push("ZB");const r=`Destroy a ${a.log.levelGateText(this.level+1,!0)}enemy creature.`,e=this.level===3?": ":", destroy another friendly creature: ";this.text=`Activate${e}${r}`}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.deTil(t.param);if(r[1]==="P1")a.action.ddf5(this.getCardActions(t));else{const e=a.field.jr5(r[0]),s=Date.now();if(this.level<3){const u=a.field.jr5(r[2]);a.death.destroy(u,this.code,s)}const c=a.field.ddf6(t);a.death.destroy(c,this.code,s),e.endActivation()}}friends(t){const r=d.crFriendNotMeActTarg("CARD",t.id,this.code,a.enTil(t.id,"P1"));return a.target.toActions(r)}enemies(t,r=""){const e=d.crEnemyActTarg("CARD",this.code,a.enTil(t.id,"P2",r));return e.level=a.target.ddf2(this.level+1),a.target.toActions(e)}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param);let s;return this.level===3?s=this.enemies(e):s=this.friends(e),s.push(a.action.cancelAction()),s}else if(t.actionKey==="CARD"){const e=a.deTil(t.param),s=a.field.jr5(e[0]),c=a.field.ddf6(t),u=this.enemies(s,c.id);return u.push(a.action.cancelAction()),u}return super.getCardActions(t,r)}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=a.deTil(t.param);if(r[1]==="P1")return d.ddp5(t);{const e=t,s=d.ddp7(t,e.playerA,e.lane);if(this.level<3){const c=a.field.jr5(r[2]),u=d.ddp1(c.owner,c.lane);u.destroy=!0,s.vectors.push(u)}return s}}}}class fr extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Seismic Adept",this.jr1=this.boof4712,this.jr2=this.boof61218,this.tribe.push("HM"),this.text="Activate: Move an enemy creature to another available enemy space.",this.bonus={exist:this.level*.5}}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{const e=a.field.jr5(r[1]);a.field.jr5(r[2]).move(t.lane),e.endActivation()}}empties(t,r=""){const e=d.actionTarget("TF","CARD",this.code,a.enTil("P2",t.id,r));return e.field="E",e.player="E",a.target.toActions(e)}enemies(t){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P1",t.id));return a.target.toActions(r)}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=this.enemies(e);return s.push(a.action.cancelAction()),s}else if(t.actionKey==="CARD"){const e=a.field.ddf6(t),s=a.deTil(t.param),c=a.field.jr5(s[1]),u=this.empties(c,e.id);return u.push(a.action.cancelAction()),u}return super.getCardActions(t,r)}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=d.actionEval(t,"ST"),s=t,c=a.field.jr5(r[2]),u=d.ddp1(c.owner,c.lane);return u.moveTo=s.lane,e.vectors.push(u),e}}}}class Ot extends x{constructor(t){super(t),this.rarity="R",this.jr1=this.boof4612,this.jr2=this.boof61016;const r=this.cardCode();if(r==="SSS"?this.steel():r==="LSS"?this.life():r==="FSS"?this.flame():r==="DSS"&&this.dark(),this.level>1){const e=a.log.levelGateText(this.level-1);this.text=`When you play a ${e} ${a.log.factionText(this.faction)} card, you may ${this.tuxt}.`}else this.hints=["LV"];this.bonus={exist:this.level*.5},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 ${a.log.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 ${a.log.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,r){const e=super.jr3(t,r);return this.level>1&&e.jr4("PC",this.code),e}ddf8(t){if(t.trigger.type==="PC"){const r=t.event;if(r.playerA===t.ownerPlayerA){const e=a.cards.getCard(r.cardCode);if(e.level0&&a.field.qActiveCreats().length>1&&t.push(r),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=this.boof5814;a.death.destroy(s,this.code),e.buff(c,c),a.turn.spellCast()}}getCardActions(t,r){const e=a.field.ddf6(t),s=a.target.toActions(d.crNotMeActTarg("CARD",e.id,this.code,a.enTil("P2",e.id)));return s.push(a.action.cancelAction()),s}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=a.field.jr5(r[1]),s=d.ddp8(t,e,"SD"),c=this.boof5814;return s.vectors.push(d.ddp1(t.playerA,t.lane,{att:c,hlt:c})),s}}}class mr extends x{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Statis Warden",this.jr1=this.boof5915,this.jr2=this.jr1+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,r){const e=super.jr3(t,r),s=e.jr4("PC",this.code);return s.interactive=!0,e}handleAction(t){const r=a.field.ddf6(t),e=d.mod("DF",!0,t.param);e.expiry="EN",r.addMod(e),a.action.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const r=t.event;return r.playerA===t.ownerPlayerA&&a.cards.getCard(r.cardCode).type==="S"}return!1}jr8(t){const r=d.crFriendNotMeActTarg("CARD",t.creatId,this.code,t.creatId);r.canDefender=!0;const e=a.target.toActions(r);e.length===0?a.batch.triggerDone():(e.push(a.action.noneEndTrigger()),a.action.ddf5(e))}ddf7(t){return d.ddp2(t,t.playerA,t.lane,{def:!0})}}class pr extends Q{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Static Shock",this.text=`Deal ${this.boof124} damage to a creature or player. You may play an additional ${a.log.levelGateText(this.level,!0)}spell this turn.`}playTargets(){const t=super.playTargets();return t.push(d.crActTarg("CARD",this.code),d.actionTarget("TP","CARD",this.code)),t}handleAction(t){this.logSpell(),t.zone==="P"?a.player.ddf3(t.playerA,this.boof124,this.code):a.field.ddf6(t).hurtDirect(this.boof124,this.code);const r=a.turn.freeCard(this.code);r.condition.level=a.target.ddf2(this.level),r.condition.card="S",a.turn.spellCast()}ddf7(t){const r=this.boof124,e=d.actionEval(t,"ST");if(t.zone==="P")e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r));else{const s=t;e.vectors.push(d.ddp1(s.playerA,s.lane,{dmg:r}))}return e}}class yr extends x{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steelscale Dragon",this.jr1=this.boof4812,this.jr2=this.jr1+2,this.tribe.push("RB","DG"),this.initMobile=this.level,this.text=`While each other friendly creature has Defender, ${this.name} gets ${a.log.jr9(this.jr1,0)}, Armor ${this.boof246}, and Breakthrough.`}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("DF",this.code);s.area="C";const c=e.addEffect("PS",this.code);return c.area="C",e}enforceEffect(t,r){const e=d.crNotMeTarg(r.id);if(e.player=a.player.toTarget(r.owner),a.field.creatByTarget(e).some(c=>!c.defender))r.removeModSafe(r.id);else{const c=d.mod("AT",this.jr1,r.id),u=d.mod("AR",this.boof246,r.id),m=d.mod("BT",!0,r.id);r.addModSafe(c),r.addModSafe(u),r.addModSafe(m)}}}class br extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Storm Bringer",this.jr1=this.boof5814,this.jr2=this.boof61018,this.tribe.push("WN","EL"),this.hints=["FH"];const r=this.boof246;this.bonus={exist:this.ddp9(0,r+2,0,0)},this.text=`At the start of each turn, ${this.name} moves to an available space at random. Flank: Deal ${r} damage to the opposing creature.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("TS",this.code),e.jr4("FK",this.code),e}ddf8(t){return t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="TS"){const r=a.field.emptyLanes(t.ownerPlayerA);r.length>0&&a.field.jr5(t.creatId).move(r[a.randInt(0,r.length)]),a.batch.triggerDone()}else if(t.trigger.type==="FK"){const e=t.event.creature.opposed;e&&e.hurtDirect(this.boof246,this.code),a.batch.triggerDone()}else super.jr8(t)}}class vr extends x{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Synapsis Oracle",this.jr1=this.boof358,this.jr2=this.lValN([9,15,24]),this.tribe.push("HM"),this.hints=["OL"];let r;this.level===3?(this.text="Activate: Level up a card in your hand.",r=1):(this.text=`Activate: ${a.log.daluac(!0)}.`,r=.5),this.bonus={exist:r}}canActivate(t){return a.state.getPlayer(t.owner).hand.some(e=>a.cards.getCard(e).canLevel())}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.jr5(t.param),e=a.state.getPlayer(r.owner);this.level===3?e.hand[t.position]=a.cards.getCard(t.card).levelUpCard():a.turn.levelAndDiscard(t),r.endActivation()}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=d.lvlHandActTarg(this.code,e.id);return a.target.toActions([s,a.target.buttonTarget("CANC")])}return super.getCardActions(t,r)}ddf7(t){return t.actionKey==="ACTV"?d.ddp5(t):d.actionEval(t,"DC")}}class Ar extends ne{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Thundersaur",this.jr1=0,this.jr2=this.level*12,this.tribe.push("DN"),this.initBT=!0,this.hints=["DLK","LKR"],this.text="When Thundersaur is dealt damage, it gets +1 attack for each damage dealt."}jr8(t){const r=t.event,e=r.target;e?e.buff(r.dmg,0):a.log.add("ERROR couldnt find creature - thundersaur trigger"),a.batch.triggerDone()}}class At extends x{lookup(t){return{["DCS"]:{c:()=>this.delphC(),t:e=>this.delphT(e)},["GMP"]:{c:()=>this.gmpC(),t:e=>this.gmpT(e)},["LBL"]:{c:()=>this.lbcC(),t:e=>this.lbcT(e)},["SSE"]:{c:()=>this.sseC(),t:e=>this.sseT(e)},["SPD"]:{c:()=>this.spdC(),t:e=>this.spdT(e)},["SPM"]:{c:()=>this.spmC(),t:e=>this.spmT(e)},["TBA"]:{c:()=>this.tbaC(),t:e=>this.tbaT(e)},["VCG"]:{c:()=>this.vgC(),t:e=>this.vgT(e)},["WBG"]:{c:()=>this.woeC(),t:e=>this.woeT(e)},["ZSH"]:{c:()=>this.zyxC(),t:e=>this.zyxT(e)}}[t]}bothTurns=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return e.jr4("TS",this.code),e}ddf8(t){return t.trigger.type==="TS"?this.bothTurns?!0:t.event.playerA===t.ownerPlayerA:!1}jr8(t){this.lookup(this.cardCode()).t(t),a.batch.triggerDone()}delphC(){this.faction="A",this.rarity="L",this.name="Delpha, Chronosculptor",this.jr1=this.boof7914,this.jr2=this.jr1,this.tribe.push("HM"),this.level>1&&(this.hints=["OL"],this.bonus={exist:this.ddp9(0,9,4,0)},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 r=a.state.getPlayer(t.ownerPlayerA),e=r.hand.map((c,u)=>{const m=a.cards.getCard(c);return{idx:u,lvl:m.level,nxt:m.canLevel()?m.levelUpCard():""}}).filter(c=>c.nxt&&(this.level===3||c.lvl===1)),s=e.length;if(s>0){const c=e[a.randInt(0,s)];r.hand[c.idx]=c.nxt}}}gmpC(){this.faction="A",this.rarity="L",this.name="Ghox, Metamind Paragon",this.jr1=this.boof4814,this.jr2=this.boof61218,this.tribe.push("MM"),this.hints=["OL"];const t=this.level===1?"":"s";this.bonus={exist:this.ddp9(0,0,0,0,this.level*.5)},this.text=`At the start of your turn, draw ${this.level} card${t}.`}gmpT(t){a.player.drawCard(t.ownerPlayerA,this.level)}lbcC(){this.faction="U",this.rarity="R",this.name="Lightbringer Cleric",this.jr1=this.boof51015,this.jr2=this.jr1,this.tribe.push("TK"),this.hints=["OL"],this.bonus={exist:this.ddp9(0,0,0,this.boof3610)},this.text=`At the start of your turn, you gain ${this.boof137} to ${this.boof5914-1} health.`}lbcT(t){a.player.healPlayer(t.ownerPlayerA,a.randInt(this.boof137,this.boof5914))}sseC(){this.faction="U",this.rarity="L",this.name="Scatterspore Eidolon",this.jr1=8,this.jr2=this.jr1,this.tribe.push("PL"),this.hints=["OL","EMO","DL"];const t=this.boof357,r=N.minionName(this.level);this.bonus={exist:this.ddp9(1,t*2,t,0)},this.text=`At the start of your turn, Spawn a ${t}/${t} ${r}.`}sseT(t){const r=this.lValS(["SXD","SXP","SXT"])+this.level.toString();a.field.birthCreature(r,"S",t.ownerPlayerA)}spdC(){this.faction="U",this.rarity="R",this.name="Shardplate Delver",this.jr1=this.boof4612,this.jr2=this.jr1,this.tribe.push("DN"),this.hints=["OL"];const t=this.boof246;this.bonus={exist:this.ddp9(0,t*2,t,0)},this.text=`At the start of your turn, ${this.name} gets ${a.log.jr9(t,t)}.`}spdT(t){const r=this.boof246;a.field.jr5(t.creatId).buff(r,r)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.jr1=this.boof91421,this.jr2=this.jr1,this.tribe.push("IN"),this.hints=["OP"],this.text="At the start of your turn, randomly discard down to two cards in your hand."}spmT(t){const r=a.state.getPlayer(t.ownerPlayerA);if(r.hand.length>2){let e=r.hand.slice(),s=[];for(;e.length>2;)s.push(e.splice(a.randInt(0,e.length),1)[0]);r.discard.push(...s),r.hand=e}}tbaC(){this.faction="U",this.rarity="L",this.name="Talisin, Bard of Abundance",this.jr1=this.lValN([8,12,16]),this.jr2=this.lValN([10,14,20]),this.tribe.push("SY"),this.bothTurns=this.lValB([!0,!0,!1]),this.hints=["OL"],this.level===3&&(this.bonus={exist:this.ddp6()}),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){a.state.gs.turn.regularPlays+=1}vgC(){this.faction="T",this.rarity="C",this.name="Volcanic Giant",this.jr1=this.boof51015,this.jr2=this.jr1,this.tribe.push("ER","GT"),this.hints=["OL"],this.bonus={exist:this.ddp9(0,0,0,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 r=a.randInt(this.boof137,this.boof5914);a.player.ddf3(!t.ownerPlayerA,r,this.code)}woeC(){this.faction="N",this.rarity="L",this.name="Woebringer",this.jr1=this.lValN([7,10,18]),this.jr2=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 r=d.crTarg();this.level===3&&(r.player=a.player.toTarget(!t.ownerPlayerA));const e=a.field.creatByTarget(r);let s=99999,c=[];e.forEach(m=>{m.attack===s?c.push(m):m.attack0){const m=c[a.randInt(0,u)];a.death.destroy(m,this.code)}}zyxC(){this.faction="T",this.rarity="L",this.name="Zyx, Storm Herald",this.jr1=this.boof4712,this.jr2=this.lValN([6,9,20]),this.initMobile=1,this.tribe.push("LT","AS"),this.hints=["OL","ATH","LKV"],this.text="Zyx battles an additional time on your turn."}zyxT(t){const r=a.field.jr5(t.creatId);r.extraBattles+=1}}class Zt extends Q{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(e,s)=>this.confZ(e,s),e:(e,s,c)=>this.confE(e,s,c)},["CSG"]:{c:()=>this.cystgC(),z:(e,s)=>this.cystgZ(e,s),e:(e,s,c)=>this.cystgE(e,s,c)},["GRN"]:{c:()=>this.grenC(),z:(e,s)=>this.grenZ(e,s),e:(e,s,c)=>this.grenE(e,s,c)},["TWG"]:{c:()=>this.twstrC(),z:(e,s)=>this.twstrZ(e,s),e:(e,s,c)=>this.twstrE(e,s,c)}}[t]}cardCast(t,r,e){this.lookup(t).z(r,e)}playTarg;constructor(t){super(t),this.playTarg=d.crActTarg("CARD",this.code),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",a.field.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]);this.cardCast(this.cardCode(),s,e),a.turn.spellCast()}}getCardActions(t){const r=a.field.ddf6(t);return this.playTarg.notMe=r.id,this.playTarg.param=a.enTil("P2",r.id),a.target.toActions([this.playTarg,a.target.buttonTarget("CANC")])}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=a.field.ddf6(t),s=a.field.jr5(r[1]);return this.lookup(this.cardCode()).e(t,s,e)}}confC(){this.faction="T",this.rarity="C",this.name="Conflagrate",this.text=`Deal ${this.boof369} to two enemy creatures.`,this.playTarg.player="E"}confZ(t,r){const e=Date.now(),s=this.boof369;t.hurtDirect(s,this.code,e),r.hurtDirect(s,this.code,e)}confE(t,r,e){const s=this.boof369,c=d.actionEval(t,"ST");return c.vectors=[d.ddp1(r.owner,r.lane,{dmg:s}),d.ddp1(e.owner,e.lane,{dmg:s})],c}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,r){const e=this.boof246;t.addArmor(e),r.addArmor(e)}cystgE(t,r,e){const s=this.boof246,c=d.actionEval(t,"ST");return c.vectors=[d.ddp1(r.owner,r.lane,{arm:s}),d.ddp1(e.owner,e.lane,{arm:s})],c}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,r){const e=this.boof246;t.addRegen(e),r.addRegen(e)}grenE(t,r,e){const s=this.boof246,c=d.actionEval(t,"ST");return c.vectors=[d.ddp1(r.owner,r.lane,{rgn:s}),d.ddp1(e.owner,e.lane,{rgn:s})],c}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 ${a.log.jr9(t,t)}.`,this.playTarg.player="F"}twstrZ(t,r){const e=this.tsboof;t.buff(e,e),r.buff(e,e)}twstrE(t,r,e){const s=this.tsboof,c=d.actionEval(t,"ST");return c.vectors=[d.ddp1(r.owner,r.lane,{att:s,hlt:s}),d.ddp1(e.owner,e.lane,{att:s,hlt:s})],c}}class kr extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Umbruk Icecrusher",this.jr1=this.boof61014,this.jr2=this.boof246,this.tribe.push("DN"),this.hints=["OL","ALU","ATH","LKV"],this.bonus={exist:this.ddp9(0,5,this.jr1+2,0)},this.text=`When ${this.name} ${a.log.dbdtap()}, deal that much damage to that player. Allied Uterra: This gets ${a.log.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.id===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR"){if(a.turn.allied("U")){const r=a.field.jr5(t.creatId);r.breakthrough=!0,r.buff(2,2)}a.batch.triggerDone()}else if(t.trigger.type==="DM"){const r=t.event;a.player.ddf3(r.target,r.dmg,this.code),a.batch.triggerDone()}}}class Tr extends x{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Umbruk Lasher",this.jr1=this.boof71014,this.jr2=this.jr1-1,this.initBT=!0,this.tribe.push("DN"),this.hints=["OL","LKV","ATH","ALT"],this.text=`Allied Tempys: When ${this.name} ${a.log.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.ddp9(0,this.jr1,0,0)}}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}handleAction(t){a.field.ddf6(t).hurtDirect(parseInt(t.param),this.code),a.action.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.id===t.creatId&&r.source.owner===a.state.ddf9()}return!1}jr8(t){if(t.trigger.type==="FR"){if(a.turn.allied("T")){const r=a.field.jr5(t.creatId),e=r.jr4("DM",this.code);e.interactive=!0,r.changed=!0}a.batch.triggerDone()}else if(t.trigger.type==="DM"){const r=t.event,e=a.target.toActions(d.crEnemyActTarg("CARD",this.code,r.dmg.toString()));e.length>0?(e.push(a.action.noneEndTrigger()),a.action.ddf5(e)):a.batch.triggerDone()}}ddf7(t){return d.ddp2(t,t.playerA,t.lane,{dmg:parseInt(t.param)})}}class Cr extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Uranti Heartseeker",this.jr1=this.boof4915,this.jr2=this.jr1,this.initDefend=!0,this.tribe.push("YT"),this.text=`Activate: Deal ${this.jr1} damage to an enemy creature or player with exactly ${this.jr1} health.`}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){if(t.zone==="F")a.field.ddf6(t).hurtDirect(this.jr1,this.code);else{const e=t;a.player.ddf3(e.playerA,this.jr1,this.code)}a.field.jr5(t.param).endActivation()}findVictims(t){const r=this.jr1,e=d.crEnemyTarg(),c=a.field.creatByTarget(e).filter(m=>m.health===r).map(m=>d.fieldSelectAction("CARD",m.lane,m.owner)),u=a.player.toPlayer("E");return u.health===r&&c.push(d.playerSelectAction("CARD",u.isPlayerA)),c.forEach(m=>{m.hostCard=this.code,m.param=t}),c}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=this.jr1,e=d.actionEval(t,"ST");if(t.zone==="P")e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r)),e.bonus=9999;else{const s=t;e.vectors.push(d.ddp1(s.playerA,s.lane,{dmg:r}))}return e}}getCardActions(t,r){const e=r??a.field.jr5(t.param),s=this.findVictims(e.id);return s.push(a.action.cancelAction()),s}}class D extends x{constructor(t){super(t),this.cardConstruct(this.cardCode())}cardConstruct(t){({["AEN"]:()=>this.anvenf(),["AGU"]:()=>this.avguard(),["BWG"]:()=>this.brambleguard(),["CHY"]:()=>this.cavernhyd(),["CDC"]:()=>this.cindcol(),["CNM"]:()=>this.cindmy(),["DBP"]:()=>this.prowler(),["DMR"]:()=>this.raptor(),["DBR"]:()=>this.bearride(),["DSZ"]:()=>this.duskzomb(),["FWB"]:()=>this.fangbear(),["FWR"]:()=>this.ravager(),["FMS"]:()=>this.firemane(),["FPR"]:()=>this.flop(),["FGA"]:()=>this.falpha(),["FGB"]:()=>this.fbeta(),["FGO"]:()=>this.fomega(),["FPS"]:()=>this.forgeplate(),["GGE"]:()=>this.geist(),["GGH"]:()=>this.ghast(),["GGS"]:()=>this.ggs(),["GCL"]:()=>this.glacial(),["IWC"]:()=>this.warcharger(),["LWY"]:()=>this.lwyrm(),["LHY"]:()=>this.lyshyd(),["MRF"]:()=>this.marrow(),["MMO"]:()=>this.mmop(),["NCW"]:()=>this.necrotic(),["NXC"]:()=>this.nexcore(),["OBD"]:()=>this.battledroid(),["OSP"]:()=>this.oss(),["RHC"]:()=>this.rime(),["SCS"]:()=>this.scorp(),["SCD"]:()=>this.scout(),["SFT"]:()=>this.scrap(),["SBA"]:()=>this.sparkblade(),["SKB"]:()=>this.sparkbot(),["SBR"]:()=>this.sparkass(),["SSN"]:()=>this.sfsent(),["SGI"]:()=>this.stonefist(),["SCL"]:()=>this.stormcall(),["SML"]:()=>this.lurker(),["TGS"]:()=>this.tsprout(),["TGN"]:()=>this.tgnome(),["TWS"]:()=>this.tscout(),["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]()}anvenf(){this.faction="A",this.rarity="C",this.name="Anvillon Enforcer",this.jr1=this.boof5711,this.jr2=this.jr1-1,this.initArmor=this.boof246,this.tribe.push("RB")}avguard(){this.faction="T",this.rarity="R",this.name="Avalanche Guardian",this.jr1=this.boof5915,this.jr2=this.lValN([8,15,23]),this.initMobile=1,this.initDefend=!0,this.tribe.push("IC","EL")}battledroid(){this.faction="A",this.rarity="H",this.name="Oreian Battledroid",this.jr1=this.lValN([5,7,17]),this.jr2=1,this.initArmor=this.jr1,this.tribe.push("RB")}bearride(){this.faction="U",this.rarity="C",this.name="Deepwood Bear Rider",this.jr1=this.lValN([5,16,18]),this.jr2=this.lValN([2,8,10]),this.tribe.push("LP")}brambleguard(){this.faction="U",this.rarity="C",this.name="Bramblewood Guardian",this.jr1=this.boof2612,this.jr2=this.lValN([9,14,24]),this.tribe.push("PL")}cavernhyd(){this.faction="U",this.rarity="C",this.name="Cavern Hydra",this.jr1=this.boof4711,this.jr2=this.boof71015,this.initRegen=this.boof135,this.tribe.push("HY")}cindcol(){this.faction="T",this.rarity="C",this.name="Cinder Colossus",this.jr1=this.lValN([3,13,24]),this.jr2=this.lValN([4,14,27]),this.initDefend=!0,this.level===1&&(this.hints=["LV"]),this.tribe.push("ER","EL")}cindmy(){this.faction="T",this.rarity="C",this.name="Cinder Mystic",this.jr1=this.lValN([4,11,21]),this.jr2=this.boof3714,this.tribe.push("FR","AS")}duskzomb(){this.faction="N",this.rarity="C",this.name="Duskspire Zombie",this.jr1=this.lValN([2,5,16]),this.jr2=this.lValN([5,8,19]),this.initRegen=4,this.tribe.push("ZB")}falpha(){this.faction="A",this.rarity="C",this.name="Forge Guardian Alpha",this.jr1=this.lValN([4,8,20]),this.jr2=this.lValN([8,14,26]),this.initDefend=!0,this.tribe.push("RB","GD")}fangbear(){this.faction="U",this.rarity="C",this.name="Fangwood Bear",this.jr1=this.boof61016,this.jr2=this.jr1,this.tribe.push("BR")}fbeta(){this.faction="A",this.rarity="R",this.name="Forge Guardian Beta",this.jr1=this.lValN([5,8,20]),this.jr2=this.lValN([3,6,18]),this.initArmor=this.boof124,this.tribe.push("RB","GD")}firemane(){this.faction="T",this.rarity="C",this.name="Firemane Steed",this.jr1=this.lValN([3,6,16]),this.jr2=this.lValN([6,9,19]),this.initMobile=2,this.tribe.push("FR","EL")}flop(){this.faction="T",this.rarity="C",this.name="Flowstone Primordial",this.jr1=this.lValN([6,7,15]),this.jr2=this.jr1+1,this.tribe.push("FR","EL")}fomega(){this.faction="A",this.rarity="L",this.name="Forge Guardian Omega",this.jr1=this.boof255080,this.jr2=this.jr1,this.initMobile=this.boof124,this.initArmor=this.initMobile*10,this.initBT=!0,this.initAggro=!0,this.consistent=!0,this.tribe.push("RB","GD")}forgeplate(){this.faction="A",this.rarity="C",this.name="Forgeplate Sentry",this.jr1=this.boof4915,this.jr2=this.jr1,this.initArmor=this.boof135,this.tribe.push("RB")}ggs(){this.faction="N",this.rarity="C",this.name="Grimgaunt Spectre",this.jr1=this.lValN([3,11,14]),this.jr2=this.jr1,this.initMobile=1,this.hints=["LV"],this.tribe.push("GG")}geist(){this.faction="N",this.rarity="C",this.name="Grave Geist",this.jr1=this.boof71118,this.jr2=this.boof4711,this.tribe.push("ST")}ghast(){this.faction="N",this.rarity="C",this.name="Grave Ghast",this.jr2=this.boof71013,this.jr1=this.jr2-2,this.initRegen=this.boof246,this.tribe.push("ZB")}glacial(){this.faction="T",this.rarity="C",this.name="Glacial Colossus",this.jr1=this.boof61016,this.jr2=this.lValN([8,13,19]),this.tribe.push("IC","EL"),this.initDefend=!0}hulk(){this.faction="N",this.rarity="C",this.name="Xithian Hulk",this.jr1=this.boof4814,this.jr2=this.jr1+3,this.tribe.push("AB")}lurker(){this.faction="U",this.rarity="C",this.name="Swampmoss Lurker",this.jr1=this.lValN([8,13,22]),this.jr2=this.lValN([4,6,15]),this.tribe.push("DN")}lwyrm(){this.faction="T",this.rarity="C",this.name="Lightning Wyrm",this.jr1=this.boof4711,this.jr2=this.boof258,this.tribe.push("LT","EL"),this.initAggro=!0}lyshyd(){this.faction="U",this.rarity="C",this.name="Lysian Hydra",this.jr1=this.boof5914,this.jr2=this.jr1+1,this.initRegen=this.level,this.tribe.push("HY")}marrow(){this.faction="N",this.rarity="C",this.name="Marrow Fiend",this.jr1=this.boof81117,this.jr2=this.lValN([1,5,13]),this.tribe.push("SK")}mmop(){this.faction="A",this.rarity="C",this.name="Metamind Operator",this.jr1=this.boof4610,this.jr2=this.lValN([10,14,18]),this.tribe.push("MM")}necrotic(){this.faction="N",this.rarity="C",this.name="Necrotic Wurm",this.jr1=this.lValN([4,7,18]),this.jr2=this.lValN([5,8,19]),this.tribe.push("WR")}nexcore(){this.faction="A",this.rarity="C",this.name="Nexus Core",this.jr1=0,this.jr2=this.lValN([15,25,40]),this.tribe.push("RB"),this.initDefend=!0}oss(){this.faction="N",this.rarity="R",this.name="Ossuary Spirit",this.jr1=this.lValN([1,3,6]),this.jr2=this.boof91420,this.initRegen=this.jr1+2,this.tribe.push("ST")}prowler(){this.faction="U",this.rarity="C",this.name="Deepbranch Prowler",this.jr1=this.lValN([8,9,10]),this.jr2=this.jr1,this.tribe.push("CT"),this.hints=["DL"],this.initBT=!0}raptor(){this.faction="U",this.rarity="C",this.name="Deepmoss Raptor",this.jr1=this.lValN([2,13,16]),this.jr2=this.jr1,this.hints=["LV","ST"],this.tribe.push("DN")}ravager(){this.faction="U",this.rarity="C",this.name="Fangwood Ravager",this.jr1=this.boof5917,this.jr2=this.jr1,this.tribe.push("BE")}rime(){this.faction="T",this.rarity="C",this.name="Rimehorn Charger",this.jr1=this.lValN([5,8,10]),this.jr2=this.jr1+3,this.initMobile=1,this.hints=["DL"],this.tribe.push("RM")}scorp(){this.faction="N",this.rarity="C",this.name="Scavenger Scorpion",this.jr1=this.lValN([6,9,11]),this.jr2=this.jr1,this.initRegen=this.level,this.hints=["DL"],this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.jr1=this.boof246,this.jr2=this.jr1,this.isFree=this.level>1,this.hints=[this.level===1?"LV":"DL"],this.tribe.push("RB")}scrap(){this.faction="A",this.rarity="H",this.name="Scrapforge Titan",this.jr1=this.lValN([1,5,20]),this.jr2=this.jr1,this.initArmor=this.lValN([1,5,10]),this.level===1&&(this.hints=["LV","ST"],this.bonus={play:1}),this.tribe.push("RB")}sfsent(){this.faction="A",this.rarity="C",this.name="Spiritforge Sentinel",this.jr1=this.lValN([3,6,9]),this.jr2=this.jr1*2,this.initArmor=this.lValN([1,2,6]),this.tribe.push("RB")}sparkbot(){this.faction="A",this.rarity="C",this.name="Spark Bot",this.jr1=this.boof5914,this.jr2=this.lValN([6,11,16]),this.tribe.push("RB")}sparkblade(){this.faction="A",this.rarity="C",this.name="Sparkblade Assassin",this.jr1=this.lValN([4,12,14]),this.jr2=this.lValN([5,13,15]),this.tribe.push("HM")}sparkass(){this.faction="T",this.rarity="C",this.name="Sparkbrand Asir",this.jr1=this.lValN([2,7,9]),this.jr2=this.lValN([6,11,13]),this.initAggro=!0,this.tribe.push("LT","AS")}stonefist(){this.faction="T",this.rarity="C",this.name="Stonefist Giant",this.jr1=this.lValN([3,7,16]),this.jr2=this.lValN([6,10,24]),this.tribe.push("ER","EL")}stormcall(){this.faction="T",this.rarity="C",this.name="Storm Caller",this.jr1=this.lValN([8,11,14]),this.jr2=this.jr1-2,this.tribe.push("WN","AS")}tgnome(){this.faction="A",this.rarity="C",this.name="Technognome",this.jr1=this.lValN([3,9,19]),this.jr2=this.jr1,this.level===1&&(this.hints=["LV"]),this.tribe.push("GN")}tscout(){this.faction="A",this.rarity="C",this.name="Tower Scout",this.jr1=this.boof5915,this.jr2=this.jr1,this.initMobile=1,this.tribe.push("HM")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.jr1=this.boof7911,this.jr2=this.jr1+1,this.hints=["DL"],this.tribe.push("PL")}unrelenting(){this.faction="N",this.rarity="H",this.name="Unrelenting Dead",this.jr1=this.boof4814,this.jr2=this.jr1,this.initRegen=this.jr1,this.tribe.push("ZB")}vblock(){this.faction="A",this.rarity="R",this.name="Vault Blockade",this.jr1=0,this.jr2=this.boof135,this.initArmor=this.boof101520,this.initDefend=!0,this.tribe.push("RB")}vtech(){this.faction="A",this.rarity="C",this.name="Vault Technician",this.jr1=this.boof61218,this.jr2=this.lValN([3,9,15]),this.tribe.push("HM")}warcharger(){this.faction="A",this.rarity="C",this.name="Ionic Warcharger",this.jr1=this.boof4915,this.jr2=this.lValN([7,12,18]),this.initMobile=1,this.tribe.push("RB")}waterwalk(){this.faction="T",this.rarity="C",this.name="Water Walker",this.jr1=this.lValN([5,12,14]),this.jr2=this.lValN([2,9,11]),this.tribe.push("IC","AS")}windprime(){this.faction="T",this.rarity="C",this.name="Wind Primordial",this.jr2=this.boof4814,this.jr1=this.jr2+2,this.initMobile=this.level,this.tribe.push("WN","EL")}xithcrush(){this.faction="N",this.rarity="C",this.name="Xithian Crusher",this.jr1=this.lValN([4,10,16]),this.jr2=this.jr1+2,this.tribe.push("AB")}yetiwar(){this.faction="T",this.rarity="C",this.name="Yeti Warcaller",this.jr1=this.boof248,this.jr2=this.lValN([10,15,23]),this.tribe.push("YT")}zombinf(){this.faction="N",this.rarity="C",this.name="Zombie Infantry",this.jr1=this.boof61015,this.jr2=this.jr1-1,this.tribe.push("ZB")}}class Sr extends Q{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Varna's Pact";const r=this.lValS(["a","two","three"]),e=this.level===1?"":"s",s=this.level===1?"was":"were";this.text=`Put ${r} random creature${e} that ${s} destroyed this game into ${r} space${e}.`}playTargets(){const t=super.playTargets();return t.push(this.fieldTarget("P1",[])),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")this.level===1?this.endSpell([t.lane],t.playerA):a.action.ddf5(this.getCardActions(t));else if(r[0]==="P2"){const e=[t.lane,parseInt(r[1])];this.level===2?this.endSpell(e,t.playerA):a.action.ddf5(this.getCardActions(t))}else this.endSpell([t.lane,parseInt(r[1]),parseInt(r[2])],t.playerA)}endSpell(t,r){this.logSpell();const e=Date.now();t.forEach(s=>{const c=a.death.gravedigger();c&&a.field.birthCreature(c,"R",r,s,e)}),a.turn.spellCast()}fieldTarget(t,r){const e=d.actionTarget("TF","CARD",this.code,a.enTil(t,...r));return e.player="F",e.lanes=a.field.laneIdx.filter(s=>!r.includes(s)),e}getCardActions(t,r){const e=a.deTil(t.param);let s;if(e[0]==="P1")s=this.fieldTarget("P2",[t.lane]);else{const c=[t.lane,parseInt(e[1])];s=this.fieldTarget("P3",c)}return a.target.toActions(s)}ddf7(t){const e=a.deTil(t.param)[0],s=d.ddp4(t,t.playerA,t.lane,`${"XHU"}1`);return s.final=this.level===1&&e==="P1"||this.level===2&&e==="P2"||this.level===3&&e==="P3",s.hints=["RE"],s}}class wr extends x{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Wildwood Sower",this.jr1=this.boof3612,this.jr2=this.lValN([6,11,18]),this.tribe.push("HM"),this.hints=["EMO"];const r=N.minionBuff(this.level);this.text=`When you play a spell, you may put a ${r}/${r} ${N.minionName(this.level)} into an available space.`,this.bonus={exist:this.ddp9(1,r*2,r,0)*.5}}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("PC",this.code);return s.interactive=!0,e}handleAction(t){a.field.birthCreature(N.minionCode(this.level),"P",t.playerA,t.lane),a.action.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const r=t.event;return r.playerA===t.ownerPlayerA&&a.cards.getCard(r.cardCode).type==="S"}return!1}jr8(t){const r=d.actionTarget("TF","CARD",this.code);r.field="E",r.player="F";const e=a.target.toActions(r);e.length===0?a.batch.triggerDone():(e.push(a.action.noneEndTrigger()),a.action.ddf5(e))}ddf7(t){return d.ddp4(t,t.playerA,t.lane,N.minionCode(this.level))}}class Er extends x{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Windcaller Shaman",this.jr1=this.boof3713,this.jr2=this.jr1+4,this.tribe.push("WN","AS"),this.hints=["FRO","EMA"],this.text=`Forge: You may move another friendly ${a.log.levelGateText(this.level,!0)}creature to an available space adjacent to ${this.name}.`,this.bonus={play:this.lValN([.25,.5,1])}}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("FR",this.code);return s.interactive=!0,e}jr8(t){const r=a.field.jr5(t.creatId);if(this.emptySloots(r).length>0){const e=d.crFriendNotMeActTarg("CARD",r.id,this.code,a.enTil("P1",r.id));e.level=a.target.ddf2(this.level);const s=a.target.toActions(e);s.length>0?(s.push(a.action.noneEndTrigger()),a.action.ddf5(s)):a.batch.triggerDone()}else a.batch.triggerDone()}handleAction(t){const r=a.deTil(t.param);r[0]==="P1"?a.action.ddf5(this.getCardActions(t)):(a.field.jr5(r[1]).move(t.lane),a.action.actionDone(!0))}emptySloots(t,r=""){return a.action.emptyAdjacents(t,a.enTil("P2",r))}getCardActions(t,r){const e=a.deTil(t.param),s=a.field.ddf6(t),c=a.field.jr5(e[1]),u=this.emptySloots(c,s.id);return u.push(a.action.cancelAction()),u}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=d.actionEval(t,"ST"),s=a.field.jr5(r[1]),c=d.ddp1(s.owner,s.lane);return c.moveTo=t.lane,e.vectors.push(c),e}}}class xr extends x{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Xithian Rotfiend",this.jr1=this.lValN([7,12,20]),this.jr2=this.jr1+1,this.tribe.push("AB"),this.hints=["OL"];const r=-this.boof135;this.text=`When ${this.name} becomes opposed, it gets ${a.log.jr9(r,r)}.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("EF",this.code),e.jr4("MV",this.code),e}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const r=t.event;return t.trigger.creatId===r.creature.id||r.creature.owner!==t.ownerPlayerA}return!1}jr8(t){let r=!1;const e=a.field.jr5(t.creatId),s=t.event;if((e.id===s.creature.id&&e.opposed||s.creature.lane===a.field.oppositeLane(e.lane))&&(r=!0),r){const c=-this.boof135;e.buff(c,c)}a.batch.triggerDone()}}class Dr extends x{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Xithian Shambler",this.jr1=this.boof369,this.jr2=this.jr1+1,this.tribe.push("AB");let r="",e=1;this.level===3&&(r=" You may use this ability twice per turn.",e=2),this.text=`Activate, destroy an adjacent creature: ${this.name} moves into that creature's space, then gets +attack and +health equal to that creature's attack and health.${r}`,this.hints=["LJ"];const s=this.avgCreatureStats();this.bonus={exist:this.ddp9(-1,s[0]+s[1],s[0],0)*e}}adjacentTarget(t){const r=d.crFriendActTarg("CARD",this.code,t.id);return r.lanes=t.adjacent,r}addExtraActivate(t){const r=d.mod("EA",!0,t.id);r.expiry="ET",t.addMod(r)}jr3(t,r){const e=super.jr3(t,r);return this.level===3&&(e.jr4("TS",this.code),this.addExtraActivate(e)),e}canActivate(t){return a.target.toActions(this.adjacentTarget(t)).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.ddf6(t),e=a.field.jr5(t.param),s=r.attack,c=r.health;a.death.destroy(r,this.code),e.move(t.lane),e.buff(s,c),e.endActivation(),this.level===3&&e.hasMod(e.id)&&(e.removeMod(e.id),e.activationAvailable=!0,a.phase.whatNext())}ddf8(t){return t.trigger.type==="TS"}jr8(t){const r=a.field.jr5(t.creatId);this.addExtraActivate(r),a.batch.triggerDone()}getCardActions(t,r){const e=r??a.field.jr5(t.param);return a.target.toActions([this.adjacentTarget(e),a.target.buttonTarget("CANC")])}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=a.deTil(t.param),e=t,s=a.field.jr5(r[0]),c=a.field.ddf6(e),u=d.actionEvalBuffC(t,s,c.attack,c.health),m=d.ddp1(c.owner,c.lane);m.destroy=!0;const y=d.ddp1(s.owner,s.lane);return y.moveTo=e.lane,u.vectors.push(m,y),u}}}class Pr{cardCache={};mapper={["AAK"]:He,["AGC"]:_,["AGK"]:M,["AGP"]:Y,["ASG"]:P,["AFO"]:le,["ATG"]:Pt,["ART"]:Pt,["AGM"]:Rt,["ALG"]:Ut,["AHL"]:Ze,["ALS"]:Ut,["AEN"]:D,["APM"]:Ne,["AQE"]:P,["AGD"]:Me,["AFS"]:Nt,["ABR"]:St,["AMY"]:St,["ABL"]:P,["AGU"]:D,["AIV"]:vt,["BTN"]:Ut,["BLH"]:Pt,["BSP"]:vt,["BWK"]:Rt,["BSR"]:_,["BMY"]:Re,["BTM"]:P,["BOS"]:N,["BAW"]:_,["BWG"]:D,["BWD"]:Wt,["BSG"]:Ge,["BSS"]:M,["BTS"]:Wt,["BWH"]:Le,["BZD"]:M,["BFM"]:M,["BSM"]:Ie,["CDT"]:Rt,["CTL"]:Y,["CHY"]:D,["CHV"]:$e,["CTI"]:M,["CHA"]:_,["CHH"]:M,["CHR"]:Ve,["CDC"]:D,["CFB"]:St,["CNM"]:D,["CSW"]:M,["CCT"]:_t,["CFG"]:Zt,["CSU"]:P,["CCR"]:_,["CSB"]:rt,["CRC"]:vt,["CYC"]:Pt,["CTW"]:P,["CTV"]:P,["CAG"]:P,["CBS"]:P,["CIN"]:Jt,["CSG"]:Zt,["DFR"]:M,["DHW"]:Pt,["DSS"]:Ot,["DCR"]:Y,["DSK"]:rt,["DBA"]:M,["DBP"]:D,["DMR"]:D,["DBR"]:D,["DCS"]:At,["DGZ"]:Y,["DIS"]:Gt,["DSV"]:Ue,["DDD"]:M,["DBT"]:P,["DFB"]:bt,["DMW"]:Nt,["DCH"]:Gt,["DSZ"]:D,["DYB"]:P,["ESK"]:vt,["EHW"]:We,["ETN"]:P,["EWE"]:de,["ENP"]:P,["ESU"]:Gt,["ENR"]:P,["EPD"]:Y,["ESC"]:Wt,["ESP"]:ze,["EWT"]:M,["EHN"]:Wt,["EFM"]:St,["EFP"]:Ke,["EXD"]:P,["FWB"]:D,["FWR"]:D,["FWK"]:rt,["FIN"]:P,["FRR"]:Y,["FVA"]:P,["FFU"]:z,["FMS"]:D,["FSM"]:Y,["FBC"]:St,["FBI"]:Pt,["FFS"]:z,["FLN"]:P,["FSS"]:Ot,["FLS"]:Pt,["FSH"]:z,["FFD"]:rt,["FSP"]:yt,["FPR"]:D,["FFL"]:P,["FGA"]:D,["FGB"]:D,["FGG"]:Nt,["FGO"]:D,["FPS"]:D,["FSK"]:Ye,["FWT"]:M,["FZS"]:P,["GHS"]:Nt,["GHB"]:_t,["GRN"]:Zt,["GTH"]:P,["GSC"]:Rt,["GMP"]:At,["GTT"]:qe,["GCL"]:D,["GCR"]:P,["GLF"]:_,["GRW"]:_,["GSW"]:M,["GVS"]:rt,["GSS"]:M,["GBG"]:rt,["GGE"]:D,["GGH"]:D,["GRP"]:Xe,["GGD"]:bt,["GGP"]:bt,["GGS"]:D,["GRM"]:Y,["GHT"]:_,["GMR"]:rt,["HTR"]:Qt,["HAR"]:P,["HFA"]:Vt,["HWM"]:Jt,["HGS"]:je,["HTP"]:Je,["IBF"]:Y,["ITO"]:Gt,["IWC"]:D,["IHA"]:Rt,["IMA"]:M,["JPK"]:P,["KAW"]:Pt,["KOD"]:z,["KKK"]:Qt,["LKP"]:Qe,["LGT"]:M,["LBR"]:P,["LSK"]:_e,["LWY"]:D,["LBD"]:M,["LSS"]:Ot,["LBL"]:At,["LSP"]:Jt,["LMV"]:M,["LHY"]:D,["MMH"]:_,["MRF"]:D,["MOE"]:M,["MXW"]:_,["MSP"]:Gt,["MMA"]:M,["MMX"]:rt,["MMO"]:D,["MMV"]:vt,["MSC"]:P,["MTS"]:tr,["MTT"]:er,["MML"]:rr,["MMW"]:ir,["MBP"]:z,["MND"]:z,["NGB"]:_,["NSL"]:P,["NCS"]:z,["NCW"]:D,["NCV"]:P,["NDR"]:ar,["NEM"]:Gt,["NSH"]:Y,["NXC"]:D,["NXP"]:he,["NXT"]:Ut,["NGT"]:bt,["NCL"]:Y,["NFF"]:z,["NOZ"]:rt,["NSY"]:M,["ONN"]:sr,["OXA"]:nr,["OXM"]:M,["OXP"]:or,["OOZ"]:N,["OBD"]:D,["OFM"]:M,["OJC"]:yt,["OPK"]:M,["OWW"]:Nt,["OHV"]:z,["ODC"]:hr,["OSP"]:D,["OWF"]:Y,["OXS"]:lr,["PHM"]:M,["PPM"]:z,["PSM"]:M,["PHS"]:_,["PTB"]:Y,["PSC"]:z,["PTR"]:P,["PSG"]:P,["PMS"]:P,["PYG"]:_t,["PYS"]:Y,["RBH"]:cr,["RTS"]:St,["RLW"]:yt,["RFL"]:dr,["RHC"]:D,["ROG"]:P,["RFA"]:Vt,["RBG"]:ce,["RGG"]:vt,["RSZ"]:rt,["SAP"]:P,["SPL"]:N,["SVO"]:P,["SSE"]:At,["SXP"]:N,["SXD"]:N,["SXT"]:N,["SCS"]:D,["SMD"]:M,["SFS"]:ur,["SCD"]:D,["SFT"]:D,["SDL"]:N,["SAD"]:fr,["SHG"]:P,["SPD"]:At,["SPM"]:At,["STD"]:_,["SHS"]:Rt,["SGF"]:z,["SKG"]:he,["SSR"]:vt,["SNB"]:P,["SNP"]:Y,["SRD"]:Y,["SRH"]:bt,["SDN"]:M,["SHV"]:P,["SBA"]:D,["SKB"]:D,["SBR"]:D,["SBD"]:M,["SFM"]:rt,["SSN"]:D,["SSM"]:vt,["SLH"]:gr,["SPN"]:N,["SRV"]:ce,["STR"]:P,["XYR"]:N,["SSA"]:z,["STO"]:P,["SDR"]:yt,["SWR"]:mr,["SHK"]:pr,["SFA"]:Vt,["STG"]:yr,["SSS"]:Ot,["SWM"]:z,["STN"]:P,["SGI"]:D,["SBG"]:br,["SCL"]:D,["SGA"]:Vt,["SSG"]:vt,["SVH"]:St,["SIN"]:P,["SYL"]:M,["SML"]:D,["SYO"]:vr,["TST"]:Y,["TBA"]:At,["TGS"]:D,["TPT"]:P,["TDW"]:yt,["TGN"]:D,["TSM"]:le,["TUP"]:P,["TGI"]:M,["TDS"]:Ar,["TOB"]:P,["TWS"]:D,["TVG"]:Oe,["TXS"]:P,["TFK"]:N,["TFD"]:N,["TFF"]:N,["TCG"]:P,["TRN"]:Y,["TWG"]:Zt,["UGM"]:vt,["UGL"]:M,["UIC"]:kr,["ULR"]:Tr,["URD"]:D,["UBL"]:P,["UCM"]:z,["UHS"]:Cr,["UIM"]:z,["UWL"]:M,["UWS"]:M,["UTM"]:M,["UTR"]:yt,["URB"]:St,["UPM"]:Nt,["VRP"]:Sr,["VBK"]:D,["VTC"]:D,["VGN"]:rt,["VNF"]:_,["VNS"]:M,["VGR"]:P,["VCG"]:At,["VES"]:St,["VYE"]:P,["WBY"]:_,["WBU"]:_,["WMR"]:z,["WMM"]:P,["WTW"]:D,["WWP"]:M,["WFM"]:Nt,["WWS"]:wr,["WBH"]:de,["WCS"]:Er,["WPD"]:D,["WFB"]:M,["WFS"]:z,["WBG"]:At,["XCR"]:D,["XHS"]:rt,["XHU"]:D,["XRF"]:xr,["XSH"]:Dr,["XDV"]:Qt,["XRW"]:P,["YWC"]:D,["YNS"]:bt,["ZPM"]:z,["ZTR"]:N,["ZTU"]:rt,["ZIN"]:D,["ZBS"]:N,["ZMB"]:N,["ZSH"]:At};makeCard(t){try{return new this.mapper[ut.extractCardCode(t)](t)}catch(r){throw console.error("Make card screwed up on code: "+t),r}}getCard(t){return this.cardCache[t]||(this.cardCache[t]=this.makeCard(t)),this.cardCache[t]}}class Fr{guts="";txt(t){return this.guts+=t,this}plr(t){const r=a.player.toBool(t);return this.guts+="^p"+(r?"a":"b"),this}crd(t){return this.guts+="^c"+t,this}go(){a.log.parse(this)}}class Br{loglist;you=!0;localPlayerKey="";oppPlayerKey="";localPlayerSpan="";oppPlayerSpan="";constructor(){this.loglist=document.getElementById("loglist")}setup(){this.you=a.state.gs.isLocalA,this.localPlayerKey=this.you?"^pa":"^pb",this.oppPlayerKey=this.you?"^pb":"^pa",this.localPlayerSpan=this.span(a.player.toPlayer(this.you).name,"green"),this.oppPlayerSpan=this.span(a.player.toPlayer(!this.you).name,"red")}addLi(t){const r=document.createElement("li");r.innerHTML=t,this.loglist.appendChild(r),r.scrollIntoView({behavior:"smooth",block:"end"})}span(t,r){return`${t}`}add(t){this.addLi(t)}clearAll(){this.loglist.innerHTML=""}new(){return new Fr}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let r=!0;for(;r;){const e=t.indexOf("^c");if(e===-1)r=!1;else{const s=t.slice(e+2,e+6);if(s==="POIS")t=t.replaceAll("^c"+s,this.span("Poison","green"));else{const c=a.cards.getCard(s);t=t.replaceAll("^c"+s,this.span(`${c.name} ${c.level}`,this.factMap[c.faction]))}}}return t}parse(t){const e=t.guts.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),s=this.parseCards(e);this.add(s)}cardText(t){let r;if(t.type==="C"){const e=t,s=[];e.initRegen>0&&s.push("Regenerate "+e.initRegen),e.initArmor>0&&s.push("Armor "+e.initArmor),e.initMobile>0&&s.push("Mobility "+e.initMobile),e.initBT&&s.push("Breakthrough"),e.initDefend&&s.push("Defender"),e.initAggro&&s.push("Aggressive"),e.consistent&&s.push("Consistent"),s.length>0&&s.push(""),r=s.join(". ")+t.text}else r=t.text;return(t.isFree?"Free. ":"")+(t.overload?"Overload. ":"")+r}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,r=!1){const e=r?" ":"";return t===1?`level 1${e}`:t===2?`level 2 or lower${e}`:""}jr9(t,r,e=!1){return t!==0&&r!==0?`${this.bufferson(t,!0)}${e?",":" and"} ${this.bufferson(r,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(r,!1)}bufferson(t,r){return`${t>0?"+":""}${t} ${r?"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){return t.length===3&&(t=`${t}1`),a.cards.getCard(t).name}actionText(t){switch(t.actionKey){case "ACTV":return"Activate";case "CARD":return`Card (${this.fastName(t.hostCard)})`;case "FITE":return"Fight";case "FORG":const r=t;return`Forge (${this.fastName(r.hostCard)}) Lane ${6-r.lane}`;case "HDSC":return`Hand Discard (${this.fastName(t.hostCard)})`;case "HPLY":const e=t;return`Hand Pick (${this.fastName(e.card)})`;case "MEND":return"Move End";case "MOVE":return"Move Start";case "NOTR":return"Pick None";case "ENDT":return"Donethanks";default:return t.actionKey}}tribeText(t){switch(t){case "AN":return"Any";case "AB":return"Abomination";case "AG":return"Angel";case "AS":return"Asir";case "BR":return"Bear";case "BE":return"Beast";case "CT":return"Cat";case "CR":return"Chrysalis";case "CY":return"Cyborg";case "DF":return"Darkforged";case "DM":return"Demon";case "DN":return"Dinosaur";case "DG":return"Dragon";case "DY":return"Dryad";case "ER":return"Earth";case "EL":return"Elemental";case "EN":return"Energeist";case "FY":return"Fairy";case "FR":return"Fire";case "FB":return"Forgeborn";case "FT":return"Frost";case "GT":return"Giant";case "GN":return"Gnome";case "GL":return"Golem";case "GG":return"Grimgaunt";case "GD":return"Guardian";case "HM":return"Human";case "HY":return"Hydra";case "IC":return"Ice";case "IN":return"Insect";case "LT":return"Lightning";case "LP":return"Lupin";case "MT":return"Manticore";case "MC":return"Mech";case "MM":return"Metamind";case "NG":return"Naga";case "OZ":return"Ooze";case "PX":return"Phoenix";case "PL":return"Plant";case "RM":return"Ram";case "RB":return"Robot";case "SY":return"Satyr";case "SE":return"Seraph";case "SH":return"Shaman";case "SS":return"Shapeshifter";case "SK":return"Skeleton";case "SN":return"Snake";case "SP":return"Spider";case "ST":return"Spirit";case "TG":return"Tigrin";case "TK":return"Tuskin";case "VP":return"Vampire";case "WD":return"Wanderer";case "WN":return"Wind";case "WF":return"Wolf";case "WR":return"Wurm";case "YT":return"Yeti";case "ZB":return"Zombie"}}}class Hr{makeTrans(t,r,e,s,c,u){}writeTrans(t,r,e,s,c,u){let m=!1;const y=a.state.getPlayer(t);if(r==="P")e==="HD"&&(u==="R"?(y.hand=s,m=!0):u==="D"&&(this.delPlayerHandI(y,s),m=!0));else if(r==="F"){if(u!=="R"){if(u==="U"){const A=a.field.jr5(c);A?e==="FT"&&(this.updFieldStateI(A,s),m=!0):console.error("Write could not find field, creature key:",c)}}}else r==="T"?e==="RP"&&(this.updRegPlaysI(s),m=!0):r==="D"&&u==="A"&&(this.addPlayerDeckI(y,e,s),m=!0);m||console.error("encountered unhandled DataDuke.write request",t,r,e,s,u)}updFieldState(t,r){this.updFieldStateI(t,r),this.makeTrans(t.owner,"F","FT",r,t.id,"U")}updRegPlays(t){this.updRegPlaysI(t),this.makeTrans(a.state.ddf9(),"T","RP",t,void 0,"U")}delPlayerHand(t,r){this.delPlayerHandI(t,r),this.makeTrans(t.isPlayerA,"P","HD",r,void 0,"D")}addPlayerDeck(t,r,e){this.addPlayerDeckI(t,r,e),this.makeTrans(t.isPlayerA,"D",r,e,void 0,"A")}updFieldStateI(t,r){t.status=r}updRegPlaysI(t){a.state.gs.turn.regularPlays=t}delPlayerHandI(t,r){t.hand.splice(r,1)}addPlayerDeckI(t,r,e){let s;if(r==="MD")s=t.deck;else if(r==="HD")s=t.hand;else if(r==="DD")s=t.discard;else{console.error("Invalid write item passed to addPlayerDeck ",r);return}s.push(e)}}class Nr{ddf8(t){return t.trigger.type==="FR"?this.forgeTriggerTest(t):t.trigger.type==="VN"?this.vengeanceTriggerTest(t):t.trigger.type==="FK"?this.flankTriggerTest(t):t.trigger.type==="DM"&&t.event.code==="DMG"||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==="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.host==="C"?(t.trigger.interactive&&(a.state.gs.batch.iatLane=a.field.jr5(t.creatId).lane),a.cards.getCard(t.trigger.logicCode).jr8(t)):t.host==="P"?console.error("player hosted trigger encountered. No code!"):t.host==="H"?console.error("hand card hosted trigger encountered. No code!"):console.error("Encountered trigger reaction with mystery host ",t)}forgeTriggerTest(t){if(t.event.code==="ENT"){const r=t.event;if(!r.creature)throw new Error("Creature Enters Field event not provided creature payload");if(r.forged){const e=a.field.jr5(t.creatId);return e.status==="A"&&e.id===r.creature.id}}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const r=t.event;if(!r.creature)throw new Error("Creature Died event not provided creature payload");const e=a.field.searchById(t.creatId);if(e)return e.status==="D"&&e.id===r.creature.id;console.warn("interesting. venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const r=t.event;if(!r.creature)throw new Error("Creature Moved event not provided creature payload");const e=a.field.jr5(t.creatId);return e.status==="A"&&e.id===r.creature.id}return!1}generalTriggerTest(t){return t.creatId?a.cards.getCard(t.trigger.logicCode).ddf8(t):(console.error("player based trigger event encountered"),!1)}}class Mr{deathCheck(){const t=Date.now();a.field.qActiveCreats().forEach(s=>{s.health<1&&(a.log.new().crd(s.code).txt(" died.").go(),this.smite(s,t))});const r=a.player.toPlayer(!0),e=a.player.toPlayer(!1);(r.health<1||e.health<1)&&(r.healthe.creatId===t.id)&&(a.state.gs.deathOrder=a.state.gs.deathOrder.filter(e=>e.creatId!==t.id))}findDeathTime(t){const r=a.state.gs.deathOrder.filter(e=>e.creatId===t).map(e=>e.time);if(r.length!==0)return Math.min(...r)}destroy(t,r,e=void 0){a.log.new().crd(t.code).txt(" was destroyed by ").crd(r).txt(".").go(),this.smite(t,e)}gravedigger(t="X"){if(t==="X"){const r=a.state.gs.graveyard.length;return r===0?"":a.state.gs.graveyard[a.randInt(0,r)].cardCode}else{const r=a.player.toBool(t),e=a.state.gs.graveyard.filter(c=>c.owner===r),s=e.length;return s===0?"":e[a.randInt(0,s)].cardCode}}smite(t,r=void 0){t.status="D",a.state.gs.deathOrder.push({creatId:t.id,time:r||Date.now()}),a.state.gs.graveyard.push({cardCode:t.code,owner:t.owner}),a.batch.addEvents(d.creatureEvent("DIE",t)),a.effect.positionChange(t.owner)}}class Rr{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 r;if(t==="N0")r=a.state.gs.batch.events.slice(),a.state.gs.batch.events=[];else{const s=a.state.gs.batch.events.filter(u=>u.code==="DIE"),c=a.state.gs.batch.events.filter(u=>u.code!=="DIE");t==="C1"?(r=c,a.state.gs.batch.events=s):(r=s,a.state.gs.batch.events=c)}const e=this.generateTriggers(r);a.state.gs.batch.triggerActions=this.sortTriggers(e),a.phase.whatNext()}generateTriggers(t){let r;const e=t.map(s=>(s.code==="TRS"&&(r=s),a.state.gs.field.map(u=>u.triggers.map(m=>{const y=d.triggerReaction(s,m,u.owner,"C");return y.creatId=u.id,y.cardCode=u.code,y}).filter(m=>a.trigger.ddf8(m))).flat())).flat();return r&&this.handleTurnStart(r),e}sortTriggers(t){const r=a.state.ddf9(),e=t.filter(u=>!u.trigger.interactive&&u.ownerPlayerA===r),s=t.filter(u=>!u.trigger.interactive&&u.ownerPlayerA!==r);return t.filter(u=>u.trigger.interactive&&u.ownerPlayerA===r).concat(s,e)}handleTurnStart(t){const r=a.state.ddf9();a.field.qPlayerCreats(r).filter(s=>s.sleeping).forEach(s=>{s.sleeping=!1});const e=Date.now();a.field.qActiveCreats().forEach(s=>{if(s.owner===t.playerA&&(s.activationAvailable=!0,s.mobilityAvailable=!0,s.sleeping=!1),s.armorDmg=0,s.poison>0&&s.hurtDirect(s.poison,"POIS",e),s.regen>0){const c=s.heal(s.regen);this.addEvents(d.creatStatEvent("RGN",s,c))}a.death.deathProdder(s,e)})}getNextTrigger(){const t=a.state.gs.batch.triggerActions;if(t.length!==0)return t[t.length-1]}triggerDone(){const t=a.state.gs.batch.triggerActions;t.length===0?console.error("batch.triggerDone() was called when there is no trigger actions"):(t.pop(),a.state.gs.batch.iatLane=0),a.phase.whatNext()}addEvents(...t){a.state.gs.batch.events.push(...t)}get deathCheck(){return a.state.gs.batch.deathCheck}set deathCheck(t){a.state.gs.batch.deathCheck=t}get type(){return a.state.gs.batch.type}set type(t){a.state.gs.batch.type=t}get iaTrigLane(){return a.state.gs.batch.iatLane}}class Gr{chirpy=!1;chirp(t){}enterMainPhase(){a.state.setPhase("MN");const t=a.state.getActivePlayer(),r=this.getMainPhaseActions(t);a.action.ddf5(r)}passTheTurn(){a.state.gs.activePlayer=!a.state.gs.activePlayer,a.state.setPhase("WT"),a.state.gs.aiMode&&(a.state.gs.aiActive=!a.state.gs.aiActive,this.startTurn())}startTurn(){a.log.new().txt("------").go(),a.log.new().plr(a.state.ddf9()).txt(" starts turn.").go(),a.state.resetTurnData(),a.state.setPhase("ST"),a.batch.addEvents(d.playerEvent("TRS",a.state.ddf9())),this.expireMods(),this.whatNext()}async whatNext(){if(a.state.gs.winFlag!==0){this.chirp("NEXT! found win state"),a.action.actionHistory=[],a.state.gs.aiActive=!1,await a.drawing.drawAll();return}if(await a.drawing.drawAll(),a.action.actionHistory.length>0)this.chirp("NEXT! action restore"),a.action.ddf5();else if(a.batch.getNextTrigger())this.chirp("NEXT! next trigger"),a.trigger.resolve(a.batch.getNextTrigger());else if(!a.batch.deathCheck)this.chirp("NEXT! death check"),a.death.deathCheck(),this.whatNext();else if(a.state.gs.batch.events.length>0)this.chirp("NEXT! batch start"),a.batch.startBatch();else switch(this.chirp("NEXT! enter phase handler "+a.state.gs.phase),a.state.gs.field=a.state.gs.field.filter(t=>t.status==="A"),a.state.gs.deathOrder=[],a.state.gs.birthOrder=[],a.state.gs.phase){case "MN":this.enterMainPhase();break;case "ET":a.state.setPhase("PT"),a.batch.addEvents(d.playerEvent("PTN",a.state.ddf9())),a.phase.expireMods(),this.whatNext();break;case "PT":this.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),a.state.setPhase("MN"),this.whatNext();break;case "ST":a.state.setPhase("MN"),a.ai.cheater()?a.sleep(500).then(()=>this.whatNext()):this.whatNext();break}}expireMods(){const t=a.state.gs.phase,r=a.field.creatByTarget(d.crTarg());let e=[];t==="PT"?r.forEach(s=>{s.mods.forEach(c=>{c.expiry==="EN"?c.expiry="ET":c.expiry==="ET"&&e.push([s,c])})}):t==="ST"&&r.forEach(s=>{s.mods.forEach(c=>{c.expiry==="SN"?c.expiry="ST":c.expiry==="ST"&&e.push([s,c])})}),e.length>0&&(e.forEach(s=>s[0].expireMod(s[1])),a.effect.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const r=this.getHandActions(t),e=this.getFieldActions(t);let s=!a.state.gs.turn.mainBattle,c="M";return s||(s=a.field.ddf1().some(m=>m.extraBattles>0&&m.isActive&&!m.defender),c="E"),s&&r.push({actionKey:"FITE",zone:"B",param:c,hostCard:""}),s||r.push({actionKey:"ENDT",zone:"B",param:"",hostCard:""}),[r,e].flat()}getHandActions(t){const r=[...new Set(t.hand)],e=[],s=[];r.forEach(y=>{a.cards.getCard(y).isFree?e.push(y):s.push(y)});const c=e.map(y=>[y,"FREE"]);a.state.gs.turn.freeCards.forEach(y=>{a.target.cardByTarget(s,y.condition).forEach(k=>{c.push([k[0],y.id]),s.splice(s.indexOf(k[0]),1)})}),c.push(...s.map(y=>[y,""]));const u=a.state.gs.turn.regularPlays>0;let m=t.hand.map((y,A)=>[y,A]);return u||(m=m.filter(y=>!s.includes(y[0]))),m.map(y=>{const A=c.find(k=>k[0]===y[0]);return A||console.error("No cost found for card"+y[0]),d.handSelectAction("HPLY",y[0],A[1],y[1])})}getFieldActions(t){const r=a.field.qPlayerCreats(t.isPlayerA),e=r.filter(c=>a.field.canMove(c).length>0).map(c=>d.fieldSelectAction("MOVE",c.lane,c.owner)),s=r.filter(c=>c.isActive&&c.activationAvailable?a.cards.getCard(c.code).canActivate(c):!1).map(c=>{const u=d.fieldSelectAction("ACTV",c.lane,c.owner);return u.hostCard=c.code,u.param=c.id,u});return e.forEach(c=>{const u=s.findIndex(m=>m.lane===c.lane);u>-1&&(s.splice(u,1),c.param="ACTV")}),e.concat(s)}}var st=(n=>(n[n.Left=0]="Left",n[n.Both=1]="Both",n[n.Right=2]="Right",n))(st||{});class ee{action;hitTest(t,r,e){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,r,e,s){let c,u=0;const m=t.length;for(;c===void 0&&u=t&&this.originY<=r&&this.endY>=r?this.action:void 0}}class wt extends O{constructor(t,r,e,s,c=0){super({zone:"N",actionKey:"BNDL",hostCard:"",param:""},t,r,e,s,c)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,r,e){if(super.hitTest(t,r,e))return ee.arrayHit(this.childs,t,r,e)}}class Lr{registry;constructor(){this.registry=[]}find(t){const r=this.registry.find(e=>e.action===t);if(r)return r;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,r){const e=this.find(t);e.enabled=r}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const r=this.registry.findIndex(e=>e.action===t);r>-1&&this.registry.splice(r,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,r,e){let s,c=a.state.clickMode;return c==="M"?s=e:c==="T"?s=0:s=2,ee.arrayHit(this.registry,t,r,s)}}class Ir{forgeCard(t,r){const e=this.cardPlayed(r),s=a.state.getActivePlayer();a.log.new().txt("Forged ").crd(e.code).txt(".").go(),a.field.birthCreature(e,"F",s.isPlayerA,t.lane),a.action.actionDone()}levelAndDiscard(t){const r=a.cards.getCard(t.card),e=a.state.getActivePlayer();return e.hand.splice(t.position,1),r.overload||e.discard.push(r.levelUpCard()),r}cardPlayed(t,r=!1){const e=this.levelAndDiscard(t),s=a.state.getActivePlayer();if(t.cost==="")a.state.gs.turn.regularPlays-=1;else if(t.cost!=="FREE"){const c=a.state.gs.turn.freeCards.findIndex(u=>u.id===t.cost);c>-1?a.state.gs.turn.freeCards.splice(c,1):console.error("Could not find free card rule!")}if(a.state.gs.turn.cardsPlayed+=1,!r){const c=d.playCardEvent(t.card,s.isPlayerA);a.batch.addEvents(c)}return e}spellCast(){this.cardPlayed(a.action.cardBeingPlayed),a.action.actionDone()}endTurn(){const t=a.state.getActivePlayer();t.discard.push(...t.hand),t.hand=[],t.turn++;const r=t.turn>4;a.batch.addEvents(d.playerEvent("TRE",t.isPlayerA)),r&&(t.turn=1,t.rank++,a.batch.addEvents(d.playerEvent("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],a.deck.shuffleDeck(t.isPlayerA)),a.field.qActiveCreats().forEach(e=>{e.extraBattles=0}),a.player.drawCard(t,5),a.state.setPhase("ET"),a.action.actionDone()}mobility(t){const r=a.field.jr5(t.param);r.mobilityAvailable=!1,r.move(t.lane),a.action.actionDone()}allied(t,r){const e=r??a.state.getActivePlayer(),s=d.target("TH");return s.player=a.player.toTarget(e),s.faction=t,a.target.deckByTarget(s).length>0}freeCard(t){const r=d.freeCard(t);return a.state.gs.turn.freeCards.push(r),r}}class $r{laneIdx=[1,2,3,4,5];jr5(t){const r=this.searchById(t);if(r)return r;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByLane(t,r){const e=this.searchByLane(t,r);if(e)return e;throw console.error("naughty creature lane ",t,r),new Error("Could not find creature by lane")}ddf6(t){const r=this.searchByFSA(t);if(r)return r;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return a.state.gs.field.find(r=>r.id===t)}searchByLane(t,r){return a.state.gs.field.find(e=>e.lane===t&&e.owner===r&&e.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let r=a.state.gs.field;if(t){if(t.player!=="X"){const e=a.player.toBool(t.player);r=r.filter(s=>s.owner===e)}if(t.creatStatus!=="A"){const e=this.creatStatusTargetToCS(t.creatStatus);r=r.filter(s=>s.status===e)}if(!a.isUn(t.lanes)){const e=a.target.lanesToArr(t.lanes);r=r.filter(s=>e.includes(s.lane))}if(a.isUn(t.maxAttack)||(r=r.filter(e=>e.attack<=t.maxAttack)),t.notMe&&(r=r.filter(e=>e.id!==t.notMe)),t.tribe!=="AN"&&(r=r.filter(e=>e.isTribe(t.tribe))),t.level!=="LA")if(t.level==="LG")r=r.filter(e=>a.cards.getCard(e.code).canLevel());else{const e=a.target.levelTargetToLevel(t.level);r=r.filter(s=>e.includes(s.level))}t.canDefender&&(r=r.filter(e=>!e.negateDefender)),t.hasDefender&&(r=r.filter(e=>e.defender)),t.canArmor&&(r=r.filter(e=>!e.negateArmor)),t.hasArmor&&(r=r.filter(e=>e.armor>0)),t.canMove&&(r=r.filter(e=>!e.negateMobility)),t.hasMobility&&(r=r.filter(e=>e.mobility>0)),t.hasPoison&&(r=r.filter(e=>e.poison>0)),t.canRegen&&(r=r.filter(e=>!e.negateRegen)),t.hasRegen&&(r=r.filter(e=>e.regen>0)),t.faction!=="X"&&(r=r.filter(e=>e.faction===t.faction))}return r}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(r=>!a.state.gs.field.find(s=>s.owner===t&&s.lane===r&&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(r=>Math.abs(t.lane-r)<=t.mobility):[]}birthCreature(t,r,e,s=0,c=void 0){if(r==="S"){const k=this.emptyLanes(e);if(k.length===0)return;s=k[a.randInt(0,k.length)]}else if(r==="P"&&!this.emptyLanes(e).includes(s))return;const m=(typeof t=="string"?a.cards.getCard(t):t).jr3(e,s),y=a.state.gs.field;if(r==="F"||r==="R"){const k=a.field.searchByLane(s,e);k&&(a.log.new().crd(k.code).txt(" was replaced.").go(),k.status="R",a.batch.addEvents(d.creatureEvent("RPL",k)))}y.push(m);const A=d.enterFieldEvent(m);return A.forged=r==="F",a.state.gs.birthOrder.push({creatId:m.id,time:c||Date.now()}),a.batch.addEvents(A),m.enforceEffects("PH"),a.effect.positionChange(e),m}findBirthTime(t){const r=a.state.gs.birthOrder.filter(e=>e.creatId===t).map(e=>e.time);if(r.length!==0)return r.length>1&&console.warn("wery curious, more than one birth record for creat "+t),r[0]}qActiveCreats(){return this.creatByTarget(d.crTarg())}qPlayerCreats(t){const r=d.crTarg();return r.player=a.player.toTarget(t),this.creatByTarget(r)}ddf1(){return this.creatByTarget(d.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(d.crEnemyTarg())}}class Vr{creatFightState(t,r){return t?r===1||t.defender||t.sleeping&&!t.aggressive?1:r===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t,r,e,s){if(t>0){let c=0;if(r>0){const u=t===2&&e.breakthrough;c=s.hurtBattle(e.attack,e,u)}else t===2&&(c=e.attack);c>0&&a.player.hurtPlayerBattle(!e.owner,c,e)}}fight(t){a.log.add("FIGHT!");let r=2,e=1;t&&(a.state.gs.turn.mainBattle=!0,r=0,e=0);const s=a.state.ddf9(),c=[],u=[];a.field.laneIdx.forEach(m=>{const y=a.field.searchByLane(m,s),A=a.field.searchByLane(6-m,!s),k=this.creatFightState(y,r),w=this.creatFightState(A,e);(k===2||w===2)&&(u.push([k,w,y,A],[w,k,A,y]),k===2&&(a.state.gs.turn.friendlyFightStarters++,c.push([m,s])),w===2&&c.push([a.field.oppositeLane(m),!s]))}),this.barking&&c.length>0&&a.dogBark(),a.drawing.drawCombat(c).then(()=>{u.forEach(m=>this.dukeItOut(...m)),a.effect.playerHealthChange(),a.death.deathCheck(),a.batch.type="C0",a.action.actionDone()})}barking=!0}class Ur{positionChange(t){a.field.creatByTarget().forEach(r=>{r.enforceEffects("PS",t)})}defenderChange(t){a.field.qActiveCreats().forEach(e=>{e.effects.filter(s=>s.watch==="DF").filter(s=>s.area==="C"&&e.owner===t||s.area==="A").forEach(s=>a.cards.getCard(s.logicCode).enforceEffect(s,e))})}playerHealthChange(){a.field.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){a.field.qActiveCreats().forEach(r=>{r.enforceEffects("AT"),r.enforceEffects("AR"),r.enforceEffects("CH"),r.enforceEffects("DF",r.owner)})}}class Wr{}class Or{pt2pb={["X"]:()=>{throw new Error("goof passed any to player target boolean-o-fier")},["A"]:()=>!0,["B"]:()=>!1,["F"]:()=>a.state.ddf9(),["E"]:()=>!a.state.ddf9()};toPlayer(t){return typeof t=="boolean"?a.state.getPlayer(t):typeof t=="string"?a.state.getPlayer(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"}hurtPlayer(t,r){return r<1?0:(t.health-=r,r)}ddf3(t,r,e){const s=this.toPlayer(t),c=this.hurtPlayer(s,r);c>0&&(a.log.new().crd(e).txt(` dealt ${c} dmg to `).plr(s).txt(".").go(),a.batch.addEvents(d.damageEvent(!1,c,!1,!1,s.isPlayerA,void 0)),a.effect.playerHealthChange())}hurtPlayerBattle(t,r,e){const s=this.toPlayer(t),c=this.hurtPlayer(s,r);c>0&&(a.log.new().crd(e.code).txt(` dealt ${c} battle dmg to `).plr(s).txt(".").go(),a.batch.addEvents(d.damageEvent(!0,c,!0,!1,s.isPlayerA,e)))}healPlayer(t,r){const e=this.toPlayer(t);e.health+=r,a.log.new().plr(e).txt(` gained ${r} health.`).go(),a.batch.addEvents(d.playerHealEvent("PHL",e.isPlayerA,r)),a.effect.playerHealthChange()}drawCard(t,r){const e=this.toPlayer(t);for(let s=0;s{const s=this.actionTargGuts(e);return s.forEach(c=>{c.hostCard=e.hostCard,c.param=e.param}),s}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(r=>d.handSelectAction(t.actionKey,r[0],"",r[1]));if(t.target==="TF"){if(t.field==="O")return a.field.creatByTarget(t).map(r=>d.fieldSelectAction(t.actionKey,r.lane,r.owner));{const r=t.player==="X"?[!0,!1]:[a.player.toBool(t.player)],e=a.isUn(t.lanes)?a.field.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return r.map(s=>e.map(c=>d.fieldSelectAction(t.actionKey,c,s))).flat();if(t.field==="E")return r.map(s=>a.field.emptyLanes(s).filter(c=>e.includes(c)).map(c=>d.fieldSelectAction(t.actionKey,c,s))).flat()}}if(t.target==="TP")return t.player==="X"?[d.playerSelectAction(t.actionKey,!0),d.playerSelectAction(t.actionKey,!1)]:[d.playerSelectAction(t.actionKey,a.player.toBool(t.player))];if(t.target==="TB")return[{actionKey:t.actionKey,zone:"B",hostCard:t.hostCard,param:""}];if(t.target==="TR")return[{actionKey:t.actionKey,zone:"R",hostCard:t.hostCard,param:""}];if(t.target==="TD")return[];throw new Error("Target encountered that doesnt have mappings to actions: "+t.target)}cardByTarget(t,r){let e=t.map((s,c)=>[s,c]);if(r){if(a.isUn(r.deckPositionSkip)||(e=e.filter(s=>s[1]!==r.deckPositionSkip)),r.faction!=="X"&&(e=e.filter(s=>a.cards.getCard(s[0]).faction===r.faction)),r.tribe!=="AN"&&(e=e.filter(s=>{const c=a.cards.getCard(s[0]);return c.type==="C"?c.isTribe(r.tribe):!1})),r.level!=="LA")if(r.level==="LG")e=e.filter(s=>a.cards.getCard(s[0]).canLevel());else{const s=a.target.levelTargetToLevel(r.level);e=e.filter(c=>{const u=parseInt(c[0].substring(3,4));return s.includes(u)})}if(r.card!=="A"){const s=r.card==="C"?"C":"S";e=e.filter(c=>a.cards.getCard(c[0]).type===s)}}return e}deckByTarget(t){const r=a.player.toPlayer(t.player);let e;if(t.target==="TH")e=r.hand;else if(t.target==="TD")e=r.discard;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(e,t)}buttonTarget(t,r="",e=""){return d.actionTarget("TB",t,r,e)}boardTarget(t,r){return d.actionTarget("TR",t,r)}ddf2(t){return t===1?"L1":t===2?"LN":"LA"}lt2l={["LA"]:()=>[1,2,3,4],["LG"]:()=>{throw new Error("goof passed grow to level target mapper")},["L1"]:()=>[1],["L2"]:()=>[2],["L3"]:()=>[3],["LN"]:()=>[1,2]};levelTargetToLevel(t){return this.lt2l[t]()}levelTargetTest(t,r){return this.levelTargetToLevel(t).includes(r)}levelTestCommon(t,r){return this.levelTargetTest(this.ddf2(r),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}class zr{handleAction(t){if(t.actionKey==="DEET"){a.state.gs.ui.detailsMode=!0,a.drawing.drawDetails(t);return}if(t.actionKey==="HPLY"){this.playCardSelect(t);return}if(t.actionKey==="FORG"){a.turn.forgeCard(t,this.cardBeingPlayed);return}if(t.actionKey==="FITE"){a.fight.fight(t.param==="M");return}if(t.actionKey==="ENDT"){a.turn.endTurn();return}if(t.actionKey==="MOVE"){this.mobilitySelect(t);return}if(t.actionKey==="MEND"){a.turn.mobility(t);return}if(t.actionKey==="HDSC"){const r=this.cardBeingPlayed;r.cost="",a.turn.cardPlayed(r,!0),this.actionDone();return}if(t.actionKey==="ACTV"){const r=a.field.jr5(t.param);a.cards.getCard(r.code).startActivation(r);return}if(t.actionKey==="NOTR"){this.actionDone(!0);return}if(t.actionKey==="CARD"){a.cards.getCard(t.hostCard).handleAction(t);return}if(t.actionKey==="CANC"){(t.param="EX")&&a.state.cancelExitMode(),this.actionHistory.pop(),this.ddf5();return}if(t.actionKey==="SCRH"){t.param==="R"?a.state.gs.ui.handScrollLeft+=1:a.state.gs.ui.handScrollLeft-=1,a.drawing.drawAll();return}if(t.actionKey==="DRFT"){a.draft.resumeDraft(t.param);return}if(t.actionKey==="SCRD"){t.param==="U"?a.draft.paginating=!1:a.draft.paginating=!0,a.drawing.drawAll();return}if(t.actionKey==="UIBT"){t.param==="DM"?(a.state.setClickMode("I"),a.drawing.drawAll()):t.param==="TM"?(a.state.setClickMode("T"),a.drawing.drawAll()):t.param==="EX"?(a.state.setMode("X"),this.generateExitActions()):console.error("missing handler for common button param "+t.param);return}if(t.actionKey==="MENU"){t.param==="D"?(a.state.setMode("D"),a.state.gs.options.wasDrafting=!0,a.draft.startDraft(!1,!1)):t.param==="C"?(a.state.setMode("C"),a.state.gs.options.wasDrafting=!1,this.ddf5(this.generateDeckPickerActions())):t.param==="I"?(a.state.setMode("I"),a.drawing.drawAll()):window.open("deckbuilder.html");return}if(t.actionKey==="MNBT"){if(t.param==="RP")if(a.log.clearAll(),a.state.gs.options.wasDrafting)a.draft.startDraft(!1,!0);else{const r=a.deck.randomStockDeck();a.state.gs.newGame(a.state.gs.options.playerDeck,r.cards)}else t.param==="MM"?(a.state.setMode("M"),a.log.clearAll(),a.drawing.drawAll()):t.param==="LK"?a.deck.loadFromFile().then(r=>{Array.isArray(r)?this.launchConstructed(r):new be().iAmError(r)}):t.param==="GP"?(a.state.toggleOption("fatPacks"),a.drawing.drawAll()):t.param==="LD"?(a.state.toggleOption("legDraft"),a.drawing.drawAll()):t.param==="HH"?(a.state.toggleOption("highHealth"),a.drawing.drawAll()):t.param==="CH"?(a.state.toggleOption("cheater"),a.drawing.drawAll()):t.param==="BB"?(a.state.toggleOption("bark"),a.drawing.drawAll()):t.param==="RU"?window.open("https://github.com/grousewood-games/solforge/blob/main/docs/rules.md#rules"):t.param==="FQ"?window.open("https://github.com/grousewood-games/solforge/blob/main/docs/faq.md#info--faq"):console.error("missing handler for menu button param "+t.param);return}if(t.actionKey==="DSET"){this.ddf5(this.generateDeckPickerActions(parseInt(t.param)));return}if(t.actionKey==="DECK"){let r;if(t.param==="~random~")r=a.deck.randomStockDeck();else{const e=a.deTil(t.param);r=a.deck.stockDeckByName(e[0],e[1])}this.launchConstructed(r.cards);return}}launchConstructed(t){a.state.gs.options.playerDeck=t;const r=a.deck.randomStockDeck();a.state.setMode("G"),a.state.gs.newGame(t,r.cards)}ddf5(t){let r;if(t){const e=this.generateDetailActions();r=t.concat(e),this.actionHistory.push(r)}else r=this.actionHistory[this.actionHistory.length-1];a.state.gs.aiActive?a.ai.processAction(r):a.drawing.drawAll()}currPlayHandAction;get cardBeingPlayed(){if(this.currPlayHandAction)return this.currPlayHandAction;throw new Error("Attempted to read current card being played, nothing exists")}actionHistory=[];get activeActions(){const t=this.actionHistory.length;return t===0?[]:this.actionHistory[t-1]}actionDone(t=!1){this.currPlayHandAction=void 0,this.actionHistory=[],a.clickers.removeAll(),a.drawing.drawActions([]),t?a.batch.triggerDone():a.phase.whatNext()}playCardSelect(t){this.currPlayHandAction=t;const r=this.getPlayCardActions(t);this.ddf5(r)}getPlayCardActions(t){if(t.actionKey!=="HPLY")throw new Error("Unexpected action passed to getPlayCardActions: "+t.actionKey);const e=a.cards.getCard(t.card).playTargets();a.state.getRegularPlays()>0&&e.push(a.target.buttonTarget("HDSC",t.card));const s=a.target.toActions(e);return s.push(d.handSelectAction("CANC",t.card,"",t.position)),s}mobilitySelect(t){const r=this.getMoveCardActions(t);this.ddf5(r)}getMoveCardActions(t){if(t.actionKey!=="MOVE")throw new Error("Unexpected action passed to getMoveCardActions: "+t.actionKey);const r=a.field.ddf6(t);let e=[];if(t.param==="ACTV"){const s=d.actionTarget("TB","ACTV",r.code,r.id);e=a.target.toActions(s)}return e.push(d.fieldSelectAction("CANC",t.lane,t.playerA)),a.field.canMove(r).map(s=>{const c=d.fieldSelectAction("MEND",s,t.playerA);return c.param=r.id,c}).concat(e)}noneEndTrigger(){return a.target.toActions(a.target.buttonTarget("NOTR"))[0]}cancelAction(){return a.target.toActions(a.target.buttonTarget("CANC"))[0]}emptyAdjacents(t,r=""){const e=r||t.id,s=d.actionTarget("TF","CARD",t.code,e);return s.field="E",s.lanes=t.adjacent,s.player="F",a.target.toActions(s)}generateDetailActions(){const t=a.state.mode;if(a.state.gs.aiActive||t==="M"||t==="C"||t==="I"||t==="X")return[];if(t==="G"){const r=a.state.getLocalPlayer().hand.map((s,c)=>{const u=d.handSelectAction("DEET",s,"",c);return u.param=s,u}),e=a.field.qActiveCreats().map(s=>{const c=d.fieldSelectAction("DEET",s.lane,s.owner);return c.param=s.code,c});return r.concat(e)}else if(t==="D"){const r=a.draft.currentPack.map((s,c)=>{const u=d.draftSelectAction("DEET",c,!0);return u.param=`${s}1`,u}),e=a.draft.picksAsDeck().map((s,c)=>{const u=d.draftSelectAction("DEET",c,!1);return u.param=`${s.card}1`,u});return r.concat(e)}return[]}generateDeckPickerActions(t=-1){const r=Mt.map((e,s)=>({actionKey:"DSET",zone:"N",hostCard:"",param:s.toString()}));if(t>-1){const e=Mt[t],s=e.decks.map(c=>({actionKey:"DECK",zone:"N",hostCard:"",param:a.enTil(e.id,c.name)}));return r.concat(s)}return r}generateInfoActions(){return Mt.map((r,e)=>({actionKey:"MNBT",zone:"N",hostCard:"",param:"MM"}))}generateExitActions(){const t=[{actionKey:"CANC",zone:"N",hostCard:"",param:"EX"},d.menuButtonAction("MM")];this.ddf5(t)}}class Kr{_state=new Be;get gs(){return this._state}resetTurnData(){this.gs.turn=d.freshTurn(),this.gs.firstTurn&&(this.gs.firstTurn=!1,this.gs.turn.regularPlays=1)}clearDetails(){this.gs.ui.detailsMode=!1,a.drawing.clearDetails()}getPlayer(t){return t?this._state.playerA:this._state.playerB}getActivePlayer(){return this.getPlayer(this._state.activePlayer)}ddf9(){return this._state.activePlayer}getLocalPlayer(){return this.getPlayer(this._state.isLocalA)}setPhase(t){this.gs.phase=t}getRegularPlays(){return this.gs.turn.regularPlays}getCardsPlayed(){return this.gs.turn.cardsPlayed}xMode="M";setMode(t){t==="X"&&(this.xMode=this.mode),this.gs.appMode=t,t==="G"?(a.canvases.get("game-ui").clear(),a.drawing.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(a.canvases.get("game-ui").clear(),a.drawing.setBackground("blueface")):t==="M"&&(a.drawing.clearAll(),a.drawing.setBackground("mainmenu"))}cancelExitMode(){this.gs.appMode=this.xMode}get mode(){return this.gs.appMode}writeStorage(t,r){localStorage.setItem(t,r)}readStorage(t){return localStorage.getItem(t)}boolRead(t,r){const e=this.readStorage(t);return e===null?r:e==="Y"}boolWrite(t,r){this.writeStorage(t,r?"Y":"N")}restoreOptions(){const t=this.gs.options;t.bark=this.boolRead("bark",!0),t.cheater=this.boolRead("cheater",!1),t.highHealth=this.boolRead("highHealth",!1),t.fatPacks=this.boolRead("fatPacks",!1),t.legDraft=this.boolRead("legDraft",!1)}toggleOption(t){this.gs.options[t]=!this.gs.options[t],this.boolWrite(t,this.gs.options[t])}setClickMode(t){this.gs.clickMode=t}get clickMode(){return this.gs.clickMode}}class Yr{async drawAll(){a.clickers.removeAll(),a.state.mode==="G"?(await Promise.all([this.drawHand(a.state.getLocalPlayer()),this.drawPlayers(),this.drawField(),this.drawActions(a.action.activeActions)]),a.state.gs.winFlag!==0?await this.drawGameOver():await this.drawCommonButtons(!0,!0,!0)):a.state.mode==="D"?await this.drawDraft(a.action.activeActions):a.state.mode==="C"?await this.drawDeckPick(a.action.activeActions):a.state.mode==="I"?await this.drawInfoMenu():a.state.mode==="X"?await this.drawExit(a.action.activeActions):await this.drawMenu()}async drawGameOver(){await new ie().drawGameOver()}async drawHand(t){await new ye().drawCards(t)}async drawField(){await new re().drawCards()}async drawPlayers(){await new ie().drawAllPlayers()}async drawActions(t){const r=new ti;if(a.state.gs.aiActive)await r.drawActions([]);else{a.canvases.get("effects").clear();const s=new ye,c=new re,u=new ie;await Promise.all([s.drawActions(t),c.drawActions(t),r.drawActions(t),u.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;a.canvases.get("effects").clear(),await new re().drawFight(t)}async drawDraft(t){const r=new ii,e=a.canvases.get("game-ui");e.clear(),a.clickers.removeAll(),await r.drawPack(t,e),await r.drawList(t,e),await this.drawCommonButtons(!1,!0,!1)}async drawMenu(){const t=new si,r=a.canvases.get("game-ui");r.clear(),a.clickers.removeAll(),await t.drawMenu(r)}async drawInfoMenu(){const t=new ai,r=a.canvases.get("game-ui");r.clear(),a.clickers.removeAll(),await t.drawMenu(r)}async drawDeckPick(t){const r=new be,e=a.canvases.get("game-ui");e.clear(),a.clickers.removeAll(),await r.drawSets(t,e),await r.drawList(t,e)}clearDetails(){a.canvases.get("card").clear()}async drawDetails(t){a.canvases.get("card").clear(),await new ri().drawCards(t.param)}async drawCommonButtons(t,r,e){let s=979;const c=723,u=new _r,m=a.canvases.get("game-ui");if(e&&m.clear(),t&&(await u.buttonMaker(m,s,c,"EX"),s-=50),r){const y=a.state.clickMode;y!=="M"&&await u.buttonMaker(m,s,c,y==="I"?"TM":"DM")}}async drawExit(t){const r=a.canvases.get("effects"),e=new Kt;await e.drawButton(r,151,488,t[1],"Quit Game",24,!1),await e.drawButton(r,478,488,t[0],"Resume",52,!1)}setBackground(t){const r="hide";["playmat","blueface","mainmenu"].forEach(e=>{const s=document.getElementById(e);t===e?s.classList.remove(r):s.classList.add(r)})}clearAll(){["card","decklist","effects","field","game-ui","hand","player"].forEach(t=>{a.canvases.get(t).clear()})}}class Ft{paStats;pbStats;constructor(t,r){this.paStats=t,this.pbStats=r}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const r=this.playerStats(t),e=this.playerStats(!t);return Ft.deltafier(r,e)}static deltafier(t,r){const e=Ft.blankStats(!0);return e.creatCount=t.creatCount-r.creatCount,e.creatValue=t.creatValue-r.creatValue,e.threatValue=t.threatValue-r.threatValue,e.playerHealth=t.playerHealth-r.playerHealth,e}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0}}}class Et{guts;constructor(t){this.guts=t}static fromState(){const t=a.field.qActiveCreats(),r=[!0,!1],e=r.map(c=>a.field.laneIdx.map(u=>{const m=t.find(y=>y.owner===c&&y.lane===u);return m?d.evalVectorCreature(m):d.evalVectorEmpty(c,u)})).flat(),s=r.map(c=>{const u=a.player.toPlayer(c),m=d.evalVectorPlayer(c);return m.health=u.health,m});return e.push(...s),new Et(e)}static ddp9(t,r,e,s,c=0){return t/2+c+r/10+(s+e)/3}static creatValueFormula(t){return t.health+Math.max(0,t.attack)+t.bonus+t.regen+t.armor-t.poison}clone(){return new Et(structuredClone(this.guts))}boardStats(){const t=[!0,!1].map(r=>this.guts.filter(e=>e.playerA===r)).map(r=>{const e=Ft.blankStats(r[0].playerA),s=r.filter(c=>c.type==="C");return e.creatCount=s.length,e.playerHealth=r[5].health,e.creatValue=this.creatSum(s,Et.creatValueFormula),e.threatValue=this.creatSum(s,c=>{if(c.defender)return 0;{const u=this.guts[this.findLaneIndex(6-c.lane,!c.playerA)];let m=0;if(u.type==="E"?m=c.attack:c.breakthrough&&(m=c.attack-u.health),m<1)return 0;if(m<6)return m;{let y=!0,A=0,k=5,w=1;const H=5;for(;y;)m>k+H?(A+=w*H,k+=H,w++):(A+=w*(m-k),y=!1);return m+(c.sleeping&&!c.aggressive?A/2:A)}}}),e});return new Ft(t[0],t[1])}weighState(t,r,e){const s=this.boardStats(),c=s.playerStats(!e).playerHealth;if(c<1&&cr(e)).reduce((e,s)=>e+s,0)}findLaneIndex(t,r){return t+(r?-1:4)}findVectorIdx(t){return t.shape==="B"?this.findLaneIndex(t.lane,t.playerA):t.playerA?10:11}getBaseVector(t){return this.guts[this.findVectorIdx(t)]}replaceBaseVector(t){const r=this.findVectorIdx(t);this.guts[r]=t}applyVectors(t){t.forEach(e=>{switch(e.type){case "M":if(e.shape==="B")if(e.destroy)this.replaceBaseVector(d.evalVectorEmpty(e.playerA,e.lane));else{const c=this.getBaseVector(e);if(c.type!=="E"){if(e.moveTo){const u=d.evalVectorEmpty(e.playerA,e.lane);c.lane=e.moveTo,this.replaceBaseVector(c),this.replaceBaseVector(u)}else if(this.applyCreatVector(c,e),e.dirDmg){const u=Math.min(e.dirDmg,c.armor-c.armorDmg);c.armorDmg+=u,c.health-=e.dirDmg-u}}}else{const c=this.getBaseVector(e);c.health+=e.health,e.dirDmg&&(c.health-=e.dirDmg)}break;case "R":const s=d.evalVectorEmpty(e.playerA,e.lane);this.applyCreatVector(s,e),s.type="C",this.replaceBaseVector(s);break;case "P":break;default:console.warn("BoardEval is applying vectors, encountered unexpected vector type:",e)}}),this.guts.filter(e=>e.shape==="B"&&e.health<1).forEach(e=>this.replaceBaseVector(d.evalVectorEmpty(e.playerA,e.lane)))}battleState(t){return t.type==="E"?0:t.defender||t.sleeping&&!t.aggressive?1:2}battleVector(t,r,e,s){const c=[];if(t>0){let u=0;const m=Math.max(e.attack,0);if(r>0){const y=t===2&&e.breakthrough,A=Math.max(Math.min(m,s.armor-s.armorDmg),0);let k=m-A;if(y&&k>s.health&&(u=k-s.health,k=s.health),A>0||k>0){const w=d.ddp1(s.playerA,s.lane);w.health=-k,w.armorDmg=A,c.push(w)}}else t===2&&(u=m);u>0&&c.push(d.evalVectorPlayerLife(s.playerA,-u))}return c}applyCombat(){const t=a.field.laneIdx.map(r=>{const e=this.guts[r-1],s=this.guts[10-r],c=this.battleState(e),u=this.battleState(s);return c===2||u===2?this.battleVector(c,u,e,s).concat(this.battleVector(u,c,s,e)):[]}).flat();this.applyVectors(t)}applyTurnEnd(t,r){const e=!t,s=!r,c=this.guts.filter(u=>u.shape==="B"&&(e||u.playerA===s)&&u.poison>0).map(u=>{const m=u.regen-Math.max(0,u.poison-u.armor),y=d.ddp1(u.playerA,u.lane);return y.health=m,y}).filter(u=>u.health!==0);this.applyVectors(c)}applyCreatVector(t,r){t.health+=r.health,t.attack+=this.doubleOrNossing(t.attack,r.attack),t.armor+=r.armor,t.armorDmg+=r.armorDmg,t.poison+=this.doubleOrNossing(t.poison,r.poison),t.regen+=r.regen,t.aggressive=r.aggressive,t.breakthrough=r.breakthrough,t.defender=r.defender,t.negateDefender=r.negateDefender}doubleOrNossing(t,r){if(r>=Ht&&r0||e.freeCards.length>0)&&(r-=L.Horrid);break;case "NT":break;case "PS":break;case "NO":break;default:console.error("Final type with no weighting switch: "+t.type),r=-2}return r+t.bonus}weighPlacement(t){let r=0;const e=t.action,s=a.field.searchByFSA(e),c=a.field.searchByLane(a.field.oppositeLane(e.lane),!e.playerA),u=t.hints.includes("RD");if(s){const y=s.aiHints().includes("RT");y&&u?(this.logHint("Replacement Supercombo - Upgrade and Happy Replace"),r+=L.Grand):y?(this.logHint("Likes being replaced"),r+=L.Noice):u?(this.logHint("Upgrade"),r+=L.Noice):t.hints.includes("RE")||(a.state.gs.turn.mainBattle?r+=L.Bad:r+=L.Never)}else u&&(this.logHint("Upgrade ignored"),r+=L.Bad);return r+=this.weighOpposition(t,c),r+=this.weighLanePlacement(t,e.lane,e.playerA),t.hints.includes("SD")&&(r+=this.weighSacrificeDemand(t)),r}weighStatChange(t){let r=0;return t.hints.includes("SD")&&(r+=this.weighSacrificeDemand(t)),r}weighDestroy(t){let r=0;const e=t.action;return a.field.ddf6(e).owner===this.aiPlayer?t.hints.includes("ST")?(this.logHint("Good sacrifice"),r+=L.Noice):r+=L.Horrid:r+=L.Noice,r}weighDmg(t){return 0}weighDiscard(t){let r=0,e;t.action.actionKey==="HDSC"?(a.state.gs.turn.mainBattle||(r+=L.Horrid),e=t.action.hostCard):(r+=L.Noice,e=t.action.card);const c=a.cards.getCard(e).aiHints();return c.includes("LV")?(this.logHint("Good card to level"),r+=L.Noice):c.includes("DL")&&(this.logHint("Bad card to level"),r+=L.Horrid),r}weighMove(t){let r=0;const e=t.action,s=a.field.jr5(e.param),c=s.owner===this.aiPlayer?1:-1,u=this.weighLanePlacement(t,s.lane,s.owner),y=this.weighLanePlacement(t,e.lane,s.owner)-u,A=a.field.searchByLane(a.field.oppositeLane(s.lane),!s.owner),k=this.weighOpposition(t,A),w=a.field.searchByLane(a.field.oppositeLane(e.lane),!s.owner),V=this.weighOpposition(t,w)-k;let tt=0;w&&(t.hints.includes("FH")?tt=L.Noice:t.hints.includes("FK")&&a.target.levelTestCommon(w.level,s.level)&&(tt=L.Grand*2));const ht=(y+V+tt)*c;return r+ht}weighLanePlacement(t,r,e){let s=0;const c=t.hints.includes("NX"),u=t.hints.includes("SL"),m=t.hints.includes("LJ");if(c?r===3?(this.logHint("Nexus"),s+=L.Noice):(this.logHint("Nexus ignored"),s+=L.Bad):u&&(r===1||r===5?(this.logHint("Sidelane"),s+=L.Noice):(this.logHint("Sidelane ignored"),s+=L.Bad)),m){const y=d.crTarg();y.player=a.player.toTarget(e),y.lanes=a.field.adjacentPositions(r);const A=a.field.creatByTarget(y).length;s+=L.Noice*A}return s}weighOpposition(t,r){let e=0;const s=t.hints.includes("OL"),c=t.hints.includes("OP");if(r){const u=r.aiHints(),m=u.includes("OL"),y=u.includes("OP");c?m?(this.logHint("Likes opposition, enemy hates it"),e+=L.Grand):y||(this.logHint("Likes opposition"),e+=L.Noice):s&&(y?(this.logHint("Hates opposition, enemy loves it"),e+=L.Horrid):m||(this.logHint("Hates opposition"),e+=L.Bad))}else c?(this.logHint("Hates open lane"),e+=L.Bad):s&&(this.logHint("Loves open lane"),e+=L.Grand);return e}weighSacrificeDemand(t){let r=L.Never;const e=s=>{r{s.hints.includes("ST")?e(L.Grand*2):Et.ddp9(1,Et.creatValueFormula(s),s.attack,0)<2?e(L.Grand):e(L.Horrid)}),r}logHint(t){}logHintStarter(t,r){this.logHint(`Eval start - ${a.log.actionText(t)} / ${r}`)}}class Xr{logChains=!1;aiPlayer=!1;actEval=new qr(this.aiPlayer);whiffActions=["CANC","DEET","SCRH"];committedVectors=[];evaluateActions(t,r=""){const e=t.filter(s=>this.whiffActions.indexOf(s.actionKey)===-1);return e.forEach(s=>{switch(s.actionKey){case "ACTV":case "CARD":const c=a.cards.getCard(s.hostCard),u=c.ddf7(s);if(u.final)s.evals=[[u]];else{const it=c.getCardActions(s);s.evals=this.evalSmoosh(this.evaluateActions(it,r+"--"),u)}break;case "FORG":const m=s,y=d.ddp4(s,m.playerA,m.lane,m.hostCard,!0);s.evals=[[y]];break;case "HDSC":s.evals=[[d.actionEval(s,"DC")]];break;case "HPLY":const A=s,k=ut.extractCardCode(A.card);if(k==="MTS"||k==="MTT")s.evals=[[d.actionEval(s,"NR")]];else{const it=a.action.getPlayCardActions(A);s.evals=this.evalSmoosh(this.evaluateActions(it))}break;case "MEND":const w=d.actionEval(s,"MC"),H=a.field.jr5(s.param),V=s;w.hints=H.aiHints();const tt=d.ddp1(H.owner,H.lane);tt.moveTo=V.lane,w.vectors.push(tt),s.evals=[[w]];break;case "MOVE":const ht=a.action.getMoveCardActions(s);s.evals=this.evalSmoosh(this.evaluateActions(ht));break;case "NOTR":s.evals=[[d.actionEval(s,"NO")]];break;case "FITE":s.evals=[[d.actionEval(s,"FT")]];break;case "ENDT":s.evals=[[d.actionEval(s,"DT")]];break;default:s.evals=[],console.error("Encountered action that AI could not evaluate:",s)}}),e}evalSmoosh(t,r){const e=t.map(s=>s.evals||[]).flat();return r?e.map(s=>[r,...s]):e}processAction(t){const r=this.evaluateActions(t),e=Et.fromState(),s=e.boardStats();let c=-9999;const m=r.map(A=>{let k=-9999;return A.evals?.forEach(w=>{let H=0;w.forEach(Bt=>{const qt=this.actEval.weighEval(Bt);H+=qt});const V=e.clone(),tt=w.map(Bt=>Bt.vectors).flat();V.applyVectors(tt);const ht=V.boardStats(),it=!a.state.gs.turn.mainBattle;it&&V.applyCombat(),V.applyTurnEnd(it,this.aiPlayer);const $t=V.weighState(s,ht,this.aiPlayer);H=Math.round((H+$t.formula)*2)/2,H>k&&(k=H)}),k>c&&(c=k),{action:A,weight:k}}).filter(A=>A.weight===c),y=m[a.randInt(0,m.length)].action;a.sleep(500).then(()=>{a.action.handleAction(y)})}logChain(t){}alliedHint(t){if(t==="A")return "ALA";if(t==="N")return "ALN";if(t==="T")return "ALT";if(t==="U")return "ALU";throw new Error("non faction passed to allied hint")}jr7(t,r=3){return`${t}${r}`}jr6(t,r){const e=a.randInt(0,r.length),s=r[e];return r.splice(e,1),a.field.birthCreature(t,"F",this.aiPlayer,s)}cheater(){const t=a.state.gs;if(!(t.aiMode&&t.aiActive&&t.options.cheater))return!1;const r=a.player.toPlayer(this.aiPlayer),e=a.player.toPlayer(!this.aiPlayer),s=e.health-r.health;let c=0;s>85?c=3:s>65?c=2:s>45&&(c=1);const u=a.field.emptyLanes(this.aiPlayer);if(c===0||u.length===0)return!1;a.log.new().plr(this.aiPlayer).txt(" is a cheaty cheaterton.").go();let m=0;if(c===1){if(t.turn.regularPlays-=1,m=a.randInt(0,13),m===0)this.jr6(this.jr7("HTR"),u);else if(m===1)this.jr6(this.jr7("AGM"),u).addRegen(8);else if(m===2){const y=this.jr6(this.jr7("YNS"),u);y.buff(0,15),y.addRegen(4)}else if(m===3)this.jr6(this.jr7("TBA"),u);else if(m===4)this.jr6(this.jr7("DCS"),u);else if(m===5)this.jr6(this.jr7("GGP"),u).addRegen(8);else if(m===6){const y=this.jr6(this.jr7("WFM"),u);y.aggressive=!0}else if(m===7){const y=this.jr6(this.jr7("FFU"),u);y.aggressive=!0}else if(m===8){const y=this.jr6(this.jr7("URB"),u);y.aggressive=!0}else if(m===9){const y=this.jr6(this.jr7("KOD"),u);y.aggressive=!0,y.addRegen(6)}else if(m===10)this.jr6(this.jr7("AGK"),u).addArmor(3);else if(m===11){const y=this.jr6(this.jr7("PSC"),u);y.aggressive=!0}else if(m===12){const y=this.jr6(this.jr7("SAD"),u);y.aggressive=!0}}else if(c===2)if(t.turn.regularPlays-=1,m=a.randInt(0,17),m===0){const y=this.jr6(this.jr7("NDR"),u);y.aggressive=!0}else if(m===1){const y=this.jr6(this.jr7("CSW"),u);y.aggressive=!0}else if(m===2)this.jr6(this.jr7("GGD"),u).addRegen(6);else if(m===3)this.jr6(this.jr7("EFP"),u);else if(m===4)this.jr6(this.jr7("ZTU"),u);else if(m===5){const y=this.jr6(this.jr7("DDD"),u);y.aggressive=!0}else if(m===6)this.jr6(this.jr7("RBH"),u).addRegen(8);else if(m===7)this.jr6(this.jr7("SFT"),u);else if(m===8)this.jr6(this.jr7("GTT"),u);else if(m===9)this.jr6(this.jr7("SMD"),u);else if(u.length===5)this.jr6(this.jr7("DFB"),u),[1,2,3,4].forEach(y=>this.jr6(this.jr7("XHS"),u));else if(u.length===4)this.jr6(this.jr7("LMV"),u);else if(u.length===3)this.jr6(this.jr7("LHY"),u),this.jr6(this.jr7("SVH"),u),this.jr6(this.jr7("DBA"),u);else if(u.length===2)this.jr6(this.jr7("UTR"),u),this.jr6(this.jr7("TDS"),u);else if(r.turn===4)this.jr6(this.jr7("SSR"),u);else if(r.turn===1)this.jr6(this.jr7("ESK"),u);else{const y=this.jr6(this.jr7("XSH"),u);y.aggressive=!0}else if(c===3)if(m=a.randInt(0,20),m===0){const y=this.jr6(this.jr7("IHA",4),u);y.aggressive=!0}else if(m===1)this.jr6(this.jr7("CHR"),u);else if(m===2)this.jr6(this.jr7("FGO",1),u);else if(m===3)this.jr6(this.jr7("CHV",4),u);else if(m===4)this.jr6(this.jr7("KKK",4),u);else if(r.health<20){const y=this.jr6(this.jr7("ODC",4),u);y.aggressive=!0}else if(u.length===5){const y=a.randInt(0,4);if(y===0)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("UWL",2),u));else if(y===1)[1,2].forEach(A=>this.jr6(this.jr7("DFB"),u)),[1,2,3].forEach(A=>this.jr6(this.jr7("FFD"),u));else if(y===2)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("BWK"),u));else if(y===3){this.jr6(this.jr7("SBG"),u),this.jr6(this.jr7("EWE"),u);const A=this.jr6(this.jr7("BMY"),u);A.defender=!0,A.aggressive=!0}}else if(e.health>350)r.health<180&&a.player.healPlayer(r,180-r.health),this.jr6(this.jr7("AGD"),u);else if(e.health>250)this.jr6(this.jr7("FGO"),u);else if(u.length===4){const y=a.randInt(0,3);y===0?(this.jr6(this.jr7("AGK"),u),[1,2,3].forEach(A=>this.jr6(this.jr7("VBK"),u))):y===1?(this.jr6(this.jr7("TDS"),u),this.jr6(this.jr7("TDS"),u),this.jr6(this.jr7("UTR"),u)):y===2&&[1,2,3,4].forEach(A=>this.jr6(this.jr7("CDC"),u))}else if(u.length===3)if(a.randInt(0,2)){this.jr6(this.jr7("SDR"),u),this.jr6(this.jr7("SDR"),u);const y=this.jr6(this.jr7("UPM"),u);y.aggressive=!0}else{this.jr6(this.jr7("SDL"),u);const y=this.jr6(this.jr7("NFF"),u);y.aggressive=!0}else if(u.length===2)this.jr6(this.jr7("SPM"),u),this.jr6(this.jr7("SPM"),u);else{const y=this.jr6(this.jr7("NXC"),u);y.buff(10,0),y.aggressive=!0,y.addMobility(2),y.addRegen(5)}return r.health<30&&a.player.healPlayer(r,50-r.health),!0}}class jr{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const r=a.state.getPlayer(t).deck;this.shuffle(r)}shuffle(t){const r=t.length,e=(s,c)=>{const u=t[s];t[s]=t[c],t[c]=u};if(r>0){let s,c;for(let u=0;ue.decks).flat(),r=a.randInt(0,t.length);return t[r]}stockDeckByName(t,r){let e;if(Mt.some(s=>s.id===t?s.decks.some(c=>{c.name===r&&(e=c)}):!1),e)return e;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+r)}ripper(t,r,e){const s=[[15,8,5],[30,15,10]],c=this.getDeckCards([],[t]),u=[],m=s[e===15?0:1][r-1];for(;u.lengthw===k)||u.push(k)}const y=u.map(A=>({card:A,num:r}));return r===2&&e===15&&(y[0].num=1),y}deckify(t){const r=t.map(e=>{const s=ke.find(c=>c[0]===e);return s?s[1]:[]}).flat();return t.concat(r).map(e=>`${e}1`)}parseDeck(t){const r=t.map(e=>Array(e.num).fill(e.card)).flat();return this.deckify(r)}validDeck(t){const r={};t.forEach(A=>{r[A.card]?r[A.card]+=A.num:r[A.card]=A.num});const e=Object.entries(r).map(A=>({card:A[0],num:A[1]})),s=e.map(A=>A.num).reduce((A,k)=>A+k,0);if(s!==30)return"Deck must have 30 cards, found "+s;const c=[];let u="";if(e.some(A=>{const k=xt.findIndex(w=>w.crd===A.card);return k===-1?(u=A.card,!0):(c.push(xt[k].fct),!1)}))return`Invalid card code: '${u}'`;let m=0;if(e.some(A=>A.num>3?(u=A.card,m=A.num,!0):!1))return`${m} copies of '${u}' ${a.log.fastName(u)}`;const y=[...new Set(c)];return y.length>2?"Deck must have two or less factions, found: "+y.join():""}getDeckCards(t=[],r=[]){return t.length===0&&r.length===0?xt.map(e=>e.crd):t.length>0&&r.length>0?xt.filter(e=>t.includes(e.rty)&&r.includes(e.fct)).map(e=>e.crd):t.length>0?xt.filter(e=>t.includes(e.rty)).map(e=>e.crd):xt.filter(e=>r.includes(e.fct)).map(e=>e.crd)}getCardFaction(t){const r=xt.find(e=>e.crd===t);return r?r.fct:"X"}getCardRarity(t){const r=xt.find(e=>e.crd===t);return r?r.rty:"T"}cardStats(){se.forEach(t=>{const r=`${a.log.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,e=jt.map(s=>`${a.log.rarityText(s)}: ${this.getDeckCards([s],[t]).length}`).join("; ");console.log(r+e)})}loadPromise=new ue;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new ue,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 r=t.cards,e=this.validDeck(r);return e||r}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const r=this.loader.files;if(r&&r.length>0){const s=r[0];var e=new FileReader;e.onload=c=>{try{var u=e.result;if(u){var m=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(u)));m.cards&&Array.isArray(m.cards)&&!m.cards.some(y=>!(y&&typeof y.card=="string"&&Number.isInteger(y.num)))?(this.fileguts=JSON.stringify(m),this.loadPromise.resolveMe()):this.readError("File format is incorrect.")}else this.readError("File read was empty.")}catch(y){console.error(y),this.readError("Error occurred while reading file.")}};try{e.readAsArrayBuffer(s)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}class ue{realPromise;resolveMe(){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,r)=>{this.resolveMe=t,this.rejectMe=r})}}class Jr{rarityCache={["L"]:[],["H"]:[],["R"]:[],["C"]:[],["T"]:[]};faction1="X";faction2="X";factionLock=!1;picks=[];currentPack=[];paginating=!1;aiPicking=!1;packOdds=[];legMode=!1;startDraft(t,r){!t&&r?this.startDraft(!0,!1):(t||(a.state.gs.options.playerDeck=[]),this.aiPicking=t,this.legMode=a.state.gs.options.legDraft,this.paginating=!1,this.packOdds=a.state.gs.options.fatPacks?[9,31,40]:[5,25,40],jt.forEach(e=>{this.rarityCache[e]=a.deck.getDeckCards([e])}),this.faction1="X",this.faction2="X",this.factionLock=!1,this.picks=[],this.resumeDraft(""))}resumeDraft(t){if(t){if(this.picks.push(t),this.picks.length===30){let s=this.picksAsDeck();this.aiPicking?a.state.gs.options.playerDeck.length>0&&(a.state.setMode("G"),a.state.gs.newGame(a.state.gs.options.playerDeck,this.picksAsDeck())):(this.startDraft(!0,!1),a.state.gs.options.playerDeck=s,a.state.setMode("G"),a.state.gs.newGame(s,this.picksAsDeck()));return}if(!this.factionLock){const s=a.deck.getCardFaction(t);this.faction1==="X"?this.faction1=s:s!==this.faction1&&(this.faction2=s,this.factionLock=!0,jt.forEach(c=>{this.rarityCache[c]=a.deck.getDeckCards([c],[this.faction1,this.faction2])}))}}const r=this.generatePack().slice(-1*(6-this.picks.length%5)),e=this.fillPack(r);if(this.aiPicking)this.resumeDraft(e[e.length-1]);else{this.currentPack=e;const s=e.map((c,u)=>{const m=d.draftSelectAction("DRFT",u,!0);return m.param=c,m});a.action.ddf5(s)}}picksAsDeck(){const t=[];return this.picks.forEach(r=>{const e=t.findIndex(s=>s.card===r);e===-1?t.push({card:r,num:1}):t[e].num+=1}),t.sort((r,e)=>{const s=a.cards.getCard(r.card+"1"),c=a.cards.getCard(e.card+"1");return s.name.toLowerCase(){const s=this.rarityCache[e].length;let c=!0;for(;c;){const u=this.rarityCache[e][a.randInt(0,s)];r.includes(u)||(r.push(u),c=!1)}}),r}}class fe{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,r,e){this.context.drawImage(t,r,e)}}class Qr{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new fe(t)}get(t){return this.registry[t]}}class ot{getCanv(t){return t instanceof fe?t:a.canvases.get(t)}async drawSprite(t,r,e,s,c={}){const u=this.getCanv(t).context,m=await a.getSprite(a.imgRoot+r);let y=1;c&&(y=c.alpha??1),y<1&&(u.globalAlpha=y),u.drawImage(m,e,s,m.naturalWidth,m.naturalHeight),y<1&&(u.globalAlpha=1)}async drawText(t,r,e,s,c={}){const u=this.getCanv(t).context;u.fillStyle=c.colour||"#000000",u.font=`${c.fontSize??24}px ${c.fontName||"cinzel"}`,u.shadowColor=c.shadow?"#000000":"#00000000",u.fillText(r,e,s),u.shadowColor="#00000000"}async drawHighlight(t,r,e,s,c,u="#00FF00"){const m=u.length===7?u.concat("aa"):u,y=this.getCanv(t);y.context.strokeStyle=m,y.context.beginPath(),y.context.rect(r,e,s,c),y.context.stroke()}hlColour(t){return t==="CANC"?"#FF0000":"#00FF00"}drawRarity(t,r,e,s){return this.drawSprite(t,`icons/rarity/new/${a.log.rarityText(r).toLowerCase()}.png`,e,s)}drawFaction(t,r,e,s){const c=r==="T"?2:0;return this.drawSprite(t,`icons/faction/${a.log.factionText(r).toLowerCase()}.png`,e+c,s+3)}}class Kt extends ot{async drawButton(t,r,e,s,c,u=7,m=!1){let y,A;m?(y="ui/button/menu_on.png",A="#d7fc03"):(y="ui/button/menu_off.png",A="#00DEF7");const k=this.buttonBounds(r,e);await this.drawSprite(t,y,k[0],k[1]),await this.drawText(t,c,k[0]+7+u,k[1]+24,{colour:A,fontSize:30});const w=new O(s,...k,st.Both);a.clickers.add(w)}buttonBounds(t,r){return[t-7,r-7,232,69]}}class _r extends ot{async buttonMaker(t,r,e,s){let u;u=`ui/button/ui_${s}.png`,await this.drawSprite(t,u,r,e);const m={actionKey:"UIBT",zone:"N",hostCard:"",param:s},y=new O(m,r,e,40,40,st.Both);a.clickers.add(y)}}class ti extends ot{async drawActions(t){const r=a.canvases.get("effects"),e=t.filter(s=>s.zone==="B");if(e.length>1&&console.error("Two button actions encountered in one batch",e),e.length===0){const s=this.buttonBounds();await this.drawSprite(r,"ui/button/off.png",s[0],s[1])}else{const s=e[0],c=this.buttonBounds();await this.drawSprite(r,"ui/button/on.png",c[0],c[1]);const m={["HDSC"]:{s:"Discard",x:22},["ENDT"]:{s:"Done",x:41},["FITE"]:{s:"Fight",x:42},["NOTR"]:{s:"None",x:41},["ACTV"]:{s:"Activ8",x:33},["CANC"]:{s:"Cancel",x:28}}[s.actionKey]??{s:"???",x:60};if(await this.drawText(r,m.s,c[0]+m.x,c[1]+21,{colour:"#00ff00",fontSize:26}),a.state.clickMode!=="I"){const y=this.highlightBounds(),A=new O(s,...y);a.clickers.add(A)}}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),r=5,e=[-1,-1,2,2];return t.map((s,c)=>s+r*e[c])}}const ge={colour:"#ffd865",fontSize:18,fontName:"serif"},ei={colour:"#0f300f",fontSize:18,fontName:"serif"};class Lt extends ot{async drawCard(t,r,e,s){const c=this.getCanv(r);let u,m=!1,y=0,A=0,k=!1,w=0,H=!1,V=!1,tt=!1,ht=!1,it=0,$t=0,Bt=0,qt=!1;if(!(t instanceof ut))m=!0,y=t.attack,A=t.health,k=t.sleeping&&!t.aggressive,w=t.regen,H=t.breakthrough,V=t.defender,tt=t.aggressive,it=t.armor,$t=t.poison,Bt=t.mobility,ht=t.changed,u=a.cards.getCard(t.code);else{if(t.type==="C"){m=!0;const nt=t;y=nt.jr1,A=nt.jr2,w=nt.initRegen,H=nt.initBT,V=nt.initDefend,tt=nt.initAggro,it=nt.initArmor,Bt=nt.initMobile}qt=t.overload,u=t}if(await this.drawSprite(c,u.image,e+14,s+35),await this.drawSprite(c,this.frameImg(u.level,u.faction,u.type),e,s),await this.drawSprite(c,`text/card/${u.cardCode()}.png`,e+12,s+16),m){const nt=s+177,Xt=e+15,ae=e+119,ve=this.statFormat(y);await this.drawText(c,ve[0],Xt+(ve[1]?4:0),nt,ge);const Ae=this.statFormat(A);await this.drawText(c,Ae[0],ae+(Ae[1]?4:0),nt,ge)}k&&await this.drawSprite(c,"icons/effects/defensive.png",e+5,s+40,{alpha:.7});const lt=[];if(qt&<.push(["overload",0]),w>0&<.push(["regenerate",w]),H&<.push(["breakthrough",0]),V&<.push(["defender",0]),tt&<.push(["aggressive",0]),it>0&<.push(["armor",it]),$t>0&<.push(["poison",$t]),Bt>0&<.push(["mobility",Bt]),ht&<.push(["changed",0]),lt.length>0){const nt=e+54-17*(lt.length-1);await Promise.all(lt.map(async(Xt,ae)=>this.drawIcon(c,nt+ae*35,s+140,Xt[0],Xt[1])))}}async drawIcon(t,r,e,s,c=0){const u=this.getCanv(t);if(await this.drawSprite(u,`icons/effects/${s}.png`,r,e),c>0){const m=this.statFormat(c);await this.drawText(u,m[0],r+(m[1]?12:7),e+8,ei)}}async drawHilight(t,r,e,s="#00FF00"){await super.drawHighlight(t,...this.highlightBounds(r,e),s)}cardBounds(t,r){return[t,r,150,205]}highlightBounds(t,r){const e=this.cardBounds(t,r),s=5,c=[-1,-1,2,2];return e.map((u,m)=>u+s*c[m])}frameImg(t,r,e){return`frames/small/lvl${t}_${r}${e}.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`}statFormat(t){const r=t.toString();return[r,r.length===1]}}const me=30,Yt=540,pe=5;class ye extends ot{async drawCards(t){const r=a.canvases.get("hand");r.clear();const e=new Lt,s=e.highlightBounds(0,0)[2]+pe;let c=me;const u=this.paginatron(t);for(let m=u[0];m<=u[1];m++){const y=a.cards.getCard(t.hand[m]);await e.drawCard(y,r,c,Yt),c+=s}}async drawActions(t){const r=a.state.clickMode!=="I",e=a.state.clickMode!=="T",s=a.canvases.get("effects"),c=new Lt,u=c.highlightBounds(0,0)[2]+pe,m=new wt(0,520,1e3,250),y=new wt(0,520,1e3,250,st.Right),A=this.paginatron(a.state.getActivePlayer());await Promise.all(t.filter(k=>k.zone==="H").map(async k=>{const w=k;if(w.position>=A[0]&&w.position<=A[1]){const H=me+(w.position-A[0])*u;if(e&&k.actionKey==="DEET"){const V=new O(k,...c.highlightBounds(H,Yt),st.Right);y.addChild(V)}else if(r&&k.actionKey!=="DEET"){const V=new O(k,...c.highlightBounds(H,Yt));m.addChild(V),await c.drawHilight(s,H,Yt,this.hlColour(w.actionKey))}}})),r&&a.clickers.add(m),e&&a.clickers.add(y),A[0]>0&&await this.makeScroller(s,!1),A[1]0&&t.hand.length-r<5&&(r=Math.max(0,t.hand.length-5),a.state.gs.ui.handScrollLeft=r),[r,Math.min(r+4,t.hand.length-1),t.hand.length-1]}scrollHilightBounds(t,r){return[t-3,r-2,27,38]}async makeScroller(t,r){const e=r?894:856,s=726,c=this.scrollHilightBounds(e,s);await this.drawSprite(t,`ui/arrow/${r?"right":"left"}.png`,e,s),await this.drawHighlight(t,...c);const u={zone:"N",actionKey:"SCRH",hostCard:"",param:r?"R":"L"},m=new O(u,...c,st.Both);a.clickers.add(m)}}class re extends ot{fieldBoundary=[17,62,821,443];async drawCards(t){const r=a.state.gs.isLocalA,e=a.canvases.get("field");e.clear();const s=new Lt,c=a.field.qActiveCreats().map(u=>{let m=0;t&&t.scrappers.some(A=>A[0]===u.lane&&A[1]===u.owner)&&(m=t.battlePhase);const y=this.coordCalc(u.lane,u.owner,r,m);return s.drawCard(u,e,...y)});if(await Promise.all(c),a.batch.iaTrigLane>0){const u=this.coordCalc(a.batch.iaTrigLane,a.state.ddf9(),r),m=s.cardBounds(...u);await this.drawSprite(e,"icons/rewards/gold.png",m[0]+m[2]/2-20,m[1]+m[3]+7)}}async drawActions(t){const r=a.state.clickMode!=="I",e=a.state.clickMode!=="T",s=a.state.gs.isLocalA,c=a.canvases.get("effects"),u=new Lt,m=new wt(...this.fieldBoundary),y=new wt(...this.fieldBoundary,st.Right);await Promise.all(t.filter(A=>A.zone==="F"||A.zone==="R").map(async A=>{if(A.zone==="R"&&r){const k=new O(A,...this.fieldBoundary);a.clickers.add(k),await this.drawHighlight(c,...this.fieldBoundary)}else{const k=A,w=this.coordCalc(k.lane,k.playerA,s);if(e&&A.actionKey==="DEET"){const H=new O(A,...u.highlightBounds(...w),st.Right);y.addChild(H)}else if(r&&A.actionKey!=="DEET"){const H=new O(A,...u.highlightBounds(...w));m.addChild(H),await u.drawHilight(c,...w,this.hlColour(k.actionKey))}}})),r&&m.childs.length>0&&a.clickers.add(m),e&&y.childs.length>0&&a.clickers.add(y)}async drawFight(t){if(t.length>0){const r={battlePhase:1,scrappers:t},e=72;await this.drawCards(r),await a.sleep(e),r.battlePhase=2,await this.drawCards(r),await a.sleep(e),r.battlePhase=3,await this.drawCards(r),await a.sleep(e),r.battlePhase=4,await this.drawCards(r),await a.sleep(e+70),r.battlePhase=3,await this.drawCards(r),await a.sleep(e),r.battlePhase=2,await this.drawCards(r),await a.sleep(e),r.battlePhase=1,await this.drawCards(r),await a.sleep(e)}}coordCalc(t,r,e,s=0){const c=e===r,u=166,m=5;let y,A,k;return[y,k,A]=c?[22,290,1]:[687,65,-1],[y+(t-1)*u*A,k+s*m*(-1*A)]}}class ie extends ot{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,r,e,s){const c=this.getCanv(r);await this.drawSprite(c,`avatar/${this.avatars[t.avatar]}.jpg`,e+46,s+48),await this.drawSprite(c,"ui/player_frame.png",e,s),await this.drawSprite(c,"ui/player_health.png",e+10,s+102);let u;t.health>99||t.health<-9?u=26:t.health>9||t.health<0?u=33:u=39,await this.drawText(c,t.health.toString(),e+u,s+147,{colour:"#00FF00",fontName:"serif"}),await this.drawText(c,`Turn: ${t.turn.toString()} Rank: ${t.rank.toString()}`,e+25,s+210,{colour:"#f5f242",fontSize:20}),await this.drawText(c,t.name,e+t.nameOffset,s+185,{colour:"#42a4f5",fontSize:20})}async drawAllPlayers(){const t=a.canvases.get("player");t.clear();const r=a.state.getLocalPlayer(),e=a.state.getPlayer(!r.isPlayerA);if(await this.drawPlayer(r,t,...this.playerOrigin(!0)),await this.drawPlayer(e,t,...this.playerOrigin(!1)),r.isPlayerA===a.state.ddf9()){let s=862;const c=350,u=a.state.getRegularPlays(),m=a.state.gs.turn.freeCards.length,y=Array(u).fill("blue").concat(Array(m).fill("green")),A=[];y.forEach(k=>{A.push(this.drawSprite(t,`ui/${k}card.png`,s,c)),s+=30}),await Promise.all(A)}}async drawActions(t){if(a.state.clickMode==="I")return;const r=a.canvases.get("effects"),e=a.state.gs.isLocalA;await Promise.all(t.filter(s=>s.zone==="P").map(s=>{const c=s,u=this.playerOrigin(c.playerA===e),m=this.highlightBounds(...u),y=new O(s,...m);return a.clickers.add(y),this.drawHighlight(r,...m)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,r){return[t+18,r+18,170,170]}highlightBounds(t,r){return this.playerBounds(t,r)}async drawGameOver(){const t=a.canvases.get("field"),r=a.state.gs.isLocalA,e=a.state.gs.winFlag,s=r&&e===1||!r&&e===-1;await this.drawSprite(t,`ui/you-${s?"win":"lose"}.png`,89,89),a.clickers.removeAll();const c=new Kt,u=a.canvases.get("effects");await c.drawButton(u,151,520,d.menuButtonAction("MM"),"Main Menu",20,!1),await c.drawButton(u,478,520,d.menuButtonAction("RP"),"Replay",55,!1)}}class ri extends ot{async drawCards(t){const r=a.canvases.get("card");r.clear(),r.context.fillStyle="#222222cc",r.context.fillRect(0,0,a.gameWidth,a.gameHeight);const e=typeof t=="string"?a.cards.getCard(t):t;let s;if(e.rarity==="T")s=[e];else{const A=e.maxLevel,k=ut.extractCardCode(e.code);s=a.field.laneIdx.filter(w=>w<=A).map(w=>w===e.level?e:a.cards.getCard(`${k}${w}`))}const c=new Lt;let u=3;const m=s.length,y=m===4;u0;){let ht;if(V.lengtha.log.tribeText(r)).join(" "):""}}class ii extends ot{async drawPack(t,r){const e=new Lt,s=a.state.clickMode!=="I",c=a.state.clickMode!=="T",u=[],m=new wt(...this.packBoundary),y=new wt(...this.packBoundary,st.Right);t.filter(k=>k.pack).forEach(k=>{const w=this.coordCalcPack(k.index);if(k.actionKey==="DRFT"){const H=a.cards.getCard(k.param+"1");if(u.push(e.drawCard(H,r,...w).then(()=>this.drawRarity(r,H.rarity,w[0]+112,w[1]+4))),s){const V=new O(k,...e.highlightBounds(...w));m.addChild(V)}}else if(c){const H=new O(k,...e.highlightBounds(...w),st.Right);y.addChild(H)}}),s&&m.childs.length>0&&a.clickers.add(m),c&&y.childs.length>0&&a.clickers.add(y),await Promise.all(u)}async drawList(t,r){let e=170;const s=570,c=[],u=a.draft.picksAsDeck(),m=new wt(s,e,600,600,st.Both),y=t,A=15,k=a.draft.paginating;u.length>A&&await this.makeScroller(r,k),y.filter(w=>!w.pack).forEach(w=>{if(k===w.index>=A){const H=a.cards.getCard(w.param+"1");c.push(this.drawFaction(r,H.faction,s,e),this.drawRarity(r,H.rarity,s+28,e),this.drawText(r,`${u[w.index].num}x ${H.name}`,s+65,e+7,{colour:"#f5f242"}));const V=new O(w,s,e-2,600,35,st.Both);m.addChild(V),e+=35}}),await Promise.all(c),a.clickers.add(m)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,c=Math.floor(t/3);return[22+s*176,200+c*235]}scrollHilightBounds(t,r){return[t-5,r-5,26,26]}async makeScroller(t,r){const c=this.scrollHilightBounds(530,720);await this.drawSprite(t,`ui/arrow/${r?"up":"down"}.png`,530,720);const u={zone:"N",actionKey:"SCRD",hostCard:"",param:r?"U":"D"},m=new O(u,...c,st.Both);a.clickers.add(m)}}class be extends ot{async drawSets(t,r){let e=200;const s=100,c=[],u=new wt(s,e,400,600);t.filter(k=>k.actionKey==="DSET").forEach(k=>{const w=Mt[parseInt(k.param)];c.push(this.drawText(r,w.name,s,e,{colour:"#f5f242"}),this.drawSprite(r,"icons/chest_small.png",s-48,e-5));const H=new O(k,s,e-2,400,35);u.addChild(H),e+=45}),c.push(this.drawText(r,"Random Deck",s,e,{colour:"#f5f242"}),this.drawSprite(r,"icons/chest_small.png",s-48,e-5));const m=new O({actionKey:"DECK",zone:"N",param:"~random~",hostCard:""},s,e-2,400,35);u.addChild(m),a.clickers.add(u),await Promise.all(c);const y={actionKey:"MNBT",zone:"N",hostCard:"",param:"LK"};await new Kt().drawButton(r,s-48,650,y,"LOAD FILE",32)}async drawList(t,r){let e=170;const s=570,c=[],u=new wt(s,e,600,600);t.filter(m=>m.actionKey==="DECK").forEach(m=>{const y=a.deTil(m.param),A=a.deck.stockDeckByName(y[0],y[1]);c.push(this.drawFaction(r,A.factions[0],s,e),this.drawText(r,A.name,s+65,e+7,{colour:"#f5f242"})),A.factions.length===2&&c.push(this.drawFaction(r,A.factions[1],s+28,e));const k=new O(m,s,e-2,600,35);u.addChild(k),e+=35}),await Promise.all(c),a.clickers.add(u)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,c=Math.floor(t/3);return[22+s*176,200+c*235]}iAmError(t){const r=a.canvases.get("game-ui");this.drawText(r,t,295,670,{colour:"#f5142e",fontSize:26})}}class ai extends ot{async drawMenu(t){const r=new Kt,e=80,s=45,c=240;let u=50,m=c;await this.textFun(u+28,m,"More Info",t),m+=s,await this.buttonMaker(t,r,u,m,"RU","RULES",66),m+=e,await this.buttonMaker(t,r,u,m,"FQ","INFO & FAQ",20),m+=e*2,await this.buttonMaker(t,r,u,m,"MM","MAIN MENU",20),u=404,m=c,await this.textFun(u+5,m,"Draft Modes",t),m+=s,await this.buttonMaker(t,r,u,m,"GP","GOOD PACKS",9,a.state.gs.options.fatPacks),m+=e,await this.buttonMaker(t,r,u,m,"LD","LEGENDARY",17,a.state.gs.options.legDraft),u=757,m=c,await this.textFun(u+12,m,"Game Modes",t),m+=s,await this.buttonMaker(t,r,u,m,"HH","BIG HEALTH",20,a.state.gs.options.highHealth),m+=e,await this.buttonMaker(t,r,u,m,"CH","CHEATER",37,a.state.gs.options.cheater),m+=e,await this.buttonMaker(t,r,u,m,"BB","BATTLE BARK",13,a.state.gs.options.bark)}async textFun(t,r,e,s){await this.drawText(s,e,t,r,{colour:"#f5f242",fontSize:30})}async buttonMaker(t,r,e,s,c,u,m=7,y=!1){const A={actionKey:"MNBT",zone:"N",hostCard:"",param:c};await r.drawButton(t,e,s,A,u,m,y)}}class si extends ot{async drawMenu(t){let e=22;await this.drawSprite(t,"ui/button/constructed.png",778,e);const s={zone:"N",actionKey:"MENU",hostCard:"",param:"C"},c=new O(s,...this.buttHilightBounds(778,e));a.clickers.add(c),e=148,await this.drawSprite(t,"ui/button/draft.png",778,e);const u={zone:"N",actionKey:"MENU",hostCard:"",param:"D"},m=new O(u,...this.buttHilightBounds(778,e));a.clickers.add(m),e=508,await this.drawSprite(t,"ui/button/deck.png",778,e);const y={zone:"N",actionKey:"MENU",hostCard:"",param:"B"},A=new O(y,...this.buttHilightBounds(778,e));a.clickers.add(A),e=634,await this.drawSprite(t,"ui/button/info.png",778,e);const k={zone:"N",actionKey:"MENU",hostCard:"",param:"I"},w=new O(k,...this.buttHilightBounds(778,e));a.clickers.add(w),await this.drawSprite(t,"gwg/gwg_red.png",58,0)}buttBounds(t,r){return[t,r,242,113]}buttHilightBounds(t,r){const s=[-3,-3,6,6];return this.buttBounds(t,r).map((c,u)=>c+s[u])}textFun(t,r,e,s){this.drawText(s,e,t+89,r+40,{colour:"#1aa0e3",fontSize:20})}}class ni{gameWidth;gameHeight;spriteCache;action;ai;batch;canvases;cards;clickers;creat;data;death;deck;draft;drawing;effect;field;fight;log;phase;player;state;target;trigger;turn;dogAudio;idnum=0;imgRoot;constructor(){this.spriteCache={},this.imgRoot="./img/",this.gameWidth=1024,this.gameHeight=768,this.action=new zr,this.ai=new Xr,this.batch=new Rr,this.canvases=new Qr,this.cards=new Pr,this.clickers=new Lr,this.creat=new Wr,this.data=new Hr,this.death=new Mr,this.deck=new jr,this.draft=new Jr,this.drawing=new Yr,this.effect=new Ur,this.field=new $r,this.fight=new Vr,this.log=new Br,this.phase=new Gr,this.player=new Or,this.state=new Kr,this.target=new Zr,this.trigger=new Nr,this.turn=new Ir,this.dogAudio=document.getElementById("dogbark")}randInt(t,r){return Math.floor(Math.random()*(r-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(r=>{setTimeout(()=>{r()},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(r=>this.getSprite(`${this.imgRoot}${r}`)))}dogBark(){this.dogAudio.volume=.3,this.dogAudio.play()}genId(t){const e=t??this.state.gs.isLocalA?"@":"!";return this.idnum+=1,this.idnum.toString(36)+e}enTil(...t){return t.join("~")}deTil(t){return t.split("~")}imageLoader(t){return new Promise(r=>{const e=new Image;e.onload=()=>{r(e)},e.src=t})}}const a=new ni;window.onload=async()=>{await document.fonts.ready;let n=[];document.fonts.forEach(c=>{c.load(),n.push(c.loaded)}),await Promise.all(n),["game-ui","field","player","hand","effects","decklist","card"].forEach(c=>{a.canvases.register(c)});const r=a.canvases.get("effects");r.context.lineWidth=2;try{document.createEvent("TouchEvent"),a.state.setClickMode("T")}catch{}const e=c=>{if(a.state.gs.ui.detailsMode)a.state.clearDetails();else{const u=a.clickers.hitTest(c.pageX,c.pageY,c.button);u&&a.action.handleAction(u)}},s=document.getElementById("solforge");s.addEventListener("click",e),s.addEventListener("contextmenu",c=>(c.preventDefault(),e(c),!1)),a.state.restoreOptions(),a.drawing.drawAll()}})(); +(function(){"use strict";const se=["A","N","T","U"];const jt=["C","R","H","L"];const xt=[{crd:"AAK",fct:"T",rty:"L",set:1,typ:"C"},{crd:"AGC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"AGK",fct:"A",rty:"L",set:2.1,typ:"C"},{crd:"AGP",fct:"A",rty:"C",set:1.1,typ:"S"},{crd:"ASG",fct:"T",rty:"R",set:1,typ:"S"},{crd:"AFO",fct:"A",rty:"C",set:2.1,typ:"C"},{crd:"ATG",fct:"A",rty:"C",set:2,typ:"C"},{crd:"ART",fct:"U",rty:"H",set:2.1,typ:"C"},{crd:"AGM",fct:"T",rty:"L",set:2.2,typ:"C"},{crd:"ALG",fct:"A",rty:"R",set:1,typ:"C"},{crd:"AHL",fct:"A",rty:"H",set:1,typ:"C"},{crd:"ALS",fct:"A",rty:"H",set:2,typ:"C"},{crd:"AEN",fct:"A",rty:"C",set:2,typ:"C"},{crd:"APM",fct:"A",rty:"H",set:2,typ:"C"},{crd:"AQE",fct:"T",rty:"C",set:1,typ:"S"},{crd:"AGD",fct:"U",rty:"L",set:1,typ:"C"},{crd:"AFS",fct:"A",rty:"L",set:1,typ:"C"},{crd:"ABR",fct:"T",rty:"C",set:2,typ:"C"},{crd:"AMY",fct:"T",rty:"C",set:1,typ:"C"},{crd:"ABL",fct:"T",rty:"R",set:1,typ:"S"},{crd:"AGU",fct:"T",rty:"R",set:2.1,typ:"C"},{crd:"AIV",fct:"T",rty:"H",set:1,typ:"C"},{crd:"BTN",fct:"A",rty:"H",set:1,typ:"C"},{crd:"BLH",fct:"T",rty:"L",set:2,typ:"C"},{crd:"BSP",fct:"N",rty:"C",set:2.2,typ:"C"},{crd:"BWK",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BSR",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BMY",fct:"T",rty:"H",set:2.1,typ:"C"},{crd:"BTM",fct:"U",rty:"H",set:1,typ:"S"},{crd:"BAW",fct:"U",rty:"R",set:2,typ:"C"},{crd:"BWG",fct:"U",rty:"C",set:1,typ:"C"},{crd:"BWD",fct:"U",rty:"C",set:2,typ:"C"},{crd:"BSG",fct:"A",rty:"L",set:1,typ:"C"},{crd:"BSS",fct:"A",rty:"L",set:1,typ:"C"},{crd:"BTS",fct:"U",rty:"C",set:1.1,typ:"C"},{crd:"BWH",fct:"A",rty:"R",set:1,typ:"S"},{crd:"BZD",fct:"N",rty:"R",set:2,typ:"C"},{crd:"BFM",fct:"N",rty:"H",set:2.3,typ:"C"},{crd:"BSM",fct:"T",rty:"H",set:2,typ:"C"},{crd:"CDT",fct:"U",rty:"R",set:1,typ:"C"},{crd:"CTL",fct:"T",rty:"L",set:1,typ:"S"},{crd:"CHY",fct:"U",rty:"C",set:1,typ:"C"},{crd:"CHV",fct:"N",rty:"L",set:2,typ:"C"},{crd:"CTI",fct:"N",rty:"C",set:1.1,typ:"C"},{crd:"CHA",fct:"U",rty:"R",set:2.1,typ:"C"},{crd:"CHH",fct:"U",rty:"C",set:2,typ:"C"},{crd:"CHR",fct:"U",rty:"L",set:1,typ:"C"},{crd:"CDC",fct:"T",rty:"C",set:2,typ:"C"},{crd:"CFB",fct:"T",rty:"H",set:1,typ:"C"},{crd:"CNM",fct:"T",rty:"C",set:2,typ:"C"},{crd:"CSW",fct:"T",rty:"L",set:2.3,typ:"C"},{crd:"CCT",fct:"T",rty:"R",set:2,typ:"C"},{crd:"CFG",fct:"T",rty:"C",set:2,typ:"S"},{crd:"CSU",fct:"N",rty:"R",set:1,typ:"S"},{crd:"CCR",fct:"N",rty:"C",set:1,typ:"C"},{crd:"CSB",fct:"N",rty:"C",set:2,typ:"C"},{crd:"CRC",fct:"A",rty:"R",set:2,typ:"C"},{crd:"CYC",fct:"N",rty:"H",set:2,typ:"C"},{crd:"CTW",fct:"N",rty:"C",set:1,typ:"S"},{crd:"CTV",fct:"U",rty:"H",set:1,typ:"S"},{crd:"CAG",fct:"A",rty:"R",set:1,typ:"S"},{crd:"CBS",fct:"A",rty:"C",set:2.1,typ:"S"},{crd:"CIN",fct:"A",rty:"R",set:1.1,typ:"C"},{crd:"CSG",fct:"A",rty:"C",set:2,typ:"S"},{crd:"DFR",fct:"N",rty:"H",set:2,typ:"C"},{crd:"DHW",fct:"N",rty:"R",set:1,typ:"C"},{crd:"DSS",fct:"N",rty:"R",set:1,typ:"C"},{crd:"DCR",fct:"N",rty:"R",set:2,typ:"S"},{crd:"DSK",fct:"N",rty:"C",set:1,typ:"C"},{crd:"DBA",fct:"U",rty:"H",set:1,typ:"C"},{crd:"DBP",fct:"U",rty:"C",set:1,typ:"C"},{crd:"DMR",fct:"U",rty:"C",set:2,typ:"C"},{crd:"DBR",fct:"U",rty:"C",set:1,typ:"C"},{crd:"DCS",fct:"A",rty:"L",set:2,typ:"C"},{crd:"DGZ",fct:"A",rty:"R",set:2,typ:"S"},{crd:"DIS",fct:"T",rty:"R",set:1,typ:"S"},{crd:"DSV",fct:"U",rty:"R",set:2,typ:"S"},{crd:"DDD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"DBT",fct:"N",rty:"H",set:1,typ:"S"},{crd:"DFB",fct:"N",rty:"R",set:1,typ:"C"},{crd:"DMW",fct:"A",rty:"L",set:1.1,typ:"C"},{crd:"DCH",fct:"U",rty:"C",set:1,typ:"S"},{crd:"DSZ",fct:"N",rty:"C",set:2,typ:"C"},{crd:"DYB",fct:"U",rty:"R",set:2,typ:"S"},{crd:"ESK",fct:"N",rty:"H",set:2,typ:"C"},{crd:"EHW",fct:"U",rty:"L",set:1,typ:"C"},{crd:"ETN",fct:"A",rty:"C",set:1,typ:"S"},{crd:"EWE",fct:"T",rty:"H",set:2,typ:"C"},{crd:"ENP",fct:"A",rty:"H",set:1,typ:"S"},{crd:"ESU",fct:"A",rty:"R",set:1,typ:"S"},{crd:"ENR",fct:"U",rty:"C",set:1,typ:"S"},{crd:"EPD",fct:"N",rty:"H",set:1,typ:"S"},{crd:"ESC",fct:"A",rty:"H",set:2,typ:"C"},{crd:"ESP",fct:"U",rty:"H",set:2.3,typ:"C"},{crd:"EWT",fct:"U",rty:"R",set:2,typ:"C"},{crd:"EHN",fct:"U",rty:"C",set:1,typ:"C"},{crd:"EFM",fct:"T",rty:"L",set:2.1,typ:"C"},{crd:"EFP",fct:"T",rty:"L",set:1,typ:"C"},{crd:"EXD",fct:"N",rty:"H",set:1,typ:"S"},{crd:"FWB",fct:"U",rty:"C",set:2.3,typ:"C"},{crd:"FWR",fct:"U",rty:"C",set:1,typ:"C"},{crd:"FWK",fct:"N",rty:"C",set:1,typ:"C"},{crd:"FIN",fct:"U",rty:"C",set:1,typ:"S"},{crd:"FRR",fct:"U",rty:"H",set:1,typ:"S"},{crd:"FVA",fct:"T",rty:"H",set:1,typ:"S"},{crd:"FFU",fct:"T",rty:"H",set:1,typ:"C"},{crd:"FMS",fct:"T",rty:"C",set:2,typ:"C"},{crd:"FSM",fct:"T",rty:"H",set:1,typ:"S"},{crd:"FBC",fct:"T",rty:"L",set:1,typ:"C"},{crd:"FBI",fct:"T",rty:"H",set:2.2,typ:"C"},{crd:"FFS",fct:"T",rty:"R",set:2,typ:"C"},{crd:"FLN",fct:"T",rty:"R",set:2,typ:"S"},{crd:"FSS",fct:"T",rty:"R",set:1,typ:"C"},{crd:"FLS",fct:"T",rty:"C",set:1,typ:"C"},{crd:"FSH",fct:"T",rty:"R",set:1,typ:"C"},{crd:"FFD",fct:"N",rty:"H",set:1,typ:"C"},{crd:"FSP",fct:"A",rty:"L",set:1,typ:"C"},{crd:"FPR",fct:"T",rty:"C",set:2.1,typ:"C"},{crd:"FFL",fct:"A",rty:"C",set:1,typ:"S"},{crd:"FGA",fct:"A",rty:"C",set:1,typ:"C"},{crd:"FGB",fct:"A",rty:"R",set:1,typ:"C"},{crd:"FGG",fct:"A",rty:"H",set:1,typ:"C"},{crd:"FPS",fct:"A",rty:"C",set:1,typ:"C"},{crd:"FSK",fct:"T",rty:"C",set:2.3,typ:"S"},{crd:"FWT",fct:"U",rty:"H",set:1,typ:"C"},{crd:"FZS",fct:"T",rty:"R",set:1,typ:"S"},{crd:"GHS",fct:"U",rty:"C",set:2.2,typ:"C"},{crd:"GHB",fct:"U",rty:"R",set:1,typ:"C"},{crd:"GRN",fct:"N",rty:"C",set:2,typ:"S"},{crd:"GTH",fct:"N",rty:"C",set:1,typ:"S"},{crd:"GSC",fct:"U",rty:"C",set:1,typ:"C"},{crd:"GMP",fct:"A",rty:"L",set:1,typ:"C"},{crd:"GTT",fct:"T",rty:"L",set:2,typ:"C"},{crd:"GCL",fct:"T",rty:"C",set:1,typ:"C"},{crd:"GCR",fct:"T",rty:"C",set:2,typ:"S"},{crd:"GLF",fct:"N",rty:"C",set:2,typ:"C"},{crd:"GRW",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GSW",fct:"N",rty:"C",set:2,typ:"C"},{crd:"GVS",fct:"U",rty:"C",set:2,typ:"C"},{crd:"GSS",fct:"U",rty:"C",set:1,typ:"C"},{crd:"GBG",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GGE",fct:"N",rty:"C",set:2,typ:"C"},{crd:"GGH",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GRP",fct:"N",rty:"R",set:1,typ:"S"},{crd:"GGD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"GGP",fct:"N",rty:"H",set:1,typ:"C"},{crd:"GGS",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GRM",fct:"N",rty:"R",set:2,typ:"S"},{crd:"GHT",fct:"U",rty:"C",set:1,typ:"C"},{crd:"GMR",fct:"U",rty:"C",set:1,typ:"C"},{crd:"HTR",fct:"U",rty:"L",set:1,typ:"C"},{crd:"HAR",fct:"A",rty:"C",set:1,typ:"C"},{crd:"HFA",fct:"N",rty:"H",set:1,typ:"C"},{crd:"HWM",fct:"A",rty:"L",set:1,typ:"C"},{crd:"HGS",fct:"N",rty:"R",set:1,typ:"C"},{crd:"HTP",fct:"U",rty:"C",set:1,typ:"C"},{crd:"IBF",fct:"T",rty:"R",set:1,typ:"S"},{crd:"ITO",fct:"T",rty:"R",set:2,typ:"S"},{crd:"IWC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"IHA",fct:"A",rty:"L",set:2,typ:"C"},{crd:"IMA",fct:"A",rty:"L",set:2.3,typ:"C"},{crd:"JPK",fct:"A",rty:"C",set:1,typ:"S"},{crd:"KAW",fct:"T",rty:"L",set:1.1,typ:"C"},{crd:"KOD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"KKK",fct:"T",rty:"L",set:2,typ:"C"},{crd:"LKP",fct:"U",rty:"L",set:1,typ:"C"},{crd:"LGT",fct:"N",rty:"R",set:2.3,typ:"C"},{crd:"LBD",fct:"U",rty:"H",set:1,typ:"C"},{crd:"LSS",fct:"U",rty:"R",set:1,typ:"C"},{crd:"LBL",fct:"U",rty:"R",set:1,typ:"C"},{crd:"LBR",fct:"T",rty:"C",set:1,typ:"S"},{crd:"LSK",fct:"T",rty:"C",set:1,typ:"S"},{crd:"LWY",fct:"T",rty:"C",set:1,typ:"C"},{crd:"LSP",fct:"A",rty:"C",set:1,typ:"C"},{crd:"LMV",fct:"N",rty:"L",set:1,typ:"C"},{crd:"LHY",fct:"U",rty:"C",set:2,typ:"C"},{crd:"MMH",fct:"T",rty:"C",set:1,typ:"C"},{crd:"MRF",fct:"N",rty:"C",set:1,typ:"C"},{crd:"MOE",fct:"T",rty:"H",set:1,typ:"C"},{crd:"MXW",fct:"A",rty:"C",set:1,typ:"C"},{crd:"MSP",fct:"U",rty:"R",set:2,typ:"S"},{crd:"MMA",fct:"A",rty:"C",set:1,typ:"C"},{crd:"MMX",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMO",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMV",fct:"A",rty:"C",set:2.2,typ:"C"},{crd:"MSC",fct:"A",rty:"H",set:1,typ:"S"},{crd:"MTS",fct:"A",rty:"C",set:1.1,typ:"S"},{crd:"MTT",fct:"A",rty:"C",set:2,typ:"S"},{crd:"MML",fct:"U",rty:"H",set:2,typ:"C"},{crd:"MMW",fct:"U",rty:"L",set:2.2,typ:"C"},{crd:"MBP",fct:"U",rty:"H",set:1,typ:"C"},{crd:"MND",fct:"A",rty:"R",set:1,typ:"C"},{crd:"NGB",fct:"T",rty:"C",set:1,typ:"C"},{crd:"NSL",fct:"U",rty:"R",set:1,typ:"S"},{crd:"NCS",fct:"N",rty:"R",set:1,typ:"C"},{crd:"NCW",fct:"N",rty:"C",set:1,typ:"C"},{crd:"NCV",fct:"N",rty:"C",set:1,typ:"S"},{crd:"NEM",fct:"N",rty:"C",set:1,typ:"S"},{crd:"NSH",fct:"N",rty:"L",set:2.3,typ:"S"},{crd:"NXC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"NXP",fct:"A",rty:"C",set:1,typ:"C"},{crd:"NXT",fct:"A",rty:"H",set:2,typ:"C"},{crd:"NGT",fct:"N",rty:"R",set:2,typ:"C"},{crd:"NCL",fct:"U",rty:"R",set:1.1,typ:"S"},{crd:"NFF",fct:"U",rty:"L",set:2,typ:"C"},{crd:"NOZ",fct:"N",rty:"R",set:2,typ:"C"},{crd:"NSY",fct:"N",rty:"C",set:2.1,typ:"C"},{crd:"ONN",fct:"N",rty:"H",set:1.1,typ:"S"},{crd:"OXA",fct:"A",rty:"H",set:2.3,typ:"C"},{crd:"OXM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"OXP",fct:"N",rty:"H",set:2,typ:"C"},{crd:"OBD",fct:"A",rty:"H",set:1,typ:"C"},{crd:"OFM",fct:"A",rty:"R",set:2.1,typ:"C"},{crd:"OJC",fct:"A",rty:"H",set:1.1,typ:"C"},{crd:"OPK",fct:"A",rty:"R",set:2,typ:"C"},{crd:"OWW",fct:"A",rty:"L",set:1,typ:"C"},{crd:"OHV",fct:"N",rty:"R",set:2,typ:"C"},{crd:"ODC",fct:"U",rty:"L",set:2,typ:"C"},{crd:"OSP",fct:"N",rty:"R",set:2,typ:"C"},{crd:"OWF",fct:"A",rty:"H",set:2,typ:"S"},{crd:"OXS",fct:"U",rty:"R",set:1,typ:"C"},{crd:"PHM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"PPM",fct:"A",rty:"R",set:1,typ:"C"},{crd:"PSM",fct:"A",rty:"L",set:2.2,typ:"C"},{crd:"PHS",fct:"A",rty:"R",set:2.2,typ:"C"},{crd:"PTB",fct:"U",rty:"H",set:1,typ:"S"},{crd:"PSC",fct:"U",rty:"R",set:2,typ:"C"},{crd:"PTR",fct:"A",rty:"R",set:2,typ:"S"},{crd:"PSG",fct:"U",rty:"R",set:1,typ:"S"},{crd:"PMS",fct:"T",rty:"C",set:1,typ:"S"},{crd:"PYG",fct:"T",rty:"H",set:1,typ:"C"},{crd:"PYS",fct:"T",rty:"C",set:1.1,typ:"S"},{crd:"RBH",fct:"T",rty:"L",set:1,typ:"C"},{crd:"RTS",fct:"T",rty:"C",set:2.2,typ:"C"},{crd:"RLW",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RFL",fct:"T",rty:"R",set:1,typ:"C"},{crd:"RHC",fct:"T",rty:"C",set:1,typ:"C"},{crd:"ROG",fct:"N",rty:"H",set:1,typ:"S"},{crd:"RFA",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RBG",fct:"U",rty:"H",set:2,typ:"C"},{crd:"RGG",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RSZ",fct:"N",rty:"R",set:1.1,typ:"C"},{crd:"SAP",fct:"A",rty:"C",set:2,typ:"S"},{crd:"SVO",fct:"U",rty:"C",set:2.1,typ:"S"},{crd:"SSE",fct:"U",rty:"L",set:2.1,typ:"C"},{crd:"SCS",fct:"N",rty:"C",set:1,typ:"C"},{crd:"SMD",fct:"T",rty:"L",set:1,typ:"C"},{crd:"SFS",fct:"N",rty:"L",set:1,typ:"C"},{crd:"SCD",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SFT",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SAD",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SHG",fct:"N",rty:"L",set:2,typ:"S"},{crd:"SPD",fct:"U",rty:"R",set:1,typ:"C"},{crd:"SPM",fct:"U",rty:"L",set:1,typ:"C"},{crd:"STD",fct:"A",rty:"H",set:2.2,typ:"C"},{crd:"SHS",fct:"U",rty:"R",set:2.2,typ:"C"},{crd:"SGF",fct:"N",rty:"H",set:2.2,typ:"C"},{crd:"SKG",fct:"A",rty:"C",set:2,typ:"C"},{crd:"SSR",fct:"U",rty:"L",set:2,typ:"C"},{crd:"SNB",fct:"A",rty:"C",set:2.3,typ:"S"},{crd:"SNP",fct:"A",rty:"H",set:1,typ:"S"},{crd:"SRD",fct:"U",rty:"C",set:1,typ:"S"},{crd:"SRH",fct:"N",rty:"C",set:2.3,typ:"C"},{crd:"SDN",fct:"N",rty:"L",set:1,typ:"C"},{crd:"SHV",fct:"N",rty:"H",set:1,typ:"S"},{crd:"SBA",fct:"A",rty:"C",set:1,typ:"C"},{crd:"SKB",fct:"A",rty:"C",set:1,typ:"C"},{crd:"SBR",fct:"T",rty:"C",set:2,typ:"C"},{crd:"SBD",fct:"U",rty:"C",set:2.1,typ:"C"},{crd:"SFM",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SSN",fct:"A",rty:"C",set:2.2,typ:"C"},{crd:"SSM",fct:"T",rty:"C",set:2.2,typ:"C"},{crd:"SLH",fct:"N",rty:"C",set:2,typ:"S"},{crd:"SRV",fct:"N",rty:"R",set:2.2,typ:"C"},{crd:"STR",fct:"N",rty:"R",set:2,typ:"S"},{crd:"SSA",fct:"N",rty:"H",set:2.1,typ:"C"},{crd:"STO",fct:"U",rty:"R",set:2,typ:"S"},{crd:"SDR",fct:"U",rty:"R",set:1,typ:"C"},{crd:"SHK",fct:"T",rty:"H",set:1,typ:"S"},{crd:"SWR",fct:"A",rty:"R",set:1,typ:"C"},{crd:"SFA",fct:"A",rty:"H",set:1,typ:"C"},{crd:"STG",fct:"A",rty:"L",set:2,typ:"C"},{crd:"SSS",fct:"A",rty:"R",set:1,typ:"C"},{crd:"SWM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"STN",fct:"T",rty:"R",set:2,typ:"S"},{crd:"SGI",fct:"T",rty:"C",set:1,typ:"C"},{crd:"SBG",fct:"T",rty:"L",set:1,typ:"C"},{crd:"SCL",fct:"T",rty:"C",set:1,typ:"C"},{crd:"SGA",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SSG",fct:"U",rty:"C",set:2,typ:"C"},{crd:"SVH",fct:"U",rty:"C",set:2.3,typ:"C"},{crd:"SIN",fct:"U",rty:"C",set:1.1,typ:"S"},{crd:"SYL",fct:"U",rty:"H",set:2.2,typ:"C"},{crd:"SML",fct:"U",rty:"C",set:1,typ:"C"},{crd:"SYO",fct:"A",rty:"L",set:1,typ:"C"},{crd:"TST",fct:"T",rty:"C",set:2,typ:"S"},{crd:"TBA",fct:"U",rty:"L",set:1,typ:"C"},{crd:"TGS",fct:"U",rty:"C",set:2,typ:"C"},{crd:"TPT",fct:"N",rty:"C",set:2.1,typ:"S"},{crd:"TDW",fct:"N",rty:"R",set:1.1,typ:"C"},{crd:"TGN",fct:"A",rty:"C",set:2,typ:"C"},{crd:"TSM",fct:"A",rty:"C",set:1,typ:"C"},{crd:"TUP",fct:"A",rty:"R",set:1,typ:"S"},{crd:"TGI",fct:"T",rty:"R",set:2,typ:"C"},{crd:"TDS",fct:"U",rty:"L",set:1.1,typ:"C"},{crd:"TOB",fct:"N",rty:"R",set:1,typ:"S"},{crd:"TWS",fct:"A",rty:"C",set:2,typ:"C"},{crd:"TVG",fct:"A",rty:"R",set:1.1,typ:"C"},{crd:"TXS",fct:"U",rty:"C",set:1,typ:"S"},{crd:"TCG",fct:"T",rty:"C",set:2.1,typ:"S"},{crd:"TRN",fct:"T",rty:"H",set:2,typ:"S"},{crd:"TWG",fct:"U",rty:"C",set:2,typ:"S"},{crd:"UGM",fct:"U",rty:"C",set:2.2,typ:"C"},{crd:"UGL",fct:"T",rty:"R",set:2,typ:"C"},{crd:"UIC",fct:"T",rty:"H",set:2.3,typ:"C"},{crd:"ULR",fct:"U",rty:"H",set:2,typ:"C"},{crd:"URD",fct:"N",rty:"H",set:1,typ:"C"},{crd:"UBL",fct:"T",rty:"R",set:1,typ:"S"},{crd:"UCM",fct:"T",rty:"R",set:1,typ:"C"},{crd:"UHS",fct:"T",rty:"H",set:2,typ:"C"},{crd:"UIM",fct:"T",rty:"C",set:2,typ:"C"},{crd:"UWL",fct:"T",rty:"H",set:2,typ:"C"},{crd:"UWS",fct:"T",rty:"R",set:2.3,typ:"C"},{crd:"UTM",fct:"U",rty:"C",set:2,typ:"C"},{crd:"UTR",fct:"U",rty:"H",set:2,typ:"C"},{crd:"URB",fct:"U",rty:"L",set:2.3,typ:"C"},{crd:"UPM",fct:"U",rty:"L",set:1,typ:"C"},{crd:"VRP",fct:"N",rty:"L",set:2,typ:"S"},{crd:"VBK",fct:"A",rty:"R",set:2,typ:"C"},{crd:"VTC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"VGN",fct:"N",rty:"C",set:1,typ:"C"},{crd:"VNF",fct:"U",rty:"R",set:1.1,typ:"C"},{crd:"VNS",fct:"U",rty:"H",set:2,typ:"C"},{crd:"VGR",fct:"U",rty:"C",set:2,typ:"S"},{crd:"VCG",fct:"T",rty:"C",set:1,typ:"C"},{crd:"VES",fct:"N",rty:"L",set:2.1,typ:"C"},{crd:"VYE",fct:"N",rty:"C",set:2,typ:"S"},{crd:"WBY",fct:"T",rty:"R",set:2,typ:"C"},{crd:"WBU",fct:"T",rty:"C",set:1.1,typ:"C"},{crd:"WMR",fct:"A",rty:"H",set:2.1,typ:"C"},{crd:"WMM",fct:"A",rty:"H",set:1,typ:"C"},{crd:"WTW",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WWP",fct:"U",rty:"H",set:1.1,typ:"C"},{crd:"WFM",fct:"T",rty:"H",set:1.1,typ:"C"},{crd:"WWS",fct:"U",rty:"R",set:1,typ:"C"},{crd:"WBH",fct:"T",rty:"R",set:1.1,typ:"C"},{crd:"WCS",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WPD",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WFB",fct:"N",rty:"C",set:1.1,typ:"C"},{crd:"WFS",fct:"N",rty:"H",set:1,typ:"C"},{crd:"WBG",fct:"N",rty:"L",set:1.1,typ:"C"},{crd:"XCR",fct:"N",rty:"C",set:2,typ:"C"},{crd:"XHS",fct:"N",rty:"C",set:2.2,typ:"C"},{crd:"XHU",fct:"N",rty:"C",set:1,typ:"C"},{crd:"XRF",fct:"N",rty:"C",set:2,typ:"C"},{crd:"XSH",fct:"N",rty:"L",set:1,typ:"C"},{crd:"XDV",fct:"N",rty:"H",set:1,typ:"C"},{crd:"XRW",fct:"N",rty:"H",set:2,typ:"S"},{crd:"YWC",fct:"T",rty:"C",set:2,typ:"C"},{crd:"YNS",fct:"N",rty:"L",set:2.2,typ:"C"},{crd:"ZPM",fct:"T",rty:"R",set:1.1,typ:"C"},{crd:"ZTU",fct:"N",rty:"L",set:1,typ:"C"},{crd:"ZIN",fct:"N",rty:"C",set:1,typ:"C"},{crd:"ZSH",fct:"T",rty:"L",set:1,typ:"C"}],ke=[["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"]]],h=(n,t)=>({card:n,num:t}),Te={name:"Official",id:"SBE",decks:[{name:"Alloyin Starter",factions:["A"],cards:[h("SYO",1),h("BSS",1),h("SFT",2),h("SNP",2),h("TSM",2),h("SSS",2),h("ALG",2),h("MXW",3),h("TUP",3),h("FPS",3),h("MND",3),h("IWC",3),h("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[h("SFS",1),h("GGD",1),h("FFD",3),h("EPD",2),h("CCR",2),h("HGS",2),h("DSS",2),h("BWK",2),h("GBG",3),h("DSK",3),h("GRP",3),h("VGN",3),h("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[h("FBC",1),h("RBH",1),h("CFB",3),h("FSM",2),h("FSH",2),h("FSS",2),h("PMS",2),h("RFL",2),h("UBL",3),h("WPD",3),h("SGI",3),h("AMY",3),h("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[h("UPM",1),h("EHW",1),h("FRR",3),h("SPD",2),h("HTP",2),h("LSS",2),h("SDR",2),h("SRD",2),h("FWR",3),h("DBP",3),h("GHT",3),h("GSS",3),h("TXS",3)]},{name:"Cruel Corrosion",factions:["A","N"],cards:[h("IHA",1),h("WBG",1),h("OXP",1),h("DFR",1),h("APM",1),h("SNP",1),h("GRM",2),h("ETN",2),h("DHW",2),h("OXM",2),h("AEN",2),h("ATG",2),h("CTI",2),h("CTW",2),h("FPS",2),h("GRW",2),h("MTT",2),h("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[h("ZTU",1),h("VRP",1),h("GGP",1),h("EPD",1),h("DBT",1),h("BSM",1),h("TDW",2),h("NGT",2),h("UBL",2),h("FWK",2),h("BZD",2),h("CSB",2),h("SLH",2),h("MMH",2),h("LSK",2),h("GBG",2),h("CFG",2),h("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[h("TDS",1),h("SSR",1),h("FRR",1),h("ULR",1),h("UTR",1),h("BTM",1),h("UGL",2),h("EHN",2),h("SPD",2),h("GHB",2),h("FLN",2),h("SML",2),h("RFL",2),h("OXS",2),h("UTM",2),h("TWG",2),h("ENR",2),h("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[h("CSW",1),h("SMD",1),h("FRR",1),h("UIC",1),h("CFB",1),h("UGL",2),h("FSH",2),h("FLN",2),h("WPD",1),h("TWG",2),h("TCG",2),h("TGS",2),h("SVH",1),h("SCL",2),h("RTS",1),h("FWB",1),h("ENR",2),h("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[h("IMA",1),h("GMP",1),h("OXA",1),h("EPD",1),h("OJC",1),h("ESU",2),h("OXM",2),h("MMA",2),h("SAP",1),h("AFO",2),h("GBG",2),h("CTW",2),h("SRH",1),h("TSM",2),h("SLH",1),h("MTT",1),h("DCR",1),h("DFB",1),h("BSR",1),h("LGT",1),h("XRF",2),h("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[h("SBG",1),h("NSH",1),h("FFU",1),h("EWE",1),h("BFM",1),h("WBH",1),h("UWS",1),h("TGI",2),h("RFL",2),h("GRM",1),h("ASG",1),h("YWC",2),h("XRF",2),h("WPD",2),h("WCS",2),h("WBU",2),h("TCG",1),h("FSK",1),h("SLH",2),h("CFG",1),h("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[h("URB",1),h("AGK",1),h("ESP",1),h("FRR",1),h("NXT",1),h("ALG",1),h("FGB",1),h("PHS",2),h("TUP",1),h("EWT",2),h("PTR",1),h("VBK",1),h("AGC",1),h("AEN",2),h("ETN",1),h("FPS",2),h("MXW",2),h("GHT",1),h("TWG",2),h("SNB",1),h("SML",1),h("JPK",1),h("ENR",1),h("IWC",1)]}]},Ce={name:"Sept 2013 Reddit Tourney",id:"T1309",decks:[{name:"Axel: Lifegain",factions:["T","U"],cards:[h("AGD",3),h("EHW",3),h("FRR",3),h("FIN",1),h("UPM",1),h("LKP",2),h("BTM",2),h("LBL",3),h("GSS",3),h("RFA",3),h("GHB",3),h("EFP",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[h("DBP",3),h("EHW",2),h("FRR",3),h("FWT",3),h("UPM",3),h("LKP",2),h("BTM",3),h("HTR",2),h("LBD",2),h("RFA",3),h("GHB",2),h("SDR",2)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[h("SHK",3),h("MOE",3),h("FRR",3),h("LSK",3),h("FFU",3),h("UBL",3),h("WWS",3),h("FSS",3),h("ENR",3),h("MMH",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[h("SCS",3),h("ROG",1),h("GGP",1),h("GGD",3),h("WFS",1),h("DSS",3),h("ZTU",1),h("GBG",3),h("HFA",3),h("EXD",1),h("EPD",1),h("BSR",1),h("MRF",2),h("HGS",3),h("GTH",3)]},{name:"Shabbit: Zimus",factions:["N","T"],cards:[h("FSS",3),h("GGD",2),h("GGP",3),h("KOD",1),h("MOE",2),h("ZTU",3),h("EFP",2),h("LSK",2),h("FVA",1),h("EPD",3),h("CTW",1),h("SHV",1),h("UBL",3),h("SHK",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[h("DBP",2),h("EHW",2),h("FRR",3),h("HTP",2),h("UPM",3),h("LKP",2),h("GHT",3),h("GGP",2),h("LBD",1),h("EPD",2),h("DBT",2),h("SPD",3),h("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[h("IWC",3),h("FSS",3),h("ETN",1),h("WPD",2),h("FSM",1),h("AHL",1),h("UBL",3),h("SMD",2),h("BTN",3),h("LSK",1),h("MMH",3),h("FFU",1),h("TSM",3),h("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[h("DSS",3),h("FSS",3),h("EPD",2),h("GTH",3),h("FSM",1),h("MOE",1),h("UBL",3),h("GGP",3),h("GBG",1),h("LSK",3),h("HGS",1),h("CTW",1),h("SHK",3),h("GGD",1),h("DBT",1)]}]},Se={name:"June 2014 FWIQ Top 8",id:"T1406",decks:[{name:"CarlChu: Dreadbots",factions:["A","N"],cards:[h("MXW",1),h("TDW",3),h("BSG",3),h("BSS",2),h("IWC",1),h("OJC",2),h("EPD",3),h("ALS",3),h("ESK",2),h("OWF",2),h("CHV",3),h("VRP",3),h("BTN",2)]},{name:"Derk: Metaminds",factions:["A"],cards:[h("OJC",3),h("DMW",3),h("MMV",3),h("JPK",3),h("MMO",3),h("GMP",3),h("ALS",3),h("MMA",3),h("SFA",3),h("BTN",3)]},{name:"Hans: Farmer Tarsus",factions:["N","U"],cards:[h("LKP",2),h("CHR",2),h("FRR",3),h("VRP",3),h("SHG",2),h("SSE",3),h("EPD",3),h("SYL",3),h("WWP",3),h("NFF",3),h("TDW",3)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[h("ALS",3),h("TDS",3),h("FRR",3),h("WWP",3),h("SML",2),h("BSG",3),h("JPK",2),h("ODC",3),h("NXT",2),h("WMM",3),h("GHB",3)]},{name:"Jabor: Control",factions:["N","T"],cards:[h("CTW",2),h("BSM",3),h("SCL",3),h("EPD",3),h("VYE",3),h("ESK",3),h("UWL",3),h("SMD",3),h("ZTU",3),h("EFP",3),h("DBT",1)]},{name:"StillHadAllDeez: Necromancer",factions:["N","U"],cards:[h("ZTU",3),h("CTW",2),h("FRR",3),h("VRP",3),h("SHG",2),h("ESK",3),h("EPD",3),h("SYL",3),h("ODC",3),h("GGD",2),h("TDW",3)]},{name:"Tetrarain: Big n Small",factions:["N","U"],cards:[h("ZTU",2),h("TDS",3),h("ODC",3),h("WWP",3),h("CTW",1),h("SSE",1),h("EHW",2),h("EPD",3),h("GGD",2),h("CHA",2),h("ESK",3),h("CHV",2),h("FRR",3)]},{name:"Zecrus: Necro Growwide",factions:["N","U"],cards:[h("EHW",3),h("SSR",2),h("FRR",2),h("VRP",3),h("SHG",2),h("ESK",2),h("EPD",2),h("LBD",3),h("SSE",3),h("BWD",2),h("GGD",1),h("ZTU",1),h("SYL",1),h("TDW",3)]}]},we={name:"July 2014 FWIQ Top 8",id:"T1407",decks:[{name:"Bryan: Knightbots",factions:["A","U"],cards:[h("AGK",3),h("AFS",3),h("BSG",2),h("BSS",3),h("JPK",3),h("VBK",2),h("FRR",3),h("TDS",3),h("WWP",3),h("MXW",2),h("OJC",3)]},{name:"Busti: Tempo",factions:["N","T"],cards:[h("GGP",3),h("FZS",1),h("EPD",2),h("EFP",3),h("GGD",1),h("FBI",3),h("ZTU",2),h("FLN",3),h("LSK",3),h("ESK",3),h("SHK",3),h("KKK",1),h("CHV",1),h("GCR",1)]},{name:"Khaldrogo: Knightmind",factions:["A"],cards:[h("AGK",2),h("DMW",3),h("BSG",3),h("BSS",3),h("JPK",1),h("MMO",1),h("STD",2),h("GMP",3),h("ALS",3),h("MMA",3),h("SFA",3),h("BTN",3)]},{name:"Klematisse: Flamebreak",factions:["N","T"],cards:[h("GTT",3),h("FZS",2),h("EPD",2),h("SMD",3),h("UBL",2),h("FBI",3),h("ZTU",3),h("FLN",2),h("LSK",2),h("ESK",3),h("SHK",3),h("GCR",2)]},{name:"SilverTail: Dreadbots",factions:["A","N"],cards:[h("MXW",2),h("ZTU",3),h("BSG",3),h("BSS",3),h("GGD",2),h("OJC",2),h("EPD",3),h("ALS",3),h("ESK",3),h("CHV",3),h("BTN",3)]},{name:"Skitzo: Yeti",factions:["T","U"],cards:[h("WBY",3),h("TDS",3),h("FRR",3),h("WWP",3),h("ODC",2),h("UWL",3),h("SSR",1),h("RBH",1),h("EFP",2),h("UIM",3),h("UBL",3),h("GCR",3)]},{name:"V3ng3vin3: Farmer Tarsus",factions:["N","U"],cards:[h("LKP",2),h("CHR",2),h("FRR",3),h("VRP",3),h("SHG",2),h("SSE",3),h("EPD",3),h("SYL",3),h("WWP",3),h("NFF",3),h("TDW",3)]},{name:"Zwaxor: Control",factions:["N","T"],cards:[h("BSM",3),h("DBT",1),h("EPD",3),h("EFP",3),h("GGD",1),h("VYE",3),h("ZTU",3),h("SMD",3),h("SCL",3),h("ESK",3),h("CTW",2),h("SHG",1),h("GCR",1)]}]},Ee={name:"The Forge Season 1",id:"TG10",decks:[{name:"Aje8: Dinobots",factions:["A","U"],cards:[h("HTR",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",3),h("MXW",3),h("GHB",3)]},{name:"Btenant: Dinobots",factions:["A","U"],cards:[h("JPK",1),h("OWW",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",2),h("MXW",3),h("GHB",3)]},{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[h("BWK",3),h("TDS",2),h("FRR",3),h("WWP",3),h("GGP",3),h("GGD",3),h("DBT",1),h("WFS",3),h("CTW",3),h("EPD",3),h("GHB",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[h("DDD",3),h("DBT",3),h("EPD",3),h("EFP",3),h("GGP",3),h("LSK",3),h("SHK",3),h("UBL",3),h("WCS",3),h("ZTU",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[h("RBH",3),h("TDS",3),h("FRR",3),h("WWP",3),h("EFP",3),h("AMY",2),h("FVA",2),h("ENR",3),h("ZSH",3),h("EHW",3),h("GHB",2)]},{name:"PTKtempo: Dinobots",factions:["A","U"],cards:[h("EHW",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",3),h("MXW",3),h("GHB",3)]},{name:"SeomanReborn: Metamind Control",factions:["A","N"],cards:[h("MSC",1),h("JPK",1),h("ZTU",3),h("GGD",2),h("DBT",3),h("CTW",3),h("BSG",2),h("GMP",3),h("DMW",3),h("MMA",3),h("MXW",3)]},{name:"StillHadAllDeez: Dinobots",factions:["A","U"],cards:[h("OJC",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",3),h("MXW",3),h("GHB",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[h("LSK",2),h("WBG",3),h("EPD",3),h("DDD",3),h("SHK",3),h("EFP",3),h("ZTU",2),h("GGD",2),h("GGP",3),h("CTW",3),h("DBT",3)]},{name:"Zrandles: Dinobots",factions:["A","U"],cards:[h("HTR",1),h("JPK",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",2),h("MXW",2),h("GHB",2),h("OWW",2)]}]},xe={name:"The Forge Season 2.1",id:"TG21",decks:[{name:"Dbatterskull: Control",factions:["N","T"],cards:[h("CTW",2),h("GCR",1),h("VYE",2),h("ESK",3),h("SMD",3),h("EFP",3),h("ZTU",3),h("FLN",2),h("BSM",3),h("EPD",3),h("GGP",3),h("CHV",2)]},{name:"EvilWeevil: Control",factions:["N","U"],cards:[h("ZTU",3),h("TDS",3),h("GGP",3),h("WWP",3),h("CTW",2),h("EHW",2),h("EPD",3),h("GGD",2),h("DBT",2),h("ESK",3),h("CHV",2),h("FRR",2)]},{name:"EvilWeevil: Dino Knightbots",factions:["A","U"],cards:[h("AGK",3),h("GHB",1),h("NXT",2),h("BSG",3),h("BSS",3),h("JPK",2),h("VBK",2),h("WMM",1),h("FRR",3),h("TDS",3),h("WWP",3),h("MXW",2),h("BTM",1),h("OJC",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[h("UWL",3),h("FFU",3),h("WBY",3),h("UIM",3),h("WBU",3),h("SSR",1),h("TRN",1),h("GTT",1),h("GCR",3),h("FRR",3),h("UBL",3),h("WWP",3)]},{name:"Hans: Dino Knightbots",factions:["A","U"],cards:[h("AGK",3),h("ALS",3),h("BTN",2),h("BSG",3),h("BSS",3),h("JPK",2),h("VBK",2),h("WMM",3),h("FRR",3),h("TDS",3),h("WWP",3)]},{name:"Jran74: Control",factions:["N","T"],cards:[h("CTW",2),h("GGD",3),h("SHK",3),h("EPD",3),h("GGP",3),h("DCR",2),h("UBL",2),h("SMD",3),h("ZTU",3),h("EFP",3),h("DBT",3)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[h("BWK",2),h("KOD",2),h("CYC",3),h("GRM",3),h("VYE",3),h("XRW",3),h("MOE",2),h("ZTU",3),h("BSM",3),h("EPD",3),h("DSS",3)]},{name:"S1al: Tempo",factions:["T","U"],cards:[h("FSS",3),h("SCL",3),h("FRR",3),h("MOE",3),h("EFP",3),h("EHW",3),h("FLN",3),h("SHK",3),h("LSK",3),h("TCG",3)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[h("CTW",1),h("GCR",1),h("CFG",1),h("FZS",1),h("FBI",3),h("MOE",3),h("EFP",3),h("LSK",3),h("FLN",3),h("SHK",3),h("RTS",3),h("GGP",3),h("UBL",2)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[h("DMW",3),h("GMP",3),h("MMA",3),h("MMV",2),h("TDW",3),h("VRP",3),h("EPD",3),h("SHG",2),h("OJC",2),h("ESK",2),h("CHV",2),h("CTW",2)]}]},De={name:"The Forge Season 2.2",id:"TG22",decks:[{name:"ErrorAsh: Burn",factions:["N","T"],cards:[h("UBL",2),h("EFM",2),h("FBI",3),h("ESK",3),h("FLN",3),h("EFP",3),h("MOE",3),h("FSS",3),h("SHK",3),h("EPD",3),h("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[h("WWS",3),h("DYB",3),h("FRR",3),h("SYL",3),h("EPD",3),h("SSE",2),h("NSH",2),h("TDW",3),h("NFF",2),h("CHR",2),h("LKP",2),h("EXD",1)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[h("NSH",2),h("SMD",2),h("DDD",3),h("TDW",3),h("VRP",3),h("WCS",3),h("BSM",3),h("SHG",2),h("TGI",2),h("EPD",3),h("FVA",2),h("DBT",1),h("TRN",1)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[h("XSH",3),h("SPM",3),h("FRR",3),h("ODC",3),h("SSE",3),h("ESK",3),h("TGS",3),h("XRF",3),h("VRP",3),h("URB",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[h("AGM",3),h("TDS",2),h("FRR",3),h("WWP",3),h("CSW",3),h("FLN",3),h("EFP",2),h("UWL",3),h("WBY",2),h("WCS",2),h("EHW",2),h("SHS",2)]},{name:"Stautmeister: Necro Bigstuff",factions:["N","U"],cards:[h("ESK",3),h("CTW",2),h("FRR",2),h("SSE",3),h("EPD",3),h("WBG",3),h("DBT",2),h("SHG",3),h("XSH",2),h("GGD",2),h("EHW",2),h("KOD",3)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[h("UHS",2),h("FLN",3),h("STG",3),h("CRC",3),h("SHK",3),h("EFP",2),h("WMR",2),h("WMM",3),h("JPK",3),h("SMD",3),h("FVA",3)]},{name:"Tetrarain: Aggro",factions:["T","U"],cards:[h("SMD",2),h("TDS",3),h("FRR",2),h("WWP",3),h("ODC",2),h("UWL",3),h("SSE",2),h("RBH",3),h("EFP",2),h("KKK",2),h("AAK",2),h("IBF",2)]},{name:"V3ng3vin3: Attack Plants",factions:["A","U"],cards:[h("CHR",1),h("JPK",1),h("FRR",3),h("ALS",2),h("ODC",3),h("SSE",3),h("BTN",2),h("SYL",3),h("TDS",3),h("WWP",3),h("NFF",2),h("GHB",1),h("WMM",1),h("OJC",2)]},{name:"V3ng3vin3: Control",factions:["N","U"],cards:[h("GGD",1),h("CTW",2),h("FRR",3),h("CHV",3),h("ODC",3),h("SSE",2),h("EPD",3),h("SYL",3),h("TDS",3),h("WWP",3),h("NFF",1),h("SHS",3)]}]},Pe={name:"Set 1 Fundecks",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[h("DFB",3),h("BSR",3),h("HGS",3),h("HFA",3),h("FFD",3),h("XSH",3),h("XHU",3),h("WBG",3),h("GBG",3),h("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[h("TBA",3),h("TDS",3),h("MBP",3),h("FSH",3),h("RBH",3),h("FBC",3),h("LBR",3),h("CFB",3),h("AAK",3),h("FRR",1),h("FIN",1),h("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[h("MMA",3),h("DMW",3),h("GMP",3),h("SYO",3),h("KAW",3),h("SHK",3),h("CTL",2),h("CAG",2),h("MSC",2),h("MTS",2),h("ASG",2),h("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[h("CTV",3),h("TDW",3),h("BTS",3),h("CHR",3),h("GMR",3),h("KOD",2),h("LKP",2),h("SHV",2),h("DBA",2),h("CCR",2),h("PTB",2),h("FIN",1),h("DBT",2)]},{name:"Voltron",factions:["A"],cards:[h("FGA",3),h("FGB",3),h("FGG",3),h("AFS",3),h("BSG",3),h("BSS",3),h("SCD",2),h("TUP",3),h("JPK",2),h("BWH",2),h("SFT",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[h("DDD",3),h("WBH",3),h("ZPM",3),h("WCS",3),h("GGP",3),h("SAD",3),h("SDN",3),h("WFB",3),h("SBG",3),h("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[h("WWP",3),h("EHN",3),h("SDR",3),h("HTR",3),h("HTP",3),h("MXW",3),h("MND",2),h("NXC",2),h("CDT",3),h("PTB",2),h("FIN",1),h("SYO",2)]},{name:"Zombies",factions:["N"],cards:[h("XDV",3),h("ONN",3),h("FWK",3),h("BWK",3),h("URD",3),h("KOD",3),h("DSS",3),h("TDW",3),h("GRP",3),h("SHV",3)]}]},Mt=[Te,Ce,Se,we,Ee,xe,De,Pe];class Fe{state;constructor(t){this.state=t}get adjacent(){return a.field.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 bonus(){return this.state.bonus}set bonus(t){this.state.bonus=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 a.cards.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 a.cards.getCard(this.code).isTribe(t)}get level(){return a.cards.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=d.crTarg();return t.player=a.player.toTarget(!this.owner),t.lanes=a.field.oppositeLane(this.lane),a.field.creatByTarget(t)[0]}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get lane(){return this.state.lane}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,r,e=void 0){t!==0&&(this.state.attack+=t,this.enforceEffects("AT")),r!==0&&(this.state.health+=r,this.state.maxHealth+=r,this.enforceEffects("CH"),a.death.deathProdder(this,e))}addArmor(t){if(!this.negateArmor){const r=this.state.armor+t;this.state.armor=Math.max(0,r),this.enforceEffects("AR")}}addMobility(t){if(!this.negateMobility){const r=this.state.mobility+t;this.state.mobility=Math.max(0,r)}}addPoison(t){const r=this.state.poison+t;this.state.poison=Math.max(0,r)}addRegen(t){if(!this.negateRegen){const r=this.state.regen+t;this.state.regen=Math.max(0,r)}}heal(t){if(t===0)return 0;const r=Math.min(this.health+t,this.maxHealth)-this.health;return this.state.health+=r,r}hurt(t,r=!1){if(t<1)return[0,0];const e=Math.max(Math.min(t,this.armor-this.armorDmg),0);let s=t-e,c=this.health-s;this.state.armorDmg+=e;let u=0;return r&&c<0&&(u=s-this.health,s=this.health),s>0&&(this.state.health-=s),[s,u]}hurtBattle(t,r,e=!1){const s=this.hurt(t,e);return s[0]>0&&a.batch.addEvents(d.damageEvent(!0,s[0],!0,!0,this,r)),s[1]}hurtDirect(t,r,e=void 0){const s=this.hurt(t,!1);return s[0]>0&&(a.log.new().crd(r).txt(` dealt ${t} dmg to `).crd(this.code).txt(".").go(),a.batch.addEvents(d.damageEvent(!1,s[0],!1,!0,this,void 0)),a.death.deathProdder(this,e)),s[0]}modIdx(t){return this.mods.findIndex(r=>r.granter===t)}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),a.death.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF")}modSum(t){return this.mods.filter(r=>r.type===t).map(r=>r.value).reduce((r,e)=>r+e,0)}modBool(t){return this.mods.some(r=>r.type===t&&r.value===1)}hasMod(t){return this.modIdx(t)>-1}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){this.mods.findIndex(e=>e.granter===t.granter&&e.type===t.type)===-1&&this.addMod(t)}removeMod(t){const r=this.state.mods.filter(e=>e.granter===t);this.state.mods=this.state.mods.filter(e=>e.granter!==t),r.forEach(e=>this.modEffectPropagator(e))}removeModSafe(t){this.hasMod(t)&&this.removeMod(t)}expireMod(t){this.state.mods.splice(this.state.mods.indexOf(t),1)}endActivation(){this.state.activationAvailable=!1,a.death.deathCheck(),a.action.actionDone()}move(t){this.state.lane=t,a.effect.positionChange(this.owner),a.batch.addEvents(d.creatureEvent("MOV",this))}addEffect(t,r){const e=d.effect(t,r);return this.effects.push(e),e}enforceEffects(t,r=!1){this.effects.filter(e=>e.watch===t).filter(e=>e.area==="A"||e.area==="C"&&this.owner===r).forEach(e=>a.cards.getCard(e.logicCode).enforceEffect(e,this))}jr4(t,r){const e=d.trigger(t,r);return e.cardCode=this.code,e.creatId=this.id,this.triggers.push(e),e}removeTrigger(t){const r=this.triggers.indexOf(t);r>-1?this.triggers.splice(r,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.bonus=0,this.state.changed=!0,this.state.negateActivate=!0,a.field.creatByTarget(d.crTarg()).forEach(t=>t.removeMod(this.id)),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),a.effect.defenderChange(this.owner)}get hints(){return this.state.hints}aiHints(){return this.hints}}var L=(n=>(n[n.Never=-999]="Never",n[n.Horrid=-2]="Horrid",n[n.Bad=-1]="Bad",n[n.Noice=1]="Noice",n[n.Grand=2]="Grand",n))(L||{});const Ht=10218;class Be{appMode="M";clickMode="M";options={bark:!0,highHealth:!1,cheater:!1,legDraft:!1,fatPacks:!1,playerDeck:[],wasDrafting:!1};playerA=d.player(!0);playerB=d.player(!1);activePlayer=!0;isLocalA=!0;aiMode=!1;aiActive=!1;firstTurn=!0;winFlag=0;field=[];phase="ST";batch={type:"N0",events:[],triggerActions:[],deathCheck:!0,iatLane:0};turn=d.freshTurn();ui=d.freshUI();deathOrder=[];birthOrder=[];graveyard=[];newGame(t,r){this.aiMode=!0,a.fight.barking=a.state.gs.options.bark,this.activePlayer=a.randInt(0,2)===0,this.aiActive=!this.activePlayer,this.playerA.name="Forgy McGhee",this.playerA.nameOffset=25;const e=a.player.nameOSaurus();this.playerB.name=e[0],this.playerB.nameOffset=e[1],a.log.setup(),a.action.actionHistory=[],this.graveyard=[],this.field=[],this.deathOrder=[],this.birthOrder=[],this.ui=d.freshUI(),this.firstTurn=!0,this.winFlag=0,this.playerA.turn=1,this.playerB.turn=1,this.playerA.rank=1,this.playerB.rank=1;const s=a.state.gs.options.highHealth?360:120;this.playerA.health=s,this.playerB.health=s,this.playerA.discard=[],this.playerB.discard=[],this.playerA.deck=a.deck.parseDeck(t),this.playerB.deck=a.deck.parseDeck(r),a.deck.shuffleDeck(!1),this.playerB.hand=this.playerB.deck.splice(0,5),a.deck.shuffleDeck(!0),this.playerA.hand=this.playerA.deck.splice(0,5),a.log.add("Ready...FIGHT!"),a.phase.startTurn()}}class d{static creatureState(t,r){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,bonus:0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:r,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,r){return{area:"A",watch:t,logicCode:r}}static freeCard(t){return{id:a.genId(),condition:d.target("TH"),sourceCard:t}}static mod(t,r,e=""){return{type:t,value:typeof r=="boolean"?r?1:0:r,granter:e,expiry:"NN"}}static player(t){return{hand:[],deck:[],discard:[],isPlayerA:t,health:120,name:"",nameOffset:0,turn:1,rank:1,avatar:Math.floor(Math.random()*17)}}static trigger(t,r){return{type:t,logicCode:r,cardCode:"",creatId:"",customCode:"",interactive:!1,changes:!1}}static triggerReaction(t,r,e,s){return{event:t,ownerPlayerA:e,creatId:"",cardCode:"",trigger:r,host:s}}static freshTurn(){return{mainBattle:!1,creaturesKilled:0,friendlyFightStarters:0,regularPlays:2,cardsPlayed:0,freeCards:[]}}static freshUI(){return{handScrollLeft:0,detailsMode:!1}}static fieldSelectAction(t,r=-1,e=!0){return{zone:"F",actionKey:t,playerA:e,lane:r,hostCard:"",param:""}}static handSelectAction(t,r="",e="",s=-1){return{zone:"H",actionKey:t,card:r,cost:e,position:s,hostCard:"",param:""}}static playerSelectAction(t,r){return{zone:"P",actionKey:t,playerA:r,hostCard:"",param:""}}static draftSelectAction(t,r,e){return{zone:"N",actionKey:t,index:r,pack:e,hostCard:"",param:""}}static ddf4(){return{zone:"N",actionKey:"ACTV",hostCard:"",param:""}}static menuButtonAction(t){return{zone:"N",actionKey:"MNBT",hostCard:"",param:t}}static creatureEvent(t,r){return{code:t,creature:r}}static enterFieldEvent(t){return{code:"ENT",creature:t,forged:!1}}static creatStatEvent(t,r,e){return{code:t,creature:r,newValue:e}}static playCardEvent(t,r){const e=d.playerEvent("PLC",r);return e.cardCode=t,e}static playerEvent(t,r){return{code:t,playerA:r}}static playerHealEvent(t,r,e){return{code:t,playerA:r,healAmt:e}}static damageEvent(t,r,e,s,c,u){return{code:"DMG",battle:t,dmg:r,creatureSrc:e,creatureTarg:s,target:c,source:u}}static actionifier(t,r,e,s=""){const c=t;return c.actionKey=r,c.hostCard=e,c.param=s,c}static target(t){return{target:t,level:"LA",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:""}}static actionTarget(t,r,e,s=""){return d.actionifier(d.target(t),r,e,s)}static crTarg(){const t=d.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,r,e=""){return d.actionifier(d.crTarg(),t,r,e)}static crNotMeTarg(t){const r=d.target("TF");return r.field="O",r.creatStatus="V",r.notMe=t,r}static crNotMeActTarg(t,r,e,s=""){return d.actionifier(d.crNotMeTarg(r),t,e,s)}static crFriendTarg(){const t=d.crTarg();return t.player="F",t}static crFriendActTarg(t,r,e=""){return d.actionifier(d.crFriendTarg(),t,r,e)}static crFriendNotMeTarg(t){const r=d.crNotMeTarg(t);return r.player="F",r}static crFriendNotMeActTarg(t,r,e,s=""){return d.actionifier(d.crFriendNotMeTarg(r),t,e,s)}static crEnemyTarg(){const t=d.crTarg();return t.player="E",t}static crEnemyActTarg(t,r,e=""){return d.actionifier(d.crEnemyTarg(),t,r,e)}static playerTarg(t){const r=d.target("TP");return r.player=a.player.toTarget(t),r}static playerActTarg(t,r,e,s=""){return d.actionifier(d.playerTarg(t),r,e,s)}static lvlHandActTarg(t,r=""){const e=this.actionTarget("TH","CARD",t,r);return e.player="F",e.level="LG",e}static actionEval(t,r,e){const s=e??[];return{type:r,hints:Array.isArray(s)?s:[s],vectors:[],action:t,final:!0,bonus:0}}static ddp5(t){const r=d.actionEval(t,"PS");return r.final=!1,r}static ddp7(t,r,e,s){const c=d.actionEval(t,"ST",s),u=d.ddp1(r,e);return u.destroy=!0,c.vectors=[u],c}static ddp8(t,r,e){return d.ddp7(t,r.owner,r.lane,e)}static ddp2(t,r,e,s={},c){const u=d.actionEval(t,"ST",c);return u.vectors=[d.ddp1(r,e,s)],u}static ddp3(t,r,e={},s){return d.ddp2(t,r.owner,r.lane,e,s)}static actionEvalBuffN(t,r,e,s=0,c=0,u){return d.ddp2(t,r,e,{att:s,hlt:c},u)}static actionEvalBuffC(t,r,e=0,s=0,c){return d.ddp3(t,r,{att:e,hlt:s},c)}static ddp4(t,r,e,s,c=!1){const u=d.actionEval(t,"PC"),m=a.cards.getCard(s);u.hints=m.aiHints();const y=d.evalVectorCreatureFromClass(m,r,e);return y.type="R",u.vectors.push(y),c&&(u.bonus=m.bonusPlay()),u}static evalVectorEmpty(t,r){return{shape:"B",type:"E",playerA:t,lane:r,destroy:!1,dirDmg:0,moveTo:0,health:0,attack:0,aggressive:!1,armor:0,armorDmg:0,breakthrough:!1,defender:!1,negateDefender:!1,poison:0,regen:0,sleeping:!1,bonus:0}}static evalVectorCreatureFromCode(t,r,e){const s=a.cards.getCard(t);return d.evalVectorCreatureFromClass(s,r,e)}static evalVectorCreatureFromClass(t,r,e){const s=t.jr3(r,e);return d.evalVectorCreature(s)}static evalVectorCreature(t){return{shape:"B",type:"C",playerA:t.owner,lane:t.lane,destroy:!1,dirDmg:0,moveTo:0,health:t.health,attack:t.attack,aggressive:t.aggressive,armor:t.armor,armorDmg:t.armorDmg,breakthrough:t.breakthrough,defender:t.defender,negateDefender:t.negateDefender,poison:t.poison,regen:t.regen,sleeping:t.sleeping,bonus:t.bonus}}static evalVectorPlayerLife(t,r){const e=d.evalVectorEmpty(t,0);return e.shape="P",e.type="M",e.health=r,e}static evalVectorPlayerDmg(t,r){const e=d.evalVectorEmpty(t,0);return e.shape="P",e.type="M",e.dirDmg=r,e}static evalVectorPlayer(t){const r=d.evalVectorEmpty(t,0);return r.shape="P",r.type="P",r}static ddp1(t,r,e){const s=d.evalVectorEmpty(t,r);return s.type="M",e&&(s.attack=e.att??0,s.health=e.hlt??0,s.armor=e.arm??0,s.regen=e.rgn??0,s.poison=e.psn??0,s.dirDmg=e.dmg??0,s.defender=e.def??!1,s.breakthrough=e.brt??!1,s.aggressive=e.agr??!1,s.negateDefender=e.noD??!1),s}}class ut{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return ut.extractCardCode(this.code)}get image(){return this.type==="S"?this.fixedImage():this.leveledImage()}leveledImage(){return this.rawImage(this.code)}fixedImage(){return this.rawImage(this.cardCode())}rawImage(t){return`card/${this.faction}/${t}.jpg`}isFree=!1;level;maxLevel=3;name="";overload=!1;rarity="T";text="";get type(){return "C"}hints;aiHints(){return this.hints??[]}bonus;bonusPlay(){return this?.bonus?.play??0}bonusExist(){return this?.bonus?.exist??0}canLevel(){return this.level{c+=s[m]*e[0][m],u+=s[m]*e[1][m]}),[c,u]}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 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 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 x extends ut{constructor(t){super(t)}jr2=0;jr1=0;initAggro=!1;initArmor=0;initBT=!1;initDefend=!1;initMobile=0;initRegen=0;tribe=[];isTribe(t){return(Array.isArray(t)?t:[t]).every(e=>this.tribe.includes(e))}jr3(t,r){const e=d.creatureState(t,r);return e.id=a.genId(),e.code=this.code,e.health=this.jr2,e.attack=this.jr1,e.maxHealth=e.health,e.regen=this.initRegen,e.breakthrough=this.initBT,e.defender=this.initDefend,e.aggressive=this.initAggro,e.armor=this.initArmor,e.mobility=this.initMobile,e.hints=this.aiHints(),e.bonus=this.bonusExist(),new Fe(e)}playTargets(){const t=super.playTargets(),r=d.actionTarget("TF","FORG",this.code);return r.player="F",t.push(r),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}ddf8(t){return!1}}class Q extends ut{constructor(t){super(t)}get type(){return "S"}logSpell(){a.log.new().txt("Casted ").crd(this.code).txt(".").go()}}class He extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Abraxas, Avatar of Kadras",this.jr1=this.boof4712,this.jr2=this.lValN([7,11,21]),this.tribe.push("HY"),this.hints=["LJ"];const r=this.lValS(["Give an adjacent creature","Each adjacent creature gets","Each other friendly creature gets"]);this.text=`Activate: ${r} 2x attack this turn.`}targ(t){const r=d.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(r.lanes=t.adjacent),r}canActivate(t){return a.field.creatByTarget(this.targ(t)).length>0}startActivation(t){if(this.level===1)a.action.ddf5(this.getCardActions(d.ddf4(),t));else{const r=this.targ(t);a.field.creatByTarget(r).forEach(e=>{this.applyMod(e,t.id)}),t.endActivation()}}handleAction(t){const r=a.field.ddf6(t),e=a.field.jr5(t.param);this.applyMod(r,e.id),e.endActivation()}getCardActions(t,r){if(t.actionKey==="ACTV"){this.level>1&&console.error("Abraxis asking for activate actions after level 1. Something in your code is wrong");const e=r??a.field.jr5(t.param),s=this.targ(e);return a.target.toActions([s,a.target.buttonTarget("CANC")])}return super.getCardActions(t,r)}ddf7(t){const r=Ht+1,e=d.actionEval(t,"ST");if(t.actionKey==="ACTV")if(this.level>1){const s=a.field.jr5(t.param);let c;this.level===3?c=a.field.laneIdx.filter(u=>u!==s.lane):c=s.adjacent,e.vectors=c.map(u=>d.ddp1(s.owner,u,{att:r}))}else return d.ddp5(t);else{const s=t;e.vectors.push(d.ddp1(s.playerA,s.lane,{att:r}))}return e}applyMod(t,r){const e=d.mod("AT",t.attack,r);e.expiry="ET",t.addMod(e)}}class Ne extends x{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Apocrymancer",this.jr1=this.boof3713,this.jr2=this.jr1+3,this.tribe.push("HM"),this.text="When you play an Alloyin spell, you may discard and level up a card."}jr3(t,r){const e=super.jr3(t,r);return e.jr4("PC",this.code),e}handleAction(t){a.turn.levelAndDiscard(t),a.action.actionDone(!0)}ddf8(t){if(t.event.code==="PLC"){const r=t.event;if(r.playerA===t.ownerPlayerA){const e=a.cards.getCard(r.cardCode);if(e.type==="S"&&e.faction==="A")return!0}}return!1}jr8(t){const r=d.lvlHandActTarg(this.code,t.creatId);a.action.ddf5(a.target.toActions([r,a.target.buttonTarget("NOTR")]))}ddf7(t){return t.actionKey==="CARD"?d.actionEval(t,"DC"):super.ddf7(t)}}class Me extends x{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Arboris, Grove Dragon",this.jr1=this.lValN([5,9,20]),this.jr2=this.jr1,this.tribe.push("DG");const r=this.boof;this.text=`While you have over 120 health, Arboris gets ${a.log.jr9(r,r)}.`}jr3(t,r){const e=super.jr3(t,r);return e.addEffect("PH",this.code),e}enforceEffect(t,r){if(a.state.getPlayer(r.owner).health>120&&r.status==="A"){const s=this.boof;r.addModSafe(d.mod("HL",s,r.id)),r.addModSafe(d.mod("MH",s,r.id)),r.addModSafe(d.mod("AT",s,r.id))}else r.removeModSafe(r.id)}get boof(){return this.lValN([4,8,80])}}class Vt extends x{constructor(t){super(t),this.rarity="H",this.jr1=this.level+2,this.jr2=this.jr1;const r=this.cardCode();r==="SFA"?this.steel():r==="RFA"?this.root():r==="HFA"?this.hell():r==="SGA"&&this.storm(),this.hints=["P1",a.ai.alliedHint(this.faction)],this.text=`Forge: ${this.name} gets ${a.log.jr9(this.level,this.level)} for each ${a.log.factionText(this.faction)} card in your hand.`}hell(){this.faction="N",this.name="Hellforged Avatar",this.initRegen=this.level,this.tribe.push("AB")}root(){this.faction="U",this.name="Rootforged Avatar",this.initBT=!0,this.tribe.push("HM")}steel(){this.faction="A",this.name="Steelforged Avatar",this.initArmor=this.level,this.tribe.push("CY")}storm(){this.faction="T",this.name="Stormforged Avatar",this.initMobile=this.level,this.tribe.push("MT")}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}jr8(t){const r=t.event,e=a.state.getPlayer(t.ownerPlayerA).hand.filter(s=>a.cards.getCard(s).faction===this.faction).length;if(e>0){const s=e*this.level;r.creature.buff(s,s)}a.batch.triggerDone()}}class N extends x{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["OOZ"]:()=>this.ooze(),["SPL"]:()=>this.minion(),["SXP"]:()=>this.fixedSapling(5),["SXD"]:()=>this.fixedSeedling(3),["SXT"]:()=>this.fixedTreefolk(7),["SDL"]:()=>this.minion(),["SPN"]:()=>this.nekSpirit(),["XYR"]:()=>this.yuruSpirit(),["TFK"]:()=>this.minion(),["TFD"]:()=>this.fixedTreefolk(this.boof5714),["TFF"]:()=>this.tfFight(),["ZTR"]:()=>this.zimus(),["ZBS"]:()=>this.threeZomb(),["ZMB"]:()=>this.commonZomb()}[t]}constructor(t){super(t),this.rarity="T";const r=this.cardCode();this.imgKey=r,this.lookup(r)()}get image(){return this.rawImage(this.imgKey)}fixedNekSpirit(t){this.faction="N",this.rarity="T",this.name="Spirit",this.tribe.push("ST"),this.jr1=t,this.jr2=t,this.imgKey=`${"SPN"}${this.level}`}nekSpirit(){this.fixedNekSpirit(this.boof51015)}yuruSpirit(){this.fixedNekSpirit(this.boof5814)}ooze(){this.faction="N",this.rarity="T",this.name="Oozeling",this.tribe.push("OZ"),this.jr1=this.boof4711,this.jr2=this.jr1,this.imgKey="OOZ"}minion(){this.jr1=N.minionBuff(this.level),this.plont(),this.name=N.minionName(this.level)}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.jr2=this.jr1,this.tribe.push("PL")}fixedSapling(t){this.jr1=t,this.plont(),this.name=N.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.jr1=t,this.plont(),this.name=N.minionName(1),this.imgKey="SDL"}fixedTreefolk(t){this.jr1=t,this.plont(),this.name=N.minionName(3),this.imgKey="TFK"}tfFight(){this.jr1=this.boof91421,this.plont(),this.name=N.minionName(3),this.imgKey="TFK"}zimus(){this.faction="N",this.rarity="L",this.name="Zimus, the Returned",this.tribe.push("ZB"),this.jr1=10,this.jr2=5,this.imgKey=`${"ZTU"}2`}zomb(t,r){this.faction="N",this.rarity="T",this.name="Zombie",this.tribe.push("ZB"),this.jr1=t,this.jr2=r,this.imgKey="ZMB"}commonZomb(){const t=this.boof359;this.zomb(t,t)}threeZomb(){this.zomb(3,3)}}class Y extends Q{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ(),e:e=>this.apulseE(e)},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ(),e:e=>this.ctlE(e)},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ(),e:e=>this.dcurE(e)},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ(),e:e=>this.digiE(e)},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ(),e:e=>this.epiE(e)},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ(),e:e=>this.roarE(e)},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ(),e:e=>this.fstormE(e)},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ(),e:e=>this.mealE(e)},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ(),e:e=>this.ibfE(e)},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ(),e:e=>this.shriekE(e)},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ(),e:e=>this.noxE(e)},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ(),e:e=>this.oforceE(e)},["PTB"]:{c:()=>this.phyC(),z:()=>this.phyZ(),e:e=>this.phyE(e)},["PYS"]:{c:()=>this.pyreC(),z:()=>this.pyreZ(),e:e=>this.pyreE(e)},["SNP"]:{c:()=>this.pulseC(),z:()=>this.pulseZ(),e:e=>this.pulseE(e)},["SRD"]:{c:()=>this.sradC(),z:()=>this.sradZ(),e:e=>this.sradE(e)},["TST"]:{c:()=>this.talinC(),z:()=>this.talinZ(),e:e=>this.talinE(e)},["TRN"]:{c:()=>this.turnbC(),z:()=>this.turnbZ(),e:e=>this.turnbE(e)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}get image(){return this.cardCode()==="NSH"?this.leveledImage():this.fixedImage()}playTargets(){const t=super.playTargets(),r=a.target.boardTarget("CARD",this.code);return t.push(r),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),a.turn.spellCast()}ddf7(t){return this.lookup(this.cardCode()).e(t)}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;a.field.ddf1().forEach(r=>{r.addArmor(t)})}apulseE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof234;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{arm:s})),r}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 ${a.log.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;a.field.ddf1().forEach(r=>{const e=d.mod("AT",t,this.code);e.expiry="ET",r.addMod(e),r.extraBattles+=1})}ctlE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.ctlboof;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s})),r}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(),r=t.length;if(r>0){const e=a.randInt(0,r),s=Date.now();a.death.destroy(t[e],this.code,s),this.level===3&&r>1&&(t.splice(e,1),a.death.destroy(t[a.randInt(0,r-1)],this.code,s))}}dcurE(t){let r;const e=this.dCurrHunter(),s=e.length;if(s>0){const c=a.randInt(0,s);if(r=d.ddp8(t,e[c]),this.level===3&&s>1){e.splice(c,1);const u=d.ddp1(e[0].owner,a.randInt(0,s-1));u.destroy=!0,r.vectors.push(u)}}else r=d.actionEval(t,"NR");return r}dCurrHunter(){const t=d.crEnemyTarg();return t.level=a.target.ddf2(this.level+1),a.field.creatByTarget(t)}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${a.log.jr9(this.boof4812n,0)}.`}digiZ(){const t=this.boof4812n;a.field.qEnemyCreats().forEach(r=>{r.buff(t,0)})}digiE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.boof4812n;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s})),r}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${a.log.jr9(t,t)}.`}epiZ(){const t=this.boof246n,r=d.crEnemyTarg();a.field.creatByTarget(r).forEach(e=>{e.buff(t,t)})}epiE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.boof246n;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s,hlt:s})),r}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${a.log.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;a.field.ddf1().forEach(r=>{r.buff(t,t),this.level===3&&(r.breakthrough=!0)})}roarE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof235,c=this.level===3;return r.vectors=a.field.laneIdx.map(u=>d.ddp1(e,u,{att:s,hlt:s,brt:c})),r}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,r=Date.now();a.field.qActiveCreats().forEach(e=>{e.hurtDirect(t,this.code,r)})}fstormE(t){const r=d.actionEval(t,"ST"),e=this.fszap;return r.vectors=[!0,!1].map(s=>a.field.laneIdx.map(c=>d.ddp1(s,c,{dmg:e}))).flat(),r}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${a.log.jr9(-1*t,0)}. Each friendly creature gets ${a.log.jr9(t,0)}.`}mealZ(){const t=this.boof234,r=a.state.ddf9();a.field.qActiveCreats().forEach(e=>{const s=e.owner===r?t:-1*t;e.buff(s,0)})}mealE(t){const r=d.actionEval(t,"ST"),e=this.boof234,s=a.state.ddf9();return r.vectors=[!0,!1].map(c=>a.field.laneIdx.map(u=>d.ddp1(c,u,{att:c===s?e:-e}))).flat(),r}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${a.log.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,r=d.crFriendTarg();a.field.creatByTarget(r).forEach(e=>{e.buff(0,t)})}ibfE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof3510;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{hlt:s})),r}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=this.boof4815;this.text=`Spawn a ${t}/${t} Netherdrake.`}shriekZ(){a.field.birthCreature(`${"NDR"}${this.level}`,"S",a.state.ddf9())}shriekE(t){const r=a.state.ddf9(),e=a.field.emptyLanes(r);if(e.length===0)return d.actionEval(t,"NR");{const s=d.ddp4(t,r,e[a.randInt(0,e.length)],`${"NDR"}${this.level}`);return s.type="ST",s.hints.push("ENF"),s}}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;a.field.qEnemyCreats().forEach(r=>{r.addPoison(t)})}noxE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.boof246;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{psn:s})),r}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${a.log.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)a.field.ddf1().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;a.field.ddf1().forEach(r=>{r.buff(t,0)})}}oforceE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.lValN([3,6,Ht+1]);return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s})),r}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=N.minionBuff(this.level);this.text=`Put a ${t}/${t} ${N.minionName(this.level)} into each players available spaces.`}phyZ(){const t=N.minionCode(this.level),r=Date.now();[!0,!1].forEach(e=>{a.field.emptyLanes(e).forEach(s=>{a.field.birthCreature(t,"P",e,s,r)})})}phyE(t){const r=N.minionCode(this.level),e=d.actionEval(t,"ST");return e.vectors=[!0,!1].map(s=>a.field.emptyLanes(s).map(c=>{const u=d.evalVectorCreatureFromCode(r,s,c);return u.type="R",u})).flat(),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,r=Date.now(),e=a.field.qEnemyCreats();a.field.ddf1().forEach(s=>{e.forEach(c=>{c.hurtDirect(t,s.code,r)})})}pyreE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.level*a.field.ddf1().length;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{dmg:s})),r}get spboof(){return(this.level+1)*-2}pulseC(){this.faction="A",this.rarity="H",this.name="Sonic Pulse",this.text=`Each enemy creature gets ${a.log.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;a.field.qEnemyCreats().forEach(r=>{r.buff(t,0)})}pulseE(t){const r=d.actionEval(t,"ST"),e=!a.state.ddf9(),s=this.spboof;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{att:s})),r}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;a.field.ddf1().forEach(r=>{r.heal(t)})}sradE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof3612;return r.vectors=a.field.laneIdx.map(c=>d.ddp1(e,c,{hlt:s})),r}talinC(){this.faction="T",this.rarity="C",this.name="Talin Stampede",this.text=`Each friendly Tempys creature gets ${a.log.jr9(this.boof5814,0)} this turn.`}talinZ(){const t=this.boof5814;this.talinTarg().forEach(r=>{const e=d.mod("AT",t);e.expiry="ET",r.addMod(e)})}talinE(t){const r=d.actionEval(t,"ST"),e=a.state.ddf9(),s=this.boof5814;return r.vectors=this.talinTarg().map(c=>d.ddp1(e,c.lane,{att:s})),r}talinTarg(){const t=d.crFriendTarg();return t.faction="T",a.field.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 ${a.log.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,r=-1*t;a.field.qActiveCreats().forEach(e=>{const s=d.mod("AT",t),c=d.mod("HL",r),u=d.mod("MH",r);s.expiry="ET",c.expiry="ET",u.expiry="ET",e.addMod(s),e.addMod(c),e.addMod(u)})}turnbE(t){const r=d.actionEval(t,"ST"),e=this.boof235,s=-1*e;return r.vectors=[!0,!1].map(c=>a.field.laneIdx.map(u=>d.ddp1(c,u,{att:e,hlt:s}))).flat(),r}}class Re extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Borean Mystic",this.jr1=this.boof4814,this.jr2=this.boof71118,this.tribe.push("WN","AS"),this.text=`Activate: Move another friendly creature to an available space adjacent to ${this.name}.`}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{const e=a.field.jr5(r[1]);a.field.jr5(r[2]).move(t.lane),e.endActivation()}}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=this.buddies(e.id);return s.push(a.action.cancelAction()),s}else if(t.actionKey==="CARD"){const e=a.field.ddf6(t),s=a.deTil(t.param),c=a.field.jr5(s[1]),u=this.emptySloots(c,e.id);return u.push(a.action.cancelAction()),u}return super.getCardActions(t,r)}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=d.actionEval(t,"ST"),s=t,c=a.field.jr5(r[2]),u=d.ddp1(c.owner,c.lane);return u.moveTo=s.lane,e.vectors.push(u),e}}}emptySloots(t,r=""){return a.action.emptyAdjacents(t,a.enTil("P2",t.id,r))}buddies(t){return a.target.toActions(d.crFriendNotMeActTarg("CARD",t,this.code,a.enTil("P1",t)))}}class Ge extends x{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Brightsteel Gargoyle",this.jr1=this.boof61016,this.jr2=this.jr1,this.initMobile=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,r){const e=super.jr3(t,r);return e.jr4("PT",this.code),e}ddf8(t){return t.trigger.type==="PT"?t.event.playerA===t.ownerPlayerA:!1}jr8(t){const r=d.mod("AR",this.boof2510,t.creatId),e=d.mod("DF",!0,t.creatId);r.expiry="ET",e.expiry="ET";const s=a.field.jr5(t.creatId);s.addMod(r),s.addMod(e),a.batch.triggerDone()}}class Le extends Q{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 r=d.crFriendActTarg("CARD",this.code,"P1");r.hasArmor=!0,t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]);e.hurtDirect(s.armor*this.level,this.code),a.turn.spellCast()}}enemyTargActions(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r)}getCardActions(t){const r=a.field.ddf6(t),e=this.enemyTargActions(r.id);return e.push(a.action.cancelAction()),e}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=t,s=a.field.jr5(r[1]);return d.ddp2(t,e.playerA,e.lane,{dmg:s.armor*this.level})}}}class Ie extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Byzerak Spitemage",this.jr1=this.boof369,this.jr2=this.level,this.initAggro=!0,this.tribe.push("HM"),this.hints=["ALN"],this.bonus={play:this.level*.5},this.text=`Allied Nekrium: When ${this.name} ${a.log.dbdtac(this.level)}, destroy it.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&r.creatureSrc&&r.creatureTarg&&r.dmg>0&&r.source.id===t.creatId&&a.target.levelTestCommon(r.target.level,this.level)}else return!1}jr8(t){if(t.trigger.type==="FR"&&a.turn.allied("N")){const r=a.field.jr5(t.creatId);r.jr4("DM",this.code),r.hints.push("BX"),r.changed=!0}else if(t.trigger.type==="DM"){const e=t.event.target;a.death.destroy(e,this.code)}a.batch.triggerDone()}}class $e extends x{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Cercee, Hand of Varna",this.jr1=this.lValN([1,3,5,7]),this.jr2=this.lValN([6,10,20,40]),this.tribe.push("FB"),this.initMobile=1,this.maxLevel=4,this.level===4?this.hints=["OL","LKV","BX"]:this.hints=["OP","BX"];const r=this.level===4?`When ${this.name} ${a.log.dbdtap()}, deal damamge to that player equal to their health. `:"";this.text=r+`When ${this.name} ${a.log.dbdtac(this.level)}, destroy that creature.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;if(r.battle&&r.creatureSrc&&r.source.id===t.creatId){if(this.level===4)return!0;if(r.creatureTarg){const e=r.target;return a.target.levelTestCommon(e.level,this.level)}}}return!1}jr8(t){const r=t.event;if(r.creatureTarg){const e=r.target;e.status==="A"&&a.death.destroy(e,this.code)}else{const e=a.player.toPlayer(r.target);a.player.ddf3(e,e.health,this.code)}a.batch.triggerDone()}}class ne extends x{constructor(t){super(t)}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.creatureTarg&&r.target.id===t.creatId}return!1}}class Ve extends ne{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Chrogias",this.jr1=this.lValN([1,0,40]),this.jr2=this.lValN([1,15,40]),this.tribe.push("PL"),this.level===1?(this.hints=["LV","ST"],this.bonus={play:1}):this.level===2?(this.initRegen=2,this.initDefend=!0,this.bonus={play:1}):this.level===3&&(this.initBT=!0,this.initRegen=5),this.level>1&&(this.hints=["DLK"],this.text="When Chrogias is dealt damage, you gain that much health.")}jr8(t){if(this.level>1){const r=t.event;a.player.healPlayer(t.ownerPlayerA,r.dmg)}a.batch.triggerDone()}}class z extends x{lookup(t){return{["FFU"]:{c:()=>this.ffuC(),a:(e,s)=>this.ffuA(e,s),t:e=>this.ffuT(e),e:(e,s)=>this.ffuE(e,s)},["FFS"]:{c:()=>this.ffsC(),a:(e,s)=>this.ffsA(e,s),t:e=>this.ffsT(e),e:(e,s)=>this.ffsE(e,s)},["FSH"]:{c:()=>this.fssC(),a:(e,s)=>this.fssA(e,s),t:e=>this.fssT(e),e:(e,s)=>this.fssE(e,s)},["KOD"]:{c:()=>this.kodC(),a:(e,s)=>this.kodA(e,s),t:e=>this.kodT(e),e:(e,s)=>this.kodE(e,s)},["MBP"]:{c:()=>this.mbpC(),a:(e,s)=>this.mbpA(e,s),t:e=>this.mbpT(e),e:(e,s)=>this.mbpE(e,s)},["MND"]:{c:()=>this.mndC(),a:(e,s)=>this.mndA(e,s),t:e=>this.mndT(e),e:(e,s)=>this.mndE(e,s)},["NCS"]:{c:()=>this.ncsC(),a:(e,s)=>this.ncsA(e,s),t:e=>this.ncsT(e),e:(e,s)=>this.ncsE(e,s)},["NFF"]:{c:()=>this.nffC(),a:(e,s)=>this.nffA(e,s),t:e=>this.nffT(e),e:(e,s)=>this.nffE(e,s)},["OHV"]:{c:()=>this.orghC(),a:(e,s)=>this.orghA(e,s),t:e=>this.orghT(e),e:(e,s)=>this.orghE(e,s)},["PPM"]:{c:()=>this.ppmC(),a:(e,s)=>this.ppmA(e,s),t:e=>this.ppmT(e),e:(e,s)=>this.ppmE(e,s)},["PSC"]:{c:()=>this.pcoilC(),a:(e,s)=>this.pcoilA(e,s),t:e=>this.pcoilT(e),e:(e,s)=>this.pcoilE(e,s)},["SGF"]:{c:()=>this.siggyC(),a:(e,s)=>this.siggyA(e,s),t:e=>this.siggyT(e),e:(e,s)=>this.siggyE(e,s)},["SSA"]:{c:()=>this.ssaC(),a:(e,s)=>this.ssaA(e,s),t:e=>this.ssaT(e),e:(e,s)=>this.ssaE(e,s)},["SWM"]:{c:()=>this.swmC(),a:(e,s)=>this.swmA(e,s),t:e=>this.swmT(e),e:(e,s)=>this.swmE(e,s)},["UCM"]:{c:()=>this.ucmC(),a:(e,s)=>this.ucmA(e,s),t:e=>this.ucmT(e),e:(e,s)=>this.ucmE(e,s)},["UIM"]:{c:()=>this.uimC(),a:(e,s)=>this.uimA(e,s),t:e=>this.uimT(e),e:(e,s)=>this.uimE(e,s)},["WMR"]:{c:()=>this.warmC(),a:(e,s)=>this.warmA(e,s),t:e=>this.warmT(e),e:(e,s)=>this.warmE(e,s)},["WFS"]:{c:()=>this.wfsC(),a:(e,s)=>this.wfsA(e,s),t:e=>this.wfsT(e),e:(e,s)=>this.wfsE(e,s)},["ZPM"]:{c:()=>this.zpmC(),a:(e,s)=>this.zpmA(e,s),t:e=>this.zpmT(e),e:(e,s)=>this.zpmE(e,s)}}[t]}targAction(t,r,e){this.lookup(t).a(r,e)}actTargets(t,r){return this.lookup(t).t(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=t,e=a.field.jr5(t.param);return this.lookup(this.cardCode()).e(r,e)}}canActivate(t){return a.target.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.ddf6(t),e=a.field.jr5(t.param);this.targAction(this.cardCode(),r,e),e.endActivation()}makeCreatTarg(t){return d.crActTarg("CARD",this.code,t.id)}ddf8(t){return ut.extractCardCode(t.trigger.logicCode)==="KOD"&&(t.trigger.type==="PT"||t.trigger.type==="VN")?!0:super.ddf8(t)}jr8(t){if(t.trigger.type==="VN"){const r=t.event;a.field.birthCreature(r.creature.code,"S",t.ownerPlayerA),a.batch.triggerDone()}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,e=a.field.jr5(t.creatId);e.triggers.filter(c=>c.customCode===r).forEach(c=>e.removeTrigger(c)),a.batch.triggerDone()}}getCardActions(t,r){const e=r??a.field.jr5(t.param);return a.target.toActions([this.actTargets(this.cardCode(),e),a.target.buttonTarget("CANC")])}ffuC(){this.faction="T",this.rarity="H",this.name="Firefist Uranti",this.jr1=this.boof357,this.jr2=this.boof71116,this.tribe.push("FR","YT"),this.text=`Activate: Deal damage equal to ${this.name}'s attack to a creature.`}ffuT(t){return this.makeCreatTarg(t)}ffuA(t,r){t.hurtDirect(r.attack,this.code)}ffuE(t,r){return d.ddp2(t,t.playerA,t.lane,{dmg:r.attack})}ffsC(){this.faction="T",this.rarity="R",this.name="Flamefury Shaman",this.jr1=this.boof369,this.jr2=this.boof81116,this.tribe.push("HM"),this.text=`Activate: Grant another creature ${a.log.jr9(this.jr1,0)} this turn.`}ffsT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}ffsA(t,r){const e=d.mod("AT",this.jr1,r.id);e.expiry="ET",t.addMod(e)}ffsE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.jr1)}fssC(){this.faction="T",this.rarity="R",this.name="Flamestoke Shaman",this.jr1=this.boof61218,this.jr2=this.boof3712,this.tribe.push("HM"),this.text=`Activate: Grant an adjacent ${a.log.levelGateText(this.level,!0)}creature Aggressive.`}fssT(t){const r=this.makeCreatTarg(t);return r.level=a.target.ddf2(this.level),r.lanes=t.adjacent,r.player=a.player.toTarget(t.owner),r}fssA(t,r){t.aggressive=!0}fssE(t,r){return d.ddp2(t,t.playerA,t.lane,{agr:!0})}kodC(){this.faction="N",this.rarity="L",this.name="Keeper of the Damned",this.jr1=this.boof5815,this.jr2=this.boof61017,this.tribe.push("ZB"),this.text=`Activate: another friendly ${a.log.levelGateText(this.level,!0)}creature gets "Vengeance: Spawn this" this turn.`}kodT(t){const r=this.makeCreatTarg(t);return r.level=a.target.ddf2(this.level),r.player=a.player.toTarget(t.owner),r.notMe=t.id,r}kodA(t,r){const e=t.jr4("VN",this.code);e.customCode=r.id,e.changes=!0;const s=t.jr4("PT",this.code);s.customCode=r.id}kodE(t,r){const e=d.ddp2(t,t.playerA,t.lane,void 0,"LZ");return e.bonus=2,e}mbpC(){this.faction="U",this.rarity="H",this.name="Mossbeard Patriarch",this.jr1=this.boof137,this.jr2=this.boof81220,this.tribe.push("PL"),this.text=`Activate: Give another creature ${a.log.jr9(0,this.boof468)}.`}mbpT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}mbpA(t,r){t.buff(0,this.boof468)}mbpE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,0,this.boof468)}mndC(){this.faction="A",this.rarity="R",this.name="Munitions Drone",this.jr1=this.boof137,this.jr2=this.boof6814,this.tribe.push("RB"),this.text=`Activate: Give another creature ${a.log.jr9(this.boof357,0)}.`}mndT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}mndA(t,r){t.buff(this.boof357,0)}mndE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof357)}ncsC(){this.faction="N",this.rarity="R",this.name="Necroslime",this.jr1=this.boof4814,this.jr2=this.jr1,this.tribe.push("OZ");const t=this.boof248;this.text=`Activate, deal 3 damage to another friendly creature: ${this.name} gets ${a.log.jr9(t,t)}.`}ncsT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r.player="F",r}ncsA(t,r){const e=this.boof248;t.hurtDirect(3,this.code),r.buff(e,e)}ncsE(t,r){const e=this.boof248,s=d.actionEvalBuffC(t,r,e,e);return s.vectors.push(d.ddp1(t.playerA,t.lane,{dmg:3})),s}nffC(){this.faction="U",this.rarity="L",this.name="Nuada, Faith's Flourish",this.jr1=this.boof246,this.jr2=this.lValN([10,17,25]),this.initDefend=!0,this.tribe.push("TK");const t=this.boof91421;this.text=`Activate: Give a friendly Plant with a ${t}/${t} Treefolk.`}nffT(t){const r=this.makeCreatTarg(t);return r.player="F",r.tribe="PL",r}nffA(t,r){a.field.birthCreature(`${"TFF"}${this.level}`,"R",r.owner,t.lane)}nffE(t,r){const e=d.ddp4(t,t.playerA,t.lane,`${"TFF"}${this.level}`);return e.hints=["RE"],e}orghC(){this.faction="N",this.rarity="R",this.name="Organ Harvester",this.jr1=this.lValN([2,6,9]),this.jr2=this.jr1+1,this.tribe.push("AB"),this.text=`Activate, destroy ${this.name}: Destroy a ${a.log.levelGateText(this.level,!0)}creature.`}orghT(t){const r=this.makeCreatTarg(t);return r.level=a.target.ddf2(this.level),r.notMe=t.id,r}orghA(t,r){const e=Date.now();a.death.destroy(t,this.code,e),a.death.destroy(r,this.code,e)}orghE(t,r){const e=d.ddp7(t,t.playerA,t.lane),s=d.ddp1(r.owner,r.lane);return s.destroy=!0,e.vectors.push(s),e}ppmC(){this.faction="A",this.rarity="R",this.name="Palladium Pulsemage",this.jr1=this.lValN([2,8,12]),this.jr2=this.lValN([7,12,15]),this.tribe.push("HM"),this.text=`Activate: give a creature ${a.log.jr9(this.boof4812n,0)} this turn.`}ppmT(t){return this.makeCreatTarg(t)}ppmA(t,r){const e=d.mod("AT",this.boof4812n,r.id);e.expiry="ET",t.addMod(e)}ppmE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof4812n)}pcoilC(){this.faction="U",this.rarity="R",this.name="Poisoncoil",this.jr1=this.boof357,this.jr2=this.boof71013,this.initDefend=!0,this.tribe.push("SN"),this.text=`Activate: Give another creature Poison ${this.boof135}.`}pcoilT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}pcoilA(t,r){t.addPoison(this.boof135)}pcoilE(t,r){return d.ddp2(t,t.playerA,t.lane,{psn:this.boof135})}siggyC(){this.faction="N",this.rarity="H",this.name="Sigmund Fraud",this.jr1=this.boof357,this.jr2=this.lValN([9,14,19]),this.initDefend=!0,this.tribe.push("AB");const t=this.boof4812;this.text=`Activate, destroy another friendly creature: Deal ${t} damage to the enemy player and you gain ${t} health.`}siggyT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r.player="F",r}siggyA(t,r){a.death.destroy(t,this.code);const e=this.boof4812;a.player.ddf3(!r.owner,e,this.code),a.player.healPlayer(r.owner,e)}siggyE(t,r){const e=d.ddp7(t,t.playerA,t.lane,"SD"),s=this.boof4812;return e.vectors.push(d.evalVectorPlayerDmg(!r.owner,s),d.evalVectorPlayerLife(r.owner,s)),e}ssaC(){this.faction="N",this.rarity="H",this.name="Spitesower Acolyte",this.jr1=this.boof234,this.jr2=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 ${a.log.jr9(t,t)}.`}ssaT(t){return this.makeCreatTarg(t)}ssaA(t,r){const e=this.boof246n,s=Date.now();r.hurtDirect(-e,this.code,s),t.buff(e,e,s)}ssaE(t,r){const e=this.boof246n,s=d.actionEvalBuffN(t,t.playerA,t.lane,e,e);return s.vectors.push(d.ddp1(r.owner,r.lane,{dmg:-e})),s}swmC(){this.faction="A",this.rarity="R",this.name="Steelwelder Medic",this.jr1=this.lValN([3,5,13]),this.jr2=this.boof61014,this.tribe.push("HM"),this.text=`Activate: Give another creature Armor ${this.level}.`}swmT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r.canArmor=!0,r}swmA(t,r){t.addArmor(this.level)}swmE(t,r){return d.ddp2(t,t.playerA,t.lane,{arm:this.level})}ucmC(){this.faction="T",this.rarity="R",this.name="Uranti Cryomancer",this.jr1=this.boof247,this.jr2=this.lValN([8,13,17]),this.tribe.push("IC","YT"),this.text=`Activate: Deal ${this.boof135} damage to a creature.`}ucmT(t){return this.makeCreatTarg(t)}ucmA(t,r){t.hurtDirect(this.boof135,this.code)}ucmE(t,r){return d.ddp2(t,t.playerA,t.lane,{dmg:this.boof135})}uimC(){this.faction="T",this.rarity="C",this.name="Uranti Icemage",this.jr1=this.lValN([2,5,9]),this.jr2=this.lValN([8,13,20]),this.tribe.push("IC","YT"),this.text="Activate: Negate Defender this turn."}uimT(t){return this.makeCreatTarg(t)}uimA(t,r){const e=d.mod("ND",!0,r.id);e.expiry="ET",t.addMod(e)}uimE(t,r){return d.ddp2(t,t.playerA,t.lane,{noD:!0})}warmC(){this.faction="A",this.rarity="H",this.name="War Merchant",this.jr1=this.boof468,this.jr2=this.jr1,this.initDefend=!0,this.tribe.push("HM"),this.text=`Activate: Give a creature in a center space ${a.log.jr9(this.jr1,this.level===3?this.jr1:0)}.`}warmT(t){const r=this.makeCreatTarg(t);return r.lanes=3,r}warmA(t,r){t.buff(this.jr1,this.level===3?this.jr1:0)}warmE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.jr1,this.level===3?this.jr1:0)}wfsC(){this.faction="N",this.rarity="H",this.name="Witherfrost Succubus",this.jr1=this.boof147,this.jr2=this.boof61018,this.tribe.push("DM");const t=-this.boof357;this.text=`Activate: Give a creature ${a.log.jr9(t,t)} this turn.`}wfsT(t){return this.makeCreatTarg(t)}wfsA(t,r){const e=-this.boof357,s=d.mod("AT",e,r.id);s.expiry="ET",t.addMod(s);const c=d.mod("HL",e,r.id);c.expiry="ET",t.addMod(c);const u=d.mod("MH",e,r.id);u.expiry="ET",t.addMod(u)}wfsE(t,r){const e=-this.boof357;return d.actionEvalBuffN(t,t.playerA,t.lane,e,e)}zpmC(){this.faction="T",this.rarity="R",this.name="Zephyr Mage",this.jr1=this.boof4813,this.jr2=this.boof61017,this.tribe.push("WN","AS"),this.text=`Activate: Give another ${a.log.levelGateText(this.level,!0)}creature Mobility ${this.level}.`}zpmT(t){const r=this.makeCreatTarg(t);return r.level=a.target.ddf2(this.level),r.notMe=t.id,r.canMove=!0,r}zpmA(t,r){t.addMobility(this.level)}zpmE(t,r){const e=d.ddp2(t,t.playerA,t.lane);return e.bonus=.5,e}}class _ extends x{lookup(t){return{["AGC"]:{c:()=>this.aconC(),f:(e,s)=>this.aconF(e,s),e:e=>this.aconE(e)},["BSR"]:{c:()=>this.bsrC(),f:(e,s)=>this.bsrF(e,s),e:e=>this.bsrE(e)},["BAW"]:{c:()=>this.bawC(),f:(e,s)=>this.bawF(e,s),e:e=>this.bawE(e)},["CHA"]:{c:()=>this.chaC(),f:(e,s)=>this.chaF(e,s),e:e=>this.chaE(e)},["CCR"]:{c:()=>this.ccC(),f:(e,s)=>this.ccF(e,s),e:e=>this.ccE(e)},["GLF"]:{c:()=>this.gfiendC(),f:(e,s)=>this.gfiendF(e,s),e:e=>this.gfiendE(e)},["GRW"]:{c:()=>this.grwC(),f:(e,s)=>this.grwF(e,s),e:e=>this.grwE(e)},["GHT"]:{c:()=>this.grhC(),f:(e,s)=>this.grhF(e,s),e:e=>this.grhE(e)},["MMH"]:{c:()=>this.houndC(),f:(e,s)=>this.houndF(e,s),e:e=>this.houndE(e)},["MXW"]:{c:()=>this.mtxC(),f:(e,s)=>this.mtxF(e,s),e:e=>this.mtxE(e)},["NGB"]:{c:()=>this.ngbC(),f:(e,s)=>this.ngbF(e,s),e:e=>this.ngbE(e)},["PHS"]:{c:()=>this.phxsC(),f:(e,s)=>this.phxsF(e,s),e:e=>this.phxsE(e)},["STD"]:{c:()=>this.stdC(),f:(e,s)=>this.stdF(e,s),e:e=>this.stdE(e)},["VNF"]:{c:()=>this.vnfC(),f:(e,s)=>this.vnfF(e,s),e:e=>this.vnfE(e)},["WBY"]:{c:()=>this.wbyC(),f:(e,s)=>this.wbyF(e,s),e:e=>this.wbyE(e)},["WBU"]:{c:()=>this.wbuC(),f:(e,s)=>this.wbuF(e,s),e:e=>this.wbuE(e)}}[t]}targAction(t,r,e){this.lookup(t).f(r,e)}targEval(t,r){return this.lookup(t).e(r)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=d.crActTarg("CARD",this.code),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}jr3(t,r){const e=super.jr3(t,r);if(this.forges){const s=e.jr4("FR",this.code);s.interactive=!0}return e}handleAction(t){const r=a.field.ddf6(t),e=a.field.jr5(t.param);this.targAction(this.cardCode(),r,e),a.action.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const r=a.target.toActions(this.playTarg);r.length>0?(r.forEach(e=>{e.param=t.creatId}),this.optional&&r.push(a.action.noneEndTrigger()),a.action.ddf5(r)):a.batch.triggerDone()}ddf7(t){return this.targEval(this.cardCode(),t)}aconC(){this.faction="A",this.rarity="C",this.name="Aegis Conscript",this.jr1=this.boof3612,this.jr2=this.lValN([6,9,15]),this.tribe.push("HM"),this.hints=["FRO"],this.bonus={play:this.ddp9(0,this.boof248,0,0)},this.playTarg.canArmor=!0,this.playTarg.player="F",this.ftext=`Give a friendly creature Armor ${this.boof124}.`}aconF(t,r){t.addArmor(this.boof124)}aconE(t){return d.ddp2(t,t.playerA,t.lane,{arm:this.boof124})}bsrC(){this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.jr1=this.boof5813,this.jr2=this.boof3712,this.tribe.push("AB"),this.hints=["ENS"],this.bonus={play:this.ddp6()},this.forges=this.level>1,this.playTarg.level=a.target.ddf2(this.level-1),this.playTarg.player="E",this.ftext=`You may destroy a ${a.log.levelGateText(this.level-1)} enemy creature.`,this.optional=!0}bsrF(t,r){a.death.destroy(t,this.code)}bsrE(t){return d.ddp7(t,t.playerA,t.lane)}bawC(){this.faction="U",this.rarity="R",this.name="Brambleaxe Warrior",this.jr1=this.boof61014,this.jr2=this.jr1-4,this.tribe.push("HM"),this.hints=["FRO"];const t=this.avgCreatureStats()[0];this.bonus={play:this.ddp9(0,0,t,t)},this.ftext="Give a creature Breakthrough this turn."}bawF(t,r){const e=d.mod("BT",!0,r.id);e.expiry="ET",t.addMod(e)}bawE(t){return d.ddp2(t,t.playerA,t.lane,{brt:!0})}chaC(){this.faction="U",this.rarity="R",this.name="Chistlehearth Archer",this.jr1=this.boof2510,this.jr2=this.jr1+7,this.tribe.push("HM"),this.hints=["ENS"];const t=this.boof4816;this.bonus={play:this.ddp9(0,t/2,0,0)},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,r){t.hurtDirect(this.boof4816,this.code),t.negateMobility=!0}chaE(t){return d.ddp2(t,t.playerA,t.lane,{dmg:this.boof4816})}ccC(){this.faction="N",this.rarity="C",this.name="Corpse Crawler",this.jr1=this.boof81220,this.jr2=this.jr1+1,this.tribe.push("AB"),this.hints=["SD"],this.playTarg.player="F",this.ftext="Destroy a friendly creature."}ccF(t,r){a.death.destroy(t,this.code)}ccE(t){return d.ddp7(t,t.playerA,t.lane,"SD")}get fiendBof(){return this.lValN([-1,-2,-5])}gfiendC(){this.faction="N",this.rarity="C",this.name="Gloomfiend",this.jr1=this.boof4812,this.jr2=this.jr1,this.tribe.push("AB"),this.hints=["ENS"],this.playTarg.player="E";const t=this.fiendBof;this.ftext=`You may give an enemy creature ${a.log.jr9(t,t)}.`,this.optional=!0,this.bonus={play:this.ddp9(0,-2*t,-t,0)}}gfiendF(t,r){const e=this.fiendBof;t.buff(e,e)}gfiendE(t){const r=this.fiendBof;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}grwC(){this.faction="N",this.rarity="C",this.name="Gloomreaper Witch",this.jr1=this.boof5915,this.jr2=this.jr1,this.tribe.push("HM"),this.hints=["ENS"],this.bonus={play:this.ddp6()/4};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,r){a.death.destroy(t,this.code)}grwE(t){return d.ddp7(t,t.playerA,t.lane)}grhC(){this.faction="U",this.rarity="C",this.name="Grove Huntress",this.jr1=this.boof4711,this.jr2=this.jr1-1,this.tribe.push("HM"),this.playTarg.player="F";const t=this.boof135;this.ftext=`Give a friendly creature ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*2,t,0)}}grhF(t,r){const e=this.boof135;t.buff(e,e)}grhE(t){const r=this.boof135;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}houndC(){this.faction="T",this.rarity="C",this.name="Magma Hound",this.jr1=this.boof4813,this.jr2=this.jr1-1,this.tribe.push("ER","EL"),this.hints=["ENS"];const t=this.boof246;this.optional=!0,this.playTarg.player="E",this.ftext=`You may deal ${t} damage to an enemy creature.`,this.bonus={play:this.ddp9(0,t,0,0)}}houndF(t,r){t.hurtDirect(this.boof246,this.code)}houndE(t){return d.ddp2(t,t.playerA,t.lane,{dmg:this.boof246})}mtxC(){this.faction="A",this.rarity="C",this.name="Matrix Warden",this.jr1=this.lValN([3,8,12]),this.jr2=this.jr1,this.tribe.push("RB");const t=this.boof3510;this.playTarg.player="F",this.ftext=`Give a friendly creature ${a.log.jr9(t,0)}.`,this.bonus={play:this.ddp9(0,t,t,0)}}mtxF(t,r){t.buff(this.boof3510,0)}mtxE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof3510)}ngbC(){this.faction="T",this.rarity="C",this.name="Nargath Bruiser",this.jr1=this.boof5814,this.jr2=this.jr1-1,this.tribe.push("ER","AS");const t=this.boof248;this.playTarg.player="F",this.ftext=`Give a friendly creature ${a.log.jr9(0,t)}.`,this.bonus={play:this.ddp9(0,t,0,0)}}ngbF(t,r){t.buff(0,this.boof248)}ngbE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,0,this.boof248)}phxsC(){this.faction="A",this.rarity="R",this.name="Phalanx Squadron",this.jr1=this.boof3714,this.jr2=this.boof61117,this.tribe.push("HM"),this.hints=["FRO"],this.playTarg.hasArmor=!0,this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature with Armor ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t,t/2,0)}}phxsF(t,r){const e=this.boof234;t.buff(e,e)}phxsE(t){const r=this.boof234;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}stdC(){this.faction="A",this.rarity="H",this.name="Shardthief Druid",this.jr1=this.boof5813,this.jr2=this.boof81318,this.tribe.push("MM"),this.hints=["ENS"],this.playTarg.canRegen,this.playTarg.player="E",this.ftext=`Negate and remove all Regenerate from an enemy creature. ${this.name} gets that much Renerate.`,this.bonus={play:this.ddp9(0,2,0,0)}}stdF(t,r){const e=t.regen;t.negateRegen=!0,r.addRegen(e)}stdE(t){const r=a.field.ddf6(t);return d.ddp3(t,r,{rgn:-r.regen})}vnfC(){this.faction="U",this.rarity="R",this.name="Venomfang",this.jr1=this.boof61014,this.jr2=this.jr1-2,this.tribe.push("SN");const t=this.boof246;this.playTarg.player="E",this.ftext=`Give an enemy creature Poison ${t}.`,this.bonus={play:this.ddp9(0,t,0,0)}}vnfF(t,r){t.addPoison(this.boof246)}vnfE(t){return d.ddp2(t,t.playerA,t.lane,{psn:this.boof246})}wbyC(){this.faction="T",this.rarity="R",this.name="Wallbreaker Yeti",this.jr1=this.boof4712,this.jr2=this.boof71116,this.tribe.push("ER","YT"),this.hints=["ENS"],this.bonus={play:this.ddp6()/4},this.playTarg.player="E",this.playTarg.level=a.target.ddf2(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${a.log.levelGateText(this.level,!0)}enemy creature with Defender.`,this.optional=!0}wbyF(t,r){a.death.destroy(t,this.code)}wbyE(t){return d.ddp7(t,t.playerA,t.lane)}wbuC(){this.faction="T",this.rarity="C",this.name="Warbringer Uranti",this.jr1=this.boof3711,this.jr2=this.jr1,this.tribe.push("LT","YT"),this.hints=["FRO"];const t=this.boof4812;this.notme=!0,this.playTarg.player="F",this.ftext=`Give another friendly creature ${a.log.jr9(t,0)} this turn.`,this.bonus={play:this.ddp9(0,t,t,0)}}wbuF(t,r){const e=d.mod("AT",this.boof4812,r.id);e.expiry="ET",t.addMod(e)}wbuE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof4812)}}class P extends Q{lookup(t){return{["ASG"]:{c:()=>this.asurgeC(),z:e=>this.asurgeZ(e),e:e=>this.asurgeE(e)},["AQE"]:{c:()=>this.aqatC(),z:e=>this.aqatZ(e),e:e=>this.aqatE(e)},["ABL"]:{c:()=>this.ablC(),z:e=>this.ablZ(e),e:e=>this.ablE(e)},["BTM"]:{c:()=>this.botC(),z:e=>this.botZ(e),e:e=>this.botE(e)},["CSU"]:{c:()=>this.csurgeC(),z:e=>this.csurgeZ(e),e:e=>this.csurgeE(e)},["CTW"]:{c:()=>this.cullC(),z:e=>this.cullZ(e),e:e=>this.cullE(e)},["CTV"]:{c:()=>this.cultC(),z:e=>this.cultZ(e),e:e=>this.cultE(e)},["CAG"]:{c:()=>this.cypaC(),z:e=>this.cypaZ(e),e:e=>this.cypaE(e)},["CBS"]:{c:()=>this.cypbC(),z:e=>this.cypbZ(e),e:e=>this.cypbE(e)},["DBT"]:{c:()=>this.dreadC(),z:e=>this.dreadZ(e),e:e=>this.dreadE(e)},["DYB"]:{c:()=>this.drybC(),z:e=>this.drybZ(e),e:e=>this.drybE(e)},["ETN"]:{c:()=>this.elnC(),z:e=>this.elnZ(e),e:e=>this.elnE(e)},["ENP"]:{c:()=>this.enpC(),z:e=>this.enpZ(e),e:e=>this.enpE(e)},["ENR"]:{c:()=>this.rageC(),z:e=>this.rageZ(e),e:e=>this.rageE(e)},["EXD"]:{c:()=>this.expdmC(),z:e=>this.expdmZ(e),e:e=>this.expdmE(e)},["FIN"]:{c:()=>this.feralC(),z:e=>this.feralZ(e),e:e=>this.feralE(e)},["FVA"]:{c:()=>this.fervassC(),z:e=>this.fervassZ(e),e:e=>this.fervassE(e)},["FLN"]:{c:()=>this.flncC(),z:e=>this.flncZ(e),e:e=>this.flncE(e)},["FFL"]:{c:()=>this.ffldC(),z:e=>this.ffldZ(e),e:e=>this.ffldE(e)},["FZS"]:{c:()=>this.frozC(),z:e=>this.frozZ(e),e:e=>this.frozE(e)},["GTH"]:{c:()=>this.ghastC(),z:e=>this.ghastZ(e),e:e=>this.ghastE(e)},["GCR"]:{c:()=>this.crushC(),z:e=>this.crushZ(e),e:e=>this.crushE(e)},["HAR"]:{c:()=>this.hartC(),z:e=>this.hartZ(e),e:e=>this.hartE(e)},["JPK"]:{c:()=>this.jpC(),z:e=>this.jpZ(e),e:e=>this.jpE(e)},["LBR"]:{c:()=>this.lbrandC(),z:e=>this.lbrandZ(e),e:e=>this.lbrandE(e)},["MSC"]:{c:()=>this.sculptC(),z:e=>this.sculptZ(e),e:e=>this.sculptE(e)},["NSL"]:{c:()=>this.natselC(),z:e=>this.natselZ(e),e:e=>this.natselE(e)},["NCV"]:{c:()=>this.nviveC(),z:e=>this.nviveZ(e),e:e=>this.nviveE(e)},["PTR"]:{c:()=>this.pwtorC(),z:e=>this.pwtorZ(e),e:e=>this.pwtorE(e)},["PSG"]:{c:()=>this.psurgeC(),z:e=>this.psurgeZ(e),e:e=>this.psurgeE(e)},["PMS"]:{c:()=>this.pslamC(),z:e=>this.pslamZ(e),e:e=>this.pslamE(e)},["ROG"]:{c:()=>this.rotgC(),z:e=>this.rotgZ(e),e:e=>this.rotgE(e)},["SAP"]:{c:()=>this.sapC(),z:e=>this.sapZ(e),e:e=>this.sapE(e)},["SVO"]:{c:()=>this.soathC(),z:e=>this.soathZ(e),e:e=>this.soathE(e)},["SHG"]:{c:()=>this.shgrC(),z:e=>this.shgrZ(e),e:e=>this.shgrE(e)},["SNB"]:{c:()=>this.snbC(),z:e=>this.snbZ(e),e:e=>this.snbE(e)},["SHV"]:{c:()=>this.sharvC(),z:e=>this.sharvZ(e),e:e=>this.sharvE(e)},["STR"]:{c:()=>this.sttorC(),z:e=>this.sttorZ(e),e:e=>this.sttorE(e)},["STO"]:{c:()=>this.sptorC(),z:e=>this.sptorZ(e),e:e=>this.sptorE(e)},["STN"]:{c:()=>this.stbrnC(),z:e=>this.stbrnZ(e),e:e=>this.stbrnE(e)},["SIN"]:{c:()=>this.sinC(),z:e=>this.sinZ(e),e:e=>this.sinE(e)},["TPT"]:{c:()=>this.tpactC(),z:e=>this.tpactZ(e),e:e=>this.tpactE(e)},["TUP"]:{c:()=>this.tugC(),z:e=>this.tugZ(e),e:e=>this.tugE(e)},["TOB"]:{c:()=>this.blightC(),z:e=>this.blightZ(e),e:e=>this.blightE(e)},["TXS"]:{c:()=>this.sporeC(),z:e=>this.sporeZ(e),e:e=>this.sporeE(e)},["TCG"]:{c:()=>this.tremcC(),z:e=>this.tremcZ(e),e:e=>this.tremcE(e)},["VGR"]:{c:()=>this.vgraC(),z:e=>this.vgraZ(e),e:e=>this.vgraE(e)},["VYE"]:{c:()=>this.vembC(),z:e=>this.vembZ(e),e:e=>this.vembE(e)},["UBL"]:{c:()=>this.uboltC(),z:e=>this.uboltZ(e),e:e=>this.uboltE(e)},["WMM"]:{c:()=>this.warC(),z:e=>this.warZ(e),e:e=>this.warE(e)},["XRW"]:{c:()=>this.xwillC(),z:e=>this.xwillZ(e),e:e=>this.xwillE(e)}}[t]}cardCast(t,r){this.lookup(t).z(r)}castEval(t,r){return this.lookup(t).e(r)}playTarg;constructor(t){super(t),this.playTarg=d.crActTarg("CARD",this.code),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.cardCode()==="NSL"&&a.field.creatByTarget(d.crFriendTarg()).length<5||t.push(this.playTarg),t}handleAction(t){this.logSpell();const r=a.field.ddf6(t);this.cardCast(this.cardCode(),r),a.turn.spellCast()}ddf7(t){return this.castEval(this.cardCode(),t)}ddf8(t){const r=ut.extractCardCode(t.trigger.logicCode);if(r==="TOB"&&t.trigger.type==="DM"){const e=t.event;if(e.battle&&e.creatureTarg&&e.creatureSrc&&e.source.id===t.creatId)return this.level===3?!0:a.cards.getCard(e.target.code).level<=this.level}else if(r==="ABL"&&t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.creatureTarg&&e.creatureSrc&&e.source.id===t.creatId}else if(r==="FZS"&&t.trigger.type==="DM"){const e=t.event;if(e.creatureTarg&&e.target.id===t.creatId)return!0}else if(r==="DYB"&&t.trigger.type==="EF"){const e=t.event;return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.ownerPlayerA}else if(r==="FVA"&&t.trigger.type==="FK"||r==="ROG"&&t.trigger.type==="DS"||r==="SHG"&&(t.trigger.type==="PT"||t.trigger.type==="VN"))return!0;return!1}jr8(t){const r=ut.extractCardCode(t.trigger.logicCode);if(r==="TOB"){const s=t.event.target;a.death.destroy(s,this.code),a.batch.triggerDone()}else if(r==="ABL")a.field.jr5(t.creatId).buff(this.level,this.level),a.batch.triggerDone();else if(r==="FVA"){const e=a.field.jr5(t.creatId),s=a.field.searchByLane(a.field.oppositeLane(e.lane),!e.owner);s&&s.hurtDirect(this.boof3612,e.code),a.batch.triggerDone()}else if(r==="FZS"){const e=a.field.jr5(t.creatId);a.death.destroy(e,this.code),a.batch.triggerDone()}else if(r==="ROG"||r==="DYB")a.field.jr5(t.creatId).buff(this.level,this.level),a.batch.triggerDone();else if(r==="SHG"){if(t.trigger.type==="VN"){const e=t.event;a.field.birthCreature(e.creature.code,"S",t.ownerPlayerA),a.batch.triggerDone()}else if(t.trigger.type==="PT"){const e=t.trigger.customCode,s=a.field.jr5(t.creatId);s.triggers.filter(u=>u.customCode===e).forEach(u=>s.removeTrigger(u)),a.batch.triggerDone()}}else super.jr8(t)}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg.canMove=!0,this.text=`Give a creature Mobility ${this.level}.`}asurgeZ(t){t.addMobility(this.level)}asurgeE(t){return d.actionEval(t,"ST","GM")}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${a.log.jr9(0,this.boof51015)}.`}aqatZ(t){t.buff(0,this.boof51015)}aqatE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,0,this.boof51015)}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${a.log.dbdtap()}, it gets ${a.log.jr9(this.level,this.level)}."`}ablZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("OL")}ablE(t){const r=d.actionEval(t,"ST","OL");return r.bonus=.5,r}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.text=`Replace an enemy ${a.log.levelGateText(this.level,!0)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=a.target.ddf2(this.level)}botZ(t){a.field.birthCreature(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}botE(t){const r=d.ddp4(t,t.playerA,t.lane,`${"BOS"}${this.level}`);return r.hints=["RE"],r}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof123n;this.text=`Give a creature ${a.log.jr9(t,t)}.`}csurgeZ(t){const r=this.boof123n;t.buff(r,r)}csurgeE(t){const r=this.boof123n;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}cullC(){this.faction="N",this.rarity="C",this.name="Cull the Weak";const t=this.boof4814;this.text=`Destroy a creature with ${t} or less attack.`,this.playTarg.maxAttack=t}cullZ(t){a.death.destroy(t,this.code)}cullE(t){return d.ddp7(t,t.playerA,t.lane)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate";const t=this.boof91421;this.text=`Replace a friendly Plant with a ${t}/${t} Treefolk.`,this.playTarg.player="F",this.playTarg.tribe="PL"}cultZ(t){a.field.birthCreature(`${"TFF"}${this.level}`,"R",t.owner,t.lane)}cultE(t){const r=d.ddp4(t,t.playerA,t.lane,`${"TFF"}${this.level}`);return r.hints=["RE"],r}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof246;this.text=`Give a creature in a center space ${a.log.jr9(t,t)}.`,this.playTarg.lanes=3}cypaZ(t){const r=this.boof246;t.buff(r,r)}cypaE(t){const r=this.boof246;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${a.log.jr9(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.faction="A"}cypbZ(t){t.buff(this.boof51015,0),t.addArmor(this.boof124)}cypbE(t){return d.ddp2(t,t.playerA,t.lane,{att:this.boof51015,arm:this.boof124})}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.hints=["LV"],this.text=`Destroy a ${a.log.levelGateText(this.level,!0)}creature.`,this.playTarg.level=a.target.ddf2(this.level)}dreadZ(t){a.death.destroy(t,this.code)}dreadE(t){return d.ddp7(t,t.playerA,t.lane)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${a.log.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${a.log.jr9(this.level,this.level)}."`}drybZ(t){t.buff(this.level,this.level),t.changed=!0,t.jr4("EF",this.code),t.hints.push("BF")}drybE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.level,this.level,"BF")}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.isFree=this.level===3,this.text=`Give a ${a.log.levelGateText(this.level,!0)}creature Defender.`,this.playTarg.canDefender=!0}enpZ(t){t.defender=!0}enpE(t){return d.ddp2(t,t.playerA,t.lane,{def:!0})}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${a.log.jr9(-this.boof51015,0)}.`}elnZ(t){t.buff(-this.boof51015,0)}elnE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,-this.boof51015)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${a.log.jr9(t,t)}.`}rageZ(t){const r=this.boof3612;t.buff(r,r)}rageE(t){const r=this.boof3612;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}expdmC(){this.faction="N",this.rarity="H",this.name="Explosive Demise",this.text=`Destroy a friendly ${a.log.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=a.target.ddf2(this.level+1),this.playTarg.player="F"}expdmZ(t){const r=t.attack;a.death.destroy(t,this.code),a.player.ddf3("E",r,this.code),this.level===3&&a.player.healPlayer("F",r)}expdmE(t){const r=a.field.ddf6(t),e=d.ddp8(t,r);return e.vectors.push(d.evalVectorPlayerDmg(!r.owner,r.attack)),this.level===3&&e.vectors.push(d.evalVectorPlayerDmg(r.owner,r.attack)),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 ${a.log.jr9(t,t,!0)} and Breakthrough.`}feralZ(t){const r=this.fiboof;t.breakthrough=!0,t.buff(r,r)}feralE(t){const r=this.fiboof;return d.ddp2(t,t.playerA,t.lane,{att:r,hlt:r,brt:!0})}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),t.hints.push("FH")}fervassE(t){return d.actionEval(t,"ST","FH")}flncC(){this.faction="T",this.rarity="R",this.name="Flame Lance";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 r=this.boof579;t.hurtDirect(r,this.code),a.player.ddf3("E",r,this.code)}flncE(t){const r=this.boof579,e=d.ddp2(t,t.playerA,t.lane,{dmg:r});return e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r)),e}ffldC(){this.faction="A",this.rarity="C",this.name="Forcefield",this.playTarg.canArmor=!0,this.text=`Give a creature Armor ${this.boof51020} this turn.`}ffldZ(t){const r=d.mod("AR",this.boof51020,this.code);r.expiry="ET",t.addMod(r)}ffldE(t){return d.ddp2(t,t.playerA,t.lane,{arm:this.boof51020})}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=a.target.ddf2(this.level),this.text=`Give a ${a.log.levelGateText(this.level,!0)}creature "When this is dealt damage, destroy it".`}frozZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("DD")}frozE(t){return d.actionEval(t,"ST","DD")}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${a.log.jr9(t,t)}.`}ghastZ(t){const r=-this.boof3612;t.buff(r,r)}ghastE(t){const r=-this.boof3612;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.isFree=this.level>1,this.isFree||(this.hints=["LV"]),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 r=t.health;a.death.destroy(t,this.code),this.level===3&&a.player.ddf3(t.owner,r,this.code)}crushE(t){const r=a.field.ddf6(t),e=d.ddp8(t,r);return this.level===3&&e.vectors.push(d.evalVectorPlayerDmg(r.owner,r.health)),e}hartC(){this.faction="A",this.rarity="C",this.name="Heavy Artillery",this.text=`Give a creature ${a.log.jr9(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}hartE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof51015)}jpC(){this.faction="A",this.rarity="C",this.name="Jet Pack",this.text=`Give a creature ${a.log.jr9(this.boof369,0)} and Mobility 1.`}jpZ(t){t.buff(this.boof369,0),t.addMobility(1)}jpE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof369,void 0,"GM")}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=a.target.ddf2(this.level+1),this.text=`Give a ${a.log.levelGateText(this.level+1)}creature ${a.log.jr9(this.boof124,0)} and Aggressive this turn.`}lbrandZ(t){const r=d.mod("AT",this.boof124,this.code),e=d.mod("AG",!0,this.code);r.expiry="ET",e.expiry="ET",t.addMod(r),t.addMod(e)}lbrandE(t){return d.ddp2(t,t.playerA,t.lane,{att:this.boof124,agr:!0})}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.isFree=this.level===3,this.playTarg.level=a.target.ddf2(this.level+1),this.text=`Remove all abilities from a ${a.log.levelGateText(this.level+1,!0)}creature.`}sculptZ(t){t.wipeAll()}sculptE(t){return d.actionEval(t,"ST","NT")}natselC(){this.faction="U",this.rarity="R",this.name="Natural Selection",this.text=`If there is a friendly creature in each space, destroy a ${a.log.levelGateText(this.level,!0)}creature.`,this.playTarg.level=a.target.ddf2(this.level)}natselZ(t){a.death.destroy(t,this.code)}natselE(t){return d.ddp7(t,t.playerA,t.lane)}nviveC(){this.faction="N",this.rarity="C",this.name="Necrovive",this.playTarg.canRegen=!0,this.text=`Give a creature Regenerate ${this.boof3612}.`}nviveZ(t){t.addRegen(this.boof3612)}nviveE(t){return d.ddp2(t,t.playerA,t.lane,{rgn:this.boof3612})}pwtorC(){this.faction="A",this.rarity="R",this.name="Power Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature ${a.log.jr9(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}pwtorE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof234)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature ${a.log.jr9(this.level,this.level)}.`}psurgeZ(t){t.buff(this.level,this.level)}psurgeE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.level,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.text=`Give a creature ${a.log.jr9(this.boof71116,0)} this turn.`}pslamZ(t){const r=d.mod("AT",this.boof71116,this.code);r.expiry="ET",t.addMod(r)}pslamE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof71116)}rotgC(){this.faction="N",this.rarity="H",this.name="Rite of the Grimgaunt",this.text=`Give a creature "When a creature is destroyed, this gets ${a.log.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0,t.jr4("DS",this.code),t.hints.push("BD")}rotgE(t){return d.actionEval(t,"ST","BD")}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=a.target.ddf2(this.level),this.text=`Reduce a ${a.log.levelGateText(this.level,!0)}creature's attack to 0.`}sapZ(t){t.buff(-t.attack,0)}sapE(t){const r=a.field.ddf6(t);return d.actionEvalBuffC(t,r,-r.attack)}soathC(){this.faction="U",this.rarity="C",this.name="Savage Oath",this.level===1&&(this.hints=["LV"]);const t=this.saboof;this.text=`Give an Uterra creature ${a.log.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.faction="U"}soathZ(t){const r=this.saboof;t.buff(r,r),t.breakthrough=!0}soathE(t){const r=this.saboof;return d.ddp2(t,t.playerA,t.lane,{att:r,hlt:r,brt:!0})}get saboof(){return this.lValN([2,6,15])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.isFree=this.level===3,this.playTarg.level=a.target.ddf2(this.level+1),this.text=`Give a ${a.log.levelGateText(this.level+1,!0)}friendly creature "Vengeance: Spawn this" this turn.`}shgrZ(t){const r=a.genId(a.state.ddf9()),e=t.jr4("VN",this.code);e.customCode=r,e.changes=!0;const s=t.jr4("PT",this.code);s.customCode=r,t.hints.push("LZ")}shgrE(t){return d.actionEval(t,"ST","LZ")}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.text=`Give a creature ${a.log.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){const r=this.level*a.field.ddf1().length;t.buff(r,r)}sinE(t){const r=this.level*a.field.ddf1().length;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}get snbboof(){return-1*(this.level+7)}snbC(){this.faction="A",this.rarity="C",this.name="Sonic Burst",this.text=`Give a creature ${a.log.jr9(this.snbboof,0)}.`}snbZ(t){t.buff(this.snbboof,0)}snbE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.snbboof)}sharvC(){this.faction="N",this.rarity="H",this.name="Soul Harvest";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(a.death.destroy(t,this.code),this.level===1){const r=a.turn.freeCard(this.code);r.condition.level=a.target.ddf2(1)}else a.state.gs.turn.regularPlays+=this.level-1}sharvE(t){return d.ddp7(t,t.playerA,t.lane,["FRC","SD"])}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Regenerate ${this.boof234}.`,this.playTarg.canRegen=!0}sttorZ(t){t.addRegen(this.boof234)}sttorE(t){return d.ddp2(t,t.playerA,t.lane,{rgn:this.boof234})}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Poison ${this.boof234}.`}sptorZ(t){t.addPoison(this.boof234)}sptorE(t){return d.ddp2(t,t.playerA,t.lane,{psn:this.boof234})}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${a.log.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hasDefender=!0}stbrnZ(t){const r=this.boof579;t.buff(r,r),t.negateDefender=!0}stbrnE(t){const r=this.boof579;return d.ddp2(t,t.playerA,t.lane,{att:r,hlt:r,noD:!0})}tpactC(){this.faction="N",this.rarity="C",this.name="Tarsian Pact";const t=this.boof235;this.text=`Give a Nekrium creature ${a.log.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.faction="N"}tpactZ(t){const r=this.boof235;t.buff(r,r),t.addRegen(r)}tpactE(t){const r=this.boof235;return d.ddp2(t,t.playerA,t.lane,{att:r,hlt:r,rgn:r})}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.text=`Give a Robot ${a.log.jr9(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),t.buff(this.boof4612,0)}tugE(t){return d.ddp2(t,t.playerA,t.lane,{att:this.boof4612,arm:this.boof236})}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${a.log.dbdtac(this.level)}, destroy that creature."`}blightZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("BX")}blightE(t){return d.actionEval(t,"ST","BX")}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}.`}sporeZ(t){t.addPoison(this.tspois)}sporeE(t){return d.ddp2(t,t.playerA,t.lane,{psn:this.tspois})}tremcC(){this.faction="T",this.rarity="C",this.name="Tremorcharge",this.text=`Give a Tempys creature ${a.log.jr9(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T"}tremcZ(t){t.buff(0,this.boof4812),t.addMobility(this.level)}tremcE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,void 0,this.boof4812,"GM")}uboltC(){this.faction="T",this.rarity="R",this.name="Uranti Bolt",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 r=d.mod("DF",!0,this.code);r.expiry="EN",t.addMod(r)}uboltE(t){return d.ddp2(t,t.playerA,t.lane,{dmg:this.ubzap,def:!0})}get ubzap(){return this.lValN([3,10,20])}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 r=this.boof246;a.field.creatByTarget(d.crFriendNotMeTarg(t.id)).forEach(e=>{e.heal(r)})}vgraE(t){const r=this.boof246,e=a.field.ddf6(t),s=d.actionEvalBuffC(t,e,0,this.boof101520),c=a.field.creatByTarget(d.crFriendNotMeTarg(e.id)).map(u=>{const m=d.ddp1(u.owner,u.lane);return m.health=r,m});return s.vectors.push(...c),s}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace";const t=this.boof468,r=t*-1;this.text=`Give a creature ${a.log.jr9(r,r)}. You gain ${t} health.`}vembZ(t){const r=this.boof468,e=-r;t.buff(e,e),a.player.healPlayer(a.state.getActivePlayer(),r)}vembE(t){const r=this.boof468,e=-r,s=d.actionEvalBuffN(t,t.playerA,t.lane,e,e);return s.vectors.push(d.evalVectorPlayerLife(a.state.ddf9(),r)),s}warC(){this.faction="A",this.rarity="H",this.name="Warmonger Mod";let t=this.level,r=3;this.level===1&&(this.playTarg.level="LN",r=2,t=2),this.text=`Give a ${a.log.levelGateText(r,!0)}creature ${t}x attack.`}warZ(t){const r=this.level===3?2:1;t.buff(t.attack*r,0)}warE(t){const r=this.level===3?2:1;return d.actionEvalBuffN(t,t.playerA,t.lane,Ht+r)}xwillC(){this.faction="N",this.rarity="H",this.name="Xrath's Will";const t=this.boof3612;this.text=`Destroy an enemy creature with ${t} or less attack. You may play and additional Zombie this turn.`,this.playTarg.player="E",this.playTarg.maxAttack=t}xwillZ(t){a.death.destroy(t,this.code);const r=a.turn.freeCard(this.code);r.condition.tribe="ZB"}xwillE(t){return d.ddp7(t,t.playerA,t.lane,"FRZ")}}class Ue extends Q{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.isFree=this.level===3,this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}playTargets(){const t=super.playTargets(),r=this.poisTarg();return this.level===1?t.push(r):a.field.creatByTarget(r).length>0&&t.push(a.target.boardTarget("CARD",this.code)),t}handleAction(t){if(this.logSpell(),this.level===1){const r=a.field.ddf6(t);r.addPoison(r.poison)}else a.field.creatByTarget(this.poisTarg()).forEach(e=>{e.addPoison(e.poison)});a.turn.spellCast()}poisTarg(){const t=d.crEnemyActTarg("CARD",this.code);return t.hasPoison=!0,t}ddf7(t){const r=Ht+1,e=d.actionEval(t,"ST"),s=!a.state.ddf9();let c;return t.zone==="R"?c=a.field.laneIdx:c=[t.lane],e.vectors=c.map(u=>d.ddp1(s,u,{psn:r})),e}}class We extends x{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Echowisp",this.jr1=this.lValN([7,8,10]),this.jr2=this.boof135,this.tribe.push("ST"),this.level===3?(this.text="Forge: Put a copy of Echowisp into each available space.",this.hints=["EML"]):(this.text="Forge: You may put a copy of Echowisp into an adjacent space.",this.hints=["EMA"])}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("FR",this.code);return s.interactive=this.level<3,e}jr8(t){const r=d.actionTarget("TF","CARD",this.code,t.trigger.creatId);if(r.player="F",r.field="E",this.level<3){const s=a.field.jr5(t.trigger.creatId);r.lanes=s.adjacent}let e=a.target.toActions(r);if(e.length>0)if(this.level<3)a.action.ddf5([a.action.noneEndTrigger(),...e]);else{const s=Date.now();e.forEach(c=>a.field.birthCreature(this.code,"P",c.playerA,c.lane,s)),a.batch.triggerDone()}else a.batch.triggerDone()}handleAction(t){a.field.birthCreature(this.code,"P",t.playerA,t.lane),a.action.actionDone(!0)}ddf7(t){return d.ddp4(t,t.playerA,t.lane,this.code)}}class Oe extends x{lookup(t){return{["TVG"]:{c:()=>this.tvgC(),m:e=>this.tvgM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}armThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("AR",this.code);return s.area="A",e}enforceEffect(t,r){this.armThreshold<=r.armor?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}tvgC(){this.faction="A",this.rarity="R",this.name="Tower Vanguard",this.jr1=this.lValN([3,6,11]),this.jr2=this.lValN([7,13,21]),this.tribe.push("RB"),this.hints=["LKA"],this.armThreshold=1;const t=this.boof247;this.text=`While ${this.name} has Armor, it gets ${a.log.jr9(t,0)}.`,this.bonus={play:this.ddp9(0,t,t,0)}}tvgM(t){return[d.mod("AT",this.boof247,t.id)]}}class Jt extends x{lookup(t){return{["CIN"]:{c:()=>this.cyinC(),m:e=>this.cyinM(e)},["HWM"]:{c:()=>this.hlwmC(),m:e=>this.hlwmM(e)},["LSP"]:{c:()=>this.lspC(),m:e=>this.lspM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=["ATH"]}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("AT",this.code);return s.area="A",e}enforceEffect(t,r){this.attThreshold<=r.attack?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}cyinC(){this.faction="A",this.rarity="R",this.name="Cypien Infiltrator",this.jr1=this.boof61117,this.jr2=this.jr1-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[d.mod("BT",!0,t.id)]}hlwmC(){this.faction="A",this.rarity="L",this.name="Hinterland Watchman",this.jr1=this.lValN([4,7,15]),this.jr2=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}.`,this.bonus={exist:this.ddp9(0,this.lValN([1,9,17]),0,0)*2}}hlwmM(t){const r=[d.mod("MB",3,t.id)];return this.level>1&&r.push(d.mod("AR",5,t.id)),this.level===3&&(r.push(d.mod("BT",!0,t.id)),r.push(d.mod("AG",!0,t.id)),r.push(d.mod("RG",5,t.id))),r}lspC(){this.faction="A",this.rarity="C",this.name="Lightshield Patrol",this.jr1=this.lValN([4,7,15]),this.jr2=this.boof51020,this.tribe.push("HM"),this.attThreshold=this.jr2,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Armor ${this.boof234}.`}lspM(t){return[d.mod("AR",this.boof234,t.id)]}}class oe extends x{friendNotMe(t){const r=d.crNotMeTarg(t.id);return r.player=a.player.toTarget(t.owner),r}friendNone(t){const r=d.crTarg();return r.player=a.player.toTarget(t.owner),r.lanes=[],r}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("PS",this.code);return s.area="C",e}enforcementActive(t){return t.status==="A"}applyEffect(t,r,e){const s=this.friendNotMe(t),c=a.field.creatByTarget(s),u=a.field.creatByTarget(e);c.forEach(m=>{u.includes(m)?m.addModSafe(r):m.removeModSafe(t.id)})}}class Qt extends oe{lookup(t){return{["HTR"]:{c:()=>this.hrtC(),m:e=>this.hrtM(e),t:e=>this.hrtT(e)},["KKK"]:{c:()=>this.kkkC(),m:e=>this.kkkM(e),t:e=>this.kkkT(e)},["XDV"]:{c:()=>this.xdvC(),m:e=>this.xdvM(e),t:e=>this.xdvT(e)}}[t]}createMod(t,r){return this.lookup(t).m(r)}effTargs(t,r){return this.lookup(t).t(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t,r){const e=this.cardCode(),s=this.createMod(e,r),c=this.enforcementActive(r)?this.effTargs(e,r):this.friendNone(r);this.applyEffect(r,s,c)}hrtC(){this.faction="U",this.rarity="L",this.name="Heart Tree",this.jr1=0,this.jr2=this.lValN([10,15,30]),this.initRegen=this.boof246,this.initDefend=!0,this.tribe.push("PL"),this.hints=["FRS"],this.text=`Each other friendly creature gets Regenerate ${this.initRegen}.`,this.bonus={exist:this.ddp9(0,this.initRegen,0,0)*2}}hrtM(t){return d.mod("RG",this.initRegen,t.id)}hrtT(t){return this.friendNotMe(t)}kkkC(){if(this.faction="T",this.rarity="L",this.name="Korok, Khan of Kadras",this.jr1=this.lValN([4,7,12,18]),this.jr2=this.lValN([7,12,18,26]),this.initAggro=!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.`,this.hints=["FRS"],this.bonus={exist:(this.level-1)*.5}}}kkkM(t){return d.mod("AG",!0,t.id)}kkkT(t){const r=this.friendNotMe(t);return this.level===1?r.lanes=[]:r.level=a.target.ddf2(this.level-1),r}xdvC(){this.faction="N",this.rarity="H",this.name="Xrath, Dreadnight Of Varna",this.jr1=this.boof5914,this.jr2=this.jr1+1,this.initRegen=this.boof248,this.tribe.push("ZB"),this.text=`Each other friendly Zombie gets Regenerate ${this.initRegen}`,this.bonus={exist:this.ddp9(0,this.initRegen,0,0)}}xdvM(t){return d.mod("RG",this.initRegen,t.id)}xdvT(t){const r=this.friendNotMe(t);return r.tribe="ZB",r}}class Ze extends x{lookup(t){return{["AHL"]:{c:()=>this.ahlC(),m:e=>this.ahlM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("PS",this.code);return s.area="C",e}enforceEffect(t,r){const e=d.crNotMeTarg(r.id);e.player=a.player.toTarget(r.owner),a.field.creatByTarget(e).length===0?this.createMods(this.cardCode(),r).forEach(c=>{r.addModSafe(c)}):r.removeModSafe(r.id)}ahlC(){this.faction="A",this.rarity="H",this.name="Alloyin Highlander",this.jr1=this.lValN([5,7,10]),this.jr2=this.boof6914,this.tribe.push("HM"),this.text=`While ${this.name} is your only friendly creature, it gets ${a.log.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}ahlM(t){return[d.mod("AT",this.boof4812,t.id),d.mod("AR",this.boof248,t.id)]}}class he extends x{lookup(t){return{["NXP"]:{c:()=>this.nxpC(),m:e=>this.nxpM(e)},["SKG"]:{c:()=>this.skgC(),m:e=>this.skgM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=["NX"]}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("PS",this.code);return s.area="C",e}enforceEffect(t,r){r.lane===3?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}nxpC(){this.faction="A",this.rarity="C",this.name="Nexus Pilot",this.jr1=this.boof358,this.jr2=this.boof4710,this.tribe.push("HM"),this.text=`While ${this.name} is in the center space, it gets ${a.log.jr9(this.jr1,this.jr2)}.`,this.bonus={play:this.ddp9(0,this.jr1+this.jr2,this.jr1,0)}}nxpM(t){return[d.mod("AT",this.jr1,t.id),d.mod("HL",this.jr2,t.id),d.mod("MH",this.jr2,t.id)]}skgC(){this.faction="A",this.rarity="C",this.name="Skyknight Glider",this.jr1=this.boof5916,this.jr2=this.jr1+1,this.tribe.push("HM"),this.text=`While ${this.name} is in the center space, it gets Mobility 2.`}skgM(t){return[d.mod("MB",2,t.id)]}}class _t extends x{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:e=>this.cctM(e)},["GHB"]:{c:()=>this.ghbC(),m:e=>this.ghbM(e)},["PYG"]:{c:()=>this.pygC(),m:e=>this.pygM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}likesOpposed=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=[this.likesOpposed?"OP":"OL"]}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("PS",this.code);return s.area="A",e}enforceEffect(t,r){!!r.opposed===this.likesOpposed?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}cctC(){this.faction="T",this.rarity="R",this.name="Cloudcleaver Titan",this.jr1=this.boof4812,this.jr2=this.lValN([7,10,16]),this.tribe.push("WN","GT"),this.initMobile=this.level;const t=this.boof246;this.bonus={play:this.ddp9(0,t,t,0)},this.text=`While ${this.name} is unopposed, it gets ${a.log.jr9(t,0)}.`}cctM(t){return[d.mod("AT",this.boof246,t.id)]}ghbC(){this.faction="U",this.rarity="R",this.name="Gemhide Basher",this.jr1=this.lValN([5,10,16]),this.jr2=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[d.mod("AG",!0,t.id)]}pygC(){this.faction="T",this.rarity="H",this.name="Pyre Giant",this.jr1=this.boof468,this.jr2=this.boof234,this.tribe.push("FR","GT"),this.initAggro=!0,this.bonus={play:this.ddp9(0,this.jr1,this.jr1,0)},this.text=`While ${this.name} is unopposed, it gets ${a.log.jr9(this.jr1,0)}.`}pygM(t){return[d.mod("AT",this.jr1,t.id)]}}class Ut extends oe{lookup(t){return{["ALG"]:{c:()=>this.algnC(),m:e=>this.algnM(e)},["ALS"]:{c:()=>this.alstC(),m:e=>this.alstM(e)},["BTN"]:{c:()=>this.btcC(),m:e=>this.btcM(e)},["NXT"]:{c:()=>this.ntcC(),m:e=>this.ntcM(e)}}[t]}createMod(t,r){return this.lookup(t).m(r)}constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=this.nexus?["NX"]:["LJ"]}nexus=!1;enforcementActive(t){return super.enforcementActive(t)?this.nexus?t.lane===3:!0:!1}enforceEffect(t,r){const e=this.cardCode(),s=this.createMod(e,r);let c;this.enforcementActive(r)?(c=this.friendNotMe(r),this.nexus?c.lanes=[1,2,4,5]:c.lanes=r.adjacent):c=this.friendNone(r),this.applyEffect(r,s,c)}algnC(){this.faction="A",this.rarity="R",this.name="Alloyin General",this.jr1=this.boof246,this.jr2=this.boof81318,this.tribe.push("HM"),this.text=`Adjacent creatures gets ${a.log.jr9(this.jr1,0)}.`,this.bonus={exist:this.ddp9(0,this.jr1,this.jr1,0)}}algnM(t){return d.mod("AT",this.jr1,t.id)}alstC(){this.faction="A",this.rarity="H",this.name="Alloyin Strategist",this.jr1=this.boof4814,this.jr2=this.jr1+1,this.initMobile=this.level,this.tribe.push("HM");const t=this.boof246;this.text=`Adjacent creatures gets ${a.log.jr9(t,0)}.`,this.bonus={exist:this.ddp9(0,t,t,0)}}alstM(t){return d.mod("AT",this.boof246,t.id)}btcC(){this.faction="A",this.rarity="H",this.name="Battle Techtician",this.jr1=this.boof3714,this.jr2=this.boof71117,this.tribe.push("HM"),this.nexus=!0;const t=this.boof248;this.text=`While ${this.name} is in the center space, each other friendly creature gets ${a.log.jr9(t,0)}.`,this.bonus={exist:this.ddp9(0,t,t,0)*2}}btcM(t){return d.mod("AT",this.boof248,t.id)}ntcC(){this.faction="A",this.rarity="H",this.name="Nexus Techtician",this.jr2=this.boof6916,this.jr1=this.jr2-3,this.tribe.push("HM"),this.nexus=!0;const t=this.boof235;this.text=`While ${this.name} is in the center space, each other friendly creature gets Armor ${this.boof235}.`,this.bonus={exist:this.ddp9(0,t,0,0)*4}}ntcM(t){return d.mod("AR",this.boof235,t.id)}}class Wt extends x{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC()})[t]()}targAction(t){a.field.birthCreature(this.spawnCode,"P",t.playerA,t.lane)}adjacent=!1;optional=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const r=a.log.forglied(this.allied);this.text=r+": "+this.ftext}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("FR",this.code);return s.interactive=!0,e}jr8(t){if(this.allied==="X"||a.turn.allied(this.allied)){const r=d.actionTarget("TF","CARD",this.code,t.trigger.creatId);if(r.player="F",r.field="E",this.adjacent){const s=a.field.jr5(t.trigger.creatId);r.lanes=s.adjacent}const e=a.target.toActions(r);e.length>0?(this.optional&&e.push(a.action.noneEndTrigger()),a.action.ddf5(e)):a.batch.triggerDone()}else a.batch.triggerDone()}handleAction(t){this.targAction(t),a.action.actionDone(!0)}ddf7(t){return d.ddp4(t,t.playerA,t.lane,this.spawnCode)}bwdC(){this.faction="U",this.rarity="C",this.name="Branchweaver Druid",this.jr1=1,this.jr2=1,this.tribe.push("HM"),this.hints=["EMO"],this.spawnCode=`${"TFD"}${this.level}`,this.optional=!0;const t=this.boof5714;this.ftext=`You may put a ${t}/${t} ${N.minionName(3)} into another space.`}btsC(){this.faction="U",this.rarity="C",this.name="Brighttusk Sower",this.jr1=this.lValN([6,8,10]),this.jr2=this.jr1,this.tribe.push("TK"),this.hints=["EMA"],this.spawnCode=N.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=N.minionBuff(this.level);this.ftext=`You may put a ${t}/${t} ${N.minionName(this.level)} into an adjacent space.`}escarC(){this.faction="A",this.rarity="H",this.name="Esperian Scarab",this.jr1=this.lValN([3,4,7]),this.jr2=this.boof5711,this.initArmor=this.boof135,this.tribe.push("RB"),this.allied="U",this.hints=["EMO","ALU"],this.spawnCode=this.code,this.optional=!0,this.ftext=`You may but a copy of ${this.name} another space.`}ethhC(){this.faction="U",this.rarity="C",this.name="Ether Hounds",this.jr1=this.boof369,this.jr2=this.jr1,this.tribe.push("ST"),this.hints=["EMO"],this.spawnCode=this.code,this.ftext="Put a copy of this into an available space."}}class ze extends x{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Esperian Steelplate",this.jr1=this.boof369,this.jr2=this.boof6916,this.tribe.push("IN"),this.hints=["ALA"],this.text=`Activate: Heal ${this.boof358} damage from each other friendly creature. Allied Alloyin: Armor ${this.boof247}.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}canActivate(t){const r=d.crFriendNotMeTarg(t.id);return a.field.creatByTarget(r).length>0}startActivation(t){const r=this.boof358,e=d.crFriendNotMeTarg(t.id);a.field.creatByTarget(e).forEach(s=>{s.heal(r)}),t.endActivation()}jr8(t){a.turn.allied("A")&&a.field.jr5(t.creatId).addArmor(this.boof247),a.batch.triggerDone()}}class Ke extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Everflame Phoenix",this.jr1=this.lValN([7,0,22]),this.jr2=this.lValN([6,1,15]),this.tribe.push("PX"),this.initMobile=this.lValN([1,0,2]),this.level===2?(this.initDefend=!0,this.text=`When you gain a rank, replace ${this.name} with a level 3 ${this.name}.`,this.hints=["RH","LV"],this.bonus={exist:this.ddp9(1,37,22,0)}):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this space.`,this.bonus={exist:this.ddp9(1,1,0,0)})}jr3(t,r){const e=super.jr3(t,r);return this.level===2?e.jr4("RU",this.code):this.level===3&&e.jr4("VN",this.code),e}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.ownerPlayerA:super.ddf8(t)}jr8(t){if(t.trigger.type==="RU"){const r=a.field.jr5(t.creatId);a.field.birthCreature(`${"EFP"}3`,"R",r.owner,r.lane)}else if(t.trigger.type==="VN"){const e=t.event.creature;a.field.birthCreature(`${"EFP"}2`,"P",e.owner,e.lane)}a.batch.triggerDone()}}class Ye extends Q{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const r=this.boof4711;this.text=`Deal ${r} damage to an enemy creature. Give a friendly creature ${a.log.jr9(r,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(d.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=this.boof4711;s.hurtDirect(c,this.code);const u=d.mod("AT",c,this.code);u.expiry="ET",e.addMod(u),a.turn.spellCast()}}friends(t=""){const r=d.crFriendActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r)}getCardActions(t,r){const e=a.field.ddf6(t),s=this.friends(e.id);return s.push(a.action.cancelAction()),s}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=this.boof359,s=d.actionEvalBuffN(t,t.playerA,t.lane,e),c=a.field.jr5(r[1]);return s.vectors.push(d.ddp1(c.owner,c.lane,{dmg:e})),s}}}class qe extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Glaceus, Tundra Tyrant",this.jr1=this.boof5916,this.jr2=this.jr1+2,this.tribe.push("IC","EL"),this.hints=["TL"];const r=`Gain Rank: each enemy ${a.log.levelGateText(this.level,!0)}creature gets "When this is dealt damage, destroy it."`,e=this.level===3?"At the start of each turn, deal 1 damage to each enemy creature. ":"";this.text=e+r}jr3(t,r){const e=super.jr3(t,r);return e.jr4("RU",this.code),this.level===3&&e.jr4("TS",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;if(r.creatureTarg&&r.target.id===t.creatId)return!0}return t.trigger.type==="RU"||t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="RU"){const r=d.crEnemyTarg();r.level=a.target.ddf2(this.level),a.field.creatByTarget(r).forEach(e=>{e.jr4("DM",this.code),e.hints.push("DD"),e.changed=!0})}else if(t.trigger.type==="TS"){const r=Date.now();a.field.qEnemyCreats().forEach(e=>{e.hurtDirect(1,this.code,r)})}else if(t.trigger.type==="DM"){const r=a.field.jr5(t.creatId);a.death.destroy(r,this.code),a.batch.triggerDone()}a.batch.triggerDone()}}class Xe extends Q{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 ${a.log.levelGateText(this.level+1,!0)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=Date.now();a.death.destroy(s,this.code,c),a.death.destroy(e,this.code,c),a.turn.spellCast()}}enemyTargActions(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return r.level=a.target.ddf2(this.level+1),a.target.toActions(r)}getCardActions(t,r){const e=a.field.ddf6(t),s=this.enemyTargActions(e.id);return s.push(a.action.cancelAction()),s}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=a.field.jr5(r[1]),s=d.ddp8(t,e,"SD"),c=d.ddp1(t.playerA,t.lane);return c.destroy=!0,s.vectors.push(c),s}}}class je extends Q{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const r=this.boof359;this.text=`Give a friendly creature +${r} attack. Give an enemy creature -${r} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=this.boof359;s.buff(c,0),e.buff(-c,0),a.turn.spellCast()}}getCardActions(t,r){const e=a.field.ddf6(t),s=this.enemyTargActions(e.id);return s.push(a.action.cancelAction()),s}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=d.actionEval(t,"ST"),s=a.field.ddf6(t),c=a.field.jr5(r[1]),u=this.boof359;return e.vectors.push(d.ddp1(s.owner,s.lane,{att:-u}),d.ddp1(c.owner,c.lane,{att:u})),e}}enemyTargActions(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r)}}class Je extends x{constructor(t){super(t),this.faction="U",this.rarity="C",this.name="Hunting Pack",this.jr1=this.boof3612,this.jr2=this.boof248,this.tribe.push("WF"),this.hints=["EML"],this.text=`When ${this.name} enters play, you have a 50% chance to put a copy of ${this.name} into an available space.`}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("EF",this.code);return s.interactive=!0,e}handleAction(t){a.field.birthCreature(this.code,"P",t.playerA,t.lane),a.action.actionDone(!0)}ddf8(t){return t.trigger.type==="EF"&&t.event.creature.id===t.creatId}jr8(t){if(a.randInt(0,2)===1){const e=d.actionTarget("TF","CARD",this.code);e.player="F",e.field="E";const s=d.actionTarget("TB","NOTR",this.code),c=a.target.toActions([e,s]);c.length===1?a.batch.triggerDone():a.action.ddf5(c)}else a.batch.triggerDone()}ddf7(t){return d.ddp4(t,t.playerA,t.lane,this.code)}}class Qe extends x{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Leafkin Progenitor",this.jr1=this.boof3711,this.jr2=this.jr1,this.tribe.push("PL"),this.level===3?(this.text=`Activate: Put a level 1 ${this.name} into an adjacent available space.`,this.bonus={exist:this.ddp9(1,6,3,0)}):(this.text=`Activate: Replace this with a level ${this.level+1} ${this.name}.`,this.bonus={exist:this.ddp9(0,12*this.level,6*this.level,0)})}canActivate(t){return this.level===3?a.action.emptyAdjacents(t).length>0:!0}startActivation(t){this.level===3?a.action.ddf5(this.getCardActions(d.ddf4(),t)):(a.field.birthCreature(this.leafCode(this.level+1),"R",t.owner,t.lane),t.endActivation())}handleAction(t){const r=a.field.jr5(t.param);a.field.birthCreature(this.leafCode(1),"P",t.playerA,t.lane),r.endActivation()}getCardActions(t,r){const e=r??a.field.jr5(t.param),s=a.action.emptyAdjacents(e);return s.push(a.action.cancelAction()),s}ddf7(t){if(t.actionKey==="ACTV"){if(this.level===3)return d.ddp5(t);{const r=a.field.jr5(t.param),e=d.ddp4(t,r.owner,r.lane,this.leafCode(this.level+1));return e.hints=["RE"],e}}else{const r=t;return d.ddp4(t,r.playerA,r.lane,this.leafCode(1))}}leafCode(t){return`${"LKP"}${t}`}}class le extends x{cardConstruct(t){({["AFO"]:()=>this.aetorC(),["TSM"]:()=>this.tsmithC()})[t]()}targAction(t,r,e){({["AFO"]:(c,u)=>this.doNossing(c,u),["TSM"]:(c,u)=>this.doNossing(c,u)})[t](r,e)}playTarg;optional=!1;ftext="";forgeLevels=[1,2,3,4];constructor(t){super(t),this.playTarg=d.lvlHandActTarg(this.code),this.cardConstruct(this.cardCode()),this.forgeLevels.includes(this.level)&&(this.text="Forge: "+this.ftext)}jr3(t,r){const e=super.jr3(t,r);if(this.forgeLevels.includes(this.level)){const s=e.jr4("FR",this.code);s.interactive=!0}return e}handleAction(t){a.turn.levelAndDiscard(t);const r=a.field.jr5(t.param);this.targAction(this.cardCode(),t,r),a.action.actionDone(!0)}jr8(t){const r=a.target.toActions(this.playTarg);r.length>0?(r.forEach(e=>{e.param=t.creatId}),this.optional&&r.push(a.action.noneEndTrigger()),a.action.ddf5(r)):a.batch.triggerDone()}doNossing(t,r){}ddf7(t){return d.actionEval(t,"DC")}aetorC(){this.faction="A",this.rarity="C",this.name="Aetherforge Oracle",this.jr1=this.boof61218,this.jr2=this.boof246,this.tribe.push("HM"),this.optional=!0,this.playTarg.card="S",this.ftext="You may discard and level up a spell.",this.bonus={play:.5}}tsmithC(){this.faction="A",this.rarity="C",this.name="Technosmith",this.jr1=this.boof5915,this.jr2=this.jr1-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`You may ${a.log.daluac()}.`,this.bonus={play:.5}}}class _e extends Q{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Lightning Spark",this.text=`Deal ${this.boof6812} damage to a creature or player.`}playTargets(){const t=super.playTargets();return t.push(d.crActTarg("CARD",this.code)),t.push(d.actionTarget("TP","CARD",this.code)),t}handleAction(t){this.logSpell();const r=this.boof6812;t.zone==="P"?a.player.ddf3(t.playerA,r,this.code):a.field.ddf6(t).hurtDirect(r,this.code),a.turn.spellCast()}ddf7(t){const r=this.boof6812,e=d.actionEval(t,"ST");if(t.zone==="P")e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r));else{const s=t;e.vectors.push(d.ddp1(s.playerA,s.lane,{dmg:r}))}return e}}class tr extends Q{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metasight",this.maxLevel=2,this.isFree=this.level===2,this.text="Discard two cards and level them."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(t.position0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.jr5(t.param);a.field.birthCreature(r.code,"P",t.playerA,t.lane),r.endActivation()}getCardActions(t,r){const e=r??a.field.jr5(t.param),s=a.action.emptyAdjacents(e);return s.push(a.action.cancelAction()),s}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=t;return d.ddp4(t,r.playerA,r.lane,this.code)}}}class ir extends x{constructor(t){if(super(t),this.faction="U",this.rarity="L",this.name="Mimicwurm",this.jr1=7,this.jr2=this.jr1,this.tribe.push("WR"),this.level>1){this.hints=[this.level===2?"EMO":"EML"];const r=this.level-1;this.bonus={play:this.ddp9(r,14*r,7*r,0)}}this.text=this.lValS(["","Forge: You may put a level 1 Mimicwurm into another space.","Forge: You may put a level 2 Mimicwurm into another space. Then you may put a level 1 Mimicwurm into another space."])}jr3(t,r){const e=super.jr3(t,r);if(this.level>1){const s=e.jr4("FR",this.code);s.interactive=!0}return e}handleAction(t){a.deTil(t.param)[0]==="P1"?this.level===3?(this.wurmsign(2,t),a.action.ddf5(this.getCardActions(t))):(this.wurmsign(1,t),a.action.actionDone(!0)):(this.wurmsign(1,t),a.action.actionDone(!0))}jr8(t){a.action.ddf5(this.fieldActions("P1",[t.event.creature.lane]))}fieldActions(t,r){const e=d.actionTarget("TF","CARD",this.code,a.enTil(t,r[0]));e.player="F",e.lanes=a.field.laneIdx.filter(c=>!r.includes(c));const s=a.target.toActions(e);return s.push(a.action.noneEndTrigger()),s}wurmsign(t,r){a.field.birthCreature(this.wurmCode(t),"R",r.playerA,r.lane)}wurmCode(t){return`${"MMW"}${t}`}getCardActions(t,r){const e=a.deTil(t.param),s=[t.lane,parseInt(e[1])];return this.fieldActions("P2",s)}ddf7(t){const r=a.deTil(t.param),e=this.level===2||r[0]==="P2"?1:2,s=d.ddp4(t,t.playerA,t.lane,this.wurmCode(e));return s.final=e===1,s.hints=["RE"],s}}class ar extends x{constructor(t){super(t),this.faction="N",this.rarity="T",this.name="Netherdrake",this.jr1=this.boof4815,this.jr2=this.jr1,this.initMobile=this.lValN([0,0,1]),this.tribe.push("DG"),this.hints=["FK"],this.text=`When this enters play or moves into a lane, destroy the opposing ${a.log.levelGateText(this.level,!0)}creature.`}get image(){return this.rawImage(`${"NSH"}${this.level}`)}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FK",this.code),e.jr4("EF",this.code),e}ddf8(t){return t.trigger.type==="EF"&&t.event.creature.id===t.creatId}jr8(t){const e=t.event.creature.opposed;e&&a.target.levelTestCommon(e.level,this.level)&&a.death.destroy(e,this.code),a.batch.triggerDone()}}class sr extends Q{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const r=this.boof246,e=r*-1;this.text=`Give a friendly Zombie ${a.log.jr9(r,r,!0)}, and Regenerate ${r}. Then give an enemy non-Zombie ${a.log.jr9(e,e)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");r.tribe="ZB",t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=this.boof246;s.buff(c,c),s.addRegen(c),e.buff(-c,-c),a.turn.spellCast()}}nonZombies(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r).filter(e=>{const s=e;return!a.field.ddf6(s).isTribe("ZB")})}getCardActions(t,r){if(t.actionKey==="CARD"){const e=a.field.ddf6(t),s=a.action.cancelAction(),c=this.nonZombies(e.id);return c.push(s),c}return super.getCardActions(t,r)}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=a.field.jr5(r[1]),s=this.boof246,c=d.ddp3(t,e,{att:s,hlt:s,rgn:s});return c.vectors.push(d.ddp1(t.playerA,t.lane,{att:-s,hlt:-s})),c}}}class nr extends x{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Onyxium Allomancer",this.jr1=this.boof248,this.jr2=this.boof61016,this.tribe.push("HM"),this.hints=["ALN","OL"];const r=this.boof358;this.text=`Activate: Discard and level up a card. Allied Nekrium: Regenerate ${r}.`,this.bonus={exist:this.ddp9(0,r,0,0,.5)}}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}canActivate(t){return a.state.getPlayer(t.owner).hand.some(e=>a.cards.getCard(e).canLevel())}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.jr5(t.param);a.turn.levelAndDiscard(t),r.endActivation()}jr8(t){a.turn.allied("N")&&a.field.jr5(t.creatId).addRegen(this.boof358),a.batch.triggerDone()}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=d.lvlHandActTarg(this.code,e.id);return a.target.toActions([s,a.target.buttonTarget("CANC")])}return super.getCardActions(t,r)}ddf7(t){return t.actionKey==="ACTV"?d.ddp5(t):d.actionEval(t,"DC")}}class or extends x{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Onyxium Phantasm",this.jr1=this.boof246,this.jr2=this.lValN([9,12,19]),this.initRegen=this.boof124,this.tribe.push("ST"),this.text=`Allied Alloyin: Activate: Give a creature ${a.log.jr9(this.boof4812n,0)}`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}canActivate(t){return t.hasMod(t.id)}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.jr5(t.param);a.field.ddf6(t).buff(this.boof4812n,0),r.endActivation()}jr8(t){if(a.turn.allied("A")){const r=a.field.jr5(t.creatId);r.addMod(d.mod("AL",!0,r.id)),r.changed=!0}a.batch.triggerDone()}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=d.crActTarg("CARD",this.code,e.id),c=a.target.toActions(s);return c.push(a.action.cancelAction()),c}return super.getCardActions(t,r)}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=t;return d.actionEvalBuffN(t,r.playerA,r.lane,this.boof4812n)}}}class te extends x{hitCreature;constructor(t,r){super(t),this.hitCreature=r}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&r.creatureTarg===this.hitCreature&&r.creatureSrc&&r.source.id===t.creatId}return!1}}class hr extends te{constructor(t){super(t,!1),this.faction="U",this.rarity="L",this.name="Oros, Deepwood's Chosen",this.jr1=this.lValN([7,11,16,0]),this.jr2=this.jr1,this.initBT=!0,this.maxLevel=4,this.tribe.push("FB"),this.hints=["OL","LKV"];const r=`When Oros ${a.log.dbdtap()}, you gain that much health.`,e=this.level===4?"Oros gets +attack and +health equal to your health. ":"";this.text=e+r}jr3(t,r){const e=super.jr3(t,r);return this.level===4&&e.addEffect("PH",this.code),e}jr8(t){const r=t.event;a.player.healPlayer(t.ownerPlayerA,r.dmg),a.batch.triggerDone()}enforceEffect(t,r){const e=a.state.getPlayer(r.owner).health;r.status==="A"&&(r.removeModSafe(r.id),r.addModSafe(d.mod("HL",e,r.id)),r.addModSafe(d.mod("MH",e,r.id)),r.addModSafe(d.mod("AT",e,r.id)))}}class lr extends x{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Oxidon Spitter",this.jr1=this.boof7914,this.jr2=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,r){const e=super.jr3(t,r),s=e.jr4("FR",this.code);return s.interactive=!this.l3,e}jr8(t){if(this.l3)a.field.creatByTarget(d.crEnemyTarg()).forEach(r=>{r.negateArmor=!0}),a.batch.triggerDone();else{const r=d.crEnemyActTarg("CARD",this.code),e=a.target.toActions(r);e.length>0?a.action.ddf5(e):a.batch.triggerDone()}}handleAction(t){const r=a.field.ddf6(t);r.negateArmor=!0,a.action.actionDone(!0)}ddf7(t){const r=a.field.ddf6(t);return d.ddp3(t,r,{arm:-r.armor})}}class Nt extends x{lookup(t){return{["AFS"]:{c:()=>this.afsC(),a:e=>this.afsA(e),t:e=>this.afsT(e),e:e=>this.afsE(e)},["DMW"]:{c:()=>this.drixC(),a:e=>this.drixA(e),t:e=>this.drixT(e),e:e=>this.drixE(e)},["FGG"]:{c:()=>this.fggC(),a:e=>this.fggA(e),t:e=>this.fggT(e),e:e=>this.fggE(e)},["GHS"]:{c:()=>this.mvpC(),a:e=>this.mvpA(e),t:e=>this.mvpT(e),e:e=>this.mvpE(e)},["OWW"]:{c:()=>this.owwC(),a:e=>this.owwA(e),t:e=>this.owwT(e),e:e=>this.owwE(e)},["UPM"]:{c:()=>this.upakC(),a:e=>this.upakA(e),t:e=>this.upakT(e),e:e=>this.upakE(e)},["WFM"]:{c:()=>this.wfmC(),a:e=>this.wfmA(e),t:e=>this.wfmT(e),e:e=>this.wfmE(e)}}[t]}runAct(t,r){this.lookup(t).a(r)}testAct(t,r){return this.lookup(t).t(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){this.runAct(this.cardCode(),t),t.endActivation()}ddf7(t){return this.lookup(this.cardCode()).e(t)}evalAfterPlayCards(t){return a.state.gs.turn.regularPlays>0||a.state.gs.turn.freeCards.length>0?d.actionEval(t,"NR"):d.actionEval(t,"ST")}afsC(){this.faction="A",this.rarity="L",this.name="Arcflight Squadron",this.jr1=this.boof4710,this.jr2=this.jr1+2,this.tribe.push("RB"),this.hints=["OL"],this.text=`Activate: You may play an additional ${a.log.levelGateText(this.level,!0)}Robot this turn.`}afsT(t){return!0}afsA(t){const r=a.turn.freeCard(this.code);r.condition.tribe="RB",r.condition.level=a.target.ddf2(this.level)}afsE(t){return d.actionEval(t,"ST")}drixC(){this.faction="A",this.rarity="L",this.name="Drix, the Mindwelder",this.jr1=this.boof3612,this.jr2=this.lValN([6,12,21]),this.tribe.push("MM"),this.text=`Activate, discard your hand: Each friendly Metamind gets ${a.log.jr9(this.level,0)} for each card discarded this way.`}drixT(t){return a.state.getActivePlayer().hand.length>0}drixA(t){const r=a.state.getPlayer(t.owner),e=r.hand.length*this.level;r.discard.push(...r.hand),r.hand=[];const s=d.crFriendTarg();s.tribe="MM",a.field.creatByTarget(s).forEach(c=>{c.buff(e,0)})}drixE(t){return this.evalAfterPlayCards(t)}fggC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Gamma",this.jr1=this.boof4816,this.jr2=this.jr1,this.tribe.push("RB","GD");const t=this.boof255080;this.text=`Activate, destroy five friendly Robot Guardians: Put a ${t}/${t} Forge Guardian Omega into this space.`}fggT(t){return a.field.creatByTarget(this.fggTarg()).length===5}fggA(t){const r=t.lane,e=t.owner,s=Date.now();a.field.creatByTarget(this.fggTarg()).forEach(c=>a.death.destroy(c,this.code,s)),a.field.birthCreature(`${"FGO"}${this.level}`,"P",e,r)}fggTarg(){const t=d.crFriendTarg();return t.tribe="GD",t}fggE(t){const r=a.field.jr5(t.param),e=d.ddp4(t,r.owner,r.lane,`${"FGO"}${this.level}`);return e.hints=["RE"],e.bonus=100,e.type="ST",e}mvpC(){this.faction="U",this.rarity="C",this.name="Gemheart Sprout",this.jr1=this.boof357,this.jr2=this.jr1+this.level,this.initDefend=!0,this.tribe.push("PL"),this.text=`Activate: You gain health equal to ${this.level}x the number of friendly creatures.`}mvpT(t){return!0}mvpA(t){const r=a.field.ddf1().length;a.player.healPlayer(t.owner,r*this.level)}mvpE(t){return this.evalAfterPlayCards(t)}owwC(){this.faction="A",this.rarity="L",this.name="Oreian Warwalker",this.jr1=this.boof359,this.jr2=this.boof61018,this.tribe.push("RB"),this.text=`Activate: ${this.name} gets ${this.owwbuff+1}x attack.`}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}owwE(t){return this.evalAfterPlayCards(t)}upakC(){this.faction="U",this.rarity="L",this.name="Uterra Packmaster",this.jr1=this.boof6914,this.jr2=this.jr1,this.tribe.push("HM");const t=this.boof124;this.text=`Activate: each other friendly Uterra creature gets ${a.log.jr9(t,t)}.`}upakT(t){return a.field.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const r=this.boof124;a.field.creatByTarget(this.upakTarg(t.id)).forEach(e=>{e.buff(r,r)})}upakTarg(t){const r=d.crFriendNotMeTarg(t);return r.faction="U",r}upakE(t){return this.evalAfterPlayCards(t)}wfmC(){this.faction="T",this.rarity="H",this.name="Wildfire Maiden",this.jr1=this.boof4610,this.jr2=this.boof5814,this.tribe.push("FR","AS"),this.text=`Activate, destroy ${this.name}: Deal damage equal to its attack to each enemy creature.`}wfmT(t){return!0}wfmA(t){const r=Date.now();a.field.creatByTarget(d.crEnemyTarg()).forEach(e=>{e.hurtDirect(t.attack,this.code,r)}),a.death.destroy(t,this.code)}wfmE(t){const r=a.field.jr5(t.param),e=d.ddp8(t,r),s=!r.owner;return e.vectors.push(...a.field.laneIdx.map(c=>d.ddp1(s,c,{dmg:r.attack}))),e}}class yt extends x{lookup(t){return{["FSP"]:{c:()=>this.fspC(),t:(e,s)=>this.fspT(e,s),b:(e,s)=>this.fspB(e,s)},["OJC"]:{c:()=>this.ocarC(),t:(e,s)=>this.ocarT(e,s),b:(e,s)=>this.ocarB(e,s)},["RLW"]:{c:()=>this.restwandC(),t:(e,s)=>this.restwandT(e,s),b:(e,s)=>this.restwandB(e,s)},["SDR"]:{c:()=>this.spdryC(),t:(e,s)=>this.spdryT(e,s),b:(e,s)=>this.spdryB(e,s)},["TDW"]:{c:()=>this.tdwC(),t:(e,s)=>this.tdwT(e,s),b:(e,s)=>this.tdwB(e,s)},["UTR"]:{c:()=>this.urexC(),t:(e,s)=>this.urexT(e,s),b:(e,s)=>this.urexB(e,s)}}[t]}testBirth(t,r){return this.lookup(t).t(r,r.event)}actBirth(t,r){this.lookup(t).b(r,r.event)}iTrigger=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return this.iTrigger&&e.jr4("EF",this.code),e}ddf8(t){return t.event.code==="ENT"?this.testBirth(this.cardCode(),t):!1}jr8(t){this.actBirth(this.cardCode(),t),a.batch.triggerDone()}fspC(){if(this.faction="A",this.rarity="L",this.name="Flowsteel Prototype",this.jr1=this.lValN([3,6,8]),this.jr2=this.lValN([8,15,20]),this.tribe.push("SS"),this.hints=["P1"],this.iTrigger=this.level>1,this.iTrigger){const t=a.log.levelGateText(this.level-1);this.text=`When you Forge a ${t} creature, ${this.name} gets +attack equal to that creature's attack.`;const r=this.avgCreatureStats(this.level-1);this.bonus={exist:this.ddp9(0,r[0],r[0],0)*.5}}}fspT(t,r){return!!(r.forged&&r.creature.owner===t.ownerPlayerA&&a.cards.getCard(r.creature.code).levelthis.agamC(),h:(e,s,c,u)=>this.agamH(e,s,c,u)},["BWK"]:{c:()=>this.blwalkC(),h:(e,s,c,u)=>this.blwalkH(e,s,c,u)},["CDT"]:{c:()=>this.cadtC(),h:(e,s,c,u)=>this.cadtH(e,s,c,u)},["GSC"]:{c:()=>this.gcobC(),h:(e,s,c,u)=>this.gcobH(e,s,c,u)},["IHA"]:{c:()=>this.ibhaC(),h:(e,s,c,u)=>this.ibhaH(e,s,c,u)},["SHS"]:{c:()=>this.shimfC(),h:(e,s,c,u)=>this.shimfH(e,s,c,u)}}[t]}cardConstruct(t){this.hints=["OP"],this.lookup(t).c()}creatHit(t,r,e,s,c){this.lookup(t).h(r,e,s,c)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const r=t.event,e=r.source,s=r.target;e?this.creatHit(this.cardCode(),t,r,e,s):a.log.add("ERROR couldnt find creature - "+this.name),a.batch.triggerDone()}agamC(){this.faction="T",this.rarity="L",this.name="Agamemnon",this.jr1=this.boof4814,this.jr2=this.lValN([8,12,18]),this.level>1&&(this.initMobile=1,this.initAggro=this.level===3),this.tribe.push("GT"),this.text=`When ${this.name} ${a.log.dbdtac()} on your turn, this battles again.`}agamH(t,r,e,s){t.ownerPlayerA===a.state.ddf9()&&(e.extraBattles+=1)}blwalkC(){this.faction="N",this.rarity="R",this.name="Blight Walker",this.jr1=this.boof137,this.jr2=this.lValN([5,10,17]),this.tribe.push("ZB"),this.text=`When ${this.name} ${a.log.dbdtac(this.level)}, destroy that creature.`,this.hints.push("BX")}blwalkH(t,r,e,s){s.status==="A"&&a.target.levelTestCommon(s.level,this.level)&&a.death.destroy(s,this.code)}poisonText(t){return`When ${this.name} ${a.log.dbdtac()}, give that creature gets Poison ${t}.`}cadtC(){this.faction="U",this.rarity="R",this.name="Cadaverous Thicket",this.jr1=this.boof135,this.jr2=this.lValN([7,12,22]),this.tribe.push("PL"),this.text=this.poisonText(this.jr1)}cadtH(t,r,e,s){s.addPoison(this.jr1)}gcobC(){this.faction="U",this.rarity="C",this.name="Ghostscale Cobra",this.jr1=this.boof4610,this.jr2=this.boof135,this.tribe.push("SN"),this.text=this.poisonText(this.jr1)}gcobH(t,r,e,s){s.addPoison(this.jr1)}ibhaC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Hammer of Anvillon",this.jr1=this.lValN([4,7,12,15]),this.jr2=this.lValN([7,11,17,25]),this.initArmor=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 ${a.log.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${a.log.dbdtac()}, that creature${t}, and moves to an available enemy space at random.`}ibhaH(t,r,e,s){const c=this.level===4?s.attack*-1:this.boof246n;s.buff(c,0);const u=a.field.emptyLanes(s.owner),m=u.length;m>0&&s.move(u[a.randInt(0,m)])}shimfC(){this.faction="U",this.rarity="R",this.name="Shimmerfang Serpent",this.jr1=this.boof357,this.jr2=this.boof61016,this.tribe.push("SN"),this.text=`When ${this.name} ${a.log.dbdtac()}, that creatures gets that much Poison.`,this.hints.push("ATH")}shimfH(t,r,e,s){s.addPoison(r.dmg)}}class St extends te{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(e,s,c)=>this.ashyH(e,s,c)},["AMY"]:{c:()=>this.ashmC(),h:(e,s,c)=>this.ashyH(e,s,c)},["CFB"]:{c:()=>this.cfbC(),h:(e,s,c)=>this.cfbH(e,s,c)},["EFM"]:{c:()=>this.efmC(),h:(e,s,c)=>this.efmH(e,s,c)},["FBC"]:{c:()=>this.fbcC(),h:(e,s,c)=>this.fbcH(e,s,c)},["RTS"]:{c:()=>this.rzstC(),h:(e,s,c)=>this.rzstH(e,s,c)},["SVH"]:{c:()=>this.strhyC(),h:(e,s,c)=>this.strhyH(e,s,c)},["URB"]:{c:()=>this.uridC(),h:(e,s,c)=>this.uridH(e,s,c)},["VES"]:{c:()=>this.veskC(),h:(e,s,c)=>this.veskH(e,s,c)}}[t]}cardConstruct(t){this.hints=["OP","LKV"],this.lookup(t).c()}creatHit(t,r,e,s){this.lookup(t).h(r,e,s)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}jr8(t){const r=t.event,e=r.source;e&&(this.bothTurns||e.owner===a.state.ddf9())?this.creatHit(this.cardCode(),t,r,e):a.log.add("ERROR couldnt find creature - "+this.name),a.batch.triggerDone()}ashyC(){this.faction="T",this.rarity="C",this.tribe.push("FR","AS");const t=this.boof124;this.text=`When ${this.name} ${a.log.dbdtap()}, it gets ${a.log.jr9(t,t)}.`}ashyH(t,r,e){const s=this.boof124;e.buff(s,s)}ashbC(){this.name="Ashurian Brawler",this.jr1=this.boof7911,this.jr2=this.jr1,this.ashyC()}ashmC(){this.name="Ashurian Mystic",this.jr1=this.boof3610,this.jr2=this.boof5812,this.initAggro=!0,this.ashyC()}cfbC(){this.faction="T",this.rarity="H",this.name="Cinderfist Brawler",this.jr1=this.boof71014,this.jr2=this.boof357,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${a.log.dbdtap()}, deal that much damage to that player again.`}cfbH(t,r,e){a.player.ddf3(!e.owner,r.dmg,e.code)}efmC(){this.faction="T",this.rarity="L",this.name="Everflame Mystic",this.jr1=this.boof5813,this.jr2=this.jr1+1,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${a.log.dbdtap()} on your turn, you may play ${this.lValS(["one","two","three"])} spells this turn.`}efmH(t,r,e){if(a.state.ddf9()===e.owner)for(let s=0;sc.hurtDirect(r.dmg,this.code,s))}rzstC(){this.faction="T",this.rarity="C",this.name="Razortooth Stalker",this.jr1=this.boof4812,this.jr2=this.jr1+1,this.initMobile=1,this.tribe.push("DN");const t=this.boof235;this.text=`When ${this.name} ${a.log.dbdtap()}, it gets ${a.log.jr9(t,t)}.`}rzstH(t,r,e){const s=this.boof235;e.buff(s,s)}strhyC(){this.faction="U",this.rarity="C",this.name="Stranglevine Hydra",this.jr1=this.boof5815,this.jr2=this.jr1+1,this.tribe.push("HY"),this.text=`When ${this.name} ${a.log.dbdtap()}, it gets Regenerate ${this.level}.`}strhyH(t,r,e){e.addRegen(this.level)}uridC(){this.faction="U",this.rarity="L",this.name="Uterradon Ridgeback",this.jr1=this.boof71117,this.jr2=this.boof4713,this.initBT=!0,this.tribe.push("DN"),this.hints.push("FRS"),this.bothTurns=!1;const t=this.boof124;this.text=`When ${this.name} ${a.log.dbdtap()} on your turn, each friendly creature gets ${a.log.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}uridH(t,r,e){const s=this.boof124,c=this.level===3;a.field.ddf1().forEach(u=>{u.buff(s,s),c&&(u.breakthrough=!0)})}veskC(){this.faction="N",this.rarity="L",this.name="Vyric Ebonskull",this.jr1=this.boof3713,this.jr2=this.boof71117,this.tribe.push("VP"),this.text=`When Vyric ${a.log.dbdtap()}, destroy an enemy ${a.log.levelGateText(this.level,!0)} creature at random.${this.level===3?" Then Spawn a copy of that creature.":""}`}veskH(t,r,e){const s=d.crTarg();s.player=a.player.toTarget(r.target),s.level=a.target.ddf2(this.level);const c=a.field.creatByTarget(s);if(c.length>0){const u=Date.now(),m=c[a.randInt(0,c.length)];a.death.destroy(m,this.code,u),this.level===3&&a.field.birthCreature(m.code,"S",e.owner,void 0,u)}}}class bt extends x{lookup(t){return{["DFB"]:{c:()=>this.dfbC(),d:e=>this.dfbD(e)},["GGD"]:{c:()=>this.ggdC(),d:e=>this.ggdD(e)},["GGP"]:{c:()=>this.ggpC(),d:e=>this.ggpD(e)},["NGT"]:{c:()=>this.ngauntC(),d:e=>this.ngauntD(e)},["SRH"]:{c:()=>this.sharvC(),d:e=>this.sharvD(e)},["YNS"]:{c:()=>this.yuruC(),d:e=>this.yuruD(e)}}[t]}creatDied(t,r){this.lookup(t).d(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DS",this.code),e}ddf8(t){return t.trigger.type==="DS"}jr8(t){this.creatDied(this.cardCode(),t),a.batch.triggerDone()}dfbC(){this.faction="N",this.rarity="R",this.name="Dr. Frankenbaum",this.jr1=this.boof6914,this.jr2=this.jr1-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.bonus={exist:this.ddp9(0,0,0,t*2)}}dfbD(t){const r=a.field.jr5(t.creatId),s=t.event.creature;(r.id===s.id||s.owner===r.owner&&s.isTribe("AB")&&bt.itDiedFirst(s.id,r.id))&&a.player.ddf3(!r.owner,this.boof234,this.code)}ggdC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Devourer",this.jr1=this.boof579,this.jr2=this.jr1-2,this.tribe.push("GG"),this.hints=["OL"],this.text=`When a creature is destroyed, ${this.name} gets ${a.log.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)*2}}ggdD(t){a.field.jr5(t.creatId).buff(this.level,this.level)}ggpC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Predator",this.jr1=this.boof5914,this.jr2=this.jr1,this.initMobile=1,this.tribe.push("GG"),this.hints=["OP"];const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,2*t,t,0)}}ggpD(t){const r=a.field.jr5(t.creatId),e=a.field.oppositeLane(r.lane),s=t.event;if(s.creature.owner!==r.owner&&s.creature.lane===e){const c=this.boof246;r.buff(c,c)}}ngauntC(){this.faction="N",this.rarity="R",this.name="Nightgaunt",this.jr1=this.boof4815,this.jr2=this.jr1+1,this.tribe.push("GG"),this.text=`When a creature is destroyed, ${this.name} gets Regenerate 1.`,this.bonus={exist:this.ddp9(0,4,0,0)}}ngauntD(t){a.field.jr5(t.creatId).addRegen(1)}sharvC(){this.faction="N",this.rarity="C",this.name="Sorrow Harvester",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.tribe.push("AB"),this.text="When a friendly Abomination is destroyed on your turn, draw a card.",this.bonus={exist:.25}}sharvD(t){const e=t.event.creature;e.owner===t.ownerPlayerA&&e.isTribe("AB")&&a.state.ddf9()===t.ownerPlayerA&&bt.itDiedFirst(e.id,t.creatId)&&a.player.drawCard(t.ownerPlayerA,1)}yuruC(){this.faction="N",this.rarity="L",this.name="Yuru, the Necrosage",this.jr1=3,this.jr2=this.jr1,this.initDefend=!0,this.tribe.push("HM"),this.hints=["LJ"];const t=this.boof5814;this.text=`When an adjacent non-Spirit creature is destroyed, put a ${t}/${t} Spirit into that space.`,this.bonus={exist:this.ddp9(1,t*2,t,0)}}yuruD(t){const r=a.field.jr5(t.creatId),s=t.event.creature;s.owner===r.owner&&r.adjacent.includes(s.lane)&&!s.isTribe("ST")&&bt.itDiedFirst(s.id,r.id)&&a.field.birthCreature(`${"XYR"}${this.level}`,"P",r.owner,s.lane)}static itDiedFirst(t,r){if(t===r)return!0;let e=!1;const s=a.death.findDeathTime(r);if(a.isUn(s))e=!0;else{const c=a.death.findDeathTime(t);(a.isUn(c)||c<=s)&&(e=!0)}return e}}class M extends x{lookup(t){return{["AGK"]:{c:()=>this.agknitC(),f:e=>this.agknitF(e)},["BSS"]:{c:()=>this.bssC(),f:e=>this.bssF(e)},["BZD"]:{c:()=>this.bzdrC(),f:e=>this.bzdrF(e)},["BFM"]:{c:()=>this.bfmC(),f:e=>this.bfmF(e)},["CTI"]:{c:()=>this.charnC(),f:e=>this.charnF(e)},["CHH"]:{c:()=>this.chihC(),f:e=>this.chihF(e)},["CSW"]:{c:()=>this.chickenC(),f:e=>this.chickenF(e)},["DFR"]:{c:()=>this.dfrC(),f:e=>this.dfrF(e)},["DBA"]:{c:()=>this.dbaC(),f:e=>this.dbaF(e)},["DDD"]:{c:()=>this.dddC(),f:e=>this.dddF(e)},["EWT"]:{c:()=>this.espwrC(),f:e=>this.espwrF(e)},["FWT"]:{c:()=>this.fwtC(),f:e=>this.fwtF(e)},["GSW"]:{c:()=>this.gwurmC(),f:e=>this.gwurmF(e)},["GSS"]:{c:()=>this.gsC(),f:e=>this.gsF(e)},["IMA"]:{c:()=>this.iracoC(),f:e=>this.iracoF(e)},["LGT"]:{c:()=>this.legtitC(),f:e=>this.legtitF(e)},["LBD"]:{c:()=>this.lbdC(),f:e=>this.lbdF(e)},["LMV"]:{c:()=>this.lyrC(),f:e=>this.lyrF(e)},["MOE"]:{c:()=>this.moeC(),f:e=>this.moeF(e)},["MMA"]:{c:()=>this.mmaC(),f:e=>this.mmaF(e)},["NSY"]:{c:()=>this.nysymC(),f:e=>this.nysymF(e)},["OXM"]:{c:()=>this.onxmarC(),f:e=>this.onxmarF(e)},["OFM"]:{c:()=>this.ofmC(),f:e=>this.ofmF(e)},["OPK"]:{c:()=>this.orpC(),f:e=>this.orpF(e)},["PHM"]:{c:()=>this.phmC(),f:e=>this.phmF(e)},["PSM"]:{c:()=>this.palsC(),f:e=>this.palsF(e)},["SMD"]:{c:()=>this.scorchC(),f:e=>this.scorchF(e)},["SDN"]:{c:()=>this.souldrC(),f:e=>this.souldrF(e)},["SBD"]:{c:()=>this.sbdC(),f:e=>this.sbdF(e)},["SYL"]:{c:()=>this.lotusC(),f:e=>this.lotusF(e)},["TGI"]:{c:()=>this.tgiC(),f:e=>this.tgiF(e)},["UGL"]:{c:()=>this.umglidC(),f:e=>this.umglidF(e)},["UWL"]:{c:()=>this.uwarC(),f:e=>this.uwarF(e)},["UWS"]:{c:()=>this.ustokeC(),f:e=>this.ustokeF(e)},["UTM"]:{c:()=>this.umaulC(),f:e=>this.umaulF(e)},["VNS"]:{c:()=>this.vnsC(),f:e=>this.vnsF(e)},["WWP"]:{c:()=>this.wwpC(),f:e=>this.wwpF(e)},["WFB"]:{c:()=>this.wfbC(),f:e=>this.wfbF(e)}}[t]}cardForge(t,r){this.lookup(t).f(r)}ftext="";forges=!0;flanks=!1;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let r="";this.flanks&&(r="Flank"),this.forges&&(r?r="Forge/"+r:r=a.log.forglied(this.allied)),r&&(this.text=r+": "+this.ftext),this.ftext=""}jr3(t,r){const e=super.jr3(t,r);return this.forges&&e.jr4("FR",this.code),this.flanks&&e.jr4("FK",this.code),e}jr8(t){this.cardForge(this.cardCode(),t),a.batch.triggerDone()}agknitC(){this.faction="A",this.rarity="L",this.name="Aegis Knight",this.jr1=this.boof5814,this.jr2=this.jr1,this.tribe.push("HM"),this.initArmor=this.lValN([1,2,5]),this.hints=["P2","OP"],this.bonus={play:this.ddp9(0,this.initArmor*2,0,0)},this.ftext="Each friendly creature deals damage equal to its Armor to the opposing creature"}agknitF(t){const r=d.crFriendTarg();r.hasArmor=!0;const e=Date.now();a.field.creatByTarget(r).forEach(s=>{s.opposed&&s.opposed.hurtDirect(s.armor,s.code,e)})}bssC(){this.faction="A",this.rarity="L",this.name="Brightsteel Sentinal",this.jr1=this.boof4914,this.jr2=this.jr1+1,this.tribe.push("RB"),this.hints=["P2","OP"];const t=this.boof51015;this.bonus={play:this.ddp9(0,t*1.5,0,0)},this.ftext=`Each friendly Robot gets Armor ${t} this turn.`}bssF(t){const r=this.boof51015,e=d.crFriendTarg();e.tribe="RB",e.canArmor=!0,a.field.creatByTarget(e).forEach(c=>{const u=d.mod("AR",r,t.creatId);u.expiry="ET",c.addMod(u)})}bzdrC(){this.faction="N",this.rarity="R",this.name="Byzerak Drake",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.initRegen=this.level,this.allied="T",this.tribe.push("DG"),this.hints=["ALT"],this.ftext=`Mobility ${this.level}.`}bzdrF(t){a.turn.allied(this.allied)&&a.field.jr5(t.creatId).addMobility(this.level)}bfmC(){this.faction="N",this.rarity="H",this.name="Byzerak Frostmaiden",this.jr1=this.boof135,this.jr2=this.boof91420,this.tribe.push("HM"),this.hints=["ALT","OP","FH"],this.flanks=!0;const t=this.boof246;this.ftext=`If ${this.name} is opposed, the opposing creature gets ${a.log.jr9(-1*t,0)} and this gets ${a.log.jr9(t,0)}. Allied Tempys: Mobility ${this.level}.`;const r=this.ddp9(0,t*2,t*2,0);this.bonus={play:r,exist:r/2}}bfmF(t){const e=t.event.creature;t.trigger.type==="FR"&&a.turn.allied("T")&&e.addMobility(this.level);const s=e.opposed;if(s){const c=this.boof246;s.buff(-1*c,0),e.buff(c,0)}}charnC(){this.faction="N",this.rarity="C",this.name="Charnel Titan",this.jr1=this.boof359,this.jr2=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 ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,2*t,t,0)/2}}charnF(t){const r=this.boof357,e=d.crEnemyTarg();e.maxAttack=r,a.field.creatByTarget(e).length>0&&a.field.jr5(t.creatId).buff(r,r)}chihC(){this.faction="U",this.rarity="C",this.name="Chistlehearth Hunter",this.jr1=this.lValN([2,6,11]),this.jr2=this.boof81217,this.tribe.push("HM"),this.hints=["P2","FRF"],this.ftext=`${this.name} gets ${a.log.jr9(1,0)} for each other friendly creature.`,this.bonus={play:this.ddp9(0,2,2,0)}}chihF(t){const r=a.field.ddf1().length;r>1&&a.field.jr5(t.creatId).buff(r-1,0)}chickenC(){this.faction="T",this.rarity="L",this.name="Cindersmoke Wyvern",this.jr1=this.boof3610,this.jr2=this.lValN([7,12,17]),this.tribe.push("DG"),this.initMobile=this.boof124,this.hints=["FH"],this.forges=!1,this.flanks=!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.",this.bonus={exist:this.ddp9(0,this.jr1,this.jr1,0)}}chickenF(t){const r=t.event,e=r.creature.attack,s=r.creature.opposed;s?s.hurtDirect(e,this.code):a.player.ddf3(!t.ownerPlayerA,e,this.code)}dfrC(){this.faction="N",this.rarity="H",this.name="Darkfrost Reaper",this.jr1=this.boof6916,this.jr2=this.boof3713,this.tribe.push("SK"),this.ftext="Destroy each creature with 1 or less attack.",this.bonus={play:this.ddp6()/5}}dfrF(t){const r=d.crTarg();r.maxAttack=1;const e=a.field.creatByTarget(r),s=Date.now();e.forEach(c=>{a.death.destroy(c,this.code,s)})}dbaC(){this.faction="U",this.rarity="H",this.name="Deepbranch Ancient",this.jr1=this.boof4812,this.jr2=this.jr1,this.tribe.push("HY"),this.hints=["FRF"],this.ftext=`If there is a friendly creature in each space, ${this.name} gets ${a.log.jr9(this.jr1,this.jr2)}.`,this.bonus={play:this.ddp9(0,this.jr1*2,this.jr1,0)/4}}dbaF(t){a.field.ddf1().length===5&&a.field.jr5(t.creatId).buff(this.jr1,this.jr2)}dddC(){this.faction="N",this.rarity="L",this.name="Doomwing, Dire Drake",this.jr1=this.boof61018,this.jr2=this.lValN([2,6,10]),this.initMobile=this.level,this.tribe.push("DG"),this.hints=["FK"],this.forges=!1,this.flanks=!0,this.ftext=`Destroy the opposing ${a.log.levelGateText(this.level,!0)}creature.`,this.bonus={exist:this.ddp6()/2}}dddF(t){const e=t.event.creature.opposed;e&&a.target.levelTestCommon(e.level,this.level)&&a.death.destroy(e,this.code)}espwrC(){this.faction="U",this.rarity="R",this.name="Esperian Wartusk",this.jr1=this.boof5916,this.jr2=this.jr1-1,this.initBT=!0,this.allied="A",this.tribe.push("TK"),this.hints=["ALA"];const t=this.boof124;this.ftext=`Armor ${t}.`,this.bonus={play:this.ddp9(0,t,0,0)}}espwrF(t){a.turn.allied(this.allied)&&a.field.jr5(t.creatId).addArmor(this.boof124)}fwtC(){this.faction="U",this.rarity="H",this.name="Frostwild Tracker",this.jr1=this.boof4712,this.jr2=this.boof248,this.tribe.push("TG"),this.forges=this.level>1;const t=this.level-1;this.ftext=`You may play an additional ${a.log.levelGateText(t)} creature this turn.`,this.level>1?this.bonus={play:this.ddp6(t)}:this.hints=["LV"]}fwtF(t){const r=a.turn.freeCard(this.code);r.condition.card="C",r.condition.level=a.target.ddf2(this.level-1)}gwurmC(){this.faction="N",this.rarity="C",this.name="Gloomspire Wurm",this.jr1=this.boof4813,this.jr2=this.jr1,this.tribe.push("WR"),this.hints=["ENN"],this.ftext=`If there are no enemy creatures, ${this.name} gets ${a.log.jr9(4,4)}.`}gwurmF(t){a.field.qEnemyCreats().length===0&&a.field.jr5(t.creatId).buff(4,4)}gsC(){this.faction="U",this.rarity="C",this.name="Glowstride Stag",this.jr1=this.boof5812,this.jr2=this.jr1+this.level,this.tribe.push("ST");const t=this.boof51015;this.ftext=`You gain ${t} health.`,this.bonus={play:this.ddp9(0,0,0,t)}}gsF(t){const r=this.boof51015;a.player.healPlayer(t.ownerPlayerA,r),a.log.add("Glowstride flexed for "+r)}iracoC(){this.faction="A",this.rarity="L",this.name="Ironmind Acolyte",this.jr1=this.boof61015,this.jr2=this.jr1-2,this.tribe.push("GN"),this.hints=["P1"],this.ftext="If you have five or more cards in your hand, you may play an additional card this turn.",this.bonus={play:this.ddp6()/5}}iracoF(t){a.player.toPlayer(t.ownerPlayerA).hand.length>4&&(a.state.gs.turn.regularPlays+=1)}legtitC(){this.faction="N",this.rarity="R",this.name="Legion Titan",this.jr1=this.boof4812,this.jr2=this.jr1,this.tribe.push("ZB"),this.hints=["ENF"],this.ftext=`${this.name} gets ${a.log.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`,this.bonus={play:this.ddp9(0,this.level*2,this.level,0)/2}}legtitF(t){const r=d.crEnemyTarg();r.maxAttack=this.boof357;const e=a.field.creatByTarget(r);if(e.length>0){const s=this.level*e.length;a.field.jr5(t.creatId).buff(s,s)}}lbdC(){this.faction="U",this.rarity="H",this.name="Lifeblood Dryad",this.jr1=this.lValN([4,7,9]),this.jr2=this.jr1,this.tribe.push("DY"),this.hints=["FRF"];const t=this.boof236;this.ftext=`If there is a friendly creature in each space, each other friendly creature gets ${a.log.jr9(t,t)}`,this.bonus={play:this.ddp9(0,t*2,t,0)}}lbdF(t){const r=a.field.creatByTarget(d.crFriendNotMeTarg(t.creatId));if(r.length===4){const e=this.boof236;r.forEach(s=>s.buff(e,e))}}lyrC(){this.faction="N",this.rarity="L",this.name="Lyria, Muse of Varna",this.jr1=this.boof5815,this.jr2=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 spaces.",this.forges?(this.hints=["EML"],this.bonus={play:this.ddp6(1)*(this.level-1)}):this.hints=["LV"]}lyrF(t){if(this.level===2){const r=a.death.gravedigger();r&&a.field.birthCreature(r,"S",t.ownerPlayerA)}else if(this.level===3){const r=a.field.emptyLanes(t.ownerPlayerA),e=r.map(s=>a.death.gravedigger());if(r.length>0&&e[0]){const s=Date.now();r.forEach((c,u)=>{a.field.birthCreature(e[u],"P",t.ownerPlayerA,c,s)})}}}moeC(){this.faction="T",this.rarity="H",this.name="Master of Elements",this.jr1=this.boof5917,this.jr2=this.jr1,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=`You may play an additional ${a.log.levelGateText(this.level-1)} spell this turn.`,this.forges&&(this.bonus={play:this.ddp9(0,0,0,0,(this.level-1)/2)})}moeF(t){const r=a.turn.freeCard(this.code);r.condition.card="S",r.condition.level=a.target.ddf2(this.level-1)}mmaC(){this.faction="A",this.rarity="C",this.name="Metamind Adept",this.jr1=this.boof5915,this.jr2=this.boof4813,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`Draw ${this.level} card${t}.`,this.bonus={play:this.ddp9(0,0,0,0,this.level/4)}}mmaF(t){a.player.drawCard(t.ownerPlayerA,this.level)}nysymC(){this.faction="N",this.rarity="C",this.name="Nyrali Symbiote",this.jr1=this.boof51015,this.jr2=this.jr1,this.tribe.push("OZ"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`,this.bonus={play:this.ddp9(0,t,0,0)}}nysymF(t){const r=t.event;r.creature.opposed&&r.creature.addRegen(this.boof246)}ofmC(){this.faction="A",this.rarity="R",this.name="Oreian Fieldmarshal",this.jr1=this.boof5914,this.jr2=this.jr1-2,this.tribe.push("HM"),this.hints=["FRS"];const t=this.boof135;this.ftext=`Each other friendly creature gets ${a.log.jr9(t,0)}.`,this.bonus={play:this.ddp9(0,t*2,t*2,0)}}ofmF(t){const r=this.boof135;a.field.creatByTarget(d.crFriendNotMeTarg(t.creatId)).forEach(s=>{s.buff(r,0)})}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.jr1=this.boof4816,this.jr2=this.boof248,this.tribe.push("RB"),this.hints=["OP"],this.ftext=`${this.name} gets Armor ${this.jr1} this turn.`,this.bonus={play:this.ddp9(0,this.jr1,0,0)}}orpF(t){const r=a.field.jr5(t.creatId),e=d.mod("AR",this.jr1,t.creatId);e.expiry="ET",r.addMod(e)}onxmarC(){this.faction="A",this.rarity="R",this.name="Onyxium Marauder",this.jr1=this.boof4714,this.jr2=this.lValN([6,9,17]),this.initArmor=this.level,this.allied="N",this.tribe.push("HM"),this.hints=["ALN"],this.ftext=`Regenerate ${this.level}.`,this.bonus={play:this.ddp9(0,this.level,0,0)}}onxmarF(t){a.turn.allied(this.allied)&&a.field.jr5(t.creatId).addRegen(this.level)}phmC(){this.faction="A",this.rarity="R",this.name="Palladium Hindermind",this.jr1=this.boof2612,this.jr2=this.boof61016,this.tribe.push("HM"),this.hints=["ENF"],this.ftext=`Each enemy creature gets ${a.log.jr9(this.boof123n,0)}.`;const t=this.level*2;this.bonus={play:this.ddp9(0,t,t,0)}}phmF(t){const r=this.boof123n;a.field.qEnemyCreats().forEach(e=>{e.buff(r,0)})}palsC(){this.faction="A",this.rarity="L",this.name="Palladium Simulacrum",this.jr1=this.boof4816,this.jr2=this.boof248,this.initMobile=this.level-1,this.tribe.push("SS"),this.hints=["NX"],this.flanks=!0,this.ftext=`If ${this.name} is in the center space, Spawn a copy.`,this.bonus={play:this.ddp9(1,this.jr1+this.jr2,this.jr1,0)}}palsF(t){t.event.creature.lane===3&&a.field.birthCreature(this.code,"S",t.ownerPlayerA)}scorchC(){this.faction="T",this.rarity="L",this.name="Scorchmane Dragon",this.jr1=this.lValN([0,12,24]),this.jr2=this.boof61224,this.tribe.push("DG"),this.initDefend=this.level===1,this.initMobile=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=["LV"]:this.level===2?(this.hints=["OP"],this.bonus={play:this.ddp9(0,5,0,0)}):this.bonus={play:this.ddp9(0,10,0,5)}}scorchF(t){const r=t.event,e=!t.ownerPlayerA;if(this.level===2){const s=r.creature.opposed;s&&s.hurtDirect(5,this.code)}else if(this.level===3){const s=Date.now();a.field.qPlayerCreats(e).forEach(c=>c.hurtDirect(5,this.code,s)),a.player.ddf3(e,5,this.code)}}souldrC(){this.faction="N",this.rarity="L",this.name="Soul Drinker",this.jr1=1,this.jr2=this.boof4814,this.initMobile=this.level===3?1:0,this.tribe.push("VP"),this.hints=["OP"],this.flanks=this.level===3,this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`;const t=this.avgCreatureStats()[0]*2;this.bonus={play:this.ddp9(0,t,t,0)}}souldrF(t){const r=t.event,e=r.creature.opposed;if(e){const s=e.attack;r.creature.buff(s,0),e.buff(-1*s,0)}}sbdC(){this.faction="U",this.rarity="C",this.name="Spiritbloom Dryad",this.jr1=this.boof6812,this.jr2=this.jr1+this.level,this.tribe.push("DY"),this.ftext=`Each player gains ${this.boof468} health.`}sbdF(t){const r=this.boof468;a.player.healPlayer(!0,r),a.player.healPlayer(!1,r)}lotusC(){this.faction="U",this.rarity="H",this.name="Stygian Lotus",this.jr1=this.boof468,this.jr2=this.jr1-1,this.tribe.push("PL"),this.hints=["ENF","EML","OP"],this.ftext=`If ${this.name} is opposed, spawn a copy of it. Then repeat this for each copy.`,this.bonus={play:this.ddp9(1,this.jr1+this.jr2,this.jr1,0)}}lotusF(t){if(t.event.creature.opposed){let e=!0;for(;e;){const s=a.field.emptyLanes(t.ownerPlayerA),c=s.length;if(c===0)e=!1;else{const u=s[a.randInt(0,c)];a.field.birthCreature(this.code,"P",t.ownerPlayerA,u).opposed||(e=!1)}}}}tgiC(){this.faction="T",this.rarity="R",this.name="Thundergale Invoker",this.jr1=this.boof3711,this.jr2=this.jr1,this.tribe.push("WN","GT"),this.hints=["LJ"],this.ftext=`Each creature adjacent to ${this.name} moves one space away if possible.`}tgiF(t){const r=a.field.jr5(t.creatId),e=r.lane,s=r.owner;if(e>2){const c=a.field.searchByLane(e-1,s);c&&(a.field.searchByLane(e-2,s)||c.move(e-2))}if(e<4){const c=a.field.searchByLane(e+1,s);c&&(a.field.searchByLane(e+2,s)||c.move(e+2))}}umglidC(){this.faction="T",this.rarity="R",this.name="Umbruk Glider",this.jr1=this.boof71117,this.jr2=this.jr1-4,this.initMobile=this.level,this.allied="U",this.tribe.push("DN"),this.hints=["ALU"],this.ftext="Breakthrough."}umglidF(t){if(a.turn.allied(this.allied)){const r=a.field.jr5(t.creatId);r.breakthrough=!0}}uwarC(){this.faction="T",this.rarity="H",this.name="Uranti Warlord",this.jr1=this.boof3713,this.jr2=this.boof71117,this.tribe.push("FR","YT"),this.hints=["OP"],this.ftext=`Each friendly Yeti deals ${this.jr1} damage to the opposing creature.`,this.bonus={play:this.ddp9(0,this.jr1,0,0)}}uwarF(t){const r=d.crFriendTarg();r.tribe="YT";const e=a.field.creatByTarget(r),s=Date.now();e.forEach(c=>{const u=c.opposed;u&&u.hurtDirect(this.jr1,c.code,s)})}ustokeC(){this.faction="T",this.rarity="R",this.name="Uranti Warstoker",this.jr1=this.boof6812,this.jr2=this.jr1-1,this.tribe.push("YT"),this.ftext=`Each other friendly Yeti get ${a.log.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const r=d.crFriendNotMeTarg(t.creatId);r.tribe="YT";const e=a.field.creatByTarget(r),s=this.stokeboof;e.forEach(c=>{const u=d.mod("AT",s,t.creatId);u.expiry="ET",c.addMod(u)})}get stokeboof(){return this.lValN([3,4,6])}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.jr1=this.boof4712,this.jr2=this.jr1,this.tribe.push("DN"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*2,t,0)}}umaulF(t){const r=t.event;if(r.creature.opposed){const e=this.boof246;r.creature.buff(e,e)}}vnsC(){this.faction="U",this.rarity="H",this.name="Venomous Netherscale",this.jr1=this.boof4713,this.jr2=this.jr1+4,this.tribe.push("NG"),this.ftext=`Double the Poison on each enemy creature${this.level===3?" and the enemy player":""}.`}vnsF(t){const r=d.crEnemyTarg();r.hasPoison=!0,a.field.creatByTarget(r).forEach(s=>{s.addPoison(s.poison)})}wwpC(){this.faction="U",this.rarity="H",this.name="Weirwood Patriarch",this.jr1=this.boof5714,this.jr2=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 ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t,t,0)}}wwpF(t){const r=this.boof235,e=d.crFriendNotMeTarg(t.creatId);e.maxAttack=this.boof357,a.field.creatByTarget(e).forEach(s=>s.buff(r,r))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.jr1=this.boof3612,this.jr2=this.jr1,this.tribe.push("ST"),this.hints=["OP"],this.flanks=!0;const t=this.boof247n;this.ftext=`The opposing creature gets ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*2,t,0)}}wfbF(t){const e=t.event.creature.opposed;if(e){const s=this.boof247n;e.buff(s,s)}}}class ce extends x{lookup(t){return{["RBG"]:{c:()=>this.rbgC(),g:(e,s)=>this.rbgG(e,s)},["SRV"]:{c:()=>this.sprvC(),g:(e,s)=>this.sprvG(e,s)}}[t]}onGain(t,r){this.lookup(t).g(r,r.event)}hPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return e.jr4("LG",this.code),e}ddf8(t){return t.trigger.type==="LG"&&this.validPlayer(t)}jr8(t){this.onGain(this.cardCode(),t),a.batch.triggerDone()}validPlayer(t){if(this.hPlayer===0)return!0;const r=t.event;return this.hPlayer===1?t.ownerPlayerA===r.playerA:t.ownerPlayerA!==r.playerA}rbgC(){this.faction="U",this.rarity="H",this.name="Runebark Guardian",this.jr1=this.boof5916,this.jr2=this.jr1,this.tribe.push("HM"),this.hPlayer=1;const t=this.boof135;this.text=`When you gain health, ${this.name} gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}rbgG(t,r){const e=a.field.jr5(t.creatId),s=this.boof135;e.buff(s,s)}sprvC(){this.faction="N",this.rarity="R",this.name="Spirit Reaver",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.tribe.push("DM"),this.hPlayer=-1;const t=this.boof234;this.text=`When an enemy player gains health, ${this.name} gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}sprvG(t,r){const e=a.field.jr5(t.creatId),s=this.boof234;e.buff(s,s)}}class de extends x{lookup(t){return{["EWE"]:{c:()=>this.eweC(),m:(e,s)=>this.eweM(e,s)},["WBH"]:{c:()=>this.rbgC(),m:(e,s)=>this.rbgM(e,s)}}[t]}onMove(t,r){this.lookup(t).m(r,r.event)}mPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return e.jr4("MV",this.code),e}ddf8(t){return t.trigger.type==="MV"&&this.validPlayer(t)}jr8(t){this.onMove(this.cardCode(),t),a.batch.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const r=t.event;return this.mPlayer===1?t.ownerPlayerA===r.creature.owner:t.ownerPlayerA!==r.creature.owner}eweC(){this.faction="T",this.rarity="H",this.name="Emberwind Evoker",this.jr1=this.boof4914,this.jr2=this.jr1+2,this.tribe.push("HM"),this.mPlayer=1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)}}eweM(t,r){const e=this.boof124;r.creature.buff(e,e)}rbgC(){this.faction="T",this.rarity="R",this.name="Windborn Hellion",this.jr1=this.boof4812,this.jr2=this.boof81217,this.tribe.push("WN","EL"),this.mPlayer=1,this.text=`When a friendly creature moves, ${this.name} gets ${a.log.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)}}rbgM(t,r){a.field.jr5(t.creatId).buff(this.level,this.level)}}class Pt extends x{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.agrdP(e,s)},["ART"]:{c:()=>this.arootC(),t:(e,s)=>this.factionSpellMyTurn(e,s,"U"),p:(e,s)=>this.arootP(e,s)},["BLH"]:{c:()=>this.bblhC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.bblhP(e,s)},["CYC"]:{c:()=>this.ccC(),t:(e,s)=>this.factionSpellMyTurn(e,s,"N"),p:(e,s)=>this.ccP(e,s)},["DHW"]:{c:()=>this.dhwC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.dhwP(e,s)},["FBI"]:{c:()=>this.fbiC(),t:(e,s)=>this.factionSpellMyTurn(e,s,"T"),p:(e,s)=>this.fbiP(e,s)},["FLS"]:{c:()=>this.flspkC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.flspkP(e,s)},["KAW"]:{c:()=>this.kasC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.kasP(e,s)}}[t]}testPlay(t,r){return this.lookup(t).t(r,r.event)}actPlay(t,r){this.lookup(t).p(r,r.event)}triggerLevels=[1,2,3,4];constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return this.triggerLevels.includes(this.level)&&e.jr4("PC",this.code),e}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 r=a.field.jr5(t.creatId);a.death.destroy(r,this.code)}a.batch.triggerDone()}spellMyTurn(t,r){return r.playerA===t.ownerPlayerA&&a.cards.getCard(r.cardCode).type==="S"}factionSpellMyTurn(t,r,e){if(r.playerA===t.ownerPlayerA){const s=a.cards.getCard(r.cardCode);if(s.type==="S"&&s.faction===e)return!0}return!1}agrdC(){this.faction="A",this.rarity="C",this.name="Aetherguard",this.jr1=this.boof6814,this.jr2=this.jr1-1,this.tribe.push("RB"),this.bonus={exist:this.ddp9(0,this.level,0,0)},this.text=`When you play a spell, ${this.name} gets Armor ${this.level}.`}agrdP(t,r){a.field.jr5(t.trigger.creatId).addArmor(this.level)}arootC(){this.faction="U",this.rarity="H",this.name="Aether Root",this.jr1=this.boof3610,this.jr2=this.jr1,this.tribe.push("PL");const t=this.boof234;this.text=`When you play an Uterra spell, ${this.name} gets ${a.log.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}arootP(t,r){const e=a.field.jr5(t.trigger.creatId),s=this.boof234;e.buff(s,s)}bblhC(){this.faction="T",this.rarity="L",this.name="Binben, Lightning Herald",this.jr1=this.boof61017,this.jr2=this.boof468,this.tribe.push("LT","AS");const t=this.boof4711,r=this.boof258;this.text=`When you play a spell, Spawn a ${t}/${r} Lightning Elemental. At the end of your turn, destroy it.`,this.bonus={exist:this.ddp9(1,t+r,t,0)*.5}}bblhP(t,r){const e=a.field.birthCreature(`${"LWY"}${this.level}`,"S",t.ownerPlayerA);e&&e.jr4("TE",this.code)}ccC(){this.faction="N",this.rarity="H",this.name="Crypt Conjurer",this.jr1=this.boof258,this.jr2=this.lValN([8,14,20]),this.tribe.push("VP"),this.text=`When you play a Nekrium spell, deal ${this.jr1} damage to the enemy player and you gain ${this.jr1} health.`,this.bonus={exist:this.ddp9(0,0,0,this.jr1)}}ccP(t,r){a.player.ddf3(!t.ownerPlayerA,this.jr1,t.cardCode),a.player.healPlayer(t.ownerPlayerA,this.jr1)}dhwC(){this.faction="N",this.rarity="R",this.name="Darkheart Wanderer",this.jr1=this.boof3612,this.jr2=this.boof81116,this.tribe.push("HM");const t=this.boof124;this.text=`When you play a spell, ${this.name} gets Regenerate ${t}.`,this.bonus={exist:this.ddp9(0,t,0,0)}}dhwP(t,r){a.field.jr5(t.trigger.creatId).addRegen(this.boof124)}fbiC(){this.faction="T",this.rarity="H",this.name="Flamebreak Invoker",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.tribe.push("FR","GT"),this.text=`When you play a Tempys spell, deal ${this.level} damage to each enemy creature.`,this.bonus={exist:this.ddp9(0,this.level*2,0,0)*.5}}fbiP(t,r){const e=Date.now();a.field.qEnemyCreats().forEach(s=>{s.hurtDirect(this.level,this.code,e)})}flspkC(){this.faction="T",this.rarity="C",this.name="Flame Speaker",this.jr1=this.lValN([2,6,13]),this.jr2=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.bonus={exist:this.ddp9(0,0,0,t)*.5}}flspkP(t,r){a.player.ddf3(!t.ownerPlayerA,this.boof235,t.cardCode)}kasC(){this.faction="T",this.rarity="L",this.name="Kas, Arcweaver",this.jr1=this.boof4814,this.jr2=this.jr1,this.tribe.push("LT","AS"),this.hints=["OL","LKV"],this.text="When you play a spell, Kas battles an additional time this turn.",this.bonus={exist:this.ddp9(0,this.jr1,this.jr1,0)*.5}}kasP(t,r){const e=a.field.jr5(t.trigger.creatId);e.extraBattles+=1}}class rt extends x{lookup(t){return{["CSB"]:{c:()=>this.corpsC(),v:e=>this.corpsV(e)},["DSK"]:{c:()=>this.dskC(),v:e=>this.dskV(e)},["FWK"]:{c:()=>this.fwlkC(),v:e=>this.fwlkV(e)},["FFD"]:{c:()=>this.ffC(),v:e=>this.ffV(e)},["GVS"]:{c:()=>this.ghsC(),v:e=>this.ghsV(e)},["GBG"]:{c:()=>this.ggC(),v:e=>this.ggV(e)},["GMR"]:{c:()=>this.gromC(),v:e=>this.gromV(e)},["MMX"]:{c:()=>this.mmeC(),v:e=>this.mmeV(e)},["NOZ"]:{c:()=>this.nyozC(),v:e=>this.nyozV(e)},["RSZ"]:{c:()=>this.rszC(),v:e=>this.rszV(e)},["SFM"]:{c:()=>this.spirmC(),v:e=>this.spirmV(e)},["VGN"]:{c:()=>this.vgfsC(),v:e=>this.vgfsV(e)},["XHS"]:{c:()=>this.xhostC(),v:e=>this.xhostV(e)},["ZTU"]:{c:()=>this.zimusC(),v:e=>this.zimusV(e)}}[t]}cardVengeance(t,r){this.lookup(t).v(r)}vtext="";venges=!0;fixedImgCreat=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.venges&&(this.text="Vengeance: "+this.vtext),this.vtext=""}get image(){return this.fixedImgCreat?this.fixedImage():super.image}jr3(t,r){const e=super.jr3(t,r);return this.venges&&e.jr4("VN",this.code),e}jr8(t){this.cardVengeance(this.cardCode(),t),a.batch.triggerDone()}corpsC(){this.faction="N",this.rarity="C",this.name="Corpulent Shambler",this.jr1=this.lValN([5,7,15]),this.jr2=this.jr1,this.tribe.push("ZB"),this.vtext="Put a 3/3 Zombie into this space.",this.bonus={play:this.ddp9(1,6,3,0)}}corpsV(t){const r=t.event,e=`${"ZBS"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}dskC(){this.faction="N",this.rarity="C",this.name="Death Seeker",this.jr1=1,this.jr2=1,this.tribe.push("HM"),this.fixedImgCreat=!0,this.hints=["ST"];const t=this.boof51015;this.vtext=`Put a ${t}/${t} Spirit into this space.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}dskV(t){const r=t.event,e=`${"SPN"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}fwlkC(){this.faction="N",this.rarity="C",this.name="Fell Walker",this.jr1=this.boof359,this.jr2=this.jr1,this.tribe.push("ZB"),this.vtext=`Put a ${this.jr1}/${this.jr1} Zombie into this space.`,this.bonus={play:this.ddp9(1,this.jr1*2,this.jr1,0)}}fwlkV(t){const r=t.event,e=`${"ZMB"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}ffC(){if(this.faction="N",this.rarity="H",this.name="Fleshfiend",this.jr1=this.boof6812,this.jr2=this.jr1,this.tribe.push("AB"),this.venges=this.level>1,this.vtext=`Put a level ${this.level-1} ${this.name} into this space.`,this.venges){const t=this.lValN([0,6,15]);this.bonus={play:this.ddp9(1,t*2,t,0)}}}ffV(t){const r=t.event,e=`${"FFD"}${this.level-1}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}ghsC(){this.faction="U",this.rarity="C",this.name="Glowhive Siren",this.jr1=this.boof3814,this.jr2=this.boof61117,this.tribe.push("IN"),this.vtext=`You gain ${this.boof124} to ${this.gghigh-1} health.`,this.bonus={play:this.ddp9(0,0,0,this.boof258)}}ghsV(t){const r=a.randInt(this.boof124,this.gghigh);a.player.healPlayer(t.ownerPlayerA,r)}get gghigh(){return this.lValN([5,9,13])}ggC(){this.faction="N",this.rarity="C",this.name="Graveborn Glutton",this.jr1=this.boof61117,this.jr2=this.boof3814,this.tribe.push("AB"),this.vtext=`Deal ${this.boof124} to ${this.gghigh-1} damage to the enemy player.`,this.bonus={play:this.ddp9(0,0,0,this.boof258)}}ggV(t){const r=a.randInt(this.boof124,this.gghigh);a.player.ddf3(!t.ownerPlayerA,r,this.code)}gromC(){this.faction="U",this.rarity="C",this.name="Grove Matriarch",this.jr1=this.boof4814,this.jr2=this.jr1+2,this.tribe.push("PL");const t=N.minionBuff(this.level),r=N.minionName(this.level);this.vtext=`Put a ${t}/${t} ${r} into this space.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}gromV(t){const r=t.event,e=N.minionCode(this.level);a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}mmeC(){this.faction="A",this.rarity="C",this.name="Metamind Explorer",this.jr1=this.boof3713,this.jr2=this.jr1+2,this.tribe.push("MM"),this.vtext=`Draw ${this.level} cards.`,this.bonus={play:this.ddp9(0,0,0,0,this.level/4)}}mmeV(t){a.player.drawCard(t.ownerPlayerA,this.level)}nyozC(){this.faction="N",this.rarity="R",this.name="Nyrali Ooze",this.jr1=this.boof247,this.jr2=this.jr1,this.tribe.push("OZ");const t=this.level+this.jr1+1;this.vtext=`Put a ${t}/${t} Oozeling into this space.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}nyozV(t){const r=t.event,e=`${"OOZ"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}rszC(){this.faction="N",this.rarity="R",this.name="Runescarred Zombie",this.jr1=this.lValN([5,8,16]),this.jr2=this.boof359,this.tribe.push("ZB"),this.vtext=`Put a ${a.log.levelGateText(this.level,!0)}spell at random from your discard pile into your hand.`,this.bonus={play:this.ddp9(0,0,0,0,.25)}}rszV(t){const r=a.player.toPlayer(t.ownerPlayerA),e=d.target("TD");e.player=a.player.toTarget(r),e.card="S",e.level=a.target.ddf2(this.level);const s=a.target.deckByTarget(e);if(s.length>0){const c=s[a.randInt(0,s.length)];r.discard.splice(c[1],1),r.hand.push(c[0])}}spirmC(){this.faction="T",this.rarity="H",this.name="Spiritflame Mystic",this.jr1=this.boof6912,this.jr2=this.jr1-3,this.tribe.push("HM"),this.hints=["ENF","EML","OP"],this.vtext=`Deal ${this.boof246} damage to each creature.`}spirmV(t){const r=this.boof246,e=Date.now();a.field.qActiveCreats().forEach(s=>s.hurtDirect(r,this.code,e))}vgfsC(){this.faction="N",this.rarity="C",this.name="Vengeful Spirit",this.jr1=this.boof357,this.jr2=this.jr1-2,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof369n;this.vtext=`Give the opposing creature ${a.log.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*-2,-t,0)}}vgfsV(t){const e=t.event.creature.opposed;if(e){const s=this.boof369n;e.buff(s,s)}}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.jr1=this.boof359,this.jr2=this.boof135,this.tribe.push("AB"),this.vtext=`Deal ${this.jr1} damage to the enemy player and you gain ${this.jr1} health.`,this.bonus={play:this.ddp9(0,0,0,this.jr1*2)}}xhostV(t){const r=this.jr1;a.player.ddf3(!t.ownerPlayerA,r,this.code),a.player.healPlayer(t.ownerPlayerA,r)}zimusC(){this.faction="N",this.rarity="L",this.name="Zimus, the Undying",this.jr1=this.boof51014,this.jr2=this.lValN([2,5,7]),this.tribe.push(this.level===1?"HM":"ZB"),this.venges=this.level>1,this.vtext=`Spawn a Zimus, the ${this.level===2?"Returned":"Undying"}.`,this.level<3?(this.hints=["LV"],this.level===2&&(this.bonus={play:this.ddp9(1,15,10,0)})):(this.hints=["ST"],this.bonus={play:this.ddp9(0,0,0,0,8)})}zimusV(t){let r;this.level===2?r=`${"ZTR"}2`:r=`${"ZTU"}3`,a.field.birthCreature(r,"S",t.ownerPlayerA)}}class Gt extends Q{lookup(t){return{["DIS"]:{c:()=>this.disnC(),p:e=>this.disnZ(e),e:e=>this.disnE(e)},["DCH"]:{c:()=>this.dchantC(),p:e=>this.dchantZ(e),e:e=>this.dchantE(e)},["ESU"]:{c:()=>this.esrgC(),p:e=>this.esrgZ(e),e:e=>this.esrgE(e)},["ITO"]:{c:()=>this.itorC(),p:e=>this.itorZ(e),e:e=>this.itorE(e)},["MSP"]:{c:()=>this.mendC(),p:e=>this.mendZ(e),e:e=>this.mendE(e)},["NEM"]:{c:()=>this.netherC(),p:e=>this.netherZ(e),e:e=>this.netherE(e)}}[t]}cardCast(t,r){this.lookup(t).p(r)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(d.playerActTarg(this.playTarg,"CARD",this.code)),t}handleAction(t){this.logSpell();const r=a.state.getPlayer(t.playerA);this.cardCast(this.cardCode(),r),a.turn.spellCast()}ddf7(t){return this.lookup(this.cardCode()).e(t)}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){a.player.ddf3(t,a.randInt(1,this.dshigh),this.code)}get dshigh(){return this.lValN([9,16,26])}disnE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerDmg(t.playerA,this.dshigh/2)],r}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){a.player.healPlayer(t,this.boof81220)}dchantE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerLife(t.playerA,this.boof81220)],r}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=["LV"]),this.playTarg="F",this.text=`Draw ${this.level} card.`}esrgZ(t){a.player.drawCard(t,this.level)}esrgE(t){return d.actionEval(t,"ST")}itorC(){this.faction="T",this.rarity="R",this.name="Ice Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg="E",this.text=`Deal ${this.boof234} damage to the enemy player.`}itorZ(t){a.player.ddf3(t,this.boof234,this.code)}itorE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerDmg(t.playerA,this.boof234)],r}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){a.player.healPlayer(t,a.randInt(1,this.mendboof+1))}get mendboof(){return this.lValN([10,20,40])}mendE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerLife(t.playerA,this.mendboof/2)],r}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 r=this.boof4712;a.player.ddf3(t,r,this.code),a.player.healPlayer(!t.isPlayerA,r)}netherE(t){const r=this.boof4712,e=d.actionEval(t,"ST");return e.vectors=[d.evalVectorPlayerLife(!t.playerA,r),d.evalVectorPlayerDmg(t.playerA,r)],e}}class cr extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Rageborn Hellion",this.jr1=this.boof469,this.jr2=this.jr1*2,this.tribe.push("FR","EL"),this.hints=["OL","LKV"],this.text=`When a friendly creature ${a.log.dbdtap()}, ${this.name} gets ${a.log.jr9(this.level,this.level)}.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.owner===t.ownerPlayerA}return!1}jr8(t){a.field.jr5(t.creatId).buff(this.level,this.level),a.batch.triggerDone()}}class vt extends x{lookup(t){return{["AIV"]:{c:()=>this.avinvC(),r:e=>this.avinvR(e)},["BSP"]:{c:()=>this.bskphC(),r:e=>this.bskphR(e)},["CRC"]:{c:()=>this.crucC(),r:e=>this.crucR(e)},["ESK"]:{c:()=>this.ebknC(),r:e=>this.ebknR(e)},["MMV"]:{c:()=>this.mmovC(),r:e=>this.mmovR(e)},["RGG"]:{c:()=>this.runegC(),r:e=>this.runegR(e)},["SSR"]:{c:()=>this.solrevC(),r:e=>this.solrevR(e)},["SSM"]:{c:()=>this.spshamC(),r:e=>this.spshamR(e)},["SSG"]:{c:()=>this.snoutC(),r:e=>this.snoutR(e)},["UGM"]:{c:()=>this.mantisC(),r:e=>this.mantisR(e)}}[t]}rtext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Gain Rank: "+this.rtext}jr3(t,r){const e=super.jr3(t,r);return e.jr4("RU",this.code),e}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.ownerPlayerA:!1}jr8(t){this.lookup(this.cardCode()).r(t),a.batch.triggerDone()}avinvC(){this.faction="T",this.rarity="H",this.name="Avalanche Invoker",this.jr1=this.boof6914,this.jr2=this.jr1+1,this.tribe.push("ER","AS"),this.hints=["TL"],this.rtext=`Deal ${this.boof3612} damage to each non-Tempys creature.`}avinvR(t){const r=this.boof3612,e=Date.now();a.field.qActiveCreats().filter(s=>s.faction!=="T").forEach(s=>s.hurtDirect(r,this.code,e))}bskphC(){this.faction="N",this.rarity="C",this.name="Blightskull Phantasm",this.jr1=this.boof5814,this.jr2=this.boof61017,this.tribe.push("ST"),this.hints=["TL","OP"];const t=this.boof369n;this.rtext=`the opposing creature gets ${a.log.jr9(t,t)}.`}bskphR(t){const e=a.field.jr5(t.creatId).opposed;if(e){const s=this.boof369n;e.buff(s,s)}}crucC(){this.faction="A",this.rarity="R",this.name="Crucible Colossus",this.jr1=this.boof61016,this.jr2=this.jr1+2,this.tribe.push("RB"),this.initDefend=!0,this.hints=["TL"],this.rtext=`Negate Defender from ${this.name}.`}crucR(t){const r=a.field.jr5(t.creatId);r.negateDefender=!0}ebknC(){this.faction="N",this.rarity="H",this.name="Ebonskull Knight",this.jr1=this.lValN([9,13,18]),this.jr2=this.jr1-2,this.tribe.push("VP"),this.hints=["TL"],this.rtext=`Destroy ${this.name}.`}ebknR(t){const r=a.field.jr5(t.creatId);a.death.destroy(r,this.code)}mmovC(){this.faction="A",this.rarity="C",this.name="Metamind Overseer",this.jr1=this.boof5915,this.jr2=this.jr1+1,this.tribe.push("MM"),this.hints=["TL"],this.rtext="Draw 2 cards."}mmovR(t){a.player.drawCard(t.ownerPlayerA,2)}runegC(){this.faction="U",this.rarity="H",this.name="Runegrove Guardian",this.jr1=this.boof4814,this.jr2=this.jr1,this.tribe.push("PL"),this.hints=["TL"],this.rtext=`${this.name} gets ${a.log.jr9(this.jr1,this.jr1)}.`}runegR(t){a.field.jr5(t.creatId).buff(this.jr1,this.jr1)}solrevC(){this.faction="U",this.rarity="L",this.name="Solstice Reveler",this.jr1=this.boof4816,this.jr2=this.jr1,this.tribe.push("HM"),this.hints=["TL","FRS"];const t=this.solbof;this.rtext=`each friendly creature gets ${a.log.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}solrevR(t){const r=this.solbof;a.field.ddf1().forEach(e=>{e.buff(r,r),this.level===3&&(e.breakthrough=!0)})}get solbof(){return this.jr1/2}spshamC(){this.faction="T",this.rarity="C",this.name="Spiritfrost Shaman",this.jr1=this.boof71117,this.jr2=this.boof4610,this.tribe.push("HM"),this.hints=["TL"],this.rtext=`Deal ${this.boof579} damage to the enemy player.`}spshamR(t){a.player.ddf3(!t.ownerPlayerA,this.boof579,this.code)}snoutC(){this.faction="U",this.rarity="C",this.name="Stouthide Stegadon",this.jr1=this.boof4714,this.jr2=this.boof71117,this.tribe.push("DN"),this.hints=["TL"],this.rtext=`Heal ${this.snoutbof} damage from ${this.name}.`}snoutR(t){a.field.jr5(t.creatId).heal(this.snoutbof)}get snoutbof(){return this.level*10}mantisC(){this.faction="U",this.rarity="C",this.name="Umbraglim Mantis",this.jr1=this.boof6914,this.jr2=this.jr1-1,this.tribe.push("IN"),this.hints=["TL"],this.rtext=`You gain ${this.mantbof} health.`}mantisR(t){a.player.healPlayer(t.ownerPlayerA,this.mantbof)}get mantbof(){return this.lValN([8,10,12])}}class dr extends x{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Riftlasher",this.jr1=this.boof359,this.jr2=this.boof61016,this.tribe.push("FR","EL"),this.hints=["OL","LKV","ATH"],this.text=`When ${this.name} ${a.log.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.ddp9(0,this.jr1,0,0)}}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("DM",this.code);return s.interactive=!0,e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.id===t.creatId&&t.ownerPlayerA===a.state.ddf9()}return!1}jr8(t){const r=t.event,e=a.target.toActions(d.crEnemyActTarg("CARD",this.code,a.enTil(t.creatId,r.dmg)));e.length>0?(e.push(a.action.noneEndTrigger()),a.action.ddf5(e)):a.batch.triggerDone()}handleAction(t){const r=a.deTil(t.param);a.field.ddf6(t).hurtDirect(parseInt(r[1]),this.code),a.action.actionDone(!0)}ddf7(t){const r=a.deTil(t.param);return d.ddp2(t,t.playerA,t.lane,{dmg:parseInt(r[1])})}}class ur extends x{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Scourgeflame Sorcerer",this.jr1=this.boof358,this.jr2=this.boof5914,this.tribe.push("ZB");const r=`Destroy a ${a.log.levelGateText(this.level+1,!0)}enemy creature.`,e=this.level===3?": ":", destroy another friendly creature: ";this.text=`Activate${e}${r}`}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.deTil(t.param);if(r[1]==="P1")a.action.ddf5(this.getCardActions(t));else{const e=a.field.jr5(r[0]),s=Date.now();if(this.level<3){const u=a.field.jr5(r[2]);a.death.destroy(u,this.code,s)}const c=a.field.ddf6(t);a.death.destroy(c,this.code,s),e.endActivation()}}friends(t){const r=d.crFriendNotMeActTarg("CARD",t.id,this.code,a.enTil(t.id,"P1"));return a.target.toActions(r)}enemies(t,r=""){const e=d.crEnemyActTarg("CARD",this.code,a.enTil(t.id,"P2",r));return e.level=a.target.ddf2(this.level+1),a.target.toActions(e)}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param);let s;return this.level===3?s=this.enemies(e):s=this.friends(e),s.push(a.action.cancelAction()),s}else if(t.actionKey==="CARD"){const e=a.deTil(t.param),s=a.field.jr5(e[0]),c=a.field.ddf6(t),u=this.enemies(s,c.id);return u.push(a.action.cancelAction()),u}return super.getCardActions(t,r)}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=a.deTil(t.param);if(r[1]==="P1")return d.ddp5(t);{const e=t,s=d.ddp7(t,e.playerA,e.lane);if(this.level<3){const c=a.field.jr5(r[2]),u=d.ddp1(c.owner,c.lane);u.destroy=!0,s.vectors.push(u)}return s}}}}class fr extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Seismic Adept",this.jr1=this.boof4712,this.jr2=this.boof61218,this.tribe.push("HM"),this.text="Activate: Move an enemy creature to another available enemy space.",this.bonus={exist:this.level*.5}}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{const e=a.field.jr5(r[1]);a.field.jr5(r[2]).move(t.lane),e.endActivation()}}empties(t,r=""){const e=d.actionTarget("TF","CARD",this.code,a.enTil("P2",t.id,r));return e.field="E",e.player="E",a.target.toActions(e)}enemies(t){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P1",t.id));return a.target.toActions(r)}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=this.enemies(e);return s.push(a.action.cancelAction()),s}else if(t.actionKey==="CARD"){const e=a.field.ddf6(t),s=a.deTil(t.param),c=a.field.jr5(s[1]),u=this.empties(c,e.id);return u.push(a.action.cancelAction()),u}return super.getCardActions(t,r)}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=d.actionEval(t,"ST"),s=t,c=a.field.jr5(r[2]),u=d.ddp1(c.owner,c.lane);return u.moveTo=s.lane,e.vectors.push(u),e}}}}class Ot extends x{constructor(t){super(t),this.rarity="R",this.jr1=this.boof4612,this.jr2=this.boof61016;const r=this.cardCode();if(r==="SSS"?this.steel():r==="LSS"?this.life():r==="FSS"?this.flame():r==="DSS"&&this.dark(),this.level>1){const e=a.log.levelGateText(this.level-1);this.text=`When you play a ${e} ${a.log.factionText(this.faction)} card, you may ${this.tuxt}.`}else this.hints=["LV"];this.bonus={exist:this.level*.5},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 ${a.log.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 ${a.log.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,r){const e=super.jr3(t,r);if(this.level>1){const s=e.jr4("PC",this.code);s.interactive=!0}return e}ddf8(t){if(t.trigger.type==="PC"){const r=t.event;if(r.playerA===t.ownerPlayerA){const e=a.cards.getCard(r.cardCode);if(e.level0&&a.field.qActiveCreats().length>1&&t.push(r),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]),c=this.boof5814;a.death.destroy(s,this.code),e.buff(c,c),a.turn.spellCast()}}getCardActions(t,r){const e=a.field.ddf6(t),s=a.target.toActions(d.crNotMeActTarg("CARD",e.id,this.code,a.enTil("P2",e.id)));return s.push(a.action.cancelAction()),s}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=a.field.jr5(r[1]),s=d.ddp8(t,e,"SD"),c=this.boof5814;return s.vectors.push(d.ddp1(t.playerA,t.lane,{att:c,hlt:c})),s}}}class mr extends x{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Statis Warden",this.jr1=this.boof5915,this.jr2=this.jr1+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,r){const e=super.jr3(t,r),s=e.jr4("PC",this.code);return s.interactive=!0,e}handleAction(t){const r=a.field.ddf6(t),e=d.mod("DF",!0,t.param);e.expiry="EN",r.addMod(e),a.action.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const r=t.event;return r.playerA===t.ownerPlayerA&&a.cards.getCard(r.cardCode).type==="S"}return!1}jr8(t){const r=d.crFriendNotMeActTarg("CARD",t.creatId,this.code,t.creatId);r.canDefender=!0;const e=a.target.toActions(r);e.length===0?a.batch.triggerDone():(e.push(a.action.noneEndTrigger()),a.action.ddf5(e))}ddf7(t){return d.ddp2(t,t.playerA,t.lane,{def:!0})}}class pr extends Q{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Static Shock",this.text=`Deal ${this.boof124} damage to a creature or player. You may play an additional ${a.log.levelGateText(this.level,!0)}spell this turn.`}playTargets(){const t=super.playTargets();return t.push(d.crActTarg("CARD",this.code),d.actionTarget("TP","CARD",this.code)),t}handleAction(t){this.logSpell(),t.zone==="P"?a.player.ddf3(t.playerA,this.boof124,this.code):a.field.ddf6(t).hurtDirect(this.boof124,this.code);const r=a.turn.freeCard(this.code);r.condition.level=a.target.ddf2(this.level),r.condition.card="S",a.turn.spellCast()}ddf7(t){const r=this.boof124,e=d.actionEval(t,"ST");if(t.zone==="P")e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r));else{const s=t;e.vectors.push(d.ddp1(s.playerA,s.lane,{dmg:r}))}return e}}class yr extends x{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steelscale Dragon",this.jr1=this.boof4812,this.jr2=this.jr1+2,this.tribe.push("RB","DG"),this.initMobile=this.level,this.text=`While each other friendly creature has Defender, ${this.name} gets ${a.log.jr9(this.jr1,0)}, Armor ${this.boof246}, and Breakthrough.`}jr3(t,r){const e=super.jr3(t,r),s=e.addEffect("DF",this.code);s.area="C";const c=e.addEffect("PS",this.code);return c.area="C",e}enforceEffect(t,r){const e=d.crNotMeTarg(r.id);if(e.player=a.player.toTarget(r.owner),a.field.creatByTarget(e).some(c=>!c.defender))r.removeModSafe(r.id);else{const c=d.mod("AT",this.jr1,r.id),u=d.mod("AR",this.boof246,r.id),m=d.mod("BT",!0,r.id);r.addModSafe(c),r.addModSafe(u),r.addModSafe(m)}}}class br extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Storm Bringer",this.jr1=this.boof5814,this.jr2=this.boof61018,this.tribe.push("WN","EL"),this.hints=["FH"];const r=this.boof246;this.bonus={exist:this.ddp9(0,r+2,0,0)},this.text=`At the start of each turn, ${this.name} moves to an available space at random. Flank: Deal ${r} damage to the opposing creature.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("TS",this.code),e.jr4("FK",this.code),e}ddf8(t){return t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="TS"){const r=a.field.emptyLanes(t.ownerPlayerA);r.length>0&&a.field.jr5(t.creatId).move(r[a.randInt(0,r.length)]),a.batch.triggerDone()}else if(t.trigger.type==="FK"){const e=t.event.creature.opposed;e&&e.hurtDirect(this.boof246,this.code),a.batch.triggerDone()}else super.jr8(t)}}class vr extends x{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Synapsis Oracle",this.jr1=this.boof358,this.jr2=this.lValN([9,15,24]),this.tribe.push("HM"),this.hints=["OL"];let r;this.level===3?(this.text="Activate: Level up a card in your hand.",r=1):(this.text=`Activate: ${a.log.daluac(!0)}.`,r=.5),this.bonus={exist:r}}canActivate(t){return a.state.getPlayer(t.owner).hand.some(e=>a.cards.getCard(e).canLevel())}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.jr5(t.param),e=a.state.getPlayer(r.owner);this.level===3?e.hand[t.position]=a.cards.getCard(t.card).levelUpCard():a.turn.levelAndDiscard(t),r.endActivation()}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.jr5(t.param),s=d.lvlHandActTarg(this.code,e.id);return a.target.toActions([s,a.target.buttonTarget("CANC")])}return super.getCardActions(t,r)}ddf7(t){return t.actionKey==="ACTV"?d.ddp5(t):d.actionEval(t,"DC")}}class Ar extends ne{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Thundersaur",this.jr1=0,this.jr2=this.level*12,this.tribe.push("DN"),this.initBT=!0,this.hints=["DLK","LKR"],this.text="When Thundersaur is dealt damage, it gets +1 attack for each damage dealt."}jr8(t){const r=t.event,e=r.target;e?e.buff(r.dmg,0):a.log.add("ERROR couldnt find creature - thundersaur trigger"),a.batch.triggerDone()}}class At extends x{lookup(t){return{["DCS"]:{c:()=>this.delphC(),t:e=>this.delphT(e)},["GMP"]:{c:()=>this.gmpC(),t:e=>this.gmpT(e)},["LBL"]:{c:()=>this.lbcC(),t:e=>this.lbcT(e)},["SSE"]:{c:()=>this.sseC(),t:e=>this.sseT(e)},["SPD"]:{c:()=>this.spdC(),t:e=>this.spdT(e)},["SPM"]:{c:()=>this.spmC(),t:e=>this.spmT(e)},["TBA"]:{c:()=>this.tbaC(),t:e=>this.tbaT(e)},["VCG"]:{c:()=>this.vgC(),t:e=>this.vgT(e)},["WBG"]:{c:()=>this.woeC(),t:e=>this.woeT(e)},["ZSH"]:{c:()=>this.zyxC(),t:e=>this.zyxT(e)}}[t]}bothTurns=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,r){const e=super.jr3(t,r);return e.jr4("TS",this.code),e}ddf8(t){return t.trigger.type==="TS"?this.bothTurns?!0:t.event.playerA===t.ownerPlayerA:!1}jr8(t){this.lookup(this.cardCode()).t(t),a.batch.triggerDone()}delphC(){this.faction="A",this.rarity="L",this.name="Delpha, Chronosculptor",this.jr1=this.boof7914,this.jr2=this.jr1,this.tribe.push("HM"),this.level>1&&(this.hints=["OL"],this.bonus={exist:this.ddp9(0,9,4,0)},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 r=a.state.getPlayer(t.ownerPlayerA),e=r.hand.map((c,u)=>{const m=a.cards.getCard(c);return{idx:u,lvl:m.level,nxt:m.canLevel()?m.levelUpCard():""}}).filter(c=>c.nxt&&(this.level===3||c.lvl===1)),s=e.length;if(s>0){const c=e[a.randInt(0,s)];r.hand[c.idx]=c.nxt}}}gmpC(){this.faction="A",this.rarity="L",this.name="Ghox, Metamind Paragon",this.jr1=this.boof4814,this.jr2=this.boof61218,this.tribe.push("MM"),this.hints=["OL"];const t=this.level===1?"":"s";this.bonus={exist:this.ddp9(0,0,0,0,this.level*.5)},this.text=`At the start of your turn, draw ${this.level} card${t}.`}gmpT(t){a.player.drawCard(t.ownerPlayerA,this.level)}lbcC(){this.faction="U",this.rarity="R",this.name="Lightbringer Cleric",this.jr1=this.boof51015,this.jr2=this.jr1,this.tribe.push("TK"),this.hints=["OL"],this.bonus={exist:this.ddp9(0,0,0,this.boof3610)},this.text=`At the start of your turn, you gain ${this.boof137} to ${this.boof5914-1} health.`}lbcT(t){a.player.healPlayer(t.ownerPlayerA,a.randInt(this.boof137,this.boof5914))}sseC(){this.faction="U",this.rarity="L",this.name="Scatterspore Eidolon",this.jr1=8,this.jr2=this.jr1,this.tribe.push("PL"),this.hints=["OL","EMO","DL"];const t=this.boof357,r=N.minionName(this.level);this.bonus={exist:this.ddp9(1,t*2,t,0)},this.text=`At the start of your turn, Spawn a ${t}/${t} ${r}.`}sseT(t){const r=this.lValS(["SXD","SXP","SXT"])+this.level.toString();a.field.birthCreature(r,"S",t.ownerPlayerA)}spdC(){this.faction="U",this.rarity="R",this.name="Shardplate Delver",this.jr1=this.boof4612,this.jr2=this.jr1,this.tribe.push("DN"),this.hints=["OL"];const t=this.boof246;this.bonus={exist:this.ddp9(0,t*2,t,0)},this.text=`At the start of your turn, ${this.name} gets ${a.log.jr9(t,t)}.`}spdT(t){const r=this.boof246;a.field.jr5(t.creatId).buff(r,r)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.jr1=this.boof91421,this.jr2=this.jr1,this.tribe.push("IN"),this.hints=["OP"],this.text="At the start of your turn, randomly discard down to two cards in your hand."}spmT(t){const r=a.state.getPlayer(t.ownerPlayerA);if(r.hand.length>2){let e=r.hand.slice(),s=[];for(;e.length>2;)s.push(e.splice(a.randInt(0,e.length),1)[0]);r.discard.push(...s),r.hand=e}}tbaC(){this.faction="U",this.rarity="L",this.name="Talisin, Bard of Abundance",this.jr1=this.lValN([8,12,16]),this.jr2=this.lValN([10,14,20]),this.tribe.push("SY"),this.bothTurns=this.lValB([!0,!0,!1]),this.hints=["OL"],this.level===3&&(this.bonus={exist:this.ddp6()}),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){a.state.gs.turn.regularPlays+=1}vgC(){this.faction="T",this.rarity="C",this.name="Volcanic Giant",this.jr1=this.boof51015,this.jr2=this.jr1,this.tribe.push("ER","GT"),this.hints=["OL"],this.bonus={exist:this.ddp9(0,0,0,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 r=a.randInt(this.boof137,this.boof5914);a.player.ddf3(!t.ownerPlayerA,r,this.code)}woeC(){this.faction="N",this.rarity="L",this.name="Woebringer",this.jr1=this.lValN([7,10,18]),this.jr2=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 r=d.crTarg();this.level===3&&(r.player=a.player.toTarget(!t.ownerPlayerA));const e=a.field.creatByTarget(r);let s=99999,c=[];e.forEach(m=>{m.attack===s?c.push(m):m.attack0){const m=c[a.randInt(0,u)];a.death.destroy(m,this.code)}}zyxC(){this.faction="T",this.rarity="L",this.name="Zyx, Storm Herald",this.jr1=this.boof4712,this.jr2=this.lValN([6,9,20]),this.initMobile=1,this.tribe.push("LT","AS"),this.hints=["OL","ATH","LKV"],this.text="Zyx battles an additional time on your turn."}zyxT(t){const r=a.field.jr5(t.creatId);r.extraBattles+=1}}class Zt extends Q{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(e,s)=>this.confZ(e,s),e:(e,s,c)=>this.confE(e,s,c)},["CSG"]:{c:()=>this.cystgC(),z:(e,s)=>this.cystgZ(e,s),e:(e,s,c)=>this.cystgE(e,s,c)},["GRN"]:{c:()=>this.grenC(),z:(e,s)=>this.grenZ(e,s),e:(e,s,c)=>this.grenE(e,s,c)},["TWG"]:{c:()=>this.twstrC(),z:(e,s)=>this.twstrZ(e,s),e:(e,s,c)=>this.twstrE(e,s,c)}}[t]}cardCast(t,r,e){this.lookup(t).z(r,e)}playTarg;constructor(t){super(t),this.playTarg=d.crActTarg("CARD",this.code),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",a.field.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.ddf5(this.getCardActions(t));else{this.logSpell();const e=a.field.ddf6(t),s=a.field.jr5(r[1]);this.cardCast(this.cardCode(),s,e),a.turn.spellCast()}}getCardActions(t){const r=a.field.ddf6(t);return this.playTarg.notMe=r.id,this.playTarg.param=a.enTil("P2",r.id),a.target.toActions([this.playTarg,a.target.buttonTarget("CANC")])}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=a.field.ddf6(t),s=a.field.jr5(r[1]);return this.lookup(this.cardCode()).e(t,s,e)}}confC(){this.faction="T",this.rarity="C",this.name="Conflagrate",this.text=`Deal ${this.boof369} to two enemy creatures.`,this.playTarg.player="E"}confZ(t,r){const e=Date.now(),s=this.boof369;t.hurtDirect(s,this.code,e),r.hurtDirect(s,this.code,e)}confE(t,r,e){const s=this.boof369,c=d.actionEval(t,"ST");return c.vectors=[d.ddp1(r.owner,r.lane,{dmg:s}),d.ddp1(e.owner,e.lane,{dmg:s})],c}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,r){const e=this.boof246;t.addArmor(e),r.addArmor(e)}cystgE(t,r,e){const s=this.boof246,c=d.actionEval(t,"ST");return c.vectors=[d.ddp1(r.owner,r.lane,{arm:s}),d.ddp1(e.owner,e.lane,{arm:s})],c}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,r){const e=this.boof246;t.addRegen(e),r.addRegen(e)}grenE(t,r,e){const s=this.boof246,c=d.actionEval(t,"ST");return c.vectors=[d.ddp1(r.owner,r.lane,{rgn:s}),d.ddp1(e.owner,e.lane,{rgn:s})],c}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 ${a.log.jr9(t,t)}.`,this.playTarg.player="F"}twstrZ(t,r){const e=this.tsboof;t.buff(e,e),r.buff(e,e)}twstrE(t,r,e){const s=this.tsboof,c=d.actionEval(t,"ST");return c.vectors=[d.ddp1(r.owner,r.lane,{att:s,hlt:s}),d.ddp1(e.owner,e.lane,{att:s,hlt:s})],c}}class kr extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Umbruk Icecrusher",this.jr1=this.boof61014,this.jr2=this.boof246,this.tribe.push("DN"),this.hints=["OL","ALU","ATH","LKV"],this.bonus={exist:this.ddp9(0,5,this.jr1+2,0)},this.text=`When ${this.name} ${a.log.dbdtap()}, deal that much damage to that player. Allied Uterra: This gets ${a.log.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e.jr4("DM",this.code),e}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.id===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR"){if(a.turn.allied("U")){const r=a.field.jr5(t.creatId);r.breakthrough=!0,r.buff(2,2)}a.batch.triggerDone()}else if(t.trigger.type==="DM"){const r=t.event;a.player.ddf3(r.target,r.dmg,this.code),a.batch.triggerDone()}}}class Tr extends x{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Umbruk Lasher",this.jr1=this.boof71014,this.jr2=this.jr1-1,this.initBT=!0,this.tribe.push("DN"),this.hints=["OL","LKV","ATH","ALT"],this.text=`Allied Tempys: When ${this.name} ${a.log.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.ddp9(0,this.jr1,0,0)}}jr3(t,r){const e=super.jr3(t,r);return e.jr4("FR",this.code),e}handleAction(t){a.field.ddf6(t).hurtDirect(parseInt(t.param),this.code),a.action.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.id===t.creatId&&r.source.owner===a.state.ddf9()}return!1}jr8(t){if(t.trigger.type==="FR"){if(a.turn.allied("T")){const r=a.field.jr5(t.creatId),e=r.jr4("DM",this.code);e.interactive=!0,r.changed=!0}a.batch.triggerDone()}else if(t.trigger.type==="DM"){const r=t.event,e=a.target.toActions(d.crEnemyActTarg("CARD",this.code,r.dmg.toString()));e.length>0?(e.push(a.action.noneEndTrigger()),a.action.ddf5(e)):a.batch.triggerDone()}}ddf7(t){return d.ddp2(t,t.playerA,t.lane,{dmg:parseInt(t.param)})}}class Cr extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Uranti Heartseeker",this.jr1=this.boof4915,this.jr2=this.jr1,this.initDefend=!0,this.tribe.push("YT"),this.text=`Activate: Deal ${this.jr1} damage to an enemy creature or player with exactly ${this.jr1} health.`}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){if(t.zone==="F")a.field.ddf6(t).hurtDirect(this.jr1,this.code);else{const e=t;a.player.ddf3(e.playerA,this.jr1,this.code)}a.field.jr5(t.param).endActivation()}findVictims(t){const r=this.jr1,e=d.crEnemyTarg(),c=a.field.creatByTarget(e).filter(m=>m.health===r).map(m=>d.fieldSelectAction("CARD",m.lane,m.owner)),u=a.player.toPlayer("E");return u.health===r&&c.push(d.playerSelectAction("CARD",u.isPlayerA)),c.forEach(m=>{m.hostCard=this.code,m.param=t}),c}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=this.jr1,e=d.actionEval(t,"ST");if(t.zone==="P")e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r)),e.bonus=9999;else{const s=t;e.vectors.push(d.ddp1(s.playerA,s.lane,{dmg:r}))}return e}}getCardActions(t,r){const e=r??a.field.jr5(t.param),s=this.findVictims(e.id);return s.push(a.action.cancelAction()),s}}class D extends x{constructor(t){super(t),this.cardConstruct(this.cardCode())}cardConstruct(t){({["AEN"]:()=>this.anvenf(),["AGU"]:()=>this.avguard(),["BWG"]:()=>this.brambleguard(),["CHY"]:()=>this.cavernhyd(),["CDC"]:()=>this.cindcol(),["CNM"]:()=>this.cindmy(),["DBP"]:()=>this.prowler(),["DMR"]:()=>this.raptor(),["DBR"]:()=>this.bearride(),["DSZ"]:()=>this.duskzomb(),["FWB"]:()=>this.fangbear(),["FWR"]:()=>this.ravager(),["FMS"]:()=>this.firemane(),["FPR"]:()=>this.flop(),["FGA"]:()=>this.falpha(),["FGB"]:()=>this.fbeta(),["FGO"]:()=>this.fomega(),["FPS"]:()=>this.forgeplate(),["GGE"]:()=>this.geist(),["GGH"]:()=>this.ghast(),["GGS"]:()=>this.ggs(),["GCL"]:()=>this.glacial(),["IWC"]:()=>this.warcharger(),["LWY"]:()=>this.lwyrm(),["LHY"]:()=>this.lyshyd(),["MRF"]:()=>this.marrow(),["MMO"]:()=>this.mmop(),["NCW"]:()=>this.necrotic(),["NXC"]:()=>this.nexcore(),["OBD"]:()=>this.battledroid(),["OSP"]:()=>this.oss(),["RHC"]:()=>this.rime(),["SCS"]:()=>this.scorp(),["SCD"]:()=>this.scout(),["SFT"]:()=>this.scrap(),["SBA"]:()=>this.sparkblade(),["SKB"]:()=>this.sparkbot(),["SBR"]:()=>this.sparkass(),["SSN"]:()=>this.sfsent(),["SGI"]:()=>this.stonefist(),["SCL"]:()=>this.stormcall(),["SML"]:()=>this.lurker(),["TGS"]:()=>this.tsprout(),["TGN"]:()=>this.tgnome(),["TWS"]:()=>this.tscout(),["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]()}anvenf(){this.faction="A",this.rarity="C",this.name="Anvillon Enforcer",this.jr1=this.boof5711,this.jr2=this.jr1-1,this.initArmor=this.boof246,this.tribe.push("RB")}avguard(){this.faction="T",this.rarity="R",this.name="Avalanche Guardian",this.jr1=this.boof5915,this.jr2=this.lValN([8,15,23]),this.initMobile=1,this.initDefend=!0,this.tribe.push("IC","EL")}battledroid(){this.faction="A",this.rarity="H",this.name="Oreian Battledroid",this.jr1=this.lValN([5,7,17]),this.jr2=1,this.initArmor=this.jr1,this.tribe.push("RB")}bearride(){this.faction="U",this.rarity="C",this.name="Deepwood Bear Rider",this.jr1=this.lValN([5,16,18]),this.jr2=this.lValN([2,8,10]),this.tribe.push("LP")}brambleguard(){this.faction="U",this.rarity="C",this.name="Bramblewood Guardian",this.jr1=this.boof2612,this.jr2=this.lValN([9,14,24]),this.tribe.push("PL")}cavernhyd(){this.faction="U",this.rarity="C",this.name="Cavern Hydra",this.jr1=this.boof4711,this.jr2=this.boof71015,this.initRegen=this.boof135,this.tribe.push("HY")}cindcol(){this.faction="T",this.rarity="C",this.name="Cinder Colossus",this.jr1=this.lValN([3,13,24]),this.jr2=this.lValN([4,14,27]),this.initDefend=!0,this.level===1&&(this.hints=["LV"]),this.tribe.push("ER","EL")}cindmy(){this.faction="T",this.rarity="C",this.name="Cinder Mystic",this.jr1=this.lValN([4,11,21]),this.jr2=this.boof3714,this.tribe.push("FR","AS")}duskzomb(){this.faction="N",this.rarity="C",this.name="Duskspire Zombie",this.jr1=this.lValN([2,5,16]),this.jr2=this.lValN([5,8,19]),this.initRegen=4,this.tribe.push("ZB")}falpha(){this.faction="A",this.rarity="C",this.name="Forge Guardian Alpha",this.jr1=this.lValN([4,8,20]),this.jr2=this.lValN([8,14,26]),this.initDefend=!0,this.tribe.push("RB","GD")}fangbear(){this.faction="U",this.rarity="C",this.name="Fangwood Bear",this.jr1=this.boof61016,this.jr2=this.jr1,this.tribe.push("BR")}fbeta(){this.faction="A",this.rarity="R",this.name="Forge Guardian Beta",this.jr1=this.lValN([5,8,20]),this.jr2=this.lValN([3,6,18]),this.initArmor=this.boof124,this.tribe.push("RB","GD")}firemane(){this.faction="T",this.rarity="C",this.name="Firemane Steed",this.jr1=this.lValN([3,6,16]),this.jr2=this.lValN([6,9,19]),this.initMobile=2,this.tribe.push("FR","EL")}flop(){this.faction="T",this.rarity="C",this.name="Flowstone Primordial",this.jr1=this.lValN([6,7,15]),this.jr2=this.jr1+1,this.tribe.push("FR","EL")}fomega(){this.faction="A",this.rarity="L",this.name="Forge Guardian Omega",this.jr1=this.boof255080,this.jr2=this.jr1,this.initMobile=this.boof124,this.initArmor=this.initMobile*10,this.initBT=!0,this.initAggro=!0,this.consistent=!0,this.tribe.push("RB","GD")}forgeplate(){this.faction="A",this.rarity="C",this.name="Forgeplate Sentry",this.jr1=this.boof4915,this.jr2=this.jr1,this.initArmor=this.boof135,this.tribe.push("RB")}ggs(){this.faction="N",this.rarity="C",this.name="Grimgaunt Spectre",this.jr1=this.lValN([3,11,14]),this.jr2=this.jr1,this.initMobile=1,this.hints=["LV"],this.tribe.push("GG")}geist(){this.faction="N",this.rarity="C",this.name="Grave Geist",this.jr1=this.boof71118,this.jr2=this.boof4711,this.tribe.push("ST")}ghast(){this.faction="N",this.rarity="C",this.name="Grave Ghast",this.jr2=this.boof71013,this.jr1=this.jr2-2,this.initRegen=this.boof246,this.tribe.push("ZB")}glacial(){this.faction="T",this.rarity="C",this.name="Glacial Colossus",this.jr1=this.boof61016,this.jr2=this.lValN([8,13,19]),this.tribe.push("IC","EL"),this.initDefend=!0}hulk(){this.faction="N",this.rarity="C",this.name="Xithian Hulk",this.jr1=this.boof4814,this.jr2=this.jr1+3,this.tribe.push("AB")}lurker(){this.faction="U",this.rarity="C",this.name="Swampmoss Lurker",this.jr1=this.lValN([8,13,22]),this.jr2=this.lValN([4,6,15]),this.tribe.push("DN")}lwyrm(){this.faction="T",this.rarity="C",this.name="Lightning Wyrm",this.jr1=this.boof4711,this.jr2=this.boof258,this.tribe.push("LT","EL"),this.initAggro=!0}lyshyd(){this.faction="U",this.rarity="C",this.name="Lysian Hydra",this.jr1=this.boof5914,this.jr2=this.jr1+1,this.initRegen=this.level,this.tribe.push("HY")}marrow(){this.faction="N",this.rarity="C",this.name="Marrow Fiend",this.jr1=this.boof81117,this.jr2=this.lValN([1,5,13]),this.tribe.push("SK")}mmop(){this.faction="A",this.rarity="C",this.name="Metamind Operator",this.jr1=this.boof4610,this.jr2=this.lValN([10,14,18]),this.tribe.push("MM")}necrotic(){this.faction="N",this.rarity="C",this.name="Necrotic Wurm",this.jr1=this.lValN([4,7,18]),this.jr2=this.lValN([5,8,19]),this.tribe.push("WR")}nexcore(){this.faction="A",this.rarity="C",this.name="Nexus Core",this.jr1=0,this.jr2=this.lValN([15,25,40]),this.tribe.push("RB"),this.initDefend=!0}oss(){this.faction="N",this.rarity="R",this.name="Ossuary Spirit",this.jr1=this.lValN([1,3,6]),this.jr2=this.boof91420,this.initRegen=this.jr1+2,this.tribe.push("ST")}prowler(){this.faction="U",this.rarity="C",this.name="Deepbranch Prowler",this.jr1=this.lValN([8,9,10]),this.jr2=this.jr1,this.tribe.push("CT"),this.hints=["DL"],this.initBT=!0}raptor(){this.faction="U",this.rarity="C",this.name="Deepmoss Raptor",this.jr1=this.lValN([2,13,16]),this.jr2=this.jr1,this.hints=["LV","ST"],this.tribe.push("DN")}ravager(){this.faction="U",this.rarity="C",this.name="Fangwood Ravager",this.jr1=this.boof5917,this.jr2=this.jr1,this.tribe.push("BE")}rime(){this.faction="T",this.rarity="C",this.name="Rimehorn Charger",this.jr1=this.lValN([5,8,10]),this.jr2=this.jr1+3,this.initMobile=1,this.hints=["DL"],this.tribe.push("RM")}scorp(){this.faction="N",this.rarity="C",this.name="Scavenger Scorpion",this.jr1=this.lValN([6,9,11]),this.jr2=this.jr1,this.initRegen=this.level,this.hints=["DL"],this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.jr1=this.boof246,this.jr2=this.jr1,this.isFree=this.level>1,this.hints=[this.level===1?"LV":"DL"],this.tribe.push("RB")}scrap(){this.faction="A",this.rarity="H",this.name="Scrapforge Titan",this.jr1=this.lValN([1,5,20]),this.jr2=this.jr1,this.initArmor=this.lValN([1,5,10]),this.level===1&&(this.hints=["LV","ST"],this.bonus={play:1}),this.tribe.push("RB")}sfsent(){this.faction="A",this.rarity="C",this.name="Spiritforge Sentinel",this.jr1=this.lValN([3,6,9]),this.jr2=this.jr1*2,this.initArmor=this.lValN([1,2,6]),this.tribe.push("RB")}sparkbot(){this.faction="A",this.rarity="C",this.name="Spark Bot",this.jr1=this.boof5914,this.jr2=this.lValN([6,11,16]),this.tribe.push("RB")}sparkblade(){this.faction="A",this.rarity="C",this.name="Sparkblade Assassin",this.jr1=this.lValN([4,12,14]),this.jr2=this.lValN([5,13,15]),this.tribe.push("HM")}sparkass(){this.faction="T",this.rarity="C",this.name="Sparkbrand Asir",this.jr1=this.lValN([2,7,9]),this.jr2=this.lValN([6,11,13]),this.initAggro=!0,this.tribe.push("LT","AS")}stonefist(){this.faction="T",this.rarity="C",this.name="Stonefist Giant",this.jr1=this.lValN([3,7,16]),this.jr2=this.lValN([6,10,24]),this.tribe.push("ER","EL")}stormcall(){this.faction="T",this.rarity="C",this.name="Storm Caller",this.jr1=this.lValN([8,11,14]),this.jr2=this.jr1-2,this.tribe.push("WN","AS")}tgnome(){this.faction="A",this.rarity="C",this.name="Technognome",this.jr1=this.lValN([3,9,19]),this.jr2=this.jr1,this.level===1&&(this.hints=["LV"]),this.tribe.push("GN")}tscout(){this.faction="A",this.rarity="C",this.name="Tower Scout",this.jr1=this.boof5915,this.jr2=this.jr1,this.initMobile=1,this.tribe.push("HM")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.jr1=this.boof7911,this.jr2=this.jr1+1,this.hints=["DL"],this.tribe.push("PL")}unrelenting(){this.faction="N",this.rarity="H",this.name="Unrelenting Dead",this.jr1=this.boof4814,this.jr2=this.jr1,this.initRegen=this.jr1,this.tribe.push("ZB")}vblock(){this.faction="A",this.rarity="R",this.name="Vault Blockade",this.jr1=0,this.jr2=this.boof135,this.initArmor=this.boof101520,this.initDefend=!0,this.tribe.push("RB")}vtech(){this.faction="A",this.rarity="C",this.name="Vault Technician",this.jr1=this.boof61218,this.jr2=this.lValN([3,9,15]),this.tribe.push("HM")}warcharger(){this.faction="A",this.rarity="C",this.name="Ionic Warcharger",this.jr1=this.boof4915,this.jr2=this.lValN([7,12,18]),this.initMobile=1,this.tribe.push("RB")}waterwalk(){this.faction="T",this.rarity="C",this.name="Water Walker",this.jr1=this.lValN([5,12,14]),this.jr2=this.lValN([2,9,11]),this.tribe.push("IC","AS")}windprime(){this.faction="T",this.rarity="C",this.name="Wind Primordial",this.jr2=this.boof4814,this.jr1=this.jr2+2,this.initMobile=this.level,this.tribe.push("WN","EL")}xithcrush(){this.faction="N",this.rarity="C",this.name="Xithian Crusher",this.jr1=this.lValN([4,10,16]),this.jr2=this.jr1+2,this.tribe.push("AB")}yetiwar(){this.faction="T",this.rarity="C",this.name="Yeti Warcaller",this.jr1=this.boof248,this.jr2=this.lValN([10,15,23]),this.tribe.push("YT")}zombinf(){this.faction="N",this.rarity="C",this.name="Zombie Infantry",this.jr1=this.boof61015,this.jr2=this.jr1-1,this.tribe.push("ZB")}}class Sr extends Q{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Varna's Pact";const r=this.lValS(["a","two","three"]),e=this.level===1?"":"s",s=this.level===1?"was":"were";this.text=`Put ${r} random creature${e} that ${s} destroyed this game into ${r} space${e}.`}playTargets(){const t=super.playTargets();return t.push(this.fieldTarget("P1",[])),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")this.level===1?this.endSpell([t.lane],t.playerA):a.action.ddf5(this.getCardActions(t));else if(r[0]==="P2"){const e=[t.lane,parseInt(r[1])];this.level===2?this.endSpell(e,t.playerA):a.action.ddf5(this.getCardActions(t))}else this.endSpell([t.lane,parseInt(r[1]),parseInt(r[2])],t.playerA)}endSpell(t,r){this.logSpell();const e=Date.now();t.forEach(s=>{const c=a.death.gravedigger();c&&a.field.birthCreature(c,"R",r,s,e)}),a.turn.spellCast()}fieldTarget(t,r){const e=d.actionTarget("TF","CARD",this.code,a.enTil(t,...r));return e.player="F",e.lanes=a.field.laneIdx.filter(s=>!r.includes(s)),e}getCardActions(t,r){const e=a.deTil(t.param);let s;if(e[0]==="P1")s=this.fieldTarget("P2",[t.lane]);else{const c=[t.lane,parseInt(e[1])];s=this.fieldTarget("P3",c)}return a.target.toActions(s)}ddf7(t){const e=a.deTil(t.param)[0],s=d.ddp4(t,t.playerA,t.lane,`${"XHU"}1`);return s.final=this.level===1&&e==="P1"||this.level===2&&e==="P2"||this.level===3&&e==="P3",s.hints=["RE"],s}}class wr extends x{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Wildwood Sower",this.jr1=this.boof3612,this.jr2=this.lValN([6,11,18]),this.tribe.push("HM"),this.hints=["EMO"];const r=N.minionBuff(this.level);this.text=`When you play a spell, you may put a ${r}/${r} ${N.minionName(this.level)} into an available space.`,this.bonus={exist:this.ddp9(1,r*2,r,0)*.5}}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("PC",this.code);return s.interactive=!0,e}handleAction(t){a.field.birthCreature(N.minionCode(this.level),"P",t.playerA,t.lane),a.action.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const r=t.event;return r.playerA===t.ownerPlayerA&&a.cards.getCard(r.cardCode).type==="S"}return!1}jr8(t){const r=d.actionTarget("TF","CARD",this.code);r.field="E",r.player="F";const e=a.target.toActions(r);e.length===0?a.batch.triggerDone():(e.push(a.action.noneEndTrigger()),a.action.ddf5(e))}ddf7(t){return d.ddp4(t,t.playerA,t.lane,N.minionCode(this.level))}}class Er extends x{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Windcaller Shaman",this.jr1=this.boof3713,this.jr2=this.jr1+4,this.tribe.push("WN","AS"),this.hints=["FRO","EMA"],this.text=`Forge: You may move another friendly ${a.log.levelGateText(this.level,!0)}creature to an available space adjacent to ${this.name}.`,this.bonus={play:this.lValN([.25,.5,1])}}jr3(t,r){const e=super.jr3(t,r),s=e.jr4("FR",this.code);return s.interactive=!0,e}jr8(t){const r=a.field.jr5(t.creatId);if(this.emptySloots(r).length>0){const e=d.crFriendNotMeActTarg("CARD",r.id,this.code,a.enTil("P1",r.id));e.level=a.target.ddf2(this.level);const s=a.target.toActions(e);s.length>0?(s.push(a.action.noneEndTrigger()),a.action.ddf5(s)):a.batch.triggerDone()}else a.batch.triggerDone()}handleAction(t){const r=a.deTil(t.param);r[0]==="P1"?a.action.ddf5(this.getCardActions(t)):(a.field.jr5(r[1]).move(t.lane),a.action.actionDone(!0))}emptySloots(t,r=""){return a.action.emptyAdjacents(t,a.enTil("P2",r))}getCardActions(t,r){const e=a.deTil(t.param),s=a.field.ddf6(t),c=a.field.jr5(e[1]),u=this.emptySloots(c,s.id);return u.push(a.action.cancelAction()),u}ddf7(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.ddp5(t);{const e=d.actionEval(t,"ST"),s=a.field.jr5(r[1]),c=d.ddp1(s.owner,s.lane);return c.moveTo=t.lane,e.vectors.push(c),e}}}class xr extends x{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Xithian Rotfiend",this.jr1=this.lValN([7,12,20]),this.jr2=this.jr1+1,this.tribe.push("AB"),this.hints=["OL"];const r=-this.boof135;this.text=`When ${this.name} becomes opposed, it gets ${a.log.jr9(r,r)}.`}jr3(t,r){const e=super.jr3(t,r);return e.jr4("EF",this.code),e.jr4("MV",this.code),e}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const r=t.event;return t.trigger.creatId===r.creature.id||r.creature.owner!==t.ownerPlayerA}return!1}jr8(t){let r=!1;const e=a.field.jr5(t.creatId),s=t.event;if((e.id===s.creature.id&&e.opposed||s.creature.lane===a.field.oppositeLane(e.lane))&&(r=!0),r){const c=-this.boof135;e.buff(c,c)}a.batch.triggerDone()}}class Dr extends x{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Xithian Shambler",this.jr1=this.boof369,this.jr2=this.jr1+1,this.tribe.push("AB");let r="",e=1;this.level===3&&(r=" You may use this ability twice per turn.",e=2),this.text=`Activate, destroy an adjacent creature: ${this.name} moves into that creature's space, then gets +attack and +health equal to that creature's attack and health.${r}`,this.hints=["LJ"];const s=this.avgCreatureStats();this.bonus={exist:this.ddp9(-1,s[0]+s[1],s[0],0)*e}}adjacentTarget(t){const r=d.crFriendActTarg("CARD",this.code,t.id);return r.lanes=t.adjacent,r}addExtraActivate(t){const r=d.mod("EA",!0,t.id);r.expiry="ET",t.addMod(r)}jr3(t,r){const e=super.jr3(t,r);return this.level===3&&(e.jr4("TS",this.code),this.addExtraActivate(e)),e}canActivate(t){return a.target.toActions(this.adjacentTarget(t)).length>0}startActivation(t){a.action.ddf5(this.getCardActions(d.ddf4(),t))}handleAction(t){const r=a.field.ddf6(t),e=a.field.jr5(t.param),s=r.attack,c=r.health;a.death.destroy(r,this.code),e.move(t.lane),e.buff(s,c),e.endActivation(),this.level===3&&e.hasMod(e.id)&&(e.removeMod(e.id),e.activationAvailable=!0,a.phase.whatNext())}ddf8(t){return t.trigger.type==="TS"}jr8(t){const r=a.field.jr5(t.creatId);this.addExtraActivate(r),a.batch.triggerDone()}getCardActions(t,r){const e=r??a.field.jr5(t.param);return a.target.toActions([this.adjacentTarget(e),a.target.buttonTarget("CANC")])}ddf7(t){if(t.actionKey==="ACTV")return d.ddp5(t);{const r=a.deTil(t.param),e=t,s=a.field.jr5(r[0]),c=a.field.ddf6(e),u=d.actionEvalBuffC(t,s,c.attack,c.health),m=d.ddp1(c.owner,c.lane);m.destroy=!0;const y=d.ddp1(s.owner,s.lane);return y.moveTo=e.lane,u.vectors.push(m,y),u}}}class Pr{cardCache={};mapper={["AAK"]:He,["AGC"]:_,["AGK"]:M,["AGP"]:Y,["ASG"]:P,["AFO"]:le,["ATG"]:Pt,["ART"]:Pt,["AGM"]:Rt,["ALG"]:Ut,["AHL"]:Ze,["ALS"]:Ut,["AEN"]:D,["APM"]:Ne,["AQE"]:P,["AGD"]:Me,["AFS"]:Nt,["ABR"]:St,["AMY"]:St,["ABL"]:P,["AGU"]:D,["AIV"]:vt,["BTN"]:Ut,["BLH"]:Pt,["BSP"]:vt,["BWK"]:Rt,["BSR"]:_,["BMY"]:Re,["BTM"]:P,["BOS"]:N,["BAW"]:_,["BWG"]:D,["BWD"]:Wt,["BSG"]:Ge,["BSS"]:M,["BTS"]:Wt,["BWH"]:Le,["BZD"]:M,["BFM"]:M,["BSM"]:Ie,["CDT"]:Rt,["CTL"]:Y,["CHY"]:D,["CHV"]:$e,["CTI"]:M,["CHA"]:_,["CHH"]:M,["CHR"]:Ve,["CDC"]:D,["CFB"]:St,["CNM"]:D,["CSW"]:M,["CCT"]:_t,["CFG"]:Zt,["CSU"]:P,["CCR"]:_,["CSB"]:rt,["CRC"]:vt,["CYC"]:Pt,["CTW"]:P,["CTV"]:P,["CAG"]:P,["CBS"]:P,["CIN"]:Jt,["CSG"]:Zt,["DFR"]:M,["DHW"]:Pt,["DSS"]:Ot,["DCR"]:Y,["DSK"]:rt,["DBA"]:M,["DBP"]:D,["DMR"]:D,["DBR"]:D,["DCS"]:At,["DGZ"]:Y,["DIS"]:Gt,["DSV"]:Ue,["DDD"]:M,["DBT"]:P,["DFB"]:bt,["DMW"]:Nt,["DCH"]:Gt,["DSZ"]:D,["DYB"]:P,["ESK"]:vt,["EHW"]:We,["ETN"]:P,["EWE"]:de,["ENP"]:P,["ESU"]:Gt,["ENR"]:P,["EPD"]:Y,["ESC"]:Wt,["ESP"]:ze,["EWT"]:M,["EHN"]:Wt,["EFM"]:St,["EFP"]:Ke,["EXD"]:P,["FWB"]:D,["FWR"]:D,["FWK"]:rt,["FIN"]:P,["FRR"]:Y,["FVA"]:P,["FFU"]:z,["FMS"]:D,["FSM"]:Y,["FBC"]:St,["FBI"]:Pt,["FFS"]:z,["FLN"]:P,["FSS"]:Ot,["FLS"]:Pt,["FSH"]:z,["FFD"]:rt,["FSP"]:yt,["FPR"]:D,["FFL"]:P,["FGA"]:D,["FGB"]:D,["FGG"]:Nt,["FGO"]:D,["FPS"]:D,["FSK"]:Ye,["FWT"]:M,["FZS"]:P,["GHS"]:Nt,["GHB"]:_t,["GRN"]:Zt,["GTH"]:P,["GSC"]:Rt,["GMP"]:At,["GTT"]:qe,["GCL"]:D,["GCR"]:P,["GLF"]:_,["GRW"]:_,["GSW"]:M,["GVS"]:rt,["GSS"]:M,["GBG"]:rt,["GGE"]:D,["GGH"]:D,["GRP"]:Xe,["GGD"]:bt,["GGP"]:bt,["GGS"]:D,["GRM"]:Y,["GHT"]:_,["GMR"]:rt,["HTR"]:Qt,["HAR"]:P,["HFA"]:Vt,["HWM"]:Jt,["HGS"]:je,["HTP"]:Je,["IBF"]:Y,["ITO"]:Gt,["IWC"]:D,["IHA"]:Rt,["IMA"]:M,["JPK"]:P,["KAW"]:Pt,["KOD"]:z,["KKK"]:Qt,["LKP"]:Qe,["LGT"]:M,["LBR"]:P,["LSK"]:_e,["LWY"]:D,["LBD"]:M,["LSS"]:Ot,["LBL"]:At,["LSP"]:Jt,["LMV"]:M,["LHY"]:D,["MMH"]:_,["MRF"]:D,["MOE"]:M,["MXW"]:_,["MSP"]:Gt,["MMA"]:M,["MMX"]:rt,["MMO"]:D,["MMV"]:vt,["MSC"]:P,["MTS"]:tr,["MTT"]:er,["MML"]:rr,["MMW"]:ir,["MBP"]:z,["MND"]:z,["NGB"]:_,["NSL"]:P,["NCS"]:z,["NCW"]:D,["NCV"]:P,["NDR"]:ar,["NEM"]:Gt,["NSH"]:Y,["NXC"]:D,["NXP"]:he,["NXT"]:Ut,["NGT"]:bt,["NCL"]:Y,["NFF"]:z,["NOZ"]:rt,["NSY"]:M,["ONN"]:sr,["OXA"]:nr,["OXM"]:M,["OXP"]:or,["OOZ"]:N,["OBD"]:D,["OFM"]:M,["OJC"]:yt,["OPK"]:M,["OWW"]:Nt,["OHV"]:z,["ODC"]:hr,["OSP"]:D,["OWF"]:Y,["OXS"]:lr,["PHM"]:M,["PPM"]:z,["PSM"]:M,["PHS"]:_,["PTB"]:Y,["PSC"]:z,["PTR"]:P,["PSG"]:P,["PMS"]:P,["PYG"]:_t,["PYS"]:Y,["RBH"]:cr,["RTS"]:St,["RLW"]:yt,["RFL"]:dr,["RHC"]:D,["ROG"]:P,["RFA"]:Vt,["RBG"]:ce,["RGG"]:vt,["RSZ"]:rt,["SAP"]:P,["SPL"]:N,["SVO"]:P,["SSE"]:At,["SXP"]:N,["SXD"]:N,["SXT"]:N,["SCS"]:D,["SMD"]:M,["SFS"]:ur,["SCD"]:D,["SFT"]:D,["SDL"]:N,["SAD"]:fr,["SHG"]:P,["SPD"]:At,["SPM"]:At,["STD"]:_,["SHS"]:Rt,["SGF"]:z,["SKG"]:he,["SSR"]:vt,["SNB"]:P,["SNP"]:Y,["SRD"]:Y,["SRH"]:bt,["SDN"]:M,["SHV"]:P,["SBA"]:D,["SKB"]:D,["SBR"]:D,["SBD"]:M,["SFM"]:rt,["SSN"]:D,["SSM"]:vt,["SLH"]:gr,["SPN"]:N,["SRV"]:ce,["STR"]:P,["XYR"]:N,["SSA"]:z,["STO"]:P,["SDR"]:yt,["SWR"]:mr,["SHK"]:pr,["SFA"]:Vt,["STG"]:yr,["SSS"]:Ot,["SWM"]:z,["STN"]:P,["SGI"]:D,["SBG"]:br,["SCL"]:D,["SGA"]:Vt,["SSG"]:vt,["SVH"]:St,["SIN"]:P,["SYL"]:M,["SML"]:D,["SYO"]:vr,["TST"]:Y,["TBA"]:At,["TGS"]:D,["TPT"]:P,["TDW"]:yt,["TGN"]:D,["TSM"]:le,["TUP"]:P,["TGI"]:M,["TDS"]:Ar,["TOB"]:P,["TWS"]:D,["TVG"]:Oe,["TXS"]:P,["TFK"]:N,["TFD"]:N,["TFF"]:N,["TCG"]:P,["TRN"]:Y,["TWG"]:Zt,["UGM"]:vt,["UGL"]:M,["UIC"]:kr,["ULR"]:Tr,["URD"]:D,["UBL"]:P,["UCM"]:z,["UHS"]:Cr,["UIM"]:z,["UWL"]:M,["UWS"]:M,["UTM"]:M,["UTR"]:yt,["URB"]:St,["UPM"]:Nt,["VRP"]:Sr,["VBK"]:D,["VTC"]:D,["VGN"]:rt,["VNF"]:_,["VNS"]:M,["VGR"]:P,["VCG"]:At,["VES"]:St,["VYE"]:P,["WBY"]:_,["WBU"]:_,["WMR"]:z,["WMM"]:P,["WTW"]:D,["WWP"]:M,["WFM"]:Nt,["WWS"]:wr,["WBH"]:de,["WCS"]:Er,["WPD"]:D,["WFB"]:M,["WFS"]:z,["WBG"]:At,["XCR"]:D,["XHS"]:rt,["XHU"]:D,["XRF"]:xr,["XSH"]:Dr,["XDV"]:Qt,["XRW"]:P,["YWC"]:D,["YNS"]:bt,["ZPM"]:z,["ZTR"]:N,["ZTU"]:rt,["ZIN"]:D,["ZBS"]:N,["ZMB"]:N,["ZSH"]:At};makeCard(t){try{return new this.mapper[ut.extractCardCode(t)](t)}catch(r){throw console.error("Make card screwed up on code: "+t),r}}getCard(t){return this.cardCache[t]||(this.cardCache[t]=this.makeCard(t)),this.cardCache[t]}}class Fr{guts="";txt(t){return this.guts+=t,this}plr(t){const r=a.player.toBool(t);return this.guts+="^p"+(r?"a":"b"),this}crd(t){return this.guts+="^c"+t,this}go(){a.log.parse(this)}}class Br{loglist;you=!0;localPlayerKey="";oppPlayerKey="";localPlayerSpan="";oppPlayerSpan="";constructor(){this.loglist=document.getElementById("loglist")}setup(){this.you=a.state.gs.isLocalA,this.localPlayerKey=this.you?"^pa":"^pb",this.oppPlayerKey=this.you?"^pb":"^pa",this.localPlayerSpan=this.span(a.player.toPlayer(this.you).name,"green"),this.oppPlayerSpan=this.span(a.player.toPlayer(!this.you).name,"red")}addLi(t){const r=document.createElement("li");r.innerHTML=t,this.loglist.appendChild(r),r.scrollIntoView({behavior:"smooth",block:"end"})}span(t,r){return`${t}`}add(t){this.addLi(t)}clearAll(){this.loglist.innerHTML=""}new(){return new Fr}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let r=!0;for(;r;){const e=t.indexOf("^c");if(e===-1)r=!1;else{const s=t.slice(e+2,e+6);if(s==="POIS")t=t.replaceAll("^c"+s,this.span("Poison","green"));else{const c=a.cards.getCard(s);t=t.replaceAll("^c"+s,this.span(`${c.name} ${c.level}`,this.factMap[c.faction]))}}}return t}parse(t){const e=t.guts.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),s=this.parseCards(e);this.add(s)}cardText(t){let r;if(t.type==="C"){const e=t,s=[];e.initRegen>0&&s.push("Regenerate "+e.initRegen),e.initArmor>0&&s.push("Armor "+e.initArmor),e.initMobile>0&&s.push("Mobility "+e.initMobile),e.initBT&&s.push("Breakthrough"),e.initDefend&&s.push("Defender"),e.initAggro&&s.push("Aggressive"),e.consistent&&s.push("Consistent"),s.length>0&&s.push(""),r=s.join(". ")+t.text}else r=t.text;return(t.isFree?"Free. ":"")+(t.overload?"Overload. ":"")+r}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,r=!1){const e=r?" ":"";return t===1?`level 1${e}`:t===2?`level 2 or lower${e}`:""}jr9(t,r,e=!1){return t!==0&&r!==0?`${this.bufferson(t,!0)}${e?",":" and"} ${this.bufferson(r,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(r,!1)}bufferson(t,r){return`${t>0?"+":""}${t} ${r?"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){return t.length===3&&(t=`${t}1`),a.cards.getCard(t).name}actionText(t){switch(t.actionKey){case "ACTV":return"Activate";case "CARD":return`Card (${this.fastName(t.hostCard)})`;case "FITE":return"Fight";case "FORG":const r=t;return`Forge (${this.fastName(r.hostCard)}) Lane ${6-r.lane}`;case "HDSC":return`Hand Discard (${this.fastName(t.hostCard)})`;case "HPLY":const e=t;return`Hand Pick (${this.fastName(e.card)})`;case "MEND":return"Move End";case "MOVE":return"Move Start";case "NOTR":return"Pick None";case "ENDT":return"Donethanks";default:return t.actionKey}}tribeText(t){switch(t){case "AN":return"Any";case "AB":return"Abomination";case "AG":return"Angel";case "AS":return"Asir";case "BR":return"Bear";case "BE":return"Beast";case "CT":return"Cat";case "CR":return"Chrysalis";case "CY":return"Cyborg";case "DF":return"Darkforged";case "DM":return"Demon";case "DN":return"Dinosaur";case "DG":return"Dragon";case "DY":return"Dryad";case "ER":return"Earth";case "EL":return"Elemental";case "EN":return"Energeist";case "FY":return"Fairy";case "FR":return"Fire";case "FB":return"Forgeborn";case "FT":return"Frost";case "GT":return"Giant";case "GN":return"Gnome";case "GL":return"Golem";case "GG":return"Grimgaunt";case "GD":return"Guardian";case "HM":return"Human";case "HY":return"Hydra";case "IC":return"Ice";case "IN":return"Insect";case "LT":return"Lightning";case "LP":return"Lupin";case "MT":return"Manticore";case "MC":return"Mech";case "MM":return"Metamind";case "NG":return"Naga";case "OZ":return"Ooze";case "PX":return"Phoenix";case "PL":return"Plant";case "RM":return"Ram";case "RB":return"Robot";case "SY":return"Satyr";case "SE":return"Seraph";case "SH":return"Shaman";case "SS":return"Shapeshifter";case "SK":return"Skeleton";case "SN":return"Snake";case "SP":return"Spider";case "ST":return"Spirit";case "TG":return"Tigrin";case "TK":return"Tuskin";case "VP":return"Vampire";case "WD":return"Wanderer";case "WN":return"Wind";case "WF":return"Wolf";case "WR":return"Wurm";case "YT":return"Yeti";case "ZB":return"Zombie"}}}class Hr{makeTrans(t,r,e,s,c,u){}writeTrans(t,r,e,s,c,u){let m=!1;const y=a.state.getPlayer(t);if(r==="P")e==="HD"&&(u==="R"?(y.hand=s,m=!0):u==="D"&&(this.delPlayerHandI(y,s),m=!0));else if(r==="F"){if(u!=="R"){if(u==="U"){const A=a.field.jr5(c);A?e==="FT"&&(this.updFieldStateI(A,s),m=!0):console.error("Write could not find field, creature key:",c)}}}else r==="T"?e==="RP"&&(this.updRegPlaysI(s),m=!0):r==="D"&&u==="A"&&(this.addPlayerDeckI(y,e,s),m=!0);m||console.error("encountered unhandled DataDuke.write request",t,r,e,s,u)}updFieldState(t,r){this.updFieldStateI(t,r),this.makeTrans(t.owner,"F","FT",r,t.id,"U")}updRegPlays(t){this.updRegPlaysI(t),this.makeTrans(a.state.ddf9(),"T","RP",t,void 0,"U")}delPlayerHand(t,r){this.delPlayerHandI(t,r),this.makeTrans(t.isPlayerA,"P","HD",r,void 0,"D")}addPlayerDeck(t,r,e){this.addPlayerDeckI(t,r,e),this.makeTrans(t.isPlayerA,"D",r,e,void 0,"A")}updFieldStateI(t,r){t.status=r}updRegPlaysI(t){a.state.gs.turn.regularPlays=t}delPlayerHandI(t,r){t.hand.splice(r,1)}addPlayerDeckI(t,r,e){let s;if(r==="MD")s=t.deck;else if(r==="HD")s=t.hand;else if(r==="DD")s=t.discard;else{console.error("Invalid write item passed to addPlayerDeck ",r);return}s.push(e)}}class Nr{ddf8(t){return t.trigger.type==="FR"?this.forgeTriggerTest(t):t.trigger.type==="VN"?this.vengeanceTriggerTest(t):t.trigger.type==="FK"?this.flankTriggerTest(t):t.trigger.type==="DM"&&t.event.code==="DMG"||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==="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.host==="C"?(t.trigger.interactive&&(a.state.gs.batch.iatLane=a.field.jr5(t.creatId).lane),a.cards.getCard(t.trigger.logicCode).jr8(t)):t.host==="P"?console.error("player hosted trigger encountered. No code!"):t.host==="H"?console.error("hand card hosted trigger encountered. No code!"):console.error("Encountered trigger reaction with mystery host ",t)}forgeTriggerTest(t){if(t.event.code==="ENT"){const r=t.event;if(!r.creature)throw new Error("Creature Enters Field event not provided creature payload");if(r.forged){const e=a.field.jr5(t.creatId);return e.status==="A"&&e.id===r.creature.id}}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const r=t.event;if(!r.creature)throw new Error("Creature Died event not provided creature payload");const e=a.field.searchById(t.creatId);if(e)return e.status==="D"&&e.id===r.creature.id;console.warn("interesting. venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const r=t.event;if(!r.creature)throw new Error("Creature Moved event not provided creature payload");const e=a.field.jr5(t.creatId);return e.status==="A"&&e.id===r.creature.id}return!1}generalTriggerTest(t){return t.creatId?a.cards.getCard(t.trigger.logicCode).ddf8(t):(console.error("player based trigger event encountered"),!1)}}class Mr{deathCheck(){const t=Date.now();a.field.qActiveCreats().forEach(s=>{s.health<1&&(a.log.new().crd(s.code).txt(" died.").go(),this.smite(s,t))});const r=a.player.toPlayer(!0),e=a.player.toPlayer(!1);(r.health<1||e.health<1)&&(r.healthe.creatId===t.id)&&(a.state.gs.deathOrder=a.state.gs.deathOrder.filter(e=>e.creatId!==t.id))}findDeathTime(t){const r=a.state.gs.deathOrder.filter(e=>e.creatId===t).map(e=>e.time);if(r.length!==0)return Math.min(...r)}destroy(t,r,e=void 0){a.log.new().crd(t.code).txt(" was destroyed by ").crd(r).txt(".").go(),this.smite(t,e)}gravedigger(t="X"){if(t==="X"){const r=a.state.gs.graveyard.length;return r===0?"":a.state.gs.graveyard[a.randInt(0,r)].cardCode}else{const r=a.player.toBool(t),e=a.state.gs.graveyard.filter(c=>c.owner===r),s=e.length;return s===0?"":e[a.randInt(0,s)].cardCode}}smite(t,r=void 0){t.status="D",a.state.gs.deathOrder.push({creatId:t.id,time:r||Date.now()}),a.state.gs.graveyard.push({cardCode:t.code,owner:t.owner}),a.batch.addEvents(d.creatureEvent("DIE",t)),a.effect.positionChange(t.owner)}}class Rr{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 r;if(t==="N0")r=a.state.gs.batch.events.slice(),a.state.gs.batch.events=[];else{const s=a.state.gs.batch.events.filter(u=>u.code==="DIE"),c=a.state.gs.batch.events.filter(u=>u.code!=="DIE");t==="C1"?(r=c,a.state.gs.batch.events=s):(r=s,a.state.gs.batch.events=c)}const e=this.generateTriggers(r);a.state.gs.batch.triggerActions=this.sortTriggers(e),a.phase.whatNext()}generateTriggers(t){let r;const e=t.map(s=>(s.code==="TRS"&&(r=s),a.state.gs.field.map(u=>u.triggers.map(m=>{const y=d.triggerReaction(s,m,u.owner,"C");return y.creatId=u.id,y.cardCode=u.code,y}).filter(m=>a.trigger.ddf8(m))).flat())).flat();return r&&this.handleTurnStart(r),e}sortTriggers(t){const r=a.state.ddf9(),e=t.filter(u=>!u.trigger.interactive&&u.ownerPlayerA===r),s=t.filter(u=>!u.trigger.interactive&&u.ownerPlayerA!==r);return t.filter(u=>u.trigger.interactive&&u.ownerPlayerA===r).concat(s,e)}handleTurnStart(t){const r=a.state.ddf9();a.field.qPlayerCreats(r).filter(s=>s.sleeping).forEach(s=>{s.sleeping=!1});const e=Date.now();a.field.qActiveCreats().forEach(s=>{if(s.owner===t.playerA&&(s.activationAvailable=!0,s.mobilityAvailable=!0,s.sleeping=!1),s.armorDmg=0,s.poison>0&&s.hurtDirect(s.poison,"POIS",e),s.regen>0){const c=s.heal(s.regen);this.addEvents(d.creatStatEvent("RGN",s,c))}a.death.deathProdder(s,e)})}getNextTrigger(){const t=a.state.gs.batch.triggerActions;if(t.length!==0)return t[t.length-1]}triggerDone(){const t=a.state.gs.batch.triggerActions;t.length===0?console.error("batch.triggerDone() was called when there is no trigger actions"):(t.pop(),a.state.gs.batch.iatLane=0),a.phase.whatNext()}addEvents(...t){a.state.gs.batch.events.push(...t)}get deathCheck(){return a.state.gs.batch.deathCheck}set deathCheck(t){a.state.gs.batch.deathCheck=t}get type(){return a.state.gs.batch.type}set type(t){a.state.gs.batch.type=t}get iaTrigLane(){return a.state.gs.batch.iatLane}}class Gr{chirpy=!1;chirp(t){}enterMainPhase(){a.state.setPhase("MN");const t=a.state.getActivePlayer(),r=this.getMainPhaseActions(t);a.action.ddf5(r)}passTheTurn(){a.state.gs.activePlayer=!a.state.gs.activePlayer,a.state.setPhase("WT"),a.state.gs.aiMode&&(a.state.gs.aiActive=!a.state.gs.aiActive,this.startTurn())}startTurn(){a.log.new().txt("------").go(),a.log.new().plr(a.state.ddf9()).txt(" starts turn.").go(),a.state.resetTurnData(),a.state.setPhase("ST"),a.batch.addEvents(d.playerEvent("TRS",a.state.ddf9())),this.expireMods(),this.whatNext()}async whatNext(){if(a.state.gs.winFlag!==0){this.chirp("NEXT! found win state"),a.action.actionHistory=[],a.state.gs.aiActive=!1,await a.drawing.drawAll();return}if(await a.drawing.drawAll(),a.action.actionHistory.length>0)this.chirp("NEXT! action restore"),a.action.ddf5();else if(a.batch.getNextTrigger())this.chirp("NEXT! next trigger"),a.trigger.resolve(a.batch.getNextTrigger());else if(!a.batch.deathCheck)this.chirp("NEXT! death check"),a.death.deathCheck(),this.whatNext();else if(a.state.gs.batch.events.length>0)this.chirp("NEXT! batch start"),a.batch.startBatch();else switch(this.chirp("NEXT! enter phase handler "+a.state.gs.phase),a.state.gs.field=a.state.gs.field.filter(t=>t.status==="A"),a.state.gs.deathOrder=[],a.state.gs.birthOrder=[],a.state.gs.phase){case "MN":this.enterMainPhase();break;case "ET":a.state.setPhase("PT"),a.batch.addEvents(d.playerEvent("PTN",a.state.ddf9())),a.phase.expireMods(),this.whatNext();break;case "PT":this.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),a.state.setPhase("MN"),this.whatNext();break;case "ST":a.state.setPhase("MN"),a.ai.cheater()?a.sleep(500).then(()=>this.whatNext()):this.whatNext();break}}expireMods(){const t=a.state.gs.phase,r=a.field.creatByTarget(d.crTarg());let e=[];t==="PT"?r.forEach(s=>{s.mods.forEach(c=>{c.expiry==="EN"?c.expiry="ET":c.expiry==="ET"&&e.push([s,c])})}):t==="ST"&&r.forEach(s=>{s.mods.forEach(c=>{c.expiry==="SN"?c.expiry="ST":c.expiry==="ST"&&e.push([s,c])})}),e.length>0&&(e.forEach(s=>s[0].expireMod(s[1])),a.effect.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const r=this.getHandActions(t),e=this.getFieldActions(t);let s=!a.state.gs.turn.mainBattle,c="M";return s||(s=a.field.ddf1().some(m=>m.extraBattles>0&&m.isActive&&!m.defender),c="E"),s&&r.push({actionKey:"FITE",zone:"B",param:c,hostCard:""}),s||r.push({actionKey:"ENDT",zone:"B",param:"",hostCard:""}),[r,e].flat()}getHandActions(t){const r=[...new Set(t.hand)],e=[],s=[];r.forEach(y=>{a.cards.getCard(y).isFree?e.push(y):s.push(y)});const c=e.map(y=>[y,"FREE"]);a.state.gs.turn.freeCards.forEach(y=>{a.target.cardByTarget(s,y.condition).forEach(k=>{c.push([k[0],y.id]),s.splice(s.indexOf(k[0]),1)})}),c.push(...s.map(y=>[y,""]));const u=a.state.gs.turn.regularPlays>0;let m=t.hand.map((y,A)=>[y,A]);return u||(m=m.filter(y=>!s.includes(y[0]))),m.map(y=>{const A=c.find(k=>k[0]===y[0]);return A||console.error("No cost found for card"+y[0]),d.handSelectAction("HPLY",y[0],A[1],y[1])})}getFieldActions(t){const r=a.field.qPlayerCreats(t.isPlayerA),e=r.filter(c=>a.field.canMove(c).length>0).map(c=>d.fieldSelectAction("MOVE",c.lane,c.owner)),s=r.filter(c=>c.isActive&&c.activationAvailable?a.cards.getCard(c.code).canActivate(c):!1).map(c=>{const u=d.fieldSelectAction("ACTV",c.lane,c.owner);return u.hostCard=c.code,u.param=c.id,u});return e.forEach(c=>{const u=s.findIndex(m=>m.lane===c.lane);u>-1&&(s.splice(u,1),c.param="ACTV")}),e.concat(s)}}var st=(n=>(n[n.Left=0]="Left",n[n.Both=1]="Both",n[n.Right=2]="Right",n))(st||{});class ee{action;hitTest(t,r,e){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,r,e,s){let c,u=0;const m=t.length;for(;c===void 0&&u=t&&this.originY<=r&&this.endY>=r?this.action:void 0}}class wt extends O{constructor(t,r,e,s,c=0){super({zone:"N",actionKey:"BNDL",hostCard:"",param:""},t,r,e,s,c)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,r,e){if(super.hitTest(t,r,e))return ee.arrayHit(this.childs,t,r,e)}}class Lr{registry;constructor(){this.registry=[]}find(t){const r=this.registry.find(e=>e.action===t);if(r)return r;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,r){const e=this.find(t);e.enabled=r}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const r=this.registry.findIndex(e=>e.action===t);r>-1&&this.registry.splice(r,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,r,e){let s,c=a.state.clickMode;return c==="M"?s=e:c==="T"?s=0:s=2,ee.arrayHit(this.registry,t,r,s)}}class Ir{forgeCard(t,r){const e=this.cardPlayed(r),s=a.state.getActivePlayer();a.log.new().txt("Forged ").crd(e.code).txt(".").go(),a.field.birthCreature(e,"F",s.isPlayerA,t.lane),a.action.actionDone()}levelAndDiscard(t){const r=a.cards.getCard(t.card),e=a.state.getActivePlayer();return e.hand.splice(t.position,1),r.overload||e.discard.push(r.levelUpCard()),r}cardPlayed(t,r=!1){const e=this.levelAndDiscard(t),s=a.state.getActivePlayer();if(t.cost==="")a.state.gs.turn.regularPlays-=1;else if(t.cost!=="FREE"){const c=a.state.gs.turn.freeCards.findIndex(u=>u.id===t.cost);c>-1?a.state.gs.turn.freeCards.splice(c,1):console.error("Could not find free card rule!")}if(a.state.gs.turn.cardsPlayed+=1,!r){const c=d.playCardEvent(t.card,s.isPlayerA);a.batch.addEvents(c)}return e}spellCast(){this.cardPlayed(a.action.cardBeingPlayed),a.action.actionDone()}endTurn(){const t=a.state.getActivePlayer();t.discard.push(...t.hand),t.hand=[],t.turn++;const r=t.turn>4;a.batch.addEvents(d.playerEvent("TRE",t.isPlayerA)),r&&(t.turn=1,t.rank++,a.batch.addEvents(d.playerEvent("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],a.deck.shuffleDeck(t.isPlayerA)),a.field.qActiveCreats().forEach(e=>{e.extraBattles=0}),a.player.drawCard(t,5),a.state.setPhase("ET"),a.action.actionDone()}mobility(t){const r=a.field.jr5(t.param);r.mobilityAvailable=!1,r.move(t.lane),a.action.actionDone()}allied(t,r){const e=r??a.state.getActivePlayer(),s=d.target("TH");return s.player=a.player.toTarget(e),s.faction=t,a.target.deckByTarget(s).length>0}freeCard(t){const r=d.freeCard(t);return a.state.gs.turn.freeCards.push(r),r}}class $r{laneIdx=[1,2,3,4,5];jr5(t){const r=this.searchById(t);if(r)return r;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByLane(t,r){const e=this.searchByLane(t,r);if(e)return e;throw console.error("naughty creature lane ",t,r),new Error("Could not find creature by lane")}ddf6(t){const r=this.searchByFSA(t);if(r)return r;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return a.state.gs.field.find(r=>r.id===t)}searchByLane(t,r){return a.state.gs.field.find(e=>e.lane===t&&e.owner===r&&e.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let r=a.state.gs.field;if(t){if(t.player!=="X"){const e=a.player.toBool(t.player);r=r.filter(s=>s.owner===e)}if(t.creatStatus!=="A"){const e=this.creatStatusTargetToCS(t.creatStatus);r=r.filter(s=>s.status===e)}if(!a.isUn(t.lanes)){const e=a.target.lanesToArr(t.lanes);r=r.filter(s=>e.includes(s.lane))}if(a.isUn(t.maxAttack)||(r=r.filter(e=>e.attack<=t.maxAttack)),t.notMe&&(r=r.filter(e=>e.id!==t.notMe)),t.tribe!=="AN"&&(r=r.filter(e=>e.isTribe(t.tribe))),t.level!=="LA")if(t.level==="LG")r=r.filter(e=>a.cards.getCard(e.code).canLevel());else{const e=a.target.levelTargetToLevel(t.level);r=r.filter(s=>e.includes(s.level))}t.canDefender&&(r=r.filter(e=>!e.negateDefender)),t.hasDefender&&(r=r.filter(e=>e.defender)),t.canArmor&&(r=r.filter(e=>!e.negateArmor)),t.hasArmor&&(r=r.filter(e=>e.armor>0)),t.canMove&&(r=r.filter(e=>!e.negateMobility)),t.hasMobility&&(r=r.filter(e=>e.mobility>0)),t.hasPoison&&(r=r.filter(e=>e.poison>0)),t.canRegen&&(r=r.filter(e=>!e.negateRegen)),t.hasRegen&&(r=r.filter(e=>e.regen>0)),t.faction!=="X"&&(r=r.filter(e=>e.faction===t.faction))}return r}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(r=>!a.state.gs.field.find(s=>s.owner===t&&s.lane===r&&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(r=>Math.abs(t.lane-r)<=t.mobility):[]}birthCreature(t,r,e,s=0,c=void 0){if(r==="S"){const k=this.emptyLanes(e);if(k.length===0)return;s=k[a.randInt(0,k.length)]}else if(r==="P"&&!this.emptyLanes(e).includes(s))return;const m=(typeof t=="string"?a.cards.getCard(t):t).jr3(e,s),y=a.state.gs.field;if(r==="F"||r==="R"){const k=a.field.searchByLane(s,e);k&&(a.log.new().crd(k.code).txt(" was replaced.").go(),k.status="R",a.batch.addEvents(d.creatureEvent("RPL",k)))}y.push(m);const A=d.enterFieldEvent(m);return A.forged=r==="F",a.state.gs.birthOrder.push({creatId:m.id,time:c||Date.now()}),a.batch.addEvents(A),m.enforceEffects("PH"),a.effect.positionChange(e),m}findBirthTime(t){const r=a.state.gs.birthOrder.filter(e=>e.creatId===t).map(e=>e.time);if(r.length!==0)return r.length>1&&console.warn("wery curious, more than one birth record for creat "+t),r[0]}qActiveCreats(){return this.creatByTarget(d.crTarg())}qPlayerCreats(t){const r=d.crTarg();return r.player=a.player.toTarget(t),this.creatByTarget(r)}ddf1(){return this.creatByTarget(d.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(d.crEnemyTarg())}}class Vr{creatFightState(t,r){return t?r===1||t.defender||t.sleeping&&!t.aggressive?1:r===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t,r,e,s){if(t>0){let c=0;if(r>0){const u=t===2&&e.breakthrough;c=s.hurtBattle(e.attack,e,u)}else t===2&&(c=e.attack);c>0&&a.player.hurtPlayerBattle(!e.owner,c,e)}}fight(t){a.log.add("FIGHT!");let r=2,e=1;t&&(a.state.gs.turn.mainBattle=!0,r=0,e=0);const s=a.state.ddf9(),c=[],u=[];a.field.laneIdx.forEach(m=>{const y=a.field.searchByLane(m,s),A=a.field.searchByLane(6-m,!s),k=this.creatFightState(y,r),w=this.creatFightState(A,e);(k===2||w===2)&&(u.push([k,w,y,A],[w,k,A,y]),k===2&&(a.state.gs.turn.friendlyFightStarters++,c.push([m,s])),w===2&&c.push([a.field.oppositeLane(m),!s]))}),this.barking&&c.length>0&&a.dogBark(),a.drawing.drawCombat(c).then(()=>{u.forEach(m=>this.dukeItOut(...m)),a.effect.playerHealthChange(),a.death.deathCheck(),a.batch.type="C0",a.action.actionDone()})}barking=!0}class Ur{positionChange(t){a.field.creatByTarget().forEach(r=>{r.enforceEffects("PS",t)})}defenderChange(t){a.field.qActiveCreats().forEach(e=>{e.effects.filter(s=>s.watch==="DF").filter(s=>s.area==="C"&&e.owner===t||s.area==="A").forEach(s=>a.cards.getCard(s.logicCode).enforceEffect(s,e))})}playerHealthChange(){a.field.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){a.field.qActiveCreats().forEach(r=>{r.enforceEffects("AT"),r.enforceEffects("AR"),r.enforceEffects("CH"),r.enforceEffects("DF",r.owner)})}}class Wr{}class Or{pt2pb={["X"]:()=>{throw new Error("goof passed any to player target boolean-o-fier")},["A"]:()=>!0,["B"]:()=>!1,["F"]:()=>a.state.ddf9(),["E"]:()=>!a.state.ddf9()};toPlayer(t){return typeof t=="boolean"?a.state.getPlayer(t):typeof t=="string"?a.state.getPlayer(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"}hurtPlayer(t,r){return r<1?0:(t.health-=r,r)}ddf3(t,r,e){const s=this.toPlayer(t),c=this.hurtPlayer(s,r);c>0&&(a.log.new().crd(e).txt(` dealt ${c} dmg to `).plr(s).txt(".").go(),a.batch.addEvents(d.damageEvent(!1,c,!1,!1,s.isPlayerA,void 0)),a.effect.playerHealthChange())}hurtPlayerBattle(t,r,e){const s=this.toPlayer(t),c=this.hurtPlayer(s,r);c>0&&(a.log.new().crd(e.code).txt(` dealt ${c} battle dmg to `).plr(s).txt(".").go(),a.batch.addEvents(d.damageEvent(!0,c,!0,!1,s.isPlayerA,e)))}healPlayer(t,r){const e=this.toPlayer(t);e.health+=r,a.log.new().plr(e).txt(` gained ${r} health.`).go(),a.batch.addEvents(d.playerHealEvent("PHL",e.isPlayerA,r)),a.effect.playerHealthChange()}drawCard(t,r){const e=this.toPlayer(t);for(let s=0;s{const s=this.actionTargGuts(e);return s.forEach(c=>{c.hostCard=e.hostCard,c.param=e.param}),s}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(r=>d.handSelectAction(t.actionKey,r[0],"",r[1]));if(t.target==="TF"){if(t.field==="O")return a.field.creatByTarget(t).map(r=>d.fieldSelectAction(t.actionKey,r.lane,r.owner));{const r=t.player==="X"?[!0,!1]:[a.player.toBool(t.player)],e=a.isUn(t.lanes)?a.field.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return r.map(s=>e.map(c=>d.fieldSelectAction(t.actionKey,c,s))).flat();if(t.field==="E")return r.map(s=>a.field.emptyLanes(s).filter(c=>e.includes(c)).map(c=>d.fieldSelectAction(t.actionKey,c,s))).flat()}}if(t.target==="TP")return t.player==="X"?[d.playerSelectAction(t.actionKey,!0),d.playerSelectAction(t.actionKey,!1)]:[d.playerSelectAction(t.actionKey,a.player.toBool(t.player))];if(t.target==="TB")return[{actionKey:t.actionKey,zone:"B",hostCard:t.hostCard,param:""}];if(t.target==="TR")return[{actionKey:t.actionKey,zone:"R",hostCard:t.hostCard,param:""}];if(t.target==="TD")return[];throw new Error("Target encountered that doesnt have mappings to actions: "+t.target)}cardByTarget(t,r){let e=t.map((s,c)=>[s,c]);if(r){if(a.isUn(r.deckPositionSkip)||(e=e.filter(s=>s[1]!==r.deckPositionSkip)),r.faction!=="X"&&(e=e.filter(s=>a.cards.getCard(s[0]).faction===r.faction)),r.tribe!=="AN"&&(e=e.filter(s=>{const c=a.cards.getCard(s[0]);return c.type==="C"?c.isTribe(r.tribe):!1})),r.level!=="LA")if(r.level==="LG")e=e.filter(s=>a.cards.getCard(s[0]).canLevel());else{const s=a.target.levelTargetToLevel(r.level);e=e.filter(c=>{const u=parseInt(c[0].substring(3,4));return s.includes(u)})}if(r.card!=="A"){const s=r.card==="C"?"C":"S";e=e.filter(c=>a.cards.getCard(c[0]).type===s)}}return e}deckByTarget(t){const r=a.player.toPlayer(t.player);let e;if(t.target==="TH")e=r.hand;else if(t.target==="TD")e=r.discard;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(e,t)}buttonTarget(t,r="",e=""){return d.actionTarget("TB",t,r,e)}boardTarget(t,r){return d.actionTarget("TR",t,r)}ddf2(t){return t===1?"L1":t===2?"LN":"LA"}lt2l={["LA"]:()=>[1,2,3,4],["LG"]:()=>{throw new Error("goof passed grow to level target mapper")},["L1"]:()=>[1],["L2"]:()=>[2],["L3"]:()=>[3],["LN"]:()=>[1,2]};levelTargetToLevel(t){return this.lt2l[t]()}levelTargetTest(t,r){return this.levelTargetToLevel(t).includes(r)}levelTestCommon(t,r){return this.levelTargetTest(this.ddf2(r),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}class zr{handleAction(t){if(t.actionKey==="DEET"){a.state.gs.ui.detailsMode=!0,a.drawing.drawDetails(t);return}if(t.actionKey==="HPLY"){this.playCardSelect(t);return}if(t.actionKey==="FORG"){a.turn.forgeCard(t,this.cardBeingPlayed);return}if(t.actionKey==="FITE"){a.fight.fight(t.param==="M");return}if(t.actionKey==="ENDT"){a.turn.endTurn();return}if(t.actionKey==="MOVE"){this.mobilitySelect(t);return}if(t.actionKey==="MEND"){a.turn.mobility(t);return}if(t.actionKey==="HDSC"){const r=this.cardBeingPlayed;r.cost="",a.turn.cardPlayed(r,!0),this.actionDone();return}if(t.actionKey==="ACTV"){const r=a.field.jr5(t.param);a.cards.getCard(r.code).startActivation(r);return}if(t.actionKey==="NOTR"){this.actionDone(!0);return}if(t.actionKey==="CARD"){a.cards.getCard(t.hostCard).handleAction(t);return}if(t.actionKey==="CANC"){t.param==="EX"&&a.state.cancelExitMode(),this.actionHistory.pop(),this.ddf5();return}if(t.actionKey==="SCRH"){t.param==="R"?a.state.gs.ui.handScrollLeft+=1:a.state.gs.ui.handScrollLeft-=1,a.drawing.drawAll();return}if(t.actionKey==="DRFT"){a.draft.resumeDraft(t.param);return}if(t.actionKey==="SCRD"){t.param==="U"?a.draft.paginating=!1:a.draft.paginating=!0,a.drawing.drawAll();return}if(t.actionKey==="UIBT"){t.param==="DM"?(a.state.setClickMode("I"),a.drawing.drawAll()):t.param==="TM"?(a.state.setClickMode("T"),a.drawing.drawAll()):t.param==="EX"?(a.state.setMode("X"),this.generateExitActions()):console.error("missing handler for common button param "+t.param);return}if(t.actionKey==="MENU"){t.param==="D"?(a.state.setMode("D"),a.state.gs.options.wasDrafting=!0,a.draft.startDraft(!1,!1)):t.param==="C"?(a.state.setMode("C"),a.state.gs.options.wasDrafting=!1,this.ddf5(this.generateDeckPickerActions())):t.param==="I"?(a.state.setMode("I"),a.drawing.drawAll()):window.open("deckbuilder.html");return}if(t.actionKey==="MNBT"){if(t.param==="RP")if(a.log.clearAll(),a.state.gs.options.wasDrafting)a.draft.startDraft(!1,!0);else{const r=a.deck.randomStockDeck();a.state.gs.newGame(a.state.gs.options.playerDeck,r.cards)}else t.param==="MM"?(a.state.setMode("M"),a.log.clearAll(),a.drawing.drawAll()):t.param==="LK"?a.deck.loadFromFile().then(r=>{Array.isArray(r)?this.launchConstructed(r):new be().iAmError(r)}):t.param==="GP"?(a.state.toggleOption("fatPacks"),a.drawing.drawAll()):t.param==="LD"?(a.state.toggleOption("legDraft"),a.drawing.drawAll()):t.param==="HH"?(a.state.toggleOption("highHealth"),a.drawing.drawAll()):t.param==="CH"?(a.state.toggleOption("cheater"),a.drawing.drawAll()):t.param==="BB"?(a.state.toggleOption("bark"),a.drawing.drawAll()):t.param==="RU"?window.open("https://github.com/grousewood-games/solforge/blob/main/docs/rules.md#rules"):t.param==="FQ"?window.open("https://github.com/grousewood-games/solforge/blob/main/docs/faq.md#info--faq"):console.error("missing handler for menu button param "+t.param);return}if(t.actionKey==="DSET"){this.ddf5(this.generateDeckPickerActions(parseInt(t.param)));return}if(t.actionKey==="DECK"){let r;if(t.param==="~random~")r=a.deck.randomStockDeck();else{const e=a.deTil(t.param);r=a.deck.stockDeckByName(e[0],e[1])}this.launchConstructed(r.cards);return}}launchConstructed(t){a.state.gs.options.playerDeck=t;const r=a.deck.randomStockDeck();a.state.setMode("G"),a.state.gs.newGame(t,r.cards)}ddf5(t){let r;if(t){const e=this.generateDetailActions();r=t.concat(e),this.actionHistory.push(r)}else r=this.actionHistory[this.actionHistory.length-1];a.state.gs.aiActive?a.ai.processAction(r):a.drawing.drawAll()}currPlayHandAction;get cardBeingPlayed(){if(this.currPlayHandAction)return this.currPlayHandAction;throw new Error("Attempted to read current card being played, nothing exists")}actionHistory=[];get activeActions(){const t=this.actionHistory.length;return t===0?[]:this.actionHistory[t-1]}actionDone(t=!1){this.currPlayHandAction=void 0,this.actionHistory=[],a.clickers.removeAll(),a.drawing.drawActions([]),t?a.batch.triggerDone():a.phase.whatNext()}playCardSelect(t){this.currPlayHandAction=t;const r=this.getPlayCardActions(t);this.ddf5(r)}getPlayCardActions(t){if(t.actionKey!=="HPLY")throw new Error("Unexpected action passed to getPlayCardActions: "+t.actionKey);const e=a.cards.getCard(t.card).playTargets();a.state.getRegularPlays()>0&&e.push(a.target.buttonTarget("HDSC",t.card));const s=a.target.toActions(e);return s.push(d.handSelectAction("CANC",t.card,"",t.position)),s}mobilitySelect(t){const r=this.getMoveCardActions(t);this.ddf5(r)}getMoveCardActions(t){if(t.actionKey!=="MOVE")throw new Error("Unexpected action passed to getMoveCardActions: "+t.actionKey);const r=a.field.ddf6(t);let e=[];if(t.param==="ACTV"){const s=d.actionTarget("TB","ACTV",r.code,r.id);e=a.target.toActions(s)}return e.push(d.fieldSelectAction("CANC",t.lane,t.playerA)),a.field.canMove(r).map(s=>{const c=d.fieldSelectAction("MEND",s,t.playerA);return c.param=r.id,c}).concat(e)}noneEndTrigger(){return a.target.toActions(a.target.buttonTarget("NOTR"))[0]}cancelAction(){return a.target.toActions(a.target.buttonTarget("CANC"))[0]}emptyAdjacents(t,r=""){const e=r||t.id,s=d.actionTarget("TF","CARD",t.code,e);return s.field="E",s.lanes=t.adjacent,s.player="F",a.target.toActions(s)}generateDetailActions(){const t=a.state.mode;if(a.state.gs.aiActive||t==="M"||t==="C"||t==="I"||t==="X")return[];if(t==="G"){const r=a.state.getLocalPlayer().hand.map((s,c)=>{const u=d.handSelectAction("DEET",s,"",c);return u.param=s,u}),e=a.field.qActiveCreats().map(s=>{const c=d.fieldSelectAction("DEET",s.lane,s.owner);return c.param=s.code,c});return r.concat(e)}else if(t==="D"){const r=a.draft.currentPack.map((s,c)=>{const u=d.draftSelectAction("DEET",c,!0);return u.param=`${s}1`,u}),e=a.draft.picksAsDeck().map((s,c)=>{const u=d.draftSelectAction("DEET",c,!1);return u.param=`${s.card}1`,u});return r.concat(e)}return[]}generateDeckPickerActions(t=-1){const r=Mt.map((e,s)=>({actionKey:"DSET",zone:"N",hostCard:"",param:s.toString()}));if(t>-1){const e=Mt[t],s=e.decks.map(c=>({actionKey:"DECK",zone:"N",hostCard:"",param:a.enTil(e.id,c.name)}));return r.concat(s)}return r}generateInfoActions(){return Mt.map((r,e)=>({actionKey:"MNBT",zone:"N",hostCard:"",param:"MM"}))}generateExitActions(){const t=[{actionKey:"CANC",zone:"N",hostCard:"",param:"EX"},d.menuButtonAction("MM")];this.ddf5(t)}}class Kr{_state=new Be;get gs(){return this._state}resetTurnData(){this.gs.turn=d.freshTurn(),this.gs.firstTurn&&(this.gs.firstTurn=!1,this.gs.turn.regularPlays=1)}clearDetails(){this.gs.ui.detailsMode=!1,a.drawing.clearDetails()}getPlayer(t){return t?this._state.playerA:this._state.playerB}getActivePlayer(){return this.getPlayer(this._state.activePlayer)}ddf9(){return this._state.activePlayer}getLocalPlayer(){return this.getPlayer(this._state.isLocalA)}setPhase(t){this.gs.phase=t}getRegularPlays(){return this.gs.turn.regularPlays}getCardsPlayed(){return this.gs.turn.cardsPlayed}xMode="M";setMode(t){t==="X"&&(this.xMode=this.mode),this.gs.appMode=t,t==="G"?(a.canvases.get("game-ui").clear(),a.drawing.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(a.canvases.get("game-ui").clear(),a.drawing.setBackground("blueface")):t==="M"&&(a.drawing.clearAll(),a.drawing.setBackground("mainmenu"))}cancelExitMode(){this.gs.appMode=this.xMode}get mode(){return this.gs.appMode}writeStorage(t,r){localStorage.setItem(t,r)}readStorage(t){return localStorage.getItem(t)}boolRead(t,r){const e=this.readStorage(t);return e===null?r:e==="Y"}boolWrite(t,r){this.writeStorage(t,r?"Y":"N")}restoreOptions(){const t=this.gs.options;t.bark=this.boolRead("bark",!0),t.cheater=this.boolRead("cheater",!1),t.highHealth=this.boolRead("highHealth",!1),t.fatPacks=this.boolRead("fatPacks",!1),t.legDraft=this.boolRead("legDraft",!1)}toggleOption(t){this.gs.options[t]=!this.gs.options[t],this.boolWrite(t,this.gs.options[t])}setClickMode(t){this.gs.clickMode=t}get clickMode(){return this.gs.clickMode}}class Yr{async drawAll(){a.clickers.removeAll(),a.state.mode==="G"?(await Promise.all([this.drawHand(a.state.getLocalPlayer()),this.drawPlayers(),this.drawField(),this.drawActions(a.action.activeActions)]),a.state.gs.winFlag!==0?await this.drawGameOver():await this.drawCommonButtons(!0,!0,!0)):a.state.mode==="D"?await this.drawDraft(a.action.activeActions):a.state.mode==="C"?await this.drawDeckPick(a.action.activeActions):a.state.mode==="I"?await this.drawInfoMenu():a.state.mode==="X"?await this.drawExit(a.action.activeActions):await this.drawMenu()}async drawGameOver(){await new ie().drawGameOver()}async drawHand(t){await new ye().drawCards(t)}async drawField(){await new re().drawCards()}async drawPlayers(){await new ie().drawAllPlayers()}async drawActions(t){const r=new ti;if(a.state.gs.aiActive)await r.drawActions([]);else{a.canvases.get("effects").clear();const s=new ye,c=new re,u=new ie;await Promise.all([s.drawActions(t),c.drawActions(t),r.drawActions(t),u.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;a.canvases.get("effects").clear(),await new re().drawFight(t)}async drawDraft(t){const r=new ii,e=a.canvases.get("game-ui");e.clear(),a.clickers.removeAll(),await r.drawPack(t,e),await r.drawList(t,e),await this.drawCommonButtons(!1,!0,!1)}async drawMenu(){const t=new si,r=a.canvases.get("game-ui");r.clear(),a.clickers.removeAll(),await t.drawMenu(r)}async drawInfoMenu(){const t=new ai,r=a.canvases.get("game-ui");r.clear(),a.clickers.removeAll(),await t.drawMenu(r)}async drawDeckPick(t){const r=new be,e=a.canvases.get("game-ui");e.clear(),a.clickers.removeAll(),await r.drawSets(t,e),await r.drawList(t,e)}clearDetails(){a.canvases.get("card").clear()}async drawDetails(t){a.canvases.get("card").clear(),await new ri().drawCards(t.param)}async drawCommonButtons(t,r,e){let s=979;const c=723,u=new _r,m=a.canvases.get("game-ui");if(e&&m.clear(),t&&(await u.buttonMaker(m,s,c,"EX"),s-=50),r){const y=a.state.clickMode;y!=="M"&&await u.buttonMaker(m,s,c,y==="I"?"TM":"DM")}}async drawExit(t){const r=a.canvases.get("effects"),e=new Kt;await e.drawButton(r,151,488,t[1],"Quit Game",24,!1),await e.drawButton(r,478,488,t[0],"Resume",52,!1)}setBackground(t){const r="hide";["playmat","blueface","mainmenu"].forEach(e=>{const s=document.getElementById(e);t===e?s.classList.remove(r):s.classList.add(r)})}clearAll(){["card","decklist","effects","field","game-ui","hand","player"].forEach(t=>{a.canvases.get(t).clear()})}}class Ft{paStats;pbStats;constructor(t,r){this.paStats=t,this.pbStats=r}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const r=this.playerStats(t),e=this.playerStats(!t);return Ft.deltafier(r,e)}static deltafier(t,r){const e=Ft.blankStats(!0);return e.creatCount=t.creatCount-r.creatCount,e.creatValue=t.creatValue-r.creatValue,e.threatValue=t.threatValue-r.threatValue,e.playerHealth=t.playerHealth-r.playerHealth,e}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0}}}class Et{guts;constructor(t){this.guts=t}static fromState(){const t=a.field.qActiveCreats(),r=[!0,!1],e=r.map(c=>a.field.laneIdx.map(u=>{const m=t.find(y=>y.owner===c&&y.lane===u);return m?d.evalVectorCreature(m):d.evalVectorEmpty(c,u)})).flat(),s=r.map(c=>{const u=a.player.toPlayer(c),m=d.evalVectorPlayer(c);return m.health=u.health,m});return e.push(...s),new Et(e)}static ddp9(t,r,e,s,c=0){return t/2+c+r/10+(s+e)/3}static creatValueFormula(t){return t.health+Math.max(0,t.attack)+t.bonus+t.regen+t.armor-t.poison}clone(){return new Et(structuredClone(this.guts))}boardStats(){const t=[!0,!1].map(r=>this.guts.filter(e=>e.playerA===r)).map(r=>{const e=Ft.blankStats(r[0].playerA),s=r.filter(c=>c.type==="C");return e.creatCount=s.length,e.playerHealth=r[5].health,e.creatValue=this.creatSum(s,Et.creatValueFormula),e.threatValue=this.creatSum(s,c=>{if(c.defender)return 0;{const u=this.guts[this.findLaneIndex(6-c.lane,!c.playerA)];let m=0;if(u.type==="E"?m=c.attack:c.breakthrough&&(m=c.attack-u.health),m<1)return 0;if(m<6)return m;{let y=!0,A=0,k=5,w=1;const H=5;for(;y;)m>k+H?(A+=w*H,k+=H,w++):(A+=w*(m-k),y=!1);return m+(c.sleeping&&!c.aggressive?A/2:A)}}}),e});return new Ft(t[0],t[1])}weighState(t,r,e){const s=this.boardStats(),c=s.playerStats(!e).playerHealth;if(c<1&&cr(e)).reduce((e,s)=>e+s,0)}findLaneIndex(t,r){return t+(r?-1:4)}findVectorIdx(t){return t.shape==="B"?this.findLaneIndex(t.lane,t.playerA):t.playerA?10:11}getBaseVector(t){return this.guts[this.findVectorIdx(t)]}replaceBaseVector(t){const r=this.findVectorIdx(t);this.guts[r]=t}applyVectors(t){t.forEach(e=>{switch(e.type){case "M":if(e.shape==="B")if(e.destroy)this.replaceBaseVector(d.evalVectorEmpty(e.playerA,e.lane));else{const c=this.getBaseVector(e);if(c.type!=="E"){if(e.moveTo){const u=d.evalVectorEmpty(e.playerA,e.lane);c.lane=e.moveTo,this.replaceBaseVector(c),this.replaceBaseVector(u)}else if(this.applyCreatVector(c,e),e.dirDmg){const u=Math.min(e.dirDmg,c.armor-c.armorDmg);c.armorDmg+=u,c.health-=e.dirDmg-u}}}else{const c=this.getBaseVector(e);c.health+=e.health,e.dirDmg&&(c.health-=e.dirDmg)}break;case "R":const s=d.evalVectorEmpty(e.playerA,e.lane);this.applyCreatVector(s,e),s.type="C",this.replaceBaseVector(s);break;case "P":break;default:console.warn("BoardEval is applying vectors, encountered unexpected vector type:",e)}}),this.guts.filter(e=>e.shape==="B"&&e.health<1).forEach(e=>this.replaceBaseVector(d.evalVectorEmpty(e.playerA,e.lane)))}battleState(t){return t.type==="E"?0:t.defender||t.sleeping&&!t.aggressive?1:2}battleVector(t,r,e,s){const c=[];if(t>0){let u=0;const m=Math.max(e.attack,0);if(r>0){const y=t===2&&e.breakthrough,A=Math.max(Math.min(m,s.armor-s.armorDmg),0);let k=m-A;if(y&&k>s.health&&(u=k-s.health,k=s.health),A>0||k>0){const w=d.ddp1(s.playerA,s.lane);w.health=-k,w.armorDmg=A,c.push(w)}}else t===2&&(u=m);u>0&&c.push(d.evalVectorPlayerLife(s.playerA,-u))}return c}applyCombat(){const t=a.field.laneIdx.map(r=>{const e=this.guts[r-1],s=this.guts[10-r],c=this.battleState(e),u=this.battleState(s);return c===2||u===2?this.battleVector(c,u,e,s).concat(this.battleVector(u,c,s,e)):[]}).flat();this.applyVectors(t)}applyTurnEnd(t,r){const e=!t,s=!r,c=this.guts.filter(u=>u.shape==="B"&&(e||u.playerA===s)&&u.poison>0).map(u=>{const m=u.regen-Math.max(0,u.poison-u.armor),y=d.ddp1(u.playerA,u.lane);return y.health=m,y}).filter(u=>u.health!==0);this.applyVectors(c)}applyCreatVector(t,r){t.health+=r.health,t.attack+=this.doubleOrNossing(t.attack,r.attack),t.armor+=r.armor,t.armorDmg+=r.armorDmg,t.poison+=this.doubleOrNossing(t.poison,r.poison),t.regen+=r.regen,t.aggressive=r.aggressive,t.breakthrough=r.breakthrough,t.defender=r.defender,t.negateDefender=r.negateDefender}doubleOrNossing(t,r){if(r>=Ht&&r0||e.freeCards.length>0)&&(r-=L.Horrid);break;case "NT":break;case "PS":break;case "NO":break;default:console.error("Final type with no weighting switch: "+t.type),r=-2}return r+t.bonus}weighPlacement(t){let r=0;const e=t.action,s=a.field.searchByFSA(e),c=a.field.searchByLane(a.field.oppositeLane(e.lane),!e.playerA),u=t.hints.includes("RD");if(s){const y=s.aiHints().includes("RT");y&&u?(this.logHint("Replacement Supercombo - Upgrade and Happy Replace"),r+=L.Grand):y?(this.logHint("Likes being replaced"),r+=L.Noice):u?(this.logHint("Upgrade"),r+=L.Noice):t.hints.includes("RE")||(a.state.gs.turn.mainBattle?r+=L.Bad:r+=L.Never)}else u&&(this.logHint("Upgrade ignored"),r+=L.Bad);return r+=this.weighOpposition(t,c),r+=this.weighLanePlacement(t,e.lane,e.playerA),t.hints.includes("SD")&&(r+=this.weighSacrificeDemand(t)),r}weighStatChange(t){let r=0;return t.hints.includes("SD")&&(r+=this.weighSacrificeDemand(t)),r}weighDestroy(t){let r=0;const e=t.action;return a.field.ddf6(e).owner===this.aiPlayer?t.hints.includes("ST")?(this.logHint("Good sacrifice"),r+=L.Noice):r+=L.Horrid:r+=L.Noice,r}weighDmg(t){return 0}weighDiscard(t){let r=0,e;t.action.actionKey==="HDSC"?(a.state.gs.turn.mainBattle||(r+=L.Horrid),e=t.action.hostCard):(r+=L.Noice,e=t.action.card);const c=a.cards.getCard(e).aiHints();return c.includes("LV")?(this.logHint("Good card to level"),r+=L.Noice):c.includes("DL")&&(this.logHint("Bad card to level"),r+=L.Horrid),r}weighMove(t){let r=0;const e=t.action,s=a.field.jr5(e.param),c=s.owner===this.aiPlayer?1:-1,u=this.weighLanePlacement(t,s.lane,s.owner),y=this.weighLanePlacement(t,e.lane,s.owner)-u,A=a.field.searchByLane(a.field.oppositeLane(s.lane),!s.owner),k=this.weighOpposition(t,A),w=a.field.searchByLane(a.field.oppositeLane(e.lane),!s.owner),V=this.weighOpposition(t,w)-k;let tt=0;w&&(t.hints.includes("FH")?tt=L.Noice:t.hints.includes("FK")&&a.target.levelTestCommon(w.level,s.level)&&(tt=L.Grand*2));const ht=(y+V+tt)*c;return r+ht}weighLanePlacement(t,r,e){let s=0;const c=t.hints.includes("NX"),u=t.hints.includes("SL"),m=t.hints.includes("LJ");if(c?r===3?(this.logHint("Nexus"),s+=L.Noice):(this.logHint("Nexus ignored"),s+=L.Bad):u&&(r===1||r===5?(this.logHint("Sidelane"),s+=L.Noice):(this.logHint("Sidelane ignored"),s+=L.Bad)),m){const y=d.crTarg();y.player=a.player.toTarget(e),y.lanes=a.field.adjacentPositions(r);const A=a.field.creatByTarget(y).length;s+=L.Noice*A}return s}weighOpposition(t,r){let e=0;const s=t.hints.includes("OL"),c=t.hints.includes("OP");if(r){const u=r.aiHints(),m=u.includes("OL"),y=u.includes("OP");c?m?(this.logHint("Likes opposition, enemy hates it"),e+=L.Grand):y||(this.logHint("Likes opposition"),e+=L.Noice):s&&(y?(this.logHint("Hates opposition, enemy loves it"),e+=L.Horrid):m||(this.logHint("Hates opposition"),e+=L.Bad))}else c?(this.logHint("Hates open lane"),e+=L.Bad):s&&(this.logHint("Loves open lane"),e+=L.Grand);return e}weighSacrificeDemand(t){let r=L.Never;const e=s=>{r{s.hints.includes("ST")?e(L.Grand*2):Et.ddp9(1,Et.creatValueFormula(s),s.attack,0)<2?e(L.Grand):e(L.Horrid)}),r}logHint(t){}logHintStarter(t,r){this.logHint(`Eval start - ${a.log.actionText(t)} / ${r}`)}}class Xr{logChains=!1;aiPlayer=!1;actEval=new qr(this.aiPlayer);whiffActions=["CANC","DEET","SCRH"];committedVectors=[];evaluateActions(t,r=""){const e=t.filter(s=>this.whiffActions.indexOf(s.actionKey)===-1);return e.forEach(s=>{switch(s.actionKey){case "ACTV":case "CARD":const c=a.cards.getCard(s.hostCard),u=c.ddf7(s);if(u.final)s.evals=[[u]];else{const it=c.getCardActions(s);s.evals=this.evalSmoosh(this.evaluateActions(it,r+"--"),u)}break;case "FORG":const m=s,y=d.ddp4(s,m.playerA,m.lane,m.hostCard,!0);s.evals=[[y]];break;case "HDSC":s.evals=[[d.actionEval(s,"DC")]];break;case "HPLY":const A=s,k=ut.extractCardCode(A.card);if(k==="MTS"||k==="MTT")s.evals=[[d.actionEval(s,"NR")]];else{const it=a.action.getPlayCardActions(A);s.evals=this.evalSmoosh(this.evaluateActions(it))}break;case "MEND":const w=d.actionEval(s,"MC"),H=a.field.jr5(s.param),V=s;w.hints=H.aiHints();const tt=d.ddp1(H.owner,H.lane);tt.moveTo=V.lane,w.vectors.push(tt),s.evals=[[w]];break;case "MOVE":const ht=a.action.getMoveCardActions(s);s.evals=this.evalSmoosh(this.evaluateActions(ht));break;case "NOTR":s.evals=[[d.actionEval(s,"NO")]];break;case "FITE":s.evals=[[d.actionEval(s,"FT")]];break;case "ENDT":s.evals=[[d.actionEval(s,"DT")]];break;default:s.evals=[],console.error("Encountered action that AI could not evaluate:",s)}}),e}evalSmoosh(t,r){const e=t.map(s=>s.evals||[]).flat();return r?e.map(s=>[r,...s]):e}processAction(t){const r=this.evaluateActions(t),e=Et.fromState(),s=e.boardStats();let c=-9999;const m=r.map(A=>{let k=-9999;return A.evals?.forEach(w=>{let H=0;w.forEach(Bt=>{const qt=this.actEval.weighEval(Bt);H+=qt});const V=e.clone(),tt=w.map(Bt=>Bt.vectors).flat();V.applyVectors(tt);const ht=V.boardStats(),it=!a.state.gs.turn.mainBattle;it&&V.applyCombat(),V.applyTurnEnd(it,this.aiPlayer);const $t=V.weighState(s,ht,this.aiPlayer);H=Math.round((H+$t.formula)*2)/2,H>k&&(k=H)}),k>c&&(c=k),{action:A,weight:k}}).filter(A=>A.weight===c),y=m[a.randInt(0,m.length)].action;a.sleep(500).then(()=>{a.action.handleAction(y)})}logChain(t){}alliedHint(t){if(t==="A")return "ALA";if(t==="N")return "ALN";if(t==="T")return "ALT";if(t==="U")return "ALU";throw new Error("non faction passed to allied hint")}jr7(t,r=3){return`${t}${r}`}jr6(t,r){const e=a.randInt(0,r.length),s=r[e];return r.splice(e,1),a.field.birthCreature(t,"F",this.aiPlayer,s)}cheater(){const t=a.state.gs;if(!(t.aiMode&&t.aiActive&&t.options.cheater))return!1;const r=a.player.toPlayer(this.aiPlayer),e=a.player.toPlayer(!this.aiPlayer),s=e.health-r.health;let c=0;s>85?c=3:s>65?c=2:s>45&&(c=1);const u=a.field.emptyLanes(this.aiPlayer);if(c===0||u.length===0)return!1;a.log.new().plr(this.aiPlayer).txt(" is a cheaty cheaterton.").go();let m=0;if(c===1){if(t.turn.regularPlays-=1,m=a.randInt(0,13),m===0)this.jr6(this.jr7("HTR"),u);else if(m===1)this.jr6(this.jr7("AGM"),u).addRegen(8);else if(m===2){const y=this.jr6(this.jr7("YNS"),u);y.buff(0,15),y.addRegen(4)}else if(m===3)this.jr6(this.jr7("TBA"),u);else if(m===4)this.jr6(this.jr7("DCS"),u);else if(m===5)this.jr6(this.jr7("GGP"),u).addRegen(8);else if(m===6){const y=this.jr6(this.jr7("WFM"),u);y.aggressive=!0}else if(m===7){const y=this.jr6(this.jr7("FFU"),u);y.aggressive=!0}else if(m===8){const y=this.jr6(this.jr7("URB"),u);y.aggressive=!0}else if(m===9){const y=this.jr6(this.jr7("KOD"),u);y.aggressive=!0,y.addRegen(6)}else if(m===10)this.jr6(this.jr7("AGK"),u).addArmor(3);else if(m===11){const y=this.jr6(this.jr7("PSC"),u);y.aggressive=!0}else if(m===12){const y=this.jr6(this.jr7("SAD"),u);y.aggressive=!0}}else if(c===2)if(t.turn.regularPlays-=1,m=a.randInt(0,17),m===0){const y=this.jr6(this.jr7("NDR"),u);y.aggressive=!0}else if(m===1){const y=this.jr6(this.jr7("CSW"),u);y.aggressive=!0}else if(m===2)this.jr6(this.jr7("GGD"),u).addRegen(6);else if(m===3)this.jr6(this.jr7("EFP"),u);else if(m===4)this.jr6(this.jr7("ZTU"),u);else if(m===5){const y=this.jr6(this.jr7("DDD"),u);y.aggressive=!0}else if(m===6)this.jr6(this.jr7("RBH"),u).addRegen(8);else if(m===7)this.jr6(this.jr7("SFT"),u);else if(m===8)this.jr6(this.jr7("GTT"),u);else if(m===9)this.jr6(this.jr7("SMD"),u);else if(u.length===5)this.jr6(this.jr7("DFB"),u),[1,2,3,4].forEach(y=>this.jr6(this.jr7("XHS"),u));else if(u.length===4)this.jr6(this.jr7("LMV"),u);else if(u.length===3)this.jr6(this.jr7("LHY"),u),this.jr6(this.jr7("SVH"),u),this.jr6(this.jr7("DBA"),u);else if(u.length===2)this.jr6(this.jr7("UTR"),u),this.jr6(this.jr7("TDS"),u);else if(r.turn===4)this.jr6(this.jr7("SSR"),u);else if(r.turn===1)this.jr6(this.jr7("ESK"),u);else{const y=this.jr6(this.jr7("XSH"),u);y.aggressive=!0}else if(c===3)if(m=a.randInt(0,20),m===0){const y=this.jr6(this.jr7("IHA",4),u);y.aggressive=!0}else if(m===1)this.jr6(this.jr7("CHR"),u);else if(m===2)this.jr6(this.jr7("FGO",1),u);else if(m===3)this.jr6(this.jr7("CHV",4),u);else if(m===4)this.jr6(this.jr7("KKK",4),u);else if(r.health<20){const y=this.jr6(this.jr7("ODC",4),u);y.aggressive=!0}else if(u.length===5){const y=a.randInt(0,4);if(y===0)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("UWL",2),u));else if(y===1)[1,2].forEach(A=>this.jr6(this.jr7("DFB"),u)),[1,2,3].forEach(A=>this.jr6(this.jr7("FFD"),u));else if(y===2)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("BWK"),u));else if(y===3){this.jr6(this.jr7("SBG"),u),this.jr6(this.jr7("EWE"),u);const A=this.jr6(this.jr7("BMY"),u);A.defender=!0,A.aggressive=!0}}else if(e.health>350)r.health<180&&a.player.healPlayer(r,180-r.health),this.jr6(this.jr7("AGD"),u);else if(e.health>250)this.jr6(this.jr7("FGO"),u);else if(u.length===4){const y=a.randInt(0,3);y===0?(this.jr6(this.jr7("AGK"),u),[1,2,3].forEach(A=>this.jr6(this.jr7("VBK"),u))):y===1?(this.jr6(this.jr7("TDS"),u),this.jr6(this.jr7("TDS"),u),this.jr6(this.jr7("UTR"),u)):y===2&&[1,2,3,4].forEach(A=>this.jr6(this.jr7("CDC"),u))}else if(u.length===3)if(a.randInt(0,2)){this.jr6(this.jr7("SDR"),u),this.jr6(this.jr7("SDR"),u);const y=this.jr6(this.jr7("UPM"),u);y.aggressive=!0}else{this.jr6(this.jr7("SDL"),u);const y=this.jr6(this.jr7("NFF"),u);y.aggressive=!0}else if(u.length===2)this.jr6(this.jr7("SPM"),u),this.jr6(this.jr7("SPM"),u);else{const y=this.jr6(this.jr7("NXC"),u);y.buff(10,0),y.aggressive=!0,y.addMobility(2),y.addRegen(5)}return r.health<30&&a.player.healPlayer(r,50-r.health),!0}}class jr{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const r=a.state.getPlayer(t).deck;this.shuffle(r)}shuffle(t){const r=t.length,e=(s,c)=>{const u=t[s];t[s]=t[c],t[c]=u};if(r>0){let s,c;for(let u=0;ue.decks).flat(),r=a.randInt(0,t.length);return t[r]}stockDeckByName(t,r){let e;if(Mt.some(s=>s.id===t?s.decks.some(c=>{c.name===r&&(e=c)}):!1),e)return e;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+r)}ripper(t,r,e){const s=[[15,8,5],[30,15,10]],c=this.getDeckCards([],[t]),u=[],m=s[e===15?0:1][r-1];for(;u.lengthw===k)||u.push(k)}const y=u.map(A=>({card:A,num:r}));return r===2&&e===15&&(y[0].num=1),y}deckify(t){const r=t.map(e=>{const s=ke.find(c=>c[0]===e);return s?s[1]:[]}).flat();return t.concat(r).map(e=>`${e}1`)}parseDeck(t){const r=t.map(e=>Array(e.num).fill(e.card)).flat();return this.deckify(r)}validDeck(t){const r={};t.forEach(A=>{r[A.card]?r[A.card]+=A.num:r[A.card]=A.num});const e=Object.entries(r).map(A=>({card:A[0],num:A[1]})),s=e.map(A=>A.num).reduce((A,k)=>A+k,0);if(s!==30)return"Deck must have 30 cards, found "+s;const c=[];let u="";if(e.some(A=>{const k=xt.findIndex(w=>w.crd===A.card);return k===-1?(u=A.card,!0):(c.push(xt[k].fct),!1)}))return`Invalid card code: '${u}'`;let m=0;if(e.some(A=>A.num>3?(u=A.card,m=A.num,!0):!1))return`${m} copies of '${u}' ${a.log.fastName(u)}`;const y=[...new Set(c)];return y.length>2?"Deck must have two or less factions, found: "+y.join():""}getDeckCards(t=[],r=[]){return t.length===0&&r.length===0?xt.map(e=>e.crd):t.length>0&&r.length>0?xt.filter(e=>t.includes(e.rty)&&r.includes(e.fct)).map(e=>e.crd):t.length>0?xt.filter(e=>t.includes(e.rty)).map(e=>e.crd):xt.filter(e=>r.includes(e.fct)).map(e=>e.crd)}getCardFaction(t){const r=xt.find(e=>e.crd===t);return r?r.fct:"X"}getCardRarity(t){const r=xt.find(e=>e.crd===t);return r?r.rty:"T"}cardStats(){se.forEach(t=>{const r=`${a.log.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,e=jt.map(s=>`${a.log.rarityText(s)}: ${this.getDeckCards([s],[t]).length}`).join("; ");console.log(r+e)})}loadPromise=new ue;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new ue,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 r=t.cards,e=this.validDeck(r);return e||r}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const r=this.loader.files;if(r&&r.length>0){const s=r[0];var e=new FileReader;e.onload=c=>{try{var u=e.result;if(u){var m=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(u)));m.cards&&Array.isArray(m.cards)&&!m.cards.some(y=>!(y&&typeof y.card=="string"&&Number.isInteger(y.num)))?(this.fileguts=JSON.stringify(m),this.loadPromise.resolveMe()):this.readError("File format is incorrect.")}else this.readError("File read was empty.")}catch(y){console.error(y),this.readError("Error occurred while reading file.")}};try{e.readAsArrayBuffer(s)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}class ue{realPromise;resolveMe(){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,r)=>{this.resolveMe=t,this.rejectMe=r})}}class Jr{rarityCache={["L"]:[],["H"]:[],["R"]:[],["C"]:[],["T"]:[]};faction1="X";faction2="X";factionLock=!1;picks=[];currentPack=[];paginating=!1;aiPicking=!1;packOdds=[];legMode=!1;startDraft(t,r){!t&&r?this.startDraft(!0,!1):(t||(a.state.gs.options.playerDeck=[]),this.aiPicking=t,this.legMode=a.state.gs.options.legDraft,this.paginating=!1,this.packOdds=a.state.gs.options.fatPacks?[9,31,40]:[5,25,40],jt.forEach(e=>{this.rarityCache[e]=a.deck.getDeckCards([e])}),this.faction1="X",this.faction2="X",this.factionLock=!1,this.picks=[],this.resumeDraft(""))}resumeDraft(t){if(t){if(this.picks.push(t),this.picks.length===30){let s=this.picksAsDeck();this.aiPicking?a.state.gs.options.playerDeck.length>0&&(a.state.setMode("G"),a.state.gs.newGame(a.state.gs.options.playerDeck,this.picksAsDeck())):(this.startDraft(!0,!1),a.state.gs.options.playerDeck=s,a.state.setMode("G"),a.state.gs.newGame(s,this.picksAsDeck()));return}if(!this.factionLock){const s=a.deck.getCardFaction(t);this.faction1==="X"?this.faction1=s:s!==this.faction1&&(this.faction2=s,this.factionLock=!0,jt.forEach(c=>{this.rarityCache[c]=a.deck.getDeckCards([c],[this.faction1,this.faction2])}))}}const r=this.generatePack().slice(-1*(6-this.picks.length%5)),e=this.fillPack(r);if(this.aiPicking)this.resumeDraft(e[e.length-1]);else{this.currentPack=e;const s=e.map((c,u)=>{const m=d.draftSelectAction("DRFT",u,!0);return m.param=c,m});a.action.ddf5(s)}}picksAsDeck(){const t=[];return this.picks.forEach(r=>{const e=t.findIndex(s=>s.card===r);e===-1?t.push({card:r,num:1}):t[e].num+=1}),t.sort((r,e)=>{const s=a.cards.getCard(r.card+"1"),c=a.cards.getCard(e.card+"1");return s.name.toLowerCase(){const s=this.rarityCache[e].length;let c=!0;for(;c;){const u=this.rarityCache[e][a.randInt(0,s)];r.includes(u)||(r.push(u),c=!1)}}),r}}class fe{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,r,e){this.context.drawImage(t,r,e)}}class Qr{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new fe(t)}get(t){return this.registry[t]}}class ot{getCanv(t){return t instanceof fe?t:a.canvases.get(t)}async drawSprite(t,r,e,s,c={}){const u=this.getCanv(t).context,m=await a.getSprite(a.imgRoot+r);let y=1;c&&(y=c.alpha??1),y<1&&(u.globalAlpha=y),u.drawImage(m,e,s,m.naturalWidth,m.naturalHeight),y<1&&(u.globalAlpha=1)}async drawText(t,r,e,s,c={}){const u=this.getCanv(t).context;u.fillStyle=c.colour||"#000000",u.font=`${c.fontSize??24}px ${c.fontName||"cinzel"}`,u.shadowColor=c.shadow?"#000000":"#00000000",u.fillText(r,e,s),u.shadowColor="#00000000"}async drawHighlight(t,r,e,s,c,u="#00FF00"){const m=u.length===7?u.concat("aa"):u,y=this.getCanv(t);y.context.strokeStyle=m,y.context.beginPath(),y.context.rect(r,e,s,c),y.context.stroke()}hlColour(t){return t==="CANC"?"#FF0000":"#00FF00"}drawRarity(t,r,e,s){return this.drawSprite(t,`icons/rarity/new/${a.log.rarityText(r).toLowerCase()}.png`,e,s)}drawFaction(t,r,e,s){const c=r==="T"?2:0;return this.drawSprite(t,`icons/faction/${a.log.factionText(r).toLowerCase()}.png`,e+c,s+3)}}class Kt extends ot{async drawButton(t,r,e,s,c,u=7,m=!1){let y,A;m?(y="ui/button/menu_on.png",A="#d7fc03"):(y="ui/button/menu_off.png",A="#00DEF7");const k=this.buttonBounds(r,e);await this.drawSprite(t,y,k[0],k[1]),await this.drawText(t,c,k[0]+7+u,k[1]+24,{colour:A,fontSize:30});const w=new O(s,...k,st.Both);a.clickers.add(w)}buttonBounds(t,r){return[t-7,r-7,232,69]}}class _r extends ot{async buttonMaker(t,r,e,s){let u;u=`ui/button/ui_${s}.png`,await this.drawSprite(t,u,r,e);const m={actionKey:"UIBT",zone:"N",hostCard:"",param:s},y=new O(m,r,e,40,40,st.Both);a.clickers.add(y)}}class ti extends ot{async drawActions(t){const r=a.canvases.get("effects"),e=t.filter(s=>s.zone==="B");if(e.length>1&&console.error("Two button actions encountered in one batch",e),e.length===0){const s=this.buttonBounds();await this.drawSprite(r,"ui/button/off.png",s[0],s[1])}else{const s=e[0],c=this.buttonBounds();await this.drawSprite(r,"ui/button/on.png",c[0],c[1]);const m={["HDSC"]:{s:"Discard",x:22},["ENDT"]:{s:"Done",x:41},["FITE"]:{s:"Fight",x:42},["NOTR"]:{s:"None",x:41},["ACTV"]:{s:"Activ8",x:33},["CANC"]:{s:"Cancel",x:28}}[s.actionKey]??{s:"???",x:60};if(await this.drawText(r,m.s,c[0]+m.x,c[1]+21,{colour:"#00ff00",fontSize:26}),a.state.clickMode!=="I"){const y=this.highlightBounds(),A=new O(s,...y);a.clickers.add(A)}}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),r=5,e=[-1,-1,2,2];return t.map((s,c)=>s+r*e[c])}}const ge={colour:"#ffd865",fontSize:18,fontName:"serif"},ei={colour:"#0f300f",fontSize:18,fontName:"serif"};class Lt extends ot{async drawCard(t,r,e,s){const c=this.getCanv(r);let u,m=!1,y=0,A=0,k=!1,w=0,H=!1,V=!1,tt=!1,ht=!1,it=0,$t=0,Bt=0,qt=!1;if(!(t instanceof ut))m=!0,y=t.attack,A=t.health,k=t.sleeping&&!t.aggressive,w=t.regen,H=t.breakthrough,V=t.defender,tt=t.aggressive,it=t.armor,$t=t.poison,Bt=t.mobility,ht=t.changed,u=a.cards.getCard(t.code);else{if(t.type==="C"){m=!0;const nt=t;y=nt.jr1,A=nt.jr2,w=nt.initRegen,H=nt.initBT,V=nt.initDefend,tt=nt.initAggro,it=nt.initArmor,Bt=nt.initMobile}qt=t.overload,u=t}if(await this.drawSprite(c,u.image,e+14,s+35),await this.drawSprite(c,this.frameImg(u.level,u.faction,u.type),e,s),await this.drawSprite(c,`text/card/${u.cardCode()}.png`,e+12,s+16),m){const nt=s+177,Xt=e+15,ae=e+119,ve=this.statFormat(y);await this.drawText(c,ve[0],Xt+(ve[1]?4:0),nt,ge);const Ae=this.statFormat(A);await this.drawText(c,Ae[0],ae+(Ae[1]?4:0),nt,ge)}k&&await this.drawSprite(c,"icons/effects/defensive.png",e+5,s+40,{alpha:.7});const lt=[];if(qt&<.push(["overload",0]),w>0&<.push(["regenerate",w]),H&<.push(["breakthrough",0]),V&<.push(["defender",0]),tt&<.push(["aggressive",0]),it>0&<.push(["armor",it]),$t>0&<.push(["poison",$t]),Bt>0&<.push(["mobility",Bt]),ht&<.push(["changed",0]),lt.length>0){const nt=e+54-17*(lt.length-1);await Promise.all(lt.map(async(Xt,ae)=>this.drawIcon(c,nt+ae*35,s+140,Xt[0],Xt[1])))}}async drawIcon(t,r,e,s,c=0){const u=this.getCanv(t);if(await this.drawSprite(u,`icons/effects/${s}.png`,r,e),c>0){const m=this.statFormat(c);await this.drawText(u,m[0],r+(m[1]?12:7),e+8,ei)}}async drawHilight(t,r,e,s="#00FF00"){await super.drawHighlight(t,...this.highlightBounds(r,e),s)}cardBounds(t,r){return[t,r,150,205]}highlightBounds(t,r){const e=this.cardBounds(t,r),s=5,c=[-1,-1,2,2];return e.map((u,m)=>u+s*c[m])}frameImg(t,r,e){return`frames/small/lvl${t}_${r}${e}.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`}statFormat(t){const r=t.toString();return[r,r.length===1]}}const me=30,Yt=540,pe=5;class ye extends ot{async drawCards(t){const r=a.canvases.get("hand");r.clear();const e=new Lt,s=e.highlightBounds(0,0)[2]+pe;let c=me;const u=this.paginatron(t);for(let m=u[0];m<=u[1];m++){const y=a.cards.getCard(t.hand[m]);await e.drawCard(y,r,c,Yt),c+=s}}async drawActions(t){const r=a.state.clickMode!=="I",e=a.state.clickMode!=="T",s=a.canvases.get("effects"),c=new Lt,u=c.highlightBounds(0,0)[2]+pe,m=new wt(0,520,1e3,250),y=new wt(0,520,1e3,250,st.Right),A=this.paginatron(a.state.getActivePlayer());await Promise.all(t.filter(k=>k.zone==="H").map(async k=>{const w=k;if(w.position>=A[0]&&w.position<=A[1]){const H=me+(w.position-A[0])*u;if(e&&k.actionKey==="DEET"){const V=new O(k,...c.highlightBounds(H,Yt),st.Right);y.addChild(V)}else if(r&&k.actionKey!=="DEET"){const V=new O(k,...c.highlightBounds(H,Yt));m.addChild(V),await c.drawHilight(s,H,Yt,this.hlColour(w.actionKey))}}})),r&&a.clickers.add(m),e&&a.clickers.add(y),A[0]>0&&await this.makeScroller(s,!1),A[1]0&&t.hand.length-r<5&&(r=Math.max(0,t.hand.length-5),a.state.gs.ui.handScrollLeft=r),[r,Math.min(r+4,t.hand.length-1),t.hand.length-1]}scrollHilightBounds(t,r){return[t-3,r-2,27,38]}async makeScroller(t,r){const e=r?894:856,s=726,c=this.scrollHilightBounds(e,s);await this.drawSprite(t,`ui/arrow/${r?"right":"left"}.png`,e,s),await this.drawHighlight(t,...c);const u={zone:"N",actionKey:"SCRH",hostCard:"",param:r?"R":"L"},m=new O(u,...c,st.Both);a.clickers.add(m)}}class re extends ot{fieldBoundary=[17,62,821,443];async drawCards(t){const r=a.state.gs.isLocalA,e=a.canvases.get("field");e.clear();const s=new Lt,c=a.field.qActiveCreats().map(u=>{let m=0;t&&t.scrappers.some(A=>A[0]===u.lane&&A[1]===u.owner)&&(m=t.battlePhase);const y=this.coordCalc(u.lane,u.owner,r,m);return s.drawCard(u,e,...y)});if(await Promise.all(c),a.batch.iaTrigLane>0){const u=this.coordCalc(a.batch.iaTrigLane,a.state.ddf9(),r),m=s.cardBounds(...u);await this.drawSprite(e,"icons/rewards/gold.png",m[0]+m[2]/2-20,m[1]+m[3]+7)}}async drawActions(t){const r=a.state.clickMode!=="I",e=a.state.clickMode!=="T",s=a.state.gs.isLocalA,c=a.canvases.get("effects"),u=new Lt,m=new wt(...this.fieldBoundary),y=new wt(...this.fieldBoundary,st.Right);await Promise.all(t.filter(A=>A.zone==="F"||A.zone==="R").map(async A=>{if(A.zone==="R"&&r){const k=new O(A,...this.fieldBoundary);a.clickers.add(k),await this.drawHighlight(c,...this.fieldBoundary)}else{const k=A,w=this.coordCalc(k.lane,k.playerA,s);if(e&&A.actionKey==="DEET"){const H=new O(A,...u.highlightBounds(...w),st.Right);y.addChild(H)}else if(r&&A.actionKey!=="DEET"){const H=new O(A,...u.highlightBounds(...w));m.addChild(H),await u.drawHilight(c,...w,this.hlColour(k.actionKey))}}})),r&&m.childs.length>0&&a.clickers.add(m),e&&y.childs.length>0&&a.clickers.add(y)}async drawFight(t){if(t.length>0){const r={battlePhase:1,scrappers:t},e=72;await this.drawCards(r),await a.sleep(e),r.battlePhase=2,await this.drawCards(r),await a.sleep(e),r.battlePhase=3,await this.drawCards(r),await a.sleep(e),r.battlePhase=4,await this.drawCards(r),await a.sleep(e+70),r.battlePhase=3,await this.drawCards(r),await a.sleep(e),r.battlePhase=2,await this.drawCards(r),await a.sleep(e),r.battlePhase=1,await this.drawCards(r),await a.sleep(e)}}coordCalc(t,r,e,s=0){const c=e===r,u=166,m=5;let y,A,k;return[y,k,A]=c?[22,290,1]:[687,65,-1],[y+(t-1)*u*A,k+s*m*(-1*A)]}}class ie extends ot{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,r,e,s){const c=this.getCanv(r);await this.drawSprite(c,`avatar/${this.avatars[t.avatar]}.jpg`,e+46,s+48),await this.drawSprite(c,"ui/player_frame.png",e,s),await this.drawSprite(c,"ui/player_health.png",e+10,s+102);let u;t.health>99||t.health<-9?u=26:t.health>9||t.health<0?u=33:u=39,await this.drawText(c,t.health.toString(),e+u,s+147,{colour:"#00FF00",fontName:"serif"}),await this.drawText(c,`Turn: ${t.turn.toString()} Rank: ${t.rank.toString()}`,e+25,s+210,{colour:"#f5f242",fontSize:20}),await this.drawText(c,t.name,e+t.nameOffset,s+185,{colour:"#42a4f5",fontSize:20})}async drawAllPlayers(){const t=a.canvases.get("player");t.clear();const r=a.state.getLocalPlayer(),e=a.state.getPlayer(!r.isPlayerA);if(await this.drawPlayer(r,t,...this.playerOrigin(!0)),await this.drawPlayer(e,t,...this.playerOrigin(!1)),r.isPlayerA===a.state.ddf9()){let s=862;const c=350,u=a.state.getRegularPlays(),m=a.state.gs.turn.freeCards.length,y=Array(u).fill("blue").concat(Array(m).fill("green")),A=[];y.forEach(k=>{A.push(this.drawSprite(t,`ui/${k}card.png`,s,c)),s+=30}),await Promise.all(A)}}async drawActions(t){if(a.state.clickMode==="I")return;const r=a.canvases.get("effects"),e=a.state.gs.isLocalA;await Promise.all(t.filter(s=>s.zone==="P").map(s=>{const c=s,u=this.playerOrigin(c.playerA===e),m=this.highlightBounds(...u),y=new O(s,...m);return a.clickers.add(y),this.drawHighlight(r,...m)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,r){return[t+18,r+18,170,170]}highlightBounds(t,r){return this.playerBounds(t,r)}async drawGameOver(){const t=a.canvases.get("field"),r=a.state.gs.isLocalA,e=a.state.gs.winFlag,s=r&&e===1||!r&&e===-1;await this.drawSprite(t,`ui/you-${s?"win":"lose"}.png`,89,89),a.clickers.removeAll();const c=new Kt,u=a.canvases.get("effects");await c.drawButton(u,151,520,d.menuButtonAction("MM"),"Main Menu",20,!1),await c.drawButton(u,478,520,d.menuButtonAction("RP"),"Replay",55,!1)}}class ri extends ot{async drawCards(t){const r=a.canvases.get("card");r.clear(),r.context.fillStyle="#222222cc",r.context.fillRect(0,0,a.gameWidth,a.gameHeight);const e=typeof t=="string"?a.cards.getCard(t):t;let s;if(e.rarity==="T")s=[e];else{const A=e.maxLevel,k=ut.extractCardCode(e.code);s=a.field.laneIdx.filter(w=>w<=A).map(w=>w===e.level?e:a.cards.getCard(`${k}${w}`))}const c=new Lt;let u=3;const m=s.length,y=m===4;u0;){let ht;if(V.lengtha.log.tribeText(r)).join(" "):""}}class ii extends ot{async drawPack(t,r){const e=new Lt,s=a.state.clickMode!=="I",c=a.state.clickMode!=="T",u=[],m=new wt(...this.packBoundary),y=new wt(...this.packBoundary,st.Right);t.filter(k=>k.pack).forEach(k=>{const w=this.coordCalcPack(k.index);if(k.actionKey==="DRFT"){const H=a.cards.getCard(k.param+"1");if(u.push(e.drawCard(H,r,...w).then(()=>this.drawRarity(r,H.rarity,w[0]+112,w[1]+4))),s){const V=new O(k,...e.highlightBounds(...w));m.addChild(V)}}else if(c){const H=new O(k,...e.highlightBounds(...w),st.Right);y.addChild(H)}}),s&&m.childs.length>0&&a.clickers.add(m),c&&y.childs.length>0&&a.clickers.add(y),await Promise.all(u)}async drawList(t,r){let e=170;const s=570,c=[],u=a.draft.picksAsDeck(),m=new wt(s,e,600,600,st.Both),y=t,A=15,k=a.draft.paginating;u.length>A&&await this.makeScroller(r,k),y.filter(w=>!w.pack).forEach(w=>{if(k===w.index>=A){const H=a.cards.getCard(w.param+"1");c.push(this.drawFaction(r,H.faction,s,e),this.drawRarity(r,H.rarity,s+28,e),this.drawText(r,`${u[w.index].num}x ${H.name}`,s+65,e+7,{colour:"#f5f242"}));const V=new O(w,s,e-2,600,35,st.Both);m.addChild(V),e+=35}}),await Promise.all(c),a.clickers.add(m)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,c=Math.floor(t/3);return[22+s*176,200+c*235]}scrollHilightBounds(t,r){return[t-5,r-5,26,26]}async makeScroller(t,r){const c=this.scrollHilightBounds(530,720);await this.drawSprite(t,`ui/arrow/${r?"up":"down"}.png`,530,720);const u={zone:"N",actionKey:"SCRD",hostCard:"",param:r?"U":"D"},m=new O(u,...c,st.Both);a.clickers.add(m)}}class be extends ot{async drawSets(t,r){let e=200;const s=100,c=[],u=new wt(s,e,400,600);t.filter(k=>k.actionKey==="DSET").forEach(k=>{const w=Mt[parseInt(k.param)];c.push(this.drawText(r,w.name,s,e,{colour:"#f5f242"}),this.drawSprite(r,"icons/chest_small.png",s-48,e-5));const H=new O(k,s,e-2,400,35);u.addChild(H),e+=45}),c.push(this.drawText(r,"Random Deck",s,e,{colour:"#f5f242"}),this.drawSprite(r,"icons/chest_small.png",s-48,e-5));const m=new O({actionKey:"DECK",zone:"N",param:"~random~",hostCard:""},s,e-2,400,35);u.addChild(m),a.clickers.add(u),await Promise.all(c);const y={actionKey:"MNBT",zone:"N",hostCard:"",param:"LK"};await new Kt().drawButton(r,s-48,650,y,"LOAD FILE",32)}async drawList(t,r){let e=170;const s=570,c=[],u=new wt(s,e,600,600);t.filter(m=>m.actionKey==="DECK").forEach(m=>{const y=a.deTil(m.param),A=a.deck.stockDeckByName(y[0],y[1]);c.push(this.drawFaction(r,A.factions[0],s,e),this.drawText(r,A.name,s+65,e+7,{colour:"#f5f242"})),A.factions.length===2&&c.push(this.drawFaction(r,A.factions[1],s+28,e));const k=new O(m,s,e-2,600,35);u.addChild(k),e+=35}),await Promise.all(c),a.clickers.add(u)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,c=Math.floor(t/3);return[22+s*176,200+c*235]}iAmError(t){const r=a.canvases.get("game-ui");this.drawText(r,t,295,670,{colour:"#f5142e",fontSize:26})}}class ai extends ot{async drawMenu(t){const r=new Kt,e=80,s=45,c=240;let u=50,m=c;await this.textFun(u+28,m,"More Info",t),m+=s,await this.buttonMaker(t,r,u,m,"RU","RULES",66),m+=e,await this.buttonMaker(t,r,u,m,"FQ","INFO & FAQ",20),m+=e*2,await this.buttonMaker(t,r,u,m,"MM","MAIN MENU",20),u=404,m=c,await this.textFun(u+5,m,"Draft Modes",t),m+=s,await this.buttonMaker(t,r,u,m,"GP","GOOD PACKS",9,a.state.gs.options.fatPacks),m+=e,await this.buttonMaker(t,r,u,m,"LD","LEGENDARY",17,a.state.gs.options.legDraft),u=757,m=c,await this.textFun(u+12,m,"Game Modes",t),m+=s,await this.buttonMaker(t,r,u,m,"HH","BIG HEALTH",20,a.state.gs.options.highHealth),m+=e,await this.buttonMaker(t,r,u,m,"CH","CHEATER",37,a.state.gs.options.cheater),m+=e,await this.buttonMaker(t,r,u,m,"BB","BATTLE BARK",13,a.state.gs.options.bark),await this.drawText(t,"v0.2.1",480,730,{fontSize:16,colour:"#7b68ee"})}async textFun(t,r,e,s){await this.drawText(s,e,t,r,{colour:"#f5f242",fontSize:30})}async buttonMaker(t,r,e,s,c,u,m=7,y=!1){const A={actionKey:"MNBT",zone:"N",hostCard:"",param:c};await r.drawButton(t,e,s,A,u,m,y)}}class si extends ot{async drawMenu(t){let e=22;await this.drawSprite(t,"ui/button/constructed.png",778,e);const s={zone:"N",actionKey:"MENU",hostCard:"",param:"C"},c=new O(s,...this.buttHilightBounds(778,e));a.clickers.add(c),e=148,await this.drawSprite(t,"ui/button/draft.png",778,e);const u={zone:"N",actionKey:"MENU",hostCard:"",param:"D"},m=new O(u,...this.buttHilightBounds(778,e));a.clickers.add(m),e=508,await this.drawSprite(t,"ui/button/deck.png",778,e);const y={zone:"N",actionKey:"MENU",hostCard:"",param:"B"},A=new O(y,...this.buttHilightBounds(778,e));a.clickers.add(A),e=634,await this.drawSprite(t,"ui/button/info.png",778,e);const k={zone:"N",actionKey:"MENU",hostCard:"",param:"I"},w=new O(k,...this.buttHilightBounds(778,e));a.clickers.add(w),await this.drawSprite(t,"gwg/gwg_red.png",58,0)}buttBounds(t,r){return[t,r,242,113]}buttHilightBounds(t,r){const s=[-3,-3,6,6];return this.buttBounds(t,r).map((c,u)=>c+s[u])}textFun(t,r,e,s){this.drawText(s,e,t+89,r+40,{colour:"#1aa0e3",fontSize:20})}}class ni{gameWidth;gameHeight;spriteCache;action;ai;batch;canvases;cards;clickers;creat;data;death;deck;draft;drawing;effect;field;fight;log;phase;player;state;target;trigger;turn;dogAudio;idnum=0;imgRoot;constructor(){this.spriteCache={},this.imgRoot="./img/",this.gameWidth=1024,this.gameHeight=768,this.action=new zr,this.ai=new Xr,this.batch=new Rr,this.canvases=new Qr,this.cards=new Pr,this.clickers=new Lr,this.creat=new Wr,this.data=new Hr,this.death=new Mr,this.deck=new jr,this.draft=new Jr,this.drawing=new Yr,this.effect=new Ur,this.field=new $r,this.fight=new Vr,this.log=new Br,this.phase=new Gr,this.player=new Or,this.state=new Kr,this.target=new Zr,this.trigger=new Nr,this.turn=new Ir,this.dogAudio=document.getElementById("dogbark")}randInt(t,r){return Math.floor(Math.random()*(r-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(r=>{setTimeout(()=>{r()},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(r=>this.getSprite(`${this.imgRoot}${r}`)))}dogBark(){this.dogAudio.volume=.3,this.dogAudio.play()}genId(t){const e=t??this.state.gs.isLocalA?"@":"!";return this.idnum+=1,this.idnum.toString(36)+e}enTil(...t){return t.join("~")}deTil(t){return t.split("~")}imageLoader(t){return new Promise(r=>{const e=new Image;e.onload=()=>{r(e)},e.src=t})}}const a=new ni;window.onload=async()=>{await document.fonts.ready;let n=[];document.fonts.forEach(c=>{c.load(),n.push(c.loaded)}),await Promise.all(n),["game-ui","field","player","hand","effects","decklist","card"].forEach(c=>{a.canvases.register(c)});const r=a.canvases.get("effects");r.context.lineWidth=2;try{document.createEvent("TouchEvent"),a.state.setClickMode("T")}catch{}const e=c=>{if(a.state.gs.ui.detailsMode)a.state.clearDetails();else{const u=a.clickers.hitTest(c.pageX,c.pageY,c.button);u&&a.action.handleAction(u)}},s=document.getElementById("solforge");s.addEventListener("click",e),s.addEventListener("contextmenu",c=>(c.preventDefault(),e(c),!1)),a.state.restoreOptions(),a.drawing.drawAll()}})();