diff --git a/README.md b/README.md index e6ae417..664f327 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A homebrew attempt at recreating classic [Solforge](https://en.wikipedia.org/wik ## Current Release -### (Forge Guardian) Beta `v0.7.1` +### (Forge Guardian) Beta `v0.7.2` - :flower_playing_cards: All cards in Sets 1 to 5 freely available. - :medal_military: Constructed and Draft modes. diff --git a/play/dist/solforge.js b/play/dist/solforge.js index 0e6ee3c..ec3a4d9 100644 --- a/play/dist/solforge.js +++ b/play/dist/solforge.js @@ -1,3 +1,3 @@ -(function(){"use strict";const Te=["A","N","T","U"];const oe=["C","R","H","L"];const Rt=[{crd:"AAK",fct:"T",rty:"L",set:1,typ:"C"},{crd:"ABB",fct:"N",rty:"R",set:4,typ:"C"},{crd:"ABM",fct:"N",rty:"C",set:5,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:"AGW",fct:"A",rty:"R",set:4,typ:"S"},{crd:"ASG",fct:"T",rty:"R",set:1,typ:"S"},{crd:"AMS",fct:"A",rty:"H",set:5,typ:"C"},{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:"ATP",fct:"U",rty:"H",set:3,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:"AAA",fct:"A",rty:"L",set:5.1,typ:"C"},{crd:"ABE",fct:"A",rty:"H",set:5.1,typ:"S"},{crd:"ATZ",fct:"A",rty:"C",set:4,typ:"S"},{crd:"AEC",fct:"U",rty:"L",set:5,typ:"S"},{crd:"ARB",fct:"A",rty:"H",set:4,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:"AMD",fct:"T",rty:"H",set:5,typ:"C"},{crd:"ABR",fct:"T",rty:"C",set:2,typ:"C"},{crd:"AFR",fct:"T",rty:"H",set:3.1,typ:"C"},{crd:"AMY",fct:"T",rty:"C",set:1,typ:"C"},{crd:"ABL",fct:"T",rty:"R",set:1,typ:"S"},{crd:"ATT",fct:"T",rty:"L",set:4.1,typ:"C"},{crd:"AGU",fct:"T",rty:"R",set:2.1,typ:"C"},{crd:"AIV",fct:"T",rty:"H",set:1,typ:"C"},{crd:"BRS",fct:"A",rty:"C",set:5,typ:"C"},{crd:"BTB",fct:"A",rty:"R",set:5,typ:"C"},{crd:"BTH",fct:"U",rty:"R",set:3,typ:"C"},{crd:"BTI",fct:"A",rty:"C",set:4,typ:"C"},{crd:"BTN",fct:"A",rty:"H",set:1,typ:"C"},{crd:"BBB",fct:"U",rty:"H",set:4,typ:"C"},{crd:"BLH",fct:"T",rty:"L",set:2,typ:"C"},{crd:"BFT",fct:"N",rty:"C",set:5,typ:"S"},{crd:"BSP",fct:"N",rty:"C",set:2.2,typ:"C"},{crd:"BWK",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BLW",fct:"N",rty:"R",set:3,typ:"C"},{crd:"BZS",fct:"T",rty:"C",set:5,typ:"C"},{crd:"BSR",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BMY",fct:"T",rty:"H",set:2.1,typ:"C"},{crd:"BSW",fct:"T",rty:"C",set:3,typ:"C"},{crd:"BWW",fct:"T",rty:"H",set:4,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:"BTR",fct:"U",rty:"H",set:3.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:"BST",fct:"T",rty:"L",set:4,typ:"C"},{crd:"BWT",fct:"U",rty:"L",set:4.2,typ:"C"},{crd:"BRH",fct:"N",rty:"R",set:5,typ:"C"},{crd:"BWH",fct:"A",rty:"R",set:1,typ:"S"},{crd:"BRN",fct:"T",rty:"R",set:3,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:"CKB",fct:"N",rty:"H",set:5,typ:"C"},{crd:"CDT",fct:"U",rty:"R",set:1,typ:"C"},{crd:"CMF",fct:"N",rty:"R",set:4,typ:"C"},{crd:"CTL",fct:"T",rty:"L",set:1,typ:"S"},{crd:"CCS",fct:"N",rty:"C",set:3,typ:"C"},{crd:"CHY",fct:"U",rty:"C",set:1,typ:"C"},{crd:"CSR",fct:"U",rty:"C",set:5,typ:"C"},{crd:"CHV",fct:"N",rty:"L",set:2,typ:"C"},{crd:"CRS",fct:"A",rty:"R",set:3,typ:"C"},{crd:"COD",fct:"T",rty:"R",set:4,typ:"S"},{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:"CBB",fct:"T",rty:"C",set:3,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:"CTG",fct:"A",rty:"C",set:3,typ:"C"},{crd:"CCT",fct:"T",rty:"R",set:2,typ:"C"},{crd:"CFG",fct:"T",rty:"C",set:2,typ:"S"},{crd:"CGL",fct:"N",rty:"H",set:3,typ:"C"},{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:"CNT",fct:"A",rty:"R",set:5,typ:"S"},{crd:"CWK",fct:"T",rty:"C",set:3,typ:"C"},{crd:"CRC",fct:"A",rty:"R",set:2,typ:"C"},{crd:"CYC",fct:"N",rty:"H",set:2,typ:"C"},{crd:"CYS",fct:"N",rty:"C",set:4,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:"CSH",fct:"A",rty:"C",set:3,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:"DDF",fct:"U",rty:"R",set:5,typ:"S"},{crd:"DGZ",fct:"A",rty:"R",set:2,typ:"S"},{crd:"DBN",fct:"N",rty:"C",set:4,typ:"C"},{crd:"DDS",fct:"A",rty:"H",set:4.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:"DPB",fct:"A",rty:"L",set:5.2,typ:"C"},{crd:"DZD",fct:"U",rty:"L",set:3,typ:"C"},{crd:"DRE",fct:"T",rty:"L",set:5,typ:"S"},{crd:"DGW",fct:"T",rty:"L",set:5.2,typ:"S"},{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:"DTD",fct:"N",rty:"L",set:4.2,typ:"C"},{crd:"DSZ",fct:"N",rty:"C",set:2,typ:"C"},{crd:"DYB",fct:"U",rty:"R",set:2,typ:"S"},{crd:"DBQ",fct:"N",rty:"H",set:3,typ:"C"},{crd:"DYS",fct:"N",rty:"R",set:3,typ:"S"},{crd:"DYL",fct:"U",rty:"L",set:3,typ:"C"},{crd:"EBW",fct:"N",rty:"C",set:3,typ:"C"},{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:"EPH",fct:"A",rty:"L",set:4.2,typ:"C"},{crd:"ESG",fct:"A",rty:"H",set:4.1,typ:"C"},{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:"EFA",fct:"T",rty:"R",set:5,typ:"S"},{crd:"EFM",fct:"T",rty:"L",set:2.1,typ:"C"},{crd:"EFP",fct:"T",rty:"L",set:1,typ:"C"},{crd:"EFE",fct:"U",rty:"L",set:5.2,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:"FFG",fct:"U",rty:"C",set:4,typ:"C"},{crd:"FST",fct:"N",rty:"R",set:4,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:"FLH",fct:"T",rty:"C",set:4,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:"FJT",fct:"T",rty:"C",set:5,typ:"S"},{crd:"FLN",fct:"T",rty:"R",set:2,typ:"S"},{crd:"FRI",fct:"T",rty:"C",set:3,typ:"C"},{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:"FRV",fct:"N",rty:"H",set:3,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:"FGD",fct:"A",rty:"H",set:3,typ:"C"},{crd:"FGG",fct:"A",rty:"H",set:1,typ:"C"},{crd:"FOL",fct:"A",rty:"H",set:3.1,typ:"C"},{crd:"FPM",fct:"A",rty:"R",set:3,typ:"C"},{crd:"FPS",fct:"A",rty:"C",set:1,typ:"C"},{crd:"FFM",fct:"T",rty:"H",set:3,typ:"C"},{crd:"FMD",fct:"T",rty:"L",set:3,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:"GOS",fct:"A",rty:"L",set:4,typ:"S"},{crd:"GHS",fct:"U",rty:"C",set:2.2,typ:"C"},{crd:"GHB",fct:"U",rty:"R",set:1,typ:"C"},{crd:"GHR",fct:"U",rty:"H",set:4.2,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:"GGR",fct:"N",rty:"L",set:3,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:"HMF",fct:"T",rty:"H",set:3,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:"HOD",fct:"T",rty:"R",set:3,typ:"C"},{crd:"HWM",fct:"A",rty:"L",set:1,typ:"C"},{crd:"HOX",fct:"N",rty:"R",set:4,typ:"S"},{crd:"HGS",fct:"N",rty:"R",set:1,typ:"S"},{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:"IME",fct:"N",rty:"L",set:5,typ:"S"},{crd:"IVS",fct:"N",rty:"C",set:4,typ:"S"},{crd:"ICD",fct:"N",rty:"L",set:5,typ:"C"},{crd:"IWC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"IHA",fct:"A",rty:"L",set:2,typ:"C"},{crd:"IBR",fct:"A",rty:"C",set:3,typ:"C"},{crd:"IMD",fct:"A",rty:"L",set:3,typ:"C"},{crd:"IMA",fct:"A",rty:"L",set:2.3,typ:"C"},{crd:"IZK",fct:"T",rty:"L",set:3,typ:"C"},{crd:"JPK",fct:"A",rty:"C",set:1,typ:"S"},{crd:"KDC",fct:"T",rty:"C",set:3,typ:"C"},{crd:"KAW",fct:"T",rty:"L",set:1.1,typ:"C"},{crd:"KOD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"KBE",fct:"U",rty:"H",set:5,typ:"C"},{crd:"KIW",fct:"A",rty:"L",set:3,typ:"C"},{crd:"KTS",fct:"U",rty:"H",set:4,typ:"C"},{crd:"KKK",fct:"T",rty:"L",set:2,typ:"C"},{crd:"LOD",fct:"U",rty:"L",set:4,typ:"S"},{crd:"LFA",fct:"T",rty:"H",set:4,typ:"C"},{crd:"LKP",fct:"U",rty:"L",set:1,typ:"C"},{crd:"LGT",fct:"N",rty:"R",set:2.3,typ:"C"},{crd:"LLD",fct:"N",rty:"H",set:5,typ:"C"},{crd:"LLG",fct:"U",rty:"H",set:5,typ:"C"},{crd:"LLS",fct:"A",rty:"H",set:5,typ:"C"},{crd:"LLT",fct:"T",rty:"H",set:5,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:"LCE",fct:"A",rty:"L",set:5,typ:"S"},{crd:"LUC",fct:"T",rty:"L",set:4.2,typ:"C"},{crd:"LMV",fct:"N",rty:"L",set:1,typ:"C"},{crd:"LHY",fct:"U",rty:"C",set:2,typ:"C"},{crd:"LYR",fct:"U",rty:"C",set:4,typ:"S"},{crd:"LYS",fct:"U",rty:"R",set:3,typ:"S"},{crd:"MMH",fct:"T",rty:"C",set:1,typ:"C"},{crd:"MHR",fct:"U",rty:"L",set:5.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:"MMR",fct:"A",rty:"C",set:5,typ:"C"},{crd:"MMX",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMI",fct:"A",rty:"C",set:4,typ:"C"},{crd:"MMO",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMV",fct:"A",rty:"C",set:2.2,typ:"C"},{crd:"MPH",fct:"U",rty:"H",set:3,typ:"S"},{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:"MDE",fct:"N",rty:"C",set:4,typ:"C"},{crd:"MBP",fct:"U",rty:"H",set:1,typ:"C"},{crd:"MND",fct:"A",rty:"R",set:1,typ:"C"},{crd:"NNS",fct:"A",rty:"R",set:3,typ:"S"},{crd:"NGB",fct:"T",rty:"C",set:1,typ:"C"},{crd:"NGW",fct:"T",rty:"C",set:4,typ:"C"},{crd:"NSL",fct:"U",rty:"R",set:1,typ:"S"},{crd:"NCF",fct:"N",rty:"C",set:4,typ:"S"},{crd:"NCM",fct:"N",rty:"H",set:5,typ:"C"},{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:"NSW",fct:"N",rty:"L",set:3,typ:"C"},{crd:"NSH",fct:"N",rty:"L",set:2.3,typ:"S"},{crd:"NXA",fct:"A",rty:"L",set:3.1,typ:"C"},{crd:"NXC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"NXG",fct:"A",rty:"H",set:3,typ:"C"},{crd:"NXO",fct:"A",rty:"C",set:5,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:"NGQ",fct:"U",rty:"L",set:4.1,typ:"C"},{crd:"NCL",fct:"U",rty:"R",set:1.1,typ:"S"},{crd:"NFF",fct:"U",rty:"L",set:2,typ:"C"},{crd:"NAM",fct:"N",rty:"C",set:3,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:"OBB",fct:"T",rty:"R",set:3,typ:"S"},{crd:"OEX",fct:"A",rty:"H",set:3,typ:"S"},{crd:"OWH",fct:"T",rty:"H",set:3,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:"OSV",fct:"A",rty:"H",set:4,typ:"C"},{crd:"OSS",fct:"A",rty:"C",set:5,typ:"S"},{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:"OSL",fct:"U",rty:"C",set:3,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:"PLW",fct:"A",rty:"R",set:4,typ:"S"},{crd:"PRG",fct:"N",rty:"C",set:4,typ:"C"},{crd:"PRI",fct:"A",rty:"R",set:3,typ:"S"},{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:"PSH",fct:"N",rty:"H",set:4,typ:"C"},{crd:"PTR",fct:"A",rty:"R",set:2,typ:"S"},{crd:"PSG",fct:"U",rty:"R",set:1,typ:"S"},{crd:"PMI",fct:"T",rty:"H",set:5.1,typ:"C"},{crd:"PMS",fct:"T",rty:"C",set:1,typ:"S"},{crd:"POX",fct:"N",rty:"H",set:4.2,typ:"C"},{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:"ROK",fct:"T",rty:"L",set:3.1,typ:"S"},{crd:"RHY",fct:"U",rty:"C",set:3,typ:"C"},{crd:"RTS",fct:"T",rty:"C",set:2.2,typ:"C"},{crd:"RLW",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RHU",fct:"A",rty:"L",set:4.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:"RWC",fct:"U",rty:"C",set:4,typ:"C"},{crd:"RFA",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RWD",fct:"N",rty:"C",set:5,typ:"C"},{crd:"RSE",fct:"T",rty:"H",set:4.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:"RSP",fct:"T",rty:"R",set:3,typ:"C"},{crd:"RHW",fct:"N",rty:"C",set:3,typ:"C"},{crd:"SBF",fct:"T",rty:"H",set:4,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:"STS",fct:"U",rty:"C",set:3,typ:"S"},{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:"SHY",fct:"N",rty:"C",set:5,typ:"C"},{crd:"SCD",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SFT",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SOC",fct:"N",rty:"L",set:4,typ:"S"},{crd:"SOA",fct:"A",rty:"C",set:3,typ:"S"},{crd:"SOD",fct:"U",rty:"C",set:3,typ:"S"},{crd:"SOK",fct:"T",rty:"C",set:3,typ:"S"},{crd:"SOT",fct:"N",rty:"C",set:3,typ:"S"},{crd:"SAD",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SHG",fct:"N",rty:"L",set:2,typ:"S"},{crd:"SBI",fct:"U",rty:"C",set:3,typ:"C"},{crd:"SCC",fct:"U",rty:"C",set:4,typ:"C"},{crd:"SPB",fct:"U",rty:"L",set:5,typ:"C"},{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:"STB",fct:"T",rty:"C",set:5,typ:"S"},{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:"SSD",fct:"T",rty:"L",set:5,typ:"C"},{crd:"SDA",fct:"U",rty:"H",set:5,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:"SSH",fct:"U",rty:"H",set:4,typ:"C"},{crd:"SRM",fct:"N",rty:"H",set:4,typ:"C"},{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:"SRP",fct:"N",rty:"L",set:4,typ:"S"},{crd:"SGG",fct:"N",rty:"H",set:4,typ:"C"},{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:"SKS",fct:"T",rty:"C",set:4,typ:"C"},{crd:"SEL",fct:"T",rty:"R",set:5,typ:"C"},{crd:"STM",fct:"T",rty:"R",set:4,typ:"C"},{crd:"SBD",fct:"U",rty:"C",set:2.1,typ:"C"},{crd:"SCV",fct:"N",rty:"R",set:3,typ:"S"},{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:"SSI",fct:"A",rty:"R",set:4,typ:"C"},{crd:"SND",fct:"U",rty:"R",set:4,typ:"C"},{crd:"SNT",fct:"N",rty:"L",set:5.1,typ:"C"},{crd:"STR",fct:"N",rty:"R",set:2,typ:"S"},{crd:"SPH",fct:"N",rty:"H",set:4.1,typ:"C"},{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:"SOL",fct:"U",rty:"C",set:4,typ:"C"},{crd:"SOV",fct:"T",rty:"L",set:4,typ:"S"},{crd:"SHK",fct:"T",rty:"H",set:1,typ:"S"},{crd:"SWR",fct:"A",rty:"R",set:1,typ:"C"},{crd:"SMN",fct:"T",rty:"C",set:5,typ:"C"},{crd:"SER",fct:"A",rty:"C",set:4,typ:"C"},{crd:"SES",fct:"A",rty:"L",set:5,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:"SSK",fct:"A",rty:"C",set:3,typ:"C"},{crd:"SWG",fct:"A",rty:"C",set:4,typ:"C"},{crd:"SWM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"SIV",fct:"U",rty:"H",set:5.1,typ:"S"},{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:"STP",fct:"T",rty:"C",set:4,typ:"S"},{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:"SEV",fct:"N",rty:"L",set:3.1,typ:"C"},{crd:"SMA",fct:"U",rty:"C",set:5,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:"TGL",fct:"U",rty:"R",set:3,typ:"S"},{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:"TNL",fct:"N",rty:"L",set:4.1,typ:"C"},{crd:"TEX",fct:"A",rty:"C",set:4,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:"TAB",fct:"T",rty:"C",set:4,typ:"C"},{crd:"TGI",fct:"T",rty:"R",set:2,typ:"C"},{crd:"TDS",fct:"U",rty:"L",set:1.1,typ:"C"},{crd:"TSP",fct:"T",rty:"H",set:4.2,typ:"S"},{crd:"TPG",fct:"N",rty:"H",set:3.1,typ:"C"},{crd:"TMG",fct:"U",rty:"R",set:3,typ:"C"},{crd:"TMM",fct:"U",rty:"C",set:5,typ:"C"},{crd:"TRA",fct:"A",rty:"R",set:5,typ:"C"},{crd:"TRS",fct:"U",rty:"R",set:5,typ:"C"},{crd:"TRV",fct:"T",rty:"R",set:5,typ:"C"},{crd:"TRW",fct:"N",rty:"R",set:5,typ:"C"},{crd:"TBB",fct:"T",rty:"R",set:4,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:"TXB",fct:"U",rty:"R",set:5,typ:"S"},{crd:"TXS",fct:"U",rty:"C",set:1,typ:"S"},{crd:"TCG",fct:"T",rty:"C",set:2.1,typ:"S"},{crd:"TWT",fct:"A",rty:"C",set:3,typ:"C"},{crd:"TRN",fct:"T",rty:"H",set:2,typ:"S"},{crd:"TGK",fct:"U",rty:"R",set:4,typ:"C"},{crd:"TSL",fct:"U",rty:"H",set:3,typ:"C"},{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:"UEM",fct:"T",rty:"C",set:4,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:"UIW",fct:"A",rty:"L",set:4,typ:"C"},{crd:"URS",fct:"U",rty:"C",set:5,typ:"S"},{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:"VIK",fct:"N",rty:"L",set:5.2,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:"VTW",fct:"A",rty:"R",set:4,typ:"C"},{crd:"VGN",fct:"N",rty:"C",set:1,typ:"C"},{crd:"VND",fct:"U",rty:"R",set:4,typ:"C"},{crd:"VNF",fct:"U",rty:"R",set:1.1,typ:"C"},{crd:"VNS",fct:"U",rty:"H",set:2,typ:"C"},{crd:"VSK",fct:"U",rty:"C",set:4,typ:"S"},{crd:"VCH",fct:"U",rty:"H",set:4.1,typ:"S"},{crd:"VGR",fct:"U",rty:"C",set:2,typ:"S"},{crd:"VGL",fct:"N",rty:"R",set:5,typ:"S"},{crd:"VOB",fct:"T",rty:"R",set:4,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:"WMC",fct:"A",rty:"H",set:5,typ:"C"},{crd:"WMR",fct:"A",rty:"H",set:2.1,typ:"C"},{crd:"WTK",fct:"A",rty:"H",set:4,typ:"C"},{crd:"WMM",fct:"A",rty:"H",set:1,typ:"C"},{crd:"WTW",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WTA",fct:"U",rty:"L",set:4,typ:"C"},{crd:"WWP",fct:"U",rty:"H",set:1.1,typ:"C"},{crd:"WWR",fct:"U",rty:"C",set:3,typ:"C"},{crd:"WOD",fct:"U",rty:"R",set:4,typ:"S"},{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:"WSE",fct:"T",rty:"L",set:5.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:"ZXR",fct:"T",rty:"H",set:5,typ:"C"},{crd:"XCR",fct:"N",rty:"C",set:2,typ:"C"},{crd:"XDH",fct:"N",rty:"R",set:3,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:"XTR",fct:"N",rty:"H",set:5.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:"ZMT",fct:"N",rty:"C",set:3,typ:"C"},{crd:"ZSH",fct:"T",rty:"L",set:1,typ:"C"}],_e=[["ASQ",["SLG","SLG"]],["CGL",["CGF"]],["DHC",["DYF"]],["DTD",["TOT"]],["FGD",["FGA","FGB","FGG"]],["IBA",["AVB"]],["IZK",["IFL","IFR"]],["RHU",["RSC"]],["SLS",["MMY"]],["TSL",["FUN"]],["WHR",["WHC"]]];class tr{raw={["C"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0},["S"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0}};addStat(t,e){this.raw[t][e]++}g(t,e){return this.raw[t][e]}typeSum(t){return Te.map(e=>this.g(t,e)).reduce((e,r)=>e+r,0)}getTotal(){const t=this.typeSum("C"),e=this.typeSum("S");return[t,e,t+e]}getFactTotal(t){const e=this.g("C",t),r=this.g("S",t);return[e,r,e+r]}}const l=(n,t)=>({card:n,num:t}),pr={name:"Official 1 - 3",id:"SBE1",decks:[{name:"Alloyin Starter",factions:["A"],cards:[l("SYO",1),l("BSS",1),l("SFT",2),l("SNP",2),l("TSM",2),l("SSS",2),l("ALG",2),l("MXW",3),l("TUP",3),l("FPS",3),l("MND",3),l("IWC",3),l("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[l("SFS",1),l("GGD",1),l("FFD",3),l("EPD",2),l("CCR",2),l("HGS",2),l("DSS",2),l("BWK",2),l("GBG",3),l("DSK",3),l("GRP",3),l("VGN",3),l("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[l("FBC",1),l("RBH",1),l("CFB",3),l("FSM",2),l("FSH",2),l("FSS",2),l("PMS",2),l("RFL",2),l("UBL",3),l("WPD",3),l("SGI",3),l("AMY",3),l("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[l("UPM",1),l("EHW",1),l("FRR",3),l("SPD",2),l("HTP",2),l("LSS",2),l("SDR",2),l("SRD",2),l("FWR",3),l("DBP",3),l("GHT",3),l("GSS",3),l("TXS",3)]},{name:"Cruel Corrosion",factions:["A","N"],cards:[l("IHA",1),l("WBG",1),l("OXP",1),l("DFR",1),l("APM",1),l("SNP",1),l("GRM",2),l("ETN",2),l("DHW",2),l("OXM",2),l("AEN",2),l("ATG",2),l("CTI",2),l("CTW",2),l("FPS",2),l("GRW",2),l("MTT",2),l("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[l("ZTU",1),l("VRP",1),l("GGP",1),l("EPD",1),l("DBT",1),l("BSM",1),l("TDW",2),l("NGT",2),l("UBL",2),l("FWK",2),l("BZD",2),l("CSB",2),l("SLH",2),l("MMH",2),l("LSK",2),l("GBG",2),l("CFG",2),l("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[l("TDS",1),l("SSR",1),l("FRR",1),l("ULR",1),l("UTR",1),l("BTM",1),l("UGL",2),l("EHN",2),l("SPD",2),l("GHB",2),l("FLN",2),l("SML",2),l("RFL",2),l("OXS",2),l("UTM",2),l("TWG",2),l("ENR",2),l("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[l("CSW",1),l("SMD",1),l("FRR",1),l("UIC",1),l("CFB",1),l("UGL",2),l("FSH",2),l("FLN",2),l("WPD",1),l("TWG",2),l("TCG",2),l("TGS",2),l("SML",2),l("SVH",1),l("SCL",2),l("RTS",1),l("FWB",2),l("ENR",2),l("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[l("IMA",1),l("GMP",1),l("OXA",1),l("EPD",1),l("OJC",1),l("ESU",2),l("OXM",2),l("MMA",2),l("SAP",1),l("AFO",2),l("GBG",2),l("CTW",2),l("SRH",1),l("TSM",2),l("SLH",1),l("MTT",1),l("DCR",1),l("DFB",1),l("BSR",1),l("LGT",1),l("XRF",2),l("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[l("SBG",1),l("NSH",1),l("FFU",1),l("EWE",1),l("BFM",1),l("WBH",1),l("UWS",1),l("TGI",2),l("RFL",2),l("GRM",1),l("ASG",1),l("YWC",2),l("XRF",2),l("WPD",2),l("WCS",2),l("WBU",2),l("TCG",1),l("FSK",1),l("SLH",2),l("CFG",1),l("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[l("URB",1),l("AGK",1),l("ESP",1),l("FRR",1),l("NXT",1),l("ALG",1),l("FGB",1),l("PHS",2),l("TUP",1),l("EWT",2),l("PTR",1),l("VBK",1),l("AGC",1),l("AEN",2),l("ETN",1),l("FPS",2),l("MXW",2),l("GHT",1),l("TWG",2),l("SNB",1),l("SML",1),l("JPK",1),l("ENR",1),l("IWC",1)]},{name:"Spare Parts",factions:["N"],cards:[l("SEV",1),l("SHG",1),l("TPG",1),l("CGL",1),l("FRV",1),l("HFA",2),l("XDH",1),l("GRM",1),l("SCV",1),l("DFB",2),l("EBW",2),l("GBG",2),l("GLF",2),l("XHS",2),l("SOT",1),l("XRF",2),l("SCS",1),l("ZMT",1),l("SLH",1),l("VYE",1),l("XCR",2),l("XHU",1)]},{name:"Future Forged",factions:["A"],cards:[l("NXA",1),l("IMD",1),l("FOL",1),l("SFA",2),l("SFT",1),l("SCD",1),l("CAG",1),l("ESU",1),l("NNS",1),l("FPM",1),l("PRI",1),l("SSS",1),l("CTG",1),l("TSM",2),l("IWC",1),l("MMA",2),l("TGN",2),l("MTT",1),l("SKG",1),l("AFO",1),l("MMV",1),l("TWS",1),l("SBA",2),l("SSK",1),l("JPK",1)]},{name:"Burning Rage",factions:["T"],cards:[l("ROK",1),l("KKK",1),l("MOE",1),l("AFR",1),l("FBI",1),l("FSS",2),l("FLN",2),l("CCT",2),l("BRN",2),l("WPD",2),l("SSM",2),l("SOK",1),l("RTS",2),l("FSK",2),l("CWK",2),l("CFG",2),l("BSW",2),l("FMS",2)]},{name:"Awakened Fury",factions:["U"],cards:[l("DZD",1),l("SSE",1),l("BTR",1),l("TSL",1),l("MPH",1),l("CDT",1),l("DYB",1),l("BTH",2),l("TMG",2),l("BWD",2),l("RHY",2),l("SBD",2),l("GMR",2),l("STS",1),l("OSL",2),l("SBI",2),l("LYS",2),l("TGS",2),l("SOD",2)]}]},yr={name:"Official 4",id:"SBE2",decks:[{name:"Titan's Assault",factions:["N","T"],cards:[l("ATT",1),l("TNL",1),l("RSE",1),l("SPH",1),l("SCV",2),l("ABB",2),l("TBB",2),l("BRN",2),l("FLN",2),l("CMF",2),l("XDH",2),l("FST",2),l("TAB",2),l("MDE",2),l("FSK",2),l("FLH",2),l("CBB",2)]},{name:"Verdant Fortress",factions:["A","U"],cards:[l("NGQ",1),l("RHU",1),l("VCH",1),l("ESG",1),l("PLW",2),l("NNS",2),l("SND",2),l("WOD",2),l("IBR",2),l("BWD",2),l("SBI",2),l("RWC",2),l("TEX",2),l("SER",2),l("SWG",2),l("SCC",2),l("DYB",2)]},{name:"Umbruk Uprising",factions:["T","U"],cards:[l("LUC",1),l("BWT",1),l("GHR",1),l("TSP",1),l("WBH",1),l("COD",1),l("SDR",1),l("ZPM",1),l("OXS",1),l("WOD",1),l("RWC",2),l("SSG",2),l("VGR",2),l("CFG",2),l("UEM",2),l("FFG",2),l("UGL",2),l("DMR",2),l("RTS",2),l("CWK",2)]},{name:"Onyxium Twilight",factions:["A","N"],cards:[l("EPH",1),l("DTD",1),l("POX",1),l("DDS",1),l("OHV",1),l("PHS",1),l("DFB",1),l("TDW",1),l("CAG",1),l("ALG",1),l("TUP",2),l("CTW",2),l("XCR",2),l("SSK",2),l("SRH",2),l("ATG",2),l("MTT",2),l("SLH",2),l("GLF",2),l("AFO",2)]}]},br={name:"Set 1 & 2 Tournies",id:"T1309",decks:[{name:"Axel: Lifegain",factions:["T","U"],cards:[l("AGD",3),l("EHW",3),l("FRR",3),l("FIN",1),l("UPM",1),l("LKP",2),l("BTM",2),l("LBL",3),l("GSS",3),l("RFA",3),l("GHB",3),l("EFP",3)]},{name:"Derk: Metaminds",factions:["A"],cards:[l("OJC",3),l("DMW",3),l("MMV",3),l("JPK",3),l("MMO",3),l("GMP",3),l("ALS",3),l("MMA",3),l("SFA",3),l("BTN",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[l("DBP",3),l("EHW",2),l("FRR",3),l("FWT",3),l("UPM",3),l("LKP",2),l("BTM",3),l("HTR",2),l("LBD",2),l("RFA",3),l("GHB",2),l("SDR",2)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[l("ALS",3),l("TDS",3),l("FRR",3),l("WWP",3),l("SML",2),l("BSG",3),l("JPK",2),l("ODC",3),l("NXT",2),l("WMM",3),l("GHB",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[l("SCS",3),l("ROG",1),l("GGP",1),l("GGD",3),l("WFS",1),l("DSS",3),l("ZTU",1),l("GBG",3),l("HFA",3),l("EXD",1),l("EPD",1),l("BSR",1),l("MRF",2),l("HGS",3),l("GTH",3)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[l("SHK",3),l("MOE",3),l("FRR",3),l("LSK",3),l("FFU",3),l("UBL",3),l("WWS",3),l("FSS",3),l("ENR",3),l("MMH",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[l("DBP",2),l("EHW",2),l("FRR",3),l("HTP",2),l("UPM",3),l("LKP",2),l("GHT",3),l("GGP",2),l("LBD",1),l("EPD",2),l("DBT",2),l("SPD",3),l("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[l("IWC",3),l("FSS",3),l("ETN",1),l("WPD",2),l("FSM",1),l("AHL",1),l("UBL",3),l("SMD",2),l("BTN",3),l("LSK",1),l("MMH",3),l("FFU",1),l("TSM",3),l("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[l("DSS",3),l("FSS",3),l("EPD",2),l("GTH",3),l("FSM",1),l("MOE",1),l("UBL",3),l("GGP",3),l("GBG",1),l("LSK",3),l("HGS",1),l("CTW",1),l("SHK",3),l("GGD",1),l("DBT",1)]}]},Ar={name:"The Forge",id:"TG10",decks:[{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[l("BWK",3),l("TDS",2),l("FRR",3),l("WWP",3),l("GGP",3),l("GGD",3),l("DBT",1),l("WFS",3),l("CTW",3),l("EPD",3),l("GHB",3)]},{name:"ErrorAsh: Burn",factions:["N","T"],cards:[l("UBL",2),l("EFM",2),l("FBI",3),l("ESK",3),l("FLN",3),l("EFP",3),l("MOE",3),l("FSS",3),l("SHK",3),l("EPD",3),l("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[l("WWS",3),l("DYB",3),l("FRR",3),l("SYL",3),l("EPD",3),l("SSE",2),l("NSH",2),l("TDW",3),l("NFF",2),l("CHR",2),l("LKP",2),l("EXD",2)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[l("NSH",2),l("SMD",2),l("DDD",3),l("TDW",3),l("VRP",3),l("WCS",3),l("BSM",3),l("SHG",2),l("TGI",2),l("EPD",3),l("FVA",2),l("DBT",1),l("TRN",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[l("UWL",3),l("FFU",3),l("WBY",3),l("UIM",3),l("WBU",3),l("SSR",1),l("TRN",1),l("GTT",1),l("GCR",3),l("FRR",3),l("UBL",3),l("WWP",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[l("DDD",3),l("DBT",3),l("EPD",3),l("EFP",3),l("GGP",3),l("LSK",3),l("SHK",3),l("UBL",3),l("WCS",3),l("ZTU",3)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[l("XSH",3),l("SPM",3),l("FRR",3),l("ODC",3),l("SSE",3),l("ESK",3),l("TGS",3),l("XRF",3),l("VRP",3),l("URB",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[l("RBH",3),l("TDS",3),l("FRR",3),l("WWP",3),l("EFP",3),l("AMY",2),l("FVA",2),l("ENR",3),l("ZSH",3),l("EHW",3),l("GHB",2)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[l("BWK",2),l("KOD",2),l("CYC",3),l("GRM",3),l("VYE",3),l("XRW",3),l("MOE",2),l("ZTU",3),l("BSM",3),l("EPD",3),l("DSS",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[l("AGM",3),l("TDS",2),l("FRR",3),l("WWP",3),l("CSW",3),l("FLN",3),l("EFP",2),l("UWL",3),l("WBY",2),l("WCS",2),l("EHW",2),l("SHS",2)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[l("UHS",2),l("FLN",3),l("STG",3),l("CRC",3),l("SHK",3),l("EFP",2),l("WMR",2),l("WMM",3),l("JPK",3),l("SMD",3),l("FVA",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[l("LSK",2),l("WBG",3),l("EPD",3),l("DDD",3),l("SHK",3),l("EFP",3),l("ZTU",2),l("GGD",2),l("GGP",3),l("CTW",3),l("DBT",3)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[l("DMW",3),l("GMP",3),l("MMA",3),l("MMV",2),l("TDW",3),l("VRP",3),l("EPD",3),l("SHG",2),l("OJC",2),l("ESK",2),l("CHV",2),l("CTW",2)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[l("CTW",1),l("GCR",1),l("CFG",1),l("FZS",1),l("FBI",3),l("MOE",3),l("EFP",3),l("LSK",3),l("FLN",3),l("SHK",3),l("RTS",3),l("GGP",3),l("UBL",2)]}]},kr={name:"Set 1 Fundecks",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[l("DFB",3),l("BSR",3),l("HGS",3),l("HFA",3),l("FFD",3),l("XSH",3),l("XHU",3),l("WBG",3),l("GBG",3),l("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[l("TBA",3),l("SVH",3),l("MBP",2),l("FSH",3),l("RBH",3),l("FBC",3),l("LBR",2),l("CFB",3),l("AAK",3),l("KKK",2),l("FRR",1),l("FIN",1),l("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[l("MMA",3),l("DMW",3),l("GMP",3),l("SYO",3),l("KAW",3),l("SHK",3),l("CTL",2),l("CAG",2),l("MSC",2),l("MTS",2),l("ASG",2),l("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[l("CTV",3),l("TDW",3),l("BTS",3),l("CHR",3),l("GMR",3),l("KOD",2),l("LKP",2),l("SHV",2),l("DBA",2),l("CCR",2),l("PTB",2),l("FIN",1),l("DBT",2)]},{name:"Voltron",factions:["A"],cards:[l("FGA",3),l("FGB",3),l("FGD",3),l("FGG",3),l("AFS",3),l("BSS",3),l("PRI",3),l("TUP",2),l("JPK",2),l("BWH",2),l("SFT",3)]},{name:"Do Fear The Reaper",factions:["A","N"],cards:[l("CTI",3),l("DFR",3),l("GRW",3),l("LGT",3),l("OXM",3),l("OXP",3),l("PHM",3),l("CTW",2),l("NNS",2),l("OXA",2),l("SDN",3)]},{name:"Muadib",factions:["N","U"],cards:[l("DBA",3),l("DYL",3),l("GSW",3),l("LBD",3),l("MMW",3),l("NCW",3),l("SRV",3),l("LBL",2),l("MSP",2),l("VYE",2),l("SBD",3)]},{name:"Triassic Park",factions:["T","U"],cards:[l("URB",3),l("UTR",3),l("UTM",3),l("ULR",3),l("UIC",3),l("UGL",3),l("RTS",3),l("BRN",2),l("LBR",2),l("IBF",2),l("GHB",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[l("DDD",3),l("WBH",3),l("HMF",3),l("WCS",3),l("GGP",3),l("SAD",3),l("SDN",3),l("EWE",3),l("SBG",3),l("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[l("WWP",3),l("EHN",2),l("SDR",2),l("HTR",2),l("MML",2),l("HTP",2),l("SHS",3),l("MND",2),l("NXC",2),l("CDT",2),l("PTB",2),l("SVO",2),l("MPH",2),l("SYO",2)]},{name:"Braaiins",factions:["N"],cards:[l("XDV",3),l("XRW",3),l("ONN",2),l("SLH",2),l("FWK",2),l("BWK",2),l("URD",2),l("TPG",2),l("DSS",2),l("KOD",2),l("ZMT",2),l("RSZ",2),l("BLW",2),l("CSB",2)]},{name:"Wanderin",factions:["N","U"],cards:[l("LYS",3),l("STR",2),l("MBP",2),l("OSL",2),l("RLW",3),l("SSR",1),l("SVO",2),l("SSE",2),l("RHW",3),l("SYL",2),l("TGS",2),l("TMG",3),l("XDH",3)]},{name:"Walls",factions:["A","T"],cards:[l("CDC",3),l("CTG",3),l("CRC",3),l("DCS",3),l("FRI",3),l("FGA",2),l("OBB",3),l("FVA",2),l("TGN",2),l("OWH",3),l("STN",3)]},{name:"Snakes In A Lane",factions:["A","U"],cards:[l("AFO",3),l("DSV",3),l("PSC",3),l("SHS",3),l("STO",3),l("NCL",2),l("VNF",3),l("LYS",2),l("SVO",1),l("VNS",3),l("TXS",2),l("ART",2)]},{name:"Benny & Izzy",factions:["A","T"],cards:[l("BRN",3),l("EFM",2),l("IZK",3),l("JPK",1),l("MTT",1),l("NNS",1),l("OBB",2),l("OWF",2),l("OEX",3),l("PRI",2),l("PTR",1),l("TST",1),l("FLS",2),l("BLH",3),l("SHK",3)]}]},fe=[pr,yr,br,Ar,kr];class Se{state;constructor(t){this.state=t}getState(){return this.state}get adjacent(){return f.adjacentPositions(this.lane)}get attack(){return this.state.attack+this.modSum("AT")}get activationAvailable(){return this.state.negateActivate?!1:this.state.activationAvailable}set activationAvailable(t){this.state.activationAvailable=t}get aggressive(){return this.state.aggressive||this.modBool("AG")}set aggressive(t){this.state.aggressive=t}get armor(){return this.negateArmor?0:this.state.armor+this.modSum("AR")}get armorDmg(){return this.state.armorDmg}set armorDmg(t){this.state.armorDmg=t}get 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 I.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 I.getCard(this.code).isTribe(t)}get lane(){return this.state.lane}get level(){return I.getCard(this.code).level}get maxHealth(){return this.state.maxHealth+this.modSum("MH")}get mobility(){return this.negateMobility?0:this.state.mobility+this.modSum("MB")}get mobilityAvailable(){return this.state.mobilityAvailable}set mobilityAvailable(t){this.state.mobilityAvailable=t}get mods(){return this.state.mods}get negateActivate(){return this.state.negateActivate}set negateActivate(t){this.state.negateActivate=t}get negateArmor(){return this.state.negateArmor||this.modBool("NA")}set negateArmor(t){this.state.negateArmor=t,this.enforceEffects("AR")}get negateDefender(){return this.state.negateDefender||this.modBool("ND")}set negateDefender(t){this.state.negateDefender=t,this.enforceEffects("DF")}get negateMobility(){return this.state.negateMobility||this.modBool("NM")}set negateMobility(t){this.state.negateMobility=t}get negateRegen(){return this.state.negateRegen||this.modBool("NM")}set negateRegen(t){this.state.negateRegen=t}get opposed(){const t=p.crTarg();return t.player=k.toTarget(!this.owner),t.lanes=f.oppositeLane(this.lane),f.creatByTarget(t)[0]}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get rank(){return k.toPlayer(this.owner).rank}get regen(){return this.negateRegen?0:this.state.regen+this.modSum("RG")}get sleeping(){return this.state.sleeping}set sleeping(t){this.state.sleeping=t}get status(){return this.state.status}set status(t){this.state.status=t}get triggers(){return this.state.triggers}buff(t,e,r=void 0){t!==0&&(this.state.attack+=t,this.enforceEffects("AT")),e!==0&&(this.state.health+=e,this.state.maxHealth+=e,this.enforceEffects("CH"),O.deathProdder(this,r),e>0&&x.addEvents(W.creatHeal(this,e)))}addArmor(t){if(!this.negateArmor){const e=this.state.armor+t;this.state.armor=Math.max(0,e),this.enforceEffects("AR")}}addMobility(t){if(!this.negateMobility){const e=this.state.mobility+t;this.state.mobility=Math.max(0,e)}}addPoison(t){const e=this.state.poison+t;this.state.poison=Math.max(0,e)}addRegen(t){if(!this.negateRegen){const e=this.state.regen+t;this.state.regen=Math.max(0,e)}}heal(t){if(t===0)return 0;const e=Math.min(this.health+t,this.maxHealth)-this.health;return this.state.health+=e,this.enforceEffects("CH"),x.addEvents(W.creatHeal(this,e)),e}setHealth(t){this.state.health=t}hurt(t,e=!1){if(t<1)return[0,0];const r=Math.max(Math.min(t,this.armor-this.armorDmg),0);let s=t-r,h=this.health-s;this.state.armorDmg+=r;let u=0;return e&&h<0&&(u=s-this.health,s=this.health),s>0&&(this.state.health-=s,this.enforceEffects("CH")),[s,u]}hurtBattle(t,e,r=!1){const s=this.hurt(t,r);return s[0]>0&&x.addEvents(W.damage(!0,s[0],!0,!0,this,e)),s[1]}hurtDirect(t,e,r=void 0){const s=this.hurt(t,!1);return s[0]>0&&(m.new().crd(e).txt(` dealt ${t} dmg to `).crd(this.code).txt(".").go(),x.addEvents(W.damage(!1,s[0],!1,!0,this,void 0)),O.deathProdder(this,r)),s[0]}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),O.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF")}modSum(t){return p.modSum(this.mods,t)}modBool(t){return p.modBool(this.mods,t)}hasMod(t){return p.hasModG(this.mods,t)}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){p.hasMod(this.mods,t)||this.addMod(t)}removeMod(t){const e=this.state.mods.filter(r=>r.granter===t);this.state.mods=this.state.mods.filter(r=>r.granter!==t),e.forEach(r=>{this.modEffectPropagator(r),r.type==="AR"&&(this.state.armorDmg=Math.max(0,this.state.armorDmg-r.value))})}removeModSafe(t){this.hasMod(t)&&this.removeMod(t)}expireMod(t){this.state.mods.splice(p.modIdx(this.state.mods,t),1)}endActivation(){this.modBool("EA")?this.removeMod(this.id):this.state.activationAvailable=!1,O.deathCheck(),v.actionDone()}move(t){this.state.lane=t,te.positionChange(this.owner),x.addEvents(W.creature("MOV",this))}addEffect(t,e){const r=p.effect(t,e);return this.effects.push(r),r}enforceEffects(t,e=!1){this.effects.filter(r=>r.watch===t).filter(r=>r.area==="A"||r.area==="C"&&this.owner===e).forEach(r=>I.getCard(r.logicCode).enforceEffect(r,this))}jr4(t,e){const r=p.trigger(t,e);return r.cardCode=this.code,r.creatId=this.id,this.triggers.push(r),r}removeTrigger(t){const e=p.trigIdx(this.triggers,t);e>-1?this.triggers.splice(e,1):console.error("Wery curious, could not find trigger to remove",t)}wipeAll(){this.state.mods=[],this.state.triggers=[],this.state.effects=[],this.state.hints=[],this.state.armor=0,this.state.mobility=0,this.state.poison=0,this.state.regen=0,this.state.aggressive=!1,this.state.defender=!1,this.state.breakthrough=!1,this.state.defender=!1,this.state.negateDefender=!1,this.state.negateArmor=!1,this.state.bonus=0,this.state.changed=!0,this.state.negateActivate=!0,f.creatByTarget(p.crTarg()).forEach(t=>{t.removeMod(this.id),t.enforceEffects("PS",this.owner)}),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),te.defenderChange(this.owner)}get hints(){return this.state.hints}aiHints(){return this.hints}}class p{static creatureState(t,e){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,bonus:0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:e,maxHealth:0,mobility:0,mobilityAvailable:!0,mods:[],negateActivate:!1,negateArmor:!1,negateDefender:!1,negateMobility:!1,negateRegen:!1,owner:t,poison:0,regen:0,sleeping:!0,status:"A",triggers:[]}}static effect(t,e){return{area:"A",watch:t,logicCode:e}}static freeCard(t){return{id:N.genId(),condition:p.target("TH"),sourceCard:t}}static mod(t,e,r=""){return{type:t,value:typeof e=="boolean"?e?1:0:e,granter:r,expiry:"NN"}}static trigger(t,e){return{id:N.genId(),type:t,logicCode:e,cardCode:"",creatId:"",customCode:"",interactive:!1,changes:!1}}static triggerReaction(t,e,r,s){return{event:t,owner:r,creatId:"",cardCode:"",trigger:e,host:s}}static basicAction(t){return{zone:"N",key:t,host:"",param:""}}static fieldSelectAction(t,e=-1,r=!0){return{zone:"F",key:t,playerA:r,lane:e,host:"",param:""}}static deckSelectAction(t,e,r){return{zone:"N",key:t,card:e,position:r,host:"",param:""}}static handSelectAction(t,e="",r="",s=-1){return{zone:"H",key:t,card:e,cost:r,position:s,host:"",param:""}}static playerSelectAction(t,e){return{zone:"P",key:t,playerA:e,host:"",param:""}}static draftSelectAction(t,e,r){return{zone:"N",key:t,index:e,pack:r,host:"",param:""}}static ddf4(){return{zone:"N",key:"ACTV",host:"",param:""}}static menuButtonAction(t){return{zone:"N",key:"MNBT",host:"",param:t}}static actionifier(t,e,r,s){const h=t;return h.key=e,h.host=r,h.param=s,h}static target(t){return{target:t,level:"LA",canLevel:!1,faction:"X",player:"X",card:"A",field:"A",creatStatus:"A",tribe:"AN",notMe:"",hasArmor:!1,canArmor:!1,hasDefender:!1,canDefender:!1,hasMobility:!1,canMove:!1,hasPoison:!1,hasRegen:!1,canRegen:!1,cardCode:"",victims:""}}static actionTarget(t,e,r,s){return p.actionifier(p.target(t),e,r,s)}static crTarg(){const t=p.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,e,r){return p.actionifier(p.crTarg(),t,e,r)}static crNotMeTarg(t){const e=p.target("TF");return e.field="O",e.creatStatus="V",e.notMe=t,e}static crNotMeActTarg(t,e,r,s){return p.actionifier(p.crNotMeTarg(e),t,r,s)}static crFriendTarg(){const t=p.crTarg();return t.player="F",t}static crFriendActTarg(t,e,r){return p.actionifier(p.crFriendTarg(),t,e,r)}static crFriendNotMeTarg(t){const e=p.crNotMeTarg(t);return e.player="F",e}static crFriendNotMeActTarg(t,e,r,s){return p.actionifier(p.crFriendNotMeTarg(e),t,r,s)}static crEnemyTarg(){const t=p.crTarg();return t.player="E",t}static crEnemyActTarg(t,e,r){return p.actionifier(p.crEnemyTarg(),t,e,r)}static playerTarg(t){const e=p.target("TP");return e.player=k.toTarget(t),e}static playerActTarg(t,e,r,s){return p.actionifier(p.playerTarg(t),e,r,s)}static lvlHandActTarg(t,e){const r=this.actionTarget("TH","CARD",t,e);return r.player="F",r.canLevel=!0,r.hint=["CD"],r}static emptyTarg(){const t=p.target("TF");return t.field="E",t}static emptyActTarg(t,e,r){return p.actionifier(p.emptyTarg(),t,e,r)}static emptyPlayerTarg(t){const e=p.emptyTarg();return e.player=k.toTarget(t),e}static emptyPlayerActTarg(t,e,r,s){return p.actionifier(p.emptyPlayerTarg(t),e,r,s)}static modSum(t,e){return t.filter(r=>r.type===e).map(r=>r.value).reduce((r,s)=>r+s,0)}static modBool(t,e){return t.some(r=>r.type===e&&r.value===1)}static hasModG(t,e){return t.findIndex(r=>r.granter===e)>-1}static hasMod(t,e){return p.modIdx(t,e)>-1}static modIdx(t,e){return t.findIndex(r=>r.granter===e.granter&&r.type===e.type)}static trigIdx(t,e){return t.findIndex(r=>r.id===e.id)}}class St{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return St.extractCardCode(this.code)}image(t){return this.type==="S"?this.fixedImage(t):this.leveledImage(t)}leveledImage(t){return this.rawImage(this.code,t)}fixedImage(t){return this.rawImage(this.cardCode(),t)}rawImage(t,e){return`card/${e?"b":"s"}/${this.faction}/${t}.jpg`}isFree=!1;level;maxLevel=3;minLevel=1;name="";overload=!1;rarity="T";spice;text="";get type(){return "C"}hints;addSp(t,e){}aiHints(){return this.hints??[]}bonus;bonusPlay(){return this?.bonus?.play??0}bonusExist(){return this?.bonus?.exist??0}canLevel(){return this.level{h+=s[g]*r[0][g],u+=s[g]*r[1][g]}),[h,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 boof3915(){return this.lValN([3,9,15])}get boof468(){return this.lValN([4,6,8])}get boof469(){return this.lValN([4,6,9])}get boof4610(){return this.lValN([4,6,10])}get boof4612(){return this.lValN([4,6,12])}get boof4710(){return this.lValN([4,7,10])}get boof4711(){return this.lValN([4,7,11])}get boof4712(){return this.lValN([4,7,12])}get boof4713(){return this.lValN([4,7,13])}get boof4714(){return this.lValN([4,7,14])}get boof4812(){return this.level*4}get boof4812n(){return this.level*-4}get boof4813(){return this.lValN([4,8,13])}get boof4814(){return this.lValN([4,8,14])}get boof4815(){return this.lValN([4,8,15])}get boof4816(){return this.lValN([4,8,16])}get boof4914(){return this.lValN([4,9,14])}get boof4915(){return this.lValN([4,9,15])}get boof579(){return this.lValN([5,7,9])}get boof5711(){return this.lValN([5,7,11])}get boof5714(){return this.lValN([5,7,14])}get boof5812(){return this.lValN([5,8,12])}get boof5813(){return this.lValN([5,8,13])}get boof5814(){return this.lValN([5,8,14])}get boof5815(){return this.lValN([5,8,15])}get boof5914(){return this.lValN([5,9,14])}get boof5915(){return this.lValN([5,9,15])}get boof5916(){return this.lValN([5,9,16])}get boof5917(){return this.lValN([5,9,17])}get boof51014(){return this.lValN([5,10,14])}get boof51015(){return this.level*5}get boof51020(){return this.lValN([5,10,20])}get boof6812(){return this.lValN([6,8,12])}get boof6814(){return this.lValN([6,8,14])}get boof6912(){return this.lValN([6,9,12])}get boof6914(){return this.lValN([6,9,14])}get boof6915(){return this.lValN([6,9,15])}get boof6916(){return this.lValN([6,9,16])}get boof61014(){return this.lValN([6,10,14])}get boof61015(){return this.lValN([6,10,15])}get boof61016(){return this.lValN([6,10,16])}get boof61017(){return this.lValN([6,10,17])}get boof61018(){return this.lValN([6,10,18])}get boof61117(){return this.lValN([6,11,17])}get boof61218(){return this.lValN([6,12,18])}get boof61224(){return this.lValN([6,12,24])}get boof7911(){return this.lValN([7,9,11])}get boof7914(){return this.lValN([7,9,14])}get boof71013(){return this.lValN([7,10,13])}get boof71014(){return this.lValN([7,10,14])}get boof71015(){return this.lValN([7,10,15])}get boof71116(){return this.lValN([7,11,16])}get boof71117(){return this.lValN([7,11,17])}get boof71118(){return this.lValN([7,11,18])}get boof81116(){return this.lValN([8,11,16])}get boof81117(){return this.lValN([8,11,17])}get boof81217(){return this.lValN([8,12,17])}get boof81220(){return this.lValN([8,12,20])}get boof81318(){return this.lValN([8,13,18])}get boof91420(){return this.lValN([9,14,20])}get boof91421(){return this.lValN([9,14,21])}get boof101520(){return this.lValN([10,15,20])}get boof255080(){return this.lValN([25,50,80])}}class P extends St{constructor(t){super(t)}iHealth=0;iAttack=0;iAggro=!1;iArmor=0;iBT=!1;iDefend=!1;iMobile=0;iRegen=0;tribe=[];isTribe(t){return(Array.isArray(t)?t:[t]).every(r=>this.tribe.includes(r))}jr3(t,e){const r=p.creatureState(t,e);return r.id=N.genId(),r.code=this.code,r.health=this.iHealth,r.attack=this.iAttack,r.maxHealth=r.health,r.regen=this.iRegen,r.breakthrough=this.iBT,r.defender=this.iDefend,r.aggressive=this.iAggro,r.armor=this.iArmor,r.mobility=this.iMobile,r.hints=this.aiHints(),r.bonus=this.bonusExist(),new Se(r)}playTargets(){const t=super.playTargets(),e=p.actionTarget("TF","FORG",this.code,"");return e.player="F",t.push(e),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}addExtraActivate(t){const e=p.mod("EA",!0,t.id);e.expiry="ET",t.addMod(e)}}class yt extends St{constructor(t){super(t)}get type(){return "S"}logSpell(t=void 0,e=void 0){let r=m.new().txt("Casted ").crd(this.code);t&&(r=r.txt(" on ").crd(t.code),e&&(r=r.txt(" and ").crd(e.code))),r.txt(".").go()}}class Jt{paStats;pbStats;constructor(t,e){this.paStats=t,this.pbStats=e}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const e=this.playerStats(t),r=this.playerStats(!t);return Jt.deltafier(e,r)}static deltafier(t,e){const r=Jt.blankStats(!0);return r.creatCount=t.creatCount-e.creatCount,r.creatValue=t.creatValue-e.creatValue,r.threatValue=t.threatValue-e.threatValue,r.playerHealth=t.playerHealth-e.playerHealth,r}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0}}}class he{fromState(){const t=f.qActiveCreats(),r=[!0,!1].map(s=>{const h=Jt.blankStats(s),u=k.toPlayer(s);return h.playerHealth=u.health,t.filter(g=>g.owner===s).forEach(g=>{h.creatCount++,h.creatValue+=he.creatValueFormula(g);let y=0;if(!g.defender){const C=t.find($=>$.owner!==g.owner&&$.lane===6-g.lane);let D=0;if(C?g.breakthrough&&(D=g.attack-C.health):D=g.attack,!(D<1))if(D<6)y=D;else{const $=this.scalingBonus(D);return D+(g.sleeping&&!g.aggressive?$/2:$)}}h.threatValue+=y}),h});return new Jt(r[0],r[1])}static ddp9(t,e,r,s,h=0){return he.ddp9Nugget(t,e,r,s,h)[0]}static ddp9Nugget(t,e,r,s,h=0){const u=t/4,g=e/8,y=r/5,C=s/4;return[u+g+y+C+h,u,g,y,C,h]}static creatValueFormula(t){return t.health+Math.max(0,t.attack)+t.bonus+(t.armor+Math.min(t.mobility,3)+t.regen-t.poison)*1.5}scalingBonus(t){let e=!0,r=0,s=6,h=1;const u=6;for(;e;)t>s+u?(r+=h*u,s+=u,h++):(r+=h*(t-s),e=!1);return r}weighState(t,e,r){const s=t.deltaStats(r),h=e.deltaStats(r),u=Jt.deltafier(h,s),g=u.playerHealth<0?-1:1,y=this.scalingBonus(u.playerHealth*g)*g+u.playerHealth,C=he.ddp9Nugget(u.creatCount,u.creatValue,u.threatValue,y);return{formula:C[0],fParts:C.slice(1,-1).map(D=>D.toFixed(1)),stats:[u.creatCount,u.creatValue,u.threatValue,y].map(D=>D.toFixed(1))}}}class vr{aiPlayer;constructor(t){this.aiPlayer=t}jr7(t,e=3){return`${t}${e}`}jr6(t,e){const r=S.randInt(0,e.length),s=e[r];return e.splice(r,1),f.birth(t,"F",this.aiPlayer,s)}cheatin(){const t=k.toPlayer(this.aiPlayer),e=k.toPlayer(!this.aiPlayer),r=e.health-t.health;let s=0;r>85?s=3:r>65?s=2:r>45&&(s=1);const h=f.emptyLanes(this.aiPlayer);if(s===0||h.length===0)return!1;m.new().plr(this.aiPlayer).txt(" is a cheaty cheaterton.").go();let u=0;if(s===1){if(M.regularPlays-=1,u=S.randInt(0,13),u===0)this.jr6(this.jr7("HTR"),h);else if(u===1)this.jr6(this.jr7("AGM"),h).addRegen(8);else if(u===2){const g=this.jr6(this.jr7("YNS"),h);g.buff(0,15),g.addRegen(4)}else if(u===3)this.jr6(this.jr7("TBA"),h);else if(u===4)this.jr6(this.jr7("DCS"),h);else if(u===5)this.jr6(this.jr7("GGP"),h).addRegen(8);else if(u===6){const g=this.jr6(this.jr7("WFM"),h);g.aggressive=!0}else if(u===7){const g=this.jr6(this.jr7("FFU"),h);g.aggressive=!0}else if(u===8){const g=this.jr6(this.jr7("URB"),h);g.aggressive=!0}else if(u===9){const g=this.jr6(this.jr7("KOD"),h);g.aggressive=!0,g.addRegen(6)}else if(u===10)this.jr6(this.jr7("AGK"),h).addArmor(3);else if(u===11){const g=this.jr6(this.jr7("PSC"),h);g.aggressive=!0}else if(u===12){const g=this.jr6(this.jr7("SAD"),h);g.aggressive=!0}}else if(s===2)if(M.regularPlays-=1,u=S.randInt(0,17),u===0){const g=this.jr6(this.jr7("NDR"),h);g.aggressive=!0}else if(u===1){const g=this.jr6(this.jr7("CSW"),h);g.aggressive=!0}else if(u===2)this.jr6(this.jr7("GGD"),h).addRegen(6);else if(u===3)this.jr6(this.jr7("EFP"),h);else if(u===4)this.jr6(this.jr7("ZTU"),h);else if(u===5){const g=this.jr6(this.jr7("DDD"),h);g.aggressive=!0}else if(u===6)this.jr6(this.jr7("RBH"),h).addRegen(8);else if(u===7)this.jr6(this.jr7("SFT"),h);else if(u===8)this.jr6(this.jr7("GTT"),h);else if(u===9)this.jr6(this.jr7("SMD"),h);else if(h.length===5)this.jr6(this.jr7("DFB"),h),[1,2,3,4].forEach(g=>this.jr6(this.jr7("XHS"),h));else if(h.length===4)this.jr6(this.jr7("LMV"),h);else if(h.length===3)this.jr6(this.jr7("LHY"),h),this.jr6(this.jr7("SVH"),h),this.jr6(this.jr7("DBA"),h);else if(h.length===2)this.jr6(this.jr7("UTR"),h),this.jr6(this.jr7("TDS"),h);else if(t.turn===4)this.jr6(this.jr7("SSR"),h);else if(t.turn===1)this.jr6(this.jr7("ESK"),h);else{const g=this.jr6(this.jr7("XSH"),h);g.aggressive=!0}else if(s===3)if(u=S.randInt(0,20),u===0){const g=this.jr6(this.jr7("IHA",4),h);g.aggressive=!0}else if(u===1)this.jr6(this.jr7("CHR"),h);else if(u===2)this.jr6(this.jr7("FGO",1),h);else if(u===3)this.jr6(this.jr7("CHV",4),h);else if(u===4)this.jr6(this.jr7("KKK",4),h);else if(t.health<20){const g=this.jr6(this.jr7("ODC",4),h);g.aggressive=!0}else if(h.length===5){const g=S.randInt(0,4);if(g===0)[1,2,3,4,5].forEach(y=>this.jr6(this.jr7("UWL",2),h));else if(g===1)[1,2].forEach(y=>this.jr6(this.jr7("DFB"),h)),[1,2,3].forEach(y=>this.jr6(this.jr7("FFD"),h));else if(g===2)[1,2,3,4,5].forEach(y=>this.jr6(this.jr7("BWK"),h));else if(g===3){this.jr6(this.jr7("SBG"),h),this.jr6(this.jr7("EWE"),h);const y=this.jr6(this.jr7("BMY"),h);y.defender=!0,y.aggressive=!0}}else if(e.health>350)t.health<180&&k.heal(t,180-t.health),this.jr6(this.jr7("AGD"),h);else if(e.health>250)this.jr6(this.jr7("FGO"),h);else if(h.length===4){const g=S.randInt(0,3);g===0?(this.jr6(this.jr7("AGK"),h),[1,2,3].forEach(y=>this.jr6(this.jr7("VBK"),h))):g===1?(this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("UTR"),h)):g===2&&[1,2,3,4].forEach(y=>this.jr6(this.jr7("CDC"),h))}else if(h.length===3)if(S.randInt(0,2)){this.jr6(this.jr7("SDR"),h),this.jr6(this.jr7("SDR"),h);const g=this.jr6(this.jr7("UPM"),h);g.aggressive=!0}else{this.jr6(this.jr7("SDL"),h);const g=this.jr6(this.jr7("NFF"),h);g.aggressive=!0}else if(h.length===2)this.jr6(this.jr7("SPM"),h),this.jr6(this.jr7("SPM"),h);else{const g=this.jr6(this.jr7("NXC"),h);g.buff(10,0),g.aggressive=!0,g.addMobility(2),g.addRegen(5)}return t.health<30&&k.heal(t,50-t.health),!0}}var rt=(n=>(n[n.Left=0]="Left",n[n.Both=1]="Both",n[n.Right=2]="Right",n[n.ForceRight=3]="ForceRight",n))(rt||{});class $e{action;hitTest(t,e,r){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,e,r,s){let h,u=0;const g=t.length;for(;h===void 0&&u=t&&this.originY<=e&&this.endY>=e?this.action:void 0}}class Lt extends nt{constructor(t,e,r,s,h=0){super({zone:"N",key:"BNDL",host:"",param:""},t,e,r,s,h)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,e,r){if(super.hitTest(t,e,r))return $e.arrayHit(this.childs,t,e,r)}}class Tr{guts="";txt(t){return ot.simOn||(this.guts+=t),this}plr(t){if(!ot.simOn){const e=k.toBool(t);this.guts+="^p"+(e?"a":"b")}return this}crd(t){return ot.simOn||(this.guts+="^c"+t),this}go(){ot.simOn||m.parse(this)}}class we{realPromise;resolveMe(t){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,e)=>{this.resolveMe=t,this.rejectMe=e})}}const Oe=25,er=9999,Sr=-9999,Cr=-999999,wr=["CANC","DEET","SCRH"],xr=["HPLY","ACTV","MOVE"];class Dr{log=!1;simOn=!1;dumb=!1;inPhase=!0;promStack=[];peekStack=[];peeking=!1;endCount=0;aiPlayer=!1;brdEval;rootBoardStats;turnSims=0;turnTime=0;constructor(){this.brdEval=new he,this.rootBoardStats=new Jt(Jt.blankStats(!0),Jt.blankStats(!1))}setLog(t){this.log=t}lNum(t){return t<-100?"NUNS":t>100?"KILL":t.toFixed(1)}popProm(t){this.promStack.pop().resolveMe(t)}popPeeker(t){this.peekStack.pop().resolveMe(t)}hitMainPhase(){this.dumb&&this.simOn&&this.inPhase&&M.mainBattle&&(this.inPhase=!1)}simEndpoint(t){if(this.endCount++,this.promStack.length===0)m.debug("Tried to end a sim, but no promise to unlock."),console.trace();else{let e;if(t==="T"){const r=this.brdEval.fromState();e=this.brdEval.weighState(this.rootBoardStats,r,this.aiPlayer).formula}else t==="W"?e=er:t==="L"?e=Sr:e=Cr;this.popProm(e)}}async processAction(t,e){const r=!this.simOn;let s=0,h=0,u,g=this.actionPruner(t);if(this.peeking){this.popPeeker(g);return}if(r&&this.dumb&&e&&(this.dumb=!1,m.debug("Smart Again.",!1)),this.dumb&&!this.inPhase){let D=g.filter($=>$.key==="FITE"||$.key==="ENDT");D.length>0&&(g=D)}if(r){u=new be,u.hwhipe();const D=g.map((pt,ct)=>u.drawAiGear(ct,!1));await Promise.all(D),await new Ee().drawActions([]),await S.sleep(Oe),this.simOn=!0,s=Date.now(),this.rootBoardStats=this.brdEval.fromState(),this.endCount=0;const K=await this.peeker(g),_=[];let z=0,tt=0;K.forEach(pt=>{z+=pt.peek.length,pt.free&&tt++,pt.wasPeek&&pt.peek.some(ct=>this.hasHint(ct,"DF"))&&_.push(pt.root)}),_.length>0?(g=_,this.dumb=!0,m.debug("Do firsts; dumb mode. Action count "+g.length,!1)):M.regularPlays+tt>3?(this.dumb=!0,m.debug("4+ plays; dumb mode. Peek was "+z,!1)):k.getActive().hand.length>7?(this.dumb=!0,m.debug("8+ in hand; dumb mode. Peek was "+z,!1)):z>29&&S.options.debug&&this.peekerReport(K)}if(g.length===0){r&&(console.error("Root eval set consisted of 0 valid actions"),m.debug("!! Zero Action Root !!")),this.simEndpoint("D");return}let y=-99999;const C=[];if(g.length===1&&r)C.push({a:g[0],weight:99});else{de.saveState();for(let D=0;Dy&&(y=_,C.push({a:$,weight:_})),de.restoreState(),r&&(await u.drawAiGear(D,!0),h++,await S.sleep(Oe))}de.popState()}if(r){this.simOn=!1;const D=y-.3,$=C.filter(pt=>pt.weight>D);let K;if(D>er-100){const pt=$.find(ct=>ct.a.key==="FITE");pt?K=pt.a:K=$[S.randInt(0,$.length)].a}else K=$[S.randInt(0,$.length)].a;const _=Date.now()-s,z=Math.max(1,350-_),tt=_-Oe*h;this.turnSims+=this.endCount,this.turnTime+=tt,S.sleep(z).then(()=>{v.handleAction(K)})}else this.popProm(y)}actionPruner(t){let e=t.filter(r=>wr.indexOf(r.key)===-1);return M.mainBattle?e=e.filter(r=>r.key!=="HDSC"):e=e.filter(r=>!this.hasHint(r,"BB")),e=e.filter(r=>{if(this.hasHint(r,"HR")){if(r.zone==="P")return r.playerA!==this.aiPlayer;{const s=r,h=f.ddf6(s);if(h.owner===this.aiPlayer){const u=h.aiHints();return u.includes("MC")||u.includes("LZ")}else return!0}}else return!0}),e=e.filter(r=>{if(this.hasHint(r,"KL")){const s=r,h=f.ddf6(s);if(h.owner===this.aiPlayer){const u=h.aiHints();return u.includes("ST")||u.includes("LZ")}else return!0}else return!0}),e=e.filter(r=>this.hasHint(r,"BF")?r.playerA===this.aiPlayer:!0),e=e.filter(r=>this.hasHint(r,"DB")?r.playerA!==this.aiPlayer:!0),e=e.filter(r=>{if(this.hasHint(r,"PN")){if(r.zone==="P")return r.playerA!==this.aiPlayer;{const s=r,h=f.ddf6(s);return h.owner===this.aiPlayer?h.aiHints().includes("MC"):!0}}else return!0}),e=e.filter(r=>{const s=r.key==="FORG";if(s||this.hasHint(r,"FL")){const h=r,u=f.searchByFSA(h);return u&&(M.mainBattle?M.newPre:M.newPost).includes(u.id)?u.aiHints().includes("RT")?!0:s?I.getCard(h.host).aiHints().includes("RD"):!1:!0}else return!0}),e}async peeker(t){this.peeking=!0;const e=[],r=[];t.forEach(s=>{xr.includes(s.key)?r.push(s):e.push({root:s,peek:[s],wasPeek:!1,free:!1})}),de.saveState();for(let s=0;s0){let y=!1;h.key==="HPLY"&&h.cost!==""&&(y=!0),e.push({root:h,peek:g,wasPeek:!0,free:y})}de.restoreState()}return de.popState(),this.peeking=!1,e}peekerReport(t){let e=0,r=0,s=0,h=[],u=[];t.forEach(g=>{const y=g.peek.length;if(y>0){const C=g.root.key;if(C==="HPLY")if(g.peek[0].key==="FORG")r+=y;else{const D=m.fastName(g.root.card)+": "+y;h.push(D)}else if(C==="MOVE")s+=y;else if(C==="ACTV"){const D=m.fastName(g.root.host)+": "+y;u.push(D)}else e+=y}}),m.debug("High complexity hit: Root: "+t.length),r>0&&m.debug("Forges: "+r),s>0&&m.debug("Mobility: "+s),h.forEach(g=>m.debug(g)),u.forEach(g=>m.debug(g)),e>0&&m.debug("Other: "+e)}hintWeight(t){let e=0,r="";if(t.key==="HDSC"?r=t.host:this.hasHint(t,"CD")&&(r=t.card),r){const h=I.getCard(r).aiHints();h.includes("LV")?e+=1.5:h.includes("DL")?e-=2:e+=.6}return e}hasHint(t,e){return!t.hint||t.hint.length===0?!1:t.hint.includes(e)}logStats(t,e){const s=["Crt Cnt","Crt Val","Threat","P Health"].map((h,u)=>`${h}: ${this.numNum(e[u])}`).join(", ");console.log(t+s)}numNum(t){return t.length>6?t.charAt(0)==="-"?"NUNS":"KILL":t.padEnd(4)}cheater(){return N.aiMode&&N.aiActive&&S.options.cheater?new vr(this.aiPlayer).cheatin():!1}peekAllCards(){const t=k.toPlayer(this.aiPlayer),e=t.deck.concat(t.hand,t.discard).sort();console.log(e.map(r=>m.fastName(r)).join(` +(function(){"use strict";const Te=["A","N","T","U"];const oe=["C","R","H","L"];const Rt=[{crd:"AAK",fct:"T",rty:"L",set:1,typ:"C"},{crd:"ABB",fct:"N",rty:"R",set:4,typ:"C"},{crd:"ABM",fct:"N",rty:"C",set:5,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:"AGW",fct:"A",rty:"R",set:4,typ:"S"},{crd:"ASG",fct:"T",rty:"R",set:1,typ:"S"},{crd:"AMS",fct:"A",rty:"H",set:5,typ:"C"},{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:"ATP",fct:"U",rty:"H",set:3,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:"AAA",fct:"A",rty:"L",set:5.1,typ:"C"},{crd:"ABE",fct:"A",rty:"H",set:5.1,typ:"S"},{crd:"ATZ",fct:"A",rty:"C",set:4,typ:"S"},{crd:"AEC",fct:"U",rty:"L",set:5,typ:"S"},{crd:"ARB",fct:"A",rty:"H",set:4,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:"AMD",fct:"T",rty:"H",set:5,typ:"C"},{crd:"ABR",fct:"T",rty:"C",set:2,typ:"C"},{crd:"AFR",fct:"T",rty:"H",set:3.1,typ:"C"},{crd:"AMY",fct:"T",rty:"C",set:1,typ:"C"},{crd:"ABL",fct:"T",rty:"R",set:1,typ:"S"},{crd:"ATT",fct:"T",rty:"L",set:4.1,typ:"C"},{crd:"AGU",fct:"T",rty:"R",set:2.1,typ:"C"},{crd:"AIV",fct:"T",rty:"H",set:1,typ:"C"},{crd:"BRS",fct:"A",rty:"C",set:5,typ:"C"},{crd:"BTB",fct:"A",rty:"R",set:5,typ:"C"},{crd:"BTH",fct:"U",rty:"R",set:3,typ:"C"},{crd:"BTI",fct:"A",rty:"C",set:4,typ:"C"},{crd:"BTN",fct:"A",rty:"H",set:1,typ:"C"},{crd:"BBB",fct:"U",rty:"H",set:4,typ:"C"},{crd:"BLH",fct:"T",rty:"L",set:2,typ:"C"},{crd:"BFT",fct:"N",rty:"C",set:5,typ:"S"},{crd:"BSP",fct:"N",rty:"C",set:2.2,typ:"C"},{crd:"BWK",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BLW",fct:"N",rty:"R",set:3,typ:"C"},{crd:"BZS",fct:"T",rty:"C",set:5,typ:"C"},{crd:"BSR",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BMY",fct:"T",rty:"H",set:2.1,typ:"C"},{crd:"BSW",fct:"T",rty:"C",set:3,typ:"C"},{crd:"BWW",fct:"T",rty:"H",set:4,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:"BTR",fct:"U",rty:"H",set:3.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:"BST",fct:"T",rty:"L",set:4,typ:"C"},{crd:"BWT",fct:"U",rty:"L",set:4.2,typ:"C"},{crd:"BRH",fct:"N",rty:"R",set:5,typ:"C"},{crd:"BWH",fct:"A",rty:"R",set:1,typ:"S"},{crd:"BRN",fct:"T",rty:"R",set:3,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:"CKB",fct:"N",rty:"H",set:5,typ:"C"},{crd:"CDT",fct:"U",rty:"R",set:1,typ:"C"},{crd:"CMF",fct:"N",rty:"R",set:4,typ:"C"},{crd:"CTL",fct:"T",rty:"L",set:1,typ:"S"},{crd:"CCS",fct:"N",rty:"C",set:3,typ:"C"},{crd:"CHY",fct:"U",rty:"C",set:1,typ:"C"},{crd:"CSR",fct:"U",rty:"C",set:5,typ:"C"},{crd:"CHV",fct:"N",rty:"L",set:2,typ:"C"},{crd:"CRS",fct:"A",rty:"R",set:3,typ:"C"},{crd:"COD",fct:"T",rty:"R",set:4,typ:"S"},{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:"CBB",fct:"T",rty:"C",set:3,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:"CTG",fct:"A",rty:"C",set:3,typ:"C"},{crd:"CCT",fct:"T",rty:"R",set:2,typ:"C"},{crd:"CFG",fct:"T",rty:"C",set:2,typ:"S"},{crd:"CGL",fct:"N",rty:"H",set:3,typ:"C"},{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:"CNT",fct:"A",rty:"R",set:5,typ:"S"},{crd:"CWK",fct:"T",rty:"C",set:3,typ:"C"},{crd:"CRC",fct:"A",rty:"R",set:2,typ:"C"},{crd:"CYC",fct:"N",rty:"H",set:2,typ:"C"},{crd:"CYS",fct:"N",rty:"C",set:4,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:"CSH",fct:"A",rty:"C",set:3,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:"DDF",fct:"U",rty:"R",set:5,typ:"S"},{crd:"DGZ",fct:"A",rty:"R",set:2,typ:"S"},{crd:"DBN",fct:"N",rty:"C",set:4,typ:"C"},{crd:"DDS",fct:"A",rty:"H",set:4.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:"DPB",fct:"A",rty:"L",set:5.2,typ:"C"},{crd:"DZD",fct:"U",rty:"L",set:3,typ:"C"},{crd:"DRE",fct:"T",rty:"L",set:5,typ:"S"},{crd:"DGW",fct:"T",rty:"L",set:5.2,typ:"S"},{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:"DTD",fct:"N",rty:"L",set:4.2,typ:"C"},{crd:"DSZ",fct:"N",rty:"C",set:2,typ:"C"},{crd:"DYB",fct:"U",rty:"R",set:2,typ:"S"},{crd:"DBQ",fct:"N",rty:"H",set:3,typ:"C"},{crd:"DYS",fct:"N",rty:"R",set:3,typ:"S"},{crd:"DYL",fct:"U",rty:"L",set:3,typ:"C"},{crd:"EBW",fct:"N",rty:"C",set:3,typ:"C"},{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:"EPH",fct:"A",rty:"L",set:4.2,typ:"C"},{crd:"ESG",fct:"A",rty:"H",set:4.1,typ:"C"},{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:"EFA",fct:"T",rty:"R",set:5,typ:"S"},{crd:"EFM",fct:"T",rty:"L",set:2.1,typ:"C"},{crd:"EFP",fct:"T",rty:"L",set:1,typ:"C"},{crd:"EFE",fct:"U",rty:"L",set:5.2,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:"FFG",fct:"U",rty:"C",set:4,typ:"C"},{crd:"FST",fct:"N",rty:"R",set:4,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:"FLH",fct:"T",rty:"C",set:4,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:"FJT",fct:"T",rty:"C",set:5,typ:"S"},{crd:"FLN",fct:"T",rty:"R",set:2,typ:"S"},{crd:"FRI",fct:"T",rty:"C",set:3,typ:"C"},{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:"FRV",fct:"N",rty:"H",set:3,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:"FGD",fct:"A",rty:"H",set:3,typ:"C"},{crd:"FGG",fct:"A",rty:"H",set:1,typ:"C"},{crd:"FOL",fct:"A",rty:"H",set:3.1,typ:"C"},{crd:"FPM",fct:"A",rty:"R",set:3,typ:"C"},{crd:"FPS",fct:"A",rty:"C",set:1,typ:"C"},{crd:"FFM",fct:"T",rty:"H",set:3,typ:"C"},{crd:"FMD",fct:"T",rty:"L",set:3,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:"GOS",fct:"A",rty:"L",set:4,typ:"S"},{crd:"GHS",fct:"U",rty:"C",set:2.2,typ:"C"},{crd:"GHB",fct:"U",rty:"R",set:1,typ:"C"},{crd:"GHR",fct:"U",rty:"H",set:4.2,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:"GGR",fct:"N",rty:"L",set:3,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:"HMF",fct:"T",rty:"H",set:3,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:"HOD",fct:"T",rty:"R",set:3,typ:"C"},{crd:"HWM",fct:"A",rty:"L",set:1,typ:"C"},{crd:"HOX",fct:"N",rty:"R",set:4,typ:"S"},{crd:"HGS",fct:"N",rty:"R",set:1,typ:"S"},{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:"IME",fct:"N",rty:"L",set:5,typ:"S"},{crd:"IVS",fct:"N",rty:"C",set:4,typ:"S"},{crd:"ICD",fct:"N",rty:"L",set:5,typ:"C"},{crd:"IWC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"IHA",fct:"A",rty:"L",set:2,typ:"C"},{crd:"IBR",fct:"A",rty:"C",set:3,typ:"C"},{crd:"IMD",fct:"A",rty:"L",set:3,typ:"C"},{crd:"IMA",fct:"A",rty:"L",set:2.3,typ:"C"},{crd:"IZK",fct:"T",rty:"L",set:3,typ:"C"},{crd:"JPK",fct:"A",rty:"C",set:1,typ:"S"},{crd:"KDC",fct:"T",rty:"C",set:3,typ:"C"},{crd:"KAW",fct:"T",rty:"L",set:1.1,typ:"C"},{crd:"KOD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"KBE",fct:"U",rty:"H",set:5,typ:"C"},{crd:"KIW",fct:"A",rty:"L",set:3,typ:"C"},{crd:"KTS",fct:"U",rty:"H",set:4,typ:"C"},{crd:"KKK",fct:"T",rty:"L",set:2,typ:"C"},{crd:"LOD",fct:"U",rty:"L",set:4,typ:"S"},{crd:"LFA",fct:"T",rty:"H",set:4,typ:"C"},{crd:"LKP",fct:"U",rty:"L",set:1,typ:"C"},{crd:"LGT",fct:"N",rty:"R",set:2.3,typ:"C"},{crd:"LLD",fct:"N",rty:"H",set:5,typ:"C"},{crd:"LLG",fct:"U",rty:"H",set:5,typ:"C"},{crd:"LLS",fct:"A",rty:"H",set:5,typ:"C"},{crd:"LLT",fct:"T",rty:"H",set:5,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:"LCE",fct:"A",rty:"L",set:5,typ:"S"},{crd:"LUC",fct:"T",rty:"L",set:4.2,typ:"C"},{crd:"LMV",fct:"N",rty:"L",set:1,typ:"C"},{crd:"LHY",fct:"U",rty:"C",set:2,typ:"C"},{crd:"LYR",fct:"U",rty:"C",set:4,typ:"S"},{crd:"LYS",fct:"U",rty:"R",set:3,typ:"S"},{crd:"MMH",fct:"T",rty:"C",set:1,typ:"C"},{crd:"MHR",fct:"U",rty:"L",set:5.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:"MMR",fct:"A",rty:"C",set:5,typ:"C"},{crd:"MMX",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMI",fct:"A",rty:"C",set:4,typ:"C"},{crd:"MMO",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMV",fct:"A",rty:"C",set:2.2,typ:"C"},{crd:"MPH",fct:"U",rty:"H",set:3,typ:"S"},{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:"MDE",fct:"N",rty:"C",set:4,typ:"C"},{crd:"MBP",fct:"U",rty:"H",set:1,typ:"C"},{crd:"MND",fct:"A",rty:"R",set:1,typ:"C"},{crd:"NNS",fct:"A",rty:"R",set:3,typ:"S"},{crd:"NGB",fct:"T",rty:"C",set:1,typ:"C"},{crd:"NGW",fct:"T",rty:"C",set:4,typ:"C"},{crd:"NSL",fct:"U",rty:"R",set:1,typ:"S"},{crd:"NCF",fct:"N",rty:"C",set:4,typ:"S"},{crd:"NCM",fct:"N",rty:"H",set:5,typ:"C"},{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:"NSW",fct:"N",rty:"L",set:3,typ:"C"},{crd:"NSH",fct:"N",rty:"L",set:2.3,typ:"S"},{crd:"NXA",fct:"A",rty:"L",set:3.1,typ:"C"},{crd:"NXC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"NXG",fct:"A",rty:"H",set:3,typ:"C"},{crd:"NXO",fct:"A",rty:"C",set:5,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:"NGQ",fct:"U",rty:"L",set:4.1,typ:"C"},{crd:"NCL",fct:"U",rty:"R",set:1.1,typ:"S"},{crd:"NFF",fct:"U",rty:"L",set:2,typ:"C"},{crd:"NAM",fct:"N",rty:"C",set:3,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:"OBB",fct:"T",rty:"R",set:3,typ:"S"},{crd:"OEX",fct:"A",rty:"H",set:3,typ:"S"},{crd:"OWH",fct:"T",rty:"H",set:3,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:"OSV",fct:"A",rty:"H",set:4,typ:"C"},{crd:"OSS",fct:"A",rty:"C",set:5,typ:"S"},{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:"OSL",fct:"U",rty:"C",set:3,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:"PLW",fct:"A",rty:"R",set:4,typ:"S"},{crd:"PRG",fct:"N",rty:"C",set:4,typ:"C"},{crd:"PRI",fct:"A",rty:"R",set:3,typ:"S"},{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:"PSH",fct:"N",rty:"H",set:4,typ:"C"},{crd:"PTR",fct:"A",rty:"R",set:2,typ:"S"},{crd:"PSG",fct:"U",rty:"R",set:1,typ:"S"},{crd:"PMI",fct:"T",rty:"H",set:5.1,typ:"C"},{crd:"PMS",fct:"T",rty:"C",set:1,typ:"S"},{crd:"POX",fct:"N",rty:"H",set:4.2,typ:"C"},{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:"ROK",fct:"T",rty:"L",set:3.1,typ:"S"},{crd:"RHY",fct:"U",rty:"C",set:3,typ:"C"},{crd:"RTS",fct:"T",rty:"C",set:2.2,typ:"C"},{crd:"RLW",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RHU",fct:"A",rty:"L",set:4.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:"RWC",fct:"U",rty:"C",set:4,typ:"C"},{crd:"RFA",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RWD",fct:"N",rty:"C",set:5,typ:"C"},{crd:"RSE",fct:"T",rty:"H",set:4.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:"RSP",fct:"T",rty:"R",set:3,typ:"C"},{crd:"RHW",fct:"N",rty:"C",set:3,typ:"C"},{crd:"SBF",fct:"T",rty:"H",set:4,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:"STS",fct:"U",rty:"C",set:3,typ:"S"},{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:"SHY",fct:"N",rty:"C",set:5,typ:"C"},{crd:"SCD",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SFT",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SOC",fct:"N",rty:"L",set:4,typ:"S"},{crd:"SOA",fct:"A",rty:"C",set:3,typ:"S"},{crd:"SOD",fct:"U",rty:"C",set:3,typ:"S"},{crd:"SOK",fct:"T",rty:"C",set:3,typ:"S"},{crd:"SOT",fct:"N",rty:"C",set:3,typ:"S"},{crd:"SAD",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SHG",fct:"N",rty:"L",set:2,typ:"S"},{crd:"SBI",fct:"U",rty:"C",set:3,typ:"C"},{crd:"SCC",fct:"U",rty:"C",set:4,typ:"C"},{crd:"SPB",fct:"U",rty:"L",set:5,typ:"C"},{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:"STB",fct:"T",rty:"C",set:5,typ:"S"},{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:"SSD",fct:"T",rty:"L",set:5,typ:"C"},{crd:"SDA",fct:"U",rty:"H",set:5,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:"SSH",fct:"U",rty:"H",set:4,typ:"C"},{crd:"SRM",fct:"N",rty:"H",set:4,typ:"C"},{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:"SRP",fct:"N",rty:"L",set:4,typ:"S"},{crd:"SGG",fct:"N",rty:"H",set:4,typ:"C"},{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:"SKS",fct:"T",rty:"C",set:4,typ:"C"},{crd:"SEL",fct:"T",rty:"R",set:5,typ:"C"},{crd:"STM",fct:"T",rty:"R",set:4,typ:"C"},{crd:"SBD",fct:"U",rty:"C",set:2.1,typ:"C"},{crd:"SCV",fct:"N",rty:"R",set:3,typ:"S"},{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:"SSI",fct:"A",rty:"R",set:4,typ:"C"},{crd:"SND",fct:"U",rty:"R",set:4,typ:"C"},{crd:"SNT",fct:"N",rty:"L",set:5.1,typ:"C"},{crd:"STR",fct:"N",rty:"R",set:2,typ:"S"},{crd:"SPH",fct:"N",rty:"H",set:4.1,typ:"C"},{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:"SOL",fct:"U",rty:"C",set:4,typ:"C"},{crd:"SOV",fct:"T",rty:"L",set:4,typ:"S"},{crd:"SHK",fct:"T",rty:"H",set:1,typ:"S"},{crd:"SWR",fct:"A",rty:"R",set:1,typ:"C"},{crd:"SMN",fct:"T",rty:"C",set:5,typ:"C"},{crd:"SER",fct:"A",rty:"C",set:4,typ:"C"},{crd:"SES",fct:"A",rty:"L",set:5,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:"SSK",fct:"A",rty:"C",set:3,typ:"C"},{crd:"SWG",fct:"A",rty:"C",set:4,typ:"C"},{crd:"SWM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"SIV",fct:"U",rty:"H",set:5.1,typ:"S"},{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:"STP",fct:"T",rty:"C",set:4,typ:"S"},{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:"SEV",fct:"N",rty:"L",set:3.1,typ:"C"},{crd:"SMA",fct:"U",rty:"C",set:5,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:"TGL",fct:"U",rty:"R",set:3,typ:"S"},{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:"TNL",fct:"N",rty:"L",set:4.1,typ:"C"},{crd:"TEX",fct:"A",rty:"C",set:4,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:"TAB",fct:"T",rty:"C",set:4,typ:"C"},{crd:"TGI",fct:"T",rty:"R",set:2,typ:"C"},{crd:"TDS",fct:"U",rty:"L",set:1.1,typ:"C"},{crd:"TSP",fct:"T",rty:"H",set:4.2,typ:"S"},{crd:"TPG",fct:"N",rty:"H",set:3.1,typ:"C"},{crd:"TMG",fct:"U",rty:"R",set:3,typ:"C"},{crd:"TMM",fct:"U",rty:"C",set:5,typ:"C"},{crd:"TRA",fct:"A",rty:"R",set:5,typ:"C"},{crd:"TRS",fct:"U",rty:"R",set:5,typ:"C"},{crd:"TRV",fct:"T",rty:"R",set:5,typ:"C"},{crd:"TRW",fct:"N",rty:"R",set:5,typ:"C"},{crd:"TBB",fct:"T",rty:"R",set:4,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:"TXB",fct:"U",rty:"R",set:5,typ:"S"},{crd:"TXS",fct:"U",rty:"C",set:1,typ:"S"},{crd:"TCG",fct:"T",rty:"C",set:2.1,typ:"S"},{crd:"TWT",fct:"A",rty:"C",set:3,typ:"C"},{crd:"TRN",fct:"T",rty:"H",set:2,typ:"S"},{crd:"TGK",fct:"U",rty:"R",set:4,typ:"C"},{crd:"TSL",fct:"U",rty:"H",set:3,typ:"C"},{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:"UEM",fct:"T",rty:"C",set:4,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:"UIW",fct:"A",rty:"L",set:4,typ:"C"},{crd:"URS",fct:"U",rty:"C",set:5,typ:"S"},{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:"VIK",fct:"N",rty:"L",set:5.2,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:"VTW",fct:"A",rty:"R",set:4,typ:"C"},{crd:"VGN",fct:"N",rty:"C",set:1,typ:"C"},{crd:"VND",fct:"U",rty:"R",set:4,typ:"C"},{crd:"VNF",fct:"U",rty:"R",set:1.1,typ:"C"},{crd:"VNS",fct:"U",rty:"H",set:2,typ:"C"},{crd:"VSK",fct:"U",rty:"C",set:4,typ:"S"},{crd:"VCH",fct:"U",rty:"H",set:4.1,typ:"S"},{crd:"VGR",fct:"U",rty:"C",set:2,typ:"S"},{crd:"VGL",fct:"N",rty:"R",set:5,typ:"S"},{crd:"VOB",fct:"T",rty:"R",set:4,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:"WMC",fct:"A",rty:"H",set:5,typ:"C"},{crd:"WMR",fct:"A",rty:"H",set:2.1,typ:"C"},{crd:"WTK",fct:"A",rty:"H",set:4,typ:"C"},{crd:"WMM",fct:"A",rty:"H",set:1,typ:"C"},{crd:"WTW",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WTA",fct:"U",rty:"L",set:4,typ:"C"},{crd:"WWP",fct:"U",rty:"H",set:1.1,typ:"C"},{crd:"WWR",fct:"U",rty:"C",set:3,typ:"C"},{crd:"WOD",fct:"U",rty:"R",set:4,typ:"S"},{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:"WSE",fct:"T",rty:"L",set:5.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:"ZXR",fct:"T",rty:"H",set:5,typ:"C"},{crd:"XCR",fct:"N",rty:"C",set:2,typ:"C"},{crd:"XDH",fct:"N",rty:"R",set:3,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:"XTR",fct:"N",rty:"H",set:5.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:"ZMT",fct:"N",rty:"C",set:3,typ:"C"},{crd:"ZSH",fct:"T",rty:"L",set:1,typ:"C"}],_e=[["ASQ",["SLG","SLG"]],["CGL",["CGF"]],["DHC",["DYF"]],["DTD",["TOT"]],["FGD",["FGA","FGB","FGG"]],["IBA",["AVB"]],["IZK",["IFL","IFR"]],["RHU",["RSC"]],["SLS",["MMY"]],["TSL",["FUN"]],["WHR",["WHC"]]];class tr{raw={["C"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0},["S"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0}};addStat(t,e){this.raw[t][e]++}g(t,e){return this.raw[t][e]}typeSum(t){return Te.map(e=>this.g(t,e)).reduce((e,r)=>e+r,0)}getTotal(){const t=this.typeSum("C"),e=this.typeSum("S");return[t,e,t+e]}getFactTotal(t){const e=this.g("C",t),r=this.g("S",t);return[e,r,e+r]}}const l=(n,t)=>({card:n,num:t}),pr={name:"Official 1 - 3",id:"SBE1",decks:[{name:"Alloyin Starter",factions:["A"],cards:[l("SYO",1),l("BSS",1),l("SFT",2),l("SNP",2),l("TSM",2),l("SSS",2),l("ALG",2),l("MXW",3),l("TUP",3),l("FPS",3),l("MND",3),l("IWC",3),l("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[l("SFS",1),l("GGD",1),l("FFD",3),l("EPD",2),l("CCR",2),l("HGS",2),l("DSS",2),l("BWK",2),l("GBG",3),l("DSK",3),l("GRP",3),l("VGN",3),l("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[l("FBC",1),l("RBH",1),l("CFB",3),l("FSM",2),l("FSH",2),l("FSS",2),l("PMS",2),l("RFL",2),l("UBL",3),l("WPD",3),l("SGI",3),l("AMY",3),l("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[l("UPM",1),l("EHW",1),l("FRR",3),l("SPD",2),l("HTP",2),l("LSS",2),l("SDR",2),l("SRD",2),l("FWR",3),l("DBP",3),l("GHT",3),l("GSS",3),l("TXS",3)]},{name:"Cruel Corrosion",factions:["A","N"],cards:[l("IHA",1),l("WBG",1),l("OXP",1),l("DFR",1),l("APM",1),l("SNP",1),l("GRM",2),l("ETN",2),l("DHW",2),l("OXM",2),l("AEN",2),l("ATG",2),l("CTI",2),l("CTW",2),l("FPS",2),l("GRW",2),l("MTT",2),l("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[l("ZTU",1),l("VRP",1),l("GGP",1),l("EPD",1),l("DBT",1),l("BSM",1),l("TDW",2),l("NGT",2),l("UBL",2),l("FWK",2),l("BZD",2),l("CSB",2),l("SLH",2),l("MMH",2),l("LSK",2),l("GBG",2),l("CFG",2),l("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[l("TDS",1),l("SSR",1),l("FRR",1),l("ULR",1),l("UTR",1),l("BTM",1),l("UGL",2),l("EHN",2),l("SPD",2),l("GHB",2),l("FLN",2),l("SML",2),l("RFL",2),l("OXS",2),l("UTM",2),l("TWG",2),l("ENR",2),l("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[l("CSW",1),l("SMD",1),l("FRR",1),l("UIC",1),l("CFB",1),l("UGL",2),l("FSH",2),l("FLN",2),l("WPD",1),l("TWG",2),l("TCG",2),l("TGS",2),l("SML",2),l("SVH",1),l("SCL",2),l("RTS",1),l("FWB",2),l("ENR",2),l("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[l("IMA",1),l("GMP",1),l("OXA",1),l("EPD",1),l("OJC",1),l("ESU",2),l("OXM",2),l("MMA",2),l("SAP",1),l("AFO",2),l("GBG",2),l("CTW",2),l("SRH",1),l("TSM",2),l("SLH",1),l("MTT",1),l("DCR",1),l("DFB",1),l("BSR",1),l("LGT",1),l("XRF",2),l("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[l("SBG",1),l("NSH",1),l("FFU",1),l("EWE",1),l("BFM",1),l("WBH",1),l("UWS",1),l("TGI",2),l("RFL",2),l("GRM",1),l("ASG",1),l("YWC",2),l("XRF",2),l("WPD",2),l("WCS",2),l("WBU",2),l("TCG",1),l("FSK",1),l("SLH",2),l("CFG",1),l("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[l("URB",1),l("AGK",1),l("ESP",1),l("FRR",1),l("NXT",1),l("ALG",1),l("FGB",1),l("PHS",2),l("TUP",1),l("EWT",2),l("PTR",1),l("VBK",1),l("AGC",1),l("AEN",2),l("ETN",1),l("FPS",2),l("MXW",2),l("GHT",1),l("TWG",2),l("SNB",1),l("SML",1),l("JPK",1),l("ENR",1),l("IWC",1)]},{name:"Spare Parts",factions:["N"],cards:[l("SEV",1),l("SHG",1),l("TPG",1),l("CGL",1),l("FRV",1),l("HFA",2),l("XDH",1),l("GRM",1),l("SCV",1),l("DFB",2),l("EBW",2),l("GBG",2),l("GLF",2),l("XHS",2),l("SOT",1),l("XRF",2),l("SCS",1),l("ZMT",1),l("SLH",1),l("VYE",1),l("XCR",2),l("XHU",1)]},{name:"Future Forged",factions:["A"],cards:[l("NXA",1),l("IMD",1),l("FOL",1),l("SFA",2),l("SFT",1),l("SCD",1),l("CAG",1),l("ESU",1),l("NNS",1),l("FPM",1),l("PRI",1),l("SSS",1),l("CTG",1),l("TSM",2),l("IWC",1),l("MMA",2),l("TGN",2),l("MTT",1),l("SKG",1),l("AFO",1),l("MMV",1),l("TWS",1),l("SBA",2),l("SSK",1),l("JPK",1)]},{name:"Burning Rage",factions:["T"],cards:[l("ROK",1),l("KKK",1),l("MOE",1),l("AFR",1),l("FBI",1),l("FSS",2),l("FLN",2),l("CCT",2),l("BRN",2),l("WPD",2),l("SSM",2),l("SOK",1),l("RTS",2),l("FSK",2),l("CWK",2),l("CFG",2),l("BSW",2),l("FMS",2)]},{name:"Awakened Fury",factions:["U"],cards:[l("DZD",1),l("SSE",1),l("BTR",1),l("TSL",1),l("MPH",1),l("CDT",1),l("DYB",1),l("BTH",2),l("TMG",2),l("BWD",2),l("RHY",2),l("SBD",2),l("GMR",2),l("STS",1),l("OSL",2),l("SBI",2),l("LYS",2),l("TGS",2),l("SOD",2)]}]},yr={name:"Official 4",id:"SBE2",decks:[{name:"Titan's Assault",factions:["N","T"],cards:[l("ATT",1),l("TNL",1),l("RSE",1),l("SPH",1),l("SCV",2),l("ABB",2),l("TBB",2),l("BRN",2),l("FLN",2),l("CMF",2),l("XDH",2),l("FST",2),l("TAB",2),l("MDE",2),l("FSK",2),l("FLH",2),l("CBB",2)]},{name:"Verdant Fortress",factions:["A","U"],cards:[l("NGQ",1),l("RHU",1),l("VCH",1),l("ESG",1),l("PLW",2),l("NNS",2),l("SND",2),l("WOD",2),l("IBR",2),l("BWD",2),l("SBI",2),l("RWC",2),l("TEX",2),l("SER",2),l("SWG",2),l("SCC",2),l("DYB",2)]},{name:"Umbruk Uprising",factions:["T","U"],cards:[l("LUC",1),l("BWT",1),l("GHR",1),l("TSP",1),l("WBH",1),l("COD",1),l("SDR",1),l("ZPM",1),l("OXS",1),l("WOD",1),l("RWC",2),l("SSG",2),l("VGR",2),l("CFG",2),l("UEM",2),l("FFG",2),l("UGL",2),l("DMR",2),l("RTS",2),l("CWK",2)]},{name:"Onyxium Twilight",factions:["A","N"],cards:[l("EPH",1),l("DTD",1),l("POX",1),l("DDS",1),l("OHV",1),l("PHS",1),l("DFB",1),l("TDW",1),l("CAG",1),l("ALG",1),l("TUP",2),l("CTW",2),l("XCR",2),l("SSK",2),l("SRH",2),l("ATG",2),l("MTT",2),l("SLH",2),l("GLF",2),l("AFO",2)]}]},br={name:"Set 1 & 2 Tournies",id:"T1309",decks:[{name:"Axel: Lifegain",factions:["T","U"],cards:[l("AGD",3),l("EHW",3),l("FRR",3),l("FIN",1),l("UPM",1),l("LKP",2),l("BTM",2),l("LBL",3),l("GSS",3),l("RFA",3),l("GHB",3),l("EFP",3)]},{name:"Derk: Metaminds",factions:["A"],cards:[l("OJC",3),l("DMW",3),l("MMV",3),l("JPK",3),l("MMO",3),l("GMP",3),l("ALS",3),l("MMA",3),l("SFA",3),l("BTN",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[l("DBP",3),l("EHW",2),l("FRR",3),l("FWT",3),l("UPM",3),l("LKP",2),l("BTM",3),l("HTR",2),l("LBD",2),l("RFA",3),l("GHB",2),l("SDR",2)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[l("ALS",3),l("TDS",3),l("FRR",3),l("WWP",3),l("SML",2),l("BSG",3),l("JPK",2),l("ODC",3),l("NXT",2),l("WMM",3),l("GHB",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[l("SCS",3),l("ROG",1),l("GGP",1),l("GGD",3),l("WFS",1),l("DSS",3),l("ZTU",1),l("GBG",3),l("HFA",3),l("EXD",1),l("EPD",1),l("BSR",1),l("MRF",2),l("HGS",3),l("GTH",3)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[l("SHK",3),l("MOE",3),l("FRR",3),l("LSK",3),l("FFU",3),l("UBL",3),l("WWS",3),l("FSS",3),l("ENR",3),l("MMH",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[l("DBP",2),l("EHW",2),l("FRR",3),l("HTP",2),l("UPM",3),l("LKP",2),l("GHT",3),l("GGP",2),l("LBD",1),l("EPD",2),l("DBT",2),l("SPD",3),l("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[l("IWC",3),l("FSS",3),l("ETN",1),l("WPD",2),l("FSM",1),l("AHL",1),l("UBL",3),l("SMD",2),l("BTN",3),l("LSK",1),l("MMH",3),l("FFU",1),l("TSM",3),l("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[l("DSS",3),l("FSS",3),l("EPD",2),l("GTH",3),l("FSM",1),l("MOE",1),l("UBL",3),l("GGP",3),l("GBG",1),l("LSK",3),l("HGS",1),l("CTW",1),l("SHK",3),l("GGD",1),l("DBT",1)]}]},Ar={name:"The Forge",id:"TG10",decks:[{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[l("BWK",3),l("TDS",2),l("FRR",3),l("WWP",3),l("GGP",3),l("GGD",3),l("DBT",1),l("WFS",3),l("CTW",3),l("EPD",3),l("GHB",3)]},{name:"ErrorAsh: Burn",factions:["N","T"],cards:[l("UBL",2),l("EFM",2),l("FBI",3),l("ESK",3),l("FLN",3),l("EFP",3),l("MOE",3),l("FSS",3),l("SHK",3),l("EPD",3),l("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[l("WWS",3),l("DYB",3),l("FRR",3),l("SYL",3),l("EPD",3),l("SSE",2),l("NSH",2),l("TDW",3),l("NFF",2),l("CHR",2),l("LKP",2),l("EXD",2)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[l("NSH",2),l("SMD",2),l("DDD",3),l("TDW",3),l("VRP",3),l("WCS",3),l("BSM",3),l("SHG",2),l("TGI",2),l("EPD",3),l("FVA",2),l("DBT",1),l("TRN",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[l("UWL",3),l("FFU",3),l("WBY",3),l("UIM",3),l("WBU",3),l("SSR",1),l("TRN",1),l("GTT",1),l("GCR",3),l("FRR",3),l("UBL",3),l("WWP",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[l("DDD",3),l("DBT",3),l("EPD",3),l("EFP",3),l("GGP",3),l("LSK",3),l("SHK",3),l("UBL",3),l("WCS",3),l("ZTU",3)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[l("XSH",3),l("SPM",3),l("FRR",3),l("ODC",3),l("SSE",3),l("ESK",3),l("TGS",3),l("XRF",3),l("VRP",3),l("URB",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[l("RBH",3),l("TDS",3),l("FRR",3),l("WWP",3),l("EFP",3),l("AMY",2),l("FVA",2),l("ENR",3),l("ZSH",3),l("EHW",3),l("GHB",2)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[l("BWK",2),l("KOD",2),l("CYC",3),l("GRM",3),l("VYE",3),l("XRW",3),l("MOE",2),l("ZTU",3),l("BSM",3),l("EPD",3),l("DSS",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[l("AGM",3),l("TDS",2),l("FRR",3),l("WWP",3),l("CSW",3),l("FLN",3),l("EFP",2),l("UWL",3),l("WBY",2),l("WCS",2),l("EHW",2),l("SHS",2)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[l("UHS",2),l("FLN",3),l("STG",3),l("CRC",3),l("SHK",3),l("EFP",2),l("WMR",2),l("WMM",3),l("JPK",3),l("SMD",3),l("FVA",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[l("LSK",2),l("WBG",3),l("EPD",3),l("DDD",3),l("SHK",3),l("EFP",3),l("ZTU",2),l("GGD",2),l("GGP",3),l("CTW",3),l("DBT",3)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[l("DMW",3),l("GMP",3),l("MMA",3),l("MMV",2),l("TDW",3),l("VRP",3),l("EPD",3),l("SHG",2),l("OJC",2),l("ESK",2),l("CHV",2),l("CTW",2)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[l("CTW",1),l("GCR",1),l("CFG",1),l("FZS",1),l("FBI",3),l("MOE",3),l("EFP",3),l("LSK",3),l("FLN",3),l("SHK",3),l("RTS",3),l("GGP",3),l("UBL",2)]}]},kr={name:"Set 1 Fundecks",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[l("DFB",3),l("BSR",3),l("HGS",3),l("HFA",3),l("FFD",3),l("XSH",3),l("XHU",3),l("WBG",3),l("GBG",3),l("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[l("TBA",3),l("SVH",3),l("MBP",2),l("FSH",3),l("RBH",3),l("FBC",3),l("LBR",2),l("CFB",3),l("AAK",3),l("KKK",2),l("FRR",1),l("FIN",1),l("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[l("MMA",3),l("DMW",3),l("GMP",3),l("SYO",3),l("KAW",3),l("SHK",3),l("CTL",2),l("CAG",2),l("MSC",2),l("MTS",2),l("ASG",2),l("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[l("CTV",3),l("TDW",3),l("BTS",3),l("CHR",3),l("GMR",3),l("KOD",2),l("LKP",2),l("SHV",2),l("DBA",2),l("CCR",2),l("PTB",2),l("FIN",1),l("DBT",2)]},{name:"Voltron",factions:["A"],cards:[l("FGA",3),l("FGB",3),l("FGD",3),l("FGG",3),l("AFS",3),l("BSS",3),l("PRI",3),l("TUP",2),l("JPK",2),l("BWH",2),l("SFT",3)]},{name:"Do Fear The Reaper",factions:["A","N"],cards:[l("CTI",3),l("DFR",3),l("GRW",3),l("LGT",3),l("OXM",3),l("OXP",3),l("PHM",3),l("CTW",2),l("NNS",2),l("OXA",2),l("SDN",3)]},{name:"Muadib",factions:["N","U"],cards:[l("DBA",3),l("DYL",3),l("GSW",3),l("LBD",3),l("MMW",3),l("NCW",3),l("SRV",3),l("LBL",2),l("MSP",2),l("VYE",2),l("SBD",3)]},{name:"Triassic Park",factions:["T","U"],cards:[l("URB",3),l("UTR",3),l("UTM",3),l("ULR",3),l("UIC",3),l("UGL",3),l("RTS",3),l("BRN",2),l("LBR",2),l("IBF",2),l("GHB",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[l("DDD",3),l("WBH",3),l("HMF",3),l("WCS",3),l("GGP",3),l("SAD",3),l("SDN",3),l("EWE",3),l("SBG",3),l("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[l("WWP",3),l("EHN",2),l("SDR",2),l("HTR",2),l("MML",2),l("HTP",2),l("SHS",3),l("MND",2),l("NXC",2),l("CDT",2),l("PTB",2),l("SVO",2),l("MPH",2),l("SYO",2)]},{name:"Braaiins",factions:["N"],cards:[l("XDV",3),l("XRW",3),l("ONN",2),l("SLH",2),l("FWK",2),l("BWK",2),l("URD",2),l("TPG",2),l("DSS",2),l("KOD",2),l("ZMT",2),l("RSZ",2),l("BLW",2),l("CSB",2)]},{name:"Wanderin",factions:["N","U"],cards:[l("LYS",3),l("STR",2),l("MBP",2),l("OSL",2),l("RLW",3),l("SSR",1),l("SVO",2),l("SSE",2),l("RHW",3),l("SYL",2),l("TGS",2),l("TMG",3),l("XDH",3)]},{name:"Walls",factions:["A","T"],cards:[l("CDC",3),l("CTG",3),l("CRC",3),l("DCS",3),l("FRI",3),l("FGA",2),l("OBB",3),l("FVA",2),l("TGN",2),l("OWH",3),l("STN",3)]},{name:"Snakes In A Lane",factions:["A","U"],cards:[l("AFO",3),l("DSV",3),l("PSC",3),l("SHS",3),l("STO",3),l("NCL",2),l("VNF",3),l("LYS",2),l("SVO",1),l("VNS",3),l("TXS",2),l("ART",2)]},{name:"Benny & Izzy",factions:["A","T"],cards:[l("BRN",3),l("EFM",2),l("IZK",3),l("JPK",1),l("MTT",1),l("NNS",1),l("OBB",2),l("OWF",2),l("OEX",3),l("PRI",2),l("PTR",1),l("TST",1),l("FLS",2),l("BLH",3),l("SHK",3)]}]},fe=[pr,yr,br,Ar,kr];class Se{state;constructor(t){this.state=t}getState(){return this.state}get adjacent(){return f.adjacentPositions(this.lane)}get attack(){return this.state.attack+this.modSum("AT")}get activationAvailable(){return this.state.negateActivate?!1:this.state.activationAvailable}set activationAvailable(t){this.state.activationAvailable=t}get aggressive(){return this.state.aggressive||this.modBool("AG")}set aggressive(t){this.state.aggressive=t}get armor(){return this.negateArmor?0:this.state.armor+this.modSum("AR")}get armorDmg(){return this.state.armorDmg}set armorDmg(t){this.state.armorDmg=t}get 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 I.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 I.getCard(this.code).isTribe(t)}get lane(){return this.state.lane}get level(){return I.getCard(this.code).level}get maxHealth(){return this.state.maxHealth+this.modSum("MH")}get mobility(){return this.negateMobility?0:this.state.mobility+this.modSum("MB")}get mobilityAvailable(){return this.state.mobilityAvailable}set mobilityAvailable(t){this.state.mobilityAvailable=t}get mods(){return this.state.mods}get negateActivate(){return this.state.negateActivate}set negateActivate(t){this.state.negateActivate=t}get negateArmor(){return this.state.negateArmor||this.modBool("NA")}set negateArmor(t){this.state.negateArmor=t,this.enforceEffects("AR")}get negateDefender(){return this.state.negateDefender||this.modBool("ND")}set negateDefender(t){this.state.negateDefender=t,this.enforceEffects("DF")}get negateMobility(){return this.state.negateMobility||this.modBool("NM")}set negateMobility(t){this.state.negateMobility=t}get negateRegen(){return this.state.negateRegen||this.modBool("NM")}set negateRegen(t){this.state.negateRegen=t}get opposed(){const t=p.crTarg();return t.player=k.toTarget(!this.owner),t.lanes=f.oppositeLane(this.lane),f.creatByTarget(t)[0]}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get rank(){return k.toPlayer(this.owner).rank}get regen(){return this.negateRegen?0:this.state.regen+this.modSum("RG")}get sleeping(){return this.state.sleeping}set sleeping(t){this.state.sleeping=t}get status(){return this.state.status}set status(t){this.state.status=t}get triggers(){return this.state.triggers}buff(t,e,r=void 0){t!==0&&(this.state.attack+=t,this.enforceEffects("AT")),e!==0&&(this.state.health+=e,this.state.maxHealth+=e,this.enforceEffects("CH"),O.deathProdder(this,r),e>0&&x.addEvents(W.creatHeal(this,e)))}addArmor(t){if(!this.negateArmor){const e=this.state.armor+t;this.state.armor=Math.max(0,e),this.enforceEffects("AR")}}addMobility(t){if(!this.negateMobility){const e=this.state.mobility+t;this.state.mobility=Math.max(0,e)}}addPoison(t){const e=this.state.poison+t;this.state.poison=Math.max(0,e)}addRegen(t){if(!this.negateRegen){const e=this.state.regen+t;this.state.regen=Math.max(0,e)}}heal(t){if(t===0)return 0;const e=Math.min(this.health+t,this.maxHealth)-this.health;return this.state.health+=e,this.enforceEffects("CH"),x.addEvents(W.creatHeal(this,e)),e}setHealth(t){this.state.health=t}hurt(t,e=!1){if(t<1)return[0,0];const r=Math.max(Math.min(t,this.armor-this.armorDmg),0);let s=t-r,h=this.health-s;this.state.armorDmg+=r;let u=0;return e&&h<0&&(u=s-this.health,s=this.health),s>0&&(this.state.health-=s,this.enforceEffects("CH")),[s,u]}hurtBattle(t,e,r=!1){const s=this.hurt(t,r);return s[0]>0&&x.addEvents(W.damage(!0,s[0],!0,!0,this,e)),s[1]}hurtDirect(t,e,r=void 0){const s=this.hurt(t,!1);return s[0]>0&&(m.new().crd(e).txt(` dealt ${t} dmg to `).crd(this.code).txt(".").go(),x.addEvents(W.damage(!1,s[0],!1,!0,this,void 0)),O.deathProdder(this,r)),s[0]}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),O.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF")}modSum(t){return p.modSum(this.mods,t)}modBool(t){return p.modBool(this.mods,t)}hasMod(t){return p.hasModG(this.mods,t)}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){p.hasMod(this.mods,t)||this.addMod(t)}removeMod(t){const e=this.state.mods.filter(r=>r.granter===t);this.state.mods=this.state.mods.filter(r=>r.granter!==t),e.forEach(r=>{this.modEffectPropagator(r),r.type==="AR"&&(this.state.armorDmg=Math.max(0,this.state.armorDmg-r.value))})}removeModSafe(t){this.hasMod(t)&&this.removeMod(t)}expireMod(t){this.state.mods.splice(p.modIdx(this.state.mods,t),1)}endActivation(){this.modBool("EA")?this.removeMod(this.id):this.state.activationAvailable=!1,O.deathCheck(),v.actionDone()}move(t){this.state.lane=t,te.positionChange(this.owner),x.addEvents(W.creature("MOV",this))}addEffect(t,e){const r=p.effect(t,e);return this.effects.push(r),r}enforceEffects(t,e=!1){this.effects.filter(r=>r.watch===t).filter(r=>r.area==="A"||r.area==="C"&&this.owner===e).forEach(r=>I.getCard(r.logicCode).enforceEffect(r,this))}jr4(t,e){const r=p.trigger(t,e);return r.cardCode=this.code,r.creatId=this.id,this.triggers.push(r),r}removeTrigger(t){const e=p.trigIdx(this.triggers,t);e>-1?this.triggers.splice(e,1):console.error("Wery curious, could not find trigger to remove",t)}wipeAll(){this.state.mods=[],this.state.triggers=[],this.state.effects=[],this.state.hints=[],this.state.armor=0,this.state.mobility=0,this.state.poison=0,this.state.regen=0,this.state.aggressive=!1,this.state.defender=!1,this.state.breakthrough=!1,this.state.defender=!1,this.state.negateDefender=!1,this.state.negateArmor=!1,this.state.bonus=0,this.state.changed=!0,this.state.negateActivate=!0,f.creatByTarget(p.crTarg()).forEach(t=>{t.removeMod(this.id),t.enforceEffects("PS",this.owner)}),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),te.defenderChange(this.owner)}get hints(){return this.state.hints}aiHints(){return this.hints}}class p{static creatureState(t,e){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,bonus:0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:e,maxHealth:0,mobility:0,mobilityAvailable:!0,mods:[],negateActivate:!1,negateArmor:!1,negateDefender:!1,negateMobility:!1,negateRegen:!1,owner:t,poison:0,regen:0,sleeping:!0,status:"A",triggers:[]}}static effect(t,e){return{area:"A",watch:t,logicCode:e}}static freeCard(t){return{id:N.genId(),condition:p.target("TH"),sourceCard:t}}static mod(t,e,r=""){return{type:t,value:typeof e=="boolean"?e?1:0:e,granter:r,expiry:"NN"}}static trigger(t,e){return{id:N.genId(),type:t,logicCode:e,cardCode:"",creatId:"",customCode:"",interactive:!1,changes:!1}}static triggerReaction(t,e,r,s){return{event:t,owner:r,creatId:"",cardCode:"",trigger:e,host:s}}static basicAction(t){return{zone:"N",key:t,host:"",param:""}}static fieldSelectAction(t,e=-1,r=!0){return{zone:"F",key:t,playerA:r,lane:e,host:"",param:""}}static deckSelectAction(t,e,r){return{zone:"N",key:t,card:e,position:r,host:"",param:""}}static handSelectAction(t,e="",r="",s=-1){return{zone:"H",key:t,card:e,cost:r,position:s,host:"",param:""}}static playerSelectAction(t,e){return{zone:"P",key:t,playerA:e,host:"",param:""}}static draftSelectAction(t,e,r){return{zone:"N",key:t,index:e,pack:r,host:"",param:""}}static ddf4(){return{zone:"N",key:"ACTV",host:"",param:""}}static menuButtonAction(t){return{zone:"N",key:"MNBT",host:"",param:t}}static actionifier(t,e,r,s){const h=t;return h.key=e,h.host=r,h.param=s,h}static target(t){return{target:t,level:"LA",canLevel:!1,faction:"X",player:"X",card:"A",field:"A",creatStatus:"A",tribe:"AN",notMe:"",hasArmor:!1,canArmor:!1,hasDefender:!1,canDefender:!1,hasMobility:!1,canMove:!1,hasPoison:!1,hasRegen:!1,canRegen:!1,cardCode:"",victims:""}}static actionTarget(t,e,r,s){return p.actionifier(p.target(t),e,r,s)}static crTarg(){const t=p.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,e,r){return p.actionifier(p.crTarg(),t,e,r)}static crNotMeTarg(t){const e=p.target("TF");return e.field="O",e.creatStatus="V",e.notMe=t,e}static crNotMeActTarg(t,e,r,s){return p.actionifier(p.crNotMeTarg(e),t,r,s)}static crFriendTarg(){const t=p.crTarg();return t.player="F",t}static crFriendActTarg(t,e,r){return p.actionifier(p.crFriendTarg(),t,e,r)}static crFriendNotMeTarg(t){const e=p.crNotMeTarg(t);return e.player="F",e}static crFriendNotMeActTarg(t,e,r,s){return p.actionifier(p.crFriendNotMeTarg(e),t,r,s)}static crEnemyTarg(){const t=p.crTarg();return t.player="E",t}static crEnemyActTarg(t,e,r){return p.actionifier(p.crEnemyTarg(),t,e,r)}static playerTarg(t){const e=p.target("TP");return e.player=k.toTarget(t),e}static playerActTarg(t,e,r,s){return p.actionifier(p.playerTarg(t),e,r,s)}static lvlHandActTarg(t,e){const r=this.actionTarget("TH","CARD",t,e);return r.player="F",r.canLevel=!0,r.hint=["CD"],r}static emptyTarg(){const t=p.target("TF");return t.field="E",t}static emptyActTarg(t,e,r){return p.actionifier(p.emptyTarg(),t,e,r)}static emptyPlayerTarg(t){const e=p.emptyTarg();return e.player=k.toTarget(t),e}static emptyPlayerActTarg(t,e,r,s){return p.actionifier(p.emptyPlayerTarg(t),e,r,s)}static modSum(t,e){return t.filter(r=>r.type===e).map(r=>r.value).reduce((r,s)=>r+s,0)}static modBool(t,e){return t.some(r=>r.type===e&&r.value===1)}static hasModG(t,e){return t.findIndex(r=>r.granter===e)>-1}static hasMod(t,e){return p.modIdx(t,e)>-1}static modIdx(t,e){return t.findIndex(r=>r.granter===e.granter&&r.type===e.type)}static trigIdx(t,e){return t.findIndex(r=>r.id===e.id)}}class St{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return St.extractCardCode(this.code)}image(t){return this.type==="S"?this.fixedImage(t):this.leveledImage(t)}leveledImage(t){return this.rawImage(this.code,t)}fixedImage(t){return this.rawImage(this.cardCode(),t)}rawImage(t,e){return`card/${e?"b":"s"}/${this.faction}/${t}.jpg`}isFree=!1;level;maxLevel=3;minLevel=1;name="";overload=!1;rarity="T";spice;text="";get type(){return "C"}hints;addSp(t,e){}aiHints(){return this.hints??[]}bonus;bonusPlay(){return this?.bonus?.play??0}bonusExist(){return this?.bonus?.exist??0}canLevel(){return this.level{h+=s[g]*r[0][g],u+=s[g]*r[1][g]}),[h,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 boof3915(){return this.lValN([3,9,15])}get boof468(){return this.lValN([4,6,8])}get boof469(){return this.lValN([4,6,9])}get boof4610(){return this.lValN([4,6,10])}get boof4612(){return this.lValN([4,6,12])}get boof4710(){return this.lValN([4,7,10])}get boof4711(){return this.lValN([4,7,11])}get boof4712(){return this.lValN([4,7,12])}get boof4713(){return this.lValN([4,7,13])}get boof4714(){return this.lValN([4,7,14])}get boof4812(){return this.level*4}get boof4812n(){return this.level*-4}get boof4813(){return this.lValN([4,8,13])}get boof4814(){return this.lValN([4,8,14])}get boof4815(){return this.lValN([4,8,15])}get boof4816(){return this.lValN([4,8,16])}get boof4914(){return this.lValN([4,9,14])}get boof4915(){return this.lValN([4,9,15])}get boof579(){return this.lValN([5,7,9])}get boof5711(){return this.lValN([5,7,11])}get boof5714(){return this.lValN([5,7,14])}get boof5812(){return this.lValN([5,8,12])}get boof5813(){return this.lValN([5,8,13])}get boof5814(){return this.lValN([5,8,14])}get boof5815(){return this.lValN([5,8,15])}get boof5914(){return this.lValN([5,9,14])}get boof5915(){return this.lValN([5,9,15])}get boof5916(){return this.lValN([5,9,16])}get boof5917(){return this.lValN([5,9,17])}get boof51014(){return this.lValN([5,10,14])}get boof51015(){return this.level*5}get boof51020(){return this.lValN([5,10,20])}get boof6812(){return this.lValN([6,8,12])}get boof6814(){return this.lValN([6,8,14])}get boof6912(){return this.lValN([6,9,12])}get boof6914(){return this.lValN([6,9,14])}get boof6915(){return this.lValN([6,9,15])}get boof6916(){return this.lValN([6,9,16])}get boof61014(){return this.lValN([6,10,14])}get boof61015(){return this.lValN([6,10,15])}get boof61016(){return this.lValN([6,10,16])}get boof61017(){return this.lValN([6,10,17])}get boof61018(){return this.lValN([6,10,18])}get boof61117(){return this.lValN([6,11,17])}get boof61218(){return this.lValN([6,12,18])}get boof61224(){return this.lValN([6,12,24])}get boof7911(){return this.lValN([7,9,11])}get boof7914(){return this.lValN([7,9,14])}get boof71013(){return this.lValN([7,10,13])}get boof71014(){return this.lValN([7,10,14])}get boof71015(){return this.lValN([7,10,15])}get boof71116(){return this.lValN([7,11,16])}get boof71117(){return this.lValN([7,11,17])}get boof71118(){return this.lValN([7,11,18])}get boof81116(){return this.lValN([8,11,16])}get boof81117(){return this.lValN([8,11,17])}get boof81217(){return this.lValN([8,12,17])}get boof81220(){return this.lValN([8,12,20])}get boof81318(){return this.lValN([8,13,18])}get boof91420(){return this.lValN([9,14,20])}get boof91421(){return this.lValN([9,14,21])}get boof101520(){return this.lValN([10,15,20])}get boof255080(){return this.lValN([25,50,80])}}class P extends St{constructor(t){super(t)}iHealth=0;iAttack=0;iAggro=!1;iArmor=0;iBT=!1;iDefend=!1;iMobile=0;iRegen=0;tribe=[];isTribe(t){return(Array.isArray(t)?t:[t]).every(r=>this.tribe.includes(r))}jr3(t,e){const r=p.creatureState(t,e);return r.id=N.genId(),r.code=this.code,r.health=this.iHealth,r.attack=this.iAttack,r.maxHealth=r.health,r.regen=this.iRegen,r.breakthrough=this.iBT,r.defender=this.iDefend,r.aggressive=this.iAggro,r.armor=this.iArmor,r.mobility=this.iMobile,r.hints=this.aiHints(),r.bonus=this.bonusExist(),new Se(r)}playTargets(){const t=super.playTargets(),e=p.actionTarget("TF","FORG",this.code,"");return e.player="F",t.push(e),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}addExtraActivate(t){const e=p.mod("EA",!0,t.id);e.expiry="ET",t.addMod(e)}}class yt extends St{constructor(t){super(t)}get type(){return "S"}logSpell(t=void 0,e=void 0){let r=m.new().txt("Casted ").crd(this.code);t&&(r=r.txt(" on ").crd(t.code),e&&(r=r.txt(" and ").crd(e.code))),r.txt(".").go()}}class Jt{paStats;pbStats;constructor(t,e){this.paStats=t,this.pbStats=e}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const e=this.playerStats(t),r=this.playerStats(!t);return Jt.deltafier(e,r)}static deltafier(t,e){const r=Jt.blankStats(!0);return r.creatCount=t.creatCount-e.creatCount,r.creatValue=t.creatValue-e.creatValue,r.threatValue=t.threatValue-e.threatValue,r.playerHealth=t.playerHealth-e.playerHealth,r}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0}}}class he{fromState(){const t=f.qActiveCreats(),r=[!0,!1].map(s=>{const h=Jt.blankStats(s),u=k.toPlayer(s);return h.playerHealth=u.health,t.filter(g=>g.owner===s).forEach(g=>{h.creatCount++,h.creatValue+=he.creatValueFormula(g);let y=0;if(!g.defender){const C=t.find($=>$.owner!==g.owner&&$.lane===6-g.lane);let D=0;if(C?g.breakthrough&&(D=g.attack-C.health):D=g.attack,!(D<1))if(D<6)y=D;else{const $=this.scalingBonus(D);return D+(g.sleeping&&!g.aggressive?$/2:$)}}h.threatValue+=y}),h});return new Jt(r[0],r[1])}static ddp9(t,e,r,s,h=0){return he.ddp9Nugget(t,e,r,s,h)[0]}static ddp9Nugget(t,e,r,s,h=0){const u=t/4,g=e/8,y=r/5,C=s/4;return[u+g+y+C+h,u,g,y,C,h]}static creatValueFormula(t){return t.health+Math.max(0,t.attack)+t.bonus+(t.armor+Math.min(t.mobility,3)+t.regen-t.poison)*1.5}scalingBonus(t){let e=!0,r=0,s=6,h=1;const u=6;for(;e;)t>s+u?(r+=h*u,s+=u,h++):(r+=h*(t-s),e=!1);return r}weighState(t,e,r){const s=t.deltaStats(r),h=e.deltaStats(r),u=Jt.deltafier(h,s),g=u.playerHealth<0?-1:1,y=this.scalingBonus(u.playerHealth*g)*g+u.playerHealth,C=he.ddp9Nugget(u.creatCount,u.creatValue,u.threatValue,y);return{formula:C[0],fParts:C.slice(1,-1).map(D=>D.toFixed(1)),stats:[u.creatCount,u.creatValue,u.threatValue,y].map(D=>D.toFixed(1))}}}class vr{aiPlayer;constructor(t){this.aiPlayer=t}jr7(t,e=3){return`${t}${e}`}jr6(t,e){const r=T.randInt(0,e.length),s=e[r];return e.splice(r,1),f.birth(t,"F",this.aiPlayer,s)}cheatin(){const t=k.toPlayer(this.aiPlayer),e=k.toPlayer(!this.aiPlayer),r=e.health-t.health;let s=0;r>85?s=3:r>65?s=2:r>45&&(s=1);const h=f.emptyLanes(this.aiPlayer);if(s===0||h.length===0)return!1;m.new().plr(this.aiPlayer).txt(" is a cheaty cheaterton.").go();let u=0;if(s===1){if(M.regularPlays-=1,u=T.randInt(0,13),u===0)this.jr6(this.jr7("HTR"),h);else if(u===1)this.jr6(this.jr7("AGM"),h).addRegen(8);else if(u===2){const g=this.jr6(this.jr7("YNS"),h);g.buff(0,15),g.addRegen(4)}else if(u===3)this.jr6(this.jr7("TBA"),h);else if(u===4)this.jr6(this.jr7("DCS"),h);else if(u===5)this.jr6(this.jr7("GGP"),h).addRegen(8);else if(u===6){const g=this.jr6(this.jr7("WFM"),h);g.aggressive=!0}else if(u===7){const g=this.jr6(this.jr7("FFU"),h);g.aggressive=!0}else if(u===8){const g=this.jr6(this.jr7("URB"),h);g.aggressive=!0}else if(u===9){const g=this.jr6(this.jr7("KOD"),h);g.aggressive=!0,g.addRegen(6)}else if(u===10)this.jr6(this.jr7("AGK"),h).addArmor(3);else if(u===11){const g=this.jr6(this.jr7("PSC"),h);g.aggressive=!0}else if(u===12){const g=this.jr6(this.jr7("SAD"),h);g.aggressive=!0}}else if(s===2)if(M.regularPlays-=1,u=T.randInt(0,17),u===0){const g=this.jr6(this.jr7("NDR"),h);g.aggressive=!0}else if(u===1){const g=this.jr6(this.jr7("CSW"),h);g.aggressive=!0}else if(u===2)this.jr6(this.jr7("GGD"),h).addRegen(6);else if(u===3)this.jr6(this.jr7("EFP"),h);else if(u===4)this.jr6(this.jr7("ZTU"),h);else if(u===5){const g=this.jr6(this.jr7("DDD"),h);g.aggressive=!0}else if(u===6)this.jr6(this.jr7("RBH"),h).addRegen(8);else if(u===7)this.jr6(this.jr7("SFT"),h);else if(u===8)this.jr6(this.jr7("GTT"),h);else if(u===9)this.jr6(this.jr7("SMD"),h);else if(h.length===5)this.jr6(this.jr7("DFB"),h),[1,2,3,4].forEach(g=>this.jr6(this.jr7("XHS"),h));else if(h.length===4)this.jr6(this.jr7("LMV"),h);else if(h.length===3)this.jr6(this.jr7("LHY"),h),this.jr6(this.jr7("SVH"),h),this.jr6(this.jr7("DBA"),h);else if(h.length===2)this.jr6(this.jr7("UTR"),h),this.jr6(this.jr7("TDS"),h);else if(t.turn===4)this.jr6(this.jr7("SSR"),h);else if(t.turn===1)this.jr6(this.jr7("ESK"),h);else{const g=this.jr6(this.jr7("XSH"),h);g.aggressive=!0}else if(s===3)if(u=T.randInt(0,20),u===0){const g=this.jr6(this.jr7("IHA",4),h);g.aggressive=!0}else if(u===1)this.jr6(this.jr7("CHR"),h);else if(u===2)this.jr6(this.jr7("FGO",1),h);else if(u===3)this.jr6(this.jr7("CHV",4),h);else if(u===4)this.jr6(this.jr7("KKK",4),h);else if(t.health<20){const g=this.jr6(this.jr7("ODC",4),h);g.aggressive=!0}else if(h.length===5){const g=T.randInt(0,4);if(g===0)[1,2,3,4,5].forEach(y=>this.jr6(this.jr7("UWL",2),h));else if(g===1)[1,2].forEach(y=>this.jr6(this.jr7("DFB"),h)),[1,2,3].forEach(y=>this.jr6(this.jr7("FFD"),h));else if(g===2)[1,2,3,4,5].forEach(y=>this.jr6(this.jr7("BWK"),h));else if(g===3){this.jr6(this.jr7("SBG"),h),this.jr6(this.jr7("EWE"),h);const y=this.jr6(this.jr7("BMY"),h);y.defender=!0,y.aggressive=!0}}else if(e.health>350)t.health<180&&k.heal(t,180-t.health),this.jr6(this.jr7("AGD"),h);else if(e.health>250)this.jr6(this.jr7("FGO"),h);else if(h.length===4){const g=T.randInt(0,3);g===0?(this.jr6(this.jr7("AGK"),h),[1,2,3].forEach(y=>this.jr6(this.jr7("VBK"),h))):g===1?(this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("UTR"),h)):g===2&&[1,2,3,4].forEach(y=>this.jr6(this.jr7("CDC"),h))}else if(h.length===3)if(T.randInt(0,2)){this.jr6(this.jr7("SDR"),h),this.jr6(this.jr7("SDR"),h);const g=this.jr6(this.jr7("UPM"),h);g.aggressive=!0}else{this.jr6(this.jr7("SDL"),h);const g=this.jr6(this.jr7("NFF"),h);g.aggressive=!0}else if(h.length===2)this.jr6(this.jr7("SPM"),h),this.jr6(this.jr7("SPM"),h);else{const g=this.jr6(this.jr7("NXC"),h);g.buff(10,0),g.aggressive=!0,g.addMobility(2),g.addRegen(5)}return t.health<30&&k.heal(t,50-t.health),!0}}var rt=(n=>(n[n.Left=0]="Left",n[n.Both=1]="Both",n[n.Right=2]="Right",n[n.ForceRight=3]="ForceRight",n))(rt||{});class $e{action;hitTest(t,e,r){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,e,r,s){let h,u=0;const g=t.length;for(;h===void 0&&u=t&&this.originY<=e&&this.endY>=e?this.action:void 0}}class Lt extends nt{constructor(t,e,r,s,h=0){super({zone:"N",key:"BNDL",host:"",param:""},t,e,r,s,h)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,e,r){if(super.hitTest(t,e,r))return $e.arrayHit(this.childs,t,e,r)}}class Tr{guts="";txt(t){return ot.simOn||(this.guts+=t),this}plr(t){if(!ot.simOn){const e=k.toBool(t);this.guts+="^p"+(e?"a":"b")}return this}crd(t){return ot.simOn||(this.guts+="^c"+t),this}go(){ot.simOn||m.parse(this)}}class we{realPromise;resolveMe(t){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,e)=>{this.resolveMe=t,this.rejectMe=e})}}const Oe=25,er=9999,Sr=-9999,Cr=-999999,wr=["CANC","DEET","SCRH"],xr=["HPLY","ACTV","MOVE"];class Dr{log=!1;simOn=!1;dumb=!1;inPhase=!0;promStack=[];peekStack=[];peeking=!1;endCount=0;aiPlayer=!1;brdEval;rootBoardStats;turnSims=0;turnTime=0;constructor(){this.brdEval=new he,this.rootBoardStats=new Jt(Jt.blankStats(!0),Jt.blankStats(!1))}setLog(t){this.log=t}lNum(t){return t<-100?"NUNS":t>100?"KILL":t.toFixed(1)}popProm(t){this.promStack.pop().resolveMe(t)}popPeeker(t){this.peekStack.pop().resolveMe(t)}hitMainPhase(){this.dumb&&this.simOn&&this.inPhase&&M.mainBattle&&(this.inPhase=!1)}simEndpoint(t){if(this.endCount++,this.promStack.length===0)m.debug("Tried to end a sim, but no promise to unlock."),console.trace();else{let e;if(t==="T"){const r=this.brdEval.fromState();e=this.brdEval.weighState(this.rootBoardStats,r,this.aiPlayer).formula}else t==="W"?e=er:t==="L"?e=Sr:e=Cr;this.popProm(e)}}async processAction(t,e){const r=!this.simOn;let s=0,h=0,u,g=this.actionPruner(t);if(this.peeking){this.popPeeker(g);return}if(r&&this.dumb&&e&&(this.dumb=!1,m.debug("Smart Again.",!1)),this.dumb&&!this.inPhase){let D=g.filter($=>$.key==="FITE"||$.key==="ENDT");D.length>0&&(g=D)}if(r){u=new be,u.hwhipe();const D=g.map((pt,ct)=>u.drawAiGear(ct,!1));await Promise.all(D),await new Ee().drawActions([]),await T.sleep(Oe),this.simOn=!0,s=Date.now(),this.rootBoardStats=this.brdEval.fromState(),this.endCount=0;const K=await this.peeker(g),_=[];let z=0,tt=0;K.forEach(pt=>{z+=pt.peek.length,pt.free&&tt++,pt.wasPeek&&pt.peek.some(ct=>this.hasHint(ct,"DF"))&&_.push(pt.root)}),_.length>0?(g=_,this.dumb=!0,m.debug("Do firsts; dumb mode. Action count "+g.length,!1)):M.regularPlays+tt>3?(this.dumb=!0,m.debug("4+ plays; dumb mode. Peek was "+z,!1)):k.getActive().hand.length>7?(this.dumb=!0,m.debug("8+ in hand; dumb mode. Peek was "+z,!1)):z>29&&T.options.debug&&this.peekerReport(K)}if(g.length===0){r&&(console.error("Root eval set consisted of 0 valid actions"),m.debug("!! Zero Action Root !!")),this.simEndpoint("D");return}let y=-99999;const C=[];if(g.length===1&&r)C.push({a:g[0],weight:99});else{de.saveState();for(let D=0;Dy&&(y=_,C.push({a:$,weight:_})),de.restoreState(),r&&(await u.drawAiGear(D,!0),h++,await T.sleep(Oe))}de.popState()}if(r){this.simOn=!1;const D=y-.3,$=C.filter(pt=>pt.weight>D);let K;if(D>er-100){const pt=$.find(ct=>ct.a.key==="FITE");pt?K=pt.a:K=$[T.randInt(0,$.length)].a}else K=$[T.randInt(0,$.length)].a;const _=Date.now()-s,z=Math.max(1,350-_),tt=_-Oe*h;this.turnSims+=this.endCount,this.turnTime+=tt,T.sleep(z).then(()=>{v.handleAction(K)})}else this.popProm(y)}actionPruner(t){let e=t.filter(r=>wr.indexOf(r.key)===-1);return M.mainBattle?e=e.filter(r=>r.key!=="HDSC"):e=e.filter(r=>!this.hasHint(r,"BB")),e=e.filter(r=>{if(this.hasHint(r,"HR")){if(r.zone==="P")return r.playerA!==this.aiPlayer;{const s=r,h=f.ddf6(s);if(h.owner===this.aiPlayer){const u=h.aiHints();return u.includes("MC")||u.includes("LZ")}else return!0}}else return!0}),e=e.filter(r=>{if(this.hasHint(r,"KL")){const s=r,h=f.ddf6(s);if(h.owner===this.aiPlayer){const u=h.aiHints();return u.includes("ST")||u.includes("LZ")}else return!0}else return!0}),e=e.filter(r=>this.hasHint(r,"BF")?r.playerA===this.aiPlayer:!0),e=e.filter(r=>this.hasHint(r,"DB")?r.playerA!==this.aiPlayer:!0),e=e.filter(r=>{if(this.hasHint(r,"PN")){if(r.zone==="P")return r.playerA!==this.aiPlayer;{const s=r,h=f.ddf6(s);return h.owner===this.aiPlayer?h.aiHints().includes("MC"):!0}}else return!0}),e=e.filter(r=>{const s=r.key==="FORG";if(s||this.hasHint(r,"FL")){const h=r,u=f.searchByFSA(h);return u&&(M.mainBattle?M.newPre:M.newPost).includes(u.id)?u.aiHints().includes("RT")?!0:s?I.getCard(h.host).aiHints().includes("RD"):!1:!0}else return!0}),e}async peeker(t){this.peeking=!0;const e=[],r=[];t.forEach(s=>{xr.includes(s.key)?r.push(s):e.push({root:s,peek:[s],wasPeek:!1,free:!1})}),de.saveState();for(let s=0;s0){let y=!1;h.key==="HPLY"&&h.cost!==""&&(y=!0),e.push({root:h,peek:g,wasPeek:!0,free:y})}de.restoreState()}return de.popState(),this.peeking=!1,e}peekerReport(t){let e=0,r=0,s=0,h=[],u=[];t.forEach(g=>{const y=g.peek.length;if(y>0){const C=g.root.key;if(C==="HPLY")if(g.peek[0].key==="FORG")r+=y;else{const D=m.fastName(g.root.card)+": "+y;h.push(D)}else if(C==="MOVE")s+=y;else if(C==="ACTV"){const D=m.fastName(g.root.host)+": "+y;u.push(D)}else e+=y}}),m.debug("High complexity hit: Root: "+t.length),r>0&&m.debug("Forges: "+r),s>0&&m.debug("Mobility: "+s),h.forEach(g=>m.debug(g)),u.forEach(g=>m.debug(g)),e>0&&m.debug("Other: "+e)}hintWeight(t){let e=0,r="";if(t.key==="HDSC"?r=t.host:this.hasHint(t,"CD")&&(r=t.card),r){const h=I.getCard(r).aiHints();h.includes("LV")?e+=1.5:h.includes("DL")?e-=2:e+=.6}return e}hasHint(t,e){return!t.hint||t.hint.length===0?!1:t.hint.includes(e)}logStats(t,e){const s=["Crt Cnt","Crt Val","Threat","P Health"].map((h,u)=>`${h}: ${this.numNum(e[u])}`).join(", ");console.log(t+s)}numNum(t){return t.length>6?t.charAt(0)==="-"?"NUNS":"KILL":t.padEnd(4)}cheater(){return N.aiMode&&N.aiActive&&T.options.cheater?new vr(this.aiPlayer).cheatin():!1}peekAllCards(){const t=k.toPlayer(this.aiPlayer),e=t.deck.concat(t.hand,t.discard).sort();console.log(e.map(r=>m.fastName(r)).join(` `))}peekDecks(){const t=k.toPlayer(!1),e=t.deck.map(u=>m.fastName(u)).sort(),r=t.hand.map(u=>m.fastName(u)).sort(),s=t.discard.map(u=>m.fastName(u)).sort(),h=["-- Deck --"].concat(e,"-- Hand --",r,"-- Discard --",s);console.log(h.join(` -`))}}const ot=new Dr;class Fr{getState(){const t={cCrd:this.currPlayCard,cCst:this.currPlayCost,cPos:this.currPlayPos,aa:this.actionHistory};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.currPlayCard=e.cCrd,this.currPlayCost=e.cCst,this.currPlayPos=e.cPos,this.actionHistory=e.aa}handleAction(t){if(t.key==="DEET"){Kt.init(t.param);return}if(t.key==="HPLY"){this.playCardSelect(t);return}if(t.key==="FORG"){M.forgeCard(t,this.currPlayCard,this.currPlayCost,this.currPlayPos);return}if(t.key==="FITE"){hr.fight(t.param==="M");return}if(t.key==="ENDT"){M.endTurn();return}if(t.key==="MOVE"){this.mobilitySelect(t);return}if(t.key==="MEND"){M.mobility(t);return}if(t.key==="HDSC"){this.currPlayCost="",M.cardPlayed(this.currPlayCard,this.currPlayCost,this.currPlayPos,!0),this.actionDone();return}if(t.key==="ACTV"){const e=f.jr5(t.param);I.getCard(e.code).startActivation(e);return}if(t.key==="NOTR"){t.param==="PM"&&mt.popMode(),this.actionDone(!0);return}if(t.key==="CARD"){I.getCard(t.host).handleAction(t);return}if(t.key==="CANC"||t.key==="CNCL"){t.param==="PM"&&mt.popMode(),this.actionHistory.pop(),this.ddf5();return}if(t.key==="USWP"){mt.popMode(),Et.whatNext();return}if(t.key==="DTUP"){Kt.updateDetails(t),ft.drawAll();return}if(t.key==="VWDK"){Ht.handleShowDeck(t);return}if(t.key==="SCRK"){Ht.handleDeckScroll(t);return}if(t.key==="SCRH"){t.param==="R"?N.ui.handScrollLeft+=1:N.ui.handScrollLeft-=1,ft.drawAll();return}if(t.key==="DRFT"){ut.resumeDraft(t.param);return}if(t.key==="SCRD"){ut.paginate(t.param==="D"),ft.drawAll();return}if(t.key==="UIBT"){Ke.handleUIButton(t);return}if(t.key==="MENU"){Ke.handleMainMenuButton(t);return}if(t.key==="MNBT"){Ke.handleMenuButton(t);return}if(t.key==="DSET"){this.ddf5(Bt.generateDeckPickerActions(parseInt(t.param)));return}if(t.key==="DECK"){Bt.handleDeckPick(t);return}if(t.key==="DBUG"){S.toggleDebug();return}}ddf5(t,e=!1){let r;if(t){const s=this.generateDetailActions();r=t.concat(s),this.actionHistory.push(r)}else r=this.actionHistory[this.actionHistory.length-1];N.aiActive?ot.processAction(r,e):ft.drawAll()}currPlayCard="";currPlayCost="";currPlayPos=-1;shiftPlayCard(t){t0&&e.canLevel()&&r.push(w.buttonTarget("HDSC",t.card));const s=w.toActions(r);return s.push(p.handSelectAction("CANC",t.card,"",t.position)),s}mobilitySelect(t){const e=this.getMoveCardActions(t);this.ddf5(e)}getMoveCardActions(t){if(t.key!=="MOVE")throw new Error("Unexpected action passed to getMoveCardActions: "+t.key);const e=f.ddf6(t);let r=[];if(t.param==="ACTV"){const s=p.actionTarget("TB","ACTV",e.code,e.id);r=w.toActions(s)}return r.push(p.fieldSelectAction("CANC",t.lane,t.playerA)),f.canMove(e).map(s=>{const h=p.fieldSelectAction("MEND",s,t.playerA);return h.param=e.id,h}).concat(r)}noneEndTrigger(){return w.toActions(w.buttonTarget("NOTR"))[0]}cancelAction(){return w.toActions(w.buttonTarget("CANC"))[0]}emptyAdjacents(t,e){const r=e||t.id,s=p.emptyPlayerActTarg("F","CARD",t.code,r);return s.lanes=t.adjacent,w.toActions(s)}generateDetailActions(){const t=mt.mode;if(N.aiActive)return[];if(t==="G"){const e=k.getLocal().hand.map((s,h)=>{const u=p.handSelectAction("DEET",s,"",h);return u.param=s,u}),r=f.qActiveCreats().map(s=>{const h=p.fieldSelectAction("DEET",s.lane,s.owner);return h.param=s.code,h});return e.concat(r)}else if(t==="D"){const e=ut.currentPack.map((s,h)=>{const u=p.draftSelectAction("DEET",h,!0);return u.param=`${s}1`,u}),r=ut.picksAsDeck.map((s,h)=>{const u=p.draftSelectAction("DEET",h,!1);return u.param=`${s.card}1`,u});return e.concat(r)}return[]}}const v=new Fr;class Hr{type="N0";events=[];triggerActions=[];deathCheck=!0;iaTrigLane=0;getState(){const t={type:this.type,events:this.events,tA:this.triggerActions,dC:this.deathCheck,tL:this.iaTrigLane};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.type=e.type,this.events=e.events,this.triggerActions=e.tA,this.deathCheck=e.dC,this.iaTrigLane=e.tL}startBatch(){this.deathCheck=!1,this.type==="C0"?this.type="C1":this.type==="C1"?this.type="C2":this.type==="C2"&&(this.type="N0");const t=this.type;let e;if(t==="N0")e=this.events.slice(),this.events=[];else{const s=this.events.filter(u=>u.code==="DIE"),h=this.events.filter(u=>u.code!=="DIE");t==="C1"?(e=h,this.events=s):(e=s,this.events=h)}const r=this.generateTriggers(e);this.triggerActions=this.sortTriggers(r),Et.whatNext()}generateTriggers(t){let e;const r=t.map(s=>{s.code==="TRS"&&(e=s);const h=f.field.map(g=>g.triggers.map(y=>{const C=p.triggerReaction(s,y,g.owner,"C");return C.creatId=g.id,C.cardCode=g.code,C}).filter(y=>Xe.ddf8(y))).flat(),u=[!0,!1].map(g=>k.toPlayer(g).triggers.map(C=>p.triggerReaction(s,C,g,"P")).filter(C=>Xe.ddf8(C))).flat();return h.concat(u)}).flat();return e&&this.handleTurnStart(e),r}sortTriggers(t){const e=k.getActiveB(),r=t.filter(u=>!u.trigger.interactive&&u.owner===e),s=t.filter(u=>!u.trigger.interactive&&u.owner!==e);return t.filter(u=>u.trigger.interactive&&u.owner===e).concat(s,r)}handleTurnStart(t){const e=k.getActiveB();f.qPlayerCreats(e).filter(s=>s.sleeping).forEach(s=>{s.sleeping=!1});const r=N.tick();f.qActiveCreats().forEach(s=>{s.owner===t.playerA&&(s.activationAvailable=!0,s.mobilityAvailable=!0,s.sleeping=!1),s.armorDmg=0,s.poison>0&&s.hurtDirect(s.poison,"POIS",r),s.regen>0&&s.heal(s.regen),O.deathProdder(s,r)}),[k.playerA,k.playerB].forEach(s=>{s.armorDmg=0;const h=k.totalPoison(s);h>0&&k.hurtDirect(s,h,"POIS")})}getNextTrigger(){const t=this.triggerActions;if(t.length!==0)return t[t.length-1]}triggerDone(){this.triggerActions.length===0?console.error("batch.triggerDone() was called when there is no trigger actions"):(this.triggerActions.pop(),this.iaTrigLane=0),Et.whatNext()}addEvents(...t){this.events.push(...t)}}const x=new Hr;class Br{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new lr(t)}get(t){return this.registry[t]}}const et=new Br;class Pr extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Abraxas, Avatar of Kadras",this.iAttack=this.boof4712,this.iHealth=this.lValN([7,11,21]),this.tribe.push("HY");const e=this.lValS(["Give an adjacent creature","Each adjacent creature gets","Each other friendly creature gets"]);this.text=`Activate: ${e} 2x attack this turn.`}targ(t){const e=p.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(e.lanes=t.adjacent),e}canActivate(t){return f.creatByTarget(this.targ(t)).length>0}startActivation(t){let e;this.level===1?e=this.targ(t):(e=w.boardTarget("CARD",this.code),e.param=t.id),e.hint=["BB"],v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){const e=f.jr5(t.param);if(t.zone==="F"){const r=f.ddf6(t);this.logAct(!0,r),this.applyMod(r,e.id)}else{this.logAct(!0);const r=this.targ(e);f.creatByTarget(r).forEach(s=>{this.applyMod(s,e.id)})}e.endActivation()}applyMod(t,e){const r=p.mod("AT",t.attack,e);r.expiry="ET",t.addMod(r)}}class Nr extends P{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Abyssal Brute",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.text=`When ${this.name} or another friendly creature enters a side lane, that creature gets ${m.jr9(this.level,this.level,!0)} and Regenerate ${this.level}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("EF",this.code),r.jr4("MV",this.code),r}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const e=W.toCreature(t.event),r=e.creature.lane;return(r===1||r===5)&&e.creature.owner===t.owner}return!1}jr8(t){const e=W.toCreature(t.event);e.creature.buff(this.level,this.level),e.creature.addRegen(this.level),x.triggerDone()}}class Mr extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Ambriel Archangel",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.iAttack+1,this.tribe.push("AG");const e=this.boof101520;this.text=`While ${this.name} is your only friendly creature, you get Armor ${e}, and this gets Armor ${this.level+1} and Mobility 1.`}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){const r=e.status==="A",s=p.crNotMeTarg(e.id);s.player=k.toTarget(e.owner);const h=f.creatByTarget(s);if(r&&h.length===0){const u=p.mod("AR",this.boof101520,e.id);k.addModSafe(e.owner,u);const g=p.mod("AR",this.level+1,e.id),y=p.mod("MB",1,e.id);e.addModSafe(g),e.addModSafe(y)}else k.removeModSafe(e.owner,e.id),e.removeModSafe(e.id)}}class xe extends P{lookup(t){return{["LLD"]:{c:()=>this.demC(),t:r=>this.demT(r)},["LLG"]:{c:()=>this.golC(),t:r=>this.golT(r)},["LLS"]:{c:()=>this.senC(),t:r=>this.senT(r)},["LLT"]:{c:()=>this.tyrC(),t:r=>this.tyrT(r)}}[t]}testAmbush(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}ddf8(t){return!ot.simOn&&this.testAmbush(this.cardCode(),t)}jr8(t){const e=this.cardCode(),r=k.toPlayer(t.owner),s=r.hand.length;for(let h=s-1;h>-1;h--){const u=r.hand[h];u.startsWith(e)&&(m.new().crd(u).txt(" Ambushed.").go(),f.birth(u,"S",r.isPlayerA),M.levelAndDiscard(u,h,!1,"E"))}x.triggerDone()}ambT(){return`Spawn a ${this.name}. Then discard ${this.level===3?"":"and level up "} ${this.name}.`}demC(){this.faction="N",this.rarity="H",this.name="Leyline Demon",this.iAttack=this.lValN([3,9,14]),this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.text="Ambush: When the enemy player plays a card, if it is their third card played that turn, "+this.ambT()}demT(t){if(t.event.code==="PLC"){const e=t.event;return t.owner!==e.playerA&&M.cardsPlayed===3}else return!1}golC(){this.faction="U",this.rarity="H",this.name="Leyline Golem",this.iAttack=this.lValN([5,12,18]),this.iHealth=this.iAttack-(this.level+1),this.tribe.push("GL"),this.text="Ambush: When an enemy creature moves on the enemy player's turn, "+this.ambT()}golT(t){if(t.event.code==="MOV"){const e=W.toCreature(t.event);return t.owner!==e.creature.owner&&k.getActiveB()===e.creature.owner}else return!1}senC(){this.faction="A",this.rarity="H",this.name="Leyline Sentry",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.iAttack+this.level+5,this.tribe.push("RB"),this.text="Ambush: When an enemy creature enters play on the enemy player's turn, if it wasn't Forged, "+this.ambT()}senT(t){if(t.event.code==="ENT"){const e=W.toEnterField(t.event);return t.owner!==e.creature.owner&&k.getActiveB()===e.creature.owner&&!e.forged}else return!1}tyrC(){this.faction="T",this.rarity="H",this.name="Leyline Tyrant",this.iAttack=this.lValN([6,12,17]),this.iHealth=this.iAttack-2,this.tribe.push("GT"),this.text="Ambush: When an enemy player gains health on their turn, "+this.ambT()}tyrT(t){if(t.event.code==="PHL"){const e=t.event;return t.owner!==e.playerA&&k.getActiveB()===e.playerA}else return!1}}class Rr extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Apocrymancer",this.iAttack=this.boof3713,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.text="When you play an Alloyin spell, you may discard and level up a card."}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC",this.code);return s.interactive=!0,r}handleAction(t){M.levelAndDiscardA(t),v.actionDone(!0)}ddf8(t){if(t.event.code==="PLC"){const e=t.event;if(e.playerA===t.owner){const r=I.getCard(e.cardCode);if(r.type==="S"&&r.faction==="A")return!0}}return!1}jr8(t){const e=p.lvlHandActTarg(this.code,t.creatId);v.ddf5(w.toActions([e,w.buttonTarget("NOTR")]))}}class Er extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Arboris, Grove Dragon",this.iAttack=this.lValN([5,9,20]),this.iHealth=this.iAttack,this.tribe.push("DG");const e=this.boof;this.text=`While you have over 120 health, Arboris gets ${m.jr9(e,e)}.`}jr3(t,e){const r=super.jr3(t,e);return r.addEffect("PH",this.code),r}enforceEffect(t,e){if(k.toPlayer(e.owner).health>120&&e.status==="A"){const s=this.boof;e.addModSafe(p.mod("HL",s,e.id)),e.addModSafe(p.mod("MH",s,e.id)),e.addModSafe(p.mod("AT",s,e.id))}else e.removeModSafe(e.id)}get boof(){return this.lValN([4,8,80])}}class Ir extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Ash Maiden",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("HM"),this.text=`When a friendly creature ${m.dbdtap()}, it gets ${m.jr9(this.level,this.level)}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}return!1}jr8(t){const e=W.toDamage(t.event);this.logAct(!1,e.srcCreat),e.srcCreat.buff(this.level,this.level),x.triggerDone()}}class De extends P{constructor(t){super(t),this.rarity="H",this.iAttack=this.level+2,this.iHealth=this.iAttack;const e=this.cardCode();e==="SFA"?this.steel():e==="RFA"?this.root():e==="HFA"?this.hell():e==="SGA"&&this.storm(),this.text=`Forge: ${this.name} gets ${m.jr9(this.level,this.level)} for each ${m.factionText(this.faction)} card in your hand.`}hell(){this.faction="N",this.name="Hellforged Avatar",this.iRegen=this.level,this.tribe.push("AB")}root(){this.faction="U",this.name="Rootforged Avatar",this.iBT=!0,this.tribe.push("HM")}steel(){this.faction="A",this.name="Steelforged Avatar",this.iArmor=this.level,this.tribe.push("CY")}storm(){this.faction="T",this.name="Stormforged Avatar",this.iMobile=this.level,this.tribe.push("MT")}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}jr8(t){const e=W.toEnterField(t.event),r=k.toPlayer(t.owner).hand.filter(s=>I.getCard(s).faction===this.faction).length;if(r>0){const s=r*this.level;e.creature.buff(s,s)}x.triggerDone()}}class U extends P{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["COZ"]:()=>this.cooze(),["DZA"]:()=>this.dozer(),["FWG"]:()=>this.feywing(),["FUN"]:()=>this.funguy(),["POZ"]:()=>this.purpz(),["NSD"]:()=>this.fixedSeedling(1),["OOZ"]:()=>this.nooze(),["RPT"]:()=>this.raptor(),["SPL"]:()=>this.minion(),["SXP"]:()=>this.fixedSapling(5),["SXD"]:()=>this.fixedSeedling(3),["SXT"]:()=>this.fixedTreefolk(7),["SDL"]:()=>this.minion(),["SPN"]:()=>this.nekSpirit(),["SPU"]:()=>this.uspirit(),["XYR"]:()=>this.yuruSpirit(),["TFK"]:()=>this.minion(),["TFD"]:()=>this.fixedTreefolk(this.boof5714),["TFF"]:()=>this.tfFight(),["TTF"]:()=>this.fixedTreefolk(3),["ZTR"]:()=>this.zimus(),["ZBS"]:()=>this.threeZomb(),["ZST"]:()=>this.strideZomb(),["ZMB"]:()=>this.commonZomb()}[t]}constructor(t){super(t),this.rarity="T";const e=this.cardCode();this.imgKey=e,this.minLevel=this.level,this.maxLevel=this.level,this.lookup(e)()}image(t){return this.rawImage(this.imgKey,t)}static fgoc(t){return "FGO"+t}fixedNekSpirit(t){this.faction="N",this.rarity="T",this.name="Spirit",this.tribe.push("ST"),this.iAttack=t,this.iHealth=t,this.imgKey=`${"SPN"}${this.level}`}nekSpirit(){this.fixedNekSpirit(this.boof51015)}yuruSpirit(){this.fixedNekSpirit(this.boof5814)}static purpOzC(t){return "POZ"+t}oozer(t){this.faction="N",this.rarity="T",this.name="Oozeling",this.tribe.push("OZ"),this.iHealth=this.iAttack,this.imgKey=t?"POZ":"OOZ"}purpz(){this.iAttack=this.boof135,this.oozer(!0)}nooze(){this.iAttack=this.boof4711,this.oozer(!1)}cooze(){this.iAttack=1,this.oozer(!1),this.hints=["RT"]}minion(){this.iAttack=U.minionBuff(this.level),this.plont(),this.name=U.minionName(this.level),this.hints=["RT"]}static tffc(t){return "TFF"+t}static minionCode(t){return(t===1?"SDL":t===2?"SPL":"TFK")+t}static minionName(t){return t===1?"Seedling":t===2?"Sapling":"Treefolk"}static minionBuff(t){return t===1?1:t===2?3:5}plont(){this.faction="U",this.iHealth=this.iAttack,this.tribe.push("PL")}fixedSapling(t){this.iAttack=t,this.plont(),this.name=U.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.iAttack=t,this.plont(),this.name=U.minionName(1),this.imgKey="SDL",this.hints=["RT"]}fixedTreefolk(t){this.iAttack=t,this.plont(),this.name=U.minionName(3),this.imgKey="TFK"}tfFight(){this.iAttack=this.boof91421,this.plont(),this.name=U.minionName(3),this.imgKey="TFK"}dozer(){this.faction="U",this.name="Dozer, the Awakened",this.iAttack=this.level*3+6,this.iHealth=this.iAttack,this.iAggro=!0,this.iBT=!0,this.tribe.push("BR"),this.imgKey=this.code,this.text=`${this.name} enters play with health equal to the Dozer, the Dormant it replaced.`}feywing(){this.faction="U",this.name="Feywing",this.iAttack=9,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("DG")}funguy(){this.name="Funguy",this.iAttack=this.lValN([6,12,14]),this.plont(),this.minLevel=1,this.maxLevel=3,this.hints=["DL"]}raptor(){this.faction="U",this.name="Raptor",this.iAttack=1,this.iHealth=1,this.tribe.push("DN"),this.hints=["RT"]}uspirit(){this.faction="U",this.name="Spirit",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("ST")}static zomc(t){return "ZMB"+t}zimus(){this.faction="N",this.rarity="L",this.name="Zimus, the Returned",this.tribe.push("ZB"),this.iAttack=10,this.iHealth=5,this.imgKey=`${"ZTU"}2`}zomb(t,e){this.faction="N",this.rarity="T",this.name="Zombie",this.tribe.push("ZB"),this.iAttack=t,this.iHealth=e,this.imgKey="ZMB"}commonZomb(){const t=this.boof359;this.zomb(t,t)}threeZomb(){this.zomb(3,3)}strideZomb(){this.zomb(this.lValN([4,8,10]),this.boof369)}}class lt extends yt{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ()},["ABE"]:{c:()=>this.edicC(),z:()=>this.edicZ()},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ()},["COD"]:{c:()=>this.chontC(),z:()=>this.chontZ()},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ()},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ()},["DGW"]:{c:()=>this.drwkC(),z:()=>this.drwkZ()},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ()},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ()},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ()},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ()},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ()},["IVS"]:{c:()=>this.infvC(),z:()=>this.infvZ()},["LOD"]:{c:()=>this.lashC(),z:()=>this.lashZ()},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ()},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ()},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ()},["PLW"]:{c:()=>this.palwC(),z:()=>this.palwZ()},["PTB"]:{c:()=>this.phyC(),z:()=>this.phyZ()},["PYS"]:{c:()=>this.pyreC(),z:()=>this.pyreZ()},["ROK"]:{c:()=>this.rokC(),z:()=>this.rokZ()},["STS"]:{c:()=>this.stsC(),z:()=>this.stsZ()},["SNP"]:{c:()=>this.pulseC(),z:()=>this.pulseZ()},["SRD"]:{c:()=>this.sradC(),z:()=>this.sradZ()},["SIV"]:{c:()=>this.beesC(),z:()=>this.beesZ()},["TST"]:{c:()=>this.talinC(),z:()=>this.talinZ()},["TRN"]:{c:()=>this.turnbC(),z:()=>this.turnbZ()},["VCH"]:{c:()=>this.verdC(),z:()=>this.verdZ()},["WOD"]:{c:()=>this.wdenC(),z:()=>this.wdenZ()}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){return this.cardCode()==="NSH"?this.leveledImage(t):this.fixedImage(t)}playTargets(){const t=super.playTargets();if(this.cardCode()==="ABE"&&this.aeSides().some(r=>r.length===0))return t;const e=w.boardTarget("CARD",this.code);return t.push(e),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),v.spellCast()}ddf8(t){return St.extractCardCode(t.trigger.logicCode)==="DGW"&&t.trigger.type==="TE"}jr8(t){if(St.extractCardCode(t.trigger.logicCode)==="DGW"){const r=f.jr5(t.trigger.creatId);r.status==="A"&&O.destroy(r,this.code)}x.triggerDone()}apulseC(){this.faction="A",this.rarity="C",this.name="Aegis Pulse",this.text=`Each friendly creature gets Armor ${this.boof234}.`}apulseZ(){const t=this.boof234;f.ddf1().forEach(e=>{e.addArmor(t)})}aeSides(){return[f.qPlayerCreats(!0),f.qPlayerCreats(!1)]}edicC(){this.faction="A",this.rarity="H",this.name="Ambriel's Edict",this.maxLevel=1,this.overload=!0,this.text="If each player has at least one creature in play, destroy all but the highest attack creature that each player controls.~Then discard you hand."}edicZ(){const t=this.aeSides(),e=N.tick();let r=[];t.forEach(g=>{if(g.length>1){let y=[],C=-999999;g.forEach(D=>{D.attack>C?(C=D.attack,r.push(...y),y=[D]):D.attack===C?y.push(D):r.push(D)}),y.length>1&&(y.splice(S.randInt(0,y.length),1),r.push(...y))}}),r.forEach(g=>O.destroy(g,this.code,e));const s=k.getActive(),h=v.playPosition(),u=s.hand.length;for(let g=u-1;g>-1;g--)g!==h&&(s.discard.push(s.hand[g]),s.hand.splice(g,1),v.shiftPlayCard(g))}get ctlboof(){return(this.level-1)*2}ctlC(){this.faction="T",this.rarity="L",this.name="Call the Lightning";const t=this.level>1?` gets ${m.jr9(this.ctlboof,0)} this turn. Those creatures`:"";this.text=`Each friendly creature${t} battles an additional time this turn.`}ctlZ(){const t=this.ctlboof;f.ddf1().forEach(e=>{const r=p.mod("AT",t,this.code);r.expiry="ET",e.addMod(r),e.extraBattles+=1})}chontC(){this.faction="T",this.rarity="R",this.name="Chant of Dragonwatch",this.maxLevel=1,this.text="Deal X damaage to each enemy creature, where X is your rank."}chontZ(){const t=k.getActive().rank,e=N.tick();f.qEnemyCreats().forEach(r=>{r.hurtDirect(t,this.code,e)})}dcurC(){this.faction="N",this.rarity="R",this.name="Death Current";const t=this.lValS(["a level 2 or lower","an","two"]);this.text=`Destroy ${t} enemy creature at random.`}dcurZ(){const t=this.dCurrHunter(),e=t.length;if(e>0){const r=S.randInt(0,e),s=N.tick();O.destroy(t[r],this.code,s),this.level===3&&e>1&&(t.splice(r,1),O.destroy(t[S.randInt(0,e-1)],this.code,s))}}dCurrHunter(){const t=p.crEnemyTarg();return t.level=w.ddf2(this.level+1),f.creatByTarget(t)}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${m.jr9(this.boof4812n,0)}.`}digiZ(){const t=this.boof4812n;f.qEnemyCreats().forEach(e=>{e.buff(t,0)})}drwkC(){this.faction="T",this.rarity="L",this.name="Dragonwake",this.text=`Search your deck for a ${m.levelGateText(this.level+1,!0)}Dragon and Spawn a copy of it. It gets Aggressive${this.level===3?".":' and "At the end of your turn, destroy this.'}`}drwkZ(){const t=p.target("DK");t.tribe="DG",t.level=w.ddf2(this.level+1),t.player="F";const e=w.deckByTarget(t),r=e.length;if(r>0){const s=f.birth(e[S.randInt(0,r)][0],"S",k.getActiveB());if(s&&(s.aggressive=!0,this.level<3)){const h=s.jr4("TE",this.code);h.creatId=s.id,h.changes=!0}}}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${m.jr9(t,t)}.`}epiZ(){const t=this.boof246n,e=p.crEnemyTarg();f.creatByTarget(e).forEach(r=>{r.buff(t,t)})}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${m.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;f.ddf1().forEach(e=>{e.buff(t,t),this.level===3&&(e.breakthrough=!0)})}get fszap(){return this.level+4}fstormC(){this.faction="T",this.rarity="H",this.name="Firestorm",this.text=`Deal ${this.fszap} damage to each creature.`}fstormZ(){const t=this.fszap,e=N.tick();f.qActiveCreats().forEach(r=>{r.hurtDirect(t,this.code,e)})}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${m.jr9(-1*t,0)}. Each friendly creature gets ${m.jr9(t,0)}.`}mealZ(){const t=this.boof234,e=k.getActiveB();f.qActiveCreats().forEach(r=>{const s=r.owner===e?t:-1*t;r.buff(s,0)})}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${m.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,e=p.crFriendTarg();f.creatByTarget(e).forEach(r=>{r.buff(0,t)})}infvC(){this.faction="N",this.rarity="C",this.name="Infernal Visage";const t=this.boof246;this.text=`Each friendly creature in a side lane gets ${m.jr9(t,t,!0)} and Regenerate ${this.level}.`}infvZ(){const t=this.boof246,e=p.crFriendTarg();e.lanes=[1,5],f.creatByTarget(e).forEach(r=>{r.buff(t,t),r.addRegen(this.level)})}lashC(){this.faction="U",this.rarity="L",this.name="Lash of Demara",this.text=`Each enemy creature gets Poison ${this.level+2}.`}lashZ(){const t=this.level+2;f.qEnemyCreats().forEach(e=>{e.addPoison(t)})}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=I.getCard(this.ndc());this.text=`Spawn a ${m.tokName(t)}.`}shriekZ(){f.birth(this.ndc(),"S",k.getActiveB())}ndc(){return "NDR"+this.level}noxC(){this.faction="U",this.rarity="R",this.name="Noxious Cloud",this.text=`Each enemy creature gets Poison ${this.boof246}.`}noxZ(){const t=this.boof246;f.qEnemyCreats().forEach(e=>{e.addPoison(t)})}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${m.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)f.ddf1().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;f.ddf1().forEach(e=>{e.buff(t,0)})}}palwC(){this.faction="A",this.rarity="R",this.name="Palladium Wave",this.maxLevel=1,this.text=`Each enemy creature gets ${m.jr9(-1,0).replaceAll("1","X")}, where X is two times your rank.`}palwZ(){const t=-2*k.getActive().rank;f.qEnemyCreats().forEach(e=>{e.buff(t,0)})}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=I.getCard(U.minionCode(this.level));this.text=`Put a ${m.tokName(t)} into each players available lanes.`}phyZ(){const t=U.minionCode(this.level),e=N.tick();[!0,!1].forEach(r=>{f.emptyLanes(r).forEach(s=>{f.birth(t,"P",r,s,e)})})}pyreC(){this.faction="T",this.rarity="C",this.name="Pyre Song",this.text=`Each friendly creature deals ${this.level} damage to each enemy creature.`}pyreZ(){const t=this.level,e=N.tick(),r=f.qEnemyCreats();f.ddf1().forEach(s=>{r.forEach(h=>{h.hurtDirect(t,s.code,e)})})}rokC(){this.faction="T",this.rarity="L",this.name="Rage of Kadras",this.overload=!0,this.maxLevel=1,this.text="Each friendly Tempys creature gets +1 attack and deals damage equal to its attack to the creature opposing it."}rokZ(){const t=N.tick(),e=p.crFriendTarg();e.faction="T",f.creatByTarget(e).forEach(r=>{r.buff(1,0);const s=r.opposed;s&&s.hurtDirect(r.attack,r.code,t)})}stsC(){this.faction="U",this.rarity="C",this.name="Scatter the Seeds";const t=I.getCard(U.minionCode(this.level));this.text=`Spawn three ${m.tokName(t)}s.`}stsZ(){const t=U.minionCode(this.level),e=N.tick();[1,2,3].forEach(r=>{f.birth(t,"S",k.getActiveB(),void 0,e)})}get spboof(){return(this.level+1)*-2}pulseC(){this.faction="A",this.rarity="H",this.name="Sonic Pulse",this.text=`Each enemy creature gets ${m.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;f.qEnemyCreats().forEach(e=>{e.buff(t,0)})}sradC(){this.faction="U",this.rarity="C",this.name="Soothing Radiance",this.text=`Heal ${this.boof61224} damage from each friendly creature.`}sradZ(){const t=this.boof61224;f.ddf1().forEach(e=>{e.heal(t)})}beec(){return "KBE"+this.level}beesC(){this.faction="U",this.rarity="H",this.name="Stinging Invocation";const t=I.getCard(this.beec());this.text=`Spawn one to three ${m.tokName(t)}s.`}beesZ(){const t=this.beec(),e=N.tick(),r=S.randInt(2,5);[1,2,3].forEach(s=>{s{const r=p.mod("AT",t);r.expiry="ET",e.addMod(r)})}talinTarg(){const t=p.crFriendTarg();return t.faction="T",f.creatByTarget(t)}turnbC(){this.faction="T",this.rarity="H",this.name="Turnabout",this.isFree=this.level===3;const t=this.boof235;this.text=`Each creature gets ${m.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,e=-1*t;f.qActiveCreats().forEach(r=>{const s=p.mod("AT",t),h=p.mod("HL",e),u=p.mod("MH",e);s.expiry="ET",h.expiry="ET",u.expiry="ET",r.addMod(s),r.addMod(h),r.addMod(u)})}verdC(){this.faction="U",this.rarity="H",this.name="Verdant Charge";const t=this.verdb;this.text=`Each friendly creature gets ${m.jr9(t,t,!0)} and Regenerate ${t}.`}verdZ(){const t=this.verdb;f.ddf1().forEach(e=>{e.buff(t,t),e.addRegen(t)})}get verdb(){return this.lValN([1,3,6])}wdenC(){this.faction="U",this.rarity="R",this.name="Whispers of Dendris",this.maxLevel=1,this.text=`Each friendly creature gets ${m.jr9(1,1).replaceAll("1","X")}, where X is your rank.`}wdenZ(){const t=k.getActive().rank;f.ddf1().forEach(e=>{e.buff(t,t)})}}class Lr extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Borean Mystic",this.iAttack=this.boof4814,this.iHealth=this.boof71118,this.tribe.push("WN","AS"),this.text=`Activate: Move another friendly creature to an available lane adjacent to ${this.name}.`}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=f.jr5(e[1]),h=this.emptySloots(s,r.id);h.push(v.cancelAction()),v.ddf5(h)}else{const r=f.jr5(e[1]),s=f.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),r.endActivation()}}emptySloots(t,e=""){return v.emptyAdjacents(t,S.enTil("P2",t.id,e))}buddies(t){return w.toActions(p.crFriendNotMeActTarg("CARD",t,this.code,S.enTil("P1",t)))}}class Gr extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Bron, Wild Tamer",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hints=["RD"];const e=this.boof357;this.bonus={exist:this.ddp9(0,e*2,0,0)},this.text=`Upgrade Dinosaur: Replace Bron with a level ${this.level} Dino Knight.~When this ${m.dbdtap()}, heal ${e} damage from each other friendly creature.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("UP",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="UP"){const r=W.toReplaced(t.event).replCreat;r.isTribe("DN")&&f.birth("DNK"+this.level,"R",r.owner,r.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,r=p.crNotMeTarg(t.creatId);r.player=k.toTarget(t.owner),f.creatByTarget(r).forEach(h=>h.heal(e)),x.triggerDone()}}}class $r extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Brightsteel Gargoyle",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("RB"),this.text=`At the end of your turn, ${this.name} gets Armor ${this.boof2510} and Defender until the end of the next turn.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("PT",this.code),r}ddf8(t){return t.trigger.type==="PT"?t.event.playerA===t.owner:!1}jr8(t){const e=p.mod("AR",this.boof2510,t.creatId),r=p.mod("DF",!0,t.creatId);e.expiry="ET",r.expiry="ET";const s=f.jr5(t.creatId);s.addMod(e),s.addMod(r),x.triggerDone()}}class Or extends yt{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Bullwark Bash",this.text=`Deal damage equal to ${this.level>1?this.level+"x ":""}the Armor on a friendly creature to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");e.hasArmor=!0,t.push(e)}return t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=this.enemyTargActions(r.id);s.push(v.cancelAction()),v.ddf5(s)}else{const r=f.ddf6(t),s=f.jr5(e[1]);this.logSpell(s),r.hurtDirect(s.armor*this.level,this.code),v.spellCast()}}enemyTargActions(t=""){const e=p.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return w.toActions(e)}}class Wr extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Byzerak Spitemage",this.iAttack=this.boof369,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("HM"),this.text=`Allied Nekrium: When ${this.name} ${m.dbdtac(this.level)}, destroy it.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&e.isCreatSrc&&e.isCreatTarg&&e.dmg>0&&e.srcId===t.creatId&&w.levelTestCommon(e.hurtCreat.level,this.level)}else return!1}jr8(t){if(t.trigger.type==="FR"&&M.allied("N")){const e=f.jr5(t.creatId);e.jr4("DM",this.code),e.changed=!0}else if(t.trigger.type==="DM"){const r=W.toDamage(t.event).hurtCreat;r.status==="A"&&O.destroy(r,this.code)}x.triggerDone()}}class Ur extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Cercee, Hand of Varna",this.iAttack=this.lValN([1,3,5,7]),this.iHealth=this.lValN([6,10,20,40]),this.tribe.push("FB"),this.iMobile=1,this.maxLevel=4;const e=this.level===4?`When ${this.name} ${m.dbdtap()}, deal damamge to that player equal to their health.~`:"";this.text=e+`When ${this.name} ${m.dbdtac(this.level)}, destroy that creature.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);if(e.battle&&e.isCreatSrc&&e.srcId===t.creatId){if(this.level===4)return!0;if(e.isCreatTarg){const r=e.hurtCreat;return w.levelTestCommon(r.level,this.level)}}}return!1}jr8(t){const e=W.toDamage(t.event);if(e.isCreatTarg){const r=e.hurtCreat;r.status==="A"&&O.destroy(r,this.code)}else k.hurtDirect(e.hurtPlayer,e.hurtPlayer.health,this.code);x.triggerDone()}}class dt extends P{lookup(t){return{["BSW"]:{c:()=>this.bswC(),a:(r,s)=>this.bswA(r,s),t:r=>this.bswT(r)},["CCS"]:{c:()=>this.ccsC(),a:(r,s)=>this.ccsA(r,s),t:r=>this.ccsT(r)},["CGL"]:{c:()=>this.clordC(),a:(r,s)=>this.clordA(r,s),t:r=>this.clordT(r)},["CSH"]:{c:()=>this.cswC(),a:(r,s)=>this.cswA(r,s),t:r=>this.cswT(r)},["FFU"]:{c:()=>this.ffuC(),a:(r,s)=>this.ffuA(r,s),t:r=>this.ffuT(r)},["FFS"]:{c:()=>this.ffsC(),a:(r,s)=>this.ffsA(r,s),t:r=>this.ffsT(r)},["FSH"]:{c:()=>this.fssC(),a:(r,s)=>this.fssA(r,s),t:r=>this.fssT(r)},["KOD"]:{c:()=>this.kodC(),a:(r,s)=>this.kodA(r,s),t:r=>this.kodT(r)},["LOD"]:{c:()=>this.lashC(),a:(r,s)=>this.lashA(r,s),t:r=>this.lashT(r)},["MBP"]:{c:()=>this.mbpC(),a:(r,s)=>this.mbpA(r,s),t:r=>this.mbpT(r)},["MND"]:{c:()=>this.mndC(),a:(r,s)=>this.mndA(r,s),t:r=>this.mndT(r)},["NCS"]:{c:()=>this.ncsC(),a:(r,s)=>this.ncsA(r,s),t:r=>this.ncsT(r)},["NXG"]:{c:()=>this.nxgC(),a:(r,s)=>this.nxgA(r,s),t:r=>this.nxgT(r)},["NFF"]:{c:()=>this.nffC(),a:(r,s)=>this.nffA(r,s),t:r=>this.nffT(r)},["OHV"]:{c:()=>this.orghC(),a:(r,s)=>this.orghA(r,s),t:r=>this.orghT(r)},["PPM"]:{c:()=>this.ppmC(),a:(r,s)=>this.ppmA(r,s),t:r=>this.ppmT(r)},["PSC"]:{c:()=>this.pcoilC(),a:(r,s)=>this.pcoilA(r,s),t:r=>this.pcoilT(r)},["SGF"]:{c:()=>this.siggyC(),a:(r,s)=>this.siggyA(r,s),t:r=>this.siggyT(r)},["SRM"]:{c:()=>this.srmdC(),a:(r,s)=>this.srmdA(r,s),t:r=>this.srmdT(r)},["SSA"]:{c:()=>this.ssaC(),a:(r,s)=>this.ssaA(r,s),t:r=>this.ssaT(r)},["SWM"]:{c:()=>this.swmC(),a:(r,s)=>this.swmA(r,s),t:r=>this.swmT(r)},["UCM"]:{c:()=>this.ucmC(),a:(r,s)=>this.ucmA(r,s),t:r=>this.ucmT(r)},["UIM"]:{c:()=>this.uimC(),a:(r,s)=>this.uimA(r,s),t:r=>this.uimT(r)},["WMR"]:{c:()=>this.warmC(),a:(r,s)=>this.warmA(r,s),t:r=>this.warmT(r)},["WWR"]:{c:()=>this.wwrC(),a:(r,s)=>this.wwrA(r,s),t:r=>this.wwrT(r)},["WFS"]:{c:()=>this.wfsC(),a:(r,s)=>this.wfsA(r,s),t:r=>this.wfsT(r)},["XSH"]:{c:()=>this.shambC(),a:(r,s)=>this.shambA(r,s),t:r=>this.shambT(r)},["ZPM"]:{c:()=>this.zpmC(),a:(r,s)=>this.zpmA(r,s),t:r=>this.zpmT(r)}}[t]}targAction(t,e,r){this.lookup(t).a(e,r)}actTargets(t,e){return this.lookup(t).t(e)}xl=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return this.doubleActivator()&&(r.jr4("TS",this.code),this.addExtraActivate(r)),r}canActivate(t){return w.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){const e=w.toActions([this.actTargets(this.cardCode(),t),w.buttonTarget("CANC")]);v.ddf5(e)}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.logAct(!0,this.xl?e:void 0),this.targAction(this.cardCode(),e,r),r.endActivation()}makeCreatTarg(t){return p.crActTarg("CARD",this.code,t.id)}makeOtherCreatTarg(t){const e=this.makeCreatTarg(t);return e.notMe=t.id,e}doubleActivator(){return this.code==="CGL"+"3"||this.code==="XSH"+"3"}ddf8(t){return St.extractCardCode(t.trigger.logicCode)==="KOD"&&(t.trigger.type==="PT"||t.trigger.type==="VN")?!0:t.trigger.type==="TS"&&this.doubleActivator()?t.event.playerA===t.owner:super.ddf8(t)}jr8(t){if(t.trigger.type==="VN"){const e=t.event,r=f.jr5(e.creatId);f.birth(r.code,"S",t.owner),x.triggerDone()}else if(t.trigger.type==="PT"){const e=t.trigger.customCode,r=f.jr5(t.creatId);r.triggers.filter(h=>h.customCode===e).forEach(h=>r.removeTrigger(h)),x.triggerDone()}else if(t.trigger.type==="TS"){const e=f.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}bswC(){this.faction="T",this.rarity="C",this.name="Borean Stormweaver",this.iAttack=this.boof4816,this.iHealth=this.lValN([6,10,20]),this.tribe.push("GT"),this.xl=!1;const t=this.boof234;this.text=`Activate: Deal ${t} damage to a creature.`}bswT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}bswA(t,e){t.hurtDirect(this.boof234,this.code)}ccsC(){this.faction="N",this.rarity="C",this.name="Catacomb Spider",this.iAttack=this.boof4815,this.iHealth=this.lValN([5,10,16]),this.tribe.push("SP");const t=this.boof246;this.text=`Activate: Give another creature Regenerate ${t}.`}ccsT(t){const e=this.makeOtherCreatTarg(t);return e.canRegen=!0,e.hint=["BF"],e}ccsA(t,e){t.addRegen(this.boof246)}clordC(){this.faction="N",this.rarity="H",this.name="Contagion Lord",this.iAttack=this.boof4914,this.iHealth=this.iAttack+3,this.tribe.push("AB"),this.xl=!1,this.text="Activate, destroy a friendly Abomination: You may play an additional card this turn.",this.level===3&&(this.text+="~You may use this ability twice per turn.")}clordT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="AB",e}clordA(t,e){O.destroy(t,this.code),M.regularPlays+=1}cswC(){this.faction="A",this.rarity="C",this.name="Cypien Shieldwarden",this.iAttack=this.boof4610,this.iHealth=this.boof61016,this.tribe.push("HM");const t=this.boof246;this.text=`Activate: Give a creature Armor ${t} this turn.`}cswT(t){const e=this.makeCreatTarg(t);return e.canArmor=!0,e.hint=["BF"],e}cswA(t,e){const r=p.mod("AR",this.boof246,e.id);r.expiry="ET",t.addMod(r)}ffuC(){this.faction="T",this.rarity="H",this.name="Firefist Uranti",this.iAttack=this.boof357,this.iHealth=this.boof71116,this.tribe.push("FR","YT"),this.xl=!1,this.text=`Activate: Deal damage equal to ${this.name}'s attack to a creature.`}ffuT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],t.attack<1&&(e.victims="???"),e}ffuA(t,e){t.hurtDirect(e.attack,this.code)}ffsC(){this.faction="T",this.rarity="R",this.name="Flamefury Shaman",this.iAttack=this.boof369,this.iHealth=this.boof81116,this.tribe.push("HM"),this.text=`Activate: Grant another creature ${m.jr9(this.iAttack,0)} this turn.`}ffsT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}ffsA(t,e){const r=p.mod("AT",this.iAttack,e.id);r.expiry="ET",t.addMod(r)}fssC(){this.faction="T",this.rarity="R",this.name="Flamestoke Shaman",this.iAttack=this.boof61218,this.iHealth=this.boof3712,this.tribe.push("HM"),this.text=`Activate: Grant an adjacent ${m.levelGateText(this.level,!0)}creature Aggressive.`}fssT(t){const e=this.makeCreatTarg(t);return e.level=w.ddf2(this.level),e.lanes=t.adjacent,e.player="F",e}fssA(t,e){t.aggressive=!0}kodC(){this.faction="N",this.rarity="L",this.name="Keeper of the Damned",this.iAttack=this.boof5815,this.iHealth=this.boof61017,this.tribe.push("ZB"),this.text=`Activate: another friendly ${m.levelGateText(this.level,!0)}creature gets "Vengeance: Spawn this" this turn.`}kodT(t){const e=this.makeOtherCreatTarg(t);return e.level=w.ddf2(this.level),e.player="F",e}kodA(t,e){const r=t.jr4("VN",this.code);r.customCode=e.id,r.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e.id}lashC(){this.faction="U",this.rarity="L",this.name="Demara, Herald of Affliction",this.iAttack=14,this.iHealth=20,this.tribe.push("NG"),this.text="Activate: Give an enemy creature with Poison Defender.~Forge: Each enemy creature gets Poison 6."}lashT(t){const e=this.makeCreatTarg(t);return e.player="E",e.hasPoison=!0,e.canDefender=!0,e}lashA(t,e){t.defender=!0}mbpC(){this.faction="U",this.rarity="H",this.name="Mossbeard Patriarch",this.iAttack=this.boof137,this.iHealth=this.boof81220,this.tribe.push("PL"),this.text=`Activate: Give another creature ${m.jr9(0,this.boof468)}.`}mbpT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mbpA(t,e){t.buff(0,this.boof468)}mndC(){this.faction="A",this.rarity="R",this.name="Munitions Drone",this.iAttack=this.boof137,this.iHealth=this.boof6814,this.tribe.push("RB"),this.text=`Activate: Give another creature ${m.jr9(this.boof357,0)}.`}mndT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mndA(t,e){t.buff(this.boof357,0)}ncsC(){this.faction="N",this.rarity="R",this.name="Necroslime",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.xl=!1;const t=this.boof248;this.text=`Activate, deal 3 damage to another friendly creature: ${this.name} gets ${m.jr9(t,t)}.`}ncsT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}ncsA(t,e){const r=this.boof248;t.hurtDirect(3,this.code),e.buff(r,r)}nxgC(){this.faction="A",this.rarity="H",this.name="Nexus Gunner",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("HM"),this.text=`Activate: Give a creature ${m.jr9(this.iAttack,0)}. Use this ability only if ${this.name} is in the center lane.`}nxgT(t){const e=this.makeCreatTarg(t);return t.lane!==3?e.victims="???":e.hint=["BF","BB"],e}nxgA(t,e){t.buff(this.iAttack,0)}nffC(){this.faction="U",this.rarity="L",this.name="Nuada, Faith's Flourish",this.iAttack=this.boof246,this.iHealth=this.lValN([10,17,25]),this.iDefend=!0,this.tribe.push("TK"),this.xl=!1;const t=I.getCard(U.tffc(this.level));this.text=`Activate: Replace a friendly Plant with a ${m.tokName(t)}.`}nffT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="PL",e}nffA(t,e){f.birth(U.tffc(this.level),"R",e.owner,t.lane)}orghC(){this.faction="N",this.rarity="R",this.name="Organ Harvester",this.iAttack=this.lValN([2,6,9]),this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1,this.text=`Activate, destroy ${this.name}: Destroy a ${m.levelGateText(this.level,!0)}creature.`}orghT(t){const e=this.makeOtherCreatTarg(t);return e.level=w.ddf2(this.level),e.hint=["KL"],e}orghA(t,e){const r=N.tick();O.destroy(t,this.code,r),O.destroy(e,this.code,r)}ppmC(){this.faction="A",this.rarity="R",this.name="Palladium Pulsemage",this.iAttack=this.lValN([2,8,12]),this.iHealth=this.lValN([7,12,15]),this.tribe.push("HM"),this.text=`Activate: give a creature ${m.jr9(this.boof4812n,0)} this turn.`}ppmT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}ppmA(t,e){const r=p.mod("AT",this.boof4812n,e.id);r.expiry="ET",t.addMod(r)}pcoilC(){this.faction="U",this.rarity="R",this.name="Poisoncoil",this.iAttack=this.boof357,this.iHealth=this.boof71013,this.iDefend=!0,this.tribe.push("SN"),this.text=`Activate: Give another creature Poison ${this.boof135}.`}pcoilT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["PN","DF"],e}pcoilA(t,e){t.addPoison(this.boof135)}siggyC(){this.faction="N",this.rarity="H",this.name="Sigmund Fraud",this.iAttack=this.boof357,this.iHealth=this.lValN([9,14,19]),this.iDefend=!0,this.tribe.push("AB"),this.xl=!1;const t=this.boof4812;this.text=`Activate, destroy another friendly creature: Deal ${t} damage to the enemy player and you gain ${t} health.`}siggyT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}siggyA(t,e){O.destroy(t,this.code);const r=this.boof4812;k.hurtDirect(!e.owner,r,this.code),k.heal(e.owner,r)}srmdC(){this.faction="N",this.rarity="H",this.name="Sorrow Maiden",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.xl=!1,this.text=`Activate: Destroy an enemy creature with ${this.iAttack} or less attack.`}srmdT(t){const e=this.makeCreatTarg(t);return e.player="E",e.maxAttack=this.iAttack,e}srmdA(t,e){O.destroy(t,this.code)}ssaC(){this.faction="N",this.rarity="H",this.name="Spitesower Acolyte",this.iAttack=this.boof234,this.iHealth=this.lValN([8,14,22]),this.tribe.push("HM");const t=this.boof246n;this.text=`Activate, deal ${-t} damage to ${this.name}: Give a creature ${m.jr9(t,t)}.`}ssaT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","BB"],e}ssaA(t,e){const r=this.boof246n,s=N.tick();e.hurtDirect(-r,this.code,s),t.buff(r,r,s)}swmC(){this.faction="A",this.rarity="R",this.name="Steelwelder Medic",this.iAttack=this.lValN([3,5,13]),this.iHealth=this.boof61014,this.tribe.push("HM"),this.text=`Activate: Give another creature Armor ${this.level}.`}swmT(t){const e=this.makeOtherCreatTarg(t);return e.canArmor=!0,e.hint=["BF","BB"],e}swmA(t,e){t.addArmor(this.level)}ucmC(){this.faction="T",this.rarity="R",this.name="Uranti Cryomancer",this.iAttack=this.boof247,this.iHealth=this.lValN([8,13,17]),this.tribe.push("IC","YT"),this.xl=!1,this.text=`Activate: Deal ${this.boof135} damage to a creature.`}ucmT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}ucmA(t,e){t.hurtDirect(this.boof135,this.code)}uimC(){this.faction="T",this.rarity="C",this.name="Uranti Icemage",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.lValN([8,13,20]),this.tribe.push("IC","YT"),this.text="Activate: Negate Defender this turn."}uimT(t){const e=this.makeCreatTarg(t);return e.hint=["BB"],e}uimA(t,e){const r=p.mod("ND",!0,e.id);r.expiry="ET",t.addMod(r)}warmC(){this.faction="A",this.rarity="H",this.name="War Merchant",this.iAttack=this.boof468,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("HM"),this.text=`Activate: Give a creature in a center lane ${m.jr9(this.iAttack,this.level===3?this.iAttack:0)}.`}warmT(t){const e=this.makeCreatTarg(t);return e.lanes=3,e.hint=["BF","BB"],e}warmA(t,e){t.buff(this.iAttack,this.level===3?this.iAttack:0)}wwrC(){this.faction="U",this.rarity="C",this.name="Weirwood Ranger",this.iAttack=this.boof51015,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.text=`Activate: Give another creature ${m.jr9(this.level,this.level)}.`}wwrT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF","BB"],e}wwrA(t,e){t.buff(this.level,this.level)}wfsC(){this.faction="N",this.rarity="H",this.name="Witherfrost Succubus",this.iAttack=this.boof147,this.iHealth=this.boof61018,this.tribe.push("DM");const t=-this.boof357;this.text=`Activate: Give a creature ${m.jr9(t,t)} this turn.`}wfsT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}wfsA(t,e){const r=-this.boof357,s=p.mod("AT",r,e.id);s.expiry="ET",t.addMod(s);const h=p.mod("HL",r,e.id);h.expiry="ET",t.addMod(h);const u=p.mod("MH",r,e.id);u.expiry="ET",t.addMod(u)}shambC(){this.faction="N",this.rarity="L",this.name="Xithian Shambler",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1;let t="";this.level===3&&(t="~You may use this ability twice per turn."),this.text=`Activate, destroy an adjacent creature: ${this.name} moves into that creature's lane, then gets +attack and +health equal to that creature's attack and health.${t}`}shambT(t){const e=p.crFriendActTarg("CARD",this.code,t.id);return e.lanes=t.adjacent,e}shambA(t,e){const r=t.attack,s=t.health;O.destroy(t,this.code),e.move(t.lane),e.buff(r,s)}zpmC(){this.faction="T",this.rarity="R",this.name="Zephyr Mage",this.iAttack=this.boof4813,this.iHealth=this.boof61017,this.tribe.push("WN","AS"),this.text=`Activate: Give another ${m.levelGateText(this.level,!0)}creature Mobility ${this.level}.`}zpmT(t){const e=this.makeOtherCreatTarg(t);return e.level=w.ddf2(this.level),e.canMove=!0,e.hint=["BF","BB"],e}zpmA(t,e){t.addMobility(this.level)}}class We extends P{lookup(t){return{["CMF"]:{c:()=>this.aconC(),f:(r,s)=>this.aconF(r,s)},["FLH"]:{c:()=>this.flhC(),f:(r,s)=>this.flhF(r,s)},["TBB"]:{c:()=>this.tbbC(),f:(r,s)=>this.tbbF(r,s)}}[t]}targAction(t,e,r){this.lookup(t).f(e,r)}playTarg;optional=!1;notme=!1;ftext="";constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("AS",this.code);return s.interactive=!0,r}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.targAction(this.cardCode(),e,r),v.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const e=w.toActions(this.playTarg);e.length>0?(e.forEach(r=>{r.param=t.creatId}),this.optional&&e.push(v.noneEndTrigger()),v.ddf5(e)):x.triggerDone()}aconC(){this.faction="N",this.rarity="R",this.name="Calamity Fiend",this.iAttack=this.boof4814,this.iHealth=this.lValN([5,10,16]),this.tribe.push("DM");const t=-this.boof234;this.addSp("U",t),this.playTarg.player="E",this.ftext=`Give an enemy creature ${m.jr9(t,t)}.`}aconF(t,e){this.logAct(!1,t);const r=-this.boof234;t.buff(r,r)}flhC(){this.faction="T",this.rarity="C",this.name="Firelight Hunter",this.iAttack=this.boof468,this.iHealth=this.iAttack-2,this.tribe.push("HM"),this.playTarg.player="E",this.addSp("D",this.iAttack),this.ftext=`Deal ${this.iAttack} to an enemy creature.`}flhF(t,e){t.hurtDirect(this.iAttack,this.code)}tbbC(){this.faction="T",this.rarity="R",this.name="Totembound Berserker",this.iAttack=this.boof81318,this.iHealth=this.lValN([2,4,10]),this.tribe.push("GT"),this.playTarg.player="E",this.playTarg.level=w.ddf2(this.level),this.optional=!0,this.ftext=`You may move an enemy ${m.levelGateText(this.level,!0)}creature to the space opposing ${this.name}.`}tbbF(t,e){e.opposed||(this.logAct(!1,t),t.move(f.oppositeLane(e.lane)))}}class gt extends P{lookup(t){return{["ABM"]:{c:()=>this.mawC(),f:(r,s)=>this.mawF(r,s)},["AGC"]:{c:()=>this.aconC(),f:(r,s)=>this.aconF(r,s)},["BTI"]:{c:()=>this.binvC(),f:(r,s)=>this.binvF(r,s)},["BSR"]:{c:()=>this.bsrC(),f:(r,s)=>this.bsrF(r,s)},["BAW"]:{c:()=>this.bawC(),f:(r,s)=>this.bawF(r,s)},["CKB"]:{c:()=>this.cacC(),f:(r,s)=>this.cacF(r,s)},["CHA"]:{c:()=>this.chaC(),f:(r,s)=>this.chaF(r,s)},["CCR"]:{c:()=>this.ccC(),f:(r,s)=>this.ccF(r,s)},["FRI"]:{c:()=>this.friC(),f:(r,s)=>this.friF(r,s)},["FRV"]:{c:()=>this.freavC(),f:(r,s)=>this.freavF(r,s)},["GLF"]:{c:()=>this.gfiendC(),f:(r,s)=>this.gfiendF(r,s)},["GRW"]:{c:()=>this.grwC(),f:(r,s)=>this.grwF(r,s)},["GHT"]:{c:()=>this.grhC(),f:(r,s)=>this.grhF(r,s)},["MMH"]:{c:()=>this.houndC(),f:(r,s)=>this.houndF(r,s)},["MXW"]:{c:()=>this.mtxC(),f:(r,s)=>this.mtxF(r,s)},["NGB"]:{c:()=>this.ngbC(),f:(r,s)=>this.ngbF(r,s)},["PHS"]:{c:()=>this.phxsC(),f:(r,s)=>this.phxsF(r,s)},["RWD"]:{c:()=>this.rotC(),f:(r,s)=>this.rotF(r,s)},["SHY"]:{c:()=>this.schyC(),f:(r,s)=>this.schyF(r,s)},["STD"]:{c:()=>this.stdC(),f:(r,s)=>this.stdF(r,s)},["SEV"]:{c:()=>this.surzC(),f:(r,s)=>this.surzF(r,s)},["VNF"]:{c:()=>this.vnfC(),f:(r,s)=>this.vnfF(r,s)},["WBY"]:{c:()=>this.wbyC(),f:(r,s)=>this.wbyF(r,s)},["WBU"]:{c:()=>this.wbuC(),f:(r,s)=>this.wbuF(r,s)},["XDH"]:{c:()=>this.dogsC(),f:(r,s)=>this.dogsF(r,s)}}[t]}targAction(t,e,r){this.lookup(t).f(e,r)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}jr3(t,e){const r=super.jr3(t,e);if(this.forges){const s=r.jr4("FR",this.code);s.interactive=!0}return r}ddf8(t){return St.extractCardCode(t.trigger.logicCode)==="CKB"&&t.trigger.type==="TS"?!0:super.ddf8(t)}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.targAction(this.cardCode(),e,r),v.actionDone(!0)}jr8(t){const e=this.cardCode();if(t.trigger.type==="TS"&&e==="CKB"){this.logAct(!1),M.regularPlays+=1;const s=t.event,h=k.toPlayer(s.playerA),u=p.trigIdx(h.triggers,t.trigger);u>-1&&h.triggers.splice(u,1),x.triggerDone();return}if(e==="ABM"){const s=p.crFriendNotMeTarg(t.creatId);if(s.tribe="AB",f.creatByTarget(s).length===0){x.triggerDone();return}}this.notme&&(this.playTarg.notMe=t.creatId);const r=w.toActions(this.playTarg);r.length>0?(r.forEach(s=>{s.param=t.creatId}),this.optional&&r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}mawC(){this.faction="N",this.rarity="C",this.name="Abyssal Maw",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=-this.boof359;this.ftext=`If there is another friendly Abomination, give an enemy creature ${m.jr9(t,t)}.`}mawF(t,e){this.logAct(!1,t);const r=-this.boof359;t.buff(r,r)}aconC(){this.faction="A",this.rarity="C",this.name="Aegis Conscript",this.iAttack=this.boof3612,this.iHealth=this.boof6915,this.tribe.push("HM"),this.playTarg.canArmor=!0,this.playTarg.player="F",this.ftext=`Give a friendly creature Armor ${this.boof124}.`}aconF(t,e){this.logAct(!1,t),t.addArmor(this.boof124)}binvC(){this.faction="A",this.rarity="C",this.name="Battletech Inventor",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("MM"),this.playTarg.player="E",this.ftext=`Give an enemy creature ${m.jr9(-this.iAttack,0)}.`}binvF(t,e){this.logAct(!1,t),t.buff(-this.iAttack,0)}bsrC(){if(this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.iAttack=this.boof5813,this.iHealth=this.boof3712,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.playTarg.level=w.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy an enemy ${m.levelGateText(t,!0)}creature.`,this.optional=!0}else this.hints=["LV"]}bsrF(t,e){O.destroy(t,this.code)}bawC(){this.faction="U",this.rarity="R",this.name="Brambleaxe Warrior",this.iAttack=this.boof61014,this.iHealth=this.iAttack-4,this.tribe.push("HM"),this.playTarg.hint=["BF"],this.ftext="Give a creature Breakthrough this turn."}bawF(t,e){this.logAct(!1,t);const r=p.mod("BT",!0,e.id);r.expiry="ET",t.addMod(r)}cacC(){this.faction="N",this.rarity="H",this.name="Cacklebones",this.iAttack=this.boof5915,this.iHealth=this.iAttack-this.level,this.tribe.push("SK"),this.playTarg.level=w.ddf2(this.level),this.playTarg.player="E",this.ftext=`Destroy an enemy ${m.levelGateText(this.level,!0)}creature. If you do, the enemy player may play an additional card next turn.`,this.optional=!0}cacF(t,e){O.destroy(t,this.code);const r=k.toPlayer(t.owner),s=p.trigger("TS",this.code);r.triggers.push(s)}chaC(){this.faction="U",this.rarity="R",this.name="Chistlehearth Archer",this.iAttack=this.boof2510,this.iHealth=this.iAttack+7,this.tribe.push("HM");const t=this.boof4816;this.playTarg.player="E",this.playTarg.hasMobility=!0,this.ftext=`Deal ${t} damage to an enemy creature with Mobility. Negate Mobility from that creature.`}chaF(t,e){t.hurtDirect(this.boof4816,this.code),t.negateMobility=!0}ccC(){this.faction="N",this.rarity="C",this.name="Corpse Crawler",this.iAttack=this.boof81220,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.playTarg.player="F",this.ftext="Destroy a friendly creature."}ccF(t,e){O.destroy(t,this.code)}friC(){this.faction="T",this.rarity="C",this.name="Flamerift Instigator",this.iAttack=this.lValN([7,12,17]),this.iHealth=this.iAttack-5,this.tribe.push("GT"),this.ftext="Negate Defender from a creature."}friF(t,e){this.logAct(!1,t),t.negateDefender=!0}freavC(){if(this.faction="N",this.rarity="H",this.name="Fleshreaver",this.iAttack=this.boof6915,this.iHealth=this.boof235,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.consistent=!0,this.playTarg.level=w.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy a ${m.levelGateText(t)} enemy creature.`,this.optional=!0}else this.hints=["LV"]}freavF(t,e){O.destroy(t,this.code)}get fiendBof(){return this.lValN([-1,-2,-5])}gfiendC(){this.faction="N",this.rarity="C",this.name="Gloomfiend",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=this.fiendBof;this.ftext=`You may give an enemy creature ${m.jr9(t,t)}.`,this.optional=!0}gfiendF(t,e){this.logAct(!1,t);const r=this.fiendBof;t.buff(r,r)}grwC(){this.faction="N",this.rarity="C",this.name="Gloomreaper Witch",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof147;this.playTarg.maxAttack=t,this.playTarg.player="E",this.ftext=`You may destroy an enemy creature with ${t} or less attack.`,this.optional=!0}grwF(t,e){O.destroy(t,this.code)}grhC(){this.faction="U",this.rarity="C",this.name="Grove Huntress",this.iAttack=this.boof4711,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.playTarg.player="F";const t=this.boof135;this.ftext=`Give a friendly creature ${m.jr9(t,t)}.`}grhF(t,e){this.logAct(!1,t);const r=this.boof135;t.buff(r,r)}houndC(){this.faction="T",this.rarity="C",this.name="Magma Hound",this.iAttack=this.boof4813,this.iHealth=this.iAttack-1,this.tribe.push("ER","EL");const t=this.boof246;this.optional=!0,this.playTarg.player="E",this.ftext=`You may deal ${t} damage to an enemy creature.`}houndF(t,e){t.hurtDirect(this.boof246,this.code)}mtxC(){this.faction="A",this.rarity="C",this.name="Matrix Warden",this.iAttack=this.lValN([3,8,12]),this.iHealth=this.iAttack,this.tribe.push("RB");const t=this.boof3510;this.playTarg.player="F",this.ftext=`Give a friendly creature ${m.jr9(t,0)}.`}mtxF(t,e){this.logAct(!1,t),t.buff(this.boof3510,0)}ngbC(){this.faction="T",this.rarity="C",this.name="Nargath Bruiser",this.iAttack=this.boof5814,this.iHealth=this.iAttack-1,this.tribe.push("ER","AS");const t=this.boof248;this.playTarg.player="F",this.ftext=`Give a friendly creature ${m.jr9(0,t)}.`}ngbF(t,e){this.logAct(!1,t),t.buff(0,this.boof248)}phxsC(){this.faction="A",this.rarity="R",this.name="Phalanx Squadron",this.iAttack=this.boof3714,this.iHealth=this.boof61117,this.tribe.push("HM"),this.playTarg.hasArmor=!0,this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature with Armor ${m.jr9(t,t)}.`}phxsF(t,e){this.logAct(!1,t);const r=this.boof234;t.buff(r,r)}rotC(){this.faction="N",this.rarity="C",this.name="Rot Wanderer",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.playTarg.maxAttack=this.iAttack,this.playTarg.player="E",this.ftext=`Destroy an enemy creature with ${this.iAttack} or less attack.`}rotF(t,e){O.destroy(t,this.code)}schyC(){this.faction="N",this.rarity="C",this.name="Scourge Hydra",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("HY"),this.playTarg.player="F",this.ftext="Deal 3 damage to a friendly creature."}schyF(t,e){t.hurtDirect(3,this.code)}stdC(){this.faction="A",this.rarity="H",this.name="Shardthief Druid",this.iAttack=this.boof5813,this.iHealth=this.boof81318,this.tribe.push("MM"),this.playTarg.canRegen,this.playTarg.player="E",this.ftext=`Negate and remove all Regenerate from an enemy creature. ${this.name} gets that much Renerate.`}stdF(t,e){this.logAct(!1,t);const r=t.regen;t.negateRegen=!0,e.addRegen(r)}surzC(){this.faction="N",this.rarity="L",this.name="Suruzal, Emissary of Varna",this.iAttack=this.boof4814,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.playTarg.player="F",this.playTarg.level=w.ddf2(this.level),this.ftext=`You may destroy another friendly ${m.levelGateText(this.level,!0)}creature. If you do, spawn a copy of it.`}surzF(t,e){const r=N.tick();O.destroy(t,this.code,r),f.birth(t.code,"S",e.owner,void 0,r)}vnfC(){this.faction="U",this.rarity="R",this.name="Venomfang",this.iAttack=this.boof61014,this.iHealth=this.iAttack-2,this.tribe.push("SN");const t=this.boof246;this.playTarg.player="E",this.ftext=`Give an enemy creature Poison ${t}.`}vnfF(t,e){this.logAct(!1,t),t.addPoison(this.boof246)}wbyC(){this.faction="T",this.rarity="R",this.name="Wallbreaker Yeti",this.iAttack=this.boof4712,this.iHealth=this.boof71116,this.tribe.push("ER","YT"),this.playTarg.player="E",this.playTarg.level=w.ddf2(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${m.levelGateText(this.level,!0)}enemy creature with Defender.`,this.optional=!0}wbyF(t,e){O.destroy(t,this.code)}wbuC(){this.faction="T",this.rarity="C",this.name="Warbringer Uranti",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("LT","YT");const t=this.boof4812;this.notme=!0,this.playTarg.player="F",this.addSp("A",t),this.ftext=`Give another friendly creature ${m.jr9(t,0)} this turn.`}wbuF(t,e){this.logAct(!1,t);const r=p.mod("AT",this.boof4812,e.id);r.expiry="ET",t.addMod(r)}dogsC(){this.faction="N",this.rarity="R",this.name="Xithian Direhound",this.iAttack=4,this.iHealth=4,this.tribe.push("AB"),this.overload=!0,this.maxLevel=1,this.optional=!0,this.playTarg.player="E",this.ftext=`You may give an enemy creature ${m.jr9(-4,-4)}.`}dogsF(t,e){this.logAct(!1,t),t.buff(-4,-4)}}class L extends yt{lookup(t){return{["AGW"]:{c:()=>this.awingC(),z:r=>this.awingZ(r)},["ASG"]:{c:()=>this.asurgeC(),z:r=>this.asurgeZ(r)},["ATZ"]:{c:()=>this.anatC(),z:r=>this.anatZ(r)},["AQE"]:{c:()=>this.aqatC(),z:r=>this.aqatZ(r)},["ABL"]:{c:()=>this.ablC(),z:r=>this.ablZ(r)},["BFT"]:{c:()=>this.bftC(),z:r=>this.bftZ(r)},["BTM"]:{c:()=>this.botC(),z:r=>this.botZ(r)},["CSU"]:{c:()=>this.csurgeC(),z:r=>this.csurgeZ(r)},["CNT"]:{c:()=>this.ctmsC(),z:r=>this.ctmsZ(r)},["CTW"]:{c:()=>this.cullC(),z:r=>this.cullZ(r)},["CTV"]:{c:()=>this.cultC(),z:r=>this.cultZ(r)},["CAG"]:{c:()=>this.cypaC(),z:r=>this.cypaZ(r)},["CBS"]:{c:()=>this.cypbC(),z:r=>this.cypbZ(r)},["DDF"]:{c:()=>this.dendC(),z:r=>this.dendZ(r)},["DBT"]:{c:()=>this.dreadC(),z:r=>this.dreadZ(r)},["DYB"]:{c:()=>this.drybC(),z:r=>this.drybZ(r)},["ETN"]:{c:()=>this.elnC(),z:r=>this.elnZ(r)},["ENP"]:{c:()=>this.enpC(),z:r=>this.enpZ(r)},["ENR"]:{c:()=>this.rageC(),z:r=>this.rageZ(r)},["EFA"]:{c:()=>this.efauC(),z:r=>this.efauZ(r)},["EXD"]:{c:()=>this.expdmC(),z:r=>this.expdmZ(r)},["FIN"]:{c:()=>this.feralC(),z:r=>this.feralZ(r)},["FVA"]:{c:()=>this.fervassC(),z:r=>this.fervassZ(r)},["FJT"]:{c:()=>this.fjetC(),z:r=>this.fjetZ(r)},["FLN"]:{c:()=>this.flncC(),z:r=>this.flncZ(r)},["FFL"]:{c:()=>this.ffldC(),z:r=>this.ffldZ(r)},["FZS"]:{c:()=>this.frozC(),z:r=>this.frozZ(r)},["GTH"]:{c:()=>this.ghastC(),z:r=>this.ghastZ(r)},["GCR"]:{c:()=>this.crushC(),z:r=>this.crushZ(r)},["HAR"]:{c:()=>this.hartC(),z:r=>this.hartZ(r)},["IFR"]:{c:()=>this.izftC(),z:r=>this.izftZ(r)},["JPK"]:{c:()=>this.jpC(),z:r=>this.jpZ(r)},["LBR"]:{c:()=>this.lbrandC(),z:r=>this.lbrandZ(r)},["LYS"]:{c:()=>this.shartC(),z:r=>this.shartZ(r)},["MPH"]:{c:()=>this.morphC(),z:r=>this.morphZ(r)},["MSC"]:{c:()=>this.sculptC(),z:r=>this.sculptZ(r)},["NNS"]:{c:()=>this.nanoC(),z:r=>this.nanoZ(r)},["NSL"]:{c:()=>this.natselC(),z:r=>this.natselZ(r)},["NCF"]:{c:()=>this.nflayC(),z:r=>this.nflayZ(r)},["NCV"]:{c:()=>this.nviveC(),z:r=>this.nviveZ(r)},["OEX"]:{c:()=>this.oexpC(),z:r=>this.oexpZ(r)},["OSS"]:{c:()=>this.orssC(),z:r=>this.orssZ(r)},["PTR"]:{c:()=>this.pwtorC(),z:r=>this.pwtorZ(r)},["PSG"]:{c:()=>this.psurgeC(),z:r=>this.psurgeZ(r)},["PMS"]:{c:()=>this.pslamC(),z:r=>this.pslamZ(r)},["ROG"]:{c:()=>this.rotgC(),z:r=>this.rotgZ(r)},["SAP"]:{c:()=>this.sapC(),z:r=>this.sapZ(r)},["SVO"]:{c:()=>this.soathC(),z:r=>this.soathZ(r)},["SOC"]:{c:()=>this.scythC(),z:r=>this.scythZ(r)},["SOA"]:{c:()=>this.soaC(),z:r=>this.soaZ(r)},["SOD"]:{c:()=>this.sodC(),z:r=>this.sodZ(r)},["SOT"]:{c:()=>this.sotC(),z:r=>this.sotZ(r)},["SHG"]:{c:()=>this.shgrC(),z:r=>this.shgrZ(r)},["SNB"]:{c:()=>this.snbC(),z:r=>this.snbZ(r)},["SHV"]:{c:()=>this.sharvC(),z:r=>this.sharvZ(r)},["SRP"]:{c:()=>this.sreapC(),z:r=>this.sreapZ(r)},["STR"]:{c:()=>this.sttorC(),z:r=>this.sttorZ(r)},["STO"]:{c:()=>this.sptorC(),z:r=>this.sptorZ(r)},["SOV"]:{c:()=>this.sovC(),z:r=>this.sovZ(r)},["STN"]:{c:()=>this.stbrnC(),z:r=>this.stbrnZ(r)},["STP"]:{c:()=>this.ssperC(),z:r=>this.ssperZ(r)},["SIN"]:{c:()=>this.sinC(),z:r=>this.sinZ(r)},["TGL"]:{c:()=>this.tanglC(),z:r=>this.tanglZ(r)},["TPT"]:{c:()=>this.tpactC(),z:r=>this.tpactZ(r)},["TUP"]:{c:()=>this.tugC(),z:r=>this.tugZ(r)},["TOT"]:{c:()=>this.totsC(),z:r=>this.totsZ(r)},["TOB"]:{c:()=>this.blightC(),z:r=>this.blightZ(r)},["TXB"]:{c:()=>this.txbnC(),z:r=>this.txbnZ(r)},["TXS"]:{c:()=>this.sporeC(),z:r=>this.sporeZ(r)},["TCG"]:{c:()=>this.tremcC(),z:r=>this.tremcZ(r)},["URS"]:{c:()=>this.urstC(),z:r=>this.urstZ(r)},["VSK"]:{c:()=>this.vensC(),z:r=>this.vensZ(r)},["VGR"]:{c:()=>this.vgraC(),z:r=>this.vgraZ(r)},["VGL"]:{c:()=>this.vglchC(),z:r=>this.vglchZ(r)},["VOB"]:{c:()=>this.vobC(),z:r=>this.vobZ(r)},["VYE"]:{c:()=>this.vembC(),z:r=>this.vembZ(r)},["UBL"]:{c:()=>this.uboltC(),z:r=>this.uboltZ(r)},["WMM"]:{c:()=>this.warC(),z:r=>this.warZ(r)},["XRW"]:{c:()=>this.xwillC(),z:r=>this.xwillZ(r)}}[t]}cardCast(t,e){this.lookup(t).z(e)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.cardCode()==="NSL"&&f.creatByTarget(p.crFriendTarg()).length<5||t.push(this.playTarg),t}handleAction(t){const e=f.ddf6(t);this.logSpell(this.xl?e:void 0),this.cardCast(this.cardCode(),e),v.spellCast()}ddf8(t){const e=St.extractCardCode(t.trigger.logicCode);if(e==="TOB"&&t.trigger.type==="DM"){const r=W.toDamage(t.event);if(r.battle&&r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId)return this.level===3?!0:I.getCard(r.hurtCreat.code).level<=this.level}else if((e==="ABL"||e==="OEX"||e==="VOB")&&t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId}else if((e==="FZS"||e==="IFR")&&t.trigger.type==="DM"){const r=t.event;if(r.isCreatTarg&&r.target===t.creatId)return!0}else if(e==="DYB"&&t.trigger.type==="EF"){const r=W.toEnterField(t.event);return t.trigger.creatId!==r.creature.id&&r.creature.owner===t.owner}else if(e==="FVA"&&t.trigger.type==="FK"||e==="ROG"&&t.trigger.type==="DS"||e==="SHG"&&(t.trigger.type==="PT"||t.trigger.type==="VN")||(e==="IFR"||e==="OEX")&&t.trigger.type==="PT")return!0;return!1}jr8(t){const e=St.extractCardCode(t.trigger.logicCode);if(e==="TOB"){const r=t.event,s=f.jr5(r.target);s.status==="A"&&O.destroy(s,this.code)}else if(e==="ABL")f.jr5(t.creatId).buff(this.level,this.level);else if(e==="FVA"){const r=f.jr5(t.creatId),s=f.searchByLane(f.oppositeLane(r.lane),!r.owner);s&&s.hurtDirect(this.boof3612,r.code)}else if(e==="FZS"||e==="IFR"&&t.trigger.type==="DM"){const r=f.jr5(t.creatId);r.status==="A"&&O.destroy(r,this.code)}else if(e==="ROG"||e==="DYB")f.jr5(t.creatId).buff(this.level,this.level);else if(e==="SHG"){if(t.trigger.type==="VN"){const r=t.event,s=f.jr5(r.creatId);f.birth(s.code,"S",t.owner)}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,s=f.jr5(t.creatId);s.triggers.filter(u=>u.customCode===r).forEach(u=>s.removeTrigger(u))}}else if(e==="IFR"&&t.trigger.type==="PT"){const r=S.deTil(t.trigger.customCode),s=r[1],h=f.jr5(t.creatId);if(r[0]==="P2"){const u=p.trigIdx(h.triggers,t.trigger);h.triggers[u].customCode=S.enTil("P1",s)}else{const u=h.triggers.find(g=>g.customCode===s);u&&h.removeTrigger(u),h.removeTrigger(t.trigger)}}else if(e==="OEX"){if(t.trigger.type==="DM"){const r=t.event,s=f.qEnemyCreats(),h=s.length,u=N.tick();let g;h>0&&(this.level===1?g=[s[S.randInt(0,h)]]:this.level===2?(g=s.splice(S.randInt(0,h),1),s.length>0&&g.push(s[S.randInt(0,h-1)])):g=s,g.forEach(y=>y.hurtDirect(r.dmg,this.code,u)))}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,s=f.jr5(t.creatId);s.triggers.filter(u=>u.customCode===r).forEach(u=>s.removeTrigger(u))}}else if(e==="VOB"){const r=W.toDamage(t.event);r.srcCreat.hurtDirect(r.dmg,this.code)}else super.jr8(t);x.triggerDone()}rankT(){return`If you are rank ${this.level+1} or higher`}awingC(){this.faction="A",this.rarity="R",this.name="Aegis Wings",this.text=`Give a creature ${m.jr9(this.boof369,0)}. Then if that creature has the highest attack, it also gets Mobility 1 and Armor ${this.boof246}.`,this.playTarg.hint=["BF"]}awingZ(t){t.buff(this.boof369,0);const e=t.attack;f.qActiveCreats().every(r=>r.attack<=e)&&(t.addMobility(1),t.addArmor(this.boof246))}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg.canMove=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Mobility ${this.level}.`}asurgeZ(t){t.addMobility(this.level)}anatC(){this.faction="A",this.rarity="C",this.name="Anatomize",this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(-this.boof4816,0)}.~You may play an additional ${this.name} this turn.`}anatZ(t){t.buff(-this.boof4816,0);const e=M.freeCard(this.code);e.condition.cardCode="ATZ"}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${m.jr9(0,this.boof51015)}.`,this.playTarg.hint=["BF"]}aqatZ(t){t.buff(0,this.boof51015)}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${m.dbdtap()}, it gets ${m.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}ablZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("OL")}bftC(){this.faction="N",this.rarity="C",this.name="Bitterfrost Totem";const t=this.boof4812n;this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(t,t)}. ${this.rankT()}, it gets an additional ${m.jr9(-2,-2)}.`}bftZ(t){const e=this.boof4812n-(k.getActive().rank>this.level?2:0);t.buff(e,e)}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.xl=!1,this.text=`Replace an enemy ${m.levelGateText(this.level,!0)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=w.ddf2(this.level)}botZ(t){f.birth(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof123n;this.text=`Give a creature ${m.jr9(t,t)}.`,this.playTarg.hint=["DB"]}csurgeZ(t){const e=this.boof123n;t.buff(e,e)}ctmsC(){this.faction="A",this.rarity="R",this.name="Countermeasure";const t=this.boof4816;this.text=`Give an enemy creature ${m.jr9(-t,0)}, or give a friendly creature ${m.jr9(t,0)}.`}ctmsZ(t){const e=this.boof4816;t.owner===k.getActiveB()?t.buff(e,0):t.buff(-e,0)}cullC(){this.faction="N",this.rarity="C",this.name="Cull the Weak",this.xl=!1;const t=this.boof4814;this.text=`Destroy a creature with ${t} or less attack.`,this.playTarg.maxAttack=t,this.playTarg.hint=["KL"]}cullZ(t){O.destroy(t,this.code)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate",this.xl=!1;const t=I.getCard(U.tffc(this.level));this.text=`Replace a friendly Plant with a ${m.tokName(t)}.`,this.playTarg.player="F",this.playTarg.tribe="PL"}cultZ(t){f.birth(U.tffc(this.level),"R",t.owner,t.lane)}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof246;this.text=`Give a creature in a center lane ${m.jr9(t,t)}.`,this.playTarg.lanes=3,this.playTarg.hint=["BF"]}cypaZ(t){const e=this.boof246;t.buff(e,e)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${m.jr9(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.hint=["BF"],this.playTarg.faction="A"}cypbZ(t){t.buff(this.boof51015,0),t.addArmor(this.boof124)}dendC(){this.faction="U",this.rarity="R",this.name="Dendrify",this.xl=!1,this.level===3&&(this.isFree=!0,this.overload=!0),this.text=`Replace a ${m.levelGateText(this.level+1,!0)}creature with a 7/7 Treefolk.`,this.playTarg.level=w.ddf2(this.level+1)}dendZ(t){f.birth(`${"SXT"}${this.level}`,"R",t.owner,t.lane)}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.xl=!1,this.hints=["LV"],this.text=`Destroy a ${m.levelGateText(this.level,!0)}creature.`,this.playTarg.level=w.ddf2(this.level),this.playTarg.hint=["KL"]}dreadZ(t){O.destroy(t,this.code)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${m.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${m.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}drybZ(t){t.buff(this.level,this.level),t.changed=!0,t.jr4("EF",this.code)}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.isFree=this.level===3,this.text=`Give a ${m.levelGateText(this.level,!0)}creature Defender.`,this.playTarg.canDefender=!0}enpZ(t){t.defender=!0}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${m.jr9(-this.boof51015,0)}.`,this.playTarg.hint=["DB"]}elnZ(t){t.buff(-this.boof51015,0)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${m.jr9(t,t)}.`,this.playTarg.hint=["BF"]}rageZ(t){const e=this.boof3612;t.buff(e,e)}efauC(){this.faction="T",this.rarity="R",this.name="Everflame Aura",this.text=`Deal ${this.level+6} damage to an enemy creature, or give a friendly creature Mobility ${this.level}.`}efauZ(t){t.owner===k.getActiveB()?t.addMobility(this.level):t.hurtDirect(this.level+6,this.code)}expdmC(){this.faction="N",this.rarity="H",this.name="Explosive Demise",this.xl=!1,this.text=`Destroy a friendly ${m.levelGateText(this.level+1,!0)}creature.~Deal damage equal to its attack to the enemy player.${this.level===3?"~You gain that much health.":""}`,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.player="F"}expdmZ(t){const e=t.attack;O.destroy(t,this.code),k.hurtDirect("E",e,this.code),this.level===3&&k.heal("F",e)}get fiboof(){return this.lValN([1,3,8])}feralC(){this.faction="U",this.rarity="C",this.name="Feral Instinct";const t=this.fiboof;this.text=`Give a creature ${m.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"]}feralZ(t){const e=this.fiboof;t.breakthrough=!0,t.buff(e,e)}fervassC(){this.faction="T",this.rarity="H",this.name="Fervent Assault",this.playTarg.player="F",this.text=`Give a friendly creature Mobility ${this.level} and "Flank: Deal ${this.boof3612} damage to the opposing creature.`}fervassZ(t){t.changed=!0,t.addMobility(this.level),t.jr4("FK",this.code)}fjetC(){this.faction="T",this.rarity="C",this.name="Flame Jet",this.playTarg.hint=["HR"],this.text=`Deal ${this.boof3915} damage to a creature. ${this.rankT()}, deal an additional 3 damage.`}fjetZ(t){t.hurtDirect(this.boof3915,this.code),k.getActive().rank>this.level&&t.hurtDirect(3,this.code)}flncC(){this.faction="T",this.rarity="R",this.name="Flame Lance",this.xl=!1;const t=this.boof579;this.text=`Deal ${t} damage to an enemy creature and ${t} damage to the enemy player.`,this.playTarg.player="E"}flncZ(t){const e=this.boof579;t.hurtDirect(e,this.code),k.hurtDirect("E",e,this.code)}ffldC(){this.faction="A",this.rarity="C",this.name="Forcefield",this.playTarg.canArmor=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Armor ${this.boof51020} this turn.`}ffldZ(t){const e=p.mod("AR",this.boof51020,this.code);e.expiry="ET",t.addMod(e)}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=w.ddf2(this.level),this.playTarg.hint=["KL"],this.text=`Give a ${m.levelGateText(this.level,!0)}creature "When this is dealt damage, destroy it".`}frozZ(t){t.changed=!0,t.jr4("DM",this.code)}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${m.jr9(t,t)}.`,this.playTarg.hint=["DB"]}ghastZ(t){const e=-this.boof3612;t.buff(e,e)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.xl=!1,this.isFree=this.level>1,this.isFree||(this.hints=["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 e=t.health;O.destroy(t,this.code),this.level===3&&k.hurtDirect(t.owner,e,this.code)}hartC(){this.faction="A",this.rarity="C",this.name="Heavy Artillery",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}izftC(){this.faction="T",this.rarity="T",this.name="Iztek's Frost",this.isFree=this.level===3,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.hint=["KL"],this.text=`Until the end of the next turn, give a ${m.levelGateText(this.level+1,!0)}creature "When this is dealt damage, destroy it".`}izftZ(t){const e=N.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=e;const s=t.jr4("PT",this.code);s.customCode=S.enTil("P2",e)}jpC(){this.faction="A",this.rarity="C",this.name="Jet Pack",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof369,0)} and Mobility 1.`}jpZ(t){t.buff(this.boof369,0),t.addMobility(1)}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=w.ddf2(this.level+1),this.playTarg.hint=["BF"],this.text=`Give a ${m.levelGateText(this.level+1)}creature ${m.jr9(this.boof124,0)} and Aggressive this turn.`}lbrandZ(t){const e=p.mod("AT",this.boof124,this.code),r=p.mod("AG",!0,this.code);e.expiry="ET",r.expiry="ET",t.addMod(e),t.addMod(r)}shartC(){this.faction="U",this.rarity="R",this.name="Lysian Shard",this.overload=!0,this.maxLevel=1,this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(6,6)}.`}shartZ(t){t.buff(6,6)}morphC(){this.faction="U",this.rarity="H",this.name="Metamorphosis",this.xl=!1,this.text=`Replace a ${m.levelGateText(this.level,!0)}creature with a 0/3 Feywing Chrysalis.`,this.playTarg.level=w.ddf2(this.level)}morphZ(t){f.birth(`${"FWC"}1`,"R",t.owner,t.lane)}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.isFree=this.level===3,this.playTarg.level=w.ddf2(this.level+1),this.text=`Remove all abilities from a ${m.levelGateText(this.level+1,!0)}creature.`,this.playTarg.hint=["DB"]}sculptZ(t){t.wipeAll()}nanoC(){this.faction="A",this.rarity="R",this.name="Nanoswarm",this.playTarg.level=w.ddf2(this.level),this.text=`Give a ${m.levelGateText(this.level,!0)}creature ${m.jr9(-this.boof51015,0)} and remove all abilities from it.`,this.playTarg.hint=["DB"]}nanoZ(t){t.buff(-this.boof51015,0),t.wipeAll()}natselC(){this.faction="U",this.rarity="R",this.name="Natural Selection",this.xl=!1,this.text=`If there is a friendly creature in each lane, destroy a ${m.levelGateText(this.level,!0)}creature.`,this.playTarg.level=w.ddf2(this.level),this.playTarg.hint=["KL"]}natselZ(t){O.destroy(t,this.code)}nflayC(){this.faction="N",this.rarity="C",this.name="Necroflay";const t=-this.boof3711;this.text=`Give a creature ${m.jr9(t,t)}.~You may play an additional ${this.name} this turn.`,this.playTarg.hint=["DB"]}nflayZ(t){const e=-this.boof3711;t.buff(e,e);const r=M.freeCard(this.code);r.condition.cardCode="NCF"}nviveC(){this.faction="N",this.rarity="C",this.name="Necrovive",this.playTarg.canRegen=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Regenerate ${this.boof3612}.`}nviveZ(t){t.addRegen(this.boof3612)}oexpC(){this.faction="A",this.rarity="H",this.name="Oratek Explosives",this.playTarg.player="F";const t=this.lValS(["an enemy creature at random","up to two enemy creatures at random","each enemy creature"]);this.text=`Give a friendly creature ${m.jr9(5,0)}.~Allied Tempys: This turn, when that creature ${m.dbdtap()}, deal that much damage to ${t}.`}oexpZ(t){if(t.buff(5,0),M.allied("T")){const e=N.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=e;const s=t.jr4("PT",this.code);s.customCode=e,t.hints.push("OL")}}orssC(){this.faction="A",this.rarity="C",this.name="Oreian Steelskin",this.playTarg.canArmor=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Armor ${this.boof246}. ${this.rankT()}, it gets an additional Armor 1.`}orssZ(t){const e=k.getActive().rank>this.level?1:0;t.addArmor(this.boof246+e)}pwtorC(){this.faction="A",this.rarity="R",this.name="Power Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.level,this.level)}.`}psurgeZ(t){t.buff(this.level,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof71116,0)} this turn.`}pslamZ(t){const e=p.mod("AT",this.boof71116,this.code);e.expiry="ET",t.addMod(e)}rotgC(){this.faction="N",this.rarity="H",this.name="Rite of the Grimgaunt",this.playTarg.hint=["BF"],this.text=`Give a creature "When a creature is destroyed, this gets ${m.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0,t.jr4("DS",this.code)}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=w.ddf2(this.level),this.text=`Reduce a ${m.levelGateText(this.level,!0)}creature's attack to 0.`,this.playTarg.hint=["DB"]}sapZ(t){t.buff(-t.attack,0)}soathC(){this.faction="U",this.rarity="C",this.name="Savage Oath",this.level===1&&(this.hints=["LV"]);const t=this.saboof;this.text=`Give an Uterra creature ${m.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"],this.playTarg.faction="U"}soathZ(t){const e=this.saboof;t.buff(e,e),t.breakthrough=!0}get saboof(){return this.lValN([2,6,15])}scythC(){this.faction="N",this.rarity="L",this.name="Scythe of Chiron";const t=this.boof246;this.playTarg.player="F",this.text=`Each enemy creature gets ${m.jr9(-t,0)}. Give a friendly creature ${m.jr9(t,0)} for each enemy creature.`}scythZ(t){const e=-this.boof246,r=f.qEnemyCreats();r.forEach(s=>{s.buff(e,0)}),r.length>0&&t.buff(-e*r.length,0)}soaC(){this.faction="A",this.rarity="C",this.name="Seal of Anvillon",this.level===1?this.hints=["LV"]:this.consistent=!0,this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.ubzap,0)}.`}soaZ(t){t.buff(this.ubzap,0)}sodC(){this.faction="U",this.rarity="C",this.name="Seal of Deepwood",this.level===1?this.hints=["LV"]:this.consistent=!0;const t=this.derpboof;this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(t,t)}.`}sodZ(t){const e=this.derpboof;t.buff(e,e)}get derpboof(){return this.lValN([1,6,12])}sotC(){this.faction="N",this.rarity="C",this.name="Seal of Tarsus",this.level===1?this.hints=["LV"]:this.consistent=!0;const t=this.tars;this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(t,t)}.`}sotZ(t){const e=this.tars;t.buff(e,e)}get tars(){return this.lValN([-2,-8,-16])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.isFree=this.level===3,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.player="F",this.text=`Give a ${m.levelGateText(this.level+1,!0)}friendly creature "Vengeance: Spawn this" this turn.`}shgrZ(t){const e=N.genId(),r=t.jr4("VN",this.code);r.customCode=e,r.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){const e=this.level*f.ddf1().length;t.buff(e,e)}get snbboof(){return-1*(this.level+7)}snbC(){this.faction="A",this.rarity="C",this.name="Sonic Burst",this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(this.snbboof,0)}.`}snbZ(t){t.buff(this.snbboof,0)}sharvC(){this.faction="N",this.rarity="H",this.name="Soul Harvest",this.xl=!1;const t=this.lValS(["an additional level 1 card","an additional card","two additional cards"]);this.text=`Destroy a friendly creature. You may play ${t} this turn.`,this.playTarg.player="F"}sharvZ(t){if(O.destroy(t,this.code),this.level===1){const e=M.freeCard(this.code);e.condition.level=w.ddf2(1)}else M.regularPlays+=this.level-1}sreapC(){this.faction="N",this.rarity="L",this.name="Soulreap",this.xl=!1;const t=this.boof248;this.text=`Destroy an enemy creature with ${t} or less attack. Then Spawn a copy of it.`,this.playTarg.player="E",this.playTarg.maxAttack=t}sreapZ(t){O.destroy(t,this.code),f.birth(t.code,"S",!t.owner)}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Regenerate ${this.boof234}.`,this.playTarg.hint=["BF"],this.playTarg.canRegen=!0}sttorZ(t){t.addRegen(this.boof234)}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Poison ${this.boof234}.`,this.playTarg.hint=["PN"]}sptorZ(t){t.addPoison(this.boof234)}sovC(){this.faction="T",this.rarity="L",this.name="Staff of Vaerus",this.text=`Give a friendly ${m.levelGateText(this.level+1,!0)}creature Mobility ${this.level}. That creature battles an additional time this turn.`,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.player="F"}sovZ(t){t.extraBattles+=1,t.addMobility(this.level)}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${m.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hint=["BF"],this.playTarg.hasDefender=!0}stbrnZ(t){const e=this.boof579;t.buff(e,e),t.negateDefender=!0}ssperC(){this.faction="T",this.rarity="C",this.name="Stormspear",this.xl=!1,this.playTarg.hint=["HR"],this.text=`Deal ${this.sspb} to a creature.~You may play an additional ${this.name} this turn.`}ssperZ(t){t.hurtDirect(this.sspb,this.code);const e=M.freeCard(this.code);e.condition.cardCode="STP"}get sspb(){return this.lValN([3,8,12])}tanglC(){this.faction="U",this.rarity="R",this.name="Tangle",this.xl=!1;let t="";this.level===3?t=" You gain health equal to that creature's attack.":this.playTarg.hint=["KL"],this.text=`Destroy a ${m.levelGateText(this.level+1,!0)}creature with Mobility.${t}`,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.hasMobility=!0}tanglZ(t){O.destroy(t,this.code),this.level===3&&k.heal("F",t.attack)}tpactC(){this.faction="N",this.rarity="C",this.name="Tarsian Pact";const t=this.boof235;this.text=`Give a Nekrium creature ${m.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.hint=["BF"],this.playTarg.faction="N"}tpactZ(t){const e=this.boof235;t.buff(e,e),t.addRegen(e)}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.playTarg.hint=["BF"],this.text=`Give a Robot ${m.jr9(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),t.buff(this.boof4612,0)}totsC(){this.faction="N",this.rarity="T",this.name="Tendrils Of Twilight",this.isFree=!0;const t=-this.boof7911;this.text=`Give an enemy creature ${m.jr9(-1,-1)}.~If that creature is opposing a friendly Duskmaw, give that creature ${m.jr9(t,t)} instead.`,this.playTarg.player="E"}totsZ(t){const e=this.duskBof(t);t.buff(e,e)}duskBof(t){const e=t.opposed;let r=!1;return e&&(r=St.extractCardCode(e.code)==="DTD"),r?-this.boof7911:-1}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${m.dbdtac(this.level)}, destroy that creature."`,this.playTarg.hint=["BF"]}blightZ(t){t.changed=!0,t.jr4("DM",this.code)}txbnC(){this.faction="U",this.rarity="R",this.name="Toxic Boon";const t=this.boof357;this.text=`Give an enemy creature Poison ${t}, or give a friendly creature ${m.jr9(t,t)}.`}txbnZ(t){const e=this.boof357;t.owner===k.getActiveB()?t.buff(e,e):t.addPoison(e)}get tspois(){return this.lValN([5,7,12])}sporeC(){this.faction="U",this.rarity="C",this.name="Toxic Spores",this.text=`Give a creature Poison ${this.tspois}.`,this.playTarg.hint=["PN"]}sporeZ(t){t.addPoison(this.tspois)}tremcC(){this.faction="T",this.rarity="C",this.name="Tremorcharge",this.text=`Give a Tempys creature ${m.jr9(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T",this.playTarg.hint=["BF"]}tremcZ(t){t.buff(0,this.boof4812),t.addMobility(this.level)}uboltC(){this.faction="T",this.rarity="R",this.name="Uranti Bolt",this.xl=!1,this.text=`Deal ${this.ubzap} damage to a creature.~It gets Defender until the end of the next turn.`}uboltZ(t){t.hurtDirect(this.ubzap,this.code);const e=p.mod("DF",!0,this.code);e.expiry="EN",t.addMod(e)}get ubzap(){return this.lValN([3,10,20])}urstC(){this.faction="U",this.rarity="C",this.name="Ursine Strength";const t=this.boof3711;this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(t,t)}. ${this.rankT()}, it gets an additional ${m.jr9(2,2)}.`}urstZ(t){const e=this.boof3711+(k.getActive().rank>this.level?2:0);t.buff(e,e)}vensC(){this.faction="U",this.rarity="C",this.name="Venomstrike",this.playTarg.hint=["PN"],this.text=`Give a creature Poison ${this.boof468}.~You may play an additional ${this.name} this turn.`}vensZ(t){t.addPoison(this.boof468);const e=M.freeCard(this.code);e.condition.cardCode="VSK"}vgraC(){this.faction="U",this.rarity="C",this.name="Verdant Grace",this.playTarg.player="F",this.text=`Heal ${this.boof101520} damage from a friendly creature and ${this.boof246} health from each other friendly creature.`}vgraZ(t){t.heal(this.boof101520);const e=this.boof246;f.creatByTarget(p.crFriendNotMeTarg(t.id)).forEach(r=>{r.heal(e)})}vglchC(){this.faction="N",this.rarity="R",this.name="Vigor Leech";const t=this.boof369n;this.text=`Give an enemy creature ${m.jr9(t,t)}, or give a friendly creature Regenerate ${-t}.`}vglchZ(t){const e=this.boof369n;t.owner===k.getActiveB()?t.addRegen(-e):t.buff(e,e)}vobC(){this.faction="T",this.rarity="R",this.name="Violent Outburst",this.level===3?this.isFree=!0:this.hints=["LV"],this.text=`Give a ${m.levelGateText(this.level+1,!0)}creature Aggressive and, "When this creature ${m.dbdtap()}, it also deals that much damage to itself."`}vobZ(t){t.aggressive=!0,t.changed=!0,t.jr4("DM",this.code)}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace",this.playTarg.hint=["DB"];const t=this.boof468,e=-t;this.text=`Give a creature ${m.jr9(e,e)}.~You gain ${t} health.`}vembZ(t){const e=this.boof468,r=-e;t.buff(r,r),k.heal(k.getActive(),e)}warC(){this.faction="A",this.rarity="H",this.name="Warmonger Mod";let t=this.level,e=3;this.level===1&&(this.playTarg.level="LN",e=2,t=2),this.playTarg.hint=["BF"],this.text=`Give a ${m.levelGateText(e,!0)}creature ${t}x attack.`}warZ(t){const e=this.level===3?2:1;t.buff(t.attack*e,0)}xwillC(){this.faction="N",this.rarity="H",this.name="Xrath's Will",this.xl=!1;const t=this.boof3612;this.text=`Destroy an enemy creature with ${t} or less attack.~You may play an additional Zombie this turn.`,this.playTarg.player="E",this.playTarg.maxAttack=t}xwillZ(t){O.destroy(t,this.code);const e=M.freeCard(this.code);e.condition.tribe="ZB"}}class Fe extends P{lookup(t){return{["ATP"]:{c:()=>this.phagC(),t:()=>this.phagT(),f:(r,s)=>this.phagF(r,s)},["SSH"]:{c:()=>this.sshmC(),t:()=>this.sshmT(),f:(r,s)=>this.sshmF(r,s)},["TPG"]:{c:()=>this.pillC(),t:()=>this.pillT(),f:(r,s)=>this.pillF(r,s)},["TMG"]:{c:()=>this.grootC(),t:()=>this.grootT(),f:(r,s)=>this.grootF(r,s)}}[t]}forgTargets(t){return this.lookup(t).t()}forgAction(t,e,r){this.lookup(t).f(e,r)}optional=!0;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Forge: "+this.ftext,this.ftext=""}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}handleAction(t){const e=f.jr5(t.param);this.forgAction(this.cardCode(),t.position,e),mt.popMode(),v.actionDone(!0)}jr8(t){const e=this.forgTargets(this.cardCode());if(e.length>0){const r=e.map(s=>{const h=p.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return h.param=t.creatId,h.host=this.code,h});if(this.optional){const s=v.noneEndTrigger();s.param="PM",r.push(s)}Ht.showCustomDeck(e,r)}else x.triggerDone()}phagC(){this.faction="U",this.rarity="H",this.name="Aetherphage",this.iAttack=this.lValN([7,10,16]),this.iHealth=this.boof3612,this.tribe.push("IN"),this.ftext=`Look at the ${m.levelGateText(this.level,!0)}spells in the enemy player's hand and choose one. The enemy player discards the chosen spell.`}phagT(){const t=k.toPlayer(!k.getActiveB()),e=p.target("TH");return e.player=k.toTarget(t),e.level=w.ddf2(this.level),e.card="S",Ht.generateContent(t.hand,!1,e)}phagF(t,e){const r=k.toPlayer(!e.owner),s=r.hand[t];r.hand.splice(t,1),r.discard.push(s)}sshmC(){this.faction="U",this.rarity="H",this.name="Soothsayer Hermit",this.iAttack=this.boof61016,this.iHealth=this.iAttack-1,this.tribe.push("LP"),this.ftext=`You may put a ${m.levelGateText(this.level)} creature from your discard pile into your hand.`}sshmT(){const t=k.getActive(),e=p.target("TD");return e.player=k.toTarget(t),e.card="C",e.level=w.ddf2(this.level),Ht.generateContent(t.discard,!1,e)}sshmF(t,e){const r=k.toPlayer(e.owner),s=r.discard.splice(t,1);r.hand.push(s[0])}pillC(){this.faction="N",this.rarity="H",this.name="Tomb Pillager",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("ZB"),this.consistent=this.level>1,this.ftext="You may banish a Nekrium card from your discard pile."}pillT(){const t=k.getActive(),e=p.target("TD");return e.player=k.toTarget(t),e.faction="N",Ht.generateContent(t.discard,!1,e)}pillF(t,e){k.toPlayer(e.owner).discard.splice(t,1)}grootC(){this.faction="U",this.rarity="R",this.name="Toorgmai Guardian",this.iAttack=this.boof4711,this.iHealth=this.iAttack,this.tribe.push("PL");const t=this.boof358;this.ftext=`You may banish a Plant from your discard pile. If you do, ${this.name} gets ${m.jr9(t,t)}.`}grootT(){const t=k.getActive(),e=p.target("TD");return e.player=k.toTarget(t),e.tribe="PL",Ht.generateContent(t.discard,!1,e)}grootF(t,e){k.toPlayer(e.owner).discard.splice(t,1);const s=this.boof358;e.buff(s,s)}}class Vr extends dt{jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}jr8(t){f.qEnemyCreats().forEach(e=>{e.addPoison(6)}),x.triggerDone()}}class zr extends P{constructor(t){super(t),this.faction="U",this.rarity="T",this.name="Dino Knight",this.iAttack=this.lValN([8,12,18]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.iAggro=!0,this.iBT=!0,this.maxLevel=this.level,this.minLevel=this.level;const e=this.boof357;this.text=`When this ${m.dbdtap()}, heal ${e} damage from each other friendly creature.~Vengeance: Put a level ${this.level} Bron, Wild Tamer into this lane.`}image(t){return this.fixedImage(t)}jr3(t,e){const r=super.jr3(t,e);return r.jr4("VN",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="VN"){const e=f.jr5(t.creatId);f.birth("BWT"+this.level,"P",e.owner,e.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,r=p.crNotMeTarg(t.creatId);r.player=k.toTarget(t.owner),f.creatByTarget(r).forEach(h=>h.heal(e)),x.triggerDone()}}}class Zr extends yt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Discordant Strike";const e=-this.boof4610;this.text=`Give an enemy creature ${m.jr9(e,0)}.~Allied Nekrium: Give an enemy creature ${m.jr9(0,e)}.`}playTargets(){const t=super.playTargets(),e=p.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=S.deTil(t.param),r=-this.boof4610,s=f.ddf6(t);e[0]==="P1"?(this.logSpell(s),s.buff(r,0),M.allied("N")?v.ddf5(this.getCardActions(t)):v.spellCast()):(this.logSpell(s),s.buff(0,r),v.spellCast())}getCardActions(t,e){return w.toActions(p.crEnemyActTarg("CARD",this.code,"P2"))}}class Yr extends yt{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.isFree=this.level===3,this.level<3&&(this.hints=["LV"]),this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}playTargets(){const t=super.playTargets(),e=this.poisTarg();return this.level===1?t.push(e):f.creatByTarget(e).length>0&&t.push(w.boardTarget("CARD",this.code)),t}handleAction(t){if(this.level===1){const e=f.ddf6(t);this.logSpell(e),e.addPoison(e.poison)}else this.logSpell(),f.creatByTarget(this.poisTarg()).forEach(r=>{r.addPoison(r.poison)});v.spellCast()}poisTarg(){const t=p.crEnemyActTarg("CARD",this.code,"");return t.hasPoison=!0,t}}class Kr extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Doppelbot",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("RB");let e="";this.level>1&&(e=`, then give it ${m.jr9(this.level===3?10:5,0)}`),this.text=`Activate: Look at the creatures in the enemy player's hand and choose one. Replace ${this.name} with the chosen creature${e}.`}canActivate(t){return k.toPlayer(!t.owner).hand.some(r=>I.getCard(r).type==="C")}startActivation(t){let e;if(ot.simOn)e=[{cardCode:"VND"+this.level,sourceIdx:0,cardCount:0}];else{const s=k.toPlayer(!k.getActiveB()),h=p.target("TH");h.player=k.toTarget(s),h.card="C",e=Ht.generateContent(s.hand,!1,h)}const r=e.map(s=>{const h=p.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return h.param=t.id,h.host=this.code,h});Ht.showCustomDeck(e,r)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),r=f.birth(t.card,"R",e.owner,e.lane);this.level>1&&r?.buff(this.level===3?10:5,0),mt.popMode(),e.endActivation()}}class Xr extends P{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Dysian Broodqueen",this.iAttack=this.boof248,this.iHealth=this.boof61117,this.tribe.push("NG");const e=I.getCard(this.bfc()),r=`Destroy an enemy ${m.levelGateText(this.level,!0)}creature.`;this.text=`Activate, destroy another friendly creature: ${r}~Allied Uterra: Put a ${m.tokName(e)} into an available lane.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[1]==="P1"){const r=f.ddf6(t),s=this.enemies(e[0],r.id);s.push(v.cancelAction()),v.ddf5(s)}else if(e[1]==="P2"){this.logAct(!0);const r=f.jr5(e[0]),s=N.tick(),h=f.jr5(e[2]),u=f.ddf6(t);O.destroy(h,this.code,s),O.destroy(u,this.code,s),r.endActivation()}else f.birth(this.bfc(),"P",t.playerA,t.lane),v.actionDone(!0)}jr8(t){if(M.allied("U")){const e=p.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId),r=w.toActions(e);r.length>0?v.ddf5(r):x.triggerDone()}else x.triggerDone()}friends(t){const e=p.crFriendNotMeActTarg("CARD",t,this.code,S.enTil(t,"P1"));return w.toActions(e)}enemies(t,e=""){const r=p.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",e));return r.level=w.ddf2(this.level),w.toActions(r)}bfc(){return "BRF"+this.level}}class qr extends yt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Dysian Siphon";const e=this.boof357;this.text=`Give an enemy creature ${m.jr9(-e,-e)}.~Allied Uterra: Give a friendly creature ${m.jr9(e,e)}. `}playTargets(){const t=super.playTargets(),e=p.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=S.deTil(t.param),r=this.boof357,s=f.ddf6(t);if(e[0]==="P1"){const h=p.crFriendActTarg("CARD",this.code,S.enTil("P2",s.id)),u=w.toActions(h);M.allied("U")&&u.length>0?(u.push(v.cancelAction()),v.ddf5(u)):(this.logSpell(s),s.buff(-r,-r),v.spellCast())}else{const h=f.jr5(e[1]);this.logSpell(h,s),h.buff(-r,-r),s.buff(r,r),v.spellCast()}}}class jr extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Dysian Sludge",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ");const e=-this.boof135;this.text=`Forge: If you have health over 120, you may put a copy of ${this.name} into another lane.~When this enters play, if you have a Nekrium card in hand, the opposing creathure gets ${m.jr9(e,e)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,s.customCode=r.id,r.jr4("EF",this.code),r}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){const e=W.toEnterField(t.event);if(e.forged&&e.creature.id===t.trigger.customCode)if(k.getActive().health>120){const r=p.actionTarget("TF","CARD",this.code,"");r.player="F",r.hint=["FL"],r.lanes=f.laneIdx.filter(h=>h!==e.creature.lane);const s=w.toActions(r);s.push(v.noneEndTrigger()),v.ddf5(s)}else x.triggerDone();else{const r=e.creature.opposed;if(r&&M.allied("N",e.creature.owner)){const s=-this.boof135;r.buff(s,s)}x.triggerDone()}}handleAction(t){f.birth(this.code,"R",t.playerA,t.lane),v.actionDone(!0)}}class Jr extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Echowisp",this.iAttack=this.lValN([7,8,10]),this.iHealth=this.boof135,this.tribe.push("ST"),this.level===3?this.text="Forge: Put a copy of Echowisp into each available lane.":this.text="Forge: You may put a copy of Echowisp into an adjacent lane."}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=this.level<3,r}jr8(t){if(this.level<3){const e=f.jr5(t.trigger.creatId),r=p.actionTarget("TF","CARD",this.code,"");r.player="F",r.lanes=e.adjacent,r.hint=["FL"];const s=w.toActions(r);s.push(v.noneEndTrigger()),v.ddf5(s)}else{const e=p.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId);let r=w.toActions(e);if(r.length>0){const s=N.tick();r.forEach(h=>f.birth(this.code,"P",h.playerA,h.lane,s))}x.triggerDone()}}handleAction(t){f.birth(this.code,"P",t.playerA,t.lane),v.actionDone(!0)}}class rr extends P{lookup(t){return{["BTB"]:{c:()=>this.bbtC(),m:r=>this.bbtM(r)},["TVG"]:{c:()=>this.tvgC(),m:r=>this.tvgM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}armThreshold=1;wipe=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("AR",this.code);return s.area="A",r}enforceEffect(t,e){this.armThreshold<=e.armor?this.createMods(this.cardCode(),e).forEach(r=>{this.wipe&&e.removeModSafe(e.id),e.addModSafe(r)}):e.removeModSafe(e.id)}bbtC(){this.faction="A",this.rarity="R",this.name="Batterbot",this.iAttack=this.boof6914,this.iHealth=this.iAttack+2,this.tribe.push("RB","DN"),this.wipe=!0,this.text=`${this.name} gets +Attack equal to its Armor.`}bbtM(t){return[p.mod("AT",this.boof247,t.id)]}tvgC(){this.faction="A",this.rarity="R",this.name="Tower Vanguard",this.iAttack=this.lValN([3,6,11]),this.iHealth=this.lValN([7,13,21]),this.tribe.push("RB");const t=this.boof247;this.text=`While ${this.name} has Armor, it gets ${m.jr9(t,0)}.`}tvgM(t){return[p.mod("AT",this.boof247,t.id)]}}class ge extends P{lookup(t){return{["CIN"]:{c:()=>this.cyinC(),m:r=>this.cyinM(r)},["HWM"]:{c:()=>this.hlwmC(),m:r=>this.hlwmM(r)},["LSP"]:{c:()=>this.lspC(),m:r=>this.lspM(r)},["SSI"]:{c:()=>this.ssinC(),m:r=>this.ssinM(r)},["WTA"]:{c:()=>this.weguC(),m:r=>this.weguM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.addEffect("AT",this.code),r}enforceEffect(t,e){this.attThreshold<=e.attack?this.createMods(this.cardCode(),e).forEach(r=>{e.addModSafe(r)}):e.removeModSafe(e.id)}cyinC(){this.faction="A",this.rarity="R",this.name="Cypien Infiltrator",this.iAttack=this.boof61117,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.attThreshold=this.lValN([7,14,21]),this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Breakthrough.`}cyinM(t){return[p.mod("BT",!0,t.id)]}hlwmC(){this.faction="A",this.rarity="L",this.name="Hinterland Watchman",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.lValN([7,10,20]),this.tribe.push("MC"),this.attThreshold=this.boof51020;const t=this.lValS(["Mobility 3","Armor 5 and Mobility 3","Armor 5, Breakthrough, Aggressive, Mobility 3, and Regenerate 5"]);this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets ${t}.`}hlwmM(t){const e=[p.mod("MB",3,t.id)];return this.level>1&&e.push(p.mod("AR",5,t.id)),this.level===3&&(e.push(p.mod("BT",!0,t.id)),e.push(p.mod("AG",!0,t.id)),e.push(p.mod("RG",5,t.id))),e}lspC(){this.faction="A",this.rarity="C",this.name="Lightshield Patrol",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.boof51020,this.tribe.push("HM"),this.attThreshold=this.iHealth,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Armor ${this.boof234}.`}lspM(t){return[p.mod("AR",this.boof234,t.id)]}ssinC(){this.faction="A",this.rarity="R",this.name="Spiritsteel Infiltrator",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("EN"),this.attThreshold=this.boof51020,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Mobility ${this.level} and Armor ${this.boof246}.`}ssinM(t){return[p.mod("MB",this.level,t.id),p.mod("AR",this.boof246,t.id)]}weguC(){this.faction="U",this.rarity="L",this.name="Wegu, the Ancient",this.iAttack=0,this.iHealth=1,this.tribe.push("PL"),this.iDefend=!0,this.attThreshold=this.lValN([10,25,100]);const t=this.boof124,e=this.level===3?"it gets Breakthrough and ":"";this.text=`When you gain health, Wegu gets ${m.jr9(t,t)} for each health you gained.~While Wegu has ${this.attThreshold} or more attack, ${e}Negate Defender from it.`}weguM(t){const e=[p.mod("ND",!0,t.id)];return this.level===3&&e.push(p.mod("BT",!0,t.id)),e}}class ir extends P{friendNotMe(t){const e=p.crNotMeTarg(t.id);return e.player=k.toTarget(t.owner),e}friendNone(t){const e=p.crTarg();return e.player=k.toTarget(t.owner),e.lanes=[],e}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforcementActive(t){return t.status==="A"}applyEffect(t,e,r){const s=this.friendNotMe(t),h=f.creatByTarget(s),u=f.creatByTarget(r);h.forEach(g=>{u.includes(g)?g.addModSafe(e):g.removeModSafe(t.id)})}}class He extends ir{lookup(t){return{["BWW"]:{c:()=>this.bwwC(),m:r=>this.bwwM(r),t:r=>this.bwwT(r)},["HTR"]:{c:()=>this.hrtC(),m:r=>this.hrtM(r),t:r=>this.hrtT(r)},["KKK"]:{c:()=>this.kkkC(),m:r=>this.kkkM(r),t:r=>this.kkkT(r)},["XDV"]:{c:()=>this.xdvC(),m:r=>this.xdvM(r),t:r=>this.xdvT(r)}}[t]}createMod(t,e){return this.lookup(t).m(e)}effTargs(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t,e){const r=this.cardCode(),s=this.createMod(r,e),h=this.enforcementActive(e)?this.effTargs(r,e):this.friendNone(e);this.applyEffect(e,s,h)}bwwC(){this.faction="T",this.rarity="H",this.name="Borean Windweaver",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.iMobile=this.level,this.tribe.push("WN","AS"),this.text=`Each other friendly creature gets Mobility ${this.level}.`}bwwM(t){return p.mod("MB",this.level,t.id)}bwwT(t){return this.friendNotMe(t)}hrtC(){this.faction="U",this.rarity="L",this.name="Heart Tree",this.iAttack=0,this.iHealth=this.lValN([10,15,30]),this.iRegen=this.boof246,this.iDefend=!0,this.tribe.push("PL"),this.text=`Each other friendly creature gets Regenerate ${this.iRegen}.`}hrtM(t){return p.mod("RG",this.iRegen,t.id)}hrtT(t){return this.friendNotMe(t)}kkkC(){if(this.faction="T",this.rarity="L",this.name="Korok, Khan of Kadras",this.iAttack=this.lValN([4,7,12,18]),this.iHealth=this.lValN([7,12,18,26]),this.iAggro=!0,this.tribe.push("FB"),this.maxLevel=4,this.level>1){const t=this.lValS(["","friendly level 1","friendly level 2 or lower","other friendly"]);this.text=`Each ${t} creature gets Aggressive.`}}kkkM(t){return p.mod("AG",!0,t.id)}kkkT(t){const e=this.friendNotMe(t);return this.level===1?e.lanes=[]:e.level=w.ddf2(this.level-1),e}xdvC(){this.faction="N",this.rarity="H",this.name="Xrath, Dreadnight Of Varna",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.boof248,this.tribe.push("ZB"),this.text=`Each other friendly Zombie gets Regenerate ${this.iRegen}`}xdvM(t){return p.mod("RG",this.iRegen,t.id)}xdvT(t){const e=this.friendNotMe(t);return e.tribe="ZB",e}}class Qr extends P{lookup(t){return{["AHL"]:{c:()=>this.ahlC(),m:r=>this.ahlM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){const r=p.crNotMeTarg(e.id);r.player=k.toTarget(e.owner),f.creatByTarget(r).length===0?this.createMods(this.cardCode(),e).forEach(h=>{e.addModSafe(h)}):e.removeModSafe(e.id)}ahlC(){this.faction="A",this.rarity="H",this.name="Alloyin Highlander",this.iAttack=this.lValN([5,7,10]),this.iHealth=this.boof6914,this.tribe.push("HM"),this.text=`While ${this.name} is your only friendly creature, it gets ${m.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}ahlM(t){return[p.mod("AT",this.boof4812,t.id),p.mod("AR",this.boof248,t.id)]}}class sr extends P{lookup(t){return{["NXP"]:{c:()=>this.nxpC(),m:r=>this.nxpM(r)},["SKG"]:{c:()=>this.skgC(),m:r=>this.skgM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){e.lane===3?this.createMods(this.cardCode(),e).forEach(r=>{e.addModSafe(r)}):e.removeModSafe(e.id)}nxpC(){this.faction="A",this.rarity="C",this.name="Nexus Pilot",this.iAttack=this.boof358,this.iHealth=this.boof4710,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets ${m.jr9(this.iAttack,this.iHealth)}.`}nxpM(t){return[p.mod("AT",this.iAttack,t.id),p.mod("HL",this.iHealth,t.id),p.mod("MH",this.iHealth,t.id)]}skgC(){this.faction="A",this.rarity="C",this.name="Skyknight Glider",this.iAttack=this.boof5916,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets Mobility 2.`}skgM(t){return[p.mod("MB",2,t.id)]}}class Ue extends P{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:r=>this.cctM(r)},["GHB"]:{c:()=>this.ghbC(),m:r=>this.ghbM(r)},["PYG"]:{c:()=>this.pygC(),m:r=>this.pygM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}likesOpposed=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=[this.likesOpposed?"OP":"OL"]}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="A",r}enforceEffect(t,e){!!e.opposed===this.likesOpposed?this.createMods(this.cardCode(),e).forEach(r=>{e.addModSafe(r)}):e.removeModSafe(e.id)}cctC(){this.faction="T",this.rarity="R",this.name="Cloudcleaver Titan",this.iAttack=this.boof4812,this.iHealth=this.lValN([7,10,16]),this.tribe.push("WN","GT"),this.iMobile=this.level;const t=this.boof246;this.text=`While ${this.name} is unopposed, it gets ${m.jr9(t,0)}.`}cctM(t){return[p.mod("AT",this.boof246,t.id)]}ghbC(){this.faction="U",this.rarity="R",this.name="Gemhide Basher",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.lValN([3,7,10]),this.tribe.push("DN"),this.likesOpposed=!0,this.text=`While ${this.name} is opposed, it gets Aggressive.`}ghbM(t){return[p.mod("AG",!0,t.id)]}pygC(){this.faction="T",this.rarity="H",this.name="Pyre Giant",this.iAttack=this.boof468,this.iHealth=this.boof234,this.tribe.push("FR","GT"),this.iAggro=!0,this.text=`While ${this.name} is unopposed, it gets ${m.jr9(this.iAttack,0)}.`}pygM(t){return[p.mod("AT",this.iAttack,t.id)]}}class ar extends P{lookup(t){return{["BRS"]:{c:()=>this.barryC(),m:r=>this.barryM(r)},["CSR"]:{c:()=>this.cvsC(),m:r=>this.cvsM(r)}}[t]}mPlayer=0;targetPlayer(t){if(this.mPlayer===1)return t.owner;if(this.mPlayer===-1)return!t.owner;throw new Error("didnt write code OBDD")}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){const r=e.status==="A",s=this.targetPlayer(e);if(r){const h=this.createMod(this.cardCode(),e);k.addModSafe(s,h)}else k.removeModSafe(s,e.id)}barryC(){this.faction="A",this.rarity="C",this.name="Barrier Soldier",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("HM"),this.mPlayer=1,this.text=`You get Armor ${this.iHealth}.`}barryM(t){return p.mod("AR",this.iHealth,t.id)}cvsC(){this.faction="U",this.rarity="C",this.name="Cavern Serpent",this.iAttack=this.boof4914,this.iHealth=this.iAttack,this.tribe.push("SN"),this.mPlayer=-1,this.text=`The enemy player has Poison ${this.boof246}.`}cvsM(t){return p.mod("PN",this.boof246,t.id)}}class me extends ir{lookup(t){return{["ALG"]:{c:()=>this.algnC(),m:r=>this.algnM(r)},["ALS"]:{c:()=>this.alstC(),m:r=>this.alstM(r)},["BTN"]:{c:()=>this.btcC(),m:r=>this.btcM(r)},["NXA"]:{c:()=>this.aeroC(),m:r=>this.aeroM(r)},["NXT"]:{c:()=>this.ntcC(),m:r=>this.ntcM(r)}}[t]}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}nexus=!1;enforcementActive(t){return super.enforcementActive(t)?this.nexus?t.lane===3:!0:!1}enforceEffect(t,e){const r=this.cardCode(),s=this.createMod(r,e);let h;this.enforcementActive(e)?(h=this.friendNotMe(e),this.nexus?h.lanes=[1,2,4,5]:h.lanes=e.adjacent):h=this.friendNone(e),this.applyEffect(e,s,h)}algnC(){this.faction="A",this.rarity="R",this.name="Alloyin General",this.iAttack=this.boof246,this.iHealth=this.boof81318,this.tribe.push("HM"),this.text=`Adjacent creatures gets ${m.jr9(this.iAttack,0)}.`}algnM(t){return p.mod("AT",this.iAttack,t.id)}alstC(){this.faction="A",this.rarity="H",this.name="Alloyin Strategist",this.iAttack=this.boof4814,this.iHealth=this.iAttack+1,this.iMobile=this.level,this.tribe.push("HM");const t=this.boof246;this.text=`Adjacent creatures gets ${m.jr9(t,0)}.`}alstM(t){return p.mod("AT",this.boof246,t.id)}btcC(){this.faction="A",this.rarity="H",this.name="Battle Techtician",this.iAttack=this.boof3714,this.iHealth=this.boof71117,this.tribe.push("HM"),this.nexus=!0;const t=this.boof248;this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${m.jr9(t,0)}.`}btcM(t){return p.mod("AT",this.boof248,t.id)}aeroC(){this.faction="A",this.rarity="L",this.name="Nexus Aeronaut",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.iMobile=1;const t=this.boof236;this.nexus=!0,this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${m.jr9(t,0)}. Otherwise this gets Armor ${t}.`}aeroM(t){return p.mod("AT",this.boof236,t.id)}ntcC(){this.faction="A",this.rarity="H",this.name="Nexus Techtician",this.iHealth=this.boof6916,this.iAttack=this.iHealth-3,this.tribe.push("HM"),this.nexus=!0;const t=this.boof235;this.text=`While ${this.name} is in the center lane, each other friendly creature gets Armor ${t}.`}ntcM(t){return p.mod("AR",this.boof235,t.id)}}class pe extends P{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC(),["RWC"]:()=>this.roamC()})[t]()}targAction(t){f.birth(this.spawnCode,"P",t.playerA,t.lane)}adjacent=!1;optional=!1;needsEmpty=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const e=m.forglied(this.allied);this.text=e+": "+this.ftext}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}jr8(t){if(this.allied==="X"||M.allied(this.allied)){const e=f.jr5(t.creatId),r=p.emptyPlayerActTarg("F","CARD",this.code,t.creatId);this.needsEmpty||(r.field="A",r.hint=["FL"],r.lanes=f.laneIdx.filter(h=>h!==e.lane)),this.adjacent&&(r.lanes=e.adjacent);const s=w.toActions(r);s.length>0?(this.optional&&s.push(v.noneEndTrigger()),v.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){this.targAction(t),v.actionDone(!0)}bwdC(){this.faction="U",this.rarity="C",this.name="Branchweaver Druid",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.hints=["RT"],this.spawnCode=`${"TFD"}${this.level}`,this.optional=!0;const t=I.getCard(this.spawnCode);this.ftext=`You may put a ${m.tokName(t)} into another lane.`}btsC(){this.faction="U",this.rarity="C",this.name="Brighttusk Sower",this.iAttack=this.lValN([6,8,10]),this.iHealth=this.iAttack,this.tribe.push("TK"),this.spawnCode=U.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=I.getCard(this.spawnCode);this.ftext=`You may put a ${m.tokName(t)} into an adjacent lane.`}escarC(){this.faction="A",this.rarity="H",this.name="Esperian Scarab",this.iAttack=this.lValN([3,4,7]),this.iHealth=this.boof5711,this.iArmor=this.boof135,this.tribe.push("RB"),this.allied="U",this.spawnCode=this.code,this.optional=!0,this.ftext=`You may but a copy of ${this.name} into another lane.`}ethhC(){this.faction="U",this.rarity="C",this.name="Ether Hounds",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ST"),this.needsEmpty=!0,this.spawnCode=this.code,this.ftext="Put a copy of this into an available lane."}roamC(){this.faction="U",this.rarity="C",this.name="Roaming Warclaw",this.iAttack=this.boof61016,this.iHealth=this.iAttack-3,this.tribe.push("DN"),this.spawnCode=`${"RPT"}${this.level}`,this.optional=!0,this.ftext="You may put a 1/1 Raptor into another lane."}}class _r extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Epoch Hawk",this.iAttack=this.boof469,this.iHealth=this.boof71117,this.tribe.push("MC");const e=I.getCard(this.soldier);this.addSp("N",e.iAttack),this.text=`While you have 6 or more cards in hand, this gets "Activate: Put a ${m.tokName(e)} into an available lane."`}canActivate(t){return k.toPlayer(t.owner).hand.length>5&&f.emptyLanes(t.owner).length>0}startActivation(t){const e=p.emptyPlayerActTarg(t.owner,"CARD",this.code,t.id),r=w.toActions(e);r.push(v.cancelAction()),v.ddf5(r)}handleAction(t){const e=f.jr5(t.param);this.logAct(!0),f.birth(this.soldier,"P",t.playerA,t.lane),e.endActivation()}ddf8(t){return t.trigger.type==="TE"}jr8(t){const e=k.toPlayer(t.owner);k.drawCard(e,1);const r=p.trigIdx(e.triggers,t.trigger);r>-1&&e.triggers.splice(r,1),x.triggerDone()}get soldier(){return "EPS"+this.level}}class ti extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Esperian Sage",this.iAttack=this.boof3510,this.iHealth=this.boof124,this.tribe.push("HM"),this.text=`When ${this.name} enters play, discard and level up a card.~Allied Uterra: You may put a copy of this into another lane.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);s.interactive=!0;const h=r.jr4("EF",this.code);return h.interactive=!0,r}handleAction(t){if(t.zone==="H")M.levelAndDiscardA(t);else{const e=t;f.birth(this.code,"R",e.playerA,e.lane)}v.actionDone(!0)}ddf8(t){return t.event.code==="ENT"?t.event.creatId===t.creatId:!1}jr8(t){if(t.trigger.type==="FR")if(M.allied("U")){const e=f.jr5(t.creatId),r=p.actionTarget("TF","CARD",this.code,t.creatId);r.player="F",r.lanes=f.laneIdx.filter(h=>h!==e.lane),r.hint=["FL"];const s=w.toActions(r);s.push(v.noneEndTrigger()),v.ddf5(s)}else x.triggerDone();else{const e=p.lvlHandActTarg(this.code,t.creatId),r=w.toActions(e);r.length>0?v.ddf5(r):x.triggerDone()}}}class ei extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Esperian Steelplate",this.iAttack=this.boof369,this.iHealth=this.boof6916,this.tribe.push("IN");const e=this.boof358;this.addSp("H",e),this.text=`Activate: Heal ${e} damage from each other friendly creature.~Allied Alloyin: Armor ${this.boof247}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}canActivate(t){const e=p.crFriendNotMeTarg(t.id);return f.creatByTarget(e).length>0}startActivation(t){const e=w.boardTarget("CARD",this.code);e.param=t.id,v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),r=this.boof358,s=p.crFriendNotMeTarg(e.id);f.creatByTarget(s).forEach(h=>{h.heal(r)}),e.endActivation()}jr8(t){M.allied("A")&&f.jr5(t.creatId).addArmor(this.boof247),x.triggerDone()}}class ri extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Everflame Phoenix",this.iAttack=this.lValN([7,0,22]),this.iHealth=this.lValN([6,1,15]),this.tribe.push("PX"),this.iMobile=this.lValN([1,0,2]),this.level===2?(this.iDefend=!0,this.text=`When you gain a rank, replace ${this.name} with a level 3 ${this.name}.`,this.hints=["RH","LV"],this.bonus={exist:this.ddp9(1,37,22,0)}):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this lane.`,this.bonus={exist:this.ddp9(1,1,0,0)})}jr3(t,e){const r=super.jr3(t,e);return this.level===2?r.jr4("RU",this.code):this.level===3&&r.jr4("VN",this.code),r}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.owner:super.ddf8(t)}jr8(t){if(t.trigger.type==="RU"){const e=f.jr5(t.creatId);f.birth(`${"EFP"}3`,"R",e.owner,e.lane)}else if(t.trigger.type==="VN"){const r=W.toCreature(t.event).creature;f.birth(`${"EFP"}2`,"P",r.owner,r.lane)}x.triggerDone()}}class ii extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Everflow Eidolon",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("PL"),this.text=`When ${this.name} gains health, you gain ${this.level===3?"2x ":""}that much health.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("HG",this.code),r}ddf8(t){return t.trigger.type==="HG"?t.event.creatId===t.creatId:!1}jr8(t){if(t.trigger.type==="HG"){const e=t.event,r=this.level===3?2:1;k.heal(t.owner,e.healAmt*r)}x.triggerDone()}}class si extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Frostmane Dragon",this.iAttack=this.lValN([6,9,13]),this.iHealth=this.iAttack+1,this.tribe.push("IC","DG"),this.iMobile=2,this.text=`At the start of your turn, if ${this.name} was Forged last turn, you may put a Level ${this.level} Frostmane egg into an available lane.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}handleAction(t){f.birth(`${"FME"}${this.level}`,"P",t.playerA,t.lane),v.actionDone(!0)}ddf8(t){return t.trigger.type==="TS"?t.event.playerA===t.owner:!1}jr8(t){const e=f.jr5(t.creatId);if(t.event.code==="ENT"){const r=e.jr4("TS",this.code);r.interactive=!0,r.changes=!0,x.triggerDone()}else if(t.event.code==="TRS"){const r=p.trigIdx(e.triggers,t.trigger);r>-1&&e.removeTrigger(e.triggers[r]);const s=p.emptyPlayerActTarg("F","CARD",this.code,""),h=w.toActions(s);h.length===0?x.triggerDone():(h.push(v.noneEndTrigger()),v.ddf5(h))}}}class ai extends yt{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const e=this.boof4711;this.text=`Deal ${e} damage to an enemy creature.~Give a friendly creature ${m.jr9(e,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(p.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.ddf6(t);this.logSpell(r);const s=f.jr5(e[1]),h=this.boof4711;s.hurtDirect(h,this.code);const u=p.mod("AT",h,this.code);u.expiry="ET",r.addMod(u),v.spellCast()}}friends(t=""){const e=p.crFriendActTarg("CARD",this.code,S.enTil("P2",t));return w.toActions(e)}getCardActions(t,e){const r=f.ddf6(t),s=this.friends(r.id);return s.push(v.cancelAction()),s}}class ni extends yt{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Gauntlets of Sulgrim";const e=this.boof2510;this.text=`Give a friendly creature Armor ${e}, then deal damage equal to its Armor to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.baddies().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");e.canArmor=!0,t.push(e)}return t}handleAction(t){const e=S.deTil(t.param),r=f.ddf6(t);if(e[0]==="P1"){const s=v.cancelAction(),h=this.baddies(r.id);h.push(s),v.ddf5(h)}else{const s=f.jr5(e[1]);this.logSpell(s);const h=this.boof2510;s.addArmor(h),r.hurtDirect(s.armor,this.code),v.spellCast()}}baddies(t=""){return w.toActions(p.crEnemyActTarg("CARD",this.code,S.enTil("P2",t)))}}class oi extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Gemhide Ravager",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("DN"),this.bonus={exist:this.ddp9(0,0,0,this.iAttack)},this.text=`When ${this.name} ${m.dbdtap()}, you gain that much health.~Allied Tempys: Mobility ${this.level}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR")M.allied("T")&&f.jr5(t.creatId).addMobility(this.level),x.triggerDone();else if(t.trigger.type==="DM"){const e=t.event;k.heal(t.owner,e.dmg),x.triggerDone()}}}class hi extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Glaceus, Tundra Tyrant",this.iAttack=this.boof5916,this.iHealth=this.iAttack+2,this.tribe.push("IC","EL"),this.hints=["TL"];const e=`Gain Rank: each enemy ${m.levelGateText(this.level,!0)}creature gets "When this is dealt damage, destroy it."`,r=this.level===3?"At the start of each turn, deal 1 damage to each enemy creature.~":"";this.text=r+e}jr3(t,e){const r=super.jr3(t,e);return r.jr4("RU",this.code),this.level===3&&r.jr4("TS",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;if(e.isCreatTarg&&e.target===t.creatId)return!0}return t.trigger.type==="RU"?t.event.playerA===t.owner:t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="RU"){const e=p.crEnemyTarg();e.level=w.ddf2(this.level),f.creatByTarget(e).forEach(r=>{r.jr4("DM",this.code),r.changed=!0})}else if(t.trigger.type==="TS"){const e=N.tick();f.qEnemyCreats().forEach(r=>{r.hurtDirect(1,this.code,e)})}else if(t.trigger.type==="DM"){const e=f.jr5(t.creatId);e.status==="A"&&O.destroy(e,this.code)}x.triggerDone()}}class li extends yt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Grave Pact",this.isFree=this.level===3,this.text=`Destroy a friendly creature.~Destroy an ${m.levelGateText(this.level+1,!0)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{this.logSpell();const r=f.ddf6(t),s=f.jr5(e[1]),h=N.tick();O.destroy(s,this.code,h),O.destroy(r,this.code,h),v.spellCast()}}enemyTargActions(t=""){const e=p.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return e.level=w.ddf2(this.level+1),w.toActions(e)}getCardActions(t,e){const r=f.ddf6(t),s=this.enemyTargActions(r.id);return s.push(v.cancelAction()),s}}class ci extends yt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const e=this.boof359;this.text=`Give a friendly creature +${e} attack.~Give an enemy creature -${e} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.ddf6(t),s=f.jr5(e[1]);this.logSpell(s,r);const h=this.boof359;s.buff(h,0),r.buff(-h,0),v.spellCast()}}getCardActions(t,e){const r=f.ddf6(t),s=this.enemyTargActions(r.id);return s.push(v.cancelAction()),s}enemyTargActions(t=""){const e=p.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return w.toActions(e)}}class di extends P{constructor(t){super(t),this.faction="U",this.rarity="C",this.name="Hunting Pack",this.iAttack=this.boof3612,this.iHealth=this.boof248,this.tribe.push("WF"),this.text=`When ${this.name} enters play, you have a 50% chance to put a copy of ${this.name} into an available lane.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("EF",this.code);return s.interactive=!0,r}handleAction(t){f.birth(this.code,"P",t.playerA,t.lane),v.actionDone(!0)}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){if(S.randInt(0,2)===1){const r=p.emptyPlayerActTarg("F","CARD",this.code,""),s=p.actionTarget("TB","NOTR",this.code,""),h=w.toActions([r,s]);h.length===1?x.triggerDone():v.ddf5(h)}else x.triggerDone()}}class ui extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Iniog, Carrion Demon",this.iAttack=this.lValN([0,12,20]),this.iHealth=this.boof3713,this.tribe.push("DM");let e;this.level===1?(this.iDefend=!0,e=5):(this.iMobile=1,this.iRegen=this.level===2?5:10,e=10);let r;this.level===3?r="When this gains health, deal that much damage to the enemy player.~Vengeance: Put a level 1 Iniog into this lane.":r=`When a creature is destroyed, this gets Regenerate 1.~At the end of your turn, if this has Regenerate ${e} or higher, replace it with a level ${this.level+1} Iniog.`,this.text=r}jr3(t,e){const r=super.jr3(t,e);return this.level===3?(r.jr4("HG",this.code),r.jr4("VN",this.code)):(r.jr4("DS",this.code),r.jr4("TE",this.code)),r}ddf8(t){return t.trigger.type==="TE"?t.event.playerA===t.owner:t.trigger.type==="HG"?t.event.creatId===t.creatId:t.trigger.type==="DS"}jr8(t){const e=f.jr5(t.creatId);if(t.trigger.type==="HG"){const r=t.event;k.hurtDirect(!t.owner,r.healAmt,this.code)}else if(t.trigger.type==="VN")f.birth("ICD"+"1","P",e.owner,e.lane);else if(t.trigger.type==="DS")e.addRegen(1);else if(t.trigger.type==="TE"){const r=this.level===1?4:9;e.regen>r&&f.birth(this.levelUpCard(),"R",e.owner,e.lane)}x.triggerDone()}}class fi extends P{image(t){return super.fixedImage(t)}constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Iztek, Avatar of Flame",this.iAttack=this.lValN([7,12,20]),this.iHealth=this.boof6915,this.tribe.push("FR","EL"),this.iAggro=!0,this.text=`When Iztek ${m.dbdtap()}, deal that much damage to that player again.~When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("PC",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}else if(t.trigger.type==="PC"){const e=t.event;if(e.playerA===t.owner)return I.getCard(e.cardCode).cardCode()==="IFR"}return!1}jr8(t){if(t.trigger.type==="DM"){const e=t.event;k.hurtDirect(!t.owner,e.dmg,this.code)}else if(t.trigger.type==="PC"){const e=f.jr5(t.trigger.creatId);f.birth(`${"IZR"}${this.level}`,"R",e.owner,e.lane)}x.triggerDone()}}class gi extends P{image(t){return super.fixedImage(t)}constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Iztek, Avatar of Frost",this.iAttack=this.boof6915,this.iHealth=this.lValN([7,12,20]),this.tribe.push("IC","EL"),this.iAggro=!0;const e=this.boof2510;this.text=`When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.~Activate: Deal ${e} damage to a creature.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("PC",this.code),r}canActivate(t){return!0}startActivation(t){const e=p.crActTarg("CARD",this.code,t.id);e.hint=["HR"];const r=w.toActions([e,w.buttonTarget("CANC")]);v.ddf5(r)}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.logAct(!0),e.hurtDirect(this.boof2510,this.code),r.endActivation()}ddf8(t){const e=t.event;return e.playerA===t.owner?I.getCard(e.cardCode).cardCode()==="IFL":!1}jr8(t){const e=f.jr5(t.trigger.creatId);f.birth(`${"IZL"}${this.level}`,"R",e.owner,e.lane),x.triggerDone()}}class mi extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Killer Bee",this.iAttack=this.boof135,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("IN"),this.hints=["OL"];const e=this.lValS(["Poison 1","Poison 3","that much Poison"]);this.text=`When ${this.name} deals battle damage to a creature or player, they get ${e}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){const e=W.toDamage(t.event),r=this.lValN([1,3,e.dmg]);e.isCreatTarg?e.hurtCreat.addPoison(r):e.hurtPlayer.poison+=r,x.triggerDone()}}class pi extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Killion, Infinity Warden",this.maxLevel=4,this.iAttack=this.lValN([6,9,16,22]),this.iHealth=this.lValN([3,7,14,20]),this.tribe.push("FB");let e;this.level<3?e=`a ${m.levelGateText(this.level)} card in your`:this.level===3?e="a card in your hand and":e="each card in your hand, deck, and",this.text=`Forge: Level up ${e} discard pile.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=this.level<4,r}handleAction(t){const e=k.getActive();if(t.zone==="N"){const r=I.getCard(e.discard[t.position]);e.discard[t.position]=r.levelUpCard(),mt.popMode(),v.actionDone(!0)}else{const r=I.getCard(e.hand[t.position]);e.hand[t.position]=r.levelUpCard(),this.discardLevel(!0)}}jr8(t){if(this.level<3)this.discardLevel(!1);else if(this.level===3){const e=w.toActions(p.lvlHandActTarg(this.code,""));e.length>0?v.ddf5(e):this.discardLevel(!1)}else{const e=k.getActive();this.levelDeck(e.deck),this.levelDeck(e.hand),this.levelDeck(e.discard),x.triggerDone()}}discardLevel(t){const e=k.getActive(),r=p.target("TD");r.player=k.toTarget(e),r.level=w.ddf2(this.level),r.canLevel=!0;const s=Ht.generateContent(e.discard,!1,r);if(s.length>0){const h=s.map(u=>{const g=p.deckSelectAction("CARD",u.cardCode,u.sourceIdx);return g.host=this.code,g.hint=["CD"],g});Ht.showCustomDeck(s,h)}else t?v.actionDone(!0):x.triggerDone()}levelDeck(t){t.map(r=>{const s=I.getCard(r);return s.canLevel()?s.levelUpCard():r}).forEach((r,s)=>t[s]=r)}}class yi extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Lavafused Asir",this.iAttack=this.boof369,this.iHealth=this.iAttack*2,this.tribe.push("FR","AS"),this.text=`While a friendly creature is unopposed, gets ${m.jr9(this.iAttack,0)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="A",r}enforceEffect(t,e){const r=p.crTarg(),s=e.status!=="A";r.player=k.toTarget(e.owner);const h=f.creatByTarget(r),u=p.mod("AT",this.iAttack,e.id);h.forEach(g=>{g.opposed||s?g.removeModSafe(e.id):g.addModSafe(u)})}}class bi extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Leafkin Progenitor",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level===3?(this.text=`Activate: Put a level 1 ${this.name} into an adjacent available lane.`,this.bonus={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?v.emptyAdjacents(t,"").length>0:!0}startActivation(t){let e;if(this.level===3)e=v.emptyAdjacents(t,"");else{const r=p.fieldSelectAction("CARD",t.lane,t.owner);r.param=t.id,r.host=this.code,e=[r]}e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);this.level===3?f.birth(this.leafCode(1),"P",t.playerA,t.lane):f.birth(this.leafCode(this.level+1),"R",e.owner,e.lane),e.endActivation()}leafCode(t){return`${"LKP"}${t}`}}class le extends P{cardConstruct(t){({["AFO"]:()=>this.aetorC(),["CRS"]:()=>this.scootC(),["FOL"]:()=>this.forcC(),["NXO"]:()=>this.nexoC(),["TEX"]:()=>this.texC(),["TSM"]:()=>this.tsmithC()})[t]()}targAction(t,e,r){({["AFO"]:(h,u)=>this.doNossing(h,u),["CRS"]:(h,u)=>this.doNossing(h,u),["FOL"]:(h,u)=>this.doNossing(h,u),["NXO"]:(h,u)=>this.doNossing(h,u),["TEX"]:(h,u)=>this.doNossing(h,u),["TSM"]:(h,u)=>this.doNossing(h,u)})[t](e,r)}playTarg;optional=!1;ftext="";forgeLevels=[1,2,3,4];constructor(t){super(t),this.playTarg=p.lvlHandActTarg(this.code,""),this.cardConstruct(this.cardCode()),this.forgeLevels.includes(this.level)&&(this.text="Forge: "+this.ftext)}jr3(t,e){const r=super.jr3(t,e);if(this.forgeLevels.includes(this.level)){const s=r.jr4("FR",this.code);s.interactive=!0}return r}handleAction(t){M.levelAndDiscardA(t);const e=f.jr5(t.param);this.targAction(this.cardCode(),t,e),v.actionDone(!0)}jr8(t){if(this.cardCode()==="NXO"&&f.jr5(t.creatId).lane!==3){x.triggerDone();return}const e=w.toActions(this.playTarg);e.length>0?(e.forEach(r=>{r.param=t.creatId}),this.optional&&e.push(v.noneEndTrigger()),v.ddf5(e)):x.triggerDone()}doNossing(t,e){}aetorC(){this.faction="A",this.rarity="C",this.name="Aetherforge Oracle",this.iAttack=this.boof61218,this.iHealth=this.boof246,this.tribe.push("HM"),this.optional=!0,this.playTarg.card="S",this.ftext="You may discard and level up a spell.",this.bonus={play:.5}}scootC(){this.faction="A",this.rarity="R",this.name="Cerebral Scout",this.iAttack=this.boof51015,this.iHealth=this.boof3712,this.tribe.push("MM"),this.optional=!0,this.playTarg.tribe="MM",this.ftext="You may discard and level up a Metamind.",this.bonus={play:.5}}forcC(){this.faction="A",this.rarity="H",this.name="Forge Oracle",this.iAttack=this.lValN([1,10,20]),this.iHealth=this.iAttack,this.tribe.push("ST"),this.playTarg.faction="A",this.optional=!0,this.ftext="You may discard an Alloyin card and level it.",this.level===1?(this.hints=["LV","RT"],this.bonus={play:1}):(this.consistent=!0,this.addSp("C",0),this.bonus={play:.3})}nexoC(){this.faction="A",this.rarity="C",this.name="Nexus Overwatch",this.iHealth=this.boof71014,this.iAttack=this.iHealth-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`If ${this.name} is in the center lane, you may ${m.daluac()}.`,this.bonus={play:.5}}texC(){this.faction="A",this.rarity="C",this.name="Tech Explorer",this.iAttack=this.lValN([1,8,18]),this.iHealth=this.iAttack+2,this.tribe.push("GN"),this.level===1&&(this.hints=["LV","RT"]),this.optional=!0,this.playTarg.card="C",this.ftext="You may discard and level up a creature.",this.bonus={play:.5}}tsmithC(){this.faction="A",this.rarity="C",this.name="Technosmith",this.iAttack=this.boof5915,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`You may ${m.daluac()}.`,this.bonus={play:.5}}}class Pt extends P{lookup(t){return{["DFB"]:{c:()=>this.dfbC(),d:(r,s)=>this.dfbD(r,s)},["GGD"]:{c:()=>this.ggdC(),d:(r,s)=>this.ggdD(r,s)},["GGR"]:{c:()=>this.ggdrC(),d:(r,s)=>this.ggdrD(r,s)},["GGP"]:{c:()=>this.ggpC(),d:(r,s)=>this.ggpD(r,s)},["MHR"]:{c:()=>this.mhermC(),d:(r,s)=>this.mhermD(r,s)},["NGT"]:{c:()=>this.ngauntC(),d:(r,s)=>this.ngauntD(r,s)},["SRH"]:{c:()=>this.sharvC(),d:(r,s)=>this.sharvD(r,s)},["YNS"]:{c:()=>this.yuruC(),d:(r,s)=>this.yuruD(r,s)}}[t]}creatDied(t,e){this.lookup(t).d(e,W.toCreature(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DS",this.code),r}ddf8(t){return t.trigger.type==="DS"}jr8(t){this.creatDied(this.cardCode(),t),x.triggerDone()}dfbC(){this.faction="N",this.rarity="R",this.name="Dr. Frankenbaum",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("AB");const t=this.boof234;this.text=`When a friendly Abomination is destroyed, deal ${t} damage to the enemy player.`,this.bonus={exist:this.ddp9(0,0,0,t*2)}}dfbD(t,e){const r=f.jr5(t.creatId),s=e.creature;(r.id===s.id||s.owner===r.owner&&s.isTribe("AB")&&Pt.itDiedFirst(s.id,r.id))&&k.hurtDirect(!r.owner,this.boof234,this.code)}ggdC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Devourer",this.iAttack=this.boof579,this.iHealth=this.iAttack-2,this.tribe.push("GG"),this.hints=["OL"],this.text=`When a creature is destroyed, ${this.name} gets ${m.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)*2}}ggdD(t,e){f.jr5(t.creatId).buff(this.level,this.level)}get doomb(){return this.lValN([1,1,2])}ggdrC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Doomrider",this.iAttack=this.boof4712,this.iHealth=this.iAttack+2,this.tribe.push("GG");const t=this.doomb;this.text=`When a friendly creature is destroyed, ${this.name} moves to that creatures lane and gets ${m.jr9(t,t)}. Then give the opposing creature ${m.jr9(-t,-t)}.`,this.bonus={exist:this.ddp9(0,t*4,t*2,0)}}ggdrD(t,e){const r=f.jr5(t.creatId),s=e.creature;if(s.owner===r.owner&&r.id!==s.id&&Pt.itDiedFirst(s.id,r.id)&&!f.searchByLane(s.lane,s.owner)){const u=this.doomb;r.move(s.lane),r.buff(u,u);const g=r.opposed;g&&(this.logAct(!1,g),g.buff(-u,-u))}}ggpC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Predator",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("GG"),this.hints=["OP"];const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,2*t,t,0)}}ggpD(t,e){const r=f.jr5(t.creatId),s=f.oppositeLane(r.lane);if(e.creature.owner!==r.owner&&e.creature.lane===s){const h=this.boof246;r.buff(h,h)}}mhermC(){this.faction="U",this.rarity="L",this.name="Malice Hermit",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("YT");const t=this.boof124;this.text=`Forge: Each other creature gets Poison ${t}.~When a creature with Poison is destroyed, ${this.name} gets ${m.jr9(t,t)}.`}mhermD(t,e){if(e.creature.poison>0){const r=this.boof124,s=f.jr5(t.creatId);this.logAct(!1,e.creature),s.buff(r,r)}}ngauntC(){this.faction="N",this.rarity="R",this.name="Nightgaunt",this.iAttack=this.boof4815,this.iHealth=this.iAttack+1,this.tribe.push("GG"),this.text=`When a creature is destroyed, ${this.name} gets Regenerate 1.`,this.bonus={exist:this.ddp9(0,4,0,0)}}ngauntD(t,e){f.jr5(t.creatId).addRegen(1)}sharvC(){this.faction="N",this.rarity="C",this.name="Sorrow Harvester",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("AB"),this.text="When a friendly Abomination is destroyed on your turn, draw a card.",this.bonus={exist:.25}}sharvD(t,e){const r=e.creature;r.owner===t.owner&&r.isTribe("AB")&&k.getActiveB()===t.owner&&Pt.itDiedFirst(r.id,t.creatId)&&k.drawCard(t.owner,1)}yuruC(){this.faction="N",this.rarity="L",this.name="Yuru, the Necrosage",this.iAttack=3,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("HM");const t=I.getCard(this.syc());this.text=`When an adjacent non-Spirit creature is destroyed, put a ${m.tokName(t)} into that lane.`}yuruD(t,e){const r=f.jr5(t.creatId),s=e.creature;s.owner===r.owner&&r.adjacent.includes(s.lane)&&!s.isTribe("ST")&&Pt.itDiedFirst(s.id,r.id)&&f.birth(this.syc(),"P",r.owner,s.lane)}syc(){return "XYR"+this.level}static itDiedFirst(t,e){if(t===e)return!0;let r=!1;const s=O.findDeathTime(e);if(S.isUn(s))r=!0;else{const h=O.findDeathTime(t);(S.isUn(h)||h<=s)&&(r=!0)}return r}}class Ai extends Pt{jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}jr8(t){if(t.trigger.type==="FR"){const e=f.creatByTarget(p.crNotMeTarg(t.creatId)),r=this.boof124;e.forEach(s=>s.addPoison(r)),x.triggerDone()}else super.jr8(t)}}class ki extends yt{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metatransfer",this.text=`Give a creature ${m.jr9(-this.boof579,0)}.~Discard and level up a card.`}playTargets(){const t=super.playTargets(),e=p.crActTarg("CARD",this.code,"P1");return e.hint=["DB"],t.push(e),t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=p.lvlHandActTarg(this.code,S.enTil("P2",r.id));s.deckPositionSkip=v.playPosition();const h=w.toActions(s);h.length===0?(this.logSpell(r),r.buff(-this.boof579,0),v.spellCast()):(h.push(v.cancelAction()),v.ddf5(h))}else{const r=f.jr5(e[1]);this.logSpell(r),r.buff(-this.boof579,0);const s=t;v.shiftPlayCard(s.position),M.levelAndDiscardA(s),v.spellCast()}}}class vi extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Mimicleaf",this.iAttack=this.lValN([2,5,11]),this.iHealth=this.iAttack,this.tribe.push("PL"),this.text=`Activate: Put a level ${this.level} ${this.name} into an adjacent available lane.`}canActivate(t){return v.emptyAdjacents(t,"").length>0}startActivation(t){const e=v.emptyAdjacents(t,"");e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);f.birth(e.code,"P",t.playerA,t.lane),e.endActivation()}}class Ti extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Mimicwurm",this.iAttack=7,this.iHealth=this.iAttack,this.tribe.push("WR"),this.text=this.lValS(["","Forge: You may put a level 1 Mimicwurm into another lane.","Forge: You may put a level 2 Mimicwurm into another lane. Then you may put a level 1 Mimicwurm into another lane."])}jr3(t,e){const r=super.jr3(t,e);if(this.level>1){const s=r.jr4("FR",this.code);s.interactive=!0}return r}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")if(this.level===3){this.wurmsign(2,t);const r=[t.lane,parseInt(e[1])],s=this.fieldActions("P2",r);v.ddf5(s)}else this.wurmsign(1,t),v.actionDone(!0);else this.wurmsign(1,t),v.actionDone(!0)}jr8(t){const e=W.toCreature(t.event);v.ddf5(this.fieldActions("P1",[e.creature.lane]))}fieldActions(t,e){const r=p.actionTarget("TF","CARD",this.code,S.enTil(t,e[0]));r.player="F",r.hint=["FL"],r.lanes=f.laneIdx.filter(h=>!e.includes(h));const s=w.toActions(r);return s.push(v.noneEndTrigger()),s}wurmsign(t,e){f.birth(this.wurmCode(t),"R",e.playerA,e.lane)}wurmCode(t){return`${"MMW"}${t}`}}class ie extends yt{lookup(t){return{["BRN"]:{c:()=>this.boutC(),z:(r,s)=>this.burner(r,s,8)},["IFL"]:{c:()=>this.izfmC(),z:(r,s)=>this.burner(r,s,this.boof6915)},["LSK"]:{c:()=>this.lspkC(),z:(r,s)=>this.burner(r,s,this.boof6812)},["LYR"]:{c:()=>this.rainC(),z:(r,s)=>this.rainZ(r,s)},["SOK"]:{c:()=>this.sealkC(),z:(r,s)=>this.burner(r,s,this.sealzap)},["STB"]:{c:()=>this.shatC(),z:(r,s)=>this.shatZ(r,s)},["SHK"]:{c:()=>this.shkC(),z:(r,s)=>this.shkZ(r,s)}}[t]}cardCast(t,e,r){this.lookup(t).z(e,r)}hurts=!0;burner(t,e,r){e?t.hurtDirect(r,this.code):k.hurtDirect(t,r,this.code)}burnText(t){return`Deal ${t} damage to a creature or player.`}constructor(t){super(t),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets(),e=this.hurts?["HR"]:["BF"],r=p.crActTarg("CARD",this.code,"");r.hint=e;const s=p.actionTarget("TP","CARD",this.code,"");return s.hint=e,t.push(r,s),t}handleAction(t){let e,r;t.zone==="P"?(this.logSpell(),e=!1,r=t.playerA):(r=f.ddf6(t),this.logSpell(this.hurts?void 0:r),e=!0),this.cardCast(this.cardCode(),r,e),v.spellCast()}boutC(){this.faction="T",this.rarity="R",this.name="Burnout",this.overload=!0,this.maxLevel=1,this.text=this.burnText(8)}izfmC(){this.faction="T",this.rarity="T",this.name="Iztek's Flame";const t=this.boof6915;this.addSp("D",t),this.text=this.burnText(t)}lspkC(){this.faction="T",this.rarity="C",this.name="Lightning Spark";const t=this.boof6812;this.addSp("D",t),this.text=this.burnText(t)}rainC(){this.faction="U",this.rarity="C",this.name="Lysian Rain",this.hurts=!1;const t=this.boof7911;this.addSp("H",t),this.text=`Give a creature or player +${t} health.`}rainZ(t,e){const r=this.boof7911;e?t.buff(0,r):k.heal(t,r)}sealkC(){this.faction="T",this.rarity="C",this.name="Seal of Kadras",this.level<3&&(this.hints=["LV"]),this.consistent=this.level>1;const t=this.sealzap;this.addSp("D",t),this.consistent&&this.addSp("C",0),this.text=this.burnText(t)}get sealzap(){return this.lValN([1,2,25])}shatC(){this.faction="T",this.rarity="C",this.name="Shatterbolt";const t=this.boof5914;this.addSp("D",t),this.text=`Negate Armor from a creature or player this turn, then deal ${t} damage to that creature or player.`}shatZ(t,e){const r=this.boof5914,s=p.mod("NA",!0,this.code);if(s.expiry="ET",e){const h=t;h.addMod(s),h.hurtDirect(r,this.code)}else{const h=k.toPlayer(t);k.addMod(h,s),k.hurtDirect(h,r,this.code)}}shkC(){this.faction="T",this.rarity="H",this.name="Static Shock";const t=this.boof124;this.addSp("D",t),this.text=`${this.burnText(t)} You may play an additional ${m.levelGateText(this.level,!0)}spell this turn.`}shkZ(t,e){this.burner(t,e,this.boof124);const r=M.freeCard(this.code);r.condition.level=w.ddf2(this.level),r.condition.card="S"}}class Si extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Nefrax, the Soulweaver",this.iAttack=this.boof4712,this.iHealth=this.lValN([10,15,25]),this.tribe.push("HM");const e=I.getCard(this.spc());this.text=`Activate: Put a ${m.tokName(e)} into an available lane.~Forge: Destroy a friendly creature.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}canActivate(t){return this.empties(t).length>0}startActivation(t){const e=this.empties(t);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){this.logAct(!0);const r=f.jr5(e[1]);f.birth(this.spc(),"P",t.playerA,t.lane),r.endActivation()}else{const r=f.ddf6(t);O.destroy(r,this.code),v.actionDone(!0)}}jr8(t){const e=p.crFriendActTarg("CARD",this.code,""),r=w.toActions(e);v.ddf5(r)}spc(){return "SPN"+this.level}empties(t){const e=p.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P1",t.id));return w.toActions(e)}}class Ci extends P{constructor(t){super(t),this.faction="N",this.rarity="T",this.name="Netherdrake",this.iAttack=this.boof4815,this.iHealth=this.iAttack,this.iMobile=this.lValN([0,0,1]),this.tribe.push("DG"),this.text=`When this enters play or moves into a lane, destroy the opposing ${m.levelGateText(this.level,!0)}creature.`}image(t){return this.rawImage(`${"NSH"}${this.level}`,t)}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FK",this.code),r.jr4("EF",this.code),r}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){const r=W.toCreature(t.event).creature.opposed;r&&w.levelTestCommon(r.level,this.level)&&O.destroy(r,this.code),x.triggerDone()}}class wi extends me{enforceEffect(t,e){e.lane===3?e.removeModSafe(e.id):e.addModSafe(p.mod("AR",this.boof236,e.id)),super.enforceEffect(t,e)}}class xi extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Nova, Grove Queen",this.iAttack=this.lValN([3,5,10,14]),this.iHealth=this.lValN([7,10,15,19]),this.tribe.push("FB"),this.maxLevel=4;const e=this.nbuf,r=this.lValS(["an adjacent","each adjacent","each","each"]);this.text=`Forge: Put a 1/1 Seedling into ${r} available space.~When a friendly creature is replaced, Nova gets ${m.jr9(e,e)}.`,this.bonus={play:2}}get nbuf(){return this.lValN([1,3,5,10])}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return this.level===1&&(s.interactive=!0),r.jr4("RP",this.code),r}ddf8(t){if(t.event.code==="RPL"){const e=W.toReplaced(t.event);return t.creatId!==e.replCreatId&&t.owner===e.replCreat.owner}return!1}jr8(t){const e=f.jr5(t.creatId);if(t.event.code==="RPL"){const r=this.nbuf;e.buff(r,r),x.triggerDone()}else{const r="NSD"+this.level,s=f.emptyLanes(t.owner);if(this.level>1){const h=this.level===2?e.adjacent.filter(g=>s.includes(g)):s,u=N.tick();h.forEach(g=>{f.birth(r,"P",e.owner,g,u)}),x.triggerDone()}else{const h=e.adjacent.filter(u=>s.includes(u));if(h.length===0)x.triggerDone();else if(h.length===1)f.birth(r,"P",e.owner,h[0]),x.triggerDone();else{const u=v.emptyAdjacents(e,"");v.ddf5(u)}}}}handleAction(t){f.birth("NSD"+this.level,"P",t.playerA,t.lane),v.actionDone(!0)}}class Di extends yt{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const e=this.boof246,r=e*-1;this.text=`Give a friendly Zombie ${m.jr9(e,e,!0)}, and Regenerate ${e}.~Then give an enemy non-Zombie ${m.jr9(r,r)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");e.tribe="ZB",t.push(e)}return t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.ddf6(t),s=f.jr5(e[1]);this.logSpell(s,r);const h=this.boof246;s.buff(h,h),s.addRegen(h),r.buff(-h,-h),v.spellCast()}}nonZombies(t=""){const e=p.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return w.toActions(e).filter(r=>{const s=r;return!f.ddf6(s).isTribe("ZB")})}getCardActions(t,e){if(t.key==="CARD"){const r=f.ddf6(t),s=v.cancelAction(),h=this.nonZombies(r.id);return h.push(s),h}return super.getCardActions(t,e)}}class Fi extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Onyxium Allomancer",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("HM");const e=this.boof358;this.text=`Activate: Discard and level up a card.~Allied Nekrium: Regenerate ${e}.`,this.bonus={exist:this.ddp9(0,e,0,0,.5)}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>I.getCard(r).canLevel())}startActivation(t){const e=p.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);M.levelAndDiscardA(t),e.endActivation()}jr8(t){M.allied("N")&&f.jr5(t.creatId).addRegen(this.boof358),x.triggerDone()}}class Hi extends P{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Onyxium Phantasm",this.iAttack=this.boof246,this.iHealth=this.lValN([9,12,19]),this.iRegen=this.boof124,this.tribe.push("ST");const e=this.boof4812n;this.addSp("A",e),this.text=`Allied Alloyin: Activate: Give a creature ${m.jr9(e,0)}`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}canActivate(t){return t.hasMod(t.id)}startActivation(t){const e=p.crActTarg("CARD",this.code,t.id);e.hint=["DF","DB"];const r=w.toActions(e);r.push(v.cancelAction()),v.ddf5(r)}handleAction(t){const e=f.jr5(t.param),r=f.ddf6(t);this.logAct(!0,r),r.buff(this.boof4812n,0),e.endActivation()}jr8(t){if(M.allied("A")){const e=f.jr5(t.creatId);e.addMod(p.mod("AL",!0,e.id)),e.changed=!0}x.triggerDone()}}class Bi extends yt{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Oratek Battlebrand";const e=this.boof71013;this.addSp("D",e),this.text=`Deal ${e} damage to a creature.~Allied Alloyin: You may discard a card and level it.`}playTargets(){const t=super.playTargets(),e=p.crActTarg("CARD",this.code,"");return e.hint=["HR"],t.push(e),t}handleAction(t){if(t.zone==="F"){const e=t,r=f.ddf6(e);if(this.logSpell(),r.hurtDirect(this.boof71013,this.code),M.allied("A")){const s=this.levelActs();s.length===1?v.spellCast():v.ddf5(s)}else v.spellCast()}else if(t.zone==="H"){const e=t;v.shiftPlayCard(e.position),M.levelAndDiscardA(e),v.spellCast()}else t.zone==="B"&&t.param==="NOTR"?v.spellCast():super.handleAction(t)}levelActs(){const t=p.actionTarget("TB","CARD",this.code,"NOTR"),e=p.lvlHandActTarg(this.code,"");return e.deckPositionSkip=v.playPosition(),w.toActions([e,t])}}class Pi extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Oratek Warhammer",this.iAttack=this.boof3713,this.iHealth=this.lValN([8,12,19]),this.iMobile=this.level,this.tribe.push("FR","AS"),this.text=`Allied Alloyin: When ${this.name} ${m.dbdtap()} on your turn, you may discard and level up a card.`,this.bonus={exist:.5}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}handleAction(t){M.levelAndDiscardA(t),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}return!1}jr8(t){if(t.trigger.type==="FR"){if(M.allied("A")){const e=f.jr5(t.creatId),r=e.jr4("DM",this.code);r.interactive=!0,e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=w.toActions(p.lvlHandActTarg(this.code,""));e.length>0?(e.push(v.noneEndTrigger()),v.ddf5(e)):x.triggerDone()}}}class Ve extends P{hitCreature;constructor(t,e){super(t),this.hitCreature=e}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatTarg===this.hitCreature&&e.isCreatSrc&&e.srcId===t.creatId}return!1}}class Ni extends Ve{constructor(t){super(t,!1),this.faction="U",this.rarity="L",this.name="Oros, Deepwood's Chosen",this.iAttack=this.lValN([7,11,16,0]),this.iHealth=this.iAttack,this.iBT=!0,this.maxLevel=4,this.tribe.push("FB"),this.hints=["OL"];const e=`When Oros ${m.dbdtap()}, you gain that much health.`,r=this.level===4?"Oros gets +attack and +health equal to your health.~":"";this.text=r+e}jr3(t,e){const r=super.jr3(t,e);return this.level===4&&r.addEffect("PH",this.code),r}jr8(t){const e=t.event;k.heal(t.owner,e.dmg),x.triggerDone()}enforceEffect(t,e){const r=k.toPlayer(e.owner).health;e.status==="A"&&(e.removeModSafe(e.id),e.addModSafe(p.mod("HL",r,e.id)),e.addModSafe(p.mod("MH",r,e.id)),e.addModSafe(p.mod("AT",r,e.id)))}}class Mi extends P{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Oxidon Spitter",this.iAttack=this.boof7914,this.iHealth=this.boof3510,this.tribe.push("DN"),this.l3=this.level===3,this.text=`Forge: Negate Armor from ${this.l3?"each":"an"} enemy creature.`}l3;jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!this.l3,r}jr8(t){if(this.l3)f.creatByTarget(p.crEnemyTarg()).forEach(e=>{e.negateArmor=!0}),x.triggerDone();else{const e=p.crEnemyActTarg("CARD",this.code,""),r=w.toActions(e);r.length>0?v.ddf5(r):x.triggerDone()}}handleAction(t){const e=f.ddf6(t);this.logAct(!1,e),e.negateArmor=!0,v.actionDone(!0)}}class se extends P{lookup(t){return{["AFS"]:{c:()=>this.afsC(),a:r=>this.afsA(r),t:r=>this.afsT(r)},["DMW"]:{c:()=>this.drixC(),a:r=>this.drixA(r),t:r=>this.drixT(r)},["FGG"]:{c:()=>this.fggC(),a:r=>this.fggA(r),t:r=>this.fggT(r)},["GHS"]:{c:()=>this.mvpC(),a:r=>this.mvpA(r),t:r=>this.mvpT(r)},["OWW"]:{c:()=>this.owwC(),a:r=>this.owwA(r),t:r=>this.owwT(r)},["UPM"]:{c:()=>this.upakC(),a:r=>this.upakA(r),t:r=>this.upakT(r)},["WFM"]:{c:()=>this.wfmC(),a:r=>this.wfmA(r),t:r=>this.wfmT(r)}}[t]}runAct(t,e){this.lookup(t).a(e)}testAct(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}preFight=!1;prePlay=!1;canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){const e=w.boardTarget("CARD",this.code);e.param=t.id,this.preFight&&(e.hint=["BB"]),this.prePlay&&(e.hint=["DF"]),v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);this.runAct(this.cardCode(),e),e.endActivation()}afsC(){this.faction="A",this.rarity="L",this.name="Arcflight Squadron",this.iAttack=this.boof4710,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.hints=["OL"],this.prePlay=!0,this.text=`Activate: You may play an additional ${m.levelGateText(this.level,!0)}Robot this turn.`}afsT(t){return!0}afsA(t){const e=M.freeCard(this.code);e.condition.tribe="RB",e.condition.level=w.ddf2(this.level)}drixC(){this.faction="A",this.rarity="L",this.name="Drix, the Mindwelder",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,12,21]),this.tribe.push("MM"),this.preFight=!0,this.addSp("A",this.level),this.text=`Activate, discard your hand: Each friendly Metamind gets ${m.jr9(this.level,0)} for each card discarded this way.`}drixT(t){return k.getActive().hand.length>0}drixA(t){const e=k.toPlayer(t.owner),r=e.hand.length*this.level;e.discard.push(...e.hand),e.hand=[];const s=p.crFriendTarg();s.tribe="MM",f.creatByTarget(s).forEach(h=>{h.buff(r,0)})}fggC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Gamma",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("RB","GD"),this.preFight=!0;const t=I.getCard(U.fgoc(this.level));this.addSp("N",t.iAttack),this.text=`Activate, destroy five friendly Robot Guardians: Put a ${m.tokName(t)} into this lane.`}fggT(t){return f.creatByTarget(this.fggTarg()).length===5}fggA(t){const e=t.lane,r=t.owner,s=N.tick();f.creatByTarget(this.fggTarg()).forEach(h=>O.destroy(h,this.code,s)),f.birth(U.fgoc(this.level),"P",r,e)}fggTarg(){const t=p.crFriendTarg();return t.tribe="GD",t}mvpC(){this.faction="U",this.rarity="C",this.name="Gemheart Sprout",this.iAttack=this.boof357,this.iHealth=this.iAttack+this.level,this.iDefend=!0,this.tribe.push("PL"),this.preFight=!0,this.addSp("L",this.level),this.text=`Activate: You gain health equal to ${this.level}x the number of friendly creatures.`}mvpT(t){return!0}mvpA(t){const e=f.ddf1().length;k.heal(t.owner,e*this.level)}owwC(){this.faction="A",this.rarity="L",this.name="Oreian Warwalker",this.iAttack=this.boof359,this.iHealth=this.boof61018,this.tribe.push("RB"),this.preFight=!0;const t=this.owwbuff+1;this.addSp("A",t),this.text=`Activate: ${this.name} gets ${t}x attack.`}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}upakC(){this.faction="U",this.rarity="L",this.name="Uterra Packmaster",this.iAttack=this.boof6914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.preFight=!0;const t=this.boof124;this.addSp("U",t),this.text=`Activate: each other friendly Uterra creature gets ${m.jr9(t,t)}.`}upakT(t){return f.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const e=this.boof124;f.creatByTarget(this.upakTarg(t.id)).forEach(r=>{r.buff(e,e)})}upakTarg(t){const e=p.crFriendNotMeTarg(t);return e.faction="U",e}wfmC(){this.faction="T",this.rarity="H",this.name="Wildfire Maiden",this.iAttack=this.boof4610,this.iHealth=this.boof5814,this.tribe.push("FR","AS"),this.text=`Activate, destroy ${this.name}: Deal damage equal to its attack to each enemy creature.`}wfmT(t){return!0}wfmA(t){const e=N.tick();f.creatByTarget(p.crEnemyTarg()).forEach(r=>{r.hurtDirect(t.attack,this.code,e)}),O.destroy(t,this.code)}}class nr extends P{lookup(t){return{["MDE"]:{c:()=>this.misdC(),f:r=>this.misdF(r)},["TAB"]:{c:()=>this.thraC(),f:r=>this.thraF(r)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const r=super.jr3(t,e);return r.jr4("AS",this.code),r}jr8(t){this.cardForge(this.cardCode(),t),x.triggerDone()}misdC(){this.faction="N",this.rarity="C",this.name="Misery Demon",this.iAttack=this.boof5915,this.iHealth=this.boof2510,this.tribe.push("DM"),this.hints=["OL"];const t=this.level+3;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health.`}misdF(t){const e=this.level+3;k.hurtDirect(!t.owner,e,this.code),k.heal(t.owner,e)}thraC(){this.faction="T",this.rarity="C",this.name="Thranik Ambusher",this.iAttack=this.boof5813,this.iHealth=this.iAttack,this.tribe.push("DK"),this.hints=["OL"];const t=this.boof234;this.ftext=`${this.name} gets ${m.jr9(t,t)}.`}thraF(t){const e=this.boof234;f.jr5(t.creatId).buff(e,e)}}class bt extends P{lookup(t){return{["ATT"]:{c:()=>this.atorC(),t:(r,s)=>this.atorT(r,s),b:(r,s)=>this.atorB(r,s)},["BRH"]:{c:()=>this.brhrC(),t:(r,s)=>this.brhrT(r,s),b:(r,s)=>this.brhrB(r,s)},["FGD"]:{c:()=>this.fgdC(),t:(r,s)=>this.fgdT(r,s),b:(r,s)=>this.fgdB(r,s)},["FSP"]:{c:()=>this.fspC(),t:(r,s)=>this.fspT(r,s),b:(r,s)=>this.fspB(r,s)},["HMF"]:{c:()=>this.hamfC(),t:(r,s)=>this.hamfT(r,s),b:(r,s)=>this.hamfB(r,s)},["HOD"]:{c:()=>this.haroldC(),t:(r,s)=>this.ocarT(r,s),b:(r,s)=>this.haroldB(r,s)},["OJC"]:{c:()=>this.ocarC(),t:(r,s)=>this.ocarT(r,s),b:(r,s)=>this.ocarB(r,s)},["RLW"]:{c:()=>this.restwandC(),t:(r,s)=>this.restwandT(r,s),b:(r,s)=>this.restwandB(r,s)},["RHW"]:{c:()=>this.ruthwandC(),t:(r,s)=>this.restwandT(r,s),b:(r,s)=>this.ruthwandB(r,s)},["SDR"]:{c:()=>this.spdryC(),t:(r,s)=>this.spdryT(r,s),b:(r,s)=>this.spdryB(r,s)},["TDW"]:{c:()=>this.tdwC(),t:(r,s)=>this.tdwT(r,s),b:(r,s)=>this.tdwB(r,s)},["TNL"]:{c:()=>this.tnlC(),t:(r,s)=>this.tnlT(r,s),b:(r,s)=>this.tnlB(r,s)},["UTR"]:{c:()=>this.urexC(),t:(r,s)=>this.urexT(r,s),b:(r,s)=>this.urexB(r,s)}}[t]}testBirth(t,e){return this.lookup(t).t(e,W.toEnterField(e.event))}actBirth(t,e){this.lookup(t).b(e,W.toEnterField(e.event))}iTrigger=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return this.iTrigger&&r.jr4("EF",this.code),r}ddf8(t){return t.event.code==="ENT"?this.testBirth(this.cardCode(),t):!1}jr8(t){this.actBirth(this.cardCode(),t),x.triggerDone()}atorC(){this.faction="T",this.rarity="L",this.name="Ator, Thunder Titan",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("GT"),this.text=`Each another friendly ${m.levelGateText(this.level,!0)}creature gets Assault: Aggressive.`}atorT(t,e){const r=e.creature;return e.forged&&t.trigger.creatId!==r.id&&r.owner===t.owner&&w.levelTargetTest(w.ddf2(this.level),r.level)&&!r.opposed}atorB(t,e){e.creature.aggressive=!0}brhrC(){this.faction="N",this.rarity="R",this.name="Brood Horror",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("AB"),this.text=`When another friendly creature enters play, it gets ${m.jr9(this.level,this.level)}. Then ${this.name} gets ${m.jr9(-this.level,-this.level)}.`}brhrT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}brhrB(t,e){bt.itBirthedFirst(e.creature.id,t.creatId)&&(this.logAct(!1,e.creature),e.creature.buff(this.level,this.level),f.jr5(t.creatId).buff(-this.level,-this.level))}fgdC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Delta",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("RB","GD");const t=I.getCard(U.fgoc(this.level));this.text=`When ${this.name} enters play, if there is a friendly Alpha Beta, and Gamma, put a ${m.tokName(t)} in your discard pile.`}fgdT(t,e){return e.creature.id===t.creatId}fgdB(t,e){const r=p.crTarg();r.player=k.toTarget(t.owner);const s=f.creatByTarget(r).map(h=>h.code.slice(0,3));s.includes("FGA")&&s.includes("FGB")&&s.includes("FGG")&&k.toPlayer(t.owner).discard.push(U.fgoc(this.level))}fspC(){if(this.faction="A",this.rarity="L",this.name="Flowsteel Prototype",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.lValN([8,15,20]),this.tribe.push("SS"),this.iTrigger=this.level>1,this.iTrigger){const t=m.levelGateText(this.level-1);this.text=`When you Forge a ${t} creature, ${this.name} gets +attack equal to that creature's attack.`}}fspT(t,e){return!!(e.forged&&e.creature.owner===t.owner&&I.getCard(e.creature.code).level0&&f.jr5(t.creatId).move(r[S.randInt(0,s)])}haroldC(){this.faction="T",this.rarity="R",this.name="Herald of Destruction",this.iAttack=this.boof369,this.iHealth=this.lValN([9,12,18]),this.tribe.push("FR","AS"),this.text=`When an enemy creature enters play, if it wasn't Forged, deal damage equal to ${this.name}'s attack to the enemy player.`}haroldB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const r=f.jr5(t.creatId);k.hurtDirect(!r.owner,r.attack,this.code)}}ocarC(){this.faction="A",this.rarity="H",this.name="Oreian Justicar",this.iAttack=this.boof5814,this.iHealth=this.boof81220,this.tribe.push("HM");const t=this.ocarbuff;this.text=`When an enemy creature enters play, if it wasn't Forged, it gets ${m.jr9(t,0)}.`,this.bonus={exist:this.ddp9(0,t,t,0)*-.5}}ocarT(t,e){return e.creature.owner!==t.owner&&!e.forged}ocarB(t,e){bt.itBirthedFirst(e.creature.id,t.creatId)&&e.creature.buff(this.ocarbuff,0)}get ocarbuff(){return this.lValN([-5,-10,-20])}restwandC(){this.faction="U",this.rarity="H",this.name="Restless Wanderers",this.iAttack=this.boof51014,this.iHealth=this.boof3610,this.tribe.push("ST","WD");const t=this.boof369;this.text=`When another friendly Spirit Wanderer enters play, ${this.name} gets ${m.jr9(t,t)}.`}restwandT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner?e.creature.isTribe("WD"):!1}restwandB(t,e){const r=f.jr5(t.trigger.creatId),s=this.boof369;r.buff(s,s)}ruthwandC(){this.faction="N",this.rarity="C",this.name="Ruthless Wanderers",this.iAttack=this.boof3610,this.iHealth=this.boof51014,this.tribe.push("ST","WD");const t=-this.boof369;this.text=`When another friendly Spirit Wanderer enters play, the creature opposing this gets ${m.jr9(t,t)}.`}ruthwandB(t,e){const s=f.jr5(t.trigger.creatId).opposed;if(s){const h=-this.boof369;s.buff(h,h)}}spdryC(){this.faction="U",this.rarity="R",this.name="Spring Dryad",this.iAttack=this.boof469,this.iHealth=this.iAttack,this.tribe.push("DY"),this.text=`When a friendly creature enters play, ${this.name} gets ${m.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)}}spdryT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}spdryB(t,e){f.jr5(t.trigger.creatId).buff(this.level,this.level)}tdwC(){this.faction="N",this.rarity="R",this.name="Tarsus Deathweaver",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof246;this.text=`When a friendly creature enters play, if it wasn't Forged, it gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}tdwT(t,e){return e.creature.owner===t.owner&&!e.forged}tdwB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const r=this.boof246;e.creature.buff(r,r)}}tnlC(){this.faction="N",this.rarity="L",this.name="Tarsus Necrolord",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof124,e=I.getCard(U.zomc(this.level));this.text=`Forge: Spawn a $${m.tokName(e)} for each friendly creature that was destroyed this turn.~When a friendly Zombie enters play, ${this.name} gets ${m.jr9(t,t)}.`}tnlT(t,e){return e.creature.owner===t.owner?e.creature.isTribe("ZB"):!1}tnlB(t,e){const r=f.jr5(t.trigger.creatId),s=this.boof124;r.buff(s,s)}urexC(){this.faction="U",this.rarity="H",this.name="Uterradon Rex",this.iAttack=this.boof4813,this.iHealth=this.boof71118,this.tribe.push("DN");const t=this.boof124;this.text=`When another friendly Dinosaur enters play, it gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}urexT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("DN")}urexB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const r=this.boof124;e.creature.buff(r,r)}}static itBirthedFirst(t,e){if(t===e)return!0;let r=!1;const s=O.findDeathTime(e);if(S.isUn(s))r=!0;else{const h=f.findBirthTime(t);(S.isUn(h)||h<=s)&&(r=!0)}return r}}class ae extends Ve{lookup(t){return{["AGM"]:{c:()=>this.agamC(),h:(r,s,h,u)=>this.agamH(r,s,h,u)},["BWK"]:{c:()=>this.blwalkC(),h:(r,s,h,u)=>this.blwalkH(r,s,h,u)},["BRF"]:{c:()=>this.bfangC(),h:(r,s,h,u)=>this.bfangH(r,s,h,u)},["CDT"]:{c:()=>this.cadtC(),h:(r,s,h,u)=>this.cadtH(r,s,h,u)},["GSC"]:{c:()=>this.gcobC(),h:(r,s,h,u)=>this.gcobH(r,s,h,u)},["IHA"]:{c:()=>this.ibhaC(),h:(r,s,h,u)=>this.ibhaH(r,s,h,u)},["SHS"]:{c:()=>this.shimfC(),h:(r,s,h,u)=>this.shimfH(r,s,h,u)}}[t]}image(t){return this.rarity==="T"?this.fixedImage(t):this.leveledImage(t)}cardConstruct(t){this.hints=["OP"],this.lookup(t).c()}creatHit(t,e,r,s,h){this.lookup(t).h(e,r,s,h)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const e=W.toDamage(t.event);this.creatHit(this.cardCode(),t,e,e.srcCreat,e.hurtCreat),x.triggerDone()}agamC(){this.faction="T",this.rarity="L",this.name="Agamemnon",this.iAttack=this.boof4814,this.iHealth=this.lValN([8,12,18]),this.level>1&&(this.iMobile=1,this.iAggro=this.level===3),this.tribe.push("GT"),this.text=`When ${this.name} ${m.dbdtac()} on your turn, this battles again.`}agamH(t,e,r,s){t.owner===k.getActiveB()&&(r.extraBattles+=1)}blwalkC(){this.faction="N",this.rarity="R",this.name="Blight Walker",this.iAttack=this.boof137,this.iHealth=this.lValN([5,10,17]),this.tribe.push("ZB"),this.text=`When ${this.name} ${m.dbdtac(this.level)}, destroy that creature.`}blwalkH(t,e,r,s){s.status==="A"&&w.levelTestCommon(s.level,this.level)&&O.destroy(s,this.code)}bfangC(){this.faction="U",this.rarity="T",this.name="Broodfang",this.iAttack=this.level,this.iHealth=this.level,this.maxLevel=this.level,this.minLevel=this.level,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack)}bfangH(t,e,r,s){s.addPoison(this.iAttack)}poisonText(t){return`When ${this.name} ${m.dbdtac()}, give that creature gets Poison ${t}.`}cadtC(){this.faction="U",this.rarity="R",this.name="Cadaverous Thicket",this.iAttack=this.boof135,this.iHealth=this.lValN([7,12,22]),this.tribe.push("PL"),this.text=this.poisonText(this.iAttack)}cadtH(t,e,r,s){s.addPoison(this.iAttack)}gcobC(){this.faction="U",this.rarity="C",this.name="Ghostscale Cobra",this.iAttack=this.boof4610,this.iHealth=this.boof135,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack)}gcobH(t,e,r,s){s.addPoison(this.iAttack)}ibhaC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Hammer of Anvillon",this.iAttack=this.lValN([4,7,12,15]),this.iHealth=this.lValN([7,11,17,25]),this.iArmor=this.lValN([1,3,5,20]),this.tribe.push("FB"),this.maxLevel=4;const t=this.level===4?"'s attack gets reduced to 0":` gets ${m.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${m.dbdtac()}, that creature${t}, and moves to an available enemy lane at random.`}ibhaH(t,e,r,s){if(s.status==="A"){const h=this.level===4?s.attack*-1:this.boof246n;s.buff(h,0);const u=f.emptyLanes(s.owner),g=u.length;g>0&&(this.logAct(!1,s),s.move(u[S.randInt(0,g)]))}}shimfC(){this.faction="U",this.rarity="R",this.name="Shimmerfang Serpent",this.iAttack=this.boof357,this.iHealth=this.boof61016,this.tribe.push("SN"),this.text=`When ${this.name} ${m.dbdtac()}, that creatures gets that much Poison.`}shimfH(t,e,r,s){s.addPoison(e.dmg)}}class Gt extends Ve{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(r,s,h)=>this.ashyH(r,s,h)},["AMY"]:{c:()=>this.ashmC(),h:(r,s,h)=>this.ashyH(r,s,h)},["CFB"]:{c:()=>this.cfbC(),h:(r,s,h)=>this.cfbH(r,s,h)},["EPS"]:{c:()=>this.epsdC(),h:(r,s,h)=>this.epsdH(r,s,h)},["EFM"]:{c:()=>this.efmC(),h:(r,s,h)=>this.efmH(r,s,h)},["FBC"]:{c:()=>this.fbcC(),h:(r,s,h)=>this.fbcH(r,s,h)},["RTS"]:{c:()=>this.rzstC(),h:(r,s,h)=>this.rzstH(r,s,h)},["RSE"]:{c:()=>this.rselC(),h:(r,s,h)=>this.rselH(r,s,h)},["SVH"]:{c:()=>this.strhyC(),h:(r,s,h)=>this.strhyH(r,s,h)},["URB"]:{c:()=>this.uridC(),h:(r,s,h)=>this.uridH(r,s,h)},["VES"]:{c:()=>this.veskC(),h:(r,s,h)=>this.veskH(r,s,h)}}[t]}cardConstruct(t){this.hints=["OL"],this.lookup(t).c()}creatHit(t,e,r,s){this.lookup(t).h(e,r,s)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}jr8(t){const e=W.toDamage(t.event);e.srcCreat&&(this.bothTurns||e.srcCreat.owner===k.getActiveB())&&this.creatHit(this.cardCode(),t,e,e.srcCreat),x.triggerDone()}ashyC(){this.faction="T",this.rarity="C",this.tribe.push("FR","AS");const t=this.boof124;this.text=`When ${this.name} ${m.dbdtap()}, it gets ${m.jr9(t,t)}.`}ashyH(t,e,r){const s=this.boof124;r.buff(s,s)}ashbC(){this.name="Ashurian Brawler",this.iAttack=this.boof7911,this.iHealth=this.iAttack,this.ashyC()}ashmC(){this.name="Ashurian Mystic",this.iAttack=this.boof3610,this.iHealth=this.boof5812,this.iAggro=!0,this.ashyC()}cfbC(){this.faction="T",this.rarity="H",this.name="Cinderfist Brawler",this.iAttack=this.boof71014,this.iHealth=this.boof357,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${m.dbdtap()}, deal that much damage to that player again.`}cfbH(t,e,r){k.hurtDirect(!r.owner,e.dmg,r.code)}epsdC(){this.faction="A",this.rarity="T",this.name="Epoch Soldier",this.minLevel=this.level,this.maxLevel=this.level,this.iAttack=this.boof4710,this.iHealth=this.iAttack,this.tribe.push("HM"),this.bothTurns=!1,this.text=`When ${this.name} ${m.dbdtap()} on your turn, draw a card at the end of the turn.`}epsdH(t,e,r){const s=p.trigger("TE","EPH"+this.level);s.changes=!0,k.toPlayer(t.owner).triggers.push(s)}efmC(){this.faction="T",this.rarity="L",this.name="Everflame Mystic",this.iAttack=this.boof5813,this.iHealth=this.iAttack+1,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${m.dbdtap()} on your turn, you may play ${this.lValS(["one","two","three"])} spells this turn.`}efmH(t,e,r){if(k.getActiveB()===r.owner)for(let s=0;sh.hurtDirect(e.dmg,this.code,s))}rzstC(){this.faction="T",this.rarity="C",this.name="Razortooth Stalker",this.iAttack=this.boof4812,this.iHealth=this.iAttack+1,this.iMobile=1,this.tribe.push("DN");const t=this.boof235;this.text=`When ${this.name} ${m.dbdtap()}, it gets ${m.jr9(t,t)}.`}rzstH(t,e,r){const s=this.boof235;r.buff(s,s)}rselC(){this.faction="T",this.rarity="H",this.name="Rumblestone Elemental",this.iAttack=this.boof246,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("ER","EL"),this.text=`When ${this.name} ${m.dbdtap()}, deal that much damage to itself as well.~Assault: Spawn a copy of ${this.name}. Then repeat this for each copy.`}rselH(t,e,r){r.hurtDirect(e.dmg,this.code)}strhyC(){this.faction="U",this.rarity="C",this.name="Stranglevine Hydra",this.iAttack=this.boof5815,this.iHealth=this.iAttack+1,this.tribe.push("HY"),this.text=`When ${this.name} ${m.dbdtap()}, it gets Regenerate ${this.level}.`}strhyH(t,e,r){r.addRegen(this.level)}uridC(){this.faction="U",this.rarity="L",this.name="Uterradon Ridgeback",this.iAttack=this.boof71117,this.iHealth=this.boof4713,this.iBT=!0,this.tribe.push("DN"),this.bothTurns=!1;const t=this.boof124;this.text=`When ${this.name} ${m.dbdtap()} on your turn, each friendly creature gets ${m.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}uridH(t,e,r){const s=this.boof124,h=this.level===3;f.ddf1().forEach(u=>{u.buff(s,s),h&&(u.breakthrough=!0)})}veskC(){this.faction="N",this.rarity="L",this.name="Vyric Ebonskull",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("VP"),this.text=`When Vyric ${m.dbdtap()}, destroy an enemy ${m.levelGateText(this.level,!0)} creature at random.${this.level===3?" Then Spawn a copy of that creature.":""}`}veskH(t,e,r){const s=p.crTarg();s.player=k.toTarget(e.hurtPlayer),s.level=w.ddf2(this.level);const h=f.creatByTarget(s);if(h.length>0){const u=N.tick(),g=h[S.randInt(0,h.length)];O.destroy(g,this.code,u),this.level===3&&f.birth(g.code,"S",r.owner,void 0,u)}}}class ye extends P{lookup(t){return{["CHR"]:{c:()=>this.crgC(),d:(r,s,h)=>this.crgD(r,s,h)},["DZD"]:{c:()=>this.dozC(),d:(r,s,h)=>this.dozD(r,s,h)},["IMD"]:{c:()=>this.eddieC(),d:(r,s,h)=>this.eddieD(r,s,h)},["NCM"]:{c:()=>this.ncmbC(),d:(r,s,h)=>this.ncmbD(r,s,h)},["TDS"]:{c:()=>this.tsrC(),d:(r,s,h)=>this.tsrD(r,s,h)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}cares=!0;cardDamaged(t,e){const r=W.toDamage(e.event);this.lookup(t).d(e,r.hurtCreat,r)}image(t){return this.cardCode()==="DZD"?this.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e);return this.cares&&r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.isCreatTarg&&e.target===t.creatId}return!1}jr8(t){this.cardDamaged(this.cardCode(),t),x.triggerDone()}crgC(){this.faction="U",this.rarity="L",this.name="Chrogias",this.iAttack=this.lValN([1,0,40]),this.iHealth=this.lValN([1,15,40]),this.tribe.push("PL"),this.level===1?(this.hints=["LV","RT"],this.bonus={play:1},this.cares=!1):this.level===2?(this.iRegen=2,this.iDefend=!0,this.bonus={play:1}):this.level===3&&(this.iBT=!0,this.iRegen=5),this.level>1&&(this.hints=["MC"],this.text="When Chrogias is dealt damage, you gain that much health.")}crgD(t,e,r){k.heal(t.owner,r.dmg)}dozC(){this.faction="U",this.rarity="L",this.name="Dozer, the Dormant",this.iAttack=0,this.iHealth=this.level*3+6,this.tribe.push("BR"),this.iDefend=!0,this.hints=["MC"];const t=I.getCard(this.dz());this.text=`When ${this.name} is dealt damage and survives, replace it with a ${m.tokName(t)}.`}dozD(t,e,r){if(e.health>0&&e.status==="A"){const s=f.birth(this.dz(),"R",e.owner,e.lane);s&&s.setHealth(e.health)}}dz(){return "DZA"+this.level}eddieC(){this.faction="A",this.rarity="L",this.name="Iron Maiden",this.iAttack=this.lValN([1,3,30]),this.iHealth=this.iAttack,this.tribe.push("RB"),this.consistent=this.level>1,this.level===3?(this.iBT=!0,this.hints=["MC"],this.text="When Iron Maiden is dealt damage, deal that much damage to the enemy player."):(this.cares=!1,this.hints=["LV","RT"],this.bonus={play:1})}eddieD(t,e,r){k.hurtDirect(!t.owner,r.dmg,this.code)}ncmbC(){this.faction="N",this.rarity="H",this.name="Necromoeba",this.iAttack=this.boof4710,this.iHealth=this.boof71117,this.tribe.push("OZ"),this.iRegen=3,this.hints=["MC"];const t=I.getCard(U.purpOzC(this.level));this.text=`When ${this.name} is dealt damage, Spawn a ${m.tokName(t)}.`}ncmbD(t,e,r){this.logAct(!1),f.birth(U.purpOzC(this.level),"S",t.owner)}tsrC(){this.faction="U",this.rarity="L",this.name="Thundersaur",this.iAttack=0,this.iHealth=this.level*12,this.tribe.push("DN"),this.iBT=!0,this.hints=["MC"],this.text=`When ${this.name} is dealt damage, it gets +1 attack for each damage dealt.`}tsrD(t,e,r){e.buff(r.dmg,0)}}class V extends P{lookup(t){return{["AGK"]:{c:()=>this.agknitC(),f:r=>this.agknitF(r)},["AMS"]:{c:()=>this.squadC(),f:r=>this.squadF(r)},["AFR"]:{c:()=>this.afsC(),f:r=>this.afsF(r)},["BZS"]:{c:()=>this.bzshC(),f:r=>this.bzshF(r)},["BTR"]:{c:()=>this.bwtC(),f:r=>this.bwtF(r)},["BSS"]:{c:()=>this.bssC(),f:r=>this.bssF(r)},["BZD"]:{c:()=>this.bzdrC(),f:r=>this.bzdrF(r)},["BFM"]:{c:()=>this.bfmC(),f:r=>this.bfmF(r)},["CTI"]:{c:()=>this.charnC(),f:r=>this.charnF(r)},["CHH"]:{c:()=>this.chihC(),f:r=>this.chihF(r)},["CSW"]:{c:()=>this.chickenC(),f:r=>this.chickenF(r)},["DFR"]:{c:()=>this.dfrC(),f:r=>this.dfrF(r)},["DBA"]:{c:()=>this.dbaC(),f:r=>this.dbaF(r)},["DBN"]:{c:()=>this.drbC(),f:r=>this.drbF(r)},["DDD"]:{c:()=>this.dddC(),f:r=>this.dddF(r)},["EWT"]:{c:()=>this.espwrC(),f:r=>this.espwrF(r)},["FWT"]:{c:()=>this.fwtC(),f:r=>this.fwtF(r)},["GSW"]:{c:()=>this.gwurmC(),f:r=>this.gwurmF(r)},["GSS"]:{c:()=>this.gsC(),f:r=>this.gsF(r)},["IMA"]:{c:()=>this.iracoC(),f:r=>this.iracoF(r)},["LGT"]:{c:()=>this.legtitC(),f:r=>this.legtitF(r)},["LBD"]:{c:()=>this.lbdC(),f:r=>this.lbdF(r)},["LMV"]:{c:()=>this.lyrC(),f:r=>this.lyrF(r)},["MOE"]:{c:()=>this.moeC(),f:r=>this.moeF(r)},["MMA"]:{c:()=>this.mmaC(),f:r=>this.mmaF(r)},["MMR"]:{c:()=>this.mmrC(),f:r=>this.mmrF(r)},["NSY"]:{c:()=>this.nysymC(),f:r=>this.nysymF(r)},["OXM"]:{c:()=>this.onxmarC(),f:r=>this.onxmarF(r)},["OFM"]:{c:()=>this.ofmC(),f:r=>this.ofmF(r)},["OPK"]:{c:()=>this.orpC(),f:r=>this.orpF(r)},["PHM"]:{c:()=>this.phmC(),f:r=>this.phmF(r)},["PSM"]:{c:()=>this.palsC(),f:r=>this.palsF(r)},["PMI"]:{c:()=>this.prinvC(),f:r=>this.prinvF(r)},["SMD"]:{c:()=>this.scorchC(),f:r=>this.scorchF(r)},["SOC"]:{c:()=>this.scythC(),f:r=>this.scythF(r)},["SDN"]:{c:()=>this.souldrC(),f:r=>this.souldrF(r)},["SGG"]:{c:()=>this.ssggC(),f:r=>this.ssggF(r)},["SBD"]:{c:()=>this.sbdC(),f:r=>this.sbdF(r)},["SSK"]:{c:()=>this.sssC(),f:r=>this.sssF(r)},["SYL"]:{c:()=>this.lotusC(),f:r=>this.lotusF(r)},["TGI"]:{c:()=>this.tgiC(),f:r=>this.tgiF(r)},["TRA"]:{c:()=>this.toraC(),f:r=>this.toraF(r)},["TRS"]:{c:()=>this.torsC(),f:r=>this.torsF(r)},["TRV"]:{c:()=>this.torvC(),f:r=>this.torvF(r)},["TRW"]:{c:()=>this.torwC(),f:r=>this.torwF(r)},["UGL"]:{c:()=>this.umglidC(),f:r=>this.umglidF(r)},["UWL"]:{c:()=>this.uwarC(),f:r=>this.uwarF(r)},["UWS"]:{c:()=>this.ustokeC(),f:r=>this.ustokeF(r)},["UIW"]:{c:()=>this.uiwC(),f:r=>this.uiwF(r)},["UTM"]:{c:()=>this.umaulC(),f:r=>this.umaulF(r)},["VIK"]:{c:()=>this.vikC(),f:r=>this.vikF(r)},["VND"]:{c:()=>this.vdrkC(),f:r=>this.vdrkF(r)},["VNS"]:{c:()=>this.vnsC(),f:r=>this.vnsF(r)},["WMC"]:{c:()=>this.warC(),f:r=>this.warF(r)},["WWP"]:{c:()=>this.wwpC(),f:r=>this.wwpF(r)},["WFB"]:{c:()=>this.wfbC(),f:r=>this.wfbF(r)},["XTR"]:{c:()=>this.xtmC(),f:r=>this.xtmF(r)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";forges=!0;flanks=!1;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let e="";this.flanks&&(e="Flank"),this.forges&&(e?e="Forge/"+e:e=m.forglied(this.allied)),e&&(this.text=e+": "+this.ftext),this.ftext=""}jr3(t,e){const r=super.jr3(t,e);return this.forges&&r.jr4("FR",this.code),this.flanks&&r.jr4("FK",this.code),r}ddf8(t){return St.extractCardCode(t.trigger.logicCode)==="MMR"&&t.trigger.type==="TE"}jr8(t){const e=this.cardCode();if(t.trigger.type==="TE"&&e==="MMR"){this.logAct(!1);const r=t.event,s=k.toPlayer(r.playerA);k.drawCard(s,this.level);const h=p.trigIdx(s.triggers,t.trigger);h>-1&&s.triggers.splice(h,1),x.triggerDone();return}this.cardForge(this.cardCode(),t),x.triggerDone()}agknitC(){this.faction="A",this.rarity="L",this.name="Aegis Knight",this.iAttack=this.boof5814,this.iHealth=this.iAttack,this.tribe.push("HM"),this.iArmor=this.lValN([1,2,5]),this.ftext="Each friendly creature deals damage equal to its Armor to the opposing creature"}agknitF(t){const e=p.crFriendTarg();e.hasArmor=!0;const r=N.tick();f.creatByTarget(e).forEach(s=>{s.opposed&&s.opposed.hurtDirect(s.armor,s.code,r)})}squadC(){this.faction="A",this.rarity="H",this.name="Aeromind Squadron",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("MM"),this.iMobile=1,this.ftext="Put a Metamind at random from your deck into your hand."}squadF(t){const e=k.toPlayer(t.owner),r=p.target("TH");r.player=k.toTarget(e),r.tribe="MM";const s=w.deckByTarget(r),h=s.length;if(h>0){const u=s[S.randInt(0,h)];e.deck.splice(u[1],1),e.hand.push(u[0])}}afsC(){this.faction="T",this.rarity="H",this.name="Ashurian Flamesculptor",this.iAttack=this.boof5915,this.iHealth=this.boof3610,this.tribe.push("FR","AS"),this.forges=this.level>1,this.consistent=this.forges,this.ftext=`You may play an additional ${m.levelGateText(this.level-1)} Tempys spell this turn.`,this.forges&&this.addSp("C",0)}afsF(t){const e=M.freeCard(this.code);e.condition.card="S",e.condition.level=w.ddf2(this.level-1),e.condition.faction="T"}bzshC(){this.faction="T",this.rarity="C",this.name="Blizzard Shaman",this.iAttack=this.boof61014,this.iHealth=this.iAttack+1,this.tribe.push("WN","AS"),this.ftext="Move another friendly creature at random to another available lane at random."}bzshF(t){const e=f.creatByTarget(p.crFriendNotMeTarg(t.creatId)),r=e.length;if(r<4&&r>0){const s=e[S.randInt(0,r)],h=f.emptyLanes(s.owner);this.logAct(!1,s),s.move(h[S.randInt(0,h.length)])}}bwtC(){if(this.faction="U",this.rarity="H",this.name="Bramblewood Tracker",this.iAttack=this.boof3712,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.forges=this.level>1,this.forges){const t=this.level-1;this.ftext=`You may play an additional ${m.levelGateText(t)} Uterra creature this turn.`,this.consistent=!0,this.addSp("C",0)}else this.hints=["LV"]}bwtF(t){const e=M.freeCard(this.code);e.condition.card="C",e.condition.faction="U",e.condition.level=w.ddf2(this.level-1)}bssC(){this.faction="A",this.rarity="L",this.name="Brightsteel Sentinal",this.iHealth=this.boof51015,this.iAttack=this.iHealth-1,this.tribe.push("RB"),this.addSp("M",this.iHealth),this.ftext=`Each friendly Robot gets Armor ${this.iHealth} this turn.`}bssF(t){const e=this.boof51015,r=p.crFriendTarg();r.tribe="RB",r.canArmor=!0,f.creatByTarget(r).forEach(h=>{const u=p.mod("AR",e,t.creatId);u.expiry="ET",h.addMod(u)})}bzdrC(){this.faction="N",this.rarity="R",this.name="Byzerak Drake",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.iRegen=this.level,this.allied="T",this.tribe.push("DG"),this.addSp("R",this.level),this.ftext=`Mobility ${this.level}.`}bzdrF(t){M.allied(this.allied)&&f.jr5(t.creatId).addMobility(this.level)}bfmC(){this.faction="N",this.rarity="H",this.name="Byzerak Frostmaiden",this.iAttack=this.boof135,this.iHealth=this.boof91420,this.tribe.push("HM"),this.flanks=!0;const t=this.boof246;this.ftext=`If ${this.name} is opposed, the opposing creature gets ${m.jr9(-1*t,0)} and this gets ${m.jr9(t,0)}.~Allied Tempys: Mobility ${this.level}.`;const e=this.ddp9(0,t*2,t*2,0);this.bonus={play:e,exist:e/2}}bfmF(t){const r=W.toEnterField(t.event).creature;t.trigger.type==="FR"&&M.allied("T")&&r.addMobility(this.level);const s=r.opposed;if(s){const h=this.boof246;s.buff(-1*h,0),r.buff(h,0)}}charnC(){this.faction="N",this.rarity="C",this.name="Charnel Titan",this.iAttack=this.boof359,this.iHealth=this.boof5814,this.tribe.push("AB");const t=this.boof357;this.ftext=`If there is an enemy creature with ${t} or less attack, ${this.name} gets ${m.jr9(t,t)}.`}charnF(t){const e=this.boof357,r=p.crEnemyTarg();r.maxAttack=e,f.creatByTarget(r).length>0&&f.jr5(t.creatId).buff(e,e)}chihC(){this.faction="U",this.rarity="C",this.name="Chistlehearth Hunter",this.iAttack=this.lValN([2,6,11]),this.iHealth=this.boof81217,this.tribe.push("HM"),this.ftext=`${this.name} gets ${m.jr9(1,0)} for each other friendly creature.`}chihF(t){const e=f.ddf1().length;e>1&&f.jr5(t.creatId).buff(e-1,0)}chickenC(){this.faction="T",this.rarity="L",this.name="Cindersmoke Wyvern",this.iAttack=this.boof3610,this.iHealth=this.lValN([7,12,17]),this.tribe.push("DG"),this.iMobile=this.boof124,this.forges=!1,this.flanks=!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.iAttack,this.iAttack,0)}}chickenF(t){const e=W.toEnterField(t.event),r=e.creature.attack,s=e.creature.opposed;s?s.hurtDirect(r,this.code):k.hurtDirect(!t.owner,r,this.code)}dfrC(){this.faction="N",this.rarity="H",this.name="Darkfrost Reaper",this.iAttack=this.boof6916,this.iHealth=this.boof3713,this.tribe.push("SK"),this.ftext="Destroy each creature with 1 or less attack."}dfrF(t){const e=p.crTarg();e.maxAttack=1;const r=f.creatByTarget(e),s=N.tick();r.forEach(h=>{O.destroy(h,this.code,s)})}dbaC(){this.faction="U",this.rarity="H",this.name="Deepbranch Ancient",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HY"),this.ftext=`If there is a friendly creature in each lane, ${this.name} gets ${m.jr9(this.iAttack,this.iHealth)}.`}dbaF(t){f.ddf1().length===5&&f.jr5(t.creatId).buff(this.iAttack,this.iHealth)}drbC(){this.faction="N",this.rarity="C",this.name="Dirge Banshee",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("ST"),this.hints=["OP"],this.flanks=!0;const t=this.boof246;this.ftext=`If ${this.name} is opposed, the opposing creature gets ${m.jr9(-t,0)} and this gets ${m.jr9(t,0)}.`}drbF(t){const e=W.toEnterField(t.event),r=e.creature.opposed;if(r){const s=this.boof246;r.buff(-s,0),e.creature.buff(s,0)}}dddC(){this.faction="N",this.rarity="L",this.name="Doomwing, Dire Drake",this.iAttack=this.boof61018,this.iHealth=this.lValN([2,6,10]),this.iMobile=this.level,this.tribe.push("DG"),this.forges=!1,this.flanks=!0,this.ftext=`Destroy the opposing ${m.levelGateText(this.level,!0)}creature.`}dddF(t){const r=W.toEnterField(t.event).creature.opposed;r&&w.levelTestCommon(r.level,this.level)&&O.destroy(r,this.code)}espwrC(){this.faction="U",this.rarity="R",this.name="Esperian Wartusk",this.iAttack=this.boof5916,this.iHealth=this.iAttack-1,this.iBT=!0,this.allied="A",this.tribe.push("TK");const t=this.boof124;this.ftext=`Armor ${t}.`}espwrF(t){M.allied(this.allied)&&f.jr5(t.creatId).addArmor(this.boof124)}fwtC(){this.faction="U",this.rarity="H",this.name="Frostwild Tracker",this.iAttack=this.boof4712,this.iHealth=this.boof248,this.tribe.push("TG"),this.forges=this.level>1;const t=this.level-1;this.ftext=`You may play an additional ${m.levelGateText(t)} creature this turn.`,this.level>1||(this.hints=["LV"])}fwtF(t){const e=M.freeCard(this.code);e.condition.card="C",e.condition.level=w.ddf2(this.level-1)}gwurmC(){this.faction="N",this.rarity="C",this.name="Gloomspire Wurm",this.iAttack=this.boof4813,this.iHealth=this.iAttack,this.tribe.push("WR"),this.ftext=`If there are no enemy creatures, ${this.name} gets ${m.jr9(4,4)}.`}gwurmF(t){f.qEnemyCreats().length===0&&f.jr5(t.creatId).buff(4,4)}gsC(){this.faction="U",this.rarity="C",this.name="Glowstride Stag",this.iAttack=this.boof5812,this.iHealth=this.iAttack+this.level,this.tribe.push("ST");const t=this.boof51015;this.ftext=`You gain ${t} health.`}gsF(t){const e=this.boof51015;k.heal(t.owner,e)}iracoC(){this.faction="A",this.rarity="L",this.name="Ironmind Acolyte",this.iAttack=this.boof61015,this.iHealth=this.iAttack-2,this.tribe.push("GN"),this.ftext="If you have five or more cards in your hand, you may play an additional card this turn."}iracoF(t){k.toPlayer(t.owner).hand.length>4&&(M.regularPlays+=1)}legtitC(){this.faction="N",this.rarity="R",this.name="Legion Titan",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.ftext=`${this.name} gets ${m.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`}legtitF(t){const e=p.crEnemyTarg();e.maxAttack=this.boof357;const r=f.creatByTarget(e);if(r.length>0){const s=this.level*r.length;f.jr5(t.creatId).buff(s,s)}}lbdC(){this.faction="U",this.rarity="H",this.name="Lifeblood Dryad",this.iAttack=this.lValN([4,7,9]),this.iHealth=this.iAttack,this.tribe.push("DY");const t=this.boof236;this.ftext=`If there is a friendly creature in each lane, each other friendly creature gets ${m.jr9(t,t)}.`}lbdF(t){const e=f.creatByTarget(p.crFriendNotMeTarg(t.creatId));if(e.length===4){const r=this.boof236;e.forEach(s=>s.buff(r,r))}}lyrC(){this.faction="N",this.rarity="L",this.name="Lyria, Muse of Varna",this.iAttack=this.boof5815,this.iHealth=this.boof4714,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.level===2?"Spawn a random creature that was destroyed this game.":"Put a random creature that was destroyed this game into each of your available lanes.",this.forges||(this.hints=["LV"])}lyrF(t){if(this.level===2){const e=O.gravedigger();e&&f.birth(e,"S",t.owner)}else if(this.level===3){const e=f.emptyLanes(t.owner),r=e.map(s=>O.gravedigger());if(e.length>0&&r[0]){const s=N.tick();e.forEach((h,u)=>{f.birth(r[u],"P",t.owner,h,s)})}}}moeC(){this.faction="T",this.rarity="H",this.name="Master of Elements",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=`You may play an additional ${m.levelGateText(this.level-1)} spell this turn.`}moeF(t){const e=M.freeCard(this.code);e.condition.card="S",e.condition.level=w.ddf2(this.level-1)}mmaC(){this.faction="A",this.rarity="C",this.name="Metamind Adept",this.iAttack=this.boof5915,this.iHealth=this.boof4813,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`Draw ${this.level} card${t}.`}mmaF(t){k.drawCard(t.owner,this.level)}mmrC(){this.faction="A",this.rarity="C",this.name="Metamind Archivist",this.iAttack=this.boof3713,this.iHealth=this.iAttack+5,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`If there is another friendly Metamind, draw ${this.level} card${t} at the end of your turn.`}mmrF(t){const e=p.crFriendNotMeTarg(t.creatId);if(e.tribe="MM",f.creatByTarget(e).length>0){const r=p.trigger("TE",this.code);r.changes=!0,k.toPlayer(t.owner).triggers.push(r)}}nysymC(){this.faction="N",this.rarity="C",this.name="Nyrali Symbiote",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`}nysymF(t){const e=W.toEnterField(t.event);e.creature.opposed&&e.creature.addRegen(this.boof246)}ofmC(){this.faction="A",this.rarity="R",this.name="Oreian Fieldmarshal",this.iAttack=this.boof5914,this.iHealth=this.iAttack-2,this.tribe.push("HM");const t=this.boof135;this.ftext=`Each other friendly creature gets ${m.jr9(t,0)}.`}ofmF(t){const e=this.boof135;f.creatByTarget(p.crFriendNotMeTarg(t.creatId)).forEach(s=>{s.buff(e,0)})}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.tribe.push("RB"),this.hints=["OP"],this.ftext=`${this.name} gets Armor ${this.iAttack} this turn.`}orpF(t){const e=f.jr5(t.creatId),r=p.mod("AR",this.iAttack,t.creatId);r.expiry="ET",e.addMod(r)}onxmarC(){this.faction="A",this.rarity="R",this.name="Onyxium Marauder",this.iAttack=this.boof4714,this.iHealth=this.lValN([6,9,17]),this.iArmor=this.level,this.allied="N",this.tribe.push("HM"),this.ftext=`Regenerate ${this.level}.`}onxmarF(t){M.allied(this.allied)&&f.jr5(t.creatId).addRegen(this.level)}phmC(){this.faction="A",this.rarity="R",this.name="Palladium Hindermind",this.iAttack=this.boof2612,this.iHealth=this.boof61016,this.tribe.push("HM"),this.ftext=`Each enemy creature gets ${m.jr9(this.boof123n,0)}.`}phmF(t){const e=this.boof123n;f.qEnemyCreats().forEach(r=>{r.buff(e,0)})}palsC(){this.faction="A",this.rarity="L",this.name="Palladium Simulacrum",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.iMobile=this.level-1,this.tribe.push("SS"),this.flanks=!0,this.ftext=`If ${this.name} is in the center lane, Spawn a copy.`}palsF(t){W.toEnterField(t.event).creature.lane===3&&f.birth(this.code,"S",t.owner)}prinvC(){this.faction="T",this.rarity="H",this.name="Primordial Invoker",this.iAttack=this.boof61016,this.iHealth=this.boof468,this.tribe.push("HM"),this.ftext=`Deal ${this.iHealth} damage divided at random between enemy creatures and the the enemy player.`}prinvF(t){const e=f.creatByTarget(p.crEnemyTarg()),r=e.length;if(r===0)k.hurtDirect(!t.owner,this.iHealth,this.code);else{const s=N.tick(),h=r+1,u=Array(h).fill(0);for(let g=0;g{u[y]>0&&g.hurtDirect(u[y],this.code,s)}),u[r]>0&&k.hurtDirect(!t.owner,u[r],this.code)}}scorchC(){this.faction="T",this.rarity="L",this.name="Scorchmane Dragon",this.iAttack=this.lValN([0,12,24]),this.iHealth=this.boof61224,this.tribe.push("DG"),this.iDefend=this.level===1,this.iMobile=this.level-1,this.forges=this.level>1,this.ftext="Deal 5 damage to "+(this.level===2?"the opposing creature.":"each enemy creature and player."),this.level===1&&(this.hints=["LV"])}scorchF(t){const e=W.toEnterField(t.event),r=!t.owner;if(this.level===2){const s=e.creature.opposed;s&&s.hurtDirect(5,this.code)}else if(this.level===3){const s=N.tick();f.qPlayerCreats(r).forEach(h=>h.hurtDirect(5,this.code,s)),k.hurtDirect(r,5,this.code)}}scythC(){this.faction="N",this.rarity="L",this.name="Chiron, Herald of Torment",this.iAttack=12,this.iHealth=6,this.tribe.push("DM"),this.ftext=`Each enemy creature gets ${m.jr9(-6,0)} and ${this.name} gets ${m.jr9(6,0)} for each enemy creature.`}scythF(t){const e=f.qEnemyCreats();e.forEach(r=>{r.buff(-6,0)}),e.length>0&&f.jr5(t.creatId).buff(6*e.length,0)}souldrC(){this.faction="N",this.rarity="L",this.name="Soul Drinker",this.iAttack=1,this.iHealth=this.boof4814,this.iMobile=this.level===3?1:0,this.tribe.push("VP"),this.hints=["OP"],this.flanks=this.level===3,this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`}souldrF(t){const e=W.toEnterField(t.event),r=e.creature.opposed;if(r){const s=r.attack;e.creature.buff(s,0),r.buff(-1*s,0)}}ssggC(){this.faction="N",this.rarity="H",this.name="Soulscourge Grimgaunt",this.iAttack=this.level+1,this.iHealth=this.iAttack,this.tribe.push("GG"),this.ftext=`${this.name} gets ${m.jr9(this.iAttack,this.iHealth)} for each creature that was destroyed this turn.`}ssggF(t){const e=this.iAttack*(M.deathsA.length+M.deathsB.length);e>0&&f.jr5(t.creatId).buff(e,e)}sbdC(){this.faction="U",this.rarity="C",this.name="Spiritbloom Dryad",this.iAttack=this.boof6812,this.iHealth=this.iAttack+this.level,this.tribe.push("DY"),this.ftext=`Each player gains ${this.boof468} health.`}sbdF(t){const e=this.boof468;k.heal(!0,e),k.heal(!1,e)}sssC(){this.faction="A",this.rarity="C",this.name="Steelskin Spelunker",this.iAttack=this.boof5814,this.iHealth=this.boof61018,this.tribe.push("HM"),this.ftext=`If there is another friendly creature in the center lane, that creature gets Armor ${this.boof124}`}sssF(t){const e=f.searchByLane(3,t.owner);e&&e.id!==t.creatId&&!e.negateArmor&&e.addArmor(this.boof124)}lotusC(){this.faction="U",this.rarity="H",this.name="Stygian Lotus",this.iAttack=this.boof468,this.iHealth=this.iAttack-1,this.tribe.push("PL"),this.hints=["OP"],this.ftext=`If ${this.name} is opposed, spawn a copy of it. Then repeat this for each copy.`}lotusF(t){if(W.toEnterField(t.event).creature.opposed){let r=!0;for(;r;){const s=f.emptyLanes(t.owner),h=s.length;if(h===0)r=!1;else{const u=s[S.randInt(0,h)];f.birth(this.code,"P",t.owner,u).opposed||(r=!1)}}}}tgiC(){this.faction="T",this.rarity="R",this.name="Thundergale Invoker",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("WN","GT"),this.ftext=`Each creature adjacent to ${this.name} moves one lane away if possible.`}tgiF(t){const e=f.jr5(t.creatId),r=e.lane,s=e.owner,h=[];if(r>2){const u=f.searchByLane(r-1,s);u&&(f.searchByLane(r-2,s)||(h.push(u),u.move(r-2)))}if(r<4){const u=f.searchByLane(r+1,s);u&&(f.searchByLane(r+2,s)||(h.push(u),u.move(r+2)))}h.length>0&&this.logAct(!1,...h)}tortex(t){return`Put a level ${this.level} ${t} into your hand.`}torf(t){const e=k.getActive(),r=t+this.level;e.hand.push(r)}toraC(){this.faction="A",this.rarity="R",this.name="Torrent Acolyte",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.tribe.push("MM"),this.forges=this.level>1,this.ftext=this.tortex("Power Torrent")}toraF(t){this.torf("PTR")}torsC(){this.faction="U",this.rarity="R",this.name="Torrent Soldier",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("IN"),this.forges=this.level>1,this.ftext=this.tortex("Spore Torrent")}torsF(t){this.torf("STO")}torvC(){this.faction="T",this.rarity="R",this.name="Torrent Valkyrie",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("IC","AS"),this.forges=this.level>1,this.ftext=this.tortex("Ice Torrent")}torvF(t){this.torf("ITO")}torwC(){this.faction="N",this.rarity="R",this.name="Torrent Witch",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.tortex("Spirit Torrent")}torwF(t){this.torf("STR")}umglidC(){this.faction="T",this.rarity="R",this.name="Umbruk Glider",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.iMobile=this.level,this.allied="U",this.tribe.push("DN"),this.ftext="Breakthrough."}umglidF(t){if(M.allied(this.allied)){const e=f.jr5(t.creatId);e.breakthrough=!0}}uwarC(){this.faction="T",this.rarity="H",this.name="Uranti Warlord",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("FR","YT"),this.hints=["OP"],this.ftext=`Each friendly Yeti deals ${this.iAttack} damage to the opposing creature.`}uwarF(t){const e=p.crFriendTarg();e.tribe="YT";const r=f.creatByTarget(e),s=N.tick();r.forEach(h=>{const u=h.opposed;u&&u.hurtDirect(this.iAttack,h.code,s)})}ustokeC(){this.faction="T",this.rarity="R",this.name="Uranti Warstoker",this.iAttack=this.boof6812,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.ftext=`Each other friendly Yeti get ${m.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const e=p.crFriendNotMeTarg(t.creatId);e.tribe="YT";const r=f.creatByTarget(e),s=this.stokeboof;r.forEach(h=>{const u=p.mod("AT",s,t.creatId);u.expiry="ET",h.addMod(u)})}get stokeboof(){return this.lValN([3,4,6])}uiwC(){this.faction="A",this.rarity="L",this.name="Uriel Ironwing",this.iAttack=this.lValN([6,8,13]),this.iHealth=this.boof81117,this.iMobile=this.level,this.tribe.push("AG"),this.flanks=!0;const t=this.boof246n,e=this.level===3?" If that creature has 0 or less attack, destroy it.":"";this.ftext=`The opposing creature gets ${m.jr9(t,0)}.${e}`}uiwF(t){const s=W.toEnterField(t.event).creature.opposed;s&&(s.buff(this.boof246n,0),this.level===3&&s.attack<1&&O.destroy(s,this.code))}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${m.jr9(t,t)}.`}umaulF(t){const e=W.toEnterField(t.event);if(e.creature.opposed){const r=this.boof246;e.creature.buff(r,r)}}vikC(){this.faction="N",this.rarity="L",this.name="Varna, Immortal King",this.maxLevel=4,this.iAttack=this.lValN([4,6,12,18]),this.iHealth=this.lValN([8,13,22,30]),this.tribe.push("FB");let t="";this.level===4&&(t="Destroy each other creature. Then "),this.ftext=t+"Spawn a random friendly creature that was destroyed this turn."}vikF(t){if(this.level===4){const s=f.creatByTarget(p.crNotMeTarg(t.creatId));if(s.length>0){const h=N.tick();s.forEach(u=>O.destroy(u,this.code,h))}}const e=t.owner?M.deathsA:M.deathsB,r=e.length;e.length>0&&f.birth(e[S.randInt(0,r)],"S",t.owner)}vdrkC(){this.faction="U",this.rarity="R",this.name="Venomdrinker",this.iAttack=this.lValN([5,9,13]),this.iHealth=this.iAttack,this.tribe.push("NG"),this.ftext=`${this.name} gets ${m.jr9(1,1).replaceAll("1","X")}, where X is the total amount of Poison on each enemy creature.`}vdrkF(t){const e=f.qEnemyCreats();let r=0;e.forEach(s=>{r+=s.poison}),r>0&&f.jr5(t.creatId).buff(r,r)}vnsC(){this.faction="U",this.rarity="H",this.name="Venomous Netherscale",this.iAttack=this.boof4713,this.iHealth=this.iAttack+4,this.tribe.push("NG"),this.ftext=`Double the Poison on each enemy creature${this.level===3?" and the enemy player":""}.`}vnsF(t){const e=p.crEnemyTarg();if(e.hasPoison=!0,f.creatByTarget(e).forEach(s=>{s.addPoison(s.poison)}),this.level===3){const s=k.toPlayer(!t.owner);s.poison+=k.totalPoison(s)}}warC(){this.faction="A",this.rarity="H",this.name="War Machine",this.iAttack=3,this.iHealth=3,this.tribe.push("RB"),this.maxLevel=1,this.overload=!0,this.ftext=`Each other friendly creature gets ${m.jr9(3,0)}.`}warF(t){const e=p.crFriendNotMeTarg(t.creatId);f.creatByTarget(e).forEach(r=>r.buff(3,0))}wwpC(){this.faction="U",this.rarity="H",this.name="Weirwood Patriarch",this.iAttack=this.boof5714,this.iHealth=this.lValN([7,10,17]),this.tribe.push("HM");const t=this.boof235;this.ftext=`Each friendly creature with ${this.boof357} or less attack gets ${m.jr9(t,t)}.`}wwpF(t){const e=this.boof235,r=p.crFriendNotMeTarg(t.creatId);r.maxAttack=this.boof357,f.creatByTarget(r).forEach(s=>s.buff(e,e))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("ST"),this.hints=["OP"],this.flanks=!0;const t=this.boof247n;this.ftext=`The opposing creature gets ${m.jr9(t,t)}.`}wfbF(t){const r=W.toEnterField(t.event).creature.opposed;if(r){const s=this.boof247n;r.buff(s,s)}}xtmC(){this.faction="N",this.rarity="H",this.name="Xithian Tormentor",this.iAttack=this.lValN([6,12,22]),this.iHealth=this.lValN([10,16,28]),this.tribe.push("AB"),this.ftext="Destroy each other friendly creature."}xtmF(t){const e=f.creatByTarget(p.crFriendNotMeTarg(t.creatId));if(e.length>0){const r=N.tick();e.forEach(s=>O.destroy(s,this.code,r))}}}class ze extends P{lookup(t){return{["RBG"]:{c:()=>this.rbgC(),g:(r,s)=>this.rbgG(r,s)},["SRV"]:{c:()=>this.sprvC(),g:(r,s)=>this.sprvG(r,s)},["TGK"]:{c:()=>this.tgkC(),g:(r,s)=>this.tgkG(r,s)}}[t]}onGain(t,e){this.lookup(t).g(e,e.event)}hPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("LG",this.code),r}ddf8(t){return t.trigger.type==="LG"&&this.validPlayer(t)}jr8(t){this.onGain(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.hPlayer===0)return!0;const e=t.event;return this.hPlayer===1?t.owner===e.playerA:t.owner!==e.playerA}rbgC(){this.faction="U",this.rarity="H",this.name="Runebark Guardian",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hPlayer=1;const t=this.boof135;this.text=`When you gain health, ${this.name} gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}rbgG(t,e){const r=f.jr5(t.creatId),s=this.boof135;r.buff(s,s)}sprvC(){this.faction="N",this.rarity="R",this.name="Spirit Reaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.hPlayer=-1;const t=this.boof234;this.text=`When an enemy player gains health, ${this.name} gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}sprvG(t,e){const r=f.jr5(t.creatId),s=this.boof234;r.buff(s,s)}tgkC(){this.faction="U",this.rarity="R",this.name="Tuskin Grovekeeper",this.iAttack=this.boof6912,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hPlayer=1,this.text=`When you gain health, Spawn a 3/3 ${U.minionName(this.level)}.`,this.bonus={exist:this.ddp9(1,6,3,0)*.5}}tgkG(t,e){const r=this.lValS(["SXD","SPL","TTF"])+this.level;f.birth(r,"S",t.owner)}}class Be extends P{lookup(t){return{["EWE"]:{c:()=>this.eweC(),m:(r,s)=>this.eweM(r,s)},["FFM"]:{c:()=>this.ffmC(),m:(r,s)=>this.ffmM(r,s)},["LUC"]:{c:()=>this.lugC(),m:(r,s)=>this.lugM(r,s)},["WBH"]:{c:()=>this.wbhC(),m:(r,s)=>this.wbhM(r,s)}}[t]}onMove(t,e){this.lookup(t).m(e,W.toCreature(e.event))}mPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("MV",this.code),r}ddf8(t){return t.trigger.type==="MV"&&this.validPlayer(t)}jr8(t){this.onMove(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=W.toCreature(t.event);return this.mPlayer===1?t.owner===e.creature.owner:t.owner!==e.creature.owner}eweC(){this.faction="T",this.rarity="H",this.name="Emberwind Evoker",this.iAttack=this.boof4914,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.mPlayer=1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)}}eweM(t,e){const r=this.boof124;e.creature.buff(r,r)}ffmC(){this.faction="T",this.rarity="H",this.name="Frostfang Maiden",this.iAttack=this.boof5814,this.iHealth=this.iAttack+this.level,this.tribe.push("HM"),this.iMobile=this.level,this.mPlayer=1;const t=this.ffbof;this.text=`When a friendly creature moves, deal ${t} to the creature opposing it.`,this.bonus={exist:this.ddp9(0,t,0,0)}}ffmM(t,e){const r=e.creature.opposed;r&&r.hurtDirect(this.ffbof,this.code)}get ffbof(){return this.level+2}lugC(){this.faction="T",this.rarity="L",this.name="Lug, Uranti Charger",this.iAttack=this.boof359,this.iHealth=this.lValN([9,13,19]),this.level===3&&(this.iMobile=1),this.tribe.push("YT"),this.mPlayer=1,this.text="When a friendly creature moves on your turn, Lug battles an additional time.",this.bonus={exist:this.ddp9(0,0,0,this.iAttack)}}lugM(t,e){if(t.owner===k.getActiveB()){const r=f.jr5(t.creatId);r.extraBattles+=1}}wbhC(){this.faction="T",this.rarity="R",this.name="Windborn Hellion",this.iAttack=this.boof4812,this.iHealth=this.boof81217,this.tribe.push("WN","EL"),this.mPlayer=1,this.text=`When a friendly creature moves, ${this.name} gets ${m.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)}}wbhM(t,e){f.jr5(t.creatId).buff(this.level,this.level)}}class Yt extends P{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.agrdP(r,s)},["ART"]:{c:()=>this.arootC(),t:(r,s)=>this.factionSpellMyTurn(r,s,"U"),p:(r,s)=>this.arootP(r,s)},["ARB"]:{c:()=>this.arbysC(),t:(r,s)=>this.enemyPlayed(r,s),p:(r,s)=>this.arbysP(r,s)},["BLH"]:{c:()=>this.bblhC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.bblhP(r,s)},["CYC"]:{c:()=>this.ccC(),t:(r,s)=>this.factionSpellMyTurn(r,s,"N"),p:(r,s)=>this.ccP(r,s)},["DHW"]:{c:()=>this.dhwC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.dhwP(r,s)},["FBI"]:{c:()=>this.fbiC(),t:(r,s)=>this.factionSpellMyTurn(r,s,"T"),p:(r,s)=>this.fbiP(r,s)},["FLS"]:{c:()=>this.flspkC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.flspkP(r,s)},["IZK"]:{c:()=>this.izzyC(),t:(r,s)=>this.izzyT(r,s),p:(r,s)=>this.izzyP(r,s)},["KAW"]:{c:()=>this.kasC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.kasP(r,s)}}[t]}testPlay(t,e){return this.lookup(t).t(e,e.event)}actPlay(t,e){this.lookup(t).p(e,e.event)}triggerLevels=[1,2,3,4];constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return this.triggerLevels.includes(this.level)&&r.jr4("PC",this.code),r}ddf8(t){return t.event.code==="PLC"?this.testPlay(this.cardCode(),t):t.event.code==="TRE"&&this.cardCode()==="BLH"}jr8(t){if(t.event.code==="PLC")this.actPlay(this.cardCode(),t);else{const e=f.jr5(t.creatId);O.destroy(e,this.code)}x.triggerDone()}spellMyTurn(t,e){return e.playerA===t.owner&&I.getCard(e.cardCode).type==="S"}factionSpellMyTurn(t,e,r){if(e.playerA===t.owner){const s=I.getCard(e.cardCode);if(s.type==="S"&&s.faction===r)return!0}return!1}enemyPlayed(t,e){return e.playerA!==t.owner}ownerAlive(t){return f.jr5(t).status==="A"}agrdC(){this.faction="A",this.rarity="C",this.name="Aetherguard",this.iAttack=this.boof6814,this.iHealth=this.iAttack-1,this.tribe.push("RB"),this.bonus={exist:this.ddp9(0,this.level,0,0)},this.text=`When you play a spell, ${this.name} gets Armor ${this.level}.`}agrdP(t,e){f.jr5(t.trigger.creatId).addArmor(this.level)}arootC(){this.faction="U",this.rarity="H",this.name="Aether Root",this.iAttack=this.boof3610,this.iHealth=this.iAttack,this.tribe.push("PL");const t=this.boof234;this.text=`When you play an Uterra spell, ${this.name} gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}arootP(t,e){const r=f.jr5(t.trigger.creatId),s=this.boof234;r.buff(s,s)}arbysC(){this.faction="A",this.rarity="H",this.name="Anvillon Arbiter",this.iAttack=this.boof3714,this.iHealth=this.iAttack+3,this.iArmor=1,this.tribe.push("RB"),this.text="When the enemy player plays their second card in a turn, that player discards their hand."}arbysP(t,e){if(M.cardsPlayed>1&&this.ownerAlive(t.creatId)){const r=k.getActive();r.discard.push(...r.hand),r.hand=[]}}bblhC(){this.faction="T",this.rarity="L",this.name="Binben, Lightning Herald",this.iAttack=this.boof61017,this.iHealth=this.boof468,this.tribe.push("LT","AS");const t=I.getCard(this.lwy());this.text=`When you play a spell, Spawn a ${m.tokName(t)}. At the end of your turn, destroy it.`}bblhP(t,e){if(this.ownerAlive(t.creatId)){const r=f.birth(this.lwy(),"S",t.owner);if(r){const s=r.jr4("TE",this.code);s.changes=!0}}}lwy(){return "LWY"+this.level}ccC(){this.faction="N",this.rarity="H",this.name="Crypt Conjurer",this.iAttack=this.boof258,this.iHealth=this.lValN([8,14,20]),this.tribe.push("VP"),this.text=`When you play a Nekrium spell, deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.bonus={exist:this.ddp9(0,0,0,this.iAttack)}}ccP(t,e){this.ownerAlive(t.creatId)&&(k.hurtDirect(!t.owner,this.iAttack,t.cardCode),k.heal(t.owner,this.iAttack))}dhwC(){this.faction="N",this.rarity="R",this.name="Darkheart Wanderer",this.iAttack=this.boof3612,this.iHealth=this.boof81116,this.tribe.push("HM");const t=this.boof124;this.text=`When you play a spell, ${this.name} gets Regenerate ${t}.`}dhwP(t,e){f.jr5(t.trigger.creatId).addRegen(this.boof124)}fbiC(){this.faction="T",this.rarity="H",this.name="Flamebreak Invoker",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("FR","GT"),this.text=`When you play a Tempys spell, deal ${this.level} damage to each enemy creature.`,this.bonus={exist:this.ddp9(0,this.level*2,0,0)*.5}}fbiP(t,e){if(this.ownerAlive(t.creatId)){const r=N.tick();f.qEnemyCreats().forEach(s=>{s.hurtDirect(this.level,this.code,r)})}}flspkC(){this.faction="T",this.rarity="C",this.name="Flame Speaker",this.iAttack=this.lValN([2,6,13]),this.iHealth=this.level*6,this.tribe.push("HM");const t=this.boof235;this.text=`When you play a spell, deal ${t} damage to the enemy player.`,this.bonus={exist:this.ddp9(0,0,0,t)*.5}}flspkP(t,e){this.ownerAlive(t.creatId)&&k.hurtDirect(!t.owner,this.boof235,t.cardCode)}izzyC(){this.faction="T",this.rarity="L",this.name="Iztek, Khan of Arrachtor",this.iAttack=this.boof6915,this.iHealth=this.iAttack,this.tribe.push("IC","FR","AS"),this.text=`When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.~When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.`}izzyT(t,e){if(e.playerA===t.owner){const s=I.getCard(e.cardCode).cardCode();if(s==="IFL"||s==="IFR")return!0}return!1}izzyP(t,e){const r=f.jr5(t.trigger.creatId),h=I.getCard(e.cardCode).cardCode()==="IFL"?"IZL":"IZR";f.birth(`${h}${this.level}`,"R",r.owner,r.lane)}kasC(){this.faction="T",this.rarity="L",this.name="Kas, Arcweaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("LT","AS"),this.hints=["OL"],this.text="When you play a spell, Kas battles an additional time this turn.",this.bonus={exist:this.ddp9(0,this.iAttack,this.iAttack,0)*.5}}kasP(t,e){const r=f.jr5(t.trigger.creatId);r.extraBattles+=1}}class Pe extends P{lookup(t){return{["KTS"]:{c:()=>this.kitC(),r:(r,s)=>this.kitR(r,s)},["RSC"]:{c:()=>this.scootC(),r:(r,s)=>this.scootR(r,s)},["SCC"]:{c:()=>this.shcrC(),r:(r,s)=>this.shcrR(r,s)},["SND"]:{c:()=>this.ssdC(),r:(r,s)=>this.ssdR(r,s)}}[t]}actReplace(t,e){this.lookup(t).r(e,W.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("RP",this.code),r}ddf8(t){if(t.event.code==="RPL"){const e=t.event;return t.creatId===e.replCreatId}return!1}jr8(t){this.actReplace(this.cardCode(),t),x.triggerDone()}kitC(){this.faction="U",this.rarity="H",this.name="Kitaru Sprite",this.iAttack=this.boof358,this.iHealth=this.boof71117,this.tribe.push("FY"),this.hints=["RT"],this.text=`When this is replaced, Spawn a ${this.name}.`}kitR(t,e){f.birth(this.code,"S",t.owner)}scootC(){this.faction="A",this.rarity="T",this.name="Relic Scout",this.iAttack=this.level,this.iHealth=this.level,this.iArmor=this.level,this.isFree=!0,this.tribe.push("RB"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${m.jr9(this.level,this.level,!0)} and Armor ${this.level}.`}scootR(t,e){e.creature.buff(this.level,this.level),e.creature.addArmor(this.level)}shcrC(){this.faction="U",this.rarity="C",this.name="Shardclaw Crusher",this.iAttack=this.boof5812,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${m.jr9(this.iAttack,this.iAttack)}.`}shcrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}ssdC(){this.faction="U",this.rarity="R",this.name="Spiritstone Druid",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("TG"),this.hints=["RT"],this.text=`When ${this.name} is replaced, put a ${this.iAttack}/${this.iHealth} Spirit into each adjacent available lane.`}ssdR(t,e){const r=e.replCreat.adjacent,s=f.emptyLanes(t.owner),h=N.tick();r.forEach(u=>{s.includes(u)&&f.birth("SPU"+this.level,"P",t.owner,u,h)})}}class ce extends P{lookup(t){return{["BST"]:{c:()=>this.brimC(),u:(r,s)=>this.brimR(r,s)},["OSV"]:{c:()=>this.scavC(),u:(r,s)=>this.scavR(r,s)},["RHU"]:{c:()=>this.tiaC(),u:(r,s)=>this.tiaR(r,s)},["SKS"]:{c:()=>this.spsoC(),u:(r,s)=>this.spsoR(r,s)},["SWG"]:{c:()=>this.stgrC(),u:(r,s)=>this.stgrR(r,s)},["VTW"]:{c:()=>this.weldC(),u:(r,s)=>this.weldR(r,s)}}[t]}actUpgrade(t,e){this.lookup(t).u(e,W.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("UP",this.code),r}jr8(t){this.actUpgrade(this.cardCode(),t),x.triggerDone()}brimC(){this.faction="T",this.rarity="L",this.name="Brimstone Tyrant",this.iAttack=this.boof6916,this.iHealth=this.iAttack,this.tribe.push("FR","EL"),this.hints=["RD"];const t=this.boof468;this.text=`Upgrade: Deal ${t} damage to each other creature.`}brimR(t,e){const r=N.tick(),s=this.boof468;f.creatByTarget(p.crNotMeTarg(t.creatId)).forEach(h=>h.hurtDirect(s,this.code,r))}scavC(){this.faction="A",this.rarity="H",this.name="Oreian Scavenger",this.iAttack=this.boof6916,this.iHealth=1,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Armor ${this.iAttack}.`}scavR(t,e){e.creature.addArmor(this.iAttack)}tiaC(){this.faction="A",this.rarity="L",this.name="Relic Hunter",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iBT=!0,this.tribe.push("HM"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets +attack and +health equal to the creature it replaced.`}tiaR(t,e){e.creature.buff(e.replCreat.attack,e.replCreat.health)}spsoC(){this.faction="T",this.rarity="C",this.name="Sparksoul",this.iAttack=this.boof6915,this.iHealth=this.iAttack-1,this.tribe.push("LT","EL"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Aggressive.`}spsoR(t,e){e.creature.aggressive=!0}stgrC(){this.faction="A",this.rarity="C",this.name="Steelwatch Guard",this.iAttack=this.boof4711,this.iHealth=this.iAttack,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets ${m.jr9(this.iAttack,this.iAttack)}.`}stgrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}weldC(){this.faction="A",this.rarity="R",this.name="Vault Welder",this.iAttack=this.boof71118,this.iHealth=this.lValN([9,14,22]),this.iDefend=!0,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: Negate Defender from ${this.name}.`}weldR(t,e){e.creature.negateDefender=!0}}class At extends P{lookup(t){return{["CGF"]:{c:()=>this.cfiendC(),v:(r,s)=>this.cfiendV(r,s)},["CSB"]:{c:()=>this.corpsC(),v:(r,s)=>this.corpsV(r,s)},["CYS"]:{c:()=>this.cslmC(),v:(r,s)=>this.cslmV(r,s)},["DSK"]:{c:()=>this.dskC(),v:(r,s)=>this.dskV(r,s)},["FST"]:{c:()=>this.fstrC(),v:(r,s)=>this.fstrV(r,s)},["FWK"]:{c:()=>this.fwlkC(),v:(r,s)=>this.fwlkV(r,s)},["FFD"]:{c:()=>this.ffC(),v:(r,s)=>this.ffV(r,s)},["GVS"]:{c:()=>this.ghsC(),v:(r,s)=>this.ghsV(r,s)},["GBG"]:{c:()=>this.ggC(),v:(r,s)=>this.ggV(r,s)},["GMR"]:{c:()=>this.gromC(),v:(r,s)=>this.gromV(r,s)},["MMX"]:{c:()=>this.mmeC(),v:(r,s)=>this.mmeV(r,s)},["NOZ"]:{c:()=>this.nyozC(),v:(r,s)=>this.nyozV(r,s)},["POX"]:{c:()=>this.poxC(),v:(r,s)=>this.poxV(r,s)},["RSZ"]:{c:()=>this.rszC(),v:(r,s)=>this.rszV(r,s)},["SFM"]:{c:()=>this.spirmC(),v:(r,s)=>this.spirmV(r,s)},["SNT"]:{c:()=>this.sssC(),v:(r,s)=>this.sssV(r,s)},["VGN"]:{c:()=>this.vgfsC(),v:(r,s)=>this.vgfsV(r,s)},["XHS"]:{c:()=>this.xhostC(),v:(r,s)=>this.xhostV(r,s)},["ZTU"]:{c:()=>this.zimusC(),v:(r,s)=>this.zimusV(r,s)}}[t]}cardVengeance(t,e){this.lookup(t).v(e,W.toCreature(e.event))}vtext="";venges=!0;fixedImgCreat=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.venges&&(this.text="Vengeance: "+this.vtext),this.vtext=""}image(t){return this.fixedImgCreat?this.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e);return this.venges&&r.jr4("VN",this.code),r}jr8(t){this.cardVengeance(this.cardCode(),t),x.triggerDone()}cfiendC(){this.faction="N",this.rarity="T",this.name="Contagion Fiend",this.iAttack=this.boof234,this.iHealth=this.boof5812,this.tribe.push("AB"),this.fixedImgCreat=!0;const t=-this.level;this.vtext=`Each enemy creature gets ${m.jr9(t,t)}.`}cfiendV(t,e){const r=-this.level,s=N.tick(),h=p.crTarg();h.player=k.toTarget(!t.owner),f.creatByTarget(h).forEach(u=>u.buff(r,r,s))}corpsC(){this.faction="N",this.rarity="C",this.name="Corpulent Shambler",this.iAttack=this.lValN([5,7,15]),this.iHealth=this.iAttack,this.tribe.push("ZB"),this.vtext="Put a 3/3 Zombie into this lane.",this.bonus={play:this.ddp9(1,6,3,0)}}corpsV(t,e){const r=`${"ZBS"}${this.level}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}cslmC(){this.faction="N",this.rarity="C",this.name="Crypt Slime",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.vtext="Put a 1/1 Oozeling into this lane.",this.bonus={play:this.ddp9(1,2,1,0)}}cslmV(t,e){const r=`${"COZ"}${this.level}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}dskC(){this.faction="N",this.rarity="C",this.name="Death Seeker",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.fixedImgCreat=!0,this.hints=["ST"];const t=this.boof51015;this.vtext=`Put a ${t}/${t} Spirit into this lane.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}dskV(t,e){const r=`${"SPN"}${this.level}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}fstrC(){this.faction="N",this.rarity="R",this.name="Fell Strider",this.iAttack=this.lValN([4,8,10]),this.iHealth=this.boof369,this.tribe.push("ZB");const t=I.getCard(this.fsz());this.vtext=`Put a ${m.tokName(t)} into this lane.`,this.bonus={play:this.ddp9(1,this.iAttack+this.iHealth,this.iAttack,0)}}fstrV(t,e){f.birth(this.fsz(),"P",e.creature.owner,e.creature.lane)}fsz(){return "ZST"+this.level}fwlkC(){this.faction="N",this.rarity="C",this.name="Fell Walker",this.iAttack=this.boof359,this.iHealth=this.iAttack,this.tribe.push("ZB");const t=I.getCard(U.zomc(this.level));this.vtext=`Put a ${m.tokName(t)} into this lane.`,this.bonus={play:this.ddp9(1,this.iAttack*2,this.iAttack,0)}}fwlkV(t,e){f.birth(U.zomc(this.level),"P",e.creature.owner,e.creature.lane)}ffC(){if(this.faction="N",this.rarity="H",this.name="Fleshfiend",this.iAttack=this.boof6812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.venges=this.level>1,this.vtext=`Put a level ${this.level-1} ${this.name} into this lane.`,this.venges){const t=this.lValN([0,6,15]);this.bonus={play:this.ddp9(1,t*2,t,0)}}}ffV(t,e){const r=`${"FFD"}${this.level-1}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}ghsC(){this.faction="U",this.rarity="C",this.name="Glowhive Siren",this.iAttack=this.boof3814,this.iHealth=this.boof61117,this.tribe.push("IN"),this.vtext=`You gain ${this.boof124} to ${this.gghigh-1} health.`,this.bonus={play:this.ddp9(0,0,0,this.boof258)}}ghsV(t,e){const r=S.randInt(this.boof124,this.gghigh);k.heal(t.owner,r)}get gghigh(){return this.lValN([5,9,13])}ggC(){this.faction="N",this.rarity="C",this.name="Graveborn Glutton",this.iAttack=this.boof61117,this.iHealth=this.boof3814,this.tribe.push("AB"),this.vtext=`Deal ${this.boof124} to ${this.gghigh-1} damage to the enemy player.`,this.bonus={play:this.ddp9(0,0,0,this.boof258)}}ggV(t,e){const r=S.randInt(this.boof124,this.gghigh);k.hurtDirect(!t.owner,r,this.code)}gromC(){this.faction="U",this.rarity="C",this.name="Grove Matriarch",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("PL");const t=U.minionBuff(this.level),e=U.minionName(this.level);this.vtext=`Put a ${t}/${t} ${e} into this lane.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}gromV(t,e){const r=U.minionCode(this.level);f.birth(r,"P",e.creature.owner,e.creature.lane)}mmeC(){this.faction="A",this.rarity="C",this.name="Metamind Explorer",this.iAttack=this.boof3713,this.iHealth=this.iAttack+2,this.tribe.push("MM"),this.vtext=`Draw ${this.level} cards.`}mmeV(t,e){k.drawCard(t.owner,this.level)}nyozC(){this.faction="N",this.rarity="R",this.name="Nyrali Ooze",this.iAttack=this.boof247,this.iHealth=this.iAttack,this.tribe.push("OZ");const t=this.level+this.iAttack+1;this.vtext=`Put a ${t}/${t} Oozeling into this lane.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}nyozV(t,e){const r=`${"OOZ"}${this.level}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}poxC(){if(this.faction="N",this.rarity="H",this.name="Progeny of Xith",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.tribe.push("AB"),this.hints=["DL"],this.venges=this.level<3,this.vtext=`Spawn a level ${this.level+1} ${this.name}.`,this.venges){const t=this.lValN([10,6,0]);this.bonus={play:this.ddp9(1,t*2,t,0)}}}poxV(t,e){const r=`${"POX"}${this.level+1}`;f.birth(r,"S",e.creature.owner)}rszC(){this.faction="N",this.rarity="R",this.name="Runescarred Zombie",this.iAttack=this.lValN([5,8,16]),this.iHealth=this.boof359,this.tribe.push("ZB"),this.vtext=`Put a ${m.levelGateText(this.level,!0)}spell at random from your discard pile into your hand.`,this.bonus={play:this.ddp9(0,0,0,0,.25)}}rszV(t,e){const r=k.toPlayer(t.owner),s=p.target("TD");s.player=k.toTarget(r),s.card="S",s.level=w.ddf2(this.level);const h=w.deckByTarget(s);if(h.length>0){const u=h[S.randInt(0,h.length)];r.discard.splice(u[1],1),r.hand.push(u[0])}}spirmC(){this.faction="T",this.rarity="H",this.name="Spiritflame Mystic",this.iAttack=this.boof6912,this.iHealth=this.iAttack-3,this.tribe.push("HM"),this.vtext=`Deal ${this.boof246} damage to each creature.`}spirmV(t,e){const r=this.boof246,s=N.tick();f.qActiveCreats().forEach(h=>h.hurtDirect(r,this.code,s))}sssC(){this.faction="N",this.rarity="L",this.name="Spiritstone Sentry",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("ST"),this.vtext=`If ${this.name} was in a side lane, Spawn a ${this.name}.`,this.hints=["ST"]}sssV(t,e){(e.creature.lane===1||e.creature.lane===5)&&f.birth(e.creature.code,"S",t.owner)}vgfsC(){this.faction="N",this.rarity="C",this.name="Vengeful Spirit",this.iAttack=this.boof357,this.iHealth=this.iAttack-2,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof369n;this.vtext=`Give the opposing creature ${m.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*-2,-t,0)}}vgfsV(t,e){const r=e.creature.opposed;if(r){const s=this.boof369n;r.buff(s,s)}}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.iAttack=this.boof359,this.iHealth=this.boof135,this.tribe.push("AB"),this.vtext=`Deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.bonus={play:this.ddp9(0,0,0,this.iAttack*2)}}xhostV(t,e){const r=this.iAttack;k.hurtDirect(!t.owner,r,this.code),k.heal(t.owner,r)}zimusC(){this.faction="N",this.rarity="L",this.name="Zimus, the Undying",this.iAttack=this.boof51014,this.iHealth=this.lValN([2,5,7]),this.tribe.push(this.level===1?"HM":"ZB"),this.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,e){let r;this.level===2?r=`${"ZTR"}2`:r=`${"ZTU"}3`,f.birth(r,"S",t.owner)}}class $t extends yt{lookup(t){return{["AEC"]:{c:()=>this.anceC(),p:r=>this.echoZ(r)},["DIS"]:{c:()=>this.disnC(),p:r=>this.disnZ(r)},["DRE"]:{c:()=>this.dracC(),p:r=>this.echoZ(r)},["DCH"]:{c:()=>this.dchantC(),p:r=>this.dchantZ(r)},["ESU"]:{c:()=>this.esrgC(),p:r=>this.esrgZ(r)},["HOX"]:{c:()=>this.howlC(),p:r=>this.howlZ(r)},["ITO"]:{c:()=>this.itorC(),p:r=>this.itorZ(r)},["IME"]:{c:()=>this.imecC(),p:r=>this.echoZ(r)},["LCE"]:{c:()=>this.lucidC(),p:r=>this.echoZ(r)},["MSP"]:{c:()=>this.mendC(),p:r=>this.mendZ(r)},["NEM"]:{c:()=>this.netherC(),p:r=>this.netherZ(r)}}[t]}cardCast(t,e){this.lookup(t).p(e)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(p.playerActTarg(this.playTarg,"CARD",this.code,"")),t}handleAction(t){this.logSpell();const e=k.toPlayer(t.playerA);this.cardCast(this.cardCode(),e),v.spellCast()}ddf8(t){return t.trigger.type==="TE"?t.event.playerA===t.owner:!1}jr8(t){const e=St.extractCardCode(t.trigger.logicCode),r=t.event;if(e==="LCE"){const s=k.toPlayer(r.playerA),h=this.level===1?1:2;this.logAct(!1),k.drawCard(s,h)}else if(e==="IME"){const s=O.gravedigger(k.toTarget(t.owner),w.ddf2(this.level+1));s&&f.birth(s,"S",r.playerA)}else if(e==="DRE"){const s=this.level===1?11:21;k.hurtDirect(!r.playerA,S.randInt(1,s),this.code)}else if(e==="AEC"){const s=f.qPlayerCreats(t.owner);if(s.length>0){const h=this.level===1?[1,2]:[2,4];s.forEach(u=>{this.logAct(!1,u),u.buff(h[0],h[1])})}}else super.jr8(t);if(this.level<3){const s=k.toPlayer(r.playerA),h=p.trigIdx(s.triggers,t.trigger);h>-1?t.trigger.customCode==="P2"?s.triggers[h].customCode="P1":s.triggers.splice(h,1):console.error("Wery curious, could not find player trigger ",t.trigger)}x.triggerDone()}echTxt(){return"At the end of "+(this.level===3?"each of your turns":"this turn and your next turn")+", "}echoZ(t){const e=p.trigger("TE",this.code);this.level<3&&(e.customCode="P2"),e.changes=!0,t.triggers.push(e)}anceC(){this.faction="U",this.rarity="L",this.name="Ancestral Echoes",this.playTarg="F";const t=this.level===1?[1,2]:[2,4];this.text=`${this.echTxt()}each friendly creature gets ${m.jr9(t[0],t[1])}.`}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){k.hurtDirect(t,S.randInt(1,this.dshigh),this.code)}get dshigh(){return this.lValN([9,16,26])}dracC(){this.faction="T",this.rarity="L",this.name="Draconic Echoes",this.playTarg="F";const t=this.level===1?"10":"20";this.text=`${this.echTxt()}deal 1 to ${t} damage to the enemy player.`}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){k.heal(t,this.boof81220)}esrgC(){this.faction="A",this.rarity="R",this.name="Energy Surge",this.isFree=this.level>1,this.overload=this.level===3,this.level===1&&(this.hints=["LV"]),this.playTarg="F",this.text=`Draw ${this.level} card${this.level>1?"s":""}.`}esrgZ(t){k.drawCard(t,this.level)}howlC(){this.faction="N",this.rarity="R",this.name="Howl of Xith",this.maxLevel=1,this.playTarg="E",this.text="Deal X damage to the enemy player and gain X health, where X is three times your rank."}howlZ(t){const e=k.getActive(),r=e.rank*3;k.hurtDirect(t,r,this.code),k.heal(e,r)}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){k.hurtDirect(t,this.boof234,this.code)}imecC(){this.faction="N",this.rarity="L",this.name="Immortal Echoes",this.playTarg="F";const t=`Spawn a random friendly ${m.levelGateText(this.level+1,!0)}creature that was destroyed this game`;this.text=`${this.echTxt()}${t}.`}lucidC(){this.faction="A",this.rarity="L",this.name="Lucid Echoes",this.playTarg="F";const t=this.level===1?"draw 1 card":"draw 2 cards";this.text=`${this.echTxt()}${t}.`}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){k.heal(t,S.randInt(1,this.mendboof+1))}get mendboof(){return this.lValN([10,20,40])}netherC(){this.faction="N",this.rarity="C",this.name="Nether Embrace",this.playTarg="E";const t=this.boof4712;this.text=`Deal ${t} damage to the enemy player. You gain ${t} heal`}netherZ(t){const e=this.boof4712;k.hurtDirect(t,e,this.code),k.heal(!t.isPlayerA,e)}}class Ri extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Rageborn Hellion",this.iAttack=this.boof469,this.iHealth=this.iAttack*2,this.tribe.push("FR","EL"),this.hints=["OL"],this.text=`When a friendly creature ${m.dbdtap()}, ${this.name} gets ${m.jr9(this.level,this.level)}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}return!1}jr8(t){f.jr5(t.creatId).buff(this.level,this.level),x.triggerDone()}}class Nt extends P{lookup(t){return{["AIV"]:{c:()=>this.avinvC(),r:r=>this.avinvR(r)},["BSP"]:{c:()=>this.bskphC(),r:r=>this.bskphR(r)},["CRC"]:{c:()=>this.crucC(),r:r=>this.crucR(r)},["ESK"]:{c:()=>this.ebknC(),r:r=>this.ebknR(r)},["FWC"]:{c:()=>this.fwcC(),r:r=>this.fwcR(r)},["FME"]:{c:()=>this.feggC(),r:r=>this.feggR(r)},["MMV"]:{c:()=>this.mmovC(),r:r=>this.mmovR(r)},["PSH"]:{c:()=>this.porshC(),r:r=>this.porshR(r)},["RGG"]:{c:()=>this.runegC(),r:r=>this.runegR(r)},["SSR"]:{c:()=>this.solrevC(),r:r=>this.solrevR(r)},["SSM"]:{c:()=>this.spshamC(),r:r=>this.spshamR(r)},["SSG"]:{c:()=>this.snoutC(),r:r=>this.snoutR(r)},["UGM"]:{c:()=>this.mantisC(),r:r=>this.mantisR(r)}}[t]}rtext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Gain Rank: "+this.rtext,this.rtext=""}image(t){return this.rarity==="T"?this.cardCode()==="FWC"?this.rawImage("MPH",t):super.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e);return r.jr4("RU",this.code),r}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.owner:!1}jr8(t){this.lookup(this.cardCode()).r(t),x.triggerDone()}avinvC(){this.faction="T",this.rarity="H",this.name="Avalanche Invoker",this.iAttack=this.boof6914,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS"),this.hints=["TL"],this.rtext=`Deal ${this.boof3612} damage to each non-Tempys creature.`}avinvR(t){const e=this.boof3612,r=N.tick();f.qActiveCreats().filter(s=>s.faction!=="T").forEach(s=>s.hurtDirect(e,this.code,r))}bskphC(){this.faction="N",this.rarity="C",this.name="Blightskull Phantasm",this.iAttack=this.boof5814,this.iHealth=this.boof61017,this.tribe.push("ST"),this.hints=["TL","OP"];const t=this.boof369n;this.rtext=`the opposing creature gets ${m.jr9(t,t)}.`}bskphR(t){const r=f.jr5(t.creatId).opposed;if(r){const s=this.boof369n;r.buff(s,s)}}crucC(){this.faction="A",this.rarity="R",this.name="Crucible Colossus",this.iAttack=this.boof61016,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.iDefend=!0,this.hints=["TL"],this.rtext=`Negate Defender from ${this.name}.`}crucR(t){const e=f.jr5(t.creatId);e.negateDefender=!0}ebknC(){this.faction="N",this.rarity="H",this.name="Ebonskull Knight",this.iAttack=this.lValN([9,13,18]),this.iHealth=this.iAttack-2,this.tribe.push("VP"),this.hints=["TL"],this.rtext=`Destroy ${this.name}.`}ebknR(t){const e=f.jr5(t.creatId);O.destroy(e,this.code)}fwcC(){this.faction="U",this.rarity="T",this.maxLevel=1,this.name="Feywing Chrysalis",this.iAttack=0,this.iHealth=3,this.tribe.push("CR"),this.iDefend=!0,this.rtext=`Replace ${this.name} with a 9/9 Feywing.`}fwcR(t){const e=f.jr5(t.creatId);f.birth(`${"FWG"}1`,"R",e.owner,e.lane)}feggC(){this.faction="T",this.rarity="T",this.minLevel=this.level,this.maxLevel=this.level,this.name="Frostmane Egg",this.iAttack=0,this.iHealth=6,this.tribe.push("DG"),this.iDefend=!0,this.rtext=`Replace ${this.name} with a level ${this.level} Frostmane Dragon.`}feggR(t){const e=f.jr5(t.creatId);f.birth(`${"FMD"}${this.level}`,"R",e.owner,e.lane)}mmovC(){this.faction="A",this.rarity="C",this.name="Metamind Overseer",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.hints=["TL"],this.rtext="Draw 2 cards."}mmovR(t){k.drawCard(t.owner,2)}porshC(){this.faction="N",this.rarity="H",this.name="Portal Shade",this.iAttack=this.boof5914,this.iHealth=this.boof71118,this.tribe.push("ST"),this.rtext="Spawn a random creature that was destroyed this game."}porshR(t){const e=O.gravedigger();e&&f.birth(e,"S",t.owner)}runegC(){this.faction="U",this.rarity="H",this.name="Runegrove Guardian",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=["TL"],this.rtext=`${this.name} gets ${m.jr9(this.iAttack,this.iAttack)}.`}runegR(t){f.jr5(t.creatId).buff(this.iAttack,this.iAttack)}solrevC(){this.faction="U",this.rarity="L",this.name="Solstice Reveler",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hints=["TL"];const t=this.solbof;this.rtext=`each friendly creature gets ${m.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}solrevR(t){const e=this.solbof;f.ddf1().forEach(r=>{r.buff(e,e),this.level===3&&(r.breakthrough=!0)})}get solbof(){return this.iAttack/2}spshamC(){this.faction="T",this.rarity="C",this.name="Spiritfrost Shaman",this.iAttack=this.boof71117,this.iHealth=this.boof4610,this.tribe.push("HM"),this.hints=["TL"],this.rtext=`Deal ${this.boof579} damage to the enemy player.`}spshamR(t){k.hurtDirect(!t.owner,this.boof579,this.code)}snoutC(){this.faction="U",this.rarity="C",this.name="Stouthide Stegadon",this.iAttack=this.boof4714,this.iHealth=this.boof71117,this.tribe.push("DN"),this.hints=["TL"],this.rtext=`Heal ${this.snoutbof} damage from ${this.name}.`}snoutR(t){f.jr5(t.creatId).heal(this.snoutbof)}get snoutbof(){return this.level*10}mantisC(){this.faction="U",this.rarity="C",this.name="Umbraglim Mantis",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("IN"),this.hints=["TL"],this.rtext=`You gain ${this.mantbof} health.`}mantisR(t){k.heal(t.owner,this.mantbof)}get mantbof(){return this.lValN([8,10,12])}}class Ei extends P{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Riftlasher",this.iAttack=this.boof359,this.iHealth=this.boof61016,this.tribe.push("FR","EL"),this.text=`When ${this.name} ${m.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.ddp9(0,this.iAttack,0,0)}}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM",this.code);return s.interactive=!0,r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&t.owner===k.getActiveB()}return!1}jr8(t){const e=t.event,r=w.toActions(p.crEnemyActTarg("CARD",this.code,S.enTil(t.creatId,e.dmg)));r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}handleAction(t){const e=S.deTil(t.param);f.ddf6(t).hurtDirect(parseInt(e[1]),this.code),v.actionDone(!0)}}class Ii extends Gt{jr3(t,e){const r=super.jr3(t,e);return r.jr4("AS",this.code),r}jr8(t){if(t.trigger.type==="AS"){let e=!0;for(;e;){const r=f.birth(this.code,"S",t.owner);r?r.opposed&&(e=!1):e=!1}x.triggerDone()}else super.jr8(t)}}class Li extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Scourgeflame Sorcerer",this.iAttack=this.boof358,this.iHealth=this.boof5914,this.tribe.push("ZB");const e=`Destroy an enemy ${m.levelGateText(this.level+1,!0)}creature.`,r=this.level===3?": ":", destroy another friendly creature: ";this.text=`Activate${r}${e}`}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){v.ddf5(this.getCardActions(p.ddf4(),t))}handleAction(t){const e=S.deTil(t.param);if(e[1]==="P1")v.ddf5(this.getCardActions(t));else{this.logAct(!0);const r=f.jr5(e[0]),s=N.tick(),h=f.ddf6(t);if(this.level<3){const u=f.jr5(e[2]);O.destroy(u,this.code,s)}O.destroy(h,this.code,s),r.endActivation()}}friends(t){const e=p.crFriendNotMeActTarg("CARD",t.id,this.code,S.enTil(t.id,"P1"));return w.toActions(e)}enemies(t,e=""){const r=p.crEnemyActTarg("CARD",this.code,S.enTil(t.id,"P2",e));return r.level=w.ddf2(this.level+1),w.toActions(r)}getCardActions(t,e){if(t.key==="ACTV"){const r=e??f.jr5(t.param);let s;return this.level===3?s=this.enemies(r):s=this.friends(r),s.push(v.cancelAction()),s}else if(t.key==="CARD"){const r=S.deTil(t.param),s=f.jr5(r[0]),h=f.ddf6(t),u=this.enemies(s,h.id);return u.push(v.cancelAction()),u}return super.getCardActions(t,e)}}class Gi extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Seismic Adept",this.iAttack=this.boof4712,this.iHealth=this.boof61218,this.tribe.push("HM"),this.text="Activate: Move an enemy creature to another available enemy lane.",this.bonus={exist:this.level*.5}}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){v.ddf5(this.getCardActions(p.ddf4(),t))}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.jr5(e[1]),s=f.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),r.endActivation()}}empties(t,e=""){const r=p.emptyPlayerActTarg("E","CARD",this.code,S.enTil("P2",t.id,e));return w.toActions(r)}enemies(t){const e=p.crEnemyActTarg("CARD",this.code,S.enTil("P1",t.id));return w.toActions(e)}getCardActions(t,e){if(t.key==="ACTV"){const r=e??f.jr5(t.param),s=this.enemies(r);return s.push(v.cancelAction()),s}else if(t.key==="CARD"){const r=f.ddf6(t),s=S.deTil(t.param),h=f.jr5(s[1]),u=this.empties(h,r.id);return u.push(v.cancelAction()),u}return super.getCardActions(t,e)}}class Ne extends P{constructor(t){super(t),this.rarity="R",this.iAttack=this.boof4612,this.iHealth=this.boof61016;const e=this.cardCode();if(e==="SSS"?this.steel():e==="LSS"?this.life():e==="FSS"?this.flame():e==="DSS"&&this.dark(),this.level>1){const r=m.levelGateText(this.level-1);this.text=`When you play a ${r} ${m.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 ${m.jr9(t,t)}`}life(){this.faction="U",this.name="Lifeshaper Savant",this.tribe.push("SE");const t=this.boof135;this.tuxt=`give another friendly creature ${m.jr9(t,t)}`}steel(){this.faction="A",this.name="Steelshaper Savant",this.tribe.push("HM"),this.tuxt=`give another friendly creature Armor ${this.boof124}`}flame(){this.faction="T",this.name="Flameshaper Savant",this.tribe.push("HM"),this.tuxt=`deal ${this.boof147} damage to target creature or player`}jr3(t,e){const r=super.jr3(t,e);if(this.level>1){const s=r.jr4("PC",this.code);s.interactive=!0}return r}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;if(e.playerA===t.owner){const r=I.getCard(e.cardCode);if(r.level0}startActivation(t){const e=this.empties(t);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);f.birth(`${this.hc()}`,"P",t.playerA,t.lane),e.endActivation()}empties(t){const e=p.emptyPlayerActTarg("F","CARD",this.code,t.id);return w.toActions(e)}}class Wi extends P{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Sparkstone Elemental",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("LT","EL"),this.text="Negate Defender from each creature."}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="A",r}enforceEffect(t,e){if(e.status==="A"){const s=p.mod("ND",!0,e.id);f.qActiveCreats().forEach(h=>h.addModSafe(s))}else f.qActiveCreats().forEach(s=>s.removeModSafe(e.id))}}class Ui extends yt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Spiritcleave",this.text=`Destroy a ${m.levelGateText(this.level+1,!0)}creature with the highest health among all creatures.${this.level===3?"~You gain health equal to that creature's health.":""}`}playTargets(){const t=super.playTargets();let e=-1;const r=f.qActiveCreats();r.forEach(u=>{u.health>e&&(e=u.health)});const s=r.filter(u=>u.health===e).map(u=>u.id),h=p.crActTarg("CARD",this.code,"");return h.level=w.ddf2(this.level+1),h.victims=S.enTil(...s),this.level<3&&(h.hint=["KL"]),t.push(h),t}handleAction(t){this.logSpell();const e=f.ddf6(t);O.destroy(e,this.code),this.level===3&&k.heal(k.getActiveB(),e.health),v.spellCast()}}class Vi extends yt{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Spiritleash";const e=this.boof5814;this.text=`Destroy a friendly creature.~Give a creature ${m.jr9(e,e)}.`}playTargets(){const t=super.playTargets(),e=p.crFriendActTarg("CARD",this.code,"P1");return f.creatByTarget(e).length>0&&f.qActiveCreats().length>1&&t.push(e),t}handleAction(t){const e=S.deTil(t.param),r=f.ddf6(t);if(e[0]==="P1"){const s=p.crNotMeActTarg("CARD",r.id,this.code,S.enTil("P2",r.id));s.hint=["BF"];const h=w.toActions(s);h.push(v.cancelAction()),v.ddf5(h)}else{this.logSpell(r);const s=f.jr5(e[1]),h=this.boof5814;O.destroy(s,this.code),r.buff(h,h),v.spellCast()}}}class zi extends P{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Spite Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.tribe.push("HY"),this.text=`When ${this.name} ${m.dbdtac()}, this gets ${m.jr9(this.level,this.level)}.~Allied Tempys: Activate: Deal ${this.level} damage to another creature. This gets ${m.jr9(this.level,this.level)}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r.jr4("DM",this.code),r}zapTargs(t){const e=p.crNotMeActTarg("CARD",t,this.code,t);return e.hint=["HR"],w.toActions([e,w.buttonTarget("CANC")])}canActivate(t){return this.zapTargs(t.id).length>1&&t.hasMod(t.id)}startActivation(t){v.ddf5(this.zapTargs(t.id))}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.logAct(!0),e.hurtDirect(this.level,this.code),r.buff(this.level,this.level),r.endActivation()}jr8(t){const e=f.jr5(t.creatId);t.trigger.type==="FR"?M.allied("T")&&(e.addMod(p.mod("AL",!0,e.id)),e.changed=!0):t.trigger.type==="DM"&&e.buff(this.level,this.level),x.triggerDone()}}class Zi extends P{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Statis Warden",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.text="When you play a spell, give a friendly creature Defender until the end of the enemy player's next turn."}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC",this.code);return s.interactive=!0,r}handleAction(t){const e=f.ddf6(t);this.logAct(!1,e);const r=p.mod("DF",!0,t.param);r.expiry="EN",e.addMod(r),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;return e.playerA===t.owner&&I.getCard(e.cardCode).type==="S"}return!1}jr8(t){const e=p.crFriendNotMeActTarg("CARD",t.creatId,this.code,t.creatId);e.canDefender=!0;const r=w.toActions(e);r.length===0?x.triggerDone():(r.push(v.noneEndTrigger()),v.ddf5(r))}}class Yi extends P{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Steeleye Researcher",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.hints=["RD"],this.bonus={play:.5},this.text=`Upgrade: You may ${m.daluac()}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("UP",this.code);return s.interactive=!0,r}handleAction(t){M.levelAndDiscardA(t),v.actionDone(!0)}jr8(t){const e=p.lvlHandActTarg(this.code,t.creatId),r=w.toActions(e);r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}}class Ki extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steeleye Seer",this.iAttack=0,this.iHealth=this.lValN([8,12,18]),this.iDefend=!0,this.tribe.push("HM"),this.hints=["OL"];let e;this.level===3?(this.text="Activate: Level up a card in your hand. You may use this ability twice each turn.",e=1):(this.text="Activate: Level a card in your hand, then discard it if its level is higher than your Rank.",e=.5),this.bonus={exist:e}}jr3(t,e){const r=super.jr3(t,e);return this.level===3&&(r.jr4("TS",this.code),this.addExtraActivate(r)),r}jr8(t){if(t.trigger.type==="TS"){const e=f.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>I.getCard(r).canLevel())}startActivation(t){const e=p.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),r=k.toPlayer(e.owner);this.level===3||r.rank>parseInt(t.card.slice(3))?r.hand[t.position]=I.getCard(t.card).levelUpCard():M.levelAndDiscardA(t),e.endActivation()}}class Xi extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steelscale Dragon",this.iAttack=this.boof4812,this.iHealth=this.iAttack+2,this.tribe.push("RB","DG"),this.iMobile=this.level;const e=this.boof246;this.addSp("M",e),this.text=`While each other friendly creature has Defender, ${this.name} gets ${m.jr9(this.iAttack,0)}, Armor ${e}, and Breakthrough.`}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("DF",this.code);s.area="C";const h=r.addEffect("PS",this.code);return h.area="C",r}enforceEffect(t,e){const r=p.crNotMeTarg(e.id);if(r.player=k.toTarget(e.owner),f.creatByTarget(r).some(h=>!h.defender))e.removeModSafe(e.id);else{const h=p.mod("AT",this.iAttack,e.id),u=p.mod("AR",this.boof246,e.id),g=p.mod("BT",!0,e.id);e.addModSafe(h),e.addModSafe(u),e.addModSafe(g)}}}class qi extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Storm Bringer",this.iAttack=this.boof5814,this.iHealth=this.boof61018,this.tribe.push("WN","EL");const e=this.boof246;this.addSp("D",e),this.bonus={exist:this.ddp9(0,e+2,0,0)},this.text=`At the start of each turn, ${this.name} moves to an available lane at random. Flank: Deal ${e} damage to the opposing creature.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("TS",this.code),r.jr4("FK",this.code),r}ddf8(t){return t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="TS"){const e=f.emptyLanes(t.owner);e.length>0&&f.jr5(t.creatId).move(e[S.randInt(0,e.length)]),x.triggerDone()}else if(t.trigger.type==="FK"){const r=W.toCreature(t.event).creature.opposed;r&&r.hurtDirect(this.boof246,this.code),x.triggerDone()}else super.jr8(t)}}class ji extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Sulgrim, Herald of Force",this.iAttack=15,this.iHealth=15,this.tribe.push("GL"),this.addSp("M",6),this.text="Activate: Deal damage equal to a friendly creature's Armor to an enemy creature.~Forge: Each friendly creature gets Armor 6."}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=S.deTil(t.param),r=f.ddf6(t);if(e[1]==="P1"){const s=this.enemies(e[0],r.id);s.push(v.cancelAction()),v.ddf5(s)}else if(e[1]==="P2"){const s=f.jr5(e[0]),h=f.jr5(e[2]);this.logAct(!0,h),r.hurtDirect(h.armor,this.code),s.endActivation()}}jr8(t){f.ddf1().forEach(e=>e.addArmor(6)),x.triggerDone()}friends(t){const e=p.crFriendActTarg("CARD",this.code,S.enTil(t,"P1"));return e.hasArmor=!0,w.toActions(e)}enemies(t,e=""){const r=p.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",e));return w.toActions(r)}}class Ji extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Synapsis Oracle",this.iAttack=this.boof358,this.iHealth=this.lValN([9,15,24]),this.tribe.push("HM"),this.hints=["OL"];let e;this.level===3?(this.text="Activate: Level up a card in your hand.",e=1):(this.text=`Activate: ${m.daluac(!0)}.`,e=.5),this.bonus={exist:e}}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>I.getCard(r).canLevel())}startActivation(t){const e=p.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),r=k.toPlayer(e.owner);this.level===3?r.hand[t.position]=I.getCard(t.card).levelUpCard():M.levelAndDiscardA(t),e.endActivation()}}class Qi extends bt{jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}jr8(t){if(t.trigger.type==="FR"){const e=t.owner?M.deathsA.length:M.deathsB.length;if(e>0){const r=N.tick();for(let s=0;s0}getCardActions(t,e){return w.toActions(p.crEnemyActTarg("CARD",this.code,"P2"))}}class ts extends P{constructor(t){super(t),this.rarity="C",this.faction="U",this.name="Toorgmai Mender",this.tribe.push("PL"),this.iAttack=this.lValN([2,5,9]),this.iHealth=this.iAttack+3,this.text=`Forge: Give a creature or player ${m.jr9(0,this.iHealth)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}jr8(t){const e=p.crActTarg("CARD",this.code,"");e.hint=["BF"];const r=p.actionTarget("TP","CARD",this.code,"");r.hint=["BF"];const s=[e,r,w.buttonTarget("NOTR")],h=w.toActions(s);v.ddf5(h)}handleAction(t){if(t.zone==="P")k.heal(t.playerA,this.iHealth);else{const e=f.ddf6(t);this.logAct(!1,e),e.buff(0,this.iHealth)}v.actionDone(!0)}}class Ze extends P{lookup(t){return{["SSD"]:{c:()=>this.ssdC(),t:r=>this.ssdT(r)},["SOL"]:{c:()=>this.stagC(),t:r=>this.stagT(r)},["WTK"]:{c:()=>this.tinkC(),t:r=>this.tinkT(r)}}[t]}mPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("TE",this.code),r}ddf8(t){return t.trigger.type==="TE"&&this.validPlayer(t)}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=t.event;return this.mPlayer===1?e.playerA===t.owner:e.playerA!==t.owner}ssdC(){this.faction="T",this.rarity="L",this.name="Smolderscale Dragon",this.iAttack=this.lValN([0,3,15]),this.iHealth=this.lValN([6,13,30]),this.tribe.push("DG"),this.level===3?this.iMobile=2:this.iDefend=!0,this.mPlayer=1;const t=this.boof135;this.text=`At the end of your turn, deal ${t} damage to each enemy creature.`}ssdT(t){const e=f.qEnemyCreats();if(e.length>0){const r=N.tick(),s=this.boof135;e.forEach(h=>h.hurtDirect(s,this.code,r))}}stagC(){this.faction="U",this.rarity="C",this.name="Stag of Lys",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("ST"),this.mPlayer=1;const t=this.boof246;this.text=`At the end of your turn, gain ${t} health.`}stagT(t){k.heal(t.owner,this.boof246)}tinkC(){this.faction="A",this.rarity="H",this.name="War Tinker",this.iAttack=this.level,this.iHealth=this.boof4812,this.tribe.push("GN"),this.mPlayer=-1,this.bonus={exist:this.ddp6()},this.text=`At the end of the enemy player's turn, replace ${this.name} with a copy of a random Robot from your deck.`}tinkT(t){const e=p.target("DK");e.player=k.toTarget(t.owner),e.tribe="RB";const r=w.deckByTarget(e),s=r.length;if(s>0){const h=r[S.randInt(0,s)][0],u=f.jr5(t.creatId);f.birth(h,"R",u.owner,u.lane)}}}class Ot extends P{lookup(t){return{["DCS"]:{c:()=>this.delphC(),t:r=>this.delphT(r)},["GMP"]:{c:()=>this.gmpC(),t:r=>this.gmpT(r)},["LBL"]:{c:()=>this.lbcC(),t:r=>this.lbcT(r)},["SBF"]:{c:()=>this.sfangC(),t:r=>this.sfangT(r)},["SSE"]:{c:()=>this.sseC(),t:r=>this.sseT(r)},["SPD"]:{c:()=>this.spdC(),t:r=>this.spdT(r)},["SPM"]:{c:()=>this.spmC(),t:r=>this.spmT(r)},["TBA"]:{c:()=>this.tbaC(),t:r=>this.tbaT(r)},["VCG"]:{c:()=>this.vgC(),t:r=>this.vgT(r)},["WBG"]:{c:()=>this.woeC(),t:r=>this.woeT(r)},["ZSH"]:{c:()=>this.zyxC(),t:r=>this.zyxT(r)}}[t]}bothTurns=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);r.jr4("TS",this.code);const s=St.extractCardCode(this.code);return(s==="ZSH"||s==="SBF")&&(r.extraBattles=1),r}ddf8(t){return t.trigger.type==="TS"?this.bothTurns?!0:t.event.playerA===t.owner:!1}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}delphC(){this.faction="A",this.rarity="L",this.name="Delpha, Chronosculptor",this.iAttack=this.boof7914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.level>1&&(this.hints=["OL"],this.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 e=k.toPlayer(t.owner),r=e.hand.map((h,u)=>{const g=I.getCard(h);return{idx:u,lvl:g.level,nxt:g.canLevel()?g.levelUpCard():""}}).filter(h=>h.nxt&&(this.level===3||h.lvl===1)),s=r.length;if(s>0){const h=r[S.randInt(0,s)];e.hand[h.idx]=h.nxt}}}gmpC(){this.faction="A",this.rarity="L",this.name="Ghox, Metamind Paragon",this.iAttack=this.boof4814,this.iHealth=this.boof61218,this.tribe.push("MM"),this.hints=["OL"];const t=this.level===1?"":"s";this.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){k.drawCard(t.owner,this.level)}lbcC(){this.faction="U",this.rarity="R",this.name="Lightbringer Cleric",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hints=["OL"],this.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){k.heal(t.owner,S.randInt(this.boof137,this.boof5914))}sfangC(){this.faction="T",this.rarity="H",this.name="Saberfang",this.iAttack=this.boof246,this.iHealth=1,this.iAggro=!0,this.tribe.push("CT"),this.text=`${this.name} battles an additional time on your turn.`}sfangT(t){const e=f.jr5(t.creatId);e.extraBattles+=1}sseC(){this.faction="U",this.rarity="L",this.name="Scatterspore Eidolon",this.iAttack=8,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=["DL"];const t=this.boof357,e=U.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} ${e}.`}sseT(t){const e=this.lValS(["SXD","SXP","SXT"])+this.level.toString();f.birth(e,"S",t.owner)}spdC(){this.faction="U",this.rarity="R",this.name="Shardplate Delver",this.iAttack=this.boof4612,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OL"];const t=this.boof246;this.bonus={exist:this.ddp9(0,t*2,t,0)},this.text=`At the start of your turn, ${this.name} gets ${m.jr9(t,t)}.`}spdT(t){const e=this.boof246;f.jr5(t.creatId).buff(e,e)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.iAttack=this.boof91421,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["OP"],this.text="At the start of your turn, randomly discard down to two cards in your hand."}spmT(t){const e=k.toPlayer(t.owner);if(e.hand.length>2){let r=e.hand.slice(),s=[];for(;r.length>2;)s.push(r.splice(S.randInt(0,r.length),1)[0]);e.discard.push(...s),e.hand=r}}tbaC(){this.faction="U",this.rarity="L",this.name="Talisin, Bard of Abundance",this.iAttack=this.lValN([8,12,16]),this.iHealth=this.lValN([10,14,20]),this.tribe.push("SY"),this.bothTurns=this.lValB([!0,!0,!1]),this.hints=["OL"],this.level===3&&(this.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){M.regularPlays+=1}vgC(){this.faction="T",this.rarity="C",this.name="Volcanic Giant",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("ER","GT"),this.hints=["OL"],this.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 e=S.randInt(this.boof137,this.boof5914);k.hurtDirect(!t.owner,e,this.code)}woeC(){this.faction="N",this.rarity="L",this.name="Woebringer",this.iAttack=this.lValN([7,10,18]),this.iHealth=this.boof5815,this.tribe.push("AB"),this.text=`At the start of your turn, destroy the ${this.level===3?"enemy ":""}creature with the lowest attack. If there is a tie, one is chosen at random.`}woeT(t){const e=p.crTarg();this.level===3&&(e.player=k.toTarget(!t.owner));const r=f.creatByTarget(e);let s=99999,h=[];r.forEach(g=>{g.attack===s?h.push(g):g.attack0){const g=h[S.randInt(0,u)];O.destroy(g,this.code)}}zyxC(){this.faction="T",this.rarity="L",this.name="Zyx, Storm Herald",this.iAttack=this.boof4712,this.iHealth=this.lValN([6,9,20]),this.iMobile=1,this.tribe.push("LT","AS"),this.text="Zyx battles an additional time on your turn."}zyxT(t){const e=f.jr5(t.creatId);e.extraBattles+=1}}class es extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Tuskin Sporelord",this.iAttack=this.lValN([2,6,10]),this.iHealth=this.lValN([10,14,18]),this.tribe.push("TK"),this.text=`Activate: Put a copy of friendly ${m.levelGateText(this.level,!0)}Plant into an available lane.`,this.bonus={exist:this.ddp6(this.level)/2}}canActivate(t){return this.emptySloots(t.id).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=this.emptySloots(e[1],r.code);s.push(v.cancelAction()),v.ddf5(s)}else{const r=f.jr5(e[1]),s=f.birth(e[2],"P",r.owner,t.lane);this.logAct(!0,s),r.endActivation()}}emptySloots(t,e=""){const r=p.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P2",t,e));return w.toActions(r)}buddies(t){const e=p.crFriendActTarg("CARD",this.code,S.enTil("P1",t));return e.tribe="PL",e.level=w.ddf2(this.level),w.toActions(e)}}class or extends yt{constructor(t){super(t),this.faction="A",t==="PRI"+"1"?(this.rarity="R",this.name="Perilous Insight",this.maxLevel=1,this.overload=!0):(this.rarity="C",this.name="Metasight",this.maxLevel=2,this.isFree=this.level===2),this.text="Discard and level up two cards."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(v.shiftPlayCard(t.position),t.param==="P1"){this.logSpell(),M.levelAndDiscardA(t);const e=this.targParty("P2"),r=w.toActions(e);r.length===0?v.spellCast():v.ddf5(r)}else M.levelAndDiscardA(t),v.spellCast()}targParty(t){const e=p.lvlHandActTarg(this.code,t);return e.deckPositionSkip=v.playPosition(),e}}class Me extends yt{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(r,s)=>this.confZ(r,s)},["CSG"]:{c:()=>this.cystgC(),z:(r,s)=>this.cystgZ(r,s)},["GRN"]:{c:()=>this.grenC(),z:(r,s)=>this.grenZ(r,s)},["TWG"]:{c:()=>this.twstrC(),z:(r,s)=>this.twstrZ(r,s)}}[t]}cardCast(t,e,r){this.lookup(t).z(e,r)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",f.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const e=S.deTil(t.param),r=f.ddf6(t);if(e[0]==="P1"){this.playTarg.notMe=r.id,this.playTarg.param=S.enTil("P2",r.id);const s=w.toActions([this.playTarg,w.buttonTarget("CANC")]);v.ddf5(s)}else{const s=f.jr5(e[1]);this.xl?this.logSpell(s,r):this.logSpell(),this.cardCast(this.cardCode(),s,r),v.spellCast()}}confC(){this.faction="T",this.rarity="C",this.name="Conflagrate",this.xl=!1,this.text=`Deal ${this.boof369} to two enemy creatures.`,this.playTarg.player="E"}confZ(t,e){const r=N.tick(),s=this.boof369;t.hurtDirect(s,this.code,r),e.hurtDirect(s,this.code,r)}cystgC(){this.faction="A",this.rarity="C",this.name="Cypien Steelgraft",this.text=`Two friendly creatures get Armor ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canArmor=!0}cystgZ(t,e){const r=this.boof246;t.addArmor(r),e.addArmor(r)}grenC(){this.faction="N",this.rarity="C",this.name="Ghastly Renewal",this.text=`Give two friendly creatures Regenerate ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canRegen=!0}grenZ(t,e){const r=this.boof246;t.addRegen(r),e.addRegen(r)}get tsboof(){return this.level+2}twstrC(){this.faction="U",this.rarity="C",this.name="Twinstrength";const t=this.tsboof;this.text=`Two friendly creatures get ${m.jr9(t,t)}.`,this.playTarg.player="F"}twstrZ(t,e){const r=this.tsboof;t.buff(r,r),e.buff(r,r)}}class rs extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Umbruk Icecrusher",this.iAttack=this.boof61014,this.iHealth=this.boof246,this.tribe.push("DN"),this.bonus={exist:this.ddp9(0,5,this.iAttack+2,0)},this.text=`When ${this.name} ${m.dbdtap()}, deal that much damage to that player.~Allied Uterra: This gets ${m.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR"){if(M.allied("U")){const e=f.jr5(t.creatId);e.breakthrough=!0,e.buff(2,2)}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event;k.hurtDirect(e.target,e.dmg,this.code),x.triggerDone()}}}class is extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Umbruk Lasher",this.iAttack=this.boof71014,this.iHealth=this.iAttack-1,this.iBT=!0,this.tribe.push("DN"),this.text=`Allied Tempys: When ${this.name} ${m.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.ddp9(0,this.iAttack,0,0)}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}handleAction(t){f.ddf6(t).hurtDirect(parseInt(t.param),this.code),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}return!1}jr8(t){if(t.trigger.type==="FR"){if(M.allied("T")){const e=f.jr5(t.creatId),r=e.jr4("DM",this.code);r.interactive=!0,e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,r=w.toActions(p.crEnemyActTarg("CARD",this.code,e.dmg.toString()));r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}}}class Re extends P{lookup(t){return{["CBB"]:{c:()=>this.cindC(),f:r=>this.cindF(r)},["EBW"]:{c:()=>this.ebwC(),f:r=>this.ebwF(r)},["IBR"]:{c:()=>this.ibrfC(),f:r=>this.ibrfF(r)},["SBI"]:{c:()=>this.sbiC(),f:r=>this.sbiF(r)}}[t]}targAction(t,e){this.lookup(t).f(e)}enemy=!1;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text=`Forge: If you are rank ${this.level+1} or higher, `+this.ftext,this.ftext=""}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}handleAction(t){const e=f.ddf6(t);this.targAction(this.cardCode(),e),v.actionDone(!0)}jr8(t){if(f.jr5(t.creatId).rank>this.level){const r=p.crActTarg("CARD",this.code,t.creatId);this.enemy?r.player="E":r.hint=["BF"];const s=w.toActions(r);s.length>0?v.ddf5(s):x.triggerDone()}else x.triggerDone()}ebwC(){this.faction="N",this.rarity="C",this.name="Ebonbound Warlord",this.iAttack=this.boof3714,this.iHealth=this.iAttack+4,this.tribe.push("VP"),this.enemy=!0;const t=this.boof369n;this.ftext=`give an enemy creature ${m.jr9(t,t)}.`}ebwF(t){this.logAct(!1,t);const e=this.boof369n;t.buff(e,e)}sbiC(){this.faction="U",this.rarity="C",this.name="Shardbound Invoker",this.iAttack=this.boof4714,this.iHealth=this.iAttack+1,this.tribe.push("TK");const t=this.boof359;this.ftext=`give a creature ${m.jr9(t,t)}.`}sbiF(t){this.logAct(!1,t);const e=this.boof359;t.buff(e,e)}cindC(){this.faction="T",this.rarity="C",this.name="Cinderbound Barbarian",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("FR","AS");const t=this.boof6912;this.enemy=!0,this.ftext=`deal ${t} damage to an enemy creature.`}cindF(t){t.hurtDirect(this.boof6912,this.code)}ibrfC(){this.faction="A",this.rarity="C",this.name="Ironbound Reinforcements",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("GN");const t=this.boof5812;this.ftext=`give a creature ${m.jr9(t,0)}.`}ibrfF(t){this.logAct(!1,t),t.buff(this.boof5812,0)}}class ss extends P{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Uranti Elementalist",this.iAttack=this.boof4712,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.text=`Forge: You may move another friendly creature to an available lane adjacent to ${this.name}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}jr8(t){const e=f.jr5(t.creatId);if(this.emptySloots(e).length>0){const r=p.crFriendNotMeActTarg("CARD",e.id,this.code,S.enTil("P1",e.id)),s=w.toActions(r);s.length>0?(s.push(v.noneEndTrigger()),v.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.jr5(e[1]);this.logAct(!1,r),r.move(t.lane),v.actionDone(!0)}}emptySloots(t,e=""){return v.emptyAdjacents(t,S.enTil("P2",e))}getCardActions(t,e){const r=S.deTil(t.param),s=f.ddf6(t),h=f.jr5(r[1]),u=this.emptySloots(h,s.id);return u.push(v.cancelAction()),u}}class as extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Uranti Heartseeker",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("YT"),this.addSp("D",this.iAttack),this.text=`Activate: Deal ${this.iAttack} damage to an enemy creature or player with exactly ${this.iAttack} health.`}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){const e=this.findVictims(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){if(t.zone==="F"){const r=f.ddf6(t);this.logAct(!0,r),r.hurtDirect(this.iAttack,this.code)}else{this.logAct(!0);const r=t;k.hurtDirect(r.playerA,this.iAttack,this.code)}f.jr5(t.param).endActivation()}findVictims(t){const e=this.iAttack,r=p.crEnemyTarg(),h=f.creatByTarget(r).filter(g=>g.health===e).map(g=>p.fieldSelectAction("CARD",g.lane,g.owner)),u=k.toPlayer("E");return u.health===e&&h.push(p.playerSelectAction("CARD",u.isPlayerA)),h.forEach(g=>{g.host=this.code,g.param=t}),h}}class ns extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Vaerus, Herald of Fury",this.iAttack=15,this.iHealth=12,this.iMobile=2,this.tribe.push("DG"),this.hints=["OL"],this.text="Each friendly creature battles an additional time on each of your turns.",this.bonus={exist:this.ddp9(0,0,30,0)}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("EF",this.code),r.jr4("TS",this.code),r}ddf8(t){if(t.event.code==="ENT"){const e=W.toCreature(t.event);return t.owner===e.creature.owner&&t.owner===k.getActiveB()}else if(t.event.code==="TRS")return t.event.playerA===t.owner;return!1}giveXtra(t,e){t.hasMod(e)||(t.extraBattles+=1,t.addMod(p.mod("TK",!0,e)))}jr8(t){if(t.event.code==="ENT"){const e=W.toCreature(t.event);e.creature.id===t.creatId?f.ddf1().forEach(r=>{this.giveXtra(r,t.creatId)}):bt.itBirthedFirst(e.creature.id,t.creatId)&&this.giveXtra(e.creature,t.creatId)}else t.event.code==="TRS"&&f.ddf1().forEach(e=>{e.extraBattles+=1,e.hasMod(t.creatId)||e.addMod(p.mod("TK",!0,t.creatId))});x.triggerDone()}}class G extends P{constructor(t){super(t),this.cardConstruct(this.cardCode())}cardConstruct(t){({["AEN"]:()=>this.anvenf(),["AGU"]:()=>this.avguard(),["BTH"]:()=>this.batthid(),["BBB"]:()=>this.bart(),["BLW"]:()=>this.blitwi(),["BWG"]:()=>this.brambleguard(),["CHY"]:()=>this.cavernhyd(),["CDC"]:()=>this.cindcol(),["CNM"]:()=>this.cindmy(),["CTG"]:()=>this.citg(),["CWK"]:()=>this.crag(),["DBP"]:()=>this.prowler(),["DMR"]:()=>this.raptor(),["DBR"]:()=>this.bearride(),["DTD"]:()=>this.dmaw(),["DSZ"]:()=>this.duskzomb(),["FWB"]:()=>this.fangbear(),["FWR"]:()=>this.ravager(),["FFG"]:()=>this.ffang(),["FMS"]:()=>this.firemane(),["FPR"]:()=>this.flop(),["FGA"]:()=>this.falpha(),["FGB"]:()=>this.fbeta(),["FGO"]:()=>this.fomega(),["FPM"]:()=>this.minot(),["FPS"]:()=>this.forgeplate(),["GGE"]:()=>this.geist(),["GGH"]:()=>this.ghast(),["GGS"]:()=>this.ggs(),["GCL"]:()=>this.glacial(),["IWC"]:()=>this.warcharger(),["LWY"]:()=>this.lwyrm(),["LHY"]:()=>this.lyshyd(),["KDC"]:()=>this.kadc(),["MRF"]:()=>this.marrow(),["MMI"]:()=>this.mmin(),["MMO"]:()=>this.mmop(),["NGW"]:()=>this.narg(),["NCW"]:()=>this.necrotic(),["NXC"]:()=>this.nexcore(),["NAM"]:()=>this.nyam(),["OBD"]:()=>this.battledroid(),["OSP"]:()=>this.oss(),["OSL"]:()=>this.ogsl(),["PRG"]:()=>this.perd(),["RHY"]:()=>this.ravh(),["RHC"]:()=>this.rime(),["RSP"]:()=>this.runprim(),["SCS"]:()=>this.scorp(),["SCD"]:()=>this.scout(),["SFT"]:()=>this.scrap(),["SBA"]:()=>this.sparkblade(),["SKB"]:()=>this.sparkbot(),["SBR"]:()=>this.sparkass(),["STM"]:()=>this.sparkman(),["SSN"]:()=>this.sfsent(),["SMN"]:()=>this.steam(),["SGI"]:()=>this.stonefist(),["SCL"]:()=>this.stormcall(),["SMA"]:()=>this.ancient(),["SML"]:()=>this.lurker(),["TGS"]:()=>this.tsprout(),["TGN"]:()=>this.tgnome(),["TWS"]:()=>this.tscout(),["TWT"]:()=>this.tund(),["URD"]:()=>this.unrelenting(),["VBK"]:()=>this.vblock(),["VTC"]:()=>this.vtech(),["WTW"]:()=>this.waterwalk(),["WPD"]:()=>this.windprime(),["XCR"]:()=>this.xithcrush(),["XHU"]:()=>this.hulk(),["YWC"]:()=>this.yetiwar(),["ZIN"]:()=>this.zombinf()})[t]()}sist(){this.rarity="R",this.level===1?this.hints=["LV"]:this.consistent=!0}ancient(){this.faction="U",this.rarity="C",this.name="Swampmoss Ancient",this.iAttack=this.lValN([7,12]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.maxLevel=2}anvenf(){this.faction="A",this.rarity="C",this.name="Anvillon Enforcer",this.iAttack=this.boof5711,this.iHealth=this.iAttack-1,this.iArmor=this.boof246,this.tribe.push("RB")}avguard(){this.faction="T",this.rarity="R",this.name="Avalanche Guardian",this.iAttack=this.boof5915,this.iHealth=this.lValN([8,15,23]),this.iMobile=1,this.iDefend=!0,this.tribe.push("IC","EL")}bart(){this.faction="U",this.rarity="H",this.name="Big Bad Bartok",this.iAttack=this.level+8,this.iHealth=this.iAttack,this.consistent=!0,this.hints=["DL"],this.tribe.push("TG")}batthid(){this.faction="U",this.name="Batterhide",this.iAttack=this.boof3814,this.iHealth=this.iAttack+3,this.sist(),this.iBT=!0,this.tribe.push("DN")}battledroid(){this.faction="A",this.rarity="H",this.name="Oreian Battledroid",this.iAttack=this.lValN([5,7,17]),this.iHealth=1,this.iArmor=this.iAttack,this.tribe.push("RB")}bearride(){this.faction="U",this.rarity="C",this.name="Deepwood Bear Rider",this.iAttack=this.lValN([5,16,18]),this.iHealth=this.lValN([2,8,10]),this.tribe.push("LP")}blitwi(){this.faction="N",this.name="Blight Witch",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.boof71117,this.sist(),this.iRegen=this.boof234,this.tribe.push("ZB")}brambleguard(){this.faction="U",this.rarity="C",this.name="Bramblewood Guardian",this.iAttack=this.boof2612,this.iHealth=this.lValN([9,14,24]),this.tribe.push("PL")}cavernhyd(){this.faction="U",this.rarity="C",this.name="Cavern Hydra",this.iAttack=this.boof4711,this.iHealth=this.boof71015,this.iRegen=this.boof135,this.tribe.push("HY")}cindcol(){this.faction="T",this.rarity="C",this.name="Cinder Colossus",this.iAttack=this.lValN([3,13,24]),this.iHealth=this.lValN([4,14,27]),this.iDefend=!0,this.level===1&&(this.hints=["LV"]),this.tribe.push("ER","EL")}cindmy(){this.faction="T",this.rarity="C",this.name="Cinder Mystic",this.iAttack=this.lValN([4,11,21]),this.iHealth=this.boof3714,this.tribe.push("FR","AS")}citg(){this.faction="A",this.rarity="C",this.name="Citadel Guard",this.iAttack=this.lValN([8,12,25]),this.iHealth=this.lValN([9,13,30]),this.iDefend=!0,this.tribe.push("RB")}crag(){this.faction="T",this.rarity="C",this.name="Crag Walker",this.iAttack=this.lValN([7,12,18]),this.iHealth=this.boof246,this.iMobile=1,this.tribe.push("DN")}dmaw(){this.faction="N",this.rarity="L",this.name="Duskmaw, Twilight Drake",this.iAttack=this.boof61017,this.iHealth=this.boof5915,this.iMobile=1,this.tribe.push("ST","DG")}duskzomb(){this.faction="N",this.rarity="C",this.name="Duskspire Zombie",this.iAttack=this.lValN([2,5,16]),this.iHealth=this.lValN([5,8,19]),this.iRegen=4,this.tribe.push("ZB")}falpha(){this.faction="A",this.rarity="C",this.name="Forge Guardian Alpha",this.iAttack=this.lValN([4,8,20]),this.iHealth=this.lValN([8,14,26]),this.iDefend=!0,this.tribe.push("RB","GD")}fangbear(){this.faction="U",this.rarity="C",this.name="Fangwood Bear",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("BR")}fbeta(){this.faction="A",this.rarity="R",this.name="Forge Guardian Beta",this.iAttack=this.lValN([5,8,20]),this.iHealth=this.lValN([3,6,18]),this.iArmor=this.boof124,this.tribe.push("RB","GD")}ffang(){this.faction="U",this.rarity="C",this.name="Featherfang",this.iAttack=this.boof61218,this.iHealth=this.boof4812,this.tribe.push("DN")}firemane(){this.faction="T",this.rarity="C",this.name="Firemane Steed",this.iAttack=this.lValN([3,6,16]),this.iHealth=this.lValN([6,9,19]),this.iMobile=2,this.tribe.push("FR","EL")}flop(){this.faction="T",this.rarity="C",this.name="Flowstone Primordial",this.iAttack=this.lValN([6,7,15]),this.iHealth=this.iAttack+1,this.tribe.push("FR","EL")}fomega(){this.faction="A",this.rarity="L",this.name="Forge Guardian Omega",this.iAttack=this.boof255080,this.iHealth=this.iAttack,this.iMobile=this.boof124,this.iArmor=this.iMobile*10,this.iBT=!0,this.iAggro=!0,this.consistent=!0,this.tribe.push("RB","GD")}forgeplate(){this.faction="A",this.rarity="C",this.name="Forgeplate Sentry",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iArmor=this.boof135,this.tribe.push("RB")}ggs(){this.faction="N",this.rarity="C",this.name="Grimgaunt Spectre",this.iAttack=this.lValN([3,11,14]),this.iHealth=this.iAttack,this.iMobile=1,this.hints=["LV"],this.tribe.push("GG")}geist(){this.faction="N",this.rarity="C",this.name="Grave Geist",this.iAttack=this.boof71118,this.iHealth=this.boof4711,this.tribe.push("ST")}ghast(){this.faction="N",this.rarity="C",this.name="Grave Ghast",this.iHealth=this.boof71013,this.iAttack=this.iHealth-2,this.iRegen=this.boof246,this.tribe.push("ZB")}glacial(){this.faction="T",this.rarity="C",this.name="Glacial Colossus",this.iAttack=this.boof61016,this.iHealth=this.lValN([8,13,19]),this.tribe.push("IC","EL"),this.iDefend=!0}hulk(){this.faction="N",this.rarity="C",this.name="Xithian Hulk",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("AB")}kadc(){this.faction="T",this.rarity="C",this.name="Kadras Colossus",this.iAttack=this.lValN([6,11,13]),this.iHealth=this.iAttack,this.tribe.push("GT"),this.hints=["DL"]}lurker(){this.faction="U",this.rarity="C",this.name="Swampmoss Lurker",this.iAttack=this.lValN([8,13,22]),this.iHealth=this.lValN([4,6,15]),this.tribe.push("DN")}lwyrm(){this.faction="T",this.rarity="C",this.name="Lightning Wyrm",this.iAttack=this.boof4711,this.iHealth=this.boof258,this.tribe.push("LT","EL"),this.iAggro=!0}lyshyd(){this.faction="U",this.rarity="C",this.name="Lysian Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.level,this.tribe.push("HY")}marrow(){this.faction="N",this.rarity="C",this.name="Marrow Fiend",this.iAttack=this.boof81117,this.iHealth=this.lValN([1,5,13]),this.tribe.push("SK")}minot(){this.faction="A",this.name="Forgeplate Minotaur",this.iAttack=this.lValN([2,8,16]),this.iHealth=this.lValN([4,9,17]),this.sist(),this.iArmor=this.level,this.tribe.push("RB")}mmin(){this.faction="A",this.rarity="C",this.name="Metamind Infiltrator",this.iAttack=this.boof5917,this.iHealth=this.iAttack-1,this.tribe.push("MM")}mmop(){this.faction="A",this.rarity="C",this.name="Metamind Operator",this.iAttack=this.boof4610,this.iHealth=this.lValN([10,14,18]),this.tribe.push("MM")}narg(){this.faction="T",this.rarity="C",this.name="Nargath Warrior",this.iAttack=this.boof51014,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS")}necrotic(){this.faction="N",this.rarity="C",this.name="Necrotic Wurm",this.iAttack=this.lValN([4,7,18]),this.iHealth=this.lValN([5,8,19]),this.tribe.push("WR")}nexcore(){this.faction="A",this.rarity="C",this.name="Nexus Core",this.iAttack=0,this.iHealth=this.lValN([15,25,40]),this.tribe.push("RB"),this.iDefend=!0}nyam(){this.faction="N",this.rarity="C",this.name="Nyrali Ambusher",this.iAttack=this.boof71117,this.iHealth=this.lValN([3,6,13]),this.tribe.push("OZ")}ogsl(){this.faction="U",this.rarity="C",this.name="Overgrown Spineleaf",this.iAttack=this.lValN([6,12,16]),this.iHealth=this.boof4812,this.tribe.push("PL")}oss(){this.faction="N",this.rarity="R",this.name="Ossuary Spirit",this.iAttack=this.lValN([1,3,6]),this.iHealth=this.boof91420,this.iRegen=this.iAttack+2,this.tribe.push("ST")}perd(){this.faction="N",this.rarity="C",this.name="Perdition Guard",this.iAttack=this.lValN([3,12,15]),this.iHealth=this.iAttack-1,this.tribe.push("NG")}prowler(){this.faction="U",this.rarity="C",this.name="Deepbranch Prowler",this.iAttack=this.lValN([8,9,10]),this.iHealth=this.iAttack,this.tribe.push("CT"),this.hints=["DL"],this.iBT=!0}raptor(){this.faction="U",this.rarity="C",this.name="Deepmoss Raptor",this.iAttack=this.lValN([2,13,16]),this.iHealth=this.iAttack,this.level===1&&(this.hints=["LV","RT"]),this.tribe.push("DN")}ravager(){this.faction="U",this.rarity="C",this.name="Fangwood Ravager",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("BE")}ravh(){this.faction="U",this.rarity="C",this.name="Ravenous Hydra",this.iAttack=this.boof5813,this.iHealth=this.iAttack+this.level,this.iRegen=this.level,this.iBT=!0,this.tribe.push("HY")}rime(){this.faction="T",this.rarity="C",this.name="Rimehorn Charger",this.iAttack=this.lValN([5,8,10]),this.iHealth=this.iAttack+3,this.iMobile=1,this.hints=["DL"],this.tribe.push("RM")}runprim(){this.faction="T",this.name="Runestorm Primordial",this.iAttack=this.boof3714,this.iHealth=this.iAttack-1,this.sist(),this.iAggro=!0,this.tribe.push("LT","EL")}scorp(){this.faction="N",this.rarity="C",this.name="Scavenger Scorpion",this.iAttack=this.lValN([6,9,11]),this.iHealth=this.iAttack,this.iRegen=this.level,this.hints=["DL"],this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.isFree=this.level>1,this.hints=[this.level===1?"LV":"DL"],this.tribe.push("RB")}scrap(){this.faction="A",this.rarity="H",this.name="Scrapforge Titan",this.iAttack=this.lValN([1,5,20]),this.iHealth=this.iAttack,this.iArmor=this.lValN([1,5,10]),this.level===1&&(this.hints=["LV","RT"]),this.tribe.push("RB")}sfsent(){this.faction="A",this.rarity="C",this.name="Spiritforge Sentinel",this.iAttack=this.lValN([3,6,9]),this.iHealth=this.iAttack*2,this.iArmor=this.lValN([1,2,6]),this.tribe.push("RB")}sparkbot(){this.faction="A",this.rarity="C",this.name="Spark Bot",this.iAttack=this.boof5914,this.iHealth=this.lValN([6,11,16]),this.tribe.push("RB")}sparkblade(){this.faction="A",this.rarity="C",this.name="Sparkblade Assassin",this.iAttack=this.lValN([4,12,14]),this.iHealth=this.lValN([5,13,15]),this.tribe.push("HM")}sparkass(){this.faction="T",this.rarity="C",this.name="Sparkbrand Asir",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.lValN([6,11,13]),this.iAggro=!0,this.tribe.push("LT","AS")}sparkman(){this.faction="T",this.rarity="R",this.name="Sparktail Manticore",this.iAttack=this.boof369,this.iHealth=this.boof71116,this.iAggro=!0,this.iMobile=1,this.tribe.push("MT")}steam(){this.faction="T",this.rarity="C",this.name="Steam Sentinel",this.iAttack=this.lValN([8,14,20]),this.iHealth=this.boof61016,this.iDefend=!0,this.tribe.push("WT","EL")}stonefist(){this.faction="T",this.rarity="C",this.name="Stonefist Giant",this.iAttack=this.lValN([3,7,16]),this.iHealth=this.lValN([6,10,24]),this.tribe.push("ER","EL")}stormcall(){this.faction="T",this.rarity="C",this.name="Storm Caller",this.iAttack=this.lValN([8,11,14]),this.iHealth=this.iAttack-2,this.tribe.push("WN","AS")}tgnome(){this.faction="A",this.rarity="C",this.name="Technognome",this.iAttack=this.lValN([3,9,19]),this.iHealth=this.iAttack,this.level===1&&(this.hints=["LV"]),this.tribe.push("GN")}tscout(){this.faction="A",this.rarity="C",this.name="Tower Scout",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("HM")}tund(){this.faction="A",this.rarity="C",this.name="Tundra Watcher",this.iAttack=this.lValN([5,10,12]),this.iHealth=this.lValN([8,11,13]),this.hints=["DL"],this.tribe.push("RB")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.iAttack=this.boof7911,this.iHealth=this.iAttack+1,this.hints=["DL"],this.tribe.push("PL")}unrelenting(){this.faction="N",this.rarity="H",this.name="Unrelenting Dead",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.iRegen=this.iAttack,this.tribe.push("ZB")}vblock(){this.faction="A",this.rarity="R",this.name="Vault Blockade",this.iAttack=0,this.iHealth=this.boof135,this.iArmor=this.boof101520,this.iDefend=!0,this.tribe.push("RB")}vtech(){this.faction="A",this.rarity="C",this.name="Vault Technician",this.iAttack=this.boof61218,this.iHealth=this.boof3915,this.tribe.push("HM")}warcharger(){this.faction="A",this.rarity="C",this.name="Ionic Warcharger",this.iAttack=this.boof4915,this.iHealth=this.lValN([7,12,18]),this.iMobile=1,this.tribe.push("RB")}waterwalk(){this.faction="T",this.rarity="C",this.name="Water Walker",this.iAttack=this.lValN([5,12,14]),this.iHealth=this.lValN([2,9,11]),this.tribe.push("WT","AS")}windprime(){this.faction="T",this.rarity="C",this.name="Wind Primordial",this.iHealth=this.boof4814,this.iAttack=this.iHealth+2,this.iMobile=this.level,this.tribe.push("WN","EL")}xithcrush(){this.faction="N",this.rarity="C",this.name="Xithian Crusher",this.iAttack=this.lValN([4,10,16]),this.iHealth=this.iAttack+2,this.tribe.push("AB")}yetiwar(){this.faction="T",this.rarity="C",this.name="Yeti Warcaller",this.iAttack=this.boof248,this.iHealth=this.lValN([10,15,23]),this.tribe.push("YT")}zombinf(){this.faction="N",this.rarity="C",this.name="Zombie Infantry",this.iAttack=this.boof61015,this.iHealth=this.iAttack-1,this.tribe.push("ZB")}}class os extends yt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Varna's Pact";const e=this.lValS(["a","two","three"]),r=this.level===1?"":"s",s=this.level===1?"was":"were";this.text=`Put ${e} random creature${r} that ${s} destroyed this game into ${e} lane${r}.`}playTargets(){const t=super.playTargets();return t.push(this.fieldTarget("P1",[])),t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")if(this.level===1)this.endSpell([t.lane],t.playerA);else{const r=this.fieldTarget("P2",[t.lane]);v.ddf5(w.toActions(r))}else if(e[0]==="P2"){const r=[t.lane,parseInt(e[1])];if(this.level===2)this.endSpell(r,t.playerA);else{const s=this.fieldTarget("P3",r);v.ddf5(w.toActions(s))}}else this.endSpell([t.lane,parseInt(e[1]),parseInt(e[2])],t.playerA)}endSpell(t,e){this.logSpell();const r=N.tick();t.forEach(s=>{const h=O.gravedigger();h&&f.birth(h,"R",e,s,r)}),v.spellCast()}fieldTarget(t,e){const r=p.actionTarget("TF","CARD",this.code,S.enTil(t,...e));return r.player="F",r.hint=["FL"],r.lanes=f.laneIdx.filter(s=>!e.includes(s)),r}}class hs extends ge{jr3(t,e){const r=super.jr3(t,e);return r.jr4("LG",this.code),r}ddf8(t){const e=t.event;return t.trigger.type==="LG"&&t.owner===e.playerA}jr8(t){const e=t.event,r=this.boof124*e.healAmt;f.jr5(t.creatId).buff(r,r),x.triggerDone()}}class ls extends P{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Wildwood Sower",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,11,18]),this.tribe.push("HM");const e=U.minionBuff(this.level);this.text=`When you play a spell, you may put a ${e}/${e} ${U.minionName(this.level)} into an available lane.`,this.bonus={exist:this.ddp9(1,e*2,e,0)*.5}}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC",this.code);return s.interactive=!0,r}handleAction(t){f.birth(U.minionCode(this.level),"P",t.playerA,t.lane),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;return e.playerA===t.owner&&I.getCard(e.cardCode).type==="S"}return!1}jr8(t){const e=p.emptyPlayerActTarg("F","CARD",this.code,""),r=w.toActions(e);r.length===0?x.triggerDone():(r.push(v.noneEndTrigger()),v.ddf5(r))}}class cs extends P{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Windcaller Shaman",this.iAttack=this.boof3713,this.iHealth=this.iAttack+4,this.tribe.push("WN","AS"),this.text=`Forge: You may move another friendly ${m.levelGateText(this.level,!0)}creature to an available lane adjacent to ${this.name}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}jr8(t){const e=f.jr5(t.creatId);if(this.emptySloots(e).length>0){const r=p.crFriendNotMeActTarg("CARD",e.id,this.code,S.enTil("P1",e.id));r.level=w.ddf2(this.level);const s=w.toActions(r);s.length>0?(s.push(v.noneEndTrigger()),v.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=f.jr5(e[1]),h=this.emptySloots(s,r.id);h.push(v.cancelAction()),v.ddf5(h)}else{const r=f.jr5(e[1]);this.logAct(!1,r),r.move(t.lane),v.actionDone(!0)}}emptySloots(t,e=""){return v.emptyAdjacents(t,S.enTil("P2",e))}}class ds extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Windspark Elemental",this.iAttack=this.boof258,this.iHealth=this.lValN([7,14,21]),this.tribe.push("LT","EL"),this.text=`When an enemy creature is delt non-battle damage, deal ${this.boof246} damage to the enemy player.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return!e.battle&&e.isCreatTarg&&e.hurtCreat.owner!==t.owner}return!1}jr8(t){k.hurtDirect(!t.owner,this.boof246,this.code),x.triggerDone()}}class us extends P{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Xithian Rotfiend",this.iAttack=this.lValN([7,12,20]),this.iHealth=this.iAttack+1,this.tribe.push("AB");const e=-this.boof135;this.text=`When ${this.name} becomes opposed, it gets ${m.jr9(e,e)}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("EF",this.code),r.jr4("MV",this.code),r}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const e=W.toCreature(t.event);return t.trigger.creatId===e.creature.id&&t.trigger.type==="MV"||e.creature.owner!==t.owner}return!1}jr8(t){let e=!1;const r=f.jr5(t.creatId),s=W.toCreature(t.event);if((r.id===s.creature.id&&r.opposed||s.creature.lane===f.oppositeLane(r.lane))&&(e=!0),e){const h=-this.boof135;r.buff(h,h)}x.triggerDone()}}class fs extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Zarox, the Raging",this.iAttack=this.lValN([2,4,10]),this.iHealth=this.lValN([8,12,18]),this.tribe.push("FR","EL"),this.text=`When Zaxox ${m.dbdtap()} on your turn, you may deal that much damage to an enemy creature.~Allied Nekrium: When a creature is destroyed, Zarox gets ${m.jr9(this.boof124,0)}.`}jr3(t,e){const r=super.jr3(t,e);r.jr4("FR",this.code);const s=r.jr4("DM",this.code);return s.interactive=!0,r}handleAction(t){f.ddf6(t).hurtDirect(parseInt(t.param),this.code),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}else if(t.trigger.type==="DS")return!0;return!1}jr8(t){if(t.trigger.type==="FR"){if(M.allied("N")){const e=f.jr5(t.creatId);e.jr4("DS",this.code),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,r=w.toActions(p.crEnemyActTarg("CARD",this.code,e.dmg.toString()));r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}else if(t.trigger.type==="DS"){const e=f.jr5(t.creatId);this.logAct(!1),e.buff(this.boof124,0),x.triggerDone()}}}class gs extends P{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Zombie Titan",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("ZB");const e=this.boof234;this.text=`While ${this.name} is in a side lane, it gets ${m.jr9(e,e,!0)} and Regenerate ${this.level}.`}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){if(e.lane===1||e.lane===5){const r=this.boof234;[p.mod("AT",r,e.id),p.mod("HL",r,e.id),p.mod("MH",r,e.id),p.mod("RG",this.level,e.id)].forEach(h=>{e.addModSafe(h)})}else e.removeModSafe(e.id)}}class ms{cardCache=new Map;mapper={["AAK"]:Pr,["ABB"]:Nr,["ABM"]:gt,["AGC"]:gt,["AGK"]:V,["AGP"]:lt,["AGW"]:L,["ASG"]:L,["AMS"]:V,["AFO"]:le,["ATG"]:Yt,["ART"]:Yt,["ATP"]:Fe,["AGM"]:ae,["ALG"]:me,["AHL"]:Qr,["ALS"]:me,["AAA"]:Mr,["ABE"]:lt,["ATZ"]:L,["AEC"]:$t,["ARB"]:Yt,["AEN"]:G,["APM"]:Rr,["AQE"]:L,["AGD"]:Er,["AFS"]:se,["AMD"]:Ir,["ABR"]:Gt,["AFR"]:V,["AMY"]:Gt,["ABL"]:L,["ATT"]:bt,["AGU"]:G,["AIV"]:Nt,["BRS"]:ar,["BTB"]:rr,["BTH"]:G,["BTI"]:gt,["BTN"]:me,["BBB"]:G,["BLH"]:Yt,["BFT"]:L,["BSP"]:Nt,["BWK"]:ae,["BLW"]:G,["BZS"]:V,["BSR"]:gt,["BMY"]:Lr,["BSW"]:dt,["BWW"]:He,["BTM"]:L,["BOS"]:U,["BAW"]:gt,["BWG"]:G,["BTR"]:V,["BWD"]:pe,["BSG"]:$r,["BSS"]:V,["BTS"]:pe,["BST"]:ce,["BWT"]:Gr,["BRF"]:ae,["BRH"]:bt,["BWH"]:Or,["BRN"]:ie,["BZD"]:V,["BFM"]:V,["BSM"]:Wr,["CKB"]:gt,["CDT"]:ae,["CMF"]:We,["CTL"]:lt,["CCS"]:dt,["CHY"]:G,["CSR"]:ar,["CHV"]:Ur,["CRS"]:le,["COD"]:lt,["CTI"]:V,["CHA"]:gt,["CHH"]:V,["CHR"]:ye,["CBB"]:Re,["CDC"]:G,["CFB"]:Gt,["CNM"]:G,["CSW"]:V,["CTG"]:G,["CCT"]:Ue,["CFG"]:Me,["CGF"]:At,["CGL"]:dt,["CSU"]:L,["CCR"]:gt,["CSB"]:At,["CNT"]:L,["CWK"]:G,["CRC"]:Nt,["CYC"]:Yt,["COZ"]:U,["CYS"]:At,["CTW"]:L,["CTV"]:L,["CAG"]:L,["CBS"]:L,["CIN"]:ge,["CSH"]:dt,["CSG"]:Me,["DFR"]:V,["DHW"]:Yt,["DSS"]:Ne,["DCR"]:lt,["DSK"]:At,["DBA"]:V,["DBP"]:G,["DMR"]:G,["DBR"]:G,["DCS"]:Ot,["DDF"]:L,["DGZ"]:lt,["DNK"]:zr,["DBN"]:V,["DDS"]:Zr,["DIS"]:$t,["DSV"]:Yr,["DDD"]:V,["DPB"]:Kr,["DZA"]:U,["DZD"]:ye,["DRE"]:$t,["DGW"]:lt,["DBT"]:L,["DFB"]:Pt,["DMW"]:se,["DCH"]:$t,["DTD"]:G,["DSZ"]:G,["DYB"]:L,["DBQ"]:Xr,["DYS"]:qr,["DYL"]:jr,["EBW"]:Re,["ESK"]:Nt,["EHW"]:Jr,["ETN"]:L,["EWE"]:Be,["ENP"]:L,["ESU"]:$t,["ENR"]:L,["EPD"]:lt,["EPH"]:_r,["EPS"]:Gt,["ESG"]:ti,["ESC"]:pe,["ESP"]:ei,["EWT"]:V,["EHN"]:pe,["EFA"]:L,["EFM"]:Gt,["EFP"]:ri,["EFE"]:ii,["EXD"]:L,["FWB"]:G,["FWR"]:G,["FFG"]:G,["FST"]:At,["FWK"]:At,["FIN"]:L,["FRR"]:lt,["FVA"]:L,["FWG"]:U,["FWC"]:Nt,["FFU"]:dt,["FLH"]:We,["FMS"]:G,["FSM"]:lt,["FBC"]:Gt,["FBI"]:Yt,["FFS"]:dt,["FLN"]:L,["FJT"]:L,["FRI"]:gt,["FSS"]:Ne,["FLS"]:Yt,["FSH"]:dt,["FFD"]:At,["FRV"]:gt,["FSP"]:bt,["FPR"]:G,["FFL"]:L,["FGA"]:G,["FGB"]:G,["FGD"]:bt,["FGG"]:se,["FGO"]:G,["FOL"]:le,["FPM"]:G,["FPS"]:G,["FFM"]:Be,["FMD"]:si,["FME"]:Nt,["FSK"]:ai,["FWT"]:V,["FZS"]:L,["FUN"]:U,["GOS"]:ni,["GHS"]:se,["GHB"]:Ue,["GHR"]:oi,["GRN"]:Me,["GTH"]:L,["GSC"]:ae,["GMP"]:Ot,["GTT"]:hi,["GCL"]:G,["GCR"]:L,["GLF"]:gt,["GRW"]:gt,["GSW"]:V,["GVS"]:At,["GSS"]:V,["GBG"]:At,["GGE"]:G,["GGH"]:G,["GRP"]:li,["GGD"]:Pt,["GGR"]:Pt,["GGP"]:Pt,["GGS"]:G,["GRM"]:lt,["GHT"]:gt,["GMR"]:At,["HMF"]:bt,["HTR"]:He,["HAR"]:L,["HFA"]:De,["HOD"]:bt,["HWM"]:ge,["HOX"]:$t,["HGS"]:ci,["HTP"]:di,["IBF"]:lt,["ITO"]:$t,["IME"]:$t,["IVS"]:lt,["ICD"]:ui,["IWC"]:G,["IHA"]:ae,["IBR"]:Re,["IMD"]:ye,["IMA"]:V,["IZL"]:fi,["IZR"]:gi,["IZK"]:Yt,["IFL"]:ie,["IFR"]:L,["JPK"]:L,["KDC"]:G,["KAW"]:Yt,["KOD"]:dt,["KBE"]:mi,["KIW"]:pi,["KTS"]:Pe,["KKK"]:He,["LOD"]:lt,["LFA"]:yi,["LKP"]:bi,["LGT"]:V,["LLD"]:xe,["LLG"]:xe,["LLS"]:xe,["LLT"]:xe,["LBR"]:L,["LSK"]:ie,["LWY"]:G,["LBD"]:V,["LSS"]:Ne,["LBL"]:Ot,["LSP"]:ge,["LCE"]:$t,["LUC"]:Be,["LMV"]:V,["LHY"]:G,["LYR"]:ie,["LYS"]:L,["MMH"]:gt,["MHR"]:Ai,["MRF"]:G,["MOE"]:V,["MXW"]:gt,["MSP"]:$t,["MMA"]:V,["MMR"]:V,["MMX"]:At,["MMI"]:G,["MMO"]:G,["MMV"]:Nt,["MPH"]:L,["MSC"]:L,["MTS"]:or,["MTT"]:ki,["MML"]:vi,["MMW"]:Ti,["MDE"]:nr,["MBP"]:dt,["MND"]:dt,["NNS"]:L,["NGB"]:gt,["NGW"]:G,["NSL"]:L,["NCF"]:L,["NCM"]:ye,["POZ"]:U,["NCS"]:dt,["NCW"]:G,["NCV"]:L,["NSW"]:Si,["NDR"]:Ci,["NEM"]:$t,["NSH"]:lt,["NXA"]:wi,["NXC"]:G,["NXG"]:dt,["NXO"]:le,["NXP"]:sr,["NXT"]:me,["NGT"]:Pt,["NGQ"]:xi,["NSD"]:U,["NCL"]:lt,["NFF"]:dt,["NAM"]:G,["NOZ"]:At,["NSY"]:V,["ONN"]:Di,["OXA"]:Fi,["OXM"]:V,["OXP"]:Hi,["OOZ"]:U,["OBB"]:Bi,["OEX"]:L,["OWH"]:Pi,["OBD"]:G,["OFM"]:V,["OJC"]:bt,["OPK"]:V,["OSV"]:ce,["OSS"]:L,["OWW"]:se,["OHV"]:dt,["ODC"]:Ni,["OSP"]:G,["OSL"]:G,["OWF"]:lt,["OXS"]:Mi,["PHM"]:V,["PPM"]:dt,["PSM"]:V,["PLW"]:lt,["PRG"]:G,["PRI"]:or,["PHS"]:gt,["PTB"]:lt,["PSC"]:dt,["PSH"]:Nt,["PTR"]:L,["PSG"]:L,["PMI"]:V,["PMS"]:L,["POX"]:At,["PYG"]:Ue,["PYS"]:lt,["RBH"]:Ri,["ROK"]:lt,["RPT"]:U,["RHY"]:G,["RTS"]:Gt,["RHU"]:ce,["RSC"]:Pe,["RLW"]:bt,["RFL"]:Ei,["RHC"]:G,["ROG"]:L,["RWC"]:pe,["RFA"]:De,["RWD"]:gt,["RSE"]:Ii,["RBG"]:ze,["RGG"]:Nt,["RSZ"]:At,["RSP"]:G,["RHW"]:bt,["SBF"]:Ot,["SAP"]:L,["SPL"]:U,["SVO"]:L,["SSE"]:Ot,["SXP"]:U,["SXD"]:U,["SXT"]:U,["STS"]:lt,["SCS"]:G,["SMD"]:V,["SFS"]:Li,["SHY"]:gt,["SCD"]:G,["SFT"]:G,["SOC"]:L,["SOA"]:L,["SOD"]:L,["SOK"]:ie,["SOT"]:L,["SDL"]:U,["SAD"]:Gi,["SHG"]:L,["SBI"]:Re,["SCC"]:Pe,["SPB"]:$i,["SPD"]:Ot,["SPM"]:Ot,["STD"]:gt,["STB"]:ie,["SHS"]:ae,["SGF"]:dt,["SKG"]:sr,["SSD"]:Ze,["SDA"]:Oi,["SSR"]:Nt,["SNB"]:L,["SNP"]:lt,["SRD"]:lt,["SSH"]:Fe,["SRM"]:dt,["SRH"]:Pt,["SDN"]:V,["SHV"]:L,["SRP"]:L,["SGG"]:V,["SBA"]:G,["SKB"]:G,["SBR"]:G,["SKS"]:ce,["SEL"]:Wi,["STM"]:G,["SBD"]:V,["SCV"]:Ui,["SFM"]:At,["SSN"]:G,["SSM"]:Nt,["SLH"]:Vi,["SPN"]:U,["SSI"]:ge,["SND"]:Pe,["SNT"]:At,["SRV"]:ze,["STR"]:L,["SPU"]:U,["XYR"]:U,["SPH"]:zi,["SSA"]:dt,["STO"]:L,["SDR"]:bt,["SOL"]:Ze,["SOV"]:L,["SHK"]:ie,["SWR"]:Zi,["SMN"]:G,["SER"]:Yi,["SES"]:Ki,["SFA"]:De,["STG"]:Xi,["SSS"]:Ne,["SSK"]:V,["SWG"]:ce,["SWM"]:dt,["SIV"]:lt,["STN"]:L,["SGI"]:G,["SBG"]:qi,["SCL"]:G,["SGA"]:De,["STP"]:L,["SSG"]:Nt,["SVH"]:Gt,["SIN"]:L,["SYL"]:V,["SEV"]:gt,["SMA"]:G,["SML"]:G,["SYO"]:Ji,["TST"]:lt,["TBA"]:Ot,["TGL"]:L,["TGS"]:G,["TPT"]:L,["TDW"]:bt,["TNL"]:Qi,["TEX"]:le,["TGN"]:G,["TSM"]:le,["TUP"]:L,["TOT"]:L,["TAB"]:nr,["TGI"]:V,["TDS"]:ye,["TSP"]:_i,["TPG"]:Fe,["TMG"]:Fe,["TMM"]:ts,["TRA"]:V,["TRS"]:V,["TRV"]:V,["TRW"]:V,["TBB"]:We,["TOB"]:L,["TWS"]:G,["TVG"]:rr,["TXB"]:L,["TXS"]:L,["TFK"]:U,["TFD"]:U,["TFF"]:U,["TCG"]:L,["TWT"]:G,["TRN"]:lt,["TGK"]:ze,["TSL"]:es,["TTF"]:U,["TWG"]:Me,["UGM"]:Nt,["UGL"]:V,["UIC"]:rs,["ULR"]:is,["URD"]:G,["UBL"]:L,["UCM"]:dt,["UEM"]:ss,["UHS"]:as,["UIM"]:dt,["UWL"]:V,["UWS"]:V,["UIW"]:V,["URS"]:L,["UTM"]:V,["UTR"]:bt,["URB"]:Gt,["UPM"]:se,["VIK"]:V,["VRP"]:os,["VBK"]:G,["VTC"]:G,["VTW"]:ce,["VGN"]:At,["VND"]:V,["VNF"]:gt,["VNS"]:V,["VSK"]:L,["VCH"]:lt,["VGR"]:L,["VGL"]:L,["VOB"]:L,["VCG"]:Ot,["VES"]:Gt,["VYE"]:L,["WBY"]:gt,["WBU"]:gt,["WMC"]:V,["WMR"]:dt,["WMM"]:L,["WTK"]:Ze,["WTW"]:G,["WTA"]:hs,["WWP"]:V,["WWR"]:dt,["WOD"]:lt,["WFM"]:se,["WWS"]:ls,["WBH"]:Be,["WCS"]:cs,["WPD"]:G,["WSE"]:ds,["WFB"]:V,["WFS"]:dt,["WBG"]:Ot,["XCR"]:G,["XDH"]:gt,["XHS"]:At,["XHU"]:G,["XRF"]:us,["XSH"]:dt,["XTR"]:V,["XDV"]:He,["XRW"]:L,["YWC"]:G,["YNS"]:Pt,["ZXR"]:fs,["ZPM"]:dt,["ZTR"]:U,["ZTU"]:At,["ZIN"]:G,["ZBS"]:U,["ZST"]:U,["ZMT"]:gs,["ZMB"]:U,["ZSH"]:Ot};makeCard(t){try{let e;if(t==="SOV3"?e=new ns(t):t==="SOC3"?e=new V(t):t==="LOD3"?e=new Vr(t):t==="GOS3"?e=new ji(t):e=new this.mapper[St.extractCardCode(t)](t),e.type==="C"){const r=e;r.spice=[{icon:"A",num:r.iAttack},{icon:"H",num:r.iHealth}].concat(r.spice??[])}return e}catch(e){throw console.error("Make card screwed up on code: "+t),e}}getCard(t){let e=this.cardCache.get(t);return e||(e=this.makeCard(t),this.cardCache.set(t,e)),e}}const I=new ms;class ps{registry;constructor(){this.registry=[]}find(t){const e=this.registry.find(r=>r.action===t);if(e)return e;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,e){const r=this.find(t);r.enabled=e}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const e=this.registry.findIndex(r=>r.action===t);e>-1&&this.registry.splice(e,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,e,r){if(N.ui.animating)return;let s,h;this.scaleFactor===1?(s=t,h=e):(s=Math.round(t*this.scaleFactor),h=Math.round(e*this.scaleFactor));let u,g=S.clickMode;return g==="M"?u=r:r===rt.ForceRight?u=rt.Right:g==="T"?u=rt.Left:u=rt.Right,$e.arrayHit(this.registry,s,h,u)}updateScale(t){t===1?this.scaleFactor=1:this.scaleFactor=1/t}scaleFactor=1}const Q=new ps;class ys{memLoad=!0;step="O";vsAI=!0;p1=this.dud();p2=this.dud();initConstructed(){this.step="O",this.memLoad&&(this.memLoad=!1,this.p1.mode=S.readStringStorage("cMode"+"A","CP"),this.p2.mode=S.readStringStorage("cMode"+"B","CP"),this.p1.mode==="LK"&&(this.p1.mode="CP"),this.p2.mode==="LK"&&(this.p2.mode="CP"),this.vsAI=S.readBoolStorage("cAI",!0)),ft.drawAll()}handleMenuPick(t,e){if(t==="CI"||t==="CV")this.vsAI=t==="CI",S.writeBoolStorage("cAI",this.vsAI);else if(t==="CN")this.ezDeck(this.p1)?this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",v.ddf5(this.generateDeckPickerActions())):(this.step="A",v.ddf5(this.generateDeckPickerActions()));else{const r=e==="A"?this.p1:this.p2;t==="LK"?Xt.loadFromFile().then(s=>{typeof s=="string"?new Le().iAmError(s):(r.deck=s,r.mode=t,S.writeStorage("cMode"+e,t),ft.drawAll())}):(r.mode=t,S.writeStorage("cMode"+e,t))}ft.drawAll()}ezDeck(t){return t.mode==="CP"?!1:(t.mode==="CR"?t.deck=Xt.randomStockDeck():t.mode==="CX"&&(t.deck=Xt.treatsAbound(!0)),!0)}handleDeckPick(t){const e=S.deTil(t.param),r=Xt.stockDeckByName(e[0],e[1]);this.step==="A"?(this.p1.deck=r,this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",v.ddf5(this.generateDeckPickerActions()))):(this.p2.deck=r,this.launchConstructed())}generateDeckPickerActions(t=-1){const e=fe.map((r,s)=>{const h=p.basicAction("DSET");return h.param=s.toString(),h});if(t>-1){const r=fe[t],s=r.decks.map(h=>{const u=p.basicAction("DECK");return u.param=S.enTil(r.id,h.name),u});return e.concat(s)}return e}launchConstructed(){N.aiMode=this.vsAI,mt.setMode("G"),N.newGame(this.p1.deck.cards,this.p2.deck.cards)}replay(){N.newGame(this.p1.deck.cards,this.p2.deck.cards)}dud(){return{mode:"CP",deck:{cards:[],name:"",factions:[]}}}}const Bt=new ys;class bs{deathOrder=[];graveyard=[];reset(){this.graveyard=[],this.deathOrder=[]}purge(){this.deathOrder=[]}getState(){const t={dO:this.deathOrder,gY:this.graveyard};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.deathOrder=e.dO,this.graveyard=e.gY}deathCheck(){const t=N.tick();f.qActiveCreats().forEach(s=>{s.health<1&&(m.new().crd(s.code).txt(" died.").go(),this.smite(s,t))});const e=k.toPlayer(!0),r=k.toPlayer(!1);(e.health<1||r.health<1)&&(e.healthr.creatId===t.id)&&(this.deathOrder=this.deathOrder.filter(r=>r.creatId!==t.id))}findDeathTime(t){const e=this.deathOrder.filter(r=>r.creatId===t).map(r=>r.time);if(e.length!==0)return Math.min(...e)}destroy(t,e,r=void 0){t.status==="A"?(m.new().crd(t.code).txt(" was destroyed by ").crd(e).txt(".").go(),this.smite(t,r)):(console.warn(`Attempted to destroy creature that was not active. Targ creat ${t.code}; Killer creat ${e}`),console.trace())}gravedigger(t="X",e="LA"){if(t==="X"&&e==="LA"){const r=this.graveyard.length;return r===0?"":this.graveyard[S.randInt(0,r)].cardCode}else{const r=k.toBool(t);let s=this.graveyard.filter(u=>u.owner===r);e!=="LA"&&(s=s.filter(u=>w.levelTargetTest(e,parseInt(u.cardCode.slice(3)))));const h=s.length;return h===0?"":s[S.randInt(0,h)].cardCode}}smite(t,e=void 0){t.status="D",this.deathOrder.push({creatId:t.id,time:e||N.tick()}),this.graveyard.push({cardCode:t.code,owner:t.owner}),x.addEvents(W.creature("DIE",t)),te.positionChange(t.owner),t.owner?M.deathsA.push(t.code):M.deathsB.push(t.code)}}const O=new bs;class As{get youi(){return N.ui}initDeck(t,e){this.youi.deckContents=t,this.youi.deckScroll=0,this.youi.deckSummary=e,mt.setMode("T")}get canPageDown(){return this.youi.deckContents.length-this.youi.deckScroll>15}get canPageUp(){return this.youi.deckScroll>0}paginate(t){t?this.youi.deckScroll+=15:this.youi.deckScroll-=15}visibleContent(){const t=this.youi.deckScroll;return this.youi.deckContents.slice(t,t+15)}generateContent(t,e,r){const s=w.cardByTarget(t,r);if(s.sort((h,u)=>{const g=h[0],y=u[0];return y===g?0:g>y?1:-1}),e){const h=s.length;let u=0,g="",y=0;const C=[];for(;u0&&C.push({cardCode:g,sourceIdx:-1,cardCount:y}),g=s[u][0],y=1),u++;return h>0&&C.push({cardCode:g,sourceIdx:-1,cardCount:y}),C}else return s.map(h=>({cardCode:h[0],sourceIdx:h[1],cardCount:0}))}handleShowDeck(t){const e=k.getActive();this.showDeck(e,t.param==="VD")}handleDeckScroll(t){this.paginate(t.param==="D"),ft.drawAll()}showPlayerDeck(t){this.showDeck(t,!1)}showPlayerDiscard(t){this.showDeck(t,!1)}showCustomDeck(t,e){this.initDeck(t,!1);const r=this.rightClickers();v.ddf5(e.concat(r))}showDeck(t,e){const r=k.toPlayer(t);this.initDeck(this.generateContent(e?r.discard:r.deck,!0),!0);const s=v.cancelAction();s.key="CNCL",s.param="PM";const h=this.rightClickers();h.push(s),v.ddf5(h)}rightClickers(){return N.aiActive?[]:this.youi.deckContents.map((t,e)=>{const r=p.deckSelectAction("DEET",t.cardCode,e);return r.param=t.cardCode,r})}}const Ht=new As;class ks{friends;friendText;get browseStack(){return N.ui.detailStack}n(t,e){return`${t}${e}`}allLevelFriendo(t,e){const r=Array.isArray(e)?e:[e];[1,2,3].forEach(s=>{this.friends[this.n(t,s)]=r.map(h=>this.n(h,s))})}plont(t){this.friends[this.n(t,1)]=[this.n("SDL",1)],this.friends[this.n(t,2)]=[this.n("SPL",2)],this.friends[this.n(t,3)]=[this.n("TFK",3)]}constructor(){const t=this.n("FWC",1);this.friends={[this.n("CGL",1)]:[this.n("CGF",1)],[this.n("DTD",1)]:[this.n("TOT",1)],[t]:[this.n("FWG",1)],[this.n("MPH",1)]:[t],[this.n("MPH",2)]:[t],[this.n("MPH",3)]:[t],[this.n("NGQ",4)]:[this.n("NSD",4)],[this.n("RHU",1)]:[this.n("RSC",1)],[this.n("SSE",1)]:[this.n("SXD",1)],[this.n("SSE",2)]:[this.n("SXP",2)],[this.n("SSE",3)]:[this.n("SXT",3)],[this.n("TRA",2)]:[this.n("PTR",2)],[this.n("TRA",3)]:[this.n("PTR",3)],[this.n("TRS",2)]:[this.n("STO",2)],[this.n("TRS",3)]:[this.n("STO",3)],[this.n("TRV",2)]:[this.n("ITO",2)],[this.n("TRV",3)]:[this.n("ITO",3)],[this.n("TRW",2)]:[this.n("STR",2)],[this.n("TRW",3)]:[this.n("STR",3)],[this.n("TGK",1)]:[this.n("SXD",1)],[this.n("TGK",2)]:[this.n("SPL",2)],[this.n("TGK",3)]:[this.n("TTF",3)],[this.n("TSL",1)]:[this.n("FUN",1)],[this.n("ZTU",2)]:[this.n("ZTR",2)]},this.allLevelFriendo("BLH","LWY"),this.allLevelFriendo("BTM","BOS"),this.allLevelFriendo("BWD","TFD"),this.plont("BTS"),this.allLevelFriendo("BWT","DNK"),this.allLevelFriendo("CSB","ZBS"),this.allLevelFriendo("CYS","COZ"),this.allLevelFriendo("DSK","SPN"),this.allLevelFriendo("DDF","SXT"),this.allLevelFriendo("DNK","BWT"),this.allLevelFriendo("DZD","DZA"),this.allLevelFriendo("DBQ","BRF"),this.allLevelFriendo("EPH","EPS"),this.allLevelFriendo("FST","ZST"),this.allLevelFriendo("FWK","ZMB"),this.allLevelFriendo("FGD",["FGA","FGB","FGG","FGO"]),this.allLevelFriendo("FGG","FGO"),this.allLevelFriendo("FMD","FME"),this.plont("GMR"),this.allLevelFriendo("IZL",["IFL","IFR","IZR"]),this.allLevelFriendo("IZR",["IFL","IFR","IZL"]),this.allLevelFriendo("IZK",["IFL","IFR","IZL","IZR"]),this.allLevelFriendo("NCM","POZ"),this.allLevelFriendo("NSW","SPN"),this.allLevelFriendo("NSH","NDR"),this.allLevelFriendo("NGQ","NSD"),this.allLevelFriendo("NFF","TFF"),this.allLevelFriendo("NOZ","OOZ"),this.plont("PTB"),this.allLevelFriendo("RWC","RPT"),this.plont("STS"),this.allLevelFriendo("SDA","HTP"),this.allLevelFriendo("SND","SPU"),this.allLevelFriendo("SIV","KBE"),this.allLevelFriendo("TNL","ZMB"),this.plont("WWS"),this.allLevelFriendo("YNS","XYR");const e=42,r=31,s=40,h=51,u=38,g=52,y=66;this.friendText={["BOS"]:[h,""],["BWT"]:[68,"Bron"],["BRF"]:[18,""],["CGF"]:[65,"Fiend"],["COZ"]:[r,""],["DNK"]:[8,""],["DZA"]:[59,"Dozer"],["EPS"]:[49,"Soldier"],["FWG"]:[44,""],["FWC"]:[28,"Chrysalis"],["FGA"]:[65,"Alpha"],["FGB"]:[77,"Beta"],["FGG"]:[53,"Gamma"],["FGO"]:[57,"Omega"],["FME"]:[78,"Egg"],["FUN"]:[49,""],["HTP"]:[38,"Hunting"],["ITO"]:[e,"Torrent"],["IZL"]:[42,"Av Flame"],["IZR"]:[44,"Av Frost"],["IFL"]:[65,"Flame"],["IFR"]:[67,"Frost"],["KBE"]:[78,"Bee"],["LWY"]:[65,"Wyrm"],["POZ"]:[r,""],["NDR"]:[3,""],["NSD"]:[s,""],["OOZ"]:[r,""],["PTR"]:[e,"Torrent"],["RPT"]:[51,""],["RSC"]:[60,"Scout"],["SPL"]:[h,""],["SXP"]:[h,""],["SXD"]:[s,""],["SXT"]:[u,""],["SDL"]:[s,""],["SPN"]:[y,""],["STR"]:[e,"Torrent"],["SPU"]:[y,""],["XYR"]:[y,""],["STO"]:[e,"Torrent"],["TOT"]:[40,"Tendrils"],["TFK"]:[u,""],["TFD"]:[u,""],["TFF"]:[u,""],["TTF"]:[u,""],["ZTR"]:[32,"Returned"],["ZBS"]:[g,""],["ZST"]:[g,""],["ZMB"]:[g,""]}}get currentCard(){const t=this.browseStack;return t[t.length-1]}get friendos(){return this.friends[this.currentCard]??[]}get canGoBack(){return this.browseStack.length>1}init(t){if(!N.aiActive)if(N.ui.detailStack=[t],mt.mode!=="R"){mt.setMode("R");const e=p.basicAction("CNCL");e.zone=mt.baseMode==="G"?"B":"N",e.param="PM",v.ddf5([e])}else ft.drawAll()}changeLevel(t){const e=this.browseStack,r=e.length-1,s=e[r];e[r]=this.n(St.extractCardCode(s),t)}goBack(){this.browseStack.pop()}goToFriend(t){this.browseStack.push(t)}friendTxt(t){const e=this.friendText[t];return e||[3,"I am error"]}goBackAction(){const t=p.basicAction("DTUP");return t.param="DB",t}levelAction(t){const e=p.basicAction("DTUP");return e.param=S.enTil("DL",t),e}friendAction(t){const e=p.basicAction("DTUP");return e.param=S.enTil("DF",t),e}updateDetails(t){const e=S.deTil(t.param),r=e[0];r==="DB"?this.goBack():r==="DF"?this.goToFriend(e[1]):r==="DL"?this.changeLevel(parseInt(e[1])):console.error("Unknown detail arg",t)}}const Kt=new ks,Ye=[1,2,3,4,5].map(n=>n.toString());class vs{rarityCache={["L"]:[],["H"]:[],["R"]:[],["C"]:[],["T"]:[]};faction1="X";faction2="X";factionLock=!1;picks=[];picksAsDeck=[];currentPack=[];scrollIdx=0;memLoad=!0;step="O";stats;vsAI=!0;legDraft=!1;fatPacks=!1;overdraft=!1;rarityFilters;setFilters;pAdeck=[];pBdeck=[];get aiPicking(){return this.vsAI&&this.step==="B"}packOdds=[];constructor(){this.rarityFilters=new Map(oe.map(t=>[t,!0])),this.setFilters=new Map(Ye.map(t=>[t,!0])),this.stats=new tr}getRarity(t){return this.rarityFilters.get(t)??!0}toggleRarity(t){const e=!this.rarityFilters.get(t);return this.rarityFilters.set(t,e),e}getSet(t){return this.setFilters.get(t.toString())??!0}toggleSet(t){const e=t.toString(),r=!this.setFilters.get(e);return this.setFilters.set(e,r),r}get canPageDown(){return this.picksAsDeck.length-this.scrollIdx>15}get canPageUp(){return this.scrollIdx>0}paginate(t){t?this.scrollIdx+=15:this.scrollIdx-=15}initDraft(){this.step="O",this.memLoad&&(this.memLoad=!1,this.vsAI=S.readBoolStorage("dAI",!0),this.legDraft=S.readBoolStorage("legDraft",!1),this.fatPacks=S.readBoolStorage("fatPacks",!1),this.overdraft=S.readBoolStorage("overD",!1),Ye.forEach(t=>{this.setFilters.set(t,S.readBoolStorage("dSet"+t,!0))}),oe.forEach(t=>{this.rarityFilters.set(t,S.readBoolStorage("dRare"+t,!0))})),ft.drawAll()}setFArr(){let t=Ye.filter(e=>this.setFilters.get(e)).map(e=>parseInt(e));return t.length===5&&(t=[]),t}validRarities(){return oe.filter(t=>this.rarityFilters.get(t))}startDraftPicks(){const t=this.setFArr();oe.forEach(e=>{this.getRarity(e)?this.rarityCache[e]=Xt.getDeckCards([e],[],t):this.rarityCache[e]=[]}),oe.every(e=>this.rarityCache[e].length===0)&&(this.rarityCache["C"]=this.fun()),this.packOdds=this.fatPacks?[9,31,40]:[5,25,40],this.faction1="X",this.faction2="X",this.factionLock=!1,this.picks=[],this.picksAsDeck=[],this.scrollIdx=0,this.stats=new tr,this.resumeDraft("")}resumeDraft(t){if(t){this.picks.push(t),this.picksAsDeck=this.picksToDeck();const s=this.overdraft?60:30;if(this.picks.length===s){this.step==="A"?(this.pAdeck=this.picksAsDeck.slice(),this.step="B",this.startDraftPicks()):(this.pBdeck=this.picksAsDeck.slice(),this.launchDraft());return}const h=I.getCard(t);if(this.aiPicking||this.stats.addStat(h.type,h.faction),!this.factionLock){const u=h.faction;if(this.faction1==="X")this.faction1=u;else if(u!==this.faction1){this.faction2=u,this.factionLock=!0;const g=this.setFArr();this.validRarities().forEach(y=>{this.rarityCache[y]=Xt.getDeckCards([y],[this.faction1,this.faction2],g)})}}}const e=this.generatePack().slice(-1*(6-this.picks.length%5)),r=this.fillPack(e);if(this.aiPicking)this.resumeDraft(r[r.length-1]);else{this.currentPack=r;const s=r.map((h,u)=>{const g=p.draftSelectAction("DRFT",u,!0);return g.param=h,g});v.ddf5(s)}}replay(){this.launchDraft()}picksToDeck(){const t=[];return this.picks.forEach(e=>{const r=t.findIndex(s=>s.card===e);r===-1?t.push({card:e,num:1}):t[r].num+=1}),t.sort((e,r)=>{const s=I.getCard(e.card+"1"),h=I.getCard(r.card+"1");return s.name.toLowerCase(){const s=this.rarityCache[r].length;let h=!0;for(;h;){const u=this.rarityCache[r][S.randInt(0,s)];e.includes(u)||(e.push(u),h=!1)}}),e}handleMenuPick(t,e){if(t==="DI"||t==="DV")this.vsAI=t==="DI",S.writeBoolStorage("dAI",this.vsAI);else if(t==="DN")this.step="A",this.startDraftPicks();else if(t==="DR"){const r=e;S.writeBoolStorage("dRare"+e,this.toggleRarity(r))}else t==="DT"?S.writeBoolStorage("dSet"+e,this.toggleSet(e)):t==="LD"?(this.legDraft=!this.legDraft,S.writeBoolStorage("legDraft",this.legDraft)):t==="GP"?(this.fatPacks=!this.fatPacks,S.writeBoolStorage("fatPacks",this.fatPacks)):t==="OD"&&(this.overdraft=!this.overdraft,S.writeBoolStorage("overD",this.overdraft));ft.drawAll()}launchDraft(){N.aiMode=this.vsAI,mt.setMode("G"),N.newGame(this.pAdeck,this.pBdeck)}fun(){return[["ART","SVO","MPH","VSK","MSP","LYS"],["CAG","ATG","WMM","ESU","BWH","CBS"],["DHW","NCF","ROG","EXD","TPT","HOX"],["FLS","STP","BRN","TCG","AQE","VOB"]][S.randInt(0,4)]}}const ut=new vs;class Ts{async drawAll(){if(ot.simOn)return;const t=mt.mode;Q.removeAll(),this.clearDetails(),t==="G"?(this.clearDeck(),await Promise.all([this.drawHand(k.getLocal()),this.drawPlayers(),this.drawField(),this.drawActions(v.activeActions)]),N.winFlag!==0?await this.drawGameOver():await this.drawCommonButtons(!0,!0,!0)):t==="R"?await this.drawDetails(v.activeActions):t==="T"?N.aiActive||await this.drawDeck(v.activeActions):t==="D"?await this.drawDraft(v.activeActions):t==="C"?await this.drawConstructed():t==="I"?await this.drawInfoMenu():t==="X"?await this.drawExit(v.activeActions):t==="S"?await this.drawSwap():await this.drawMenu()}async drawGameOver(){await new be().drawGameOver()}async drawHand(t){await new ur().drawCards(t)}async drawField(){await new je().drawCards()}async drawPlayers(){await new be().drawAllPlayers()}async drawDeck(t){const e=t.find(u=>u.zone==="B"),r=[];e&&r.push(e),await new Ee().drawActions(r);const h=new $s;await h.drawCards(),await h.drawActions(t),await this.drawCommonButtons(!0,!0,!1)}async drawActions(t){if(ot.simOn)return;const e=new Ee;if(N.aiActive)await e.drawActions([]);else{et.get("effects").clear();const s=new ur,h=new je,u=new be;await Promise.all([s.drawActions(t),h.drawActions(t),e.drawActions(t),u.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;N.ui.animating=!0,et.get("effects").clear(),await new je().drawFight(t),N.ui.animating=!1}async drawDraft(t){et.get("effects").clear();const r=new Ws,s=et.get("game-ui");s.clear(),Q.removeAll(),ut.step==="O"?await r.drawDraftMenu(s):(await new Ae().drawPickerPlayer(s,ut.step==="A",!1),await r.drawPack(t,s),await r.drawList(t,s),await r.drawStats(s),await this.drawCommonButtons(!0,!0,!1))}async drawMenu(){const t=new Us,e=et.get("game-ui");e.clear(),Q.removeAll(),await t.drawMenu(e)}async drawInfoMenu(){const t=new Ae,e=et.get("game-ui");e.clear(),Q.removeAll(),await t.drawExtrasMenu(e)}async drawConstructed(){if(Bt.step==="O"){const t=new Le,e=et.get("game-ui");e.clear(),Q.removeAll(),await t.drawConstrMenu(e)}else await this.drawDeckPick(v.activeActions)}async drawDeckPick(t){const e=new Le,r=new Ae,s=et.get("game-ui");s.clear(),Q.removeAll(),await r.drawPickerPlayer(s,Bt.step==="A",Bt.vsAI),await e.drawSets(t,s),await e.drawList(t,s)}clearDetails(){et.get("card").clear()}clearDeck(){et.get("decklist").clear()}async drawDetails(t){await this.drawActions(t),await this.drawCommonButtons(!0,!0,!1),et.get("card").clear();const r=new Os,s=t.find(h=>h.key==="CNCL");s?await r.drawDetails(s):console.error("Attempted to show details view with no cancel action")}async drawCommonButtons(t,e,r){let s=979;const h=723,u=new qe,g=et.get("game-ui");if(r&&g.clear(),t&&(await u.makeIconButton(g,s,h,"EX"),s-=50),e){const y=S.clickMode;y!=="M"&&await u.makeIconButton(g,s,h,y==="I"?"TM":"DM")}}async drawExit(t){et.get("decklist").clear();const r=et.get("effects"),s=new ue;await s.drawButton(r,151,488,t[1],"Quit Game",24,!1),await s.drawButton(r,478,488,t[0],"Resume",52,!1)}async drawSwap(){const t=et.get("decklist");t.clear(),t.context.fillStyle="#000000",t.context.fillRect(0,0,S.gameWidth,S.gameHeight);const e=new be,r=k.getActive(),s="#AAF0C1",h=p.basicAction("USWP");h.param="PM",await e.drawPlayer(r,t,200,300);const u={fontSize:22,colour:s};await e.drawText(t,"Player "+(r.isPlayerA?"1":"2"),480,360,u),await e.drawText(t,"Click to start turn",480,420,u);const g=new nt(h,0,0,S.gameWidth,S.gameHeight,rt.Both);Q.add(g)}setBackground(t){const e="hide";this.allBackgrounds.forEach(r=>{const s=document.getElementById(r);t===r?s.classList.remove(e):s.classList.add(e)})}changeScale(t){this.clearAll();let e=S.options.scale;e===t&&(e="100");const r=t==="100"?1:.90625;Q.updateScale(r);const s=`uiSize${e}`,h=`uiSize${t}`;this.allCanvases.forEach(y=>{et.get(y).dom.classList.replace(s,h)}),this.allBackgrounds.forEach(y=>{document.getElementById(y).classList.replace(s,h)}),document.getElementById("solforge").classList.replace(`gameSize${e}`,`gameSize${t}`),document.getElementById("log").classList.replace(`logSize${e}`,`logSize${t}`),S.options.scale=t,S.writeStorage("scale",t)}clearAll(){this.allCanvases.forEach(t=>{et.get(t).clear()})}allCanvases=["game-ui","field","player","hand","effects","decklist","card"];allBackgrounds=["playmat","blueface","mainmenu"]}const ft=new Ts;class Ss{positionChange(t){f.creatByTarget().forEach(e=>{e.enforceEffects("PS",t)})}defenderChange(t){f.qActiveCreats().forEach(r=>{r.effects.filter(s=>s.watch==="DF").filter(s=>s.area==="C"&&r.owner===t||s.area==="A").forEach(s=>I.getCard(s.logicCode).enforceEffect(s,r))})}playerHealthChange(){f.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){f.qActiveCreats().forEach(e=>{e.enforceEffects("AT"),e.enforceEffects("AR"),e.enforceEffects("CH"),e.enforceEffects("DF",e.owner)})}}const te=new Ss;class Cs{getC(t){return f.jr5(t)}creature(t,e){return{code:t,creatId:e.id}}creatHeal(t,e){return{code:"CHL",creatId:t.id,healAmt:e}}damage(t,e,r,s,h,u){let g;return h instanceof Se?g=h.id:g=h,{code:"DMG",battle:t,dmg:e,isCreatSrc:r,isCreatTarg:s,target:g,srcId:u?.id}}enterField(t){return{code:"ENT",creatId:t.id,forged:!1}}playCard(t,e){return{code:"PLC",playerA:e,cardCode:t}}player(t,e){return{code:t,playerA:e}}playerHeal(t,e){return{code:"PHL",playerA:t,healAmt:e}}replaced(t,e){return{code:"RPL",creatId:t.id,replCreatId:e.id}}toCreature(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId)}}toDamage(t){const e=t;let r,s,h;return e.isCreatTarg?h=this.getC(e.target):s=k.toPlayer(e.target),e.isCreatSrc&&(r=this.getC(e.srcId)),{code:e.code,battle:e.battle,dmg:e.dmg,isCreatSrc:e.isCreatSrc,srcId:e.srcId,target:e.target,isCreatTarg:e.isCreatTarg,srcCreat:r,hurtCreat:h,hurtPlayer:s}}toEnterField(t){const e=t;return{code:e.code,creatId:e.creatId,forged:e.forged,creature:this.getC(e.creatId)}}toReplaced(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId),replCreatId:e.replCreatId,replCreat:this.getC(e.replCreatId)}}}const W=new Cs;class ws{field=[];birthOrder=[];laneIdx=[1,2,3,4,5];reset(){this.field=[],this.birthOrder=[]}purge(){this.field=this.field.filter(t=>t.status==="A"),this.birthOrder=[]}getState(){const t={field:this.field.map(e=>e.getState()),bO:this.birthOrder};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.field=e.field.map(r=>new Se(r)),this.birthOrder=e.bO}jr5(t){const e=this.searchById(t);if(e)return e;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByLane(t,e){const r=this.searchByLane(t,e);if(r)return r;throw console.error("naughty creature lane ",t,e),new Error("Could not find creature by lane")}ddf6(t){const e=this.searchByFSA(t);if(e)return e;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return this.field.find(e=>e.id===t)}searchByLane(t,e){return this.field.find(r=>r.lane===t&&r.owner===e&&r.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let e=this.field;if(t){if(t.player!=="X"){const r=k.toBool(t.player);e=e.filter(s=>s.owner===r)}if(t.creatStatus!=="A"){const r=this.creatStatusTargetToCS(t.creatStatus);e=e.filter(s=>s.status===r)}if(!S.isUn(t.lanes)){const r=w.lanesToArr(t.lanes);e=e.filter(s=>r.includes(s.lane))}if(S.isUn(t.maxAttack)||(e=e.filter(r=>r.attack<=t.maxAttack)),t.notMe&&(e=e.filter(r=>r.id!==t.notMe)),t.victims){const r=S.deTil(t.victims);e=e.filter(s=>r.includes(s.id))}if(t.tribe!=="AN"&&(e=e.filter(r=>r.isTribe(t.tribe))),t.canLevel&&(e=e.filter(r=>I.getCard(r.code).canLevel())),t.level!=="LA"){const r=w.levelTargetToLevel(t.level);e=e.filter(s=>r.includes(s.level))}t.cardCode&&(e=e.filter(r=>I.getCard(r.code).cardCode()===t.cardCode)),t.canDefender&&(e=e.filter(r=>!r.negateDefender)),t.hasDefender&&(e=e.filter(r=>r.defender)),t.canArmor&&(e=e.filter(r=>!r.negateArmor)),t.hasArmor&&(e=e.filter(r=>r.armor>0)),t.canMove&&(e=e.filter(r=>!r.negateMobility)),t.hasMobility&&(e=e.filter(r=>r.mobility>0)),t.hasPoison&&(e=e.filter(r=>r.poison>0)),t.canRegen&&(e=e.filter(r=>!r.negateRegen)),t.hasRegen&&(e=e.filter(r=>r.regen>0)),t.faction!=="X"&&(e=e.filter(r=>r.faction===t.faction))}return e}cst2cs={["A"]:()=>{throw new Error("goof passed any to field state target mapper")},["V"]:()=>"A",["D"]:()=>"D",["R"]:()=>"R"};creatStatusTargetToCS(t){return this.cst2cs[t]()}emptyLanes(t){return this.laneIdx.filter(e=>!this.field.find(s=>s.owner===t&&s.lane===e&&s.status==="A"))}oppositeLane(t){return 6-t}adjacentPositions(t){return[[2],[1,3],[2,4],[3,5],[4]][t-1]}canMove(t){return t.mobility>0&&t.mobilityAvailable&&(!t.sleeping||t.aggressive)?this.emptyLanes(t.owner).filter(e=>Math.abs(t.lane-e)<=t.mobility):[]}birth(t,e,r,s=0,h=void 0){if(e==="S"){const C=this.emptyLanes(r);if(C.length===0)return;s=C[S.randInt(0,C.length)]}else if(e==="P"&&!this.emptyLanes(r).includes(s))return;const g=(typeof t=="string"?I.getCard(t):t).jr3(r,s);if(r===k.getActiveB()&&M.birthRegistrar(g.id),e==="F"||e==="R"){const C=f.searchByLane(s,r);if(C){const D=m.new().crd(C.code).txt(" was replaced");e==="R"?D.txt(" with ").crd(g.code).txt(".").go():D.txt(".").go(),C.status="R",x.addEvents(W.replaced(g,C))}}this.field.push(g);const y=W.enterField(g);return y.forged=e==="F",this.birthOrder.push({creatId:g.id,time:h||N.tick()}),x.addEvents(y),g.enforceEffects("PH"),te.positionChange(r),g}findBirthTime(t){const e=this.birthOrder.filter(r=>r.creatId===t).map(r=>r.time);if(e.length!==0)return e.length>1&&console.warn("wery curious, more than one birth record for creat "+t),e[0]}qActiveCreats(){return this.creatByTarget(p.crTarg())}qPlayerCreats(t){const e=p.crTarg();return e.player=k.toTarget(t),this.creatByTarget(e)}ddf1(){return this.creatByTarget(p.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(p.crEnemyTarg())}}const f=new ws;class xs{creatFightState(t,e){return t?e===1||t.defender||t.sleeping&&!t.aggressive?1:e===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t,e,r,s){if(t>0){let h=0;if(e>0){const u=t===2&&r.breakthrough;h=s.hurtBattle(r.attack,r,u)}else t===2&&(h=r.attack);h>0&&k.hurtBattle(!r.owner,h,r)}}fight(t){const e=!ot.simOn;e&&m.add("FIGHT!");let r=2,s=1;t&&(M.mainBattle=!1,r=0,s=0);const h=k.getActiveB(),u=[],g=[];f.laneIdx.forEach(C=>{const D=f.searchByLane(C,h),$=f.searchByLane(6-C,!h),K=this.creatFightState(D,r),_=this.creatFightState($,s);(K===2||_===2)&&(g.push([K,_,D,$],[_,K,$,D]),K===2&&(M.ffs++,u.push([C,h])),_===2&&u.push([f.oppositeLane(C),!h]))}),this.barking&&u.length>0&&e&&S.dogBark();let y;e?y=ft.drawCombat(u):y=Promise.resolve(),y.then(()=>{g.forEach(C=>this.dukeItOut(...C)),te.playerHealthChange(),O.deathCheck(),x.type="C0",v.actionDone()})}barking=!0}const hr=new xs;class Ds{aiMode=!1;aiActive=!1;winFlag=0;ui=this.freshUI();idnum=0;clock=0;genId(){return this.idnum++,"@"+this.idnum.toString(36)}tick(){return this.clock++,this.clock}getState(){return{i:this.idnum,t:this.clock}}setState(t,e){this.idnum=t,this.clock=e}newGame(t,e){this.idnum=0,this.clock=0,hr.barking=S.options.bark,k.activePlayer=S.randInt(0,2)===0,this.aiActive=!k.activePlayer&&this.aiMode,k.isLocalA=this.aiMode||k.activePlayer,v.actionHistory=[],ot.turnSims=0,ot.turnTime=0,f.reset(),O.reset(),this.ui=this.freshUI(),M.firstTurn=!0,this.winFlag=0;const r=k.nameOSaurus();k.initPlayer(!0,t,"Forgy McGhee",25),k.initPlayer(!1,e,r[0],r[1]),m.setup(),m.add("Ready...FIGHT!"),M.startTurn()}freshUI(){return{handScrollLeft:0,detailStack:[],deckContents:[],deckScroll:0,deckSummary:!1,animating:!1}}}const N=new Ds;class Fs{loglist;you=!0;localPlayerKey="";oppPlayerKey="";localPlayerSpan="";oppPlayerSpan="";constructor(){this.loglist=document.getElementById("loglist")}setup(){this.you=k.getLocalB(),this.localPlayerKey=this.you?"^pa":"^pb",this.oppPlayerKey=this.you?"^pb":"^pa",this.localPlayerSpan=this.span(k.toPlayer(this.you).name,"green"),this.oppPlayerSpan=this.span(k.toPlayer(!this.you).name,"red")}addLi(t){const e=document.createElement("li");e.innerHTML=t,this.loglist.appendChild(e),e.scrollIntoView({behavior:"smooth",block:"end"})}span(t,e,r=""){const s=r.length>0?` onclick="sfapi.details('${r}')"`:"";return`${t}`}add(t){this.addLi(t)}debug(t,e=!0){(e||S.options.debug)&&this.addLi(this.span(t,"debug"))}clearAll(){this.loglist.innerHTML=""}new(){return new Tr}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let e=!0;for(;e;){const r=t.indexOf("^c");if(r===-1)e=!1;else{const s=t.slice(r+2,r+6);if(s==="POIS")t=t.replaceAll("^c"+s,this.span("Poison","green"));else{const h=I.getCard(s);t=t.replaceAll("^c"+s,this.span(`${h.name} ${h.level}`,this.factMap[h.faction],s))}}}return t}parse(t){const r=t.guts.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),s=this.parseCards(r);this.add(s)}cardText(t){let e;if(t.type==="C"){const r=t,s=[];r.iRegen>0&&s.push("Regenerate "+r.iRegen),r.iArmor>0&&s.push("Armor "+r.iArmor),r.iMobile>0&&s.push("Mobility "+r.iMobile),r.iBT&&s.push("Breakthrough"),r.iDefend&&s.push("Defender"),r.iAggro&&s.push("Aggressive"),r.consistent&&s.push("Consistent"),s.length>0&&s.push(""),e=s.join(". ")+t.text}else e=t.text;return(t.isFree?"Free. ":"")+(t.overload?"Overload. ":"")+e}cardTextSplit(t){const e=[];if(t.isFree&&e.push("Free"),t.consistent&&e.push("Consistent"),t.overload&&e.push("Overload"),t.type==="C"){const r=t;r.iRegen>0&&e.push("Regenerate "+r.iRegen),r.iArmor>0&&e.push("Armor "+r.iArmor),r.iMobile>0&&e.push("Mobility "+r.iMobile),r.iBT&&e.push("Breakthrough"),r.iDefend&&e.push("Defender"),r.iAggro&&e.push("Aggressive")}if(t.text.length>0&&e.push(...t.text.split("~")),t.level===1){const r=t.cardCode(),s=_e.find(h=>h[0]===r);if(s){let h;const u=s[1];u.length===2&&u[0]===u[1]?h="2x "+I.getCard(`${u[0]}1`).name:h=u.map(g=>I.getCard(`${g}1`).name).join(", "),e.push("Solbind: "+h)}}return e}factionText(t){switch(t){case "A":return"Alloyin";case "N":return"Nekrium";case "T":return"Tempys";case "U":return"Uterra";case "X":return""}}cardTypeText(t){return t==="C"?"Creature":"Spell"}rarityText(t){switch(t){case "C":return"Common";case "R":return"Rare";case "H":return"Heroic";case "L":return"Legendary";case "T":return"Token"}}levelGateText(t,e=!1){const r=e?" ":"";return t===1?`level 1${r}`:t===2?`level 2 or lower${r}`:""}jr9(t,e,r=!1){return t!==0&&e!==0?`${this.bufferson(t,!0)}${r?",":" and"} ${this.bufferson(e,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(e,!1)}bufferson(t,e){return`${t>0?"+":""}${t} ${e?"attack":"health"}`}dbdtac(t=-1){return`deals battle damage to a ${t===-1?"":this.levelGateText(t,!0)}creature`}dbdtap(){return"deals battle damage to a player"}daluac(t=!1){return(t?"D":"d")+"iscard and level up a card"}forglied(t){return t==="X"?"Forge":`Allied ${this.factionText(t)}`}fastName(t){t.length===3&&(console.warn("HEY a 3 char card code was passed to fastName, why?: "+t),t=`${t}1`);const e=I.getCard(t);return e.name+" "+e.level}pName(t){return t?"A":"B"}tokName(t){return`${t.iAttack}/${t.iHealth} ${t.name}`}cardActionText(t){let e=`Card (${this.fastName(t.host)}) `;if(t.zone==="F"){const r=t,s=r.playerA?r.lane:6-r.lane,h=f.searchByFSA(r),u=h?this.fastName(h.code):"Empty";e+=`Lane ${s}${this.pName(r.playerA)} ${u}`}else if(t.zone==="H"){const r=t;e+=`Hand (${this.fastName(r.card)})`}else if(t.zone==="P"){const r=t;e+=`Player (${this.pName(r.playerA)})`}else t.zone==="R"?e+="Full Board":t.zone==="B"?e+="Button":t.zone==="N"&&(e+="Special");return e}actionText(t){switch(t.key){case "ACTV":return`Activate (${this.fastName(t.host)})`;case "CARD":return this.cardActionText(t);case "FITE":return"Fight";case "FORG":return`Forge to Lane ${6-t.lane}`;case "HDSC":return`Hand Discard (${this.fastName(t.host)})`;case "HPLY":const r=t;return`Play (${this.fastName(r.card)})`;case "MEND":return"Move End";case "MOVE":return"Move Start";case "NOTR":return"Pick None";case "ENDT":return"Donethanks";case "CANC":return"Cancel";default:return t.key}}tribeT={["AN"]:"Any",["AB"]:"Abomination",["AG"]:"Angel",["AS"]:"Asir",["BR"]:"Bear",["BE"]:"Beast",["CT"]:"Cat",["CR"]:"Chrysalis",["CY"]:"Cyborg",["DF"]:"Darkforged",["DM"]:"Demon",["DN"]:"Dinosaur",["DG"]:"Dragon",["DK"]:"Drakin",["DY"]:"Dryad",["ER"]:"Earth",["EL"]:"Elemental",["EN"]:"Energeist",["FY"]:"Fairy",["FR"]:"Fire",["FB"]:"Forgeborn",["FT"]:"Frost",["GT"]:"Giant",["GN"]:"Gnome",["GL"]:"Golem",["GG"]:"Grimgaunt",["GD"]:"Guardian",["HM"]:"Human",["HY"]:"Hydra",["IC"]:"Ice",["IN"]:"Insect",["LT"]:"Lightning",["LP"]:"Lupin",["MT"]:"Manticore",["MC"]:"Mech",["MM"]:"Metamind",["NG"]:"Naga",["OZ"]:"Ooze",["PX"]:"Phoenix",["PL"]:"Plant",["RM"]:"Ram",["RB"]:"Robot",["SY"]:"Satyr",["SE"]:"Seraph",["SH"]:"Shaman",["SS"]:"Shapeshifter",["SK"]:"Skeleton",["SN"]:"Snake",["SP"]:"Spider",["ST"]:"Spirit",["TG"]:"Tigrin",["TK"]:"Tuskin",["VP"]:"Vampire",["WD"]:"Wanderer",["WT"]:"Water",["WN"]:"Wind",["WF"]:"Wolf",["WR"]:"Wurm",["YT"]:"Yeti",["ZB"]:"Zombie"};tribeText(t){return this.tribeT[t]}}const m=new Fs;class Hs{handleMainMenuButton(t){t.param==="D"?(mt.setMode("D"),S.options.wasDrafting=!0,ut.initDraft()):t.param==="C"?(mt.setMode("C"),S.options.wasDrafting=!1,Bt.initConstructed()):t.param==="I"?(mt.setMode("I"),ft.drawAll()):window.open("deckbuilder.html")}handleMenuButton(t){const e=S.deTil(t.param),r=e[0];let s=!0;if(r==="RP")s=!1,m.clearAll(),S.options.wasDrafting?ut.replay():Bt.replay();else if(r==="MM")mt.setMode("M"),m.clearAll();else if(r==="CN"||r==="CP"||r==="CX"||r==="CR"||r==="CI"||r==="CV"||r==="LK")Bt.handleMenuPick(r,e[1]);else if(r==="DN"||r==="DR"||r==="DI"||r==="DV"||r==="LD"||r==="GP"||r==="OD"||r==="DT")ut.handleMenuPick(r,e[1]);else if(r==="HH")S.toggleOption("highHealth");else if(r==="CH")S.toggleOption("cheater");else if(r==="BB")S.toggleOption("bark");else if(t.param==="BC")S.toggleOption("bigCards");else if(r==="90"){const h=S.options.scale==="90"?"100":"90";ft.changeScale(h)}else r==="RU"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/rules")):r==="FQ"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/faq")):(s=!1,console.error("missing handler for menu button param "+t.param));s&&ft.drawAll()}handleUIButton(t){t.param==="DM"?(S.setClickMode("I"),ft.drawAll()):t.param==="TM"?(S.setClickMode("T"),ft.drawAll()):t.param==="EX"?(mt.setMode("X"),v.ddf5(this.generateExitActions())):console.error("missing handler for common button param "+t.param)}generateExitActions(){const t=p.basicAction("CANC");return t.param="PM",[t,p.menuButtonAction("MM")]}}const Ke=new Hs;class Bs{stack=["M"];setMode(t){this.deetMode(t)||t==="X"||t==="S"?this.stack.push(t):(this.stack=[t],t==="G"?(et.get("game-ui").clear(),ft.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(et.get("game-ui").clear(),ft.setBackground("blueface")):t==="M"&&(ft.clearAll(),ft.setBackground("mainmenu")))}popMode(){this.stack.pop()}get mode(){const t=this.stack;return t[t.length-1]}get isDetailMode(){return this.deetMode(this.mode)}get baseMode(){return this.stack[0]}deetMode(t){return t==="R"||t==="T"}}const mt=new Bs;class Ps{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const e=k.toPlayer(t),r=[],s=[];if(e.deck.forEach(h=>{I.getCard(h).consistent?r.push(h):s.push(h)}),r.length===0)this.shuffle(e.deck);else{this.shuffle(s);const h=20-r.length,u=r.concat(s.slice(0,h));this.shuffle(u),e.deck=s.slice(h).concat(u)}}shuffle(t){const e=t.length,r=(s,h)=>{const u=t[s];t[s]=t[h],t[h]=u};if(e>0){let s,h;const u=e*4;for(let g=0;gr.decks).flat(),e=S.randInt(0,t.length);return t[e]}stockDeckByName(t,e){let r;if(fe.some(s=>s.id===t?s.decks.some(h=>{h.name===e&&(r=h)}):!1),r)return r;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+e)}ripper(t,e,r){const s=[[15,8,5],[30,15,10]],h=this.getDeckCards([],[t]),u=[],g=s[r===15?0:1][e-1];for(;u.length$===D)||u.push(D)}const y=u.map(C=>({card:C,num:e}));return e===2&&r===15&&(y[0].num=1),y}deckify(t){const e=t.map(r=>{const s=_e.find(h=>h[0]===r);return s?s[1]:[]}).flat();return t.concat(e).map(r=>`${r}1`)}parseDeck(t){const e=t.map(r=>Array(r.num).fill(r.card)).flat();return this.deckify(e)}validDeck(t){const e={};t.forEach(C=>{e[C.card]?e[C.card]+=C.num:e[C.card]=C.num});const r=Object.entries(e).map(C=>({card:C[0],num:C[1]})),s=r.map(C=>C.num).reduce((C,D)=>C+D,0);if(s!==30)return"Deck must have 30 cards, found "+s;const h=[];let u="";if(r.some(C=>{const D=Rt.findIndex($=>$.crd===C.card);return D===-1?(u=C.card,!0):(h.push(Rt[D].fct),!1)}))return`Invalid card code: '${u}'`;let g=0;if(r.some(C=>C.num>3?(u=C.card,g=C.num,!0):!1))return`${g} copies of '${u}' ${m.fastName(u).slice(0,-2)}`;const y=[...new Set(h)];return y.length>2?"Deck must have two or less factions, found: "+y.join():""}getDeckCards(t=[],e=[],r=[]){return t.length===0&&e.length===0&&r.length===0?Rt.map(s=>s.crd):t.length>0&&e.length>0&&r.length===0?Rt.filter(s=>t.includes(s.rty)&&e.includes(s.fct)).map(s=>s.crd):t.length>0&&e.length===0&&r.length===0?Rt.filter(s=>t.includes(s.rty)).map(s=>s.crd):t.length===0&&e.length>0&&r.length===0?Rt.filter(s=>e.includes(s.fct)).map(s=>s.crd):t.length>0&&e.length>0&&r.length>0?Rt.filter(s=>t.includes(s.rty)&&e.includes(s.fct)&&r.includes(Math.floor(s.set))).map(s=>s.crd):t.length>0&&e.length===0&&r.length>0?Rt.filter(s=>t.includes(s.rty)&&r.includes(Math.floor(s.set))).map(s=>s.crd):t.length===0&&e.length>0&&r.length>0?Rt.filter(s=>e.includes(s.fct)&&r.includes(Math.floor(s.set))).map(s=>s.crd):Rt.filter(s=>r.includes(Math.floor(s.set))).map(s=>s.crd)}getCardFaction(t){const e=Rt.find(r=>r.crd===t);return e?e.fct:"X"}getCardRarity(t){const e=Rt.find(r=>r.crd===t);return e?e.rty:"T"}cardStats(){Te.forEach(t=>{const e=`${m.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,r=oe.map(s=>`${m.rarityText(s)}: ${this.getDeckCards([s],[t]).length}`).join("; ");console.log(e+r)})}loadPromise=new we;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new we,this.loader.click(),await this.loadPromise.getPromise(),this.fileguts==="")return"";if(this.fileguts.startsWith("!")){const s=this.fileguts.substring(1);return this.fileguts="",s}const t=JSON.parse(this.fileguts);this.fileguts="";const e=t.cards,r=this.validDeck(e);return r||t}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const e=this.loader.files;if(e&&e.length>0){const s=e[0];var r=new FileReader;r.onload=h=>{try{var u=r.result;if(u){var g=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(u)));g.cards&&Array.isArray(g.cards)&&!g.cards.some(y=>!(y&&typeof y.card=="string"&&Number.isInteger(y.num)))?(this.fileguts=JSON.stringify(g),this.loadPromise.resolveMe()):this.readError("File format is invalid.")}else this.readError("File read was empty.")}catch(y){console.error(y),this.readError("Error reading file.")}};try{r.readAsArrayBuffer(s)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}const Xt=new Ps;class Ns{phase="ST";enterMainPhase(){this.phase="MN";const t=k.getActive(),e=this.getMainPhaseActions(t);N.aiActive&&ot.hitMainPhase(),v.ddf5(e,!0)}async whatNext(t=!1){if(N.winFlag!==0){ot.simOn?(ot.simEndpoint(N.winFlag===1?"L":"W"),N.winFlag=0):(v.actionHistory=[],N.aiActive=!1,N.ui.animating=!1,await ft.drawAll());return}if(await ft.drawAll(),v.actionHistory.length>0)v.ddf5();else if(t)mt.setMode("S"),ft.drawAll();else if(x.getNextTrigger())Xe.resolve(x.getNextTrigger());else if(!x.deathCheck)O.deathCheck(),this.whatNext();else if(x.events.length>0)x.startBatch();else switch(f.purge(),O.purge(),this.phase){case "MN":this.enterMainPhase();break;case "ET":this.phase="PT",x.addEvents(W.player("PTN",k.getActiveB())),Et.expireMods(),this.whatNext();break;case "PT":M.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),this.phase="MN",this.whatNext();break;case "ST":ot.simOn?ot.simEndpoint("T"):(this.phase="MN",ot.cheater()?S.sleep(500).then(()=>this.whatNext()):S.sleep(100).then(()=>this.whatNext()));break}}expireatron(t,e,r,s){e.mods.forEach(h=>{h.expiry===s?h.expiry=r:h.expiry===r&&t.push([e,h])})}expireMods(){const t=f.creatByTarget(p.crTarg());t.push(k.playerA,k.playerB);let e=[];this.phase==="PT"?t.forEach(r=>{this.expireatron(e,r,"ET","EN")}):this.phase==="ST"&&t.forEach(r=>{this.expireatron(e,r,"ST","SN")}),e.length>0&&(e.forEach(r=>{const s=r[0];s instanceof Se?s.expireMod(r[1]):k.expireMod(s,r[1])}),te.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const e=this.getHandActions(t),r=this.getFieldActions(t);let s=M.mainBattle,h="M";return s||(s=f.ddf1().some(g=>g.extraBattles>0&&g.isActive&&!g.defender),h="E"),s&&e.push({key:"FITE",zone:"B",param:h,host:""}),s||e.push({key:"ENDT",zone:"B",param:"",host:""}),[e,r].flat()}getHandActions(t){const e=[...new Set(t.hand)],r=[],s=[];e.forEach(y=>{I.getCard(y).isFree?r.push(y):s.push(y)});const h=r.map(y=>[y,"FREE"]);M.freeCards.forEach(y=>{w.cardByTarget(s,y.condition).forEach(D=>{h.push([D[0],y.id]),s.splice(s.indexOf(D[0]),1)})}),h.push(...s.map(y=>[y,""]));const u=M.regularPlays>0;let g=t.hand.map((y,C)=>[y,C]);return u||(g=g.filter(y=>!s.includes(y[0]))),g.map(y=>{const C=h.find(D=>D[0]===y[0]);return C||console.error("No cost found for card"+y[0]),p.handSelectAction("HPLY",y[0],C[1],y[1])})}getFieldActions(t){const e=f.qPlayerCreats(t.isPlayerA),r=e.filter(h=>f.canMove(h).length>0).map(h=>p.fieldSelectAction("MOVE",h.lane,h.owner)),s=e.filter(h=>h.isActive&&h.activationAvailable?I.getCard(h.code).canActivate(h):!1).map(h=>{const u=p.fieldSelectAction("ACTV",h.lane,h.owner);return u.host=h.code,u.param=h.id,u});return r.forEach(h=>{const u=s.findIndex(g=>g.lane===h.lane);u>-1&&(s.splice(u,1),h.param="ACTV")}),r.concat(s)}}const Et=new Ns;class Ms{playerA;playerB;activePlayer;isLocalA;constructor(){this.playerA=this.newPlayer(!0),this.playerB=this.newPlayer(!1),this.activePlayer=!0,this.isLocalA=!0}getPlayerState(t){return{deck:t.deck,discard:t.discard,hand:t.hand,health:t.health,triggers:t.triggers,turn:t.turn,rank:t.rank,poison:t.poison,armor:t.armor,armorDmg:t.armorDmg,mods:t.mods}}setPlayerState(t,e){e.deck=t.deck,e.discard=t.discard,e.hand=t.hand,e.health=t.health,e.triggers=t.triggers,e.turn=t.turn,e.rank=t.rank,e.poison=t.poison,e.mods=t.mods,e.armor=t.armor,e.armorDmg=t.armorDmg}getState(){const t={pA:this.getPlayerState(this.playerA),pB:this.getPlayerState(this.playerB),actP:this.activePlayer};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.setPlayerState(e.pA,this.playerA),this.setPlayerState(e.pB,this.playerB),this.activePlayer=e.actP}pt2pb={["X"]:()=>{throw new Error("goof passed any to player target boolean-o-fier")},["A"]:()=>!0,["B"]:()=>!1,["F"]:()=>this.getActiveB(),["E"]:()=>!this.getActiveB()};b2p(t){return t?this.playerA:this.playerB}toPlayer(t){return typeof t=="boolean"?this.b2p(t):typeof t=="string"?this.b2p(this.pt2pb[t]()):t}toBool(t){return typeof t=="boolean"?t:typeof t=="string"?this.pt2pb[t]():t.isPlayerA}toTarget(t){return typeof t=="string"?t:(typeof t=="boolean"?t:t.isPlayerA)?"A":"B"}getActive(){return this.b2p(this.activePlayer)}getActiveB(){return this.activePlayer}getLocal(){return this.b2p(this.isLocalA)}getLocalB(){return this.isLocalA}hurtPlayer(t,e){if(e<1)return 0;const r=this.totalArmor(t),s=Math.max(Math.min(e,r-t.armorDmg),0);let h=e-s;return t.armorDmg+=s,t.health-=h,h}hurtDirect(t,e,r){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(m.new().crd(r).txt(` dealt ${h} dmg to `).plr(s).txt(".").go(),x.addEvents(W.damage(!1,h,!1,!1,s.isPlayerA,void 0)),te.playerHealthChange())}hurtBattle(t,e,r){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(m.new().crd(r.code).txt(` dealt ${h} battle dmg to `).plr(s).txt(".").go(),x.addEvents(W.damage(!0,h,!0,!1,s.isPlayerA,r)))}heal(t,e){const r=this.toPlayer(t);r.health+=e,m.new().plr(r).txt(` gained ${e} health.`).go(),x.addEvents(W.playerHeal(r.isPlayerA,e)),te.playerHealthChange()}drawCard(t,e){const r=this.toPlayer(t);for(let s=0;ss.granter===e?(s.type==="AR"&&(r.armorDmg=Math.max(0,r.armorDmg-s.value)),!1):!0)}removeModSafe(t,e){const r=this.toPlayer(t);this.hasMod(r,e)&&this.removeMod(r,e)}expireMod(t,e){const r=this.toPlayer(t);r.mods.splice(p.modIdx(r.mods,e),1)}newPlayer(t){return{hand:[],deck:[],discard:[],isPlayerA:t,health:120,mods:[],name:"",nameOffset:0,triggers:[],turn:1,rank:1,armor:0,armorDmg:0,poison:0,avatar:Math.floor(Math.random()*17)}}initPlayer(t,e,r,s){const h=this.toPlayer(t);h.name=r,h.nameOffset=s,h.turn=1,h.rank=1,h.health=S.options.highHealth?360:120,h.discard=[],h.deck=Xt.parseDeck(e),h.mods=[],h.triggers=[],h.poison=0,h.armor=0,h.armorDmg=0,this.ambushScan(h),Xt.shuffleDeck(h),h.hand=h.deck.splice(-5,5)}ambushScan(t){this.boosh(t,"LLD","PC"),this.boosh(t,"LLG","MV"),this.boosh(t,"LLS","EF"),this.boosh(t,"LLT","LG")}boosh(t,e,r){const s=e+"1";if(t.deck.includes(s)){const h=p.trigger(r,s);h.cardCode=s,h.customCode="AB",t.triggers.push(h)}}nameOSaurus(){const t=[["The Garmgunt",5],["Dr. Lucksack",15],["Sgt. Misplay",22],["Salty O'Teary",12],["M.V.P. Sprout",19],["Uncle Punchy",7],["Yesetherian",20],["Rubbish Asir",20],["Hogwash Druid",0],["Offal Savant",15],["Filth Knight",17],["Dirty Mystic",16],["Ether Buffoon",6],["Nexus Dimwit",12],["Hairy Poppins",11],["Al E. Gator",26],["Anita Bath",28],["Bennie Factor",9],["Chris P. Bacon",9],["Don Keigh",29],["Earl E. Bird",25],["Hugh Jass",34],["Jay Walker",28],["Barb Dwyer",22],["Robyn Banks",18],["Anna Graham",9],["Holly Graham",6],["Justin Case",26],["Sir Loins",39]],e=t[S.randInt(0,t.length)];return[e[0],e[1]+18]}}const k=new Ms;class Rs{stateStack=[];popCheck(){if(this.stateStack.length===0)throw new Error("Attempted to manipulate empty stack")}saveState(){const t={action:v.getState(),aiInPhase:ot.inPhase,batch:x.getState(),death:O.getState(),field:f.getState(),game:N.getState(),mode:JSON.stringify(mt.stack),phase:Et.phase,player:k.getState(),turn:M.getState()};this.stateStack.push(t)}restoreState(){this.popCheck();const t=this.stateStack[this.stateStack.length-1];v.setState(t.action),ot.inPhase=t.aiInPhase,x.setState(t.batch),O.setState(t.death),f.setState(t.field),N.setState(t.game.i,t.game.t),mt.stack=JSON.parse(t.mode),Et.phase=t.phase,k.setState(t.player),M.setState(t.turn)}popState(){this.popCheck(),this.stateStack.pop()}}const de=new Rs;class Es{toActions(t){return(Array.isArray(t)?t:[t]).map(r=>{const s=this.actionTargGuts(r);return s.forEach(h=>{h.host=r.host,h.param=r.param,h.hint=r.hint}),s}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(e=>p.handSelectAction(t.key,e[0],"",e[1]));if(t.target==="TF"){if(t.field==="O")return f.creatByTarget(t).map(e=>p.fieldSelectAction(t.key,e.lane,e.owner));{const e=t.player==="X"?[!0,!1]:[k.toBool(t.player)],r=S.isUn(t.lanes)?f.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return e.map(s=>r.map(h=>p.fieldSelectAction(t.key,h,s))).flat();if(t.field==="E")return e.map(s=>f.emptyLanes(s).filter(h=>r.includes(h)).map(h=>p.fieldSelectAction(t.key,h,s))).flat()}}if(t.target==="TP")return t.player==="X"?[p.playerSelectAction(t.key,!0),p.playerSelectAction(t.key,!1)]:[p.playerSelectAction(t.key,k.toBool(t.player))];if(t.target==="TB")return[{key:t.key,zone:"B",host:t.host,param:""}];if(t.target==="TR")return[{key:t.key,zone:"R",host:t.host,param:""}];if(t.target==="TD")return[];throw new Error("Target encountered that doesnt have mappings to actions: "+t.target)}cardByTarget(t,e){let r=t.map((s,h)=>[s,h]);if(e){if(S.isUn(e.deckPositionSkip)||(r=r.filter(s=>s[1]!==e.deckPositionSkip)),e.faction!=="X"&&(r=r.filter(s=>I.getCard(s[0]).faction===e.faction)),e.tribe!=="AN"&&(r=r.filter(s=>{const h=I.getCard(s[0]);return h.type==="C"?h.isTribe(e.tribe):!1})),e.canLevel&&(r=r.filter(s=>I.getCard(s[0]).canLevel())),e.level!=="LA"){const s=w.levelTargetToLevel(e.level);r=r.filter(h=>{const u=parseInt(h[0].substring(3,4));return s.includes(u)})}if(e.card!=="A"){const s=e.card==="C"?"C":"S";r=r.filter(h=>I.getCard(h[0]).type===s)}e.cardCode&&(r=r.filter(s=>I.getCard(s[0]).cardCode()===e.cardCode))}return r}deckByTarget(t){const e=k.toPlayer(t.player);let r;if(t.target==="TH")r=e.hand;else if(t.target==="TD")r=e.discard;else if(t.target==="DK")r=e.deck;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(r,t)}buttonTarget(t,e="",r=""){return p.actionTarget("TB",t,e,r)}boardTarget(t,e){return p.actionTarget("TR",t,e,"")}ddf2(t){return t===1?"L1":t===2?"LN":"LA"}lt2l={["LA"]:()=>[1,2,3,4],["L1"]:()=>[1],["L2"]:()=>[2],["L3"]:()=>[3],["LN"]:()=>[1,2]};levelTargetToLevel(t){return this.lt2l[t]()}levelTargetTest(t,e){return this.levelTargetToLevel(t).includes(e)}levelTestCommon(t,e){return this.levelTargetTest(this.ddf2(e),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}const w=new Es;class Is{ddf8(t){return t.trigger.type==="FR"?this.forgeTriggerTest(t,!1):t.trigger.type==="VN"?this.vengeanceTriggerTest(t):t.trigger.type==="FK"?this.flankTriggerTest(t):t.trigger.type==="AS"?this.forgeTriggerTest(t,!0):t.trigger.type==="UP"?this.upgradeTriggerTest(t):t.trigger.type==="DM"&&t.event.code==="DMG"||t.trigger.type==="HG"&&t.event.code==="CHL"||t.trigger.type==="EF"&&t.event.code==="ENT"||t.trigger.type==="DS"&&t.event.code==="DIE"||t.trigger.type==="PC"&&t.event.code==="PLC"||t.trigger.type==="MV"&&t.event.code==="MOV"||t.trigger.type==="RP"&&t.event.code==="RPL"||t.trigger.type==="LG"&&t.event.code==="PHL"||t.trigger.type==="TS"&&t.event.code==="TRS"||t.trigger.type==="TE"&&t.event.code==="TRE"||t.trigger.type==="PT"&&t.event.code==="PTN"||t.trigger.type==="RU"&&t.event.code==="RKU"?this.generalTriggerTest(t):!1}resolve(t){t.trigger.interactive&&(t.host==="P"?console.error("Encountered player hosted trigger that is interactive!!"):x.iaTrigLane=f.jr5(t.creatId).lane),I.getCard(t.trigger.logicCode).jr8(t)}forgeTriggerTest(t,e){if(t.event.code==="ENT"){const r=t.event;if(r.forged){const s=f.jr5(t.creatId),h=s.id===r.creatId&&s.status==="A";return e&&h?!s.opposed:h}}return!1}upgradeTriggerTest(t){if(t.event.code==="RPL"){const e=t.event,r=f.searchById(t.creatId);if(r)return r.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const e=t.event,r=f.searchById(t.creatId);if(r)return r.status==="D"&&r.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const e=t.event,r=f.jr5(t.creatId);return r.status==="A"&&r.id===e.creatId}return!1}generalTriggerTest(t){return I.getCard(t.trigger.logicCode).ddf8(t)}}const Xe=new Is;class Ls{firstTurn=!0;mainBattle=!0;deathsA=[];deathsB=[];ffs=0;regularPlays=2;cardsPlayed=0;freeCards=[];newPre=[];newPost=[];getState(){const t={mB:this.mainBattle,dA:this.deathsA,dB:this.deathsB,cP:this.cardsPlayed,ffs:this.ffs,fC:this.freeCards,rP:this.regularPlays,n1:this.newPre,n2:this.newPost};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.mainBattle=e.mB,this.deathsA=e.dA,this.deathsB=e.dB,this.cardsPlayed=e.cP,this.ffs=e.ffs,this.freeCards=e.fC,this.regularPlays=e.rP,this.newPre=e.n1,this.newPost=e.n2}resetTurnData(){this.mainBattle=!0,this.deathsA=[],this.deathsB=[],this.ffs=0,this.regularPlays=2,this.cardsPlayed=0,this.freeCards=[],this.newPre=[],this.newPost=[],this.firstTurn&&(this.firstTurn=!1,this.regularPlays=1)}forgeCard(t,e,r,s){const h=this.cardPlayed(e,r,s),u=k.getActive();m.new().txt("Forged ").crd(h.code).txt(".").go(),f.birth(h,"F",u.isPlayerA,t.lane),v.actionDone()}levelAndDiscardA(t){return this.levelAndDiscard(t.card,t.position)}levelAndDiscard(t,e,r=!0,s="F"){const h=I.getCard(t),u=k.toPlayer(s);if(e>-1?u.hand.splice(e,1):m.debug("Bad play index: "+e+" ("+t+")"),!h.overload){const g=h.levelUpCard();u.discard.push(g),r&&g!==t&&m.new().plr(u).txt(" leveled a card.").go()}return h}cardPlayed(t,e,r,s=!1){const h=this.levelAndDiscard(t,r,s),u=k.getActive();if(e==="")this.regularPlays-=1;else if(e!=="FREE"){const g=this.freeCards.findIndex(y=>y.id===e);g>-1?this.freeCards.splice(g,1):console.error("Could not find free card rule!")}if(this.cardsPlayed+=1,!s){const g=W.playCard(t,u.isPlayerA);x.addEvents(g)}return h}passTheTurn(){if(k.activePlayer=!k.activePlayer,Et.phase="WT",N.aiMode){if(!ot.simOn)if(N.aiActive=!N.aiActive,N.aiActive)ot.turnSims=0,ot.turnTime=0;else{const t=`🤖: ${this.calma(ot.turnSims)} pontifications in ${(ot.turnTime/1e3).toFixed(1)} seconds.`;m.new().txt(t).go()}}else k.isLocalA=k.activePlayer;this.startTurn()}calma(t){let e=t.toString();return e.length<4?e:e.length>6?e.slice(0,-6)+","+e.slice(-6,-3)+","+e.slice(-3):e.slice(0,-3)+","+e.slice(-3)}startTurn(){const t="------";if(ot.log&&N.aiActive&&N.aiMode&&console.log(t+" AI Turn Start "+t),!ot.simOn&&(m.new().txt(t).go(),m.new().plr(k.getActiveB()).txt(" starts turn.").go(),N.aiActive&&N.aiMode&&S.options.debug)){const e=k.toPlayer(!1);m.debug("!! Opponent Hand !!"),e.hand.forEach(r=>m.new().crd(r).go()),m.debug("!! ~~~~~~~ !!")}this.resetTurnData(),Et.phase="ST",x.addEvents(W.player("TRS",k.getActiveB())),Et.expireMods(),Et.whatNext(!N.aiMode)}endTurn(){const t=k.getActive();t.discard.push(...t.hand),t.hand=[],t.turn++;const e=t.turn>4;x.addEvents(W.player("TRE",t.isPlayerA)),e&&(t.turn=1,t.rank++,m.new().plr(t).txt(" hits Rank "+t.rank+".").go(),x.addEvents(W.player("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],Xt.shuffleDeck(t.isPlayerA)),f.qActiveCreats().forEach(r=>{r.extraBattles=0}),k.drawCard(t,5),Et.phase="ET",v.actionDone()}mobility(t){const e=f.jr5(t.param);m.new().crd(e.code).txt(" moved.").go(),e.mobilityAvailable=!1,e.move(t.lane),v.actionDone()}allied(t,e){const r=e??k.getActive(),s=p.target("TH");return s.player=k.toTarget(r),s.faction=t,w.deckByTarget(s).length>0}freeCard(t){const e=p.freeCard(t);return this.freeCards.push(e),e}birthRegistrar(t){this.mainBattle?this.newPre.push(t):this.newPost.push(t)}}const M=new Ls;class lr{id;dom;context;width;height;constructor(t){if(this.id=t,this.dom=document.getElementById(t),!this.dom)throw new Error(`Could not find canvas id ${t}`);this.context=this.dom.getContext("2d"),this.width=this.dom.width,this.height=this.dom.height,this.context.textBaseline="top",this.context.shadowOffsetX=1,this.context.shadowOffsetY=1}show(){this.dom.hidden=!1}hide(){this.dom.hidden=!0}get visible(){return!this.dom.hidden}clear(){this.context.clearRect(0,0,this.width,this.height)}sprite(t,e,r){this.context.drawImage(t,e,r)}updateScale(t){this.context.scale(t,t)}}class Mt{getCanv(t){return t instanceof lr?t:et.get(t)}async drawSprite(t,e,r,s,h={}){const u=this.getCanv(t).context,g=await S.getSprite(S.imgRoot+e);let y=1;h&&(y=h.alpha??1),y<1&&(u.globalAlpha=y),u.drawImage(g,r,s,g.naturalWidth,g.naturalHeight),y<1&&(u.globalAlpha=1)}async drawText(t,e,r,s,h={}){const u=this.getCanv(t).context,g=h.fontSize??24;S.pxRatio===2&&(s=this.retinaTextY(s,g)),u.fillStyle=h.colour||"#000000",u.font=`${g}px ${h.fontName||"cinzel"}`,u.shadowColor=h.shadow?"#000000":"#00000000",u.fillText(e,r,s),u.shadowColor="#00000000"}async spriteNumber(t,e,r,s,h,u){let g=r-this.numOffset(e,h);const y=[];e.toString().split("").forEach(C=>{y.push(this.drawSprite(t,this.numSpriteUrl(C,h,u),g,s)),g+=this.numSize(C,h)}),await Promise.all(y)}async drawHighlight(t,e,r,s,h,u="#00FF00"){const g=u.length===7?u.concat("aa"):u,y=this.getCanv(t);y.context.strokeStyle=g,y.context.beginPath(),y.context.rect(e,r,s,h),y.context.stroke()}hlColour(t){return t==="CANC"?"#FF0000":"#00FF00"}drawRarity(t,e,r,s){return this.drawSprite(t,`icons/rarity/new/${m.rarityText(e).toLowerCase()}.png`,r,s)}drawFaction(t,e,r,s){const h=e==="T"?2:0;return this.drawSprite(t,`icons/faction/${m.factionText(e).toLowerCase()}.png`,r+h,s+3)}retinaTextY(t,e){let r;return e<21?r=6:e<27?r=7:r=8,t-r}smallNumSize={"-":7,0:10,1:9,2:10,3:8,4:10,5:9,6:10,7:9,8:8,9:9};bigNumSize={"-":8,0:13,1:9,2:13,3:11,4:14,5:12,6:12,7:12,8:12,9:12};numSize(t,e){return e==="S"?this.smallNumSize[t]:this.bigNumSize[t]}numOffset(t,e){const r=t.toString().split("").reduce((s,h)=>s+this.numSize(h,e),0)-(e==="B"?2:1);return Math.floor(r/2)}numSpriteUrl(t,e,r){return`text/nums/${e}/${r}/${t}.png`}haze="#222222d8"}class ue extends Mt{async drawButton(t,e,r,s,h,u=7,g=!1,y=!0){let C,D;g?(C="ui/button/menu_on.png",D="#d7fc03"):(C="ui/button/menu_off.png",D="#00DEF7");const $=this.buttonBounds(e,r);if(await this.drawSprite(t,C,$[0],$[1]),await this.drawText(t,h,$[0]+7+u,$[1]+24,{colour:D,fontSize:30}),!g||y){const K=new nt(s,...$,rt.Both);Q.add(K)}}async buttonMaker(t,e,r,s,h,u=7,g=!1,y=!0){const C={key:"MNBT",zone:"N",host:"",param:s};await this.drawButton(t,e,r,C,h,u,g,y)}buttonBounds(t,e){return[t-7,e-7,232,69]}}class qe extends Mt{async makeIconButton(t,e,r,s){let u;u=`ui/button/ui_${s}.png`,await this.drawSprite(t,u,e,r);const g=p.basicAction("UIBT");g.param=s;const y=new nt(g,e,r,40,40,rt.Both);Q.add(y)}async makeVScroller(t,e,r,s,h){const u=this.vScrollHilightBounds(e,r);await this.drawSprite(t,`ui/arrow/${s?"up":"down"}.png`,e,r);const g={zone:"N",key:h,host:"",param:s?"U":"D"},y=new nt(g,...u,rt.Both);Q.add(y)}vScrollHilightBounds(t,e){return[t-3,e-3,40,27]}}class Ee extends Mt{async drawActions(t){if(mt.baseMode==="G"){const e=et.get("effects"),r=t.filter(s=>s.zone==="B");if(r.length>1&&console.error("Two button actions encountered in one batch",r),r.length===0||N.aiActive||S.clickMode==="I"&&!mt.isDetailMode){const s=this.buttonBounds();await this.drawSprite(e,"ui/button/off.png",s[0],s[1])}else{const s=r[0],h=this.buttonBounds();await this.drawSprite(e,"ui/button/on.png",h[0],h[1]);let u;s.key==="CARD"?u=s.param:u=s.key,await this.drawSprite(e,`text/butt/${u}.png`,h[0]+23,h[1]+18);const g=this.highlightBounds(),y=new nt(s,...g);s.key==="CNCL"&&(y.mouse=rt.Both),Q.add(y)}}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),e=5,r=[-1,-1,2,2];return t.map((s,h)=>s+e*r[h])}}class Vt extends Mt{async drawCard(t,e,r,s){const h=this.getCanv(e),u=this.extractStats(t),g=u.cardClass;if(await this.drawSprite(h,g.image(!1),r+14,s+35),await this.drawSprite(h,this.frameImg(g.level,g.faction,g.type,!1),r,s),await this.drawSprite(h,`text/card/${g.cardCode()}.png`,r+12,s+16),u.isCreature){const y=s+178;await this.spriteNumber(h,u.att,r+24,y,"S","Y"),await this.spriteNumber(h,u.hlt,r+127,y,"S","Y")}if(u.sleeping&&await this.drawSprite(h,"icons/effects/defensive.png",r+5,s+40,{alpha:.7}),u.iconList.length>0){const y=r+57-17*(u.iconList.length-1);await Promise.all(u.iconList.map(async(C,D)=>this.drawIcon(h,y+D*35,s+140,C[0],C[1])))}}async drawBigCard(t,e,r,s){const h=this.extractStats(e);if(await this.drawSprite(t,e.image(!0),r+38,s+117),await this.drawSprite(t,this.frameImg(e.level,e.faction,e.type,!0),r,s),e.rarity!=="T"&&await this.drawRarity(t,e.rarity,r+309,s+394),h.isCreature){const u=s+555;await this.spriteNumber(t,h.att,r+44,u,"B","Y"),await this.spriteNumber(t,h.hlt,r+325,u,"B","Y")}}async drawIcon(t,e,r,s,h=0){const u=this.getCanv(t);if(await this.drawSprite(u,`icons/effects/${s}.png`,e,r),h>0){const g=s==="poison"?12:9;await this.spriteNumber(u,h,e+17,r+g,"S","B")}}extractStats(t){let e,r=!1,s=0,h=0,u=!1,g=0,y=!1,C=!1,D=!1,$=!1,K=0,_=0,z=0,tt=!1,pt=!1;if(!(t instanceof St))r=!0,s=t.attack,h=t.health,u=t.sleeping&&!t.aggressive,g=t.regen,y=t.breakthrough,C=t.defender,D=t.aggressive,K=t.armor,_=t.poison,z=t.mobility,$=t.changed,e=I.getCard(t.code);else{if(t.type==="C"){r=!0;const Dt=t;s=Dt.iAttack,h=Dt.iHealth,g=Dt.iRegen,y=Dt.iBT,C=Dt.iDefend,D=Dt.iAggro,K=Dt.iArmor,z=Dt.iMobile}tt=t.overload,pt=t.consistent,e=t}const ct=[];return tt&&ct.push(["overload",0]),pt&&ct.push(["consistent",0]),g>0&&ct.push(["regenerate",g]),y&&ct.push(["breakthrough",0]),C&&ct.push(["defender",0]),D&&ct.push(["aggressive",0]),K>0&&ct.push(["armor",K]),_>0&&ct.push(["poison",_]),z>0&&ct.push(["mobility",z]),$&&ct.push(["changed",0]),{cardClass:e,isCreature:r,iconList:ct,hlt:h,att:s,sleeping:u}}async drawHilight(t,e,r,s="#00FF00"){await super.drawHighlight(t,...this.highlightBounds(e,r),s)}cardBounds(t,e){return[t,e,150,205]}highlightBounds(t,e){const r=this.cardBounds(t,e),s=5,h=[-1,-1,2,2];return r.map((u,g)=>u+s*h[g])}frameImg(t,e,r,s){return`frames/${s?"big":"small"}/lvl${t}_${e}${r}.png`}levelImg(t){return`icons/frame/lvl${t}.png`}oldFrameImg(t){return`icons/frame/frame${t}.png`}factionImg(t){return`icons/faction/orb${t}.png`}}const cr=30,Ie=540,dr=5;class ur extends Mt{async drawCards(t){const e=et.get("hand");e.clear();const r=new Vt,s=r.highlightBounds(0,0)[2]+dr;let h=cr;const u=this.paginatron(t);for(let g=u[0];g<=u[1];g++){const y=I.getCard(t.hand[g]);await r.drawCard(y,e,h,Ie),h+=s}}async drawActions(t){const e=S.clickMode!=="I",r=et.get("effects"),s=new Vt,h=s.highlightBounds(0,0)[2]+dr,u=new Lt(0,520,1e3,250),g=new Lt(0,520,1e3,250,rt.Right),y=this.paginatron(k.getActive());await Promise.all(t.filter(C=>C.zone==="H").map(async C=>{const D=C;if(D.position>=y[0]&&D.position<=y[1]){const $=cr+(D.position-y[0])*h;if(C.key==="DEET"){const K=new nt(C,...s.highlightBounds($,Ie),rt.Right);g.addChild(K)}else if(e){const K=new nt(C,...s.highlightBounds($,Ie));u.addChild(K),await s.drawHilight(r,$,Ie,this.hlColour(D.key))}}})),e&&Q.add(u),Q.add(g),y[0]>0&&await this.makeScroller(r,!1),y[1]0&&t.hand.length-e<5&&(e=Math.max(0,t.hand.length-5),N.ui.handScrollLeft=e),[e,Math.min(e+4,t.hand.length-1),t.hand.length-1]}scrollHilightBounds(t,e){return[t-3,e-2,27,38]}async makeScroller(t,e){const r=e?894:856,s=726,h=this.scrollHilightBounds(r,s);await this.drawSprite(t,`ui/arrow/${e?"right":"left"}.png`,r,s),await this.drawHighlight(t,...h);const u={zone:"N",key:"SCRH",host:"",param:e?"R":"L"},g=new nt(u,...h,rt.Both);Q.add(g)}}class je extends Mt{fieldBoundary=[17,62,821,443];async drawCards(t){const e=k.getLocalB(),r=et.get("field");r.clear();const s=new Vt,h=f.qActiveCreats().map(u=>{let g=0;t&&t.scrappers.some(C=>C[0]===u.lane&&C[1]===u.owner)&&(g=t.battlePhase);const y=this.coordCalc(u.lane,u.owner,e,g);return s.drawCard(u,r,...y)});if(await Promise.all(h),x.iaTrigLane>0){const u=this.coordCalc(x.iaTrigLane,k.getActiveB(),e),g=s.cardBounds(...u),y=g[1]+g[3]+11,C=g[0]+g[2]/2;await this.drawSprite(r,"icons/rewards/gold.png",C-10,y),await this.drawSprite(r,"icons/rewards/gold.png",C-35,y),await this.drawSprite(r,"icons/rewards/gold.png",C-60,y),await this.drawSprite(r,"icons/rewards/gold.png",C+15,y),await this.drawSprite(r,"icons/rewards/gold.png",C+40,y)}}async drawActions(t){const e=S.clickMode!=="I",r=k.getLocalB(),s=et.get("effects"),h=new Vt,u=new Lt(...this.fieldBoundary),g=new Lt(...this.fieldBoundary,rt.Right);await Promise.all(t.filter(y=>y.zone==="F"||y.zone==="R").map(async y=>{if(y.zone==="R"&&e){const C=new nt(y,...this.fieldBoundary);Q.add(C),await this.drawHighlight(s,...this.fieldBoundary)}else{const C=y,D=this.coordCalc(C.lane,C.playerA,r);if(y.key==="DEET"){const $=new nt(y,...h.highlightBounds(...D),rt.Right);g.addChild($)}else if(e){const $=new nt(y,...h.highlightBounds(...D));u.addChild($),await h.drawHilight(s,...D,this.hlColour(C.key))}}})),e&&u.childs.length>0&&Q.add(u),g.childs.length>0&&Q.add(g)}async drawFight(t){if(t.length>0){const e={battlePhase:1,scrappers:t},r=72;await new Ee().drawActions([]),await this.drawCards(e),await S.sleep(r),e.battlePhase=2,await this.drawCards(e),await S.sleep(r),e.battlePhase=3,await this.drawCards(e),await S.sleep(r),e.battlePhase=4,await this.drawCards(e),await S.sleep(r+70),e.battlePhase=3,await this.drawCards(e),await S.sleep(r),e.battlePhase=2,await this.drawCards(e),await S.sleep(r),e.battlePhase=1,await this.drawCards(e),await S.sleep(r)}}coordCalc(t,e,r,s=0){const h=r===e,u=166,g=5;let y,C,D;return[y,D,C]=h?[22,290,1]:[687,65,-1],[y+(t-1)*u*C,D+s*g*(-1*C)]}}class be extends Mt{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,e,r,s){const h=this.getCanv(e);await this.drawSprite(h,`avatar/${this.avatars[t.avatar]}.jpg`,r+46,s+48),await this.drawSprite(h,"ui/player_frame.png",r,s),await this.drawSprite(h,"ui/player_health.png",r+10,s+102),await this.spriteNumber(h,t.health,r+45,s+149,"B","G"),await this.drawText(h,`Turn: ${t.turn} Rank: ${t.rank}`,r+25,s+210,{colour:"#f5f242",fontSize:20}),await this.drawText(h,t.name,r+t.nameOffset,s+185,{colour:"#42a4f5",fontSize:20});const u=k.totalPoison(t),g=k.totalArmor(t);if(u>0||g>0){const y=new Vt,C=s+9;u>0&&await y.drawIcon(h,r+15,C,"poison",u),g>0&&await y.drawIcon(h,r+150,C,"armor",g)}}async drawAllPlayers(){const t=et.get("player");t.clear();const e=!N.aiActive,r=k.getLocal(),s=k.toPlayer(!r.isPlayerA);if(await this.drawPlayer(r,t,...this.playerOrigin(!0)),await this.drawPlayer(s,t,...this.playerOrigin(!1)),r.isPlayerA===k.getActiveB()){let h=862;const u=295,g=Array(M.regularPlays).fill("blue").concat(M.freeCards.map(C=>C.sourceCard)),y=[];g.forEach(C=>{let D;if(C==="blue")D=C;else if(D="green",e){const $={key:"DEET",zone:"N",host:"",param:C},K=new nt($,h-1,u-1,28,41,rt.Both);Q.add(K)}y.push(this.drawSprite(t,`ui/${D}card.png`,h,u)),h+=30}),await Promise.all(y)}await this.drawDeckButton(t,r,!0,e),await this.drawDeckButton(t,r,!1,e)}async drawDeckButton(t,e,r,s){let h,u,g;if(r?(h=e.discard.length,u=935,g="T"):(h=e.deck.length,u=858,g="U"),await this.drawSprite(t,`ui/button/faction_${g}.png`,u,350),await this.spriteNumber(t,h,u+38,350+14,"S","Y"),h>0&&s){const C=p.basicAction("VWDK");C.param=r?"VD":"VR";const D=new nt(C,u,350,77,44,rt.Both);Q.add(D)}}async drawActions(t){if(S.clickMode==="I")return;const e=et.get("effects"),r=k.getLocalB();await Promise.all(t.filter(s=>s.zone==="P").map(s=>{const h=s,u=this.playerOrigin(h.playerA===r),g=this.highlightBounds(...u),y=new nt(s,...g);return Q.add(y),this.drawHighlight(e,...g)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,e){return[t+18,e+18,170,170]}highlightBounds(t,e){return this.playerBounds(t,e)}async drawGameOver(){const t=et.get("field"),e=94,r=k.getLocalB(),s=N.winFlag,h=r&&s===1||!r&&s===-1;await this.drawSprite(t,`ui/you-${h?"win":"lose"}.png`,e,89),Q.removeAll();const u=new ue,g=et.get("effects");await u.drawButton(g,e+62,520,p.menuButtonAction("MM"),"Main Menu",20,!1),await u.drawButton(g,e+389,520,p.menuButtonAction("RP"),"Replay",55,!1)}async drawAiGear(t,e){const h=t%6,u=Math.floor(t/6),g=et.get("effects"),y=`icons/rewards/${e?"gold":"silver"}.png`;await this.drawSprite(g,y,862+h*24,255+u*24)}hwhipe(){et.get("effects").clear()}}const fr=15,gr=15,Gs=5;class $s extends Mt{constructor(){super();const e=new Vt().highlightBounds(0,0);this.xOffset=e[2]+Gs,this.yOffset=e[3]+25}xOffset;yOffset;async drawCards(){const t=et.get("decklist");t.clear(),t.context.fillStyle=this.haze,t.context.fillRect(0,0,849,S.gameHeight);const e=new Vt,s=Ht.visibleContent().map((h,u)=>{const g=I.getCard(h.cardCode),y=this.listXY(u);return e.drawCard(g,t,...y).then(()=>{if(h.cardCount>0)return this.drawCount(t,y[0]+62,y[1]+163,h.cardCount)})});await Promise.all(s)}async drawActions(t){const e=et.get("decklist"),r=new Vt,s=new qe,h=S.clickMode!=="I",u=Ht.visibleContent(),g=N.ui,y=g.deckScroll,C=y+15,$=g.deckSummary?rt.Both:rt.Right,K=new Lt(...this.deckBoundary()),_=new Lt(...this.deckBoundary(),$),z=[];t.forEach(tt=>{if(tt.key==="DEET"){const pt=tt;if(pt.position>=y&&pt.positionDt.sourceIdx===pt.position);if(ct>-1){const Dt=this.listXY(ct-y),ke=new nt(tt,...r.highlightBounds(...Dt));K.addChild(ke),z.push(r.drawHilight(e,...Dt,this.hlColour(tt.key)))}}}),h&&K.childs.length>0&&Q.add(K),_.childs.length>0&&Q.add(_),Ht.canPageDown&&z.push(s.makeVScroller(e,319,723,!1,"SCRK")),Ht.canPageUp&&z.push(s.makeVScroller(e,487,723,!0,"SCRK")),await Promise.all(z)}async drawCount(t,e,r,s){await this.drawSprite(t,"ui/dullcard.png",e,r),await this.spriteNumber(t,s,e+13,r+13,"S","Y")}listXY(t){return[fr+t%5*this.xOffset,gr+Math.floor(t/5)*this.yOffset]}deckBoundary(){return[fr,gr,this.xOffset*5,this.yOffset*3]}}class Os extends Mt{async drawDetails(t){const e=[],r=et.get("card");r.clear(),r.context.fillStyle=this.haze,r.context.fillRect(0,0,849,S.gameHeight);const s=30,h=30,u=I.getCard(Kt.currentCard),g=new Vt;S.options.bigCards?e.push(g.drawBigCard(r,u,s,h)):e.push(g.drawCard(u,r,134,280));const y=435;let C=30;const D="#f5f242",$="#03fcfc",K=33,_=23,z=28;let tt=u.name;for(;tt.length>0;){C+=36;let kt;if(tt.length<_)kt=tt,tt="";else{const zt=tt.lastIndexOf(" ",_);kt=tt.substring(0,zt),tt=tt.substring(zt+1)}e.push(this.drawText(r,kt,y,C,{colour:$,fontSize:28}))}C+=36,e.push(this.drawText(r,this.cardSummary(u),y,C,{colour:$,fontSize:20})),u.type==="C"&&(C+=30,e.push(this.drawText(r,this.tribeSummary(u),y,C,{colour:$,fontSize:20})));let pt=m.cardTextSplit(u);C+=40,pt.forEach(kt=>{for(;kt.length>0;){let zt;if(kt.length1){const kt=u.cardCode(),zt=Dt===3?[19,147,270]:Dt===2?[78,216]:[0,98,196,294];ct.forEach((ne,Ge)=>{e.push(this.drawLevelButton(r,kt,ne,40+zt[Ge],658,ne===u.level))})}const ke=new ue;let ve=0;const Je=513,Qe=697,mr=74;mt.baseMode!=="G"&&(e.push(ke.drawButton(r,Je,Qe,t,"Close",62,!1)),ve++);const zs=new nt(t,s,h,377,603,rt.Both);if(Q.add(zs),Kt.canGoBack){const kt=Kt.goBackAction();e.push(ke.drawButton(r,Je,this.buttonY(Qe,ve,mr),kt,"Back",72,!1)),ve++}Kt.friendos.forEach(kt=>{const zt=I.getCard(kt),ne=Kt.friendAction(kt),Ge=Kt.friendTxt(zt.cardCode());e.push(ke.drawButton(r,Je,this.buttonY(Qe,ve,mr),ne,Ge[1]||zt.name,Ge[0],!1)),ve++}),await Promise.all(e)}buttonY(t,e,r){return t-e*r}cardSummary(t){const e=m.factionText(t.faction),r=m.rarityText(t.rarity),s=m.cardTypeText(t.type);return`${e}, ${r} ${s}`}tribeSummary(t){return t.tribe.map(e=>m.tribeText(e)).join(" ")}async drawLevelButton(t,e,r,s,h,u){if(await this.drawSprite(t,`icons/frame/level${r}.png`,s,h),!u){const D=Kt.levelAction(r),$=new nt(D,s-15,h-5,88,112,rt.Both);Q.add($)}const y=I.getCard(`${e}${r}`).levelSpice(),C=[[-16,55],[41,55],[11,79]];await Promise.all(y.map((D,$)=>{const K=s+C[$][0],_=h+C[$][1];if(D.icon==="A"||D.icon==="H"){let z,tt;return D.icon==="A"?(z="icons/frame/attack.png",tt=K+17):(z="icons/frame/health.png",tt=K+16),this.drawSprite(t,z,K-1,_-1).then(()=>this.spriteNumber(t,D.num,tt,_+10,"S","Y"))}else{let z=this.spiceIcon(D.icon);if(D.icon==="U"||D.icon==="D"||D.icon==="L"||D.icon==="N"){const tt=`icons/effects/${z}.png`;return this.drawSprite(t,tt,K-1,_-1).then(()=>this.spriteNumber(t,D.num,K+16,_+10,"S","B"))}else return new Vt().drawIcon(t,K,_,z,D.num)}}))}spiceIcon(t){return t==="N"?"new":t==="D"?"damage":t==="U"?"buff":t==="V"?"mobility":t==="P"?"poison":t==="M"?"armor":t==="G"?"aggressive":t==="F"?"defender":t==="B"?"breakthrough":t==="R"?"regenerate":t==="L"?"life":t==="C"?"consistent":t==="O"?"overload":"whoops"}levelFun(t){return t.maxLevel===3?t.minLevel===1?[1,2,3]:[3]:t.maxLevel===t.minLevel?[t.minLevel]:t.maxLevel===4?[1,2,3,4]:[1,2]}}class Ws extends Mt{packLeft=22;packTop=190;packBoundary=[this.packLeft-5,this.packTop-10,537,480];async drawPack(t,e){const r=new Vt,s=S.clickMode!=="I",h=[],u=new Lt(...this.packBoundary),g=new Lt(...this.packBoundary,rt.Right);t.filter(C=>C.pack).forEach(C=>{const D=this.coordCalcPack(C.index);if(C.key==="DRFT"){const $=I.getCard(C.param+"1");if(h.push(r.drawCard($,e,...D).then(()=>this.drawRarity(e,$.rarity,D[0]+112,D[1]+4))),s){const K=new nt(C,...r.highlightBounds(...D));u.addChild(K)}}else{const $=new nt(C,...r.highlightBounds(...D),rt.Right);g.addChild($)}}),s&&u.childs.length>0&&Q.add(u),g.childs.length>0&&Q.add(g),await Promise.all(h)}async drawList(t,e){let r=170;const s=570,h=[],u=ut.picksAsDeck,g=new Lt(s,r,600,600,rt.Both),y=t,C=15,D=ut.scrollIdx;ut.canPageDown&&await this.makeScroller(e,!1),ut.canPageUp&&await this.makeScroller(e,!0),y.filter($=>!$.pack).forEach($=>{if($.index>=D&&$.index{const u=e.getFactTotal(h);if(u[2]===0)return[Promise.resolve()];{r+=75;const g=this.threeLine(t,r,s,u),y=this.drawFaction(t,h,r-8,s-39);return[g,y]}}).flat())}async threeLine(t,e,r,s){const h={colour:"#ffd865",fontSize:18,fontName:"serif"},u=30;await Promise.all(s.map((g,y)=>this.drawText(t,g.toString(),e,r+u*y,h)))}async drawDraftMenu(t){const e=new ue,r=new Ae,s=240,h=80,u=45,g=34;let y=50,C=s;await r.headerText(y+28,C,"Opponent",t),C+=u,await e.buttonMaker(t,y,C,"DI","DUMB BOT",27,ut.vsAI,!1),C+=h,await e.buttonMaker(t,y,C,"DV","HUMAN",47,!ut.vsAI,!1),C+=h+16,await r.headerText(y+17,C,"Rarity Filter",t),C+=h-g-6,await this.rarityButton(t,y+20,C,"L",ut.getRarity("L")),await this.rarityButton(t,y+125,C,"H",ut.getRarity("H")),C+=h,await this.rarityButton(t,y+20,C,"R",ut.getRarity("R")),await this.rarityButton(t,y+125,C,"C",ut.getRarity("C")),C=s+u+h*5,await e.buttonMaker(t,y,C,"MM","MAIN MENU",16),y=404,C=s,await r.headerText(y+5,C,"Draft Modes",t),C+=u,await e.buttonMaker(t,y,C,"GP","GOOD PACKS",9,ut.fatPacks),C+=h,await e.buttonMaker(t,y,C,"LD","LEGENDARY",17,ut.legDraft),C+=h,await e.buttonMaker(t,y,C,"OD","OVERDRAFT",17,ut.overdraft),y=757,C=s,await r.headerText(y+76,C,"Sets",t),C+=u,await this.chestButton(t,y+3,C,1,ut.getSet(1)),await this.chestButton(t,y+124,C,2,ut.getSet(2)),C+=88,await this.chestButton(t,y+3,C,3,ut.getSet(3)),await this.chestButton(t,y+124,C,4,ut.getSet(4)),C+=88,await this.chestButton(t,y+3,C,5,ut.getSet(5)),C=s+u+h*5,await e.buttonMaker(t,y,C,"DN","NEXT",68)}async rarityButton(t,e,r,s,h){const u={key:"MNBT",zone:"N",host:"",param:S.enTil("DR",s)},g=`ui/button/rarity_${s}${h?"y":"n"}.png`;await this.drawSprite(t,g,e,r);const y=new nt(u,e,r,75,65,rt.Both);Q.add(y)}async chestButton(t,e,r,s,h){const u={key:"MNBT",zone:"N",host:"",param:S.enTil("DT",s)},g=`icons/sets/Chest_Set${s}${h?"y":"n"}.png`;await this.drawSprite(t,g,e,r);const y=new nt(u,e,r,90,74,rt.Both);Q.add(y)}}class Le extends Mt{async drawSets(t,e){let r=200;const s=100,h=[],u=new Lt(s,r,400,600);t.filter(g=>g.key==="DSET").forEach(g=>{const y=fe[parseInt(g.param)];h.push(this.drawText(e,y.name,s,r,{colour:"#f5f242"}),this.drawSprite(e,"icons/chest_small.png",s-48,r-5));const C=new nt(g,s,r-2,400,35,rt.Both);u.addChild(C),r+=45}),Q.add(u),await Promise.all(h)}async drawList(t,e){let r=170;const s=570,h=[],u=new Lt(s,r,600,600);t.filter(g=>g.key==="DECK").forEach(g=>{const y=S.deTil(g.param),C=Xt.stockDeckByName(y[0],y[1]);h.push(this.drawFaction(e,C.factions[0],s,r),this.drawText(e,C.name,s+65,r+7,{colour:"#f5f242"})),C.factions.length===2&&h.push(this.drawFaction(e,C.factions[1],s+28,r));const D=new nt(g,s,r-2,600,35,rt.Both);u.addChild(D),r+=35}),await Promise.all(h),Q.add(u)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,h=Math.floor(t/3);return[22+s*176,200+h*235]}iAmError(t){const e=et.get("game-ui");this.drawText(e,t,295,655,{colour:"#f5142e",fontSize:26})}async drawConstrMenu(t){const e=new ue,r=new Ae,s=240,h=80,u=45;let g=50,y=s;await r.headerText(g+28,y,"Opponent",t),y+=u,await e.buttonMaker(t,g,y,"CI","DUMB BOT",27,Bt.vsAI,!1),y+=h,await e.buttonMaker(t,g,y,"CV","HUMAN",47,!Bt.vsAI,!1),y+=h*4,await e.buttonMaker(t,g,y,"MM","MAIN MENU",16),g=404,y=s,await r.headerText(g+46,y,"Player 1",t);const C=Bt.p1.mode;y+=u,await e.buttonMaker(t,g,y,S.enTil("CP","A"),"PRE-CON",39,C==="CP",!1),y+=h,await e.buttonMaker(t,g,y,S.enTil("CR","A"),"RANDOM",36,C==="CR",!1),y+=h,await e.buttonMaker(t,g,y,S.enTil("CX","A"),"SCRAMBLE",30,C==="CX",!1),y+=h,await e.buttonMaker(t,g,y,S.enTil("LK","A"),"LOAD FILE",32,C==="LK"),C==="LK"&&await this.drawFileDeck(t,g,y,Bt.p1.deck),g=757,y=s,await r.headerText(g+44,y,"Player 2",t);const D=Bt.p2.mode;y+=u,await e.buttonMaker(t,g,y,S.enTil("CP","B"),"PRE-CON",39,D==="CP",!1),y+=h,await e.buttonMaker(t,g,y,S.enTil("CR","B"),"RANDOM",36,D==="CR",!1),y+=h,await e.buttonMaker(t,g,y,S.enTil("CX","B"),"SCRAMBLE",30,D==="CX",!1),y+=h,await e.buttonMaker(t,g,y,S.enTil("LK","B"),"LOAD FILE",32,D==="LK"),D==="LK"&&await this.drawFileDeck(t,g,y,Bt.p2.deck),y+=h*2,await e.buttonMaker(t,g,y,"CN","NEXT",68)}async drawFileDeck(t,e,r,s){const h=r+89;await this.drawText(t,s.name.slice(0,20),e,r+70,{colour:"#f5f242",fontSize:18}),s.factions.length===1?await this.drawFaction(t,s.factions[0],e+96,h):(await this.drawFaction(t,s.factions[0],e+78,h),await this.drawFaction(t,s.factions[1],e+113,h))}}class Ae extends Mt{async drawExtrasMenu(t){const e=new ue,r=240,s=80,h=45;let u=50,g=r;await this.headerText(u+28,g,"More Info",t),g+=h,await e.buttonMaker(t,u,g,"RU","RULES",66),g+=s,await e.buttonMaker(t,u,g,"FQ","INFO & FAQ",20),g+=s*3,await e.buttonMaker(t,u,g,"MM","MAIN MENU",16),u=404,g=r,await this.headerText(u+37,g,"UI Modes",t),g+=h,await e.buttonMaker(t,u,g,"90","90% SIZE",47,S.options.scale==="90"),g+=s,await e.buttonMaker(t,u,g,"BC","BIG CARDS",29,S.options.bigCards),u=757,g=r,await this.headerText(u+12,g,"Game Modes",t),g+=h,await e.buttonMaker(t,u,g,"HH","BIG HEALTH",20,S.options.highHealth),g+=s,await e.buttonMaker(t,u,g,"CH","CHEATER",37,S.options.cheater),g+=s,await e.buttonMaker(t,u,g,"BB","BATTLE BARK",13,S.options.bark),await this.drawText(t,"v0.7.1",494,730,{fontSize:16,colour:"#7b68ee"})}async headerText(t,e,r,s){await this.drawText(s,r,t,e,{colour:"#f5f242",fontSize:30})}async drawPickerPlayer(t,e,r){let s;e?s="Player 1":r?s="Dumb Bot":s="Player 2",await this.headerText(54,75,s,t)}}class Us extends Mt{async drawMenu(t){let r=22;await this.drawSprite(t,"ui/button/constructed.png",778,r);const s=new nt(this.makeAction("C"),...this.buttHilightBounds(778,r),rt.Both);Q.add(s),r=148,await this.drawSprite(t,"ui/button/draft.png",778,r);const h=new nt(this.makeAction("D"),...this.buttHilightBounds(778,r),rt.Both);Q.add(h),r=508,await this.drawSprite(t,"ui/button/deck.png",778,r);const u=new nt(this.makeAction("B"),...this.buttHilightBounds(778,r),rt.Both);Q.add(u),r=634,await this.drawSprite(t,"ui/button/info.png",778,r);const g=new nt(this.makeAction("I"),...this.buttHilightBounds(778,r),rt.Both);Q.add(g);const y=p.basicAction("DBUG"),C=new nt(y,426,191,62,65,rt.Right);Q.add(C),await this.drawSprite(t,"gwg/gwg_red.png",58,0)}buttBounds(t,e){return[t,e,242,113]}buttHilightBounds(t,e){const s=[-3,-3,6,6];return this.buttBounds(t,e).map((h,u)=>h+s[u])}makeAction(t){return{zone:"N",key:"MENU",host:"",param:t}}}class Vs{gameWidth;gameHeight;spriteCache;dogAudio;_clickMode;pxRatio=1;options;imgRoot;constructor(){this.spriteCache={},this.imgRoot="./img/",this.gameWidth=1024,this.gameHeight=768,this.dogAudio=document.getElementById("dogbark"),this._clickMode="M",this.options={bark:!0,bigCards:!0,highHealth:!1,cheater:!1,wasDrafting:!1,scale:"100",debug:!1}}randInt(t,e){return Math.floor(Math.random()*(e-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async getSprite(t){return this.spriteCache[t]||(this.spriteCache[t]=this.imageLoader(t)),this.spriteCache[t]}async bulkLoadSprite(t){await Promise.all(t.map(e=>this.getSprite(`${this.imgRoot}${e}`)))}dogBark(){this.dogAudio.volume=.3,this.dogAudio.play()}toggleDebug(){const t=!this.options.debug;this.options.debug=t,new Le().iAmError("Debug mode "+(t?"ON":"OFF"))}enTil(...t){return t.join("~")}deTil(t){return t.split("~")}imageLoader(t){return new Promise(e=>{const r=new Image;r.onload=()=>{e(r)},r.src=t})}writeStorage(t,e){localStorage.setItem(t,e)}readStorage(t){return localStorage.getItem(t)}readStringStorage(t,e){const r=this.readStorage(t);return r===null?e:r}readBoolStorage(t,e){const r=this.readStorage(t);return r===null?e:r==="Y"}writeBoolStorage(t,e){this.writeStorage(t,e?"Y":"N")}restoreOptions(){const t=this.options;t.bark=this.readBoolStorage("bark",!0),t.bigCards=this.readBoolStorage("bigCards",!0),t.cheater=this.readBoolStorage("cheater",!1),t.highHealth=this.readBoolStorage("highHealth",!1),t.scale=this.readStringStorage("scale","100")}toggleOption(t){Game.options[t]=!Game.options[t],this.writeBoolStorage(t,Game.options[t])}setClickMode(t){this._clickMode=t}get clickMode(){return this._clickMode}}const S=new Vs;window.onload=async()=>{await document.fonts.ready;let n=[];document.fonts.forEach(z=>{z.load(),n.push(z.loaded)}),await Promise.all(n),["game-ui","field","player","hand","effects","decklist","card"].forEach(z=>{et.register(z)});const e=et.get("effects");e.context.lineWidth=2,S.pxRatio=window.devicePixelRatio;let r;(z=>{z.Neutral="N",z.Cancel="C",z.Down="D"})(r||(r={}));let s=!0,h=800,u="N",g;try{document.createEvent("TouchEvent"),S.setClickMode("T"),s=!1}catch{}const y=()=>{g&&(clearTimeout(g),g=void 0)},C=(z,tt,pt)=>{const ct=Q.hitTest(z,tt,pt);ct&&v.handleAction(ct)},D=z=>{C(z.pageX,z.pageY,z.button)},$=z=>{z.touches.length>1?(u="C",y()):u==="N"&&(u="D",g=setTimeout(()=>{u="C";const tt=z.touches[0];C(tt.pageX,tt.pageY,rt.ForceRight),g=void 0},h))},K=z=>{if(u==="D"){if(y(),u="N",z.changedTouches.length>0){const tt=z.changedTouches[0];C(tt.pageX,tt.pageY,rt.Left)}}else z.touches.length===0&&(u="N")},_=document.getElementById("solforge");s?(_.addEventListener("click",D),_.addEventListener("contextmenu",z=>(z.preventDefault(),D(z),!1))):(_.addEventListener("touchstart",$),_.addEventListener("touchend",K)),window.sfapi={details:z=>{Kt.init(z)},setLog:z=>{ot.setLog(z)},peekAll:()=>{ot.peekAllCards()},peekDeck:()=>{ot.peekDecks()},dumb:()=>{console.log("Am I dumb? "+ot.dumb)},debug:()=>{S.toggleDebug()}},S.restoreOptions(),S.options.scale!=="100"&&ft.changeScale(S.options.scale),ft.drawAll()}})(); +`))}}const ot=new Dr;class Fr{getState(){const t={cCrd:this.currPlayCard,cCst:this.currPlayCost,cPos:this.currPlayPos,aa:this.actionHistory};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.currPlayCard=e.cCrd,this.currPlayCost=e.cCst,this.currPlayPos=e.cPos,this.actionHistory=e.aa}handleAction(t){if(t.key==="DEET"){Kt.init(t.param);return}if(t.key==="HPLY"){this.playCardSelect(t);return}if(t.key==="FORG"){M.forgeCard(t,this.currPlayCard,this.currPlayCost,this.currPlayPos);return}if(t.key==="FITE"){hr.fight(t.param==="M");return}if(t.key==="ENDT"){M.endTurn();return}if(t.key==="MOVE"){this.mobilitySelect(t);return}if(t.key==="MEND"){M.mobility(t);return}if(t.key==="HDSC"){this.currPlayCost="",M.cardPlayed(this.currPlayCard,this.currPlayCost,this.currPlayPos,!0),this.actionDone();return}if(t.key==="ACTV"){const e=f.jr5(t.param);I.getCard(e.code).startActivation(e);return}if(t.key==="NOTR"){t.param==="PM"&&mt.popMode(),this.actionDone(!0);return}if(t.key==="CARD"){I.getCard(t.host).handleAction(t);return}if(t.key==="CANC"||t.key==="CNCL"){t.param==="PM"&&mt.popMode(),this.actionHistory.pop(),this.ddf5();return}if(t.key==="USWP"){mt.popMode(),Et.whatNext();return}if(t.key==="DTUP"){Kt.updateDetails(t),ft.drawAll();return}if(t.key==="VWDK"){Ht.handleShowDeck(t);return}if(t.key==="SCRK"){Ht.handleDeckScroll(t);return}if(t.key==="SCRH"){t.param==="R"?N.ui.handScrollLeft+=1:N.ui.handScrollLeft-=1,ft.drawAll();return}if(t.key==="DRFT"){ut.resumeDraft(t.param);return}if(t.key==="SCRD"){ut.paginate(t.param==="D"),ft.drawAll();return}if(t.key==="UIBT"){Ke.handleUIButton(t);return}if(t.key==="MENU"){Ke.handleMainMenuButton(t);return}if(t.key==="MNBT"){Ke.handleMenuButton(t);return}if(t.key==="DSET"){this.ddf5(Bt.generateDeckPickerActions(parseInt(t.param)));return}if(t.key==="DECK"){Bt.handleDeckPick(t);return}if(t.key==="DBUG"){T.toggleDebug();return}}ddf5(t,e=!1){let r;if(t){const s=this.generateDetailActions();r=t.concat(s),this.actionHistory.push(r)}else r=this.actionHistory[this.actionHistory.length-1];N.aiActive?ot.processAction(r,e):ft.drawAll()}currPlayCard="";currPlayCost="";currPlayPos=-1;shiftPlayCard(t){t0&&e.canLevel()&&r.push(w.buttonTarget("HDSC",t.card));const s=w.toActions(r);return s.push(p.handSelectAction("CANC",t.card,"",t.position)),s}mobilitySelect(t){const e=this.getMoveCardActions(t);this.ddf5(e)}getMoveCardActions(t){if(t.key!=="MOVE")throw new Error("Unexpected action passed to getMoveCardActions: "+t.key);const e=f.ddf6(t);let r=[];if(t.param==="ACTV"){const s=p.actionTarget("TB","ACTV",e.code,e.id);r=w.toActions(s)}return r.push(p.fieldSelectAction("CANC",t.lane,t.playerA)),f.canMove(e).map(s=>{const h=p.fieldSelectAction("MEND",s,t.playerA);return h.param=e.id,h}).concat(r)}noneEndTrigger(){return w.toActions(w.buttonTarget("NOTR"))[0]}cancelAction(){return w.toActions(w.buttonTarget("CANC"))[0]}emptyAdjacents(t,e){const r=e||t.id,s=p.emptyPlayerActTarg("F","CARD",t.code,r);return s.lanes=t.adjacent,w.toActions(s)}generateDetailActions(){const t=mt.mode;if(N.aiActive)return[];if(t==="G"){const e=k.getLocal().hand.map((s,h)=>{const u=p.handSelectAction("DEET",s,"",h);return u.param=s,u}),r=f.qActiveCreats().map(s=>{const h=p.fieldSelectAction("DEET",s.lane,s.owner);return h.param=s.code,h});return e.concat(r)}else if(t==="D"){const e=ut.currentPack.map((s,h)=>{const u=p.draftSelectAction("DEET",h,!0);return u.param=`${s}1`,u}),r=ut.picksAsDeck.map((s,h)=>{const u=p.draftSelectAction("DEET",h,!1);return u.param=`${s.card}1`,u});return e.concat(r)}return[]}}const v=new Fr;class Hr{type="N0";events=[];triggerActions=[];deathCheck=!0;iaTrigLane=0;getState(){const t={type:this.type,events:this.events,tA:this.triggerActions,dC:this.deathCheck,tL:this.iaTrigLane};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.type=e.type,this.events=e.events,this.triggerActions=e.tA,this.deathCheck=e.dC,this.iaTrigLane=e.tL}startBatch(){this.deathCheck=!1,this.type==="C0"?this.type="C1":this.type==="C1"?this.type="C2":this.type==="C2"&&(this.type="N0");const t=this.type;let e;if(t==="N0")e=this.events.slice(),this.events=[];else{const s=this.events.filter(u=>u.code==="DIE"),h=this.events.filter(u=>u.code!=="DIE");t==="C1"?(e=h,this.events=s):(e=s,this.events=h)}const r=this.generateTriggers(e);this.triggerActions=this.sortTriggers(r),Et.whatNext()}generateTriggers(t){let e;const r=t.map(s=>{s.code==="TRS"&&(e=s);const h=f.field.map(g=>g.triggers.map(y=>{const C=p.triggerReaction(s,y,g.owner,"C");return C.creatId=g.id,C.cardCode=g.code,C}).filter(y=>Xe.ddf8(y))).flat(),u=[!0,!1].map(g=>k.toPlayer(g).triggers.map(C=>p.triggerReaction(s,C,g,"P")).filter(C=>Xe.ddf8(C))).flat();return h.concat(u)}).flat();return e&&this.handleTurnStart(e),r}sortTriggers(t){const e=k.getActiveB(),r=t.filter(u=>!u.trigger.interactive&&u.owner===e),s=t.filter(u=>!u.trigger.interactive&&u.owner!==e);return t.filter(u=>u.trigger.interactive&&u.owner===e).concat(s,r)}handleTurnStart(t){const e=k.getActiveB();f.qPlayerCreats(e).filter(s=>s.sleeping).forEach(s=>{s.sleeping=!1});const r=N.tick();f.qActiveCreats().forEach(s=>{s.owner===t.playerA&&(s.activationAvailable=!0,s.mobilityAvailable=!0,s.sleeping=!1),s.armorDmg=0,s.poison>0&&s.hurtDirect(s.poison,"POIS",r),s.regen>0&&s.heal(s.regen),O.deathProdder(s,r)}),[k.playerA,k.playerB].forEach(s=>{s.armorDmg=0;const h=k.totalPoison(s);h>0&&k.hurtDirect(s,h,"POIS")})}getNextTrigger(){const t=this.triggerActions;if(t.length!==0)return t[t.length-1]}triggerDone(){this.triggerActions.length===0?console.error("batch.triggerDone() was called when there is no trigger actions"):(this.triggerActions.pop(),this.iaTrigLane=0),Et.whatNext()}addEvents(...t){this.events.push(...t)}}const x=new Hr;class Br{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new lr(t)}get(t){return this.registry[t]}}const et=new Br;class Pr extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Abraxas, Avatar of Kadras",this.iAttack=this.boof4712,this.iHealth=this.lValN([7,11,21]),this.tribe.push("HY");const e=this.lValS(["Give an adjacent creature","Each adjacent creature gets","Each other friendly creature gets"]);this.text=`Activate: ${e} 2x attack this turn.`}targ(t){const e=p.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(e.lanes=t.adjacent),e}canActivate(t){return f.creatByTarget(this.targ(t)).length>0}startActivation(t){let e;this.level===1?e=this.targ(t):(e=w.boardTarget("CARD",this.code),e.param=t.id),e.hint=["BB"],v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){const e=f.jr5(t.param);if(t.zone==="F"){const r=f.ddf6(t);this.logAct(!0,r),this.applyMod(r,e.id)}else{this.logAct(!0);const r=this.targ(e);f.creatByTarget(r).forEach(s=>{this.applyMod(s,e.id)})}e.endActivation()}applyMod(t,e){const r=p.mod("AT",t.attack,e);r.expiry="ET",t.addMod(r)}}class Nr extends P{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Abyssal Brute",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.text=`When ${this.name} or another friendly creature enters a side lane, that creature gets ${m.jr9(this.level,this.level,!0)} and Regenerate ${this.level}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("EF",this.code),r.jr4("MV",this.code),r}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const e=W.toCreature(t.event),r=e.creature.lane;return(r===1||r===5)&&e.creature.owner===t.owner}return!1}jr8(t){const e=W.toCreature(t.event);e.creature.buff(this.level,this.level),e.creature.addRegen(this.level),x.triggerDone()}}class Mr extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Ambriel Archangel",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.iAttack+1,this.tribe.push("AG");const e=this.boof101520;this.text=`While ${this.name} is your only friendly creature, you get Armor ${e}, and this gets Armor ${this.level+1} and Mobility 1.`}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){const r=e.status==="A",s=p.crNotMeTarg(e.id);s.player=k.toTarget(e.owner);const h=f.creatByTarget(s);if(r&&h.length===0){const u=p.mod("AR",this.boof101520,e.id);k.addModSafe(e.owner,u);const g=p.mod("AR",this.level+1,e.id),y=p.mod("MB",1,e.id);e.addModSafe(g),e.addModSafe(y)}else k.removeModSafe(e.owner,e.id),e.removeModSafe(e.id)}}class xe extends P{lookup(t){return{["LLD"]:{c:()=>this.demC(),t:r=>this.demT(r)},["LLG"]:{c:()=>this.golC(),t:r=>this.golT(r)},["LLS"]:{c:()=>this.senC(),t:r=>this.senT(r)},["LLT"]:{c:()=>this.tyrC(),t:r=>this.tyrT(r)}}[t]}testAmbush(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}ddf8(t){return!ot.simOn&&this.testAmbush(this.cardCode(),t)}jr8(t){const e=this.cardCode(),r=k.toPlayer(t.owner),s=r.hand.length;for(let h=s-1;h>-1;h--){const u=r.hand[h];u.startsWith(e)&&(m.new().crd(u).txt(" Ambushed.").go(),f.birth(u,"S",r.isPlayerA),M.levelAndDiscard(u,h,!1,"E"))}x.triggerDone()}ambT(){return`Spawn a ${this.name}. Then discard ${this.level===3?"":"and level up "} ${this.name}.`}demC(){this.faction="N",this.rarity="H",this.name="Leyline Demon",this.iAttack=this.lValN([3,9,14]),this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.text="Ambush: When the enemy player plays a card, if it is their third card played that turn, "+this.ambT()}demT(t){if(t.event.code==="PLC"){const e=t.event;return t.owner!==e.playerA&&M.cardsPlayed===3}else return!1}golC(){this.faction="U",this.rarity="H",this.name="Leyline Golem",this.iAttack=this.lValN([5,12,18]),this.iHealth=this.iAttack-(this.level+1),this.tribe.push("GL"),this.text="Ambush: When an enemy creature moves on the enemy player's turn, "+this.ambT()}golT(t){if(t.event.code==="MOV"){const e=W.toCreature(t.event);return t.owner!==e.creature.owner&&k.getActiveB()===e.creature.owner}else return!1}senC(){this.faction="A",this.rarity="H",this.name="Leyline Sentry",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.iAttack+this.level+5,this.tribe.push("RB"),this.text="Ambush: When an enemy creature enters play on the enemy player's turn, if it wasn't Forged, "+this.ambT()}senT(t){if(t.event.code==="ENT"){const e=W.toEnterField(t.event);return t.owner!==e.creature.owner&&k.getActiveB()===e.creature.owner&&!e.forged}else return!1}tyrC(){this.faction="T",this.rarity="H",this.name="Leyline Tyrant",this.iAttack=this.lValN([6,12,17]),this.iHealth=this.iAttack-2,this.tribe.push("GT"),this.text="Ambush: When an enemy player gains health on their turn, "+this.ambT()}tyrT(t){if(t.event.code==="PHL"){const e=t.event;return t.owner!==e.playerA&&k.getActiveB()===e.playerA}else return!1}}class Rr extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Apocrymancer",this.iAttack=this.boof3713,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.text="When you play an Alloyin spell, you may discard and level up a card."}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC",this.code);return s.interactive=!0,r}handleAction(t){M.levelAndDiscardA(t),v.actionDone(!0)}ddf8(t){if(t.event.code==="PLC"){const e=t.event;if(e.playerA===t.owner){const r=I.getCard(e.cardCode);if(r.type==="S"&&r.faction==="A")return!0}}return!1}jr8(t){const e=p.lvlHandActTarg(this.code,t.creatId);v.ddf5(w.toActions([e,w.buttonTarget("NOTR")]))}}class Er extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Arboris, Grove Dragon",this.iAttack=this.lValN([5,9,20]),this.iHealth=this.iAttack,this.tribe.push("DG");const e=this.boof;this.text=`While you have over 120 health, Arboris gets ${m.jr9(e,e)}.`}jr3(t,e){const r=super.jr3(t,e);return r.addEffect("PH",this.code),r}enforceEffect(t,e){if(k.toPlayer(e.owner).health>120&&e.status==="A"){const s=this.boof;e.addModSafe(p.mod("HL",s,e.id)),e.addModSafe(p.mod("MH",s,e.id)),e.addModSafe(p.mod("AT",s,e.id))}else e.removeModSafe(e.id)}get boof(){return this.lValN([4,8,80])}}class Ir extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Ash Maiden",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("HM"),this.text=`When a friendly creature ${m.dbdtap()}, it gets ${m.jr9(this.level,this.level)}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}return!1}jr8(t){const e=W.toDamage(t.event);this.logAct(!1,e.srcCreat),e.srcCreat.buff(this.level,this.level),x.triggerDone()}}class De extends P{constructor(t){super(t),this.rarity="H",this.iAttack=this.level+2,this.iHealth=this.iAttack;const e=this.cardCode();e==="SFA"?this.steel():e==="RFA"?this.root():e==="HFA"?this.hell():e==="SGA"&&this.storm(),this.text=`Forge: ${this.name} gets ${m.jr9(this.level,this.level)} for each ${m.factionText(this.faction)} card in your hand.`}hell(){this.faction="N",this.name="Hellforged Avatar",this.iRegen=this.level,this.tribe.push("AB")}root(){this.faction="U",this.name="Rootforged Avatar",this.iBT=!0,this.tribe.push("HM")}steel(){this.faction="A",this.name="Steelforged Avatar",this.iArmor=this.level,this.tribe.push("CY")}storm(){this.faction="T",this.name="Stormforged Avatar",this.iMobile=this.level,this.tribe.push("MT")}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}jr8(t){const e=W.toEnterField(t.event),r=k.toPlayer(t.owner).hand.filter(s=>I.getCard(s).faction===this.faction).length;if(r>0){const s=r*this.level;e.creature.buff(s,s)}x.triggerDone()}}class U extends P{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["COZ"]:()=>this.cooze(),["DZA"]:()=>this.dozer(),["FWG"]:()=>this.feywing(),["FUN"]:()=>this.funguy(),["POZ"]:()=>this.purpz(),["NSD"]:()=>this.fixedSeedling(1),["OOZ"]:()=>this.nooze(),["RPT"]:()=>this.raptor(),["SPL"]:()=>this.minion(),["SXP"]:()=>this.fixedSapling(5),["SXD"]:()=>this.fixedSeedling(3),["SXT"]:()=>this.fixedTreefolk(7),["SDL"]:()=>this.minion(),["SPN"]:()=>this.nekSpirit(),["SPU"]:()=>this.uspirit(),["XYR"]:()=>this.yuruSpirit(),["TFK"]:()=>this.minion(),["TFD"]:()=>this.fixedTreefolk(this.boof5714),["TFF"]:()=>this.tfFight(),["TTF"]:()=>this.fixedTreefolk(3),["ZTR"]:()=>this.zimus(),["ZBS"]:()=>this.threeZomb(),["ZST"]:()=>this.strideZomb(),["ZMB"]:()=>this.commonZomb()}[t]}constructor(t){super(t),this.rarity="T";const e=this.cardCode();this.imgKey=e,this.minLevel=this.level,this.maxLevel=this.level,this.lookup(e)()}image(t){return this.rawImage(this.imgKey,t)}static fgoc(t){return "FGO"+t}fixedNekSpirit(t){this.faction="N",this.rarity="T",this.name="Spirit",this.tribe.push("ST"),this.iAttack=t,this.iHealth=t,this.imgKey=`${"SPN"}${this.level}`}nekSpirit(){this.fixedNekSpirit(this.boof51015)}yuruSpirit(){this.fixedNekSpirit(this.boof5814)}static purpOzC(t){return "POZ"+t}oozer(t){this.faction="N",this.rarity="T",this.name="Oozeling",this.tribe.push("OZ"),this.iHealth=this.iAttack,this.imgKey=t?"POZ":"OOZ"}purpz(){this.iAttack=this.boof135,this.oozer(!0)}nooze(){this.iAttack=this.boof4711,this.oozer(!1)}cooze(){this.iAttack=1,this.oozer(!1),this.hints=["RT"]}minion(){this.iAttack=U.minionBuff(this.level),this.plont(),this.name=U.minionName(this.level),this.hints=["RT"]}static tffc(t){return "TFF"+t}static minionCode(t){return(t===1?"SDL":t===2?"SPL":"TFK")+t}static minionName(t){return t===1?"Seedling":t===2?"Sapling":"Treefolk"}static minionBuff(t){return t===1?1:t===2?3:5}plont(){this.faction="U",this.iHealth=this.iAttack,this.tribe.push("PL")}fixedSapling(t){this.iAttack=t,this.plont(),this.name=U.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.iAttack=t,this.plont(),this.name=U.minionName(1),this.imgKey="SDL",this.hints=["RT"]}fixedTreefolk(t){this.iAttack=t,this.plont(),this.name=U.minionName(3),this.imgKey="TFK"}tfFight(){this.iAttack=this.boof91421,this.plont(),this.name=U.minionName(3),this.imgKey="TFK"}dozer(){this.faction="U",this.name="Dozer, the Awakened",this.iAttack=this.level*3+6,this.iHealth=this.iAttack,this.iAggro=!0,this.iBT=!0,this.tribe.push("BR"),this.imgKey=this.code,this.text=`${this.name} enters play with health equal to the Dozer, the Dormant it replaced.`}feywing(){this.faction="U",this.name="Feywing",this.iAttack=9,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("DG")}funguy(){this.name="Funguy",this.iAttack=this.lValN([6,12,14]),this.plont(),this.minLevel=1,this.maxLevel=3,this.hints=["DL"]}raptor(){this.faction="U",this.name="Raptor",this.iAttack=1,this.iHealth=1,this.tribe.push("DN"),this.hints=["RT"]}uspirit(){this.faction="U",this.name="Spirit",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("ST")}static zomc(t){return "ZMB"+t}zimus(){this.faction="N",this.rarity="L",this.name="Zimus, the Returned",this.tribe.push("ZB"),this.iAttack=10,this.iHealth=5,this.imgKey=`${"ZTU"}2`}zomb(t,e){this.faction="N",this.rarity="T",this.name="Zombie",this.tribe.push("ZB"),this.iAttack=t,this.iHealth=e,this.imgKey="ZMB"}commonZomb(){const t=this.boof359;this.zomb(t,t)}threeZomb(){this.zomb(3,3)}strideZomb(){this.zomb(this.lValN([4,8,10]),this.boof369)}}class lt extends yt{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ()},["ABE"]:{c:()=>this.edicC(),z:()=>this.edicZ()},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ()},["COD"]:{c:()=>this.chontC(),z:()=>this.chontZ()},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ()},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ()},["DGW"]:{c:()=>this.drwkC(),z:()=>this.drwkZ()},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ()},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ()},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ()},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ()},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ()},["IVS"]:{c:()=>this.infvC(),z:()=>this.infvZ()},["LOD"]:{c:()=>this.lashC(),z:()=>this.lashZ()},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ()},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ()},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ()},["PLW"]:{c:()=>this.palwC(),z:()=>this.palwZ()},["PTB"]:{c:()=>this.phyC(),z:()=>this.phyZ()},["PYS"]:{c:()=>this.pyreC(),z:()=>this.pyreZ()},["ROK"]:{c:()=>this.rokC(),z:()=>this.rokZ()},["STS"]:{c:()=>this.stsC(),z:()=>this.stsZ()},["SNP"]:{c:()=>this.pulseC(),z:()=>this.pulseZ()},["SRD"]:{c:()=>this.sradC(),z:()=>this.sradZ()},["SIV"]:{c:()=>this.beesC(),z:()=>this.beesZ()},["TST"]:{c:()=>this.talinC(),z:()=>this.talinZ()},["TRN"]:{c:()=>this.turnbC(),z:()=>this.turnbZ()},["VCH"]:{c:()=>this.verdC(),z:()=>this.verdZ()},["WOD"]:{c:()=>this.wdenC(),z:()=>this.wdenZ()}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){return this.cardCode()==="NSH"?this.leveledImage(t):this.fixedImage(t)}playTargets(){const t=super.playTargets();if(this.cardCode()==="ABE"&&this.aeSides().some(r=>r.length===0))return t;const e=w.boardTarget("CARD",this.code);return t.push(e),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),v.spellCast()}ddf8(t){return St.extractCardCode(t.trigger.logicCode)==="DGW"&&t.trigger.type==="TE"}jr8(t){if(St.extractCardCode(t.trigger.logicCode)==="DGW"){const r=f.jr5(t.trigger.creatId);r.status==="A"&&O.destroy(r,this.code)}x.triggerDone()}apulseC(){this.faction="A",this.rarity="C",this.name="Aegis Pulse",this.text=`Each friendly creature gets Armor ${this.boof234}.`}apulseZ(){const t=this.boof234;f.ddf1().forEach(e=>{e.addArmor(t)})}aeSides(){return[f.qPlayerCreats(!0),f.qPlayerCreats(!1)]}edicC(){this.faction="A",this.rarity="H",this.name="Ambriel's Edict",this.maxLevel=1,this.overload=!0,this.text="If each player has at least one creature in play, destroy all but the highest attack creature that each player controls.~Then discard you hand."}edicZ(){const t=this.aeSides(),e=N.tick();let r=[];t.forEach(g=>{if(g.length>1){let y=[],C=-999999;g.forEach(D=>{D.attack>C?(C=D.attack,r.push(...y),y=[D]):D.attack===C?y.push(D):r.push(D)}),y.length>1&&(y.splice(T.randInt(0,y.length),1),r.push(...y))}}),r.forEach(g=>O.destroy(g,this.code,e));const s=k.getActive(),h=v.playPosition(),u=s.hand.length;for(let g=u-1;g>-1;g--)g!==h&&(s.discard.push(s.hand[g]),s.hand.splice(g,1),v.shiftPlayCard(g))}get ctlboof(){return(this.level-1)*2}ctlC(){this.faction="T",this.rarity="L",this.name="Call the Lightning";const t=this.level>1?` gets ${m.jr9(this.ctlboof,0)} this turn. Those creatures`:"";this.text=`Each friendly creature${t} battles an additional time this turn.`}ctlZ(){const t=this.ctlboof;f.ddf1().forEach(e=>{const r=p.mod("AT",t,this.code);r.expiry="ET",e.addMod(r),e.extraBattles+=1})}chontC(){this.faction="T",this.rarity="R",this.name="Chant of Dragonwatch",this.maxLevel=1,this.text="Deal X damaage to each enemy creature, where X is your rank."}chontZ(){const t=k.getActive().rank,e=N.tick();f.qEnemyCreats().forEach(r=>{r.hurtDirect(t,this.code,e)})}dcurC(){this.faction="N",this.rarity="R",this.name="Death Current";const t=this.lValS(["a level 2 or lower","an","two"]);this.text=`Destroy ${t} enemy creature at random.`}dcurZ(){const t=this.dCurrHunter(),e=t.length;if(e>0){const r=T.randInt(0,e),s=N.tick();O.destroy(t[r],this.code,s),this.level===3&&e>1&&(t.splice(r,1),O.destroy(t[T.randInt(0,e-1)],this.code,s))}}dCurrHunter(){const t=p.crEnemyTarg();return t.level=w.ddf2(this.level+1),f.creatByTarget(t)}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${m.jr9(this.boof4812n,0)}.`}digiZ(){const t=this.boof4812n;f.qEnemyCreats().forEach(e=>{e.buff(t,0)})}drwkC(){this.faction="T",this.rarity="L",this.name="Dragonwake",this.text=`Search your deck for a ${m.levelGateText(this.level+1,!0)}Dragon and Spawn a copy of it. It gets Aggressive${this.level===3?".":' and "At the end of your turn, destroy this.'}`}drwkZ(){const t=p.target("DK");t.tribe="DG",t.level=w.ddf2(this.level+1),t.player="F";const e=w.deckByTarget(t),r=e.length;if(r>0){const s=f.birth(e[T.randInt(0,r)][0],"S",k.getActiveB());if(s&&(s.aggressive=!0,this.level<3)){const h=s.jr4("TE",this.code);h.creatId=s.id,h.changes=!0}}}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${m.jr9(t,t)}.`}epiZ(){const t=this.boof246n,e=p.crEnemyTarg();f.creatByTarget(e).forEach(r=>{r.buff(t,t)})}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${m.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;f.ddf1().forEach(e=>{e.buff(t,t),this.level===3&&(e.breakthrough=!0)})}get fszap(){return this.level+4}fstormC(){this.faction="T",this.rarity="H",this.name="Firestorm",this.text=`Deal ${this.fszap} damage to each creature.`}fstormZ(){const t=this.fszap,e=N.tick();f.qActiveCreats().forEach(r=>{r.hurtDirect(t,this.code,e)})}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${m.jr9(-1*t,0)}. Each friendly creature gets ${m.jr9(t,0)}.`}mealZ(){const t=this.boof234,e=k.getActiveB();f.qActiveCreats().forEach(r=>{const s=r.owner===e?t:-1*t;r.buff(s,0)})}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${m.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,e=p.crFriendTarg();f.creatByTarget(e).forEach(r=>{r.buff(0,t)})}infvC(){this.faction="N",this.rarity="C",this.name="Infernal Visage";const t=this.boof246;this.text=`Each friendly creature in a side lane gets ${m.jr9(t,t,!0)} and Regenerate ${this.level}.`}infvZ(){const t=this.boof246,e=p.crFriendTarg();e.lanes=[1,5],f.creatByTarget(e).forEach(r=>{r.buff(t,t),r.addRegen(this.level)})}lashC(){this.faction="U",this.rarity="L",this.name="Lash of Demara",this.text=`Each enemy creature gets Poison ${this.level+2}.`}lashZ(){const t=this.level+2;f.qEnemyCreats().forEach(e=>{e.addPoison(t)})}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=I.getCard(this.ndc());this.text=`Spawn a ${m.tokName(t)}.`}shriekZ(){f.birth(this.ndc(),"S",k.getActiveB())}ndc(){return "NDR"+this.level}noxC(){this.faction="U",this.rarity="R",this.name="Noxious Cloud",this.text=`Each enemy creature gets Poison ${this.boof246}.`}noxZ(){const t=this.boof246;f.qEnemyCreats().forEach(e=>{e.addPoison(t)})}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${m.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)f.ddf1().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;f.ddf1().forEach(e=>{e.buff(t,0)})}}palwC(){this.faction="A",this.rarity="R",this.name="Palladium Wave",this.maxLevel=1,this.text=`Each enemy creature gets ${m.jr9(-1,0).replaceAll("1","X")}, where X is two times your rank.`}palwZ(){const t=-2*k.getActive().rank;f.qEnemyCreats().forEach(e=>{e.buff(t,0)})}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=I.getCard(U.minionCode(this.level));this.text=`Put a ${m.tokName(t)} into each players available lanes.`}phyZ(){const t=U.minionCode(this.level),e=N.tick();[!0,!1].forEach(r=>{f.emptyLanes(r).forEach(s=>{f.birth(t,"P",r,s,e)})})}pyreC(){this.faction="T",this.rarity="C",this.name="Pyre Song",this.text=`Each friendly creature deals ${this.level} damage to each enemy creature.`}pyreZ(){const t=this.level,e=N.tick(),r=f.qEnemyCreats();f.ddf1().forEach(s=>{r.forEach(h=>{h.hurtDirect(t,s.code,e)})})}rokC(){this.faction="T",this.rarity="L",this.name="Rage of Kadras",this.overload=!0,this.maxLevel=1,this.text="Each friendly Tempys creature gets +1 attack and deals damage equal to its attack to the creature opposing it."}rokZ(){const t=N.tick(),e=p.crFriendTarg();e.faction="T",f.creatByTarget(e).forEach(r=>{r.buff(1,0);const s=r.opposed;s&&s.hurtDirect(r.attack,r.code,t)})}stsC(){this.faction="U",this.rarity="C",this.name="Scatter the Seeds";const t=I.getCard(U.minionCode(this.level));this.text=`Spawn three ${m.tokName(t)}s.`}stsZ(){const t=U.minionCode(this.level),e=N.tick();[1,2,3].forEach(r=>{f.birth(t,"S",k.getActiveB(),void 0,e)})}get spboof(){return(this.level+1)*-2}pulseC(){this.faction="A",this.rarity="H",this.name="Sonic Pulse",this.text=`Each enemy creature gets ${m.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;f.qEnemyCreats().forEach(e=>{e.buff(t,0)})}sradC(){this.faction="U",this.rarity="C",this.name="Soothing Radiance",this.text=`Heal ${this.boof61224} damage from each friendly creature.`}sradZ(){const t=this.boof61224;f.ddf1().forEach(e=>{e.heal(t)})}beec(){return "KBE"+this.level}beesC(){this.faction="U",this.rarity="H",this.name="Stinging Invocation";const t=I.getCard(this.beec());this.text=`Spawn one to three ${m.tokName(t)}s.`}beesZ(){const t=this.beec(),e=N.tick(),r=T.randInt(2,5);[1,2,3].forEach(s=>{s{const r=p.mod("AT",t);r.expiry="ET",e.addMod(r)})}talinTarg(){const t=p.crFriendTarg();return t.faction="T",f.creatByTarget(t)}turnbC(){this.faction="T",this.rarity="H",this.name="Turnabout",this.isFree=this.level===3;const t=this.boof235;this.text=`Each creature gets ${m.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,e=-1*t;f.qActiveCreats().forEach(r=>{const s=p.mod("AT",t),h=p.mod("HL",e),u=p.mod("MH",e);s.expiry="ET",h.expiry="ET",u.expiry="ET",r.addMod(s),r.addMod(h),r.addMod(u)})}verdC(){this.faction="U",this.rarity="H",this.name="Verdant Charge";const t=this.verdb;this.text=`Each friendly creature gets ${m.jr9(t,t,!0)} and Regenerate ${t}.`}verdZ(){const t=this.verdb;f.ddf1().forEach(e=>{e.buff(t,t),e.addRegen(t)})}get verdb(){return this.lValN([1,3,6])}wdenC(){this.faction="U",this.rarity="R",this.name="Whispers of Dendris",this.maxLevel=1,this.text=`Each friendly creature gets ${m.jr9(1,1).replaceAll("1","X")}, where X is your rank.`}wdenZ(){const t=k.getActive().rank;f.ddf1().forEach(e=>{e.buff(t,t)})}}class Lr extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Borean Mystic",this.iAttack=this.boof4814,this.iHealth=this.boof71118,this.tribe.push("WN","AS"),this.text=`Activate: Move another friendly creature to an available lane adjacent to ${this.name}.`}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=f.jr5(e[1]),h=this.emptySloots(s,r.id);h.push(v.cancelAction()),v.ddf5(h)}else{const r=f.jr5(e[1]),s=f.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),r.endActivation()}}emptySloots(t,e=""){return v.emptyAdjacents(t,T.enTil("P2",t.id,e))}buddies(t){return w.toActions(p.crFriendNotMeActTarg("CARD",t,this.code,T.enTil("P1",t)))}}class Gr extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Bron, Wild Tamer",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hints=["RD"];const e=this.boof357;this.bonus={exist:this.ddp9(0,e*2,0,0)},this.text=`Upgrade Dinosaur: Replace Bron with a level ${this.level} Dino Knight.~When this ${m.dbdtap()}, heal ${e} damage from each other friendly creature.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("UP",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="UP"){const r=W.toReplaced(t.event).replCreat;r.isTribe("DN")&&f.birth("DNK"+this.level,"R",r.owner,r.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,r=p.crNotMeTarg(t.creatId);r.player=k.toTarget(t.owner),f.creatByTarget(r).forEach(h=>h.heal(e)),x.triggerDone()}}}class $r extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Brightsteel Gargoyle",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("RB"),this.text=`At the end of your turn, ${this.name} gets Armor ${this.boof2510} and Defender until the end of the next turn.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("PT",this.code),r}ddf8(t){return t.trigger.type==="PT"?t.event.playerA===t.owner:!1}jr8(t){const e=p.mod("AR",this.boof2510,t.creatId),r=p.mod("DF",!0,t.creatId);e.expiry="ET",r.expiry="ET";const s=f.jr5(t.creatId);s.addMod(e),s.addMod(r),x.triggerDone()}}class Or extends yt{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Bullwark Bash",this.text=`Deal damage equal to ${this.level>1?this.level+"x ":""}the Armor on a friendly creature to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");e.hasArmor=!0,t.push(e)}return t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=this.enemyTargActions(r.id);s.push(v.cancelAction()),v.ddf5(s)}else{const r=f.ddf6(t),s=f.jr5(e[1]);this.logSpell(s),r.hurtDirect(s.armor*this.level,this.code),v.spellCast()}}enemyTargActions(t=""){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return w.toActions(e)}}class Wr extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Byzerak Spitemage",this.iAttack=this.boof369,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("HM"),this.text=`Allied Nekrium: When ${this.name} ${m.dbdtac(this.level)}, destroy it.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&e.isCreatSrc&&e.isCreatTarg&&e.dmg>0&&e.srcId===t.creatId&&w.levelTestCommon(e.hurtCreat.level,this.level)}else return!1}jr8(t){if(t.trigger.type==="FR"&&M.allied("N")){const e=f.jr5(t.creatId);e.jr4("DM",this.code),e.changed=!0}else if(t.trigger.type==="DM"){const r=W.toDamage(t.event).hurtCreat;r.status==="A"&&O.destroy(r,this.code)}x.triggerDone()}}class Ur extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Cercee, Hand of Varna",this.iAttack=this.lValN([1,3,5,7]),this.iHealth=this.lValN([6,10,20,40]),this.tribe.push("FB"),this.iMobile=1,this.maxLevel=4;const e=this.level===4?`When ${this.name} ${m.dbdtap()}, deal damamge to that player equal to their health.~`:"";this.text=e+`When ${this.name} ${m.dbdtac(this.level)}, destroy that creature.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);if(e.battle&&e.isCreatSrc&&e.srcId===t.creatId){if(this.level===4)return!0;if(e.isCreatTarg){const r=e.hurtCreat;return w.levelTestCommon(r.level,this.level)}}}return!1}jr8(t){const e=W.toDamage(t.event);if(e.isCreatTarg){const r=e.hurtCreat;r.status==="A"&&O.destroy(r,this.code)}else k.hurtDirect(e.hurtPlayer,e.hurtPlayer.health,this.code);x.triggerDone()}}class dt extends P{lookup(t){return{["BSW"]:{c:()=>this.bswC(),a:(r,s)=>this.bswA(r,s),t:r=>this.bswT(r)},["CCS"]:{c:()=>this.ccsC(),a:(r,s)=>this.ccsA(r,s),t:r=>this.ccsT(r)},["CGL"]:{c:()=>this.clordC(),a:(r,s)=>this.clordA(r,s),t:r=>this.clordT(r)},["CSH"]:{c:()=>this.cswC(),a:(r,s)=>this.cswA(r,s),t:r=>this.cswT(r)},["FFU"]:{c:()=>this.ffuC(),a:(r,s)=>this.ffuA(r,s),t:r=>this.ffuT(r)},["FFS"]:{c:()=>this.ffsC(),a:(r,s)=>this.ffsA(r,s),t:r=>this.ffsT(r)},["FSH"]:{c:()=>this.fssC(),a:(r,s)=>this.fssA(r,s),t:r=>this.fssT(r)},["KOD"]:{c:()=>this.kodC(),a:(r,s)=>this.kodA(r,s),t:r=>this.kodT(r)},["LOD"]:{c:()=>this.lashC(),a:(r,s)=>this.lashA(r,s),t:r=>this.lashT(r)},["MBP"]:{c:()=>this.mbpC(),a:(r,s)=>this.mbpA(r,s),t:r=>this.mbpT(r)},["MND"]:{c:()=>this.mndC(),a:(r,s)=>this.mndA(r,s),t:r=>this.mndT(r)},["NCS"]:{c:()=>this.ncsC(),a:(r,s)=>this.ncsA(r,s),t:r=>this.ncsT(r)},["NXG"]:{c:()=>this.nxgC(),a:(r,s)=>this.nxgA(r,s),t:r=>this.nxgT(r)},["NFF"]:{c:()=>this.nffC(),a:(r,s)=>this.nffA(r,s),t:r=>this.nffT(r)},["OHV"]:{c:()=>this.orghC(),a:(r,s)=>this.orghA(r,s),t:r=>this.orghT(r)},["PPM"]:{c:()=>this.ppmC(),a:(r,s)=>this.ppmA(r,s),t:r=>this.ppmT(r)},["PSC"]:{c:()=>this.pcoilC(),a:(r,s)=>this.pcoilA(r,s),t:r=>this.pcoilT(r)},["SGF"]:{c:()=>this.siggyC(),a:(r,s)=>this.siggyA(r,s),t:r=>this.siggyT(r)},["SRM"]:{c:()=>this.srmdC(),a:(r,s)=>this.srmdA(r,s),t:r=>this.srmdT(r)},["SSA"]:{c:()=>this.ssaC(),a:(r,s)=>this.ssaA(r,s),t:r=>this.ssaT(r)},["SWM"]:{c:()=>this.swmC(),a:(r,s)=>this.swmA(r,s),t:r=>this.swmT(r)},["UCM"]:{c:()=>this.ucmC(),a:(r,s)=>this.ucmA(r,s),t:r=>this.ucmT(r)},["UIM"]:{c:()=>this.uimC(),a:(r,s)=>this.uimA(r,s),t:r=>this.uimT(r)},["WMR"]:{c:()=>this.warmC(),a:(r,s)=>this.warmA(r,s),t:r=>this.warmT(r)},["WWR"]:{c:()=>this.wwrC(),a:(r,s)=>this.wwrA(r,s),t:r=>this.wwrT(r)},["WFS"]:{c:()=>this.wfsC(),a:(r,s)=>this.wfsA(r,s),t:r=>this.wfsT(r)},["XSH"]:{c:()=>this.shambC(),a:(r,s)=>this.shambA(r,s),t:r=>this.shambT(r)},["ZPM"]:{c:()=>this.zpmC(),a:(r,s)=>this.zpmA(r,s),t:r=>this.zpmT(r)}}[t]}targAction(t,e,r){this.lookup(t).a(e,r)}actTargets(t,e){return this.lookup(t).t(e)}xl=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return this.doubleActivator()&&(r.jr4("TS",this.code),this.addExtraActivate(r)),r}canActivate(t){return w.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){const e=w.toActions([this.actTargets(this.cardCode(),t),w.buttonTarget("CANC")]);v.ddf5(e)}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.logAct(!0,this.xl?e:void 0),this.targAction(this.cardCode(),e,r),r.endActivation()}makeCreatTarg(t){return p.crActTarg("CARD",this.code,t.id)}makeOtherCreatTarg(t){const e=this.makeCreatTarg(t);return e.notMe=t.id,e}doubleActivator(){return this.code==="CGL"+"3"||this.code==="XSH"+"3"}ddf8(t){return St.extractCardCode(t.trigger.logicCode)==="KOD"&&(t.trigger.type==="PT"||t.trigger.type==="VN")?!0:t.trigger.type==="TS"&&this.doubleActivator()?t.event.playerA===t.owner:super.ddf8(t)}jr8(t){if(t.trigger.type==="VN"){const e=t.event,r=f.jr5(e.creatId);f.birth(r.code,"S",t.owner),x.triggerDone()}else if(t.trigger.type==="PT"){const e=t.trigger.customCode,r=f.jr5(t.creatId);r.triggers.filter(h=>h.customCode===e).forEach(h=>r.removeTrigger(h)),x.triggerDone()}else if(t.trigger.type==="TS"){const e=f.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}bswC(){this.faction="T",this.rarity="C",this.name="Borean Stormweaver",this.iAttack=this.boof4816,this.iHealth=this.lValN([6,10,20]),this.tribe.push("GT"),this.xl=!1;const t=this.boof234;this.text=`Activate: Deal ${t} damage to a creature.`}bswT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}bswA(t,e){t.hurtDirect(this.boof234,this.code)}ccsC(){this.faction="N",this.rarity="C",this.name="Catacomb Spider",this.iAttack=this.boof4815,this.iHealth=this.lValN([5,10,16]),this.tribe.push("SP");const t=this.boof246;this.text=`Activate: Give another creature Regenerate ${t}.`}ccsT(t){const e=this.makeOtherCreatTarg(t);return e.canRegen=!0,e.hint=["BF"],e}ccsA(t,e){t.addRegen(this.boof246)}clordC(){this.faction="N",this.rarity="H",this.name="Contagion Lord",this.iAttack=this.boof4914,this.iHealth=this.iAttack+3,this.tribe.push("AB"),this.xl=!1,this.text="Activate, destroy a friendly Abomination: You may play an additional card this turn.",this.level===3&&(this.text+="~You may use this ability twice per turn.")}clordT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="AB",e}clordA(t,e){O.destroy(t,this.code),M.regularPlays+=1}cswC(){this.faction="A",this.rarity="C",this.name="Cypien Shieldwarden",this.iAttack=this.boof4610,this.iHealth=this.boof61016,this.tribe.push("HM");const t=this.boof246;this.text=`Activate: Give a creature Armor ${t} this turn.`}cswT(t){const e=this.makeCreatTarg(t);return e.canArmor=!0,e.hint=["BF"],e}cswA(t,e){const r=p.mod("AR",this.boof246,e.id);r.expiry="ET",t.addMod(r)}ffuC(){this.faction="T",this.rarity="H",this.name="Firefist Uranti",this.iAttack=this.boof357,this.iHealth=this.boof71116,this.tribe.push("FR","YT"),this.xl=!1,this.text=`Activate: Deal damage equal to ${this.name}'s attack to a creature.`}ffuT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],t.attack<1&&(e.victims="???"),e}ffuA(t,e){t.hurtDirect(e.attack,this.code)}ffsC(){this.faction="T",this.rarity="R",this.name="Flamefury Shaman",this.iAttack=this.boof369,this.iHealth=this.boof81116,this.tribe.push("HM"),this.text=`Activate: Grant another creature ${m.jr9(this.iAttack,0)} this turn.`}ffsT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}ffsA(t,e){const r=p.mod("AT",this.iAttack,e.id);r.expiry="ET",t.addMod(r)}fssC(){this.faction="T",this.rarity="R",this.name="Flamestoke Shaman",this.iAttack=this.boof61218,this.iHealth=this.boof3712,this.tribe.push("HM"),this.text=`Activate: Grant an adjacent ${m.levelGateText(this.level,!0)}creature Aggressive.`}fssT(t){const e=this.makeCreatTarg(t);return e.level=w.ddf2(this.level),e.lanes=t.adjacent,e.player="F",e}fssA(t,e){t.aggressive=!0}kodC(){this.faction="N",this.rarity="L",this.name="Keeper of the Damned",this.iAttack=this.boof5815,this.iHealth=this.boof61017,this.tribe.push("ZB"),this.text=`Activate: another friendly ${m.levelGateText(this.level,!0)}creature gets "Vengeance: Spawn this" this turn.`}kodT(t){const e=this.makeOtherCreatTarg(t);return e.level=w.ddf2(this.level),e.player="F",e}kodA(t,e){const r=t.jr4("VN",this.code);r.customCode=e.id,r.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e.id}lashC(){this.faction="U",this.rarity="L",this.name="Demara, Herald of Affliction",this.iAttack=14,this.iHealth=20,this.tribe.push("NG"),this.text="Activate: Give an enemy creature with Poison Defender.~Forge: Each enemy creature gets Poison 6."}lashT(t){const e=this.makeCreatTarg(t);return e.player="E",e.hasPoison=!0,e.canDefender=!0,e}lashA(t,e){t.defender=!0}mbpC(){this.faction="U",this.rarity="H",this.name="Mossbeard Patriarch",this.iAttack=this.boof137,this.iHealth=this.boof81220,this.tribe.push("PL"),this.text=`Activate: Give another creature ${m.jr9(0,this.boof468)}.`}mbpT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mbpA(t,e){t.buff(0,this.boof468)}mndC(){this.faction="A",this.rarity="R",this.name="Munitions Drone",this.iAttack=this.boof137,this.iHealth=this.boof6814,this.tribe.push("RB"),this.text=`Activate: Give another creature ${m.jr9(this.boof357,0)}.`}mndT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mndA(t,e){t.buff(this.boof357,0)}ncsC(){this.faction="N",this.rarity="R",this.name="Necroslime",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.xl=!1;const t=this.boof248;this.text=`Activate, deal 3 damage to another friendly creature: ${this.name} gets ${m.jr9(t,t)}.`}ncsT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}ncsA(t,e){const r=this.boof248;t.hurtDirect(3,this.code),e.buff(r,r)}nxgC(){this.faction="A",this.rarity="H",this.name="Nexus Gunner",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("HM"),this.text=`Activate: Give a creature ${m.jr9(this.iAttack,0)}. Use this ability only if ${this.name} is in the center lane.`}nxgT(t){const e=this.makeCreatTarg(t);return t.lane!==3?e.victims="???":e.hint=["BF","BB"],e}nxgA(t,e){t.buff(this.iAttack,0)}nffC(){this.faction="U",this.rarity="L",this.name="Nuada, Faith's Flourish",this.iAttack=this.boof246,this.iHealth=this.lValN([10,17,25]),this.iDefend=!0,this.tribe.push("TK"),this.xl=!1;const t=I.getCard(U.tffc(this.level));this.text=`Activate: Replace a friendly Plant with a ${m.tokName(t)}.`}nffT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="PL",e}nffA(t,e){f.birth(U.tffc(this.level),"R",e.owner,t.lane)}orghC(){this.faction="N",this.rarity="R",this.name="Organ Harvester",this.iAttack=this.lValN([2,6,9]),this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1,this.text=`Activate, destroy ${this.name}: Destroy a ${m.levelGateText(this.level,!0)}creature.`}orghT(t){const e=this.makeOtherCreatTarg(t);return e.level=w.ddf2(this.level),e.hint=["KL"],e}orghA(t,e){const r=N.tick();O.destroy(t,this.code,r),O.destroy(e,this.code,r)}ppmC(){this.faction="A",this.rarity="R",this.name="Palladium Pulsemage",this.iAttack=this.lValN([2,8,12]),this.iHealth=this.lValN([7,12,15]),this.tribe.push("HM"),this.text=`Activate: give a creature ${m.jr9(this.boof4812n,0)} this turn.`}ppmT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}ppmA(t,e){const r=p.mod("AT",this.boof4812n,e.id);r.expiry="ET",t.addMod(r)}pcoilC(){this.faction="U",this.rarity="R",this.name="Poisoncoil",this.iAttack=this.boof357,this.iHealth=this.boof71013,this.iDefend=!0,this.tribe.push("SN"),this.text=`Activate: Give another creature Poison ${this.boof135}.`}pcoilT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["PN","DF"],e}pcoilA(t,e){t.addPoison(this.boof135)}siggyC(){this.faction="N",this.rarity="H",this.name="Sigmund Fraud",this.iAttack=this.boof357,this.iHealth=this.lValN([9,14,19]),this.iDefend=!0,this.tribe.push("AB"),this.xl=!1;const t=this.boof4812;this.text=`Activate, destroy another friendly creature: Deal ${t} damage to the enemy player and you gain ${t} health.`}siggyT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}siggyA(t,e){O.destroy(t,this.code);const r=this.boof4812;k.hurtDirect(!e.owner,r,this.code),k.heal(e.owner,r)}srmdC(){this.faction="N",this.rarity="H",this.name="Sorrow Maiden",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.xl=!1,this.text=`Activate: Destroy an enemy creature with ${this.iAttack} or less attack.`}srmdT(t){const e=this.makeCreatTarg(t);return e.player="E",e.maxAttack=this.iAttack,e}srmdA(t,e){O.destroy(t,this.code)}ssaC(){this.faction="N",this.rarity="H",this.name="Spitesower Acolyte",this.iAttack=this.boof234,this.iHealth=this.lValN([8,14,22]),this.tribe.push("HM");const t=this.boof246n;this.text=`Activate, deal ${-t} damage to ${this.name}: Give a creature ${m.jr9(t,t)}.`}ssaT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","BB"],e}ssaA(t,e){const r=this.boof246n,s=N.tick();e.hurtDirect(-r,this.code,s),t.buff(r,r,s)}swmC(){this.faction="A",this.rarity="R",this.name="Steelwelder Medic",this.iAttack=this.lValN([3,5,13]),this.iHealth=this.boof61014,this.tribe.push("HM"),this.text=`Activate: Give another creature Armor ${this.level}.`}swmT(t){const e=this.makeOtherCreatTarg(t);return e.canArmor=!0,e.hint=["BF","BB"],e}swmA(t,e){t.addArmor(this.level)}ucmC(){this.faction="T",this.rarity="R",this.name="Uranti Cryomancer",this.iAttack=this.boof247,this.iHealth=this.lValN([8,13,17]),this.tribe.push("IC","YT"),this.xl=!1,this.text=`Activate: Deal ${this.boof135} damage to a creature.`}ucmT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}ucmA(t,e){t.hurtDirect(this.boof135,this.code)}uimC(){this.faction="T",this.rarity="C",this.name="Uranti Icemage",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.lValN([8,13,20]),this.tribe.push("IC","YT"),this.text="Activate: Negate Defender this turn."}uimT(t){const e=this.makeCreatTarg(t);return e.hint=["BB"],e}uimA(t,e){const r=p.mod("ND",!0,e.id);r.expiry="ET",t.addMod(r)}warmC(){this.faction="A",this.rarity="H",this.name="War Merchant",this.iAttack=this.boof468,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("HM"),this.text=`Activate: Give a creature in a center lane ${m.jr9(this.iAttack,this.level===3?this.iAttack:0)}.`}warmT(t){const e=this.makeCreatTarg(t);return e.lanes=3,e.hint=["BF","BB"],e}warmA(t,e){t.buff(this.iAttack,this.level===3?this.iAttack:0)}wwrC(){this.faction="U",this.rarity="C",this.name="Weirwood Ranger",this.iAttack=this.boof51015,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.text=`Activate: Give another creature ${m.jr9(this.level,this.level)}.`}wwrT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF","BB"],e}wwrA(t,e){t.buff(this.level,this.level)}wfsC(){this.faction="N",this.rarity="H",this.name="Witherfrost Succubus",this.iAttack=this.boof147,this.iHealth=this.boof61018,this.tribe.push("DM");const t=-this.boof357;this.text=`Activate: Give a creature ${m.jr9(t,t)} this turn.`}wfsT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}wfsA(t,e){const r=-this.boof357,s=p.mod("AT",r,e.id);s.expiry="ET",t.addMod(s);const h=p.mod("HL",r,e.id);h.expiry="ET",t.addMod(h);const u=p.mod("MH",r,e.id);u.expiry="ET",t.addMod(u)}shambC(){this.faction="N",this.rarity="L",this.name="Xithian Shambler",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1;let t="";this.level===3&&(t="~You may use this ability twice per turn."),this.text=`Activate, destroy an adjacent creature: ${this.name} moves into that creature's lane, then gets +attack and +health equal to that creature's attack and health.${t}`}shambT(t){const e=p.crFriendActTarg("CARD",this.code,t.id);return e.lanes=t.adjacent,e}shambA(t,e){const r=t.attack,s=t.health;O.destroy(t,this.code),e.move(t.lane),e.buff(r,s)}zpmC(){this.faction="T",this.rarity="R",this.name="Zephyr Mage",this.iAttack=this.boof4813,this.iHealth=this.boof61017,this.tribe.push("WN","AS"),this.text=`Activate: Give another ${m.levelGateText(this.level,!0)}creature Mobility ${this.level}.`}zpmT(t){const e=this.makeOtherCreatTarg(t);return e.level=w.ddf2(this.level),e.canMove=!0,e.hint=["BF","BB"],e}zpmA(t,e){t.addMobility(this.level)}}class We extends P{lookup(t){return{["CMF"]:{c:()=>this.aconC(),f:(r,s)=>this.aconF(r,s)},["FLH"]:{c:()=>this.flhC(),f:(r,s)=>this.flhF(r,s)},["TBB"]:{c:()=>this.tbbC(),f:(r,s)=>this.tbbF(r,s)}}[t]}targAction(t,e,r){this.lookup(t).f(e,r)}playTarg;optional=!1;notme=!1;ftext="";constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("AS",this.code);return s.interactive=!0,r}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.targAction(this.cardCode(),e,r),v.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const e=w.toActions(this.playTarg);e.length>0?(e.forEach(r=>{r.param=t.creatId}),this.optional&&e.push(v.noneEndTrigger()),v.ddf5(e)):x.triggerDone()}aconC(){this.faction="N",this.rarity="R",this.name="Calamity Fiend",this.iAttack=this.boof4814,this.iHealth=this.lValN([5,10,16]),this.tribe.push("DM");const t=-this.boof234;this.addSp("U",t),this.playTarg.player="E",this.ftext=`Give an enemy creature ${m.jr9(t,t)}.`}aconF(t,e){this.logAct(!1,t);const r=-this.boof234;t.buff(r,r)}flhC(){this.faction="T",this.rarity="C",this.name="Firelight Hunter",this.iAttack=this.boof468,this.iHealth=this.iAttack-2,this.tribe.push("HM"),this.playTarg.player="E",this.addSp("D",this.iAttack),this.ftext=`Deal ${this.iAttack} to an enemy creature.`}flhF(t,e){t.hurtDirect(this.iAttack,this.code)}tbbC(){this.faction="T",this.rarity="R",this.name="Totembound Berserker",this.iAttack=this.boof81318,this.iHealth=this.lValN([2,4,10]),this.tribe.push("GT"),this.playTarg.player="E",this.playTarg.level=w.ddf2(this.level),this.optional=!0,this.ftext=`You may move an enemy ${m.levelGateText(this.level,!0)}creature to the space opposing ${this.name}.`}tbbF(t,e){e.opposed||(this.logAct(!1,t),t.move(f.oppositeLane(e.lane)))}}class gt extends P{lookup(t){return{["ABM"]:{c:()=>this.mawC(),f:(r,s)=>this.mawF(r,s)},["AGC"]:{c:()=>this.aconC(),f:(r,s)=>this.aconF(r,s)},["BTI"]:{c:()=>this.binvC(),f:(r,s)=>this.binvF(r,s)},["BSR"]:{c:()=>this.bsrC(),f:(r,s)=>this.bsrF(r,s)},["BAW"]:{c:()=>this.bawC(),f:(r,s)=>this.bawF(r,s)},["CKB"]:{c:()=>this.cacC(),f:(r,s)=>this.cacF(r,s)},["CHA"]:{c:()=>this.chaC(),f:(r,s)=>this.chaF(r,s)},["CCR"]:{c:()=>this.ccC(),f:(r,s)=>this.ccF(r,s)},["FRI"]:{c:()=>this.friC(),f:(r,s)=>this.friF(r,s)},["FRV"]:{c:()=>this.freavC(),f:(r,s)=>this.freavF(r,s)},["GLF"]:{c:()=>this.gfiendC(),f:(r,s)=>this.gfiendF(r,s)},["GRW"]:{c:()=>this.grwC(),f:(r,s)=>this.grwF(r,s)},["GHT"]:{c:()=>this.grhC(),f:(r,s)=>this.grhF(r,s)},["MMH"]:{c:()=>this.houndC(),f:(r,s)=>this.houndF(r,s)},["MXW"]:{c:()=>this.mtxC(),f:(r,s)=>this.mtxF(r,s)},["NGB"]:{c:()=>this.ngbC(),f:(r,s)=>this.ngbF(r,s)},["PHS"]:{c:()=>this.phxsC(),f:(r,s)=>this.phxsF(r,s)},["RWD"]:{c:()=>this.rotC(),f:(r,s)=>this.rotF(r,s)},["SHY"]:{c:()=>this.schyC(),f:(r,s)=>this.schyF(r,s)},["STD"]:{c:()=>this.stdC(),f:(r,s)=>this.stdF(r,s)},["SEV"]:{c:()=>this.surzC(),f:(r,s)=>this.surzF(r,s)},["VNF"]:{c:()=>this.vnfC(),f:(r,s)=>this.vnfF(r,s)},["WBY"]:{c:()=>this.wbyC(),f:(r,s)=>this.wbyF(r,s)},["WBU"]:{c:()=>this.wbuC(),f:(r,s)=>this.wbuF(r,s)},["XDH"]:{c:()=>this.dogsC(),f:(r,s)=>this.dogsF(r,s)}}[t]}targAction(t,e,r){this.lookup(t).f(e,r)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}jr3(t,e){const r=super.jr3(t,e);if(this.forges){const s=r.jr4("FR",this.code);s.interactive=!0}return r}ddf8(t){return St.extractCardCode(t.trigger.logicCode)==="CKB"&&t.trigger.type==="TS"?!0:super.ddf8(t)}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.targAction(this.cardCode(),e,r),v.actionDone(!0)}jr8(t){const e=this.cardCode();if(t.trigger.type==="TS"&&e==="CKB"){this.logAct(!1),M.regularPlays+=1;const s=t.event,h=k.toPlayer(s.playerA),u=p.trigIdx(h.triggers,t.trigger);u>-1&&h.triggers.splice(u,1),x.triggerDone();return}if(e==="ABM"){const s=p.crFriendNotMeTarg(t.creatId);if(s.tribe="AB",f.creatByTarget(s).length===0){x.triggerDone();return}}this.notme&&(this.playTarg.notMe=t.creatId);const r=w.toActions(this.playTarg);r.length>0?(r.forEach(s=>{s.param=t.creatId}),this.optional&&r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}mawC(){this.faction="N",this.rarity="C",this.name="Abyssal Maw",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=-this.boof359;this.ftext=`If there is another friendly Abomination, give an enemy creature ${m.jr9(t,t)}.`}mawF(t,e){this.logAct(!1,t);const r=-this.boof359;t.buff(r,r)}aconC(){this.faction="A",this.rarity="C",this.name="Aegis Conscript",this.iAttack=this.boof3612,this.iHealth=this.boof6915,this.tribe.push("HM"),this.playTarg.canArmor=!0,this.playTarg.player="F",this.ftext=`Give a friendly creature Armor ${this.boof124}.`}aconF(t,e){this.logAct(!1,t),t.addArmor(this.boof124)}binvC(){this.faction="A",this.rarity="C",this.name="Battletech Inventor",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("MM"),this.playTarg.player="E",this.ftext=`Give an enemy creature ${m.jr9(-this.iAttack,0)}.`}binvF(t,e){this.logAct(!1,t),t.buff(-this.iAttack,0)}bsrC(){if(this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.iAttack=this.boof5813,this.iHealth=this.boof3712,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.playTarg.level=w.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy an enemy ${m.levelGateText(t,!0)}creature.`,this.optional=!0}else this.hints=["LV"]}bsrF(t,e){O.destroy(t,this.code)}bawC(){this.faction="U",this.rarity="R",this.name="Brambleaxe Warrior",this.iAttack=this.boof61014,this.iHealth=this.iAttack-4,this.tribe.push("HM"),this.playTarg.hint=["BF"],this.ftext="Give a creature Breakthrough this turn."}bawF(t,e){this.logAct(!1,t);const r=p.mod("BT",!0,e.id);r.expiry="ET",t.addMod(r)}cacC(){this.faction="N",this.rarity="H",this.name="Cacklebones",this.iAttack=this.boof5915,this.iHealth=this.iAttack-this.level,this.tribe.push("SK"),this.playTarg.level=w.ddf2(this.level),this.playTarg.player="E",this.ftext=`Destroy an enemy ${m.levelGateText(this.level,!0)}creature. If you do, the enemy player may play an additional card next turn.`,this.optional=!0}cacF(t,e){O.destroy(t,this.code);const r=k.toPlayer(t.owner),s=p.trigger("TS",this.code);r.triggers.push(s)}chaC(){this.faction="U",this.rarity="R",this.name="Chistlehearth Archer",this.iAttack=this.boof2510,this.iHealth=this.iAttack+7,this.tribe.push("HM");const t=this.boof4816;this.playTarg.player="E",this.playTarg.hasMobility=!0,this.ftext=`Deal ${t} damage to an enemy creature with Mobility. Negate Mobility from that creature.`}chaF(t,e){t.hurtDirect(this.boof4816,this.code),t.negateMobility=!0}ccC(){this.faction="N",this.rarity="C",this.name="Corpse Crawler",this.iAttack=this.boof81220,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.playTarg.player="F",this.ftext="Destroy a friendly creature."}ccF(t,e){O.destroy(t,this.code)}friC(){this.faction="T",this.rarity="C",this.name="Flamerift Instigator",this.iAttack=this.lValN([7,12,17]),this.iHealth=this.iAttack-5,this.tribe.push("GT"),this.ftext="Negate Defender from a creature."}friF(t,e){this.logAct(!1,t),t.negateDefender=!0}freavC(){if(this.faction="N",this.rarity="H",this.name="Fleshreaver",this.iAttack=this.boof6915,this.iHealth=this.boof235,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.consistent=!0,this.playTarg.level=w.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy a ${m.levelGateText(t)} enemy creature.`,this.optional=!0}else this.hints=["LV"]}freavF(t,e){O.destroy(t,this.code)}get fiendBof(){return this.lValN([-1,-2,-5])}gfiendC(){this.faction="N",this.rarity="C",this.name="Gloomfiend",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=this.fiendBof;this.ftext=`You may give an enemy creature ${m.jr9(t,t)}.`,this.optional=!0}gfiendF(t,e){this.logAct(!1,t);const r=this.fiendBof;t.buff(r,r)}grwC(){this.faction="N",this.rarity="C",this.name="Gloomreaper Witch",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof147;this.playTarg.maxAttack=t,this.playTarg.player="E",this.ftext=`You may destroy an enemy creature with ${t} or less attack.`,this.optional=!0}grwF(t,e){O.destroy(t,this.code)}grhC(){this.faction="U",this.rarity="C",this.name="Grove Huntress",this.iAttack=this.boof4711,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.playTarg.player="F";const t=this.boof135;this.ftext=`Give a friendly creature ${m.jr9(t,t)}.`}grhF(t,e){this.logAct(!1,t);const r=this.boof135;t.buff(r,r)}houndC(){this.faction="T",this.rarity="C",this.name="Magma Hound",this.iAttack=this.boof4813,this.iHealth=this.iAttack-1,this.tribe.push("ER","EL");const t=this.boof246;this.optional=!0,this.playTarg.player="E",this.ftext=`You may deal ${t} damage to an enemy creature.`}houndF(t,e){t.hurtDirect(this.boof246,this.code)}mtxC(){this.faction="A",this.rarity="C",this.name="Matrix Warden",this.iAttack=this.lValN([3,8,12]),this.iHealth=this.iAttack,this.tribe.push("RB");const t=this.boof3510;this.playTarg.player="F",this.ftext=`Give a friendly creature ${m.jr9(t,0)}.`}mtxF(t,e){this.logAct(!1,t),t.buff(this.boof3510,0)}ngbC(){this.faction="T",this.rarity="C",this.name="Nargath Bruiser",this.iAttack=this.boof5814,this.iHealth=this.iAttack-1,this.tribe.push("ER","AS");const t=this.boof248;this.playTarg.player="F",this.ftext=`Give a friendly creature ${m.jr9(0,t)}.`}ngbF(t,e){this.logAct(!1,t),t.buff(0,this.boof248)}phxsC(){this.faction="A",this.rarity="R",this.name="Phalanx Squadron",this.iAttack=this.boof3714,this.iHealth=this.boof61117,this.tribe.push("HM"),this.playTarg.hasArmor=!0,this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature with Armor ${m.jr9(t,t)}.`}phxsF(t,e){this.logAct(!1,t);const r=this.boof234;t.buff(r,r)}rotC(){this.faction="N",this.rarity="C",this.name="Rot Wanderer",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.playTarg.maxAttack=this.iAttack,this.playTarg.player="E",this.ftext=`Destroy an enemy creature with ${this.iAttack} or less attack.`}rotF(t,e){O.destroy(t,this.code)}schyC(){this.faction="N",this.rarity="C",this.name="Scourge Hydra",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("HY"),this.playTarg.player="F",this.ftext="Deal 3 damage to a friendly creature."}schyF(t,e){t.hurtDirect(3,this.code)}stdC(){this.faction="A",this.rarity="H",this.name="Shardthief Druid",this.iAttack=this.boof5813,this.iHealth=this.boof81318,this.tribe.push("MM"),this.playTarg.canRegen,this.playTarg.player="E",this.ftext=`Negate and remove all Regenerate from an enemy creature. ${this.name} gets that much Renerate.`}stdF(t,e){this.logAct(!1,t);const r=t.regen;t.negateRegen=!0,e.addRegen(r)}surzC(){this.faction="N",this.rarity="L",this.name="Suruzal, Emissary of Varna",this.iAttack=this.boof4814,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.playTarg.player="F",this.playTarg.level=w.ddf2(this.level),this.ftext=`You may destroy another friendly ${m.levelGateText(this.level,!0)}creature. If you do, spawn a copy of it.`}surzF(t,e){const r=N.tick();O.destroy(t,this.code,r),f.birth(t.code,"S",e.owner,void 0,r)}vnfC(){this.faction="U",this.rarity="R",this.name="Venomfang",this.iAttack=this.boof61014,this.iHealth=this.iAttack-2,this.tribe.push("SN");const t=this.boof246;this.playTarg.player="E",this.ftext=`Give an enemy creature Poison ${t}.`}vnfF(t,e){this.logAct(!1,t),t.addPoison(this.boof246)}wbyC(){this.faction="T",this.rarity="R",this.name="Wallbreaker Yeti",this.iAttack=this.boof4712,this.iHealth=this.boof71116,this.tribe.push("ER","YT"),this.playTarg.player="E",this.playTarg.level=w.ddf2(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${m.levelGateText(this.level,!0)}enemy creature with Defender.`,this.optional=!0}wbyF(t,e){O.destroy(t,this.code)}wbuC(){this.faction="T",this.rarity="C",this.name="Warbringer Uranti",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("LT","YT");const t=this.boof4812;this.notme=!0,this.playTarg.player="F",this.addSp("A",t),this.ftext=`Give another friendly creature ${m.jr9(t,0)} this turn.`}wbuF(t,e){this.logAct(!1,t);const r=p.mod("AT",this.boof4812,e.id);r.expiry="ET",t.addMod(r)}dogsC(){this.faction="N",this.rarity="R",this.name="Xithian Direhound",this.iAttack=4,this.iHealth=4,this.tribe.push("AB"),this.overload=!0,this.maxLevel=1,this.optional=!0,this.playTarg.player="E",this.ftext=`You may give an enemy creature ${m.jr9(-4,-4)}.`}dogsF(t,e){this.logAct(!1,t),t.buff(-4,-4)}}class L extends yt{lookup(t){return{["AGW"]:{c:()=>this.awingC(),z:r=>this.awingZ(r)},["ASG"]:{c:()=>this.asurgeC(),z:r=>this.asurgeZ(r)},["ATZ"]:{c:()=>this.anatC(),z:r=>this.anatZ(r)},["AQE"]:{c:()=>this.aqatC(),z:r=>this.aqatZ(r)},["ABL"]:{c:()=>this.ablC(),z:r=>this.ablZ(r)},["BFT"]:{c:()=>this.bftC(),z:r=>this.bftZ(r)},["BTM"]:{c:()=>this.botC(),z:r=>this.botZ(r)},["CSU"]:{c:()=>this.csurgeC(),z:r=>this.csurgeZ(r)},["CNT"]:{c:()=>this.ctmsC(),z:r=>this.ctmsZ(r)},["CTW"]:{c:()=>this.cullC(),z:r=>this.cullZ(r)},["CTV"]:{c:()=>this.cultC(),z:r=>this.cultZ(r)},["CAG"]:{c:()=>this.cypaC(),z:r=>this.cypaZ(r)},["CBS"]:{c:()=>this.cypbC(),z:r=>this.cypbZ(r)},["DDF"]:{c:()=>this.dendC(),z:r=>this.dendZ(r)},["DBT"]:{c:()=>this.dreadC(),z:r=>this.dreadZ(r)},["DYB"]:{c:()=>this.drybC(),z:r=>this.drybZ(r)},["ETN"]:{c:()=>this.elnC(),z:r=>this.elnZ(r)},["ENP"]:{c:()=>this.enpC(),z:r=>this.enpZ(r)},["ENR"]:{c:()=>this.rageC(),z:r=>this.rageZ(r)},["EFA"]:{c:()=>this.efauC(),z:r=>this.efauZ(r)},["EXD"]:{c:()=>this.expdmC(),z:r=>this.expdmZ(r)},["FIN"]:{c:()=>this.feralC(),z:r=>this.feralZ(r)},["FVA"]:{c:()=>this.fervassC(),z:r=>this.fervassZ(r)},["FJT"]:{c:()=>this.fjetC(),z:r=>this.fjetZ(r)},["FLN"]:{c:()=>this.flncC(),z:r=>this.flncZ(r)},["FFL"]:{c:()=>this.ffldC(),z:r=>this.ffldZ(r)},["FZS"]:{c:()=>this.frozC(),z:r=>this.frozZ(r)},["GTH"]:{c:()=>this.ghastC(),z:r=>this.ghastZ(r)},["GCR"]:{c:()=>this.crushC(),z:r=>this.crushZ(r)},["HAR"]:{c:()=>this.hartC(),z:r=>this.hartZ(r)},["IFR"]:{c:()=>this.izftC(),z:r=>this.izftZ(r)},["JPK"]:{c:()=>this.jpC(),z:r=>this.jpZ(r)},["LBR"]:{c:()=>this.lbrandC(),z:r=>this.lbrandZ(r)},["LYS"]:{c:()=>this.shartC(),z:r=>this.shartZ(r)},["MPH"]:{c:()=>this.morphC(),z:r=>this.morphZ(r)},["MSC"]:{c:()=>this.sculptC(),z:r=>this.sculptZ(r)},["NNS"]:{c:()=>this.nanoC(),z:r=>this.nanoZ(r)},["NSL"]:{c:()=>this.natselC(),z:r=>this.natselZ(r)},["NCF"]:{c:()=>this.nflayC(),z:r=>this.nflayZ(r)},["NCV"]:{c:()=>this.nviveC(),z:r=>this.nviveZ(r)},["OEX"]:{c:()=>this.oexpC(),z:r=>this.oexpZ(r)},["OSS"]:{c:()=>this.orssC(),z:r=>this.orssZ(r)},["PTR"]:{c:()=>this.pwtorC(),z:r=>this.pwtorZ(r)},["PSG"]:{c:()=>this.psurgeC(),z:r=>this.psurgeZ(r)},["PMS"]:{c:()=>this.pslamC(),z:r=>this.pslamZ(r)},["ROG"]:{c:()=>this.rotgC(),z:r=>this.rotgZ(r)},["SAP"]:{c:()=>this.sapC(),z:r=>this.sapZ(r)},["SVO"]:{c:()=>this.soathC(),z:r=>this.soathZ(r)},["SOC"]:{c:()=>this.scythC(),z:r=>this.scythZ(r)},["SOA"]:{c:()=>this.soaC(),z:r=>this.soaZ(r)},["SOD"]:{c:()=>this.sodC(),z:r=>this.sodZ(r)},["SOT"]:{c:()=>this.sotC(),z:r=>this.sotZ(r)},["SHG"]:{c:()=>this.shgrC(),z:r=>this.shgrZ(r)},["SNB"]:{c:()=>this.snbC(),z:r=>this.snbZ(r)},["SHV"]:{c:()=>this.sharvC(),z:r=>this.sharvZ(r)},["SRP"]:{c:()=>this.sreapC(),z:r=>this.sreapZ(r)},["STR"]:{c:()=>this.sttorC(),z:r=>this.sttorZ(r)},["STO"]:{c:()=>this.sptorC(),z:r=>this.sptorZ(r)},["SOV"]:{c:()=>this.sovC(),z:r=>this.sovZ(r)},["STN"]:{c:()=>this.stbrnC(),z:r=>this.stbrnZ(r)},["STP"]:{c:()=>this.ssperC(),z:r=>this.ssperZ(r)},["SIN"]:{c:()=>this.sinC(),z:r=>this.sinZ(r)},["TGL"]:{c:()=>this.tanglC(),z:r=>this.tanglZ(r)},["TPT"]:{c:()=>this.tpactC(),z:r=>this.tpactZ(r)},["TUP"]:{c:()=>this.tugC(),z:r=>this.tugZ(r)},["TOT"]:{c:()=>this.totsC(),z:r=>this.totsZ(r)},["TOB"]:{c:()=>this.blightC(),z:r=>this.blightZ(r)},["TXB"]:{c:()=>this.txbnC(),z:r=>this.txbnZ(r)},["TXS"]:{c:()=>this.sporeC(),z:r=>this.sporeZ(r)},["TCG"]:{c:()=>this.tremcC(),z:r=>this.tremcZ(r)},["URS"]:{c:()=>this.urstC(),z:r=>this.urstZ(r)},["VSK"]:{c:()=>this.vensC(),z:r=>this.vensZ(r)},["VGR"]:{c:()=>this.vgraC(),z:r=>this.vgraZ(r)},["VGL"]:{c:()=>this.vglchC(),z:r=>this.vglchZ(r)},["VOB"]:{c:()=>this.vobC(),z:r=>this.vobZ(r)},["VYE"]:{c:()=>this.vembC(),z:r=>this.vembZ(r)},["UBL"]:{c:()=>this.uboltC(),z:r=>this.uboltZ(r)},["WMM"]:{c:()=>this.warC(),z:r=>this.warZ(r)},["XRW"]:{c:()=>this.xwillC(),z:r=>this.xwillZ(r)}}[t]}cardCast(t,e){this.lookup(t).z(e)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.cardCode()==="NSL"&&f.creatByTarget(p.crFriendTarg()).length<5||t.push(this.playTarg),t}handleAction(t){const e=f.ddf6(t);this.logSpell(this.xl?e:void 0),this.cardCast(this.cardCode(),e),v.spellCast()}ddf8(t){const e=St.extractCardCode(t.trigger.logicCode);if(e==="TOB"&&t.trigger.type==="DM"){const r=W.toDamage(t.event);if(r.battle&&r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId)return this.level===3?!0:I.getCard(r.hurtCreat.code).level<=this.level}else if((e==="ABL"||e==="OEX"||e==="VOB")&&t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId}else if((e==="FZS"||e==="IFR")&&t.trigger.type==="DM"){const r=t.event;if(r.isCreatTarg&&r.target===t.creatId)return!0}else if(e==="DYB"&&t.trigger.type==="EF"){const r=W.toEnterField(t.event);return t.trigger.creatId!==r.creature.id&&r.creature.owner===t.owner}else if(e==="FVA"&&t.trigger.type==="FK"||e==="ROG"&&t.trigger.type==="DS"||e==="SHG"&&(t.trigger.type==="PT"||t.trigger.type==="VN")||(e==="IFR"||e==="OEX")&&t.trigger.type==="PT")return!0;return!1}jr8(t){const e=St.extractCardCode(t.trigger.logicCode);if(e==="TOB"){const r=t.event,s=f.jr5(r.target);s.status==="A"&&O.destroy(s,this.code)}else if(e==="ABL")f.jr5(t.creatId).buff(this.level,this.level);else if(e==="FVA"){const r=f.jr5(t.creatId),s=f.searchByLane(f.oppositeLane(r.lane),!r.owner);s&&s.hurtDirect(this.boof3612,r.code)}else if(e==="FZS"||e==="IFR"&&t.trigger.type==="DM"){const r=f.jr5(t.creatId);r.status==="A"&&O.destroy(r,this.code)}else if(e==="ROG"||e==="DYB")f.jr5(t.creatId).buff(this.level,this.level);else if(e==="SHG"){if(t.trigger.type==="VN"){const r=t.event,s=f.jr5(r.creatId);f.birth(s.code,"S",t.owner)}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,s=f.jr5(t.creatId);s.triggers.filter(u=>u.customCode===r).forEach(u=>s.removeTrigger(u))}}else if(e==="IFR"&&t.trigger.type==="PT"){const r=T.deTil(t.trigger.customCode),s=r[1],h=f.jr5(t.creatId);if(r[0]==="P2"){const u=p.trigIdx(h.triggers,t.trigger);h.triggers[u].customCode=T.enTil("P1",s)}else{const u=h.triggers.find(g=>g.customCode===s);u&&h.removeTrigger(u),h.removeTrigger(t.trigger)}}else if(e==="OEX"){if(t.trigger.type==="DM"){const r=t.event,s=f.qEnemyCreats(),h=s.length,u=N.tick();let g;h>0&&(this.level===1?g=[s[T.randInt(0,h)]]:this.level===2?(g=s.splice(T.randInt(0,h),1),s.length>0&&g.push(s[T.randInt(0,h-1)])):g=s,g.forEach(y=>y.hurtDirect(r.dmg,this.code,u)))}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,s=f.jr5(t.creatId);s.triggers.filter(u=>u.customCode===r).forEach(u=>s.removeTrigger(u))}}else if(e==="VOB"){const r=W.toDamage(t.event);r.srcCreat.hurtDirect(r.dmg,this.code)}else super.jr8(t);x.triggerDone()}rankT(){return`If you are rank ${this.level+1} or higher`}awingC(){this.faction="A",this.rarity="R",this.name="Aegis Wings",this.text=`Give a creature ${m.jr9(this.boof369,0)}. Then if that creature has the highest attack, it also gets Mobility 1 and Armor ${this.boof246}.`,this.playTarg.hint=["BF"]}awingZ(t){t.buff(this.boof369,0);const e=t.attack;f.qActiveCreats().every(r=>r.attack<=e)&&(t.addMobility(1),t.addArmor(this.boof246))}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg.canMove=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Mobility ${this.level}.`}asurgeZ(t){t.addMobility(this.level)}anatC(){this.faction="A",this.rarity="C",this.name="Anatomize",this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(-this.boof4816,0)}.~You may play an additional ${this.name} this turn.`}anatZ(t){t.buff(-this.boof4816,0);const e=M.freeCard(this.code);e.condition.cardCode="ATZ"}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${m.jr9(0,this.boof51015)}.`,this.playTarg.hint=["BF"]}aqatZ(t){t.buff(0,this.boof51015)}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${m.dbdtap()}, it gets ${m.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}ablZ(t){t.changed=!0,t.jr4("DM",this.code),t.hints.push("OL")}bftC(){this.faction="N",this.rarity="C",this.name="Bitterfrost Totem";const t=this.boof4812n;this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(t,t)}. ${this.rankT()}, it gets an additional ${m.jr9(-2,-2)}.`}bftZ(t){const e=this.boof4812n-(k.getActive().rank>this.level?2:0);t.buff(e,e)}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.xl=!1,this.text=`Replace an enemy ${m.levelGateText(this.level,!0)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=w.ddf2(this.level)}botZ(t){f.birth(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof123n;this.text=`Give a creature ${m.jr9(t,t)}.`,this.playTarg.hint=["DB"]}csurgeZ(t){const e=this.boof123n;t.buff(e,e)}ctmsC(){this.faction="A",this.rarity="R",this.name="Countermeasure";const t=this.boof4816;this.text=`Give an enemy creature ${m.jr9(-t,0)}, or give a friendly creature ${m.jr9(t,0)}.`}ctmsZ(t){const e=this.boof4816;t.owner===k.getActiveB()?t.buff(e,0):t.buff(-e,0)}cullC(){this.faction="N",this.rarity="C",this.name="Cull the Weak",this.xl=!1;const t=this.boof4814;this.text=`Destroy a creature with ${t} or less attack.`,this.playTarg.maxAttack=t,this.playTarg.hint=["KL"]}cullZ(t){O.destroy(t,this.code)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate",this.xl=!1;const t=I.getCard(U.tffc(this.level));this.text=`Replace a friendly Plant with a ${m.tokName(t)}.`,this.playTarg.player="F",this.playTarg.tribe="PL"}cultZ(t){f.birth(U.tffc(this.level),"R",t.owner,t.lane)}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof246;this.text=`Give a creature in a center lane ${m.jr9(t,t)}.`,this.playTarg.lanes=3,this.playTarg.hint=["BF"]}cypaZ(t){const e=this.boof246;t.buff(e,e)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${m.jr9(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.hint=["BF"],this.playTarg.faction="A"}cypbZ(t){t.buff(this.boof51015,0),t.addArmor(this.boof124)}dendC(){this.faction="U",this.rarity="R",this.name="Dendrify",this.xl=!1,this.level===3&&(this.isFree=!0,this.overload=!0),this.text=`Replace a ${m.levelGateText(this.level+1,!0)}creature with a 7/7 Treefolk.`,this.playTarg.level=w.ddf2(this.level+1)}dendZ(t){f.birth(`${"SXT"}${this.level}`,"R",t.owner,t.lane)}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.xl=!1,this.hints=["LV"],this.text=`Destroy a ${m.levelGateText(this.level,!0)}creature.`,this.playTarg.level=w.ddf2(this.level),this.playTarg.hint=["KL"]}dreadZ(t){O.destroy(t,this.code)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${m.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${m.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}drybZ(t){t.buff(this.level,this.level),t.changed=!0,t.jr4("EF",this.code)}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.isFree=this.level===3,this.text=`Give a ${m.levelGateText(this.level,!0)}creature Defender.`,this.playTarg.canDefender=!0}enpZ(t){t.defender=!0}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${m.jr9(-this.boof51015,0)}.`,this.playTarg.hint=["DB"]}elnZ(t){t.buff(-this.boof51015,0)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${m.jr9(t,t)}.`,this.playTarg.hint=["BF"]}rageZ(t){const e=this.boof3612;t.buff(e,e)}efauC(){this.faction="T",this.rarity="R",this.name="Everflame Aura",this.text=`Deal ${this.level+6} damage to an enemy creature, or give a friendly creature Mobility ${this.level}.`}efauZ(t){t.owner===k.getActiveB()?t.addMobility(this.level):t.hurtDirect(this.level+6,this.code)}expdmC(){this.faction="N",this.rarity="H",this.name="Explosive Demise",this.xl=!1,this.text=`Destroy a friendly ${m.levelGateText(this.level+1,!0)}creature.~Deal damage equal to its attack to the enemy player.${this.level===3?"~You gain that much health.":""}`,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.player="F"}expdmZ(t){const e=t.attack;O.destroy(t,this.code),k.hurtDirect("E",e,this.code),this.level===3&&k.heal("F",e)}get fiboof(){return this.lValN([1,3,8])}feralC(){this.faction="U",this.rarity="C",this.name="Feral Instinct";const t=this.fiboof;this.text=`Give a creature ${m.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"]}feralZ(t){const e=this.fiboof;t.breakthrough=!0,t.buff(e,e)}fervassC(){this.faction="T",this.rarity="H",this.name="Fervent Assault",this.playTarg.player="F",this.text=`Give a friendly creature Mobility ${this.level} and "Flank: Deal ${this.boof3612} damage to the opposing creature.`}fervassZ(t){t.changed=!0,t.addMobility(this.level),t.jr4("FK",this.code)}fjetC(){this.faction="T",this.rarity="C",this.name="Flame Jet",this.playTarg.hint=["HR"],this.text=`Deal ${this.boof3915} damage to a creature. ${this.rankT()}, deal an additional 3 damage.`}fjetZ(t){t.hurtDirect(this.boof3915,this.code),k.getActive().rank>this.level&&t.hurtDirect(3,this.code)}flncC(){this.faction="T",this.rarity="R",this.name="Flame Lance",this.xl=!1;const t=this.boof579;this.text=`Deal ${t} damage to an enemy creature and ${t} damage to the enemy player.`,this.playTarg.player="E"}flncZ(t){const e=this.boof579;t.hurtDirect(e,this.code),k.hurtDirect("E",e,this.code)}ffldC(){this.faction="A",this.rarity="C",this.name="Forcefield",this.playTarg.canArmor=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Armor ${this.boof51020} this turn.`}ffldZ(t){const e=p.mod("AR",this.boof51020,this.code);e.expiry="ET",t.addMod(e)}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=w.ddf2(this.level),this.playTarg.hint=["KL"],this.text=`Give a ${m.levelGateText(this.level,!0)}creature "When this is dealt damage, destroy it".`}frozZ(t){t.changed=!0,t.jr4("DM",this.code)}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${m.jr9(t,t)}.`,this.playTarg.hint=["DB"]}ghastZ(t){const e=-this.boof3612;t.buff(e,e)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.xl=!1,this.isFree=this.level>1,this.isFree||(this.hints=["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 e=t.health;O.destroy(t,this.code),this.level===3&&k.hurtDirect(t.owner,e,this.code)}hartC(){this.faction="A",this.rarity="C",this.name="Heavy Artillery",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}izftC(){this.faction="T",this.rarity="T",this.name="Iztek's Frost",this.isFree=this.level===3,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.hint=["KL"],this.text=`Until the end of the next turn, give a ${m.levelGateText(this.level+1,!0)}creature "When this is dealt damage, destroy it".`}izftZ(t){const e=N.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=e;const s=t.jr4("PT",this.code);s.customCode=T.enTil("P2",e)}jpC(){this.faction="A",this.rarity="C",this.name="Jet Pack",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof369,0)} and Mobility 1.`}jpZ(t){t.buff(this.boof369,0),t.addMobility(1)}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=w.ddf2(this.level+1),this.playTarg.hint=["BF"],this.text=`Give a ${m.levelGateText(this.level+1)}creature ${m.jr9(this.boof124,0)} and Aggressive this turn.`}lbrandZ(t){const e=p.mod("AT",this.boof124,this.code),r=p.mod("AG",!0,this.code);e.expiry="ET",r.expiry="ET",t.addMod(e),t.addMod(r)}shartC(){this.faction="U",this.rarity="R",this.name="Lysian Shard",this.overload=!0,this.maxLevel=1,this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(6,6)}.`}shartZ(t){t.buff(6,6)}morphC(){this.faction="U",this.rarity="H",this.name="Metamorphosis",this.xl=!1,this.text=`Replace a ${m.levelGateText(this.level,!0)}creature with a 0/3 Feywing Chrysalis.`,this.playTarg.level=w.ddf2(this.level)}morphZ(t){f.birth(`${"FWC"}1`,"R",t.owner,t.lane)}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.isFree=this.level===3,this.playTarg.level=w.ddf2(this.level+1),this.text=`Remove all abilities from a ${m.levelGateText(this.level+1,!0)}creature.`,this.playTarg.hint=["DB"]}sculptZ(t){t.wipeAll()}nanoC(){this.faction="A",this.rarity="R",this.name="Nanoswarm",this.playTarg.level=w.ddf2(this.level),this.text=`Give a ${m.levelGateText(this.level,!0)}creature ${m.jr9(-this.boof51015,0)} and remove all abilities from it.`,this.playTarg.hint=["DB"]}nanoZ(t){t.buff(-this.boof51015,0),t.wipeAll()}natselC(){this.faction="U",this.rarity="R",this.name="Natural Selection",this.xl=!1,this.text=`If there is a friendly creature in each lane, destroy a ${m.levelGateText(this.level,!0)}creature.`,this.playTarg.level=w.ddf2(this.level),this.playTarg.hint=["KL"]}natselZ(t){O.destroy(t,this.code)}nflayC(){this.faction="N",this.rarity="C",this.name="Necroflay";const t=-this.boof3711;this.text=`Give a creature ${m.jr9(t,t)}.~You may play an additional ${this.name} this turn.`,this.playTarg.hint=["DB"]}nflayZ(t){const e=-this.boof3711;t.buff(e,e);const r=M.freeCard(this.code);r.condition.cardCode="NCF"}nviveC(){this.faction="N",this.rarity="C",this.name="Necrovive",this.playTarg.canRegen=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Regenerate ${this.boof3612}.`}nviveZ(t){t.addRegen(this.boof3612)}oexpC(){this.faction="A",this.rarity="H",this.name="Oratek Explosives",this.playTarg.player="F";const t=this.lValS(["an enemy creature at random","up to two enemy creatures at random","each enemy creature"]);this.text=`Give a friendly creature ${m.jr9(5,0)}.~Allied Tempys: This turn, when that creature ${m.dbdtap()}, deal that much damage to ${t}.`}oexpZ(t){if(t.buff(5,0),M.allied("T")){const e=N.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=e;const s=t.jr4("PT",this.code);s.customCode=e,t.hints.push("OL")}}orssC(){this.faction="A",this.rarity="C",this.name="Oreian Steelskin",this.playTarg.canArmor=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Armor ${this.boof246}. ${this.rankT()}, it gets an additional Armor 1.`}orssZ(t){const e=k.getActive().rank>this.level?1:0;t.addArmor(this.boof246+e)}pwtorC(){this.faction="A",this.rarity="R",this.name="Power Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.level,this.level)}.`}psurgeZ(t){t.buff(this.level,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.boof71116,0)} this turn.`}pslamZ(t){const e=p.mod("AT",this.boof71116,this.code);e.expiry="ET",t.addMod(e)}rotgC(){this.faction="N",this.rarity="H",this.name="Rite of the Grimgaunt",this.playTarg.hint=["BF"],this.text=`Give a creature "When a creature is destroyed, this gets ${m.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0,t.jr4("DS",this.code)}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=w.ddf2(this.level),this.text=`Reduce a ${m.levelGateText(this.level,!0)}creature's attack to 0.`,this.playTarg.hint=["DB"]}sapZ(t){t.buff(-t.attack,0)}soathC(){this.faction="U",this.rarity="C",this.name="Savage Oath",this.level===1&&(this.hints=["LV"]);const t=this.saboof;this.text=`Give an Uterra creature ${m.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"],this.playTarg.faction="U"}soathZ(t){const e=this.saboof;t.buff(e,e),t.breakthrough=!0}get saboof(){return this.lValN([2,6,15])}scythC(){this.faction="N",this.rarity="L",this.name="Scythe of Chiron";const t=this.boof246;this.playTarg.player="F",this.text=`Each enemy creature gets ${m.jr9(-t,0)}. Give a friendly creature ${m.jr9(t,0)} for each enemy creature.`}scythZ(t){const e=-this.boof246,r=f.qEnemyCreats();r.forEach(s=>{s.buff(e,0)}),r.length>0&&t.buff(-e*r.length,0)}soaC(){this.faction="A",this.rarity="C",this.name="Seal of Anvillon",this.level===1?this.hints=["LV"]:this.consistent=!0,this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.ubzap,0)}.`}soaZ(t){t.buff(this.ubzap,0)}sodC(){this.faction="U",this.rarity="C",this.name="Seal of Deepwood",this.level===1?this.hints=["LV"]:this.consistent=!0;const t=this.derpboof;this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(t,t)}.`}sodZ(t){const e=this.derpboof;t.buff(e,e)}get derpboof(){return this.lValN([1,6,12])}sotC(){this.faction="N",this.rarity="C",this.name="Seal of Tarsus",this.level===1?this.hints=["LV"]:this.consistent=!0;const t=this.tars;this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(t,t)}.`}sotZ(t){const e=this.tars;t.buff(e,e)}get tars(){return this.lValN([-2,-8,-16])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.isFree=this.level===3,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.player="F",this.text=`Give a ${m.levelGateText(this.level+1,!0)}friendly creature "Vengeance: Spawn this" this turn.`}shgrZ(t){const e=N.genId(),r=t.jr4("VN",this.code);r.customCode=e,r.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){const e=this.level*f.ddf1().length;t.buff(e,e)}get snbboof(){return-1*(this.level+7)}snbC(){this.faction="A",this.rarity="C",this.name="Sonic Burst",this.playTarg.hint=["DB"],this.text=`Give a creature ${m.jr9(this.snbboof,0)}.`}snbZ(t){t.buff(this.snbboof,0)}sharvC(){this.faction="N",this.rarity="H",this.name="Soul Harvest",this.xl=!1;const t=this.lValS(["an additional level 1 card","an additional card","two additional cards"]);this.text=`Destroy a friendly creature. You may play ${t} this turn.`,this.playTarg.player="F"}sharvZ(t){if(O.destroy(t,this.code),this.level===1){const e=M.freeCard(this.code);e.condition.level=w.ddf2(1)}else M.regularPlays+=this.level-1}sreapC(){this.faction="N",this.rarity="L",this.name="Soulreap",this.xl=!1;const t=this.boof248;this.text=`Destroy an enemy creature with ${t} or less attack. Then Spawn a copy of it.`,this.playTarg.player="E",this.playTarg.maxAttack=t}sreapZ(t){O.destroy(t,this.code),f.birth(t.code,"S",!t.owner)}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Regenerate ${this.boof234}.`,this.playTarg.hint=["BF"],this.playTarg.canRegen=!0}sttorZ(t){t.addRegen(this.boof234)}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Poison ${this.boof234}.`,this.playTarg.hint=["PN"]}sptorZ(t){t.addPoison(this.boof234)}sovC(){this.faction="T",this.rarity="L",this.name="Staff of Vaerus",this.text=`Give a friendly ${m.levelGateText(this.level+1,!0)}creature Mobility ${this.level}. That creature battles an additional time this turn.`,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.player="F"}sovZ(t){t.extraBattles+=1,t.addMobility(this.level)}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${m.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hint=["BF"],this.playTarg.hasDefender=!0}stbrnZ(t){const e=this.boof579;t.buff(e,e),t.negateDefender=!0}ssperC(){this.faction="T",this.rarity="C",this.name="Stormspear",this.xl=!1,this.playTarg.hint=["HR"],this.text=`Deal ${this.sspb} to a creature.~You may play an additional ${this.name} this turn.`}ssperZ(t){t.hurtDirect(this.sspb,this.code);const e=M.freeCard(this.code);e.condition.cardCode="STP"}get sspb(){return this.lValN([3,8,12])}tanglC(){this.faction="U",this.rarity="R",this.name="Tangle",this.xl=!1;let t="";this.level===3?t=" You gain health equal to that creature's attack.":this.playTarg.hint=["KL"],this.text=`Destroy a ${m.levelGateText(this.level+1,!0)}creature with Mobility.${t}`,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.hasMobility=!0}tanglZ(t){O.destroy(t,this.code),this.level===3&&k.heal("F",t.attack)}tpactC(){this.faction="N",this.rarity="C",this.name="Tarsian Pact";const t=this.boof235;this.text=`Give a Nekrium creature ${m.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.hint=["BF"],this.playTarg.faction="N"}tpactZ(t){const e=this.boof235;t.buff(e,e),t.addRegen(e)}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.playTarg.hint=["BF"],this.text=`Give a Robot ${m.jr9(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),t.buff(this.boof4612,0)}totsC(){this.faction="N",this.rarity="T",this.name="Tendrils Of Twilight",this.isFree=!0;const t=-this.boof7911;this.text=`Give an enemy creature ${m.jr9(-1,-1)}.~If that creature is opposing a friendly Duskmaw, give that creature ${m.jr9(t,t)} instead.`,this.playTarg.player="E"}totsZ(t){const e=this.duskBof(t);t.buff(e,e)}duskBof(t){const e=t.opposed;let r=!1;return e&&(r=St.extractCardCode(e.code)==="DTD"),r?-this.boof7911:-1}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${m.dbdtac(this.level)}, destroy that creature."`,this.playTarg.hint=["BF"]}blightZ(t){t.changed=!0,t.jr4("DM",this.code)}txbnC(){this.faction="U",this.rarity="R",this.name="Toxic Boon";const t=this.boof357;this.text=`Give an enemy creature Poison ${t}, or give a friendly creature ${m.jr9(t,t)}.`}txbnZ(t){const e=this.boof357;t.owner===k.getActiveB()?t.buff(e,e):t.addPoison(e)}get tspois(){return this.lValN([5,7,12])}sporeC(){this.faction="U",this.rarity="C",this.name="Toxic Spores",this.text=`Give a creature Poison ${this.tspois}.`,this.playTarg.hint=["PN"]}sporeZ(t){t.addPoison(this.tspois)}tremcC(){this.faction="T",this.rarity="C",this.name="Tremorcharge",this.text=`Give a Tempys creature ${m.jr9(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T",this.playTarg.hint=["BF"]}tremcZ(t){t.buff(0,this.boof4812),t.addMobility(this.level)}uboltC(){this.faction="T",this.rarity="R",this.name="Uranti Bolt",this.xl=!1,this.text=`Deal ${this.ubzap} damage to a creature.~It gets Defender until the end of the next turn.`}uboltZ(t){t.hurtDirect(this.ubzap,this.code);const e=p.mod("DF",!0,this.code);e.expiry="EN",t.addMod(e)}get ubzap(){return this.lValN([3,10,20])}urstC(){this.faction="U",this.rarity="C",this.name="Ursine Strength";const t=this.boof3711;this.playTarg.hint=["BF"],this.text=`Give a creature ${m.jr9(t,t)}. ${this.rankT()}, it gets an additional ${m.jr9(2,2)}.`}urstZ(t){const e=this.boof3711+(k.getActive().rank>this.level?2:0);t.buff(e,e)}vensC(){this.faction="U",this.rarity="C",this.name="Venomstrike",this.playTarg.hint=["PN"],this.text=`Give a creature Poison ${this.boof468}.~You may play an additional ${this.name} this turn.`}vensZ(t){t.addPoison(this.boof468);const e=M.freeCard(this.code);e.condition.cardCode="VSK"}vgraC(){this.faction="U",this.rarity="C",this.name="Verdant Grace",this.playTarg.player="F",this.text=`Heal ${this.boof101520} damage from a friendly creature and ${this.boof246} health from each other friendly creature.`}vgraZ(t){t.heal(this.boof101520);const e=this.boof246;f.creatByTarget(p.crFriendNotMeTarg(t.id)).forEach(r=>{r.heal(e)})}vglchC(){this.faction="N",this.rarity="R",this.name="Vigor Leech";const t=this.boof369n;this.text=`Give an enemy creature ${m.jr9(t,t)}, or give a friendly creature Regenerate ${-t}.`}vglchZ(t){const e=this.boof369n;t.owner===k.getActiveB()?t.addRegen(-e):t.buff(e,e)}vobC(){this.faction="T",this.rarity="R",this.name="Violent Outburst",this.level===3?this.isFree=!0:this.hints=["LV"],this.text=`Give a ${m.levelGateText(this.level+1,!0)}creature Aggressive and, "When this creature ${m.dbdtap()}, it also deals that much damage to itself."`}vobZ(t){t.aggressive=!0,t.changed=!0,t.jr4("DM",this.code)}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace",this.playTarg.hint=["DB"];const t=this.boof468,e=-t;this.text=`Give a creature ${m.jr9(e,e)}.~You gain ${t} health.`}vembZ(t){const e=this.boof468,r=-e;t.buff(r,r),k.heal(k.getActive(),e)}warC(){this.faction="A",this.rarity="H",this.name="Warmonger Mod";let t=this.level,e=3;this.level===1&&(this.playTarg.level="LN",e=2,t=2),this.playTarg.hint=["BF"],this.text=`Give a ${m.levelGateText(e,!0)}creature ${t}x attack.`}warZ(t){const e=this.level===3?2:1;t.buff(t.attack*e,0)}xwillC(){this.faction="N",this.rarity="H",this.name="Xrath's Will",this.xl=!1;const t=this.boof3612;this.text=`Destroy an enemy creature with ${t} or less attack.~You may play an additional Zombie this turn.`,this.playTarg.player="E",this.playTarg.maxAttack=t}xwillZ(t){O.destroy(t,this.code);const e=M.freeCard(this.code);e.condition.tribe="ZB"}}class Fe extends P{lookup(t){return{["ATP"]:{c:()=>this.phagC(),t:()=>this.phagT(),f:(r,s)=>this.phagF(r,s)},["SSH"]:{c:()=>this.sshmC(),t:()=>this.sshmT(),f:(r,s)=>this.sshmF(r,s)},["TPG"]:{c:()=>this.pillC(),t:()=>this.pillT(),f:(r,s)=>this.pillF(r,s)},["TMG"]:{c:()=>this.grootC(),t:()=>this.grootT(),f:(r,s)=>this.grootF(r,s)}}[t]}forgTargets(t){return this.lookup(t).t()}forgAction(t,e,r){this.lookup(t).f(e,r)}optional=!0;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Forge: "+this.ftext,this.ftext=""}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}handleAction(t){const e=f.jr5(t.param);this.forgAction(this.cardCode(),t.position,e),mt.popMode(),v.actionDone(!0)}jr8(t){const e=this.forgTargets(this.cardCode());if(e.length>0){const r=e.map(s=>{const h=p.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return h.param=t.creatId,h.host=this.code,h});if(this.optional){const s=v.noneEndTrigger();s.param="PM",r.push(s)}Ht.showCustomDeck(e,r)}else x.triggerDone()}phagC(){this.faction="U",this.rarity="H",this.name="Aetherphage",this.iAttack=this.lValN([7,10,16]),this.iHealth=this.boof3612,this.tribe.push("IN"),this.ftext=`Look at the ${m.levelGateText(this.level,!0)}spells in the enemy player's hand and choose one. The enemy player discards the chosen spell.`}phagT(){const t=k.toPlayer(!k.getActiveB()),e=p.target("TH");return e.player=k.toTarget(t),e.level=w.ddf2(this.level),e.card="S",Ht.generateContent(t.hand,!1,e)}phagF(t,e){const r=k.toPlayer(!e.owner),s=r.hand[t];r.hand.splice(t,1),r.discard.push(s)}sshmC(){this.faction="U",this.rarity="H",this.name="Soothsayer Hermit",this.iAttack=this.boof61016,this.iHealth=this.iAttack-1,this.tribe.push("LP"),this.ftext=`You may put a ${m.levelGateText(this.level)} creature from your discard pile into your hand.`}sshmT(){const t=k.getActive(),e=p.target("TD");return e.player=k.toTarget(t),e.card="C",e.level=w.ddf2(this.level),Ht.generateContent(t.discard,!1,e)}sshmF(t,e){const r=k.toPlayer(e.owner),s=r.discard.splice(t,1);r.hand.push(s[0])}pillC(){this.faction="N",this.rarity="H",this.name="Tomb Pillager",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("ZB"),this.consistent=this.level>1,this.ftext="You may banish a Nekrium card from your discard pile."}pillT(){const t=k.getActive(),e=p.target("TD");return e.player=k.toTarget(t),e.faction="N",Ht.generateContent(t.discard,!1,e)}pillF(t,e){k.toPlayer(e.owner).discard.splice(t,1)}grootC(){this.faction="U",this.rarity="R",this.name="Toorgmai Guardian",this.iAttack=this.boof4711,this.iHealth=this.iAttack,this.tribe.push("PL");const t=this.boof358;this.ftext=`You may banish a Plant from your discard pile. If you do, ${this.name} gets ${m.jr9(t,t)}.`}grootT(){const t=k.getActive(),e=p.target("TD");return e.player=k.toTarget(t),e.tribe="PL",Ht.generateContent(t.discard,!1,e)}grootF(t,e){k.toPlayer(e.owner).discard.splice(t,1);const s=this.boof358;e.buff(s,s)}}class Vr extends dt{jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}jr8(t){f.qEnemyCreats().forEach(e=>{e.addPoison(6)}),x.triggerDone()}}class zr extends P{constructor(t){super(t),this.faction="U",this.rarity="T",this.name="Dino Knight",this.iAttack=this.lValN([8,12,18]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.iAggro=!0,this.iBT=!0,this.maxLevel=this.level,this.minLevel=this.level;const e=this.boof357;this.text=`When this ${m.dbdtap()}, heal ${e} damage from each other friendly creature.~Vengeance: Put a level ${this.level} Bron, Wild Tamer into this lane.`}image(t){return this.fixedImage(t)}jr3(t,e){const r=super.jr3(t,e);return r.jr4("VN",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="VN"){const e=f.jr5(t.creatId);f.birth("BWT"+this.level,"P",e.owner,e.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,r=p.crNotMeTarg(t.creatId);r.player=k.toTarget(t.owner),f.creatByTarget(r).forEach(h=>h.heal(e)),x.triggerDone()}}}class Zr extends yt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Discordant Strike";const e=-this.boof4610;this.text=`Give an enemy creature ${m.jr9(e,0)}.~Allied Nekrium: Give an enemy creature ${m.jr9(0,e)}.`}playTargets(){const t=super.playTargets(),e=p.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=T.deTil(t.param),r=-this.boof4610,s=f.ddf6(t);e[0]==="P1"?(this.logSpell(s),s.buff(r,0),M.allied("N")?v.ddf5(this.getCardActions(t)):v.spellCast()):(this.logSpell(s),s.buff(0,r),v.spellCast())}getCardActions(t,e){return w.toActions(p.crEnemyActTarg("CARD",this.code,"P2"))}}class Yr extends yt{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.isFree=this.level===3,this.level<3&&(this.hints=["LV"]),this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}playTargets(){const t=super.playTargets(),e=this.poisTarg();return this.level===1?t.push(e):f.creatByTarget(e).length>0&&t.push(w.boardTarget("CARD",this.code)),t}handleAction(t){if(this.level===1){const e=f.ddf6(t);this.logSpell(e),e.addPoison(e.poison)}else this.logSpell(),f.creatByTarget(this.poisTarg()).forEach(r=>{r.addPoison(r.poison)});v.spellCast()}poisTarg(){const t=p.crEnemyActTarg("CARD",this.code,"");return t.hasPoison=!0,t}}class Kr extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Doppelbot",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("RB");let e="";this.level>1&&(e=`, then give it ${m.jr9(this.level===3?10:5,0)}`),this.text=`Activate: Look at the creatures in the enemy player's hand and choose one. Replace ${this.name} with the chosen creature${e}.`}canActivate(t){return k.toPlayer(!t.owner).hand.some(r=>I.getCard(r).type==="C")}startActivation(t){let e;if(ot.simOn)e=[{cardCode:"VND"+this.level,sourceIdx:0,cardCount:0}];else{const s=k.toPlayer(!k.getActiveB()),h=p.target("TH");h.player=k.toTarget(s),h.card="C",e=Ht.generateContent(s.hand,!1,h)}const r=e.map(s=>{const h=p.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return h.param=t.id,h.host=this.code,h});Ht.showCustomDeck(e,r)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),r=f.birth(t.card,"R",e.owner,e.lane);this.level>1&&r?.buff(this.level===3?10:5,0),mt.popMode(),e.endActivation()}}class Xr extends P{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Dysian Broodqueen",this.iAttack=this.boof248,this.iHealth=this.boof61117,this.tribe.push("NG");const e=I.getCard(this.bfc()),r=`Destroy an enemy ${m.levelGateText(this.level,!0)}creature.`;this.text=`Activate, destroy another friendly creature: ${r}~Allied Uterra: Put a ${m.tokName(e)} into an available lane.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[1]==="P1"){const r=f.ddf6(t),s=this.enemies(e[0],r.id);s.push(v.cancelAction()),v.ddf5(s)}else if(e[1]==="P2"){this.logAct(!0);const r=f.jr5(e[0]),s=N.tick(),h=f.jr5(e[2]),u=f.ddf6(t);O.destroy(h,this.code,s),O.destroy(u,this.code,s),r.endActivation()}else f.birth(this.bfc(),"P",t.playerA,t.lane),v.actionDone(!0)}jr8(t){if(M.allied("U")){const e=p.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId),r=w.toActions(e);r.length>0?v.ddf5(r):x.triggerDone()}else x.triggerDone()}friends(t){const e=p.crFriendNotMeActTarg("CARD",t,this.code,T.enTil(t,"P1"));return w.toActions(e)}enemies(t,e=""){const r=p.crEnemyActTarg("CARD",this.code,T.enTil(t,"P2",e));return r.level=w.ddf2(this.level),w.toActions(r)}bfc(){return "BRF"+this.level}}class qr extends yt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Dysian Siphon";const e=this.boof357;this.text=`Give an enemy creature ${m.jr9(-e,-e)}.~Allied Uterra: Give a friendly creature ${m.jr9(e,e)}. `}playTargets(){const t=super.playTargets(),e=p.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=T.deTil(t.param),r=this.boof357,s=f.ddf6(t);if(e[0]==="P1"){const h=p.crFriendActTarg("CARD",this.code,T.enTil("P2",s.id)),u=w.toActions(h);M.allied("U")&&u.length>0?(u.push(v.cancelAction()),v.ddf5(u)):(this.logSpell(s),s.buff(-r,-r),v.spellCast())}else{const h=f.jr5(e[1]);this.logSpell(h,s),h.buff(-r,-r),s.buff(r,r),v.spellCast()}}}class jr extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Dysian Sludge",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ");const e=-this.boof135;this.text=`Forge: If you have health over 120, you may put a copy of ${this.name} into another lane.~When this enters play, if you have a Nekrium card in hand, the opposing creathure gets ${m.jr9(e,e)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,s.customCode=r.id,r.jr4("EF",this.code),r}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){const e=W.toEnterField(t.event);if(e.forged&&e.creature.id===t.trigger.customCode)if(k.getActive().health>120){const r=p.actionTarget("TF","CARD",this.code,"");r.player="F",r.hint=["FL"],r.lanes=f.laneIdx.filter(h=>h!==e.creature.lane);const s=w.toActions(r);s.push(v.noneEndTrigger()),v.ddf5(s)}else x.triggerDone();else{const r=e.creature.opposed;if(r&&M.allied("N",e.creature.owner)){const s=-this.boof135;r.buff(s,s)}x.triggerDone()}}handleAction(t){f.birth(this.code,"R",t.playerA,t.lane),v.actionDone(!0)}}class Jr extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Echowisp",this.iAttack=this.lValN([7,8,10]),this.iHealth=this.boof135,this.tribe.push("ST"),this.level===3?this.text="Forge: Put a copy of Echowisp into each available lane.":this.text="Forge: You may put a copy of Echowisp into an adjacent lane."}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=this.level<3,r}jr8(t){if(this.level<3){const e=f.jr5(t.trigger.creatId),r=p.actionTarget("TF","CARD",this.code,"");r.player="F",r.lanes=e.adjacent,r.hint=["FL"];const s=w.toActions(r);s.push(v.noneEndTrigger()),v.ddf5(s)}else{const e=p.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId);let r=w.toActions(e);if(r.length>0){const s=N.tick();r.forEach(h=>f.birth(this.code,"P",h.playerA,h.lane,s))}x.triggerDone()}}handleAction(t){f.birth(this.code,"P",t.playerA,t.lane),v.actionDone(!0)}}class rr extends P{lookup(t){return{["BTB"]:{c:()=>this.bbtC(),m:r=>this.bbtM(r)},["TVG"]:{c:()=>this.tvgC(),m:r=>this.tvgM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}armThreshold=1;wipe=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("AR",this.code);return s.area="A",r}enforceEffect(t,e){this.armThreshold<=e.armor?this.createMods(this.cardCode(),e).forEach(r=>{this.wipe&&e.removeModSafe(e.id),e.addModSafe(r)}):e.removeModSafe(e.id)}bbtC(){this.faction="A",this.rarity="R",this.name="Batterbot",this.iAttack=this.boof6914,this.iHealth=this.iAttack+2,this.tribe.push("RB","DN"),this.wipe=!0,this.text=`${this.name} gets +Attack equal to its Armor.`}bbtM(t){return[p.mod("AT",this.boof247,t.id)]}tvgC(){this.faction="A",this.rarity="R",this.name="Tower Vanguard",this.iAttack=this.lValN([3,6,11]),this.iHealth=this.lValN([7,13,21]),this.tribe.push("RB");const t=this.boof247;this.text=`While ${this.name} has Armor, it gets ${m.jr9(t,0)}.`}tvgM(t){return[p.mod("AT",this.boof247,t.id)]}}class ge extends P{lookup(t){return{["CIN"]:{c:()=>this.cyinC(),m:r=>this.cyinM(r)},["HWM"]:{c:()=>this.hlwmC(),m:r=>this.hlwmM(r)},["LSP"]:{c:()=>this.lspC(),m:r=>this.lspM(r)},["SSI"]:{c:()=>this.ssinC(),m:r=>this.ssinM(r)},["WTA"]:{c:()=>this.weguC(),m:r=>this.weguM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.addEffect("AT",this.code),r}enforceEffect(t,e){this.attThreshold<=e.attack?this.createMods(this.cardCode(),e).forEach(r=>{e.addModSafe(r)}):e.removeModSafe(e.id)}cyinC(){this.faction="A",this.rarity="R",this.name="Cypien Infiltrator",this.iAttack=this.boof61117,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.attThreshold=this.lValN([7,14,21]),this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Breakthrough.`}cyinM(t){return[p.mod("BT",!0,t.id)]}hlwmC(){this.faction="A",this.rarity="L",this.name="Hinterland Watchman",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.lValN([7,10,20]),this.tribe.push("MC"),this.attThreshold=this.boof51020;const t=this.lValS(["Mobility 3","Armor 5 and Mobility 3","Armor 5, Breakthrough, Aggressive, Mobility 3, and Regenerate 5"]);this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets ${t}.`}hlwmM(t){const e=[p.mod("MB",3,t.id)];return this.level>1&&e.push(p.mod("AR",5,t.id)),this.level===3&&(e.push(p.mod("BT",!0,t.id)),e.push(p.mod("AG",!0,t.id)),e.push(p.mod("RG",5,t.id))),e}lspC(){this.faction="A",this.rarity="C",this.name="Lightshield Patrol",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.boof51020,this.tribe.push("HM"),this.attThreshold=this.iHealth,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Armor ${this.boof234}.`}lspM(t){return[p.mod("AR",this.boof234,t.id)]}ssinC(){this.faction="A",this.rarity="R",this.name="Spiritsteel Infiltrator",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("EN"),this.attThreshold=this.boof51020,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Mobility ${this.level} and Armor ${this.boof246}.`}ssinM(t){return[p.mod("MB",this.level,t.id),p.mod("AR",this.boof246,t.id)]}weguC(){this.faction="U",this.rarity="L",this.name="Wegu, the Ancient",this.iAttack=0,this.iHealth=1,this.tribe.push("PL"),this.iDefend=!0,this.attThreshold=this.lValN([10,25,100]);const t=this.boof124,e=this.level===3?"it gets Breakthrough and ":"";this.text=`When you gain health, Wegu gets ${m.jr9(t,t)} for each health you gained.~While Wegu has ${this.attThreshold} or more attack, ${e}Negate Defender from it.`}weguM(t){const e=[p.mod("ND",!0,t.id)];return this.level===3&&e.push(p.mod("BT",!0,t.id)),e}}class ir extends P{friendNotMe(t){const e=p.crNotMeTarg(t.id);return e.player=k.toTarget(t.owner),e}friendNone(t){const e=p.crTarg();return e.player=k.toTarget(t.owner),e.lanes=[],e}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforcementActive(t){return t.status==="A"}applyEffect(t,e,r){const s=this.friendNotMe(t),h=f.creatByTarget(s),u=f.creatByTarget(r);h.forEach(g=>{u.includes(g)?g.addModSafe(e):g.removeModSafe(t.id)})}}class He extends ir{lookup(t){return{["BWW"]:{c:()=>this.bwwC(),m:r=>this.bwwM(r),t:r=>this.bwwT(r)},["HTR"]:{c:()=>this.hrtC(),m:r=>this.hrtM(r),t:r=>this.hrtT(r)},["KKK"]:{c:()=>this.kkkC(),m:r=>this.kkkM(r),t:r=>this.kkkT(r)},["XDV"]:{c:()=>this.xdvC(),m:r=>this.xdvM(r),t:r=>this.xdvT(r)}}[t]}createMod(t,e){return this.lookup(t).m(e)}effTargs(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t,e){const r=this.cardCode(),s=this.createMod(r,e),h=this.enforcementActive(e)?this.effTargs(r,e):this.friendNone(e);this.applyEffect(e,s,h)}bwwC(){this.faction="T",this.rarity="H",this.name="Borean Windweaver",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.iMobile=this.level,this.tribe.push("WN","AS"),this.text=`Each other friendly creature gets Mobility ${this.level}.`}bwwM(t){return p.mod("MB",this.level,t.id)}bwwT(t){return this.friendNotMe(t)}hrtC(){this.faction="U",this.rarity="L",this.name="Heart Tree",this.iAttack=0,this.iHealth=this.lValN([10,15,30]),this.iRegen=this.boof246,this.iDefend=!0,this.tribe.push("PL"),this.text=`Each other friendly creature gets Regenerate ${this.iRegen}.`}hrtM(t){return p.mod("RG",this.iRegen,t.id)}hrtT(t){return this.friendNotMe(t)}kkkC(){if(this.faction="T",this.rarity="L",this.name="Korok, Khan of Kadras",this.iAttack=this.lValN([4,7,12,18]),this.iHealth=this.lValN([7,12,18,26]),this.iAggro=!0,this.tribe.push("FB"),this.maxLevel=4,this.level>1){const t=this.lValS(["","friendly level 1","friendly level 2 or lower","other friendly"]);this.text=`Each ${t} creature gets Aggressive.`}}kkkM(t){return p.mod("AG",!0,t.id)}kkkT(t){const e=this.friendNotMe(t);return this.level===1?e.lanes=[]:e.level=w.ddf2(this.level-1),e}xdvC(){this.faction="N",this.rarity="H",this.name="Xrath, Dreadnight Of Varna",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.boof248,this.tribe.push("ZB"),this.text=`Each other friendly Zombie gets Regenerate ${this.iRegen}`}xdvM(t){return p.mod("RG",this.iRegen,t.id)}xdvT(t){const e=this.friendNotMe(t);return e.tribe="ZB",e}}class Qr extends P{lookup(t){return{["AHL"]:{c:()=>this.ahlC(),m:r=>this.ahlM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){const r=p.crNotMeTarg(e.id);r.player=k.toTarget(e.owner),f.creatByTarget(r).length===0?this.createMods(this.cardCode(),e).forEach(h=>{e.addModSafe(h)}):e.removeModSafe(e.id)}ahlC(){this.faction="A",this.rarity="H",this.name="Alloyin Highlander",this.iAttack=this.lValN([5,7,10]),this.iHealth=this.boof6914,this.tribe.push("HM"),this.text=`While ${this.name} is your only friendly creature, it gets ${m.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}ahlM(t){return[p.mod("AT",this.boof4812,t.id),p.mod("AR",this.boof248,t.id)]}}class sr extends P{lookup(t){return{["NXP"]:{c:()=>this.nxpC(),m:r=>this.nxpM(r)},["SKG"]:{c:()=>this.skgC(),m:r=>this.skgM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){e.lane===3?this.createMods(this.cardCode(),e).forEach(r=>{e.addModSafe(r)}):e.removeModSafe(e.id)}nxpC(){this.faction="A",this.rarity="C",this.name="Nexus Pilot",this.iAttack=this.boof358,this.iHealth=this.boof4710,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets ${m.jr9(this.iAttack,this.iHealth)}.`}nxpM(t){return[p.mod("AT",this.iAttack,t.id),p.mod("HL",this.iHealth,t.id),p.mod("MH",this.iHealth,t.id)]}skgC(){this.faction="A",this.rarity="C",this.name="Skyknight Glider",this.iAttack=this.boof5916,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets Mobility 2.`}skgM(t){return[p.mod("MB",2,t.id)]}}class Ue extends P{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:r=>this.cctM(r)},["GHB"]:{c:()=>this.ghbC(),m:r=>this.ghbM(r)},["PYG"]:{c:()=>this.pygC(),m:r=>this.pygM(r)}}[t]}createMods(t,e){return this.lookup(t).m(e)}likesOpposed=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=[this.likesOpposed?"OP":"OL"]}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="A",r}enforceEffect(t,e){!!e.opposed===this.likesOpposed?this.createMods(this.cardCode(),e).forEach(r=>{e.addModSafe(r)}):e.removeModSafe(e.id)}cctC(){this.faction="T",this.rarity="R",this.name="Cloudcleaver Titan",this.iAttack=this.boof4812,this.iHealth=this.lValN([7,10,16]),this.tribe.push("WN","GT"),this.iMobile=this.level;const t=this.boof246;this.text=`While ${this.name} is unopposed, it gets ${m.jr9(t,0)}.`}cctM(t){return[p.mod("AT",this.boof246,t.id)]}ghbC(){this.faction="U",this.rarity="R",this.name="Gemhide Basher",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.lValN([3,7,10]),this.tribe.push("DN"),this.likesOpposed=!0,this.text=`While ${this.name} is opposed, it gets Aggressive.`}ghbM(t){return[p.mod("AG",!0,t.id)]}pygC(){this.faction="T",this.rarity="H",this.name="Pyre Giant",this.iAttack=this.boof468,this.iHealth=this.boof234,this.tribe.push("FR","GT"),this.iAggro=!0,this.text=`While ${this.name} is unopposed, it gets ${m.jr9(this.iAttack,0)}.`}pygM(t){return[p.mod("AT",this.iAttack,t.id)]}}class ar extends P{lookup(t){return{["BRS"]:{c:()=>this.barryC(),m:r=>this.barryM(r)},["CSR"]:{c:()=>this.cvsC(),m:r=>this.cvsM(r)}}[t]}mPlayer=0;targetPlayer(t){if(this.mPlayer===1)return t.owner;if(this.mPlayer===-1)return!t.owner;throw new Error("didnt write code OBDD")}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){const r=e.status==="A",s=this.targetPlayer(e);if(r){const h=this.createMod(this.cardCode(),e);k.addModSafe(s,h)}else k.removeModSafe(s,e.id)}barryC(){this.faction="A",this.rarity="C",this.name="Barrier Soldier",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("HM"),this.mPlayer=1,this.text=`You get Armor ${this.iHealth}.`}barryM(t){return p.mod("AR",this.iHealth,t.id)}cvsC(){this.faction="U",this.rarity="C",this.name="Cavern Serpent",this.iAttack=this.boof4914,this.iHealth=this.iAttack,this.tribe.push("SN"),this.mPlayer=-1,this.text=`The enemy player has Poison ${this.boof246}.`}cvsM(t){return p.mod("PN",this.boof246,t.id)}}class me extends ir{lookup(t){return{["ALG"]:{c:()=>this.algnC(),m:r=>this.algnM(r)},["ALS"]:{c:()=>this.alstC(),m:r=>this.alstM(r)},["BTN"]:{c:()=>this.btcC(),m:r=>this.btcM(r)},["NXA"]:{c:()=>this.aeroC(),m:r=>this.aeroM(r)},["NXT"]:{c:()=>this.ntcC(),m:r=>this.ntcM(r)}}[t]}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}nexus=!1;enforcementActive(t){return super.enforcementActive(t)?this.nexus?t.lane===3:!0:!1}enforceEffect(t,e){const r=this.cardCode(),s=this.createMod(r,e);let h;this.enforcementActive(e)?(h=this.friendNotMe(e),this.nexus?h.lanes=[1,2,4,5]:h.lanes=e.adjacent):h=this.friendNone(e),this.applyEffect(e,s,h)}algnC(){this.faction="A",this.rarity="R",this.name="Alloyin General",this.iAttack=this.boof246,this.iHealth=this.boof81318,this.tribe.push("HM"),this.text=`Adjacent creatures gets ${m.jr9(this.iAttack,0)}.`}algnM(t){return p.mod("AT",this.iAttack,t.id)}alstC(){this.faction="A",this.rarity="H",this.name="Alloyin Strategist",this.iAttack=this.boof4814,this.iHealth=this.iAttack+1,this.iMobile=this.level,this.tribe.push("HM");const t=this.boof246;this.text=`Adjacent creatures gets ${m.jr9(t,0)}.`}alstM(t){return p.mod("AT",this.boof246,t.id)}btcC(){this.faction="A",this.rarity="H",this.name="Battle Techtician",this.iAttack=this.boof3714,this.iHealth=this.boof71117,this.tribe.push("HM"),this.nexus=!0;const t=this.boof248;this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${m.jr9(t,0)}.`}btcM(t){return p.mod("AT",this.boof248,t.id)}aeroC(){this.faction="A",this.rarity="L",this.name="Nexus Aeronaut",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.iMobile=1;const t=this.boof236;this.nexus=!0,this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${m.jr9(t,0)}. Otherwise this gets Armor ${t}.`}aeroM(t){return p.mod("AT",this.boof236,t.id)}ntcC(){this.faction="A",this.rarity="H",this.name="Nexus Techtician",this.iHealth=this.boof6916,this.iAttack=this.iHealth-3,this.tribe.push("HM"),this.nexus=!0;const t=this.boof235;this.text=`While ${this.name} is in the center lane, each other friendly creature gets Armor ${t}.`}ntcM(t){return p.mod("AR",this.boof235,t.id)}}class pe extends P{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC(),["RWC"]:()=>this.roamC()})[t]()}targAction(t){f.birth(this.spawnCode,"P",t.playerA,t.lane)}adjacent=!1;optional=!1;needsEmpty=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const e=m.forglied(this.allied);this.text=e+": "+this.ftext}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}jr8(t){if(this.allied==="X"||M.allied(this.allied)){const e=f.jr5(t.creatId),r=p.emptyPlayerActTarg("F","CARD",this.code,t.creatId);this.needsEmpty||(r.field="A",r.hint=["FL"],r.lanes=f.laneIdx.filter(h=>h!==e.lane)),this.adjacent&&(r.lanes=e.adjacent);const s=w.toActions(r);s.length>0?(this.optional&&s.push(v.noneEndTrigger()),v.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){this.targAction(t),v.actionDone(!0)}bwdC(){this.faction="U",this.rarity="C",this.name="Branchweaver Druid",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.hints=["RT"],this.spawnCode=`${"TFD"}${this.level}`,this.optional=!0;const t=I.getCard(this.spawnCode);this.ftext=`You may put a ${m.tokName(t)} into another lane.`}btsC(){this.faction="U",this.rarity="C",this.name="Brighttusk Sower",this.iAttack=this.lValN([6,8,10]),this.iHealth=this.iAttack,this.tribe.push("TK"),this.spawnCode=U.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=I.getCard(this.spawnCode);this.ftext=`You may put a ${m.tokName(t)} into an adjacent lane.`}escarC(){this.faction="A",this.rarity="H",this.name="Esperian Scarab",this.iAttack=this.lValN([3,4,7]),this.iHealth=this.boof5711,this.iArmor=this.boof135,this.tribe.push("RB"),this.allied="U",this.spawnCode=this.code,this.optional=!0,this.ftext=`You may but a copy of ${this.name} into another lane.`}ethhC(){this.faction="U",this.rarity="C",this.name="Ether Hounds",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ST"),this.needsEmpty=!0,this.spawnCode=this.code,this.ftext="Put a copy of this into an available lane."}roamC(){this.faction="U",this.rarity="C",this.name="Roaming Warclaw",this.iAttack=this.boof61016,this.iHealth=this.iAttack-3,this.tribe.push("DN"),this.spawnCode=`${"RPT"}${this.level}`,this.optional=!0,this.ftext="You may put a 1/1 Raptor into another lane."}}class _r extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Epoch Hawk",this.iAttack=this.boof469,this.iHealth=this.boof71117,this.tribe.push("MC");const e=I.getCard(this.soldier);this.addSp("N",e.iAttack),this.text=`While you have 6 or more cards in hand, this gets "Activate: Put a ${m.tokName(e)} into an available lane."`}canActivate(t){return k.toPlayer(t.owner).hand.length>5&&f.emptyLanes(t.owner).length>0}startActivation(t){const e=p.emptyPlayerActTarg(t.owner,"CARD",this.code,t.id),r=w.toActions(e);r.push(v.cancelAction()),v.ddf5(r)}handleAction(t){const e=f.jr5(t.param);this.logAct(!0),f.birth(this.soldier,"P",t.playerA,t.lane),e.endActivation()}ddf8(t){return t.trigger.type==="TE"}jr8(t){const e=k.toPlayer(t.owner);k.drawCard(e,1);const r=p.trigIdx(e.triggers,t.trigger);r>-1&&e.triggers.splice(r,1),x.triggerDone()}get soldier(){return "EPS"+this.level}}class ti extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Esperian Sage",this.iAttack=this.boof3510,this.iHealth=this.boof124,this.tribe.push("HM"),this.text=`When ${this.name} enters play, discard and level up a card.~Allied Uterra: You may put a copy of this into another lane.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);s.interactive=!0;const h=r.jr4("EF",this.code);return h.interactive=!0,r}handleAction(t){if(t.zone==="H")M.levelAndDiscardA(t);else{const e=t;f.birth(this.code,"R",e.playerA,e.lane)}v.actionDone(!0)}ddf8(t){return t.event.code==="ENT"?t.event.creatId===t.creatId:!1}jr8(t){if(t.trigger.type==="FR")if(M.allied("U")){const e=f.jr5(t.creatId),r=p.actionTarget("TF","CARD",this.code,t.creatId);r.player="F",r.lanes=f.laneIdx.filter(h=>h!==e.lane),r.hint=["FL"];const s=w.toActions(r);s.push(v.noneEndTrigger()),v.ddf5(s)}else x.triggerDone();else{const e=p.lvlHandActTarg(this.code,t.creatId),r=w.toActions(e);r.length>0?v.ddf5(r):x.triggerDone()}}}class ei extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Esperian Steelplate",this.iAttack=this.boof369,this.iHealth=this.boof6916,this.tribe.push("IN");const e=this.boof358;this.addSp("H",e),this.text=`Activate: Heal ${e} damage from each other friendly creature.~Allied Alloyin: Armor ${this.boof247}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}canActivate(t){const e=p.crFriendNotMeTarg(t.id);return f.creatByTarget(e).length>0}startActivation(t){const e=w.boardTarget("CARD",this.code);e.param=t.id,v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),r=this.boof358,s=p.crFriendNotMeTarg(e.id);f.creatByTarget(s).forEach(h=>{h.heal(r)}),e.endActivation()}jr8(t){M.allied("A")&&f.jr5(t.creatId).addArmor(this.boof247),x.triggerDone()}}class ri extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Everflame Phoenix",this.iAttack=this.lValN([7,0,22]),this.iHealth=this.lValN([6,1,15]),this.tribe.push("PX"),this.iMobile=this.lValN([1,0,2]),this.level===2?(this.iDefend=!0,this.text=`When you gain a rank, replace ${this.name} with a level 3 ${this.name}.`,this.hints=["RH","LV"],this.bonus={exist:this.ddp9(1,37,22,0)}):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this lane.`,this.bonus={exist:this.ddp9(1,1,0,0)})}jr3(t,e){const r=super.jr3(t,e);return this.level===2?r.jr4("RU",this.code):this.level===3&&r.jr4("VN",this.code),r}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.owner:super.ddf8(t)}jr8(t){if(t.trigger.type==="RU"){const e=f.jr5(t.creatId);f.birth(`${"EFP"}3`,"R",e.owner,e.lane)}else if(t.trigger.type==="VN"){const r=W.toCreature(t.event).creature;f.birth(`${"EFP"}2`,"P",r.owner,r.lane)}x.triggerDone()}}class ii extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Everflow Eidolon",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("PL"),this.text=`When ${this.name} gains health, you gain ${this.level===3?"2x ":""}that much health.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("HG",this.code),r}ddf8(t){return t.trigger.type==="HG"?t.event.creatId===t.creatId:!1}jr8(t){if(t.trigger.type==="HG"){const e=t.event,r=this.level===3?2:1;k.heal(t.owner,e.healAmt*r)}x.triggerDone()}}class si extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Frostmane Dragon",this.iAttack=this.lValN([6,9,13]),this.iHealth=this.iAttack+1,this.tribe.push("IC","DG"),this.iMobile=2,this.text=`At the start of your turn, if ${this.name} was Forged last turn, you may put a Level ${this.level} Frostmane egg into an available lane.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}handleAction(t){f.birth(`${"FME"}${this.level}`,"P",t.playerA,t.lane),v.actionDone(!0)}ddf8(t){return t.trigger.type==="TS"?t.event.playerA===t.owner:!1}jr8(t){const e=f.jr5(t.creatId);if(t.event.code==="ENT"){const r=e.jr4("TS",this.code);r.interactive=!0,r.changes=!0,x.triggerDone()}else if(t.event.code==="TRS"){const r=p.trigIdx(e.triggers,t.trigger);r>-1&&e.removeTrigger(e.triggers[r]);const s=p.emptyPlayerActTarg("F","CARD",this.code,""),h=w.toActions(s);h.length===0?x.triggerDone():(h.push(v.noneEndTrigger()),v.ddf5(h))}}}class ai extends yt{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const e=this.boof4711;this.text=`Deal ${e} damage to an enemy creature.~Give a friendly creature ${m.jr9(e,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(p.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.ddf6(t);this.logSpell(r);const s=f.jr5(e[1]),h=this.boof4711;s.hurtDirect(h,this.code);const u=p.mod("AT",h,this.code);u.expiry="ET",r.addMod(u),v.spellCast()}}friends(t=""){const e=p.crFriendActTarg("CARD",this.code,T.enTil("P2",t));return w.toActions(e)}getCardActions(t,e){const r=f.ddf6(t),s=this.friends(r.id);return s.push(v.cancelAction()),s}}class ni extends yt{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Gauntlets of Sulgrim";const e=this.boof2510;this.text=`Give a friendly creature Armor ${e}, then deal damage equal to its Armor to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.baddies().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");e.canArmor=!0,t.push(e)}return t}handleAction(t){const e=T.deTil(t.param),r=f.ddf6(t);if(e[0]==="P1"){const s=v.cancelAction(),h=this.baddies(r.id);h.push(s),v.ddf5(h)}else{const s=f.jr5(e[1]);this.logSpell(s);const h=this.boof2510;s.addArmor(h),r.hurtDirect(s.armor,this.code),v.spellCast()}}baddies(t=""){return w.toActions(p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t)))}}class oi extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Gemhide Ravager",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("DN"),this.bonus={exist:this.ddp9(0,0,0,this.iAttack)},this.text=`When ${this.name} ${m.dbdtap()}, you gain that much health.~Allied Tempys: Mobility ${this.level}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR")M.allied("T")&&f.jr5(t.creatId).addMobility(this.level),x.triggerDone();else if(t.trigger.type==="DM"){const e=t.event;k.heal(t.owner,e.dmg),x.triggerDone()}}}class hi extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Glaceus, Tundra Tyrant",this.iAttack=this.boof5916,this.iHealth=this.iAttack+2,this.tribe.push("IC","EL"),this.hints=["TL"];const e=`Gain Rank: each enemy ${m.levelGateText(this.level,!0)}creature gets "When this is dealt damage, destroy it."`,r=this.level===3?"At the start of each turn, deal 1 damage to each enemy creature.~":"";this.text=r+e}jr3(t,e){const r=super.jr3(t,e);return r.jr4("RU",this.code),this.level===3&&r.jr4("TS",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;if(e.isCreatTarg&&e.target===t.creatId)return!0}return t.trigger.type==="RU"?t.event.playerA===t.owner:t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="RU"){const e=p.crEnemyTarg();e.level=w.ddf2(this.level),f.creatByTarget(e).forEach(r=>{r.jr4("DM",this.code),r.changed=!0})}else if(t.trigger.type==="TS"){const e=N.tick();f.qEnemyCreats().forEach(r=>{r.hurtDirect(1,this.code,e)})}else if(t.trigger.type==="DM"){const e=f.jr5(t.creatId);e.status==="A"&&O.destroy(e,this.code)}x.triggerDone()}}class li extends yt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Grave Pact",this.isFree=this.level===3,this.text=`Destroy a friendly creature.~Destroy an ${m.levelGateText(this.level+1,!0)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{this.logSpell();const r=f.ddf6(t),s=f.jr5(e[1]),h=N.tick();O.destroy(s,this.code,h),O.destroy(r,this.code,h),v.spellCast()}}enemyTargActions(t=""){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return e.level=w.ddf2(this.level+1),w.toActions(e)}getCardActions(t,e){const r=f.ddf6(t),s=this.enemyTargActions(r.id);return s.push(v.cancelAction()),s}}class ci extends yt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const e=this.boof359;this.text=`Give a friendly creature +${e} attack.~Give an enemy creature -${e} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.ddf6(t),s=f.jr5(e[1]);this.logSpell(s,r);const h=this.boof359;s.buff(h,0),r.buff(-h,0),v.spellCast()}}getCardActions(t,e){const r=f.ddf6(t),s=this.enemyTargActions(r.id);return s.push(v.cancelAction()),s}enemyTargActions(t=""){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return w.toActions(e)}}class di extends P{constructor(t){super(t),this.faction="U",this.rarity="C",this.name="Hunting Pack",this.iAttack=this.boof3612,this.iHealth=this.boof248,this.tribe.push("WF"),this.text=`When ${this.name} enters play, you have a 50% chance to put a copy of ${this.name} into an available lane.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("EF",this.code);return s.interactive=!0,r}handleAction(t){f.birth(this.code,"P",t.playerA,t.lane),v.actionDone(!0)}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){if(T.randInt(0,2)===1){const r=p.emptyPlayerActTarg("F","CARD",this.code,""),s=p.actionTarget("TB","NOTR",this.code,""),h=w.toActions([r,s]);h.length===1?x.triggerDone():v.ddf5(h)}else x.triggerDone()}}class ui extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Iniog, Carrion Demon",this.iAttack=this.lValN([0,12,20]),this.iHealth=this.boof3713,this.tribe.push("DM");let e;this.level===1?(this.iDefend=!0,e=5):(this.iMobile=1,this.iRegen=this.level===2?5:10,e=10);let r;this.level===3?r="When this gains health, deal that much damage to the enemy player.~Vengeance: Put a level 1 Iniog into this lane.":r=`When a creature is destroyed, this gets Regenerate 1.~At the end of your turn, if this has Regenerate ${e} or higher, replace it with a level ${this.level+1} Iniog.`,this.text=r}jr3(t,e){const r=super.jr3(t,e);return this.level===3?(r.jr4("HG",this.code),r.jr4("VN",this.code)):(r.jr4("DS",this.code),r.jr4("TE",this.code)),r}ddf8(t){return t.trigger.type==="TE"?t.event.playerA===t.owner:t.trigger.type==="HG"?t.event.creatId===t.creatId:t.trigger.type==="DS"}jr8(t){const e=f.jr5(t.creatId);if(t.trigger.type==="HG"){const r=t.event;k.hurtDirect(!t.owner,r.healAmt,this.code)}else if(t.trigger.type==="VN")f.birth("ICD"+"1","P",e.owner,e.lane);else if(t.trigger.type==="DS")e.addRegen(1);else if(t.trigger.type==="TE"){const r=this.level===1?4:9;e.regen>r&&f.birth(this.levelUpCard(),"R",e.owner,e.lane)}x.triggerDone()}}class fi extends P{image(t){return super.fixedImage(t)}constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Iztek, Avatar of Flame",this.iAttack=this.lValN([7,12,20]),this.iHealth=this.boof6915,this.tribe.push("FR","EL"),this.iAggro=!0,this.text=`When Iztek ${m.dbdtap()}, deal that much damage to that player again.~When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("PC",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}else if(t.trigger.type==="PC"){const e=t.event;if(e.playerA===t.owner)return I.getCard(e.cardCode).cardCode()==="IFR"}return!1}jr8(t){if(t.trigger.type==="DM"){const e=t.event;k.hurtDirect(!t.owner,e.dmg,this.code)}else if(t.trigger.type==="PC"){const e=f.jr5(t.trigger.creatId);f.birth(`${"IZR"}${this.level}`,"R",e.owner,e.lane)}x.triggerDone()}}class gi extends P{image(t){return super.fixedImage(t)}constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Iztek, Avatar of Frost",this.iAttack=this.boof6915,this.iHealth=this.lValN([7,12,20]),this.tribe.push("IC","EL"),this.iAggro=!0;const e=this.boof2510;this.text=`When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.~Activate: Deal ${e} damage to a creature.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("PC",this.code),r}canActivate(t){return!0}startActivation(t){const e=p.crActTarg("CARD",this.code,t.id);e.hint=["HR"];const r=w.toActions([e,w.buttonTarget("CANC")]);v.ddf5(r)}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.logAct(!0),e.hurtDirect(this.boof2510,this.code),r.endActivation()}ddf8(t){const e=t.event;return e.playerA===t.owner?I.getCard(e.cardCode).cardCode()==="IFL":!1}jr8(t){const e=f.jr5(t.trigger.creatId);f.birth(`${"IZL"}${this.level}`,"R",e.owner,e.lane),x.triggerDone()}}class mi extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Killer Bee",this.iAttack=this.boof135,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("IN"),this.hints=["OL"];const e=this.lValS(["Poison 1","Poison 3","that much Poison"]);this.text=`When ${this.name} deals battle damage to a creature or player, they get ${e}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){const e=W.toDamage(t.event),r=this.lValN([1,3,e.dmg]);e.isCreatTarg?e.hurtCreat.addPoison(r):e.hurtPlayer.poison+=r,x.triggerDone()}}class pi extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Killion, Infinity Warden",this.maxLevel=4,this.iAttack=this.lValN([6,9,16,22]),this.iHealth=this.lValN([3,7,14,20]),this.tribe.push("FB");let e;this.level<3?e=`a ${m.levelGateText(this.level)} card in your`:this.level===3?e="a card in your hand and":e="each card in your hand, deck, and",this.text=`Forge: Level up ${e} discard pile.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=this.level<4,r}handleAction(t){const e=k.getActive();if(t.zone==="N"){const r=I.getCard(e.discard[t.position]);e.discard[t.position]=r.levelUpCard(),mt.popMode(),v.actionDone(!0)}else{const r=I.getCard(e.hand[t.position]);e.hand[t.position]=r.levelUpCard(),this.discardLevel(!0)}}jr8(t){if(this.level<3)this.discardLevel(!1);else if(this.level===3){const e=w.toActions(p.lvlHandActTarg(this.code,""));e.length>0?v.ddf5(e):this.discardLevel(!1)}else{const e=k.getActive();this.levelDeck(e.deck),this.levelDeck(e.hand),this.levelDeck(e.discard),x.triggerDone()}}discardLevel(t){const e=k.getActive(),r=p.target("TD");r.player=k.toTarget(e),r.level=w.ddf2(this.level),r.canLevel=!0;const s=Ht.generateContent(e.discard,!1,r);if(s.length>0){const h=s.map(u=>{const g=p.deckSelectAction("CARD",u.cardCode,u.sourceIdx);return g.host=this.code,g.hint=["CD"],g});Ht.showCustomDeck(s,h)}else t?v.actionDone(!0):x.triggerDone()}levelDeck(t){t.map(r=>{const s=I.getCard(r);return s.canLevel()?s.levelUpCard():r}).forEach((r,s)=>t[s]=r)}}class yi extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Lavafused Asir",this.iAttack=this.boof369,this.iHealth=this.iAttack*2,this.tribe.push("FR","AS"),this.text=`While a friendly creature is unopposed, gets ${m.jr9(this.iAttack,0)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="A",r}enforceEffect(t,e){const r=p.crTarg(),s=e.status!=="A";r.player=k.toTarget(e.owner);const h=f.creatByTarget(r),u=p.mod("AT",this.iAttack,e.id);h.forEach(g=>{g.opposed||s?g.removeModSafe(e.id):g.addModSafe(u)})}}class bi extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Leafkin Progenitor",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level===3?(this.text=`Activate: Put a level 1 ${this.name} into an adjacent available lane.`,this.bonus={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?v.emptyAdjacents(t,"").length>0:!0}startActivation(t){let e;if(this.level===3)e=v.emptyAdjacents(t,"");else{const r=p.fieldSelectAction("CARD",t.lane,t.owner);r.param=t.id,r.host=this.code,e=[r]}e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);this.level===3?f.birth(this.leafCode(1),"P",t.playerA,t.lane):f.birth(this.leafCode(this.level+1),"R",e.owner,e.lane),e.endActivation()}leafCode(t){return`${"LKP"}${t}`}}class le extends P{cardConstruct(t){({["AFO"]:()=>this.aetorC(),["CRS"]:()=>this.scootC(),["FOL"]:()=>this.forcC(),["NXO"]:()=>this.nexoC(),["TEX"]:()=>this.texC(),["TSM"]:()=>this.tsmithC()})[t]()}targAction(t,e,r){({["AFO"]:(h,u)=>this.doNossing(h,u),["CRS"]:(h,u)=>this.doNossing(h,u),["FOL"]:(h,u)=>this.doNossing(h,u),["NXO"]:(h,u)=>this.doNossing(h,u),["TEX"]:(h,u)=>this.doNossing(h,u),["TSM"]:(h,u)=>this.doNossing(h,u)})[t](e,r)}playTarg;optional=!1;ftext="";forgeLevels=[1,2,3,4];constructor(t){super(t),this.playTarg=p.lvlHandActTarg(this.code,""),this.cardConstruct(this.cardCode()),this.forgeLevels.includes(this.level)&&(this.text="Forge: "+this.ftext)}jr3(t,e){const r=super.jr3(t,e);if(this.forgeLevels.includes(this.level)){const s=r.jr4("FR",this.code);s.interactive=!0}return r}handleAction(t){M.levelAndDiscardA(t);const e=f.jr5(t.param);this.targAction(this.cardCode(),t,e),v.actionDone(!0)}jr8(t){if(this.cardCode()==="NXO"&&f.jr5(t.creatId).lane!==3){x.triggerDone();return}const e=w.toActions(this.playTarg);e.length>0?(e.forEach(r=>{r.param=t.creatId}),this.optional&&e.push(v.noneEndTrigger()),v.ddf5(e)):x.triggerDone()}doNossing(t,e){}aetorC(){this.faction="A",this.rarity="C",this.name="Aetherforge Oracle",this.iAttack=this.boof61218,this.iHealth=this.boof246,this.tribe.push("HM"),this.optional=!0,this.playTarg.card="S",this.ftext="You may discard and level up a spell.",this.bonus={play:.5}}scootC(){this.faction="A",this.rarity="R",this.name="Cerebral Scout",this.iAttack=this.boof51015,this.iHealth=this.boof3712,this.tribe.push("MM"),this.optional=!0,this.playTarg.tribe="MM",this.ftext="You may discard and level up a Metamind.",this.bonus={play:.5}}forcC(){this.faction="A",this.rarity="H",this.name="Forge Oracle",this.iAttack=this.lValN([1,10,20]),this.iHealth=this.iAttack,this.tribe.push("ST"),this.playTarg.faction="A",this.optional=!0,this.ftext="You may discard an Alloyin card and level it.",this.level===1?(this.hints=["LV","RT"],this.bonus={play:1}):(this.consistent=!0,this.addSp("C",0),this.bonus={play:.3})}nexoC(){this.faction="A",this.rarity="C",this.name="Nexus Overwatch",this.iHealth=this.boof71014,this.iAttack=this.iHealth-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`If ${this.name} is in the center lane, you may ${m.daluac()}.`,this.bonus={play:.5}}texC(){this.faction="A",this.rarity="C",this.name="Tech Explorer",this.iAttack=this.lValN([1,8,18]),this.iHealth=this.iAttack+2,this.tribe.push("GN"),this.level===1&&(this.hints=["LV","RT"]),this.optional=!0,this.playTarg.card="C",this.ftext="You may discard and level up a creature.",this.bonus={play:.5}}tsmithC(){this.faction="A",this.rarity="C",this.name="Technosmith",this.iAttack=this.boof5915,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`You may ${m.daluac()}.`,this.bonus={play:.5}}}class Pt extends P{lookup(t){return{["DFB"]:{c:()=>this.dfbC(),d:(r,s)=>this.dfbD(r,s)},["GGD"]:{c:()=>this.ggdC(),d:(r,s)=>this.ggdD(r,s)},["GGR"]:{c:()=>this.ggdrC(),d:(r,s)=>this.ggdrD(r,s)},["GGP"]:{c:()=>this.ggpC(),d:(r,s)=>this.ggpD(r,s)},["MHR"]:{c:()=>this.mhermC(),d:(r,s)=>this.mhermD(r,s)},["NGT"]:{c:()=>this.ngauntC(),d:(r,s)=>this.ngauntD(r,s)},["SRH"]:{c:()=>this.sharvC(),d:(r,s)=>this.sharvD(r,s)},["YNS"]:{c:()=>this.yuruC(),d:(r,s)=>this.yuruD(r,s)}}[t]}creatDied(t,e){this.lookup(t).d(e,W.toCreature(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DS",this.code),r}ddf8(t){return t.trigger.type==="DS"}jr8(t){this.creatDied(this.cardCode(),t),x.triggerDone()}dfbC(){this.faction="N",this.rarity="R",this.name="Dr. Frankenbaum",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("AB");const t=this.boof234;this.text=`When a friendly Abomination is destroyed, deal ${t} damage to the enemy player.`,this.bonus={exist:this.ddp9(0,0,0,t*2)}}dfbD(t,e){const r=f.jr5(t.creatId),s=e.creature;(r.id===s.id||s.owner===r.owner&&s.isTribe("AB")&&Pt.itDiedFirst(s.id,r.id))&&k.hurtDirect(!r.owner,this.boof234,this.code)}ggdC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Devourer",this.iAttack=this.boof579,this.iHealth=this.iAttack-2,this.tribe.push("GG"),this.hints=["OL"],this.text=`When a creature is destroyed, ${this.name} gets ${m.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)*2}}ggdD(t,e){f.jr5(t.creatId).buff(this.level,this.level)}get doomb(){return this.lValN([1,1,2])}ggdrC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Doomrider",this.iAttack=this.boof4712,this.iHealth=this.iAttack+2,this.tribe.push("GG");const t=this.doomb;this.text=`When a friendly creature is destroyed, ${this.name} moves to that creatures lane and gets ${m.jr9(t,t)}. Then give the opposing creature ${m.jr9(-t,-t)}.`,this.bonus={exist:this.ddp9(0,t*4,t*2,0)}}ggdrD(t,e){const r=f.jr5(t.creatId),s=e.creature;if(s.owner===r.owner&&r.id!==s.id&&Pt.itDiedFirst(s.id,r.id)&&!f.searchByLane(s.lane,s.owner)){const u=this.doomb;r.move(s.lane),r.buff(u,u);const g=r.opposed;g&&(this.logAct(!1,g),g.buff(-u,-u))}}ggpC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Predator",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("GG"),this.hints=["OP"];const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,2*t,t,0)}}ggpD(t,e){const r=f.jr5(t.creatId),s=f.oppositeLane(r.lane);if(e.creature.owner!==r.owner&&e.creature.lane===s){const h=this.boof246;r.buff(h,h)}}mhermC(){this.faction="U",this.rarity="L",this.name="Malice Hermit",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("YT");const t=this.boof124;this.text=`Forge: Each other creature gets Poison ${t}.~When a creature with Poison is destroyed, ${this.name} gets ${m.jr9(t,t)}.`}mhermD(t,e){if(e.creature.poison>0){const r=this.boof124,s=f.jr5(t.creatId);this.logAct(!1,e.creature),s.buff(r,r)}}ngauntC(){this.faction="N",this.rarity="R",this.name="Nightgaunt",this.iAttack=this.boof4815,this.iHealth=this.iAttack+1,this.tribe.push("GG"),this.text=`When a creature is destroyed, ${this.name} gets Regenerate 1.`,this.bonus={exist:this.ddp9(0,4,0,0)}}ngauntD(t,e){f.jr5(t.creatId).addRegen(1)}sharvC(){this.faction="N",this.rarity="C",this.name="Sorrow Harvester",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("AB"),this.text="When a friendly Abomination is destroyed on your turn, draw a card.",this.bonus={exist:.25}}sharvD(t,e){const r=e.creature;r.owner===t.owner&&r.isTribe("AB")&&k.getActiveB()===t.owner&&Pt.itDiedFirst(r.id,t.creatId)&&k.drawCard(t.owner,1)}yuruC(){this.faction="N",this.rarity="L",this.name="Yuru, the Necrosage",this.iAttack=3,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("HM");const t=I.getCard(this.syc());this.text=`When an adjacent non-Spirit creature is destroyed, put a ${m.tokName(t)} into that lane.`}yuruD(t,e){const r=f.jr5(t.creatId),s=e.creature;s.owner===r.owner&&r.adjacent.includes(s.lane)&&!s.isTribe("ST")&&Pt.itDiedFirst(s.id,r.id)&&f.birth(this.syc(),"P",r.owner,s.lane)}syc(){return "XYR"+this.level}static itDiedFirst(t,e){if(t===e)return!0;let r=!1;const s=O.findDeathTime(e);if(T.isUn(s))r=!0;else{const h=O.findDeathTime(t);(T.isUn(h)||h<=s)&&(r=!0)}return r}}class Ai extends Pt{jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}jr8(t){if(t.trigger.type==="FR"){const e=f.creatByTarget(p.crNotMeTarg(t.creatId)),r=this.boof124;e.forEach(s=>s.addPoison(r)),x.triggerDone()}else super.jr8(t)}}class ki extends yt{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metatransfer",this.text=`Give a creature ${m.jr9(-this.boof579,0)}.~Discard and level up a card.`}playTargets(){const t=super.playTargets(),e=p.crActTarg("CARD",this.code,"P1");return e.hint=["DB"],t.push(e),t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=p.lvlHandActTarg(this.code,T.enTil("P2",r.id));s.deckPositionSkip=v.playPosition();const h=w.toActions(s);h.length===0?(this.logSpell(r),r.buff(-this.boof579,0),v.spellCast()):(h.push(v.cancelAction()),v.ddf5(h))}else{const r=f.jr5(e[1]);this.logSpell(r),r.buff(-this.boof579,0);const s=t;v.shiftPlayCard(s.position),M.levelAndDiscardA(s),v.spellCast()}}}class vi extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Mimicleaf",this.iAttack=this.lValN([2,5,11]),this.iHealth=this.iAttack,this.tribe.push("PL"),this.text=`Activate: Put a level ${this.level} ${this.name} into an adjacent available lane.`}canActivate(t){return v.emptyAdjacents(t,"").length>0}startActivation(t){const e=v.emptyAdjacents(t,"");e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);f.birth(e.code,"P",t.playerA,t.lane),e.endActivation()}}class Ti extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Mimicwurm",this.iAttack=7,this.iHealth=this.iAttack,this.tribe.push("WR"),this.text=this.lValS(["","Forge: You may put a level 1 Mimicwurm into another lane.","Forge: You may put a level 2 Mimicwurm into another lane. Then you may put a level 1 Mimicwurm into another lane."])}jr3(t,e){const r=super.jr3(t,e);if(this.level>1){const s=r.jr4("FR",this.code);s.interactive=!0}return r}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")if(this.level===3){this.wurmsign(2,t);const r=[t.lane,parseInt(e[1])],s=this.fieldActions("P2",r);v.ddf5(s)}else this.wurmsign(1,t),v.actionDone(!0);else this.wurmsign(1,t),v.actionDone(!0)}jr8(t){const e=W.toCreature(t.event);v.ddf5(this.fieldActions("P1",[e.creature.lane]))}fieldActions(t,e){const r=p.actionTarget("TF","CARD",this.code,T.enTil(t,e[0]));r.player="F",r.hint=["FL"],r.lanes=f.laneIdx.filter(h=>!e.includes(h));const s=w.toActions(r);return s.push(v.noneEndTrigger()),s}wurmsign(t,e){f.birth(this.wurmCode(t),"R",e.playerA,e.lane)}wurmCode(t){return`${"MMW"}${t}`}}class ie extends yt{lookup(t){return{["BRN"]:{c:()=>this.boutC(),z:(r,s)=>this.burner(r,s,8)},["IFL"]:{c:()=>this.izfmC(),z:(r,s)=>this.burner(r,s,this.boof6915)},["LSK"]:{c:()=>this.lspkC(),z:(r,s)=>this.burner(r,s,this.boof6812)},["LYR"]:{c:()=>this.rainC(),z:(r,s)=>this.rainZ(r,s)},["SOK"]:{c:()=>this.sealkC(),z:(r,s)=>this.burner(r,s,this.sealzap)},["STB"]:{c:()=>this.shatC(),z:(r,s)=>this.shatZ(r,s)},["SHK"]:{c:()=>this.shkC(),z:(r,s)=>this.shkZ(r,s)}}[t]}cardCast(t,e,r){this.lookup(t).z(e,r)}hurts=!0;burner(t,e,r){e?t.hurtDirect(r,this.code):k.hurtDirect(t,r,this.code)}burnText(t){return`Deal ${t} damage to a creature or player.`}constructor(t){super(t),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets(),e=this.hurts?["HR"]:["BF"],r=p.crActTarg("CARD",this.code,"");r.hint=e;const s=p.actionTarget("TP","CARD",this.code,"");return s.hint=e,t.push(r,s),t}handleAction(t){let e,r;t.zone==="P"?(this.logSpell(),e=!1,r=t.playerA):(r=f.ddf6(t),this.logSpell(this.hurts?void 0:r),e=!0),this.cardCast(this.cardCode(),r,e),v.spellCast()}boutC(){this.faction="T",this.rarity="R",this.name="Burnout",this.overload=!0,this.maxLevel=1,this.text=this.burnText(8)}izfmC(){this.faction="T",this.rarity="T",this.name="Iztek's Flame";const t=this.boof6915;this.addSp("D",t),this.text=this.burnText(t)}lspkC(){this.faction="T",this.rarity="C",this.name="Lightning Spark";const t=this.boof6812;this.addSp("D",t),this.text=this.burnText(t)}rainC(){this.faction="U",this.rarity="C",this.name="Lysian Rain",this.hurts=!1;const t=this.boof7911;this.addSp("H",t),this.text=`Give a creature or player +${t} health.`}rainZ(t,e){const r=this.boof7911;e?t.buff(0,r):k.heal(t,r)}sealkC(){this.faction="T",this.rarity="C",this.name="Seal of Kadras",this.level<3&&(this.hints=["LV"]),this.consistent=this.level>1;const t=this.sealzap;this.addSp("D",t),this.consistent&&this.addSp("C",0),this.text=this.burnText(t)}get sealzap(){return this.lValN([1,2,25])}shatC(){this.faction="T",this.rarity="C",this.name="Shatterbolt";const t=this.boof5914;this.addSp("D",t),this.text=`Negate Armor from a creature or player this turn, then deal ${t} damage to that creature or player.`}shatZ(t,e){const r=this.boof5914,s=p.mod("NA",!0,this.code);if(s.expiry="ET",e){const h=t;h.addMod(s),h.hurtDirect(r,this.code)}else{const h=k.toPlayer(t);k.addMod(h,s),k.hurtDirect(h,r,this.code)}}shkC(){this.faction="T",this.rarity="H",this.name="Static Shock";const t=this.boof124;this.addSp("D",t),this.text=`${this.burnText(t)} You may play an additional ${m.levelGateText(this.level,!0)}spell this turn.`}shkZ(t,e){this.burner(t,e,this.boof124);const r=M.freeCard(this.code);r.condition.level=w.ddf2(this.level),r.condition.card="S"}}class Si extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Nefrax, the Soulweaver",this.iAttack=this.boof4712,this.iHealth=this.lValN([10,15,25]),this.tribe.push("HM");const e=I.getCard(this.spc());this.text=`Activate: Put a ${m.tokName(e)} into an available lane.~Forge: Destroy a friendly creature.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}canActivate(t){return this.empties(t).length>0}startActivation(t){const e=this.empties(t);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){this.logAct(!0);const r=f.jr5(e[1]);f.birth(this.spc(),"P",t.playerA,t.lane),r.endActivation()}else{const r=f.ddf6(t);O.destroy(r,this.code),v.actionDone(!0)}}jr8(t){const e=p.crFriendActTarg("CARD",this.code,""),r=w.toActions(e);v.ddf5(r)}spc(){return "SPN"+this.level}empties(t){const e=p.emptyPlayerActTarg("F","CARD",this.code,T.enTil("P1",t.id));return w.toActions(e)}}class Ci extends P{constructor(t){super(t),this.faction="N",this.rarity="T",this.name="Netherdrake",this.iAttack=this.boof4815,this.iHealth=this.iAttack,this.iMobile=this.lValN([0,0,1]),this.tribe.push("DG"),this.text=`When this enters play or moves into a lane, destroy the opposing ${m.levelGateText(this.level,!0)}creature.`}image(t){return this.rawImage(`${"NSH"}${this.level}`,t)}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FK",this.code),r.jr4("EF",this.code),r}ddf8(t){return t.trigger.type==="EF"&&t.event.creatId===t.creatId}jr8(t){const r=W.toCreature(t.event).creature.opposed;r&&w.levelTestCommon(r.level,this.level)&&O.destroy(r,this.code),x.triggerDone()}}class wi extends me{enforceEffect(t,e){e.lane===3?e.removeModSafe(e.id):e.addModSafe(p.mod("AR",this.boof236,e.id)),super.enforceEffect(t,e)}}class xi extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Nova, Grove Queen",this.iAttack=this.lValN([3,5,10,14]),this.iHealth=this.lValN([7,10,15,19]),this.tribe.push("FB"),this.maxLevel=4;const e=this.nbuf,r=this.lValS(["an adjacent","each adjacent","each","each"]);this.text=`Forge: Put a 1/1 Seedling into ${r} available space.~When a friendly creature is replaced, Nova gets ${m.jr9(e,e)}.`,this.bonus={play:2}}get nbuf(){return this.lValN([1,3,5,10])}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return this.level===1&&(s.interactive=!0),r.jr4("RP",this.code),r}ddf8(t){if(t.event.code==="RPL"){const e=W.toReplaced(t.event);return t.creatId!==e.replCreatId&&t.owner===e.replCreat.owner}return!1}jr8(t){const e=f.jr5(t.creatId);if(t.event.code==="RPL"){const r=this.nbuf;e.buff(r,r),x.triggerDone()}else{const r="NSD"+this.level,s=f.emptyLanes(t.owner);if(this.level>1){const h=this.level===2?e.adjacent.filter(g=>s.includes(g)):s,u=N.tick();h.forEach(g=>{f.birth(r,"P",e.owner,g,u)}),x.triggerDone()}else{const h=e.adjacent.filter(u=>s.includes(u));if(h.length===0)x.triggerDone();else if(h.length===1)f.birth(r,"P",e.owner,h[0]),x.triggerDone();else{const u=v.emptyAdjacents(e,"");v.ddf5(u)}}}}handleAction(t){f.birth("NSD"+this.level,"P",t.playerA,t.lane),v.actionDone(!0)}}class Di extends yt{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const e=this.boof246,r=e*-1;this.text=`Give a friendly Zombie ${m.jr9(e,e,!0)}, and Regenerate ${e}.~Then give an enemy non-Zombie ${m.jr9(r,r)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const e=p.crFriendActTarg("CARD",this.code,"P1");e.tribe="ZB",t.push(e)}return t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.ddf6(t),s=f.jr5(e[1]);this.logSpell(s,r);const h=this.boof246;s.buff(h,h),s.addRegen(h),r.buff(-h,-h),v.spellCast()}}nonZombies(t=""){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P2",t));return w.toActions(e).filter(r=>{const s=r;return!f.ddf6(s).isTribe("ZB")})}getCardActions(t,e){if(t.key==="CARD"){const r=f.ddf6(t),s=v.cancelAction(),h=this.nonZombies(r.id);return h.push(s),h}return super.getCardActions(t,e)}}class Fi extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Onyxium Allomancer",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("HM");const e=this.boof358;this.text=`Activate: Discard and level up a card.~Allied Nekrium: Regenerate ${e}.`,this.bonus={exist:this.ddp9(0,e,0,0,.5)}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>I.getCard(r).canLevel())}startActivation(t){const e=p.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);M.levelAndDiscardA(t),e.endActivation()}jr8(t){M.allied("N")&&f.jr5(t.creatId).addRegen(this.boof358),x.triggerDone()}}class Hi extends P{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Onyxium Phantasm",this.iAttack=this.boof246,this.iHealth=this.lValN([9,12,19]),this.iRegen=this.boof124,this.tribe.push("ST");const e=this.boof4812n;this.addSp("A",e),this.text=`Allied Alloyin: Activate: Give a creature ${m.jr9(e,0)}`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}canActivate(t){return t.hasMod(t.id)}startActivation(t){const e=p.crActTarg("CARD",this.code,t.id);e.hint=["DF","DB"];const r=w.toActions(e);r.push(v.cancelAction()),v.ddf5(r)}handleAction(t){const e=f.jr5(t.param),r=f.ddf6(t);this.logAct(!0,r),r.buff(this.boof4812n,0),e.endActivation()}jr8(t){if(M.allied("A")){const e=f.jr5(t.creatId);e.addMod(p.mod("AL",!0,e.id)),e.changed=!0}x.triggerDone()}}class Bi extends yt{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Oratek Battlebrand";const e=this.boof71013;this.addSp("D",e),this.text=`Deal ${e} damage to a creature.~Allied Alloyin: You may discard a card and level it.`}playTargets(){const t=super.playTargets(),e=p.crActTarg("CARD",this.code,"");return e.hint=["HR"],t.push(e),t}handleAction(t){if(t.zone==="F"){const e=t,r=f.ddf6(e);if(this.logSpell(),r.hurtDirect(this.boof71013,this.code),M.allied("A")){const s=this.levelActs();s.length===1?v.spellCast():v.ddf5(s)}else v.spellCast()}else if(t.zone==="H"){const e=t;v.shiftPlayCard(e.position),M.levelAndDiscardA(e),v.spellCast()}else t.zone==="B"&&t.param==="NOTR"?v.spellCast():super.handleAction(t)}levelActs(){const t=p.actionTarget("TB","CARD",this.code,"NOTR"),e=p.lvlHandActTarg(this.code,"");return e.deckPositionSkip=v.playPosition(),w.toActions([e,t])}}class Pi extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Oratek Warhammer",this.iAttack=this.boof3713,this.iHealth=this.lValN([8,12,19]),this.iMobile=this.level,this.tribe.push("FR","AS"),this.text=`Allied Alloyin: When ${this.name} ${m.dbdtap()} on your turn, you may discard and level up a card.`,this.bonus={exist:.5}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}handleAction(t){M.levelAndDiscardA(t),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}return!1}jr8(t){if(t.trigger.type==="FR"){if(M.allied("A")){const e=f.jr5(t.creatId),r=e.jr4("DM",this.code);r.interactive=!0,e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=w.toActions(p.lvlHandActTarg(this.code,""));e.length>0?(e.push(v.noneEndTrigger()),v.ddf5(e)):x.triggerDone()}}}class Ve extends P{hitCreature;constructor(t,e){super(t),this.hitCreature=e}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatTarg===this.hitCreature&&e.isCreatSrc&&e.srcId===t.creatId}return!1}}class Ni extends Ve{constructor(t){super(t,!1),this.faction="U",this.rarity="L",this.name="Oros, Deepwood's Chosen",this.iAttack=this.lValN([7,11,16,0]),this.iHealth=this.iAttack,this.iBT=!0,this.maxLevel=4,this.tribe.push("FB"),this.hints=["OL"];const e=`When Oros ${m.dbdtap()}, you gain that much health.`,r=this.level===4?"Oros gets +attack and +health equal to your health.~":"";this.text=r+e}jr3(t,e){const r=super.jr3(t,e);return this.level===4&&r.addEffect("PH",this.code),r}jr8(t){const e=t.event;k.heal(t.owner,e.dmg),x.triggerDone()}enforceEffect(t,e){const r=k.toPlayer(e.owner).health;e.status==="A"&&(e.removeModSafe(e.id),e.addModSafe(p.mod("HL",r,e.id)),e.addModSafe(p.mod("MH",r,e.id)),e.addModSafe(p.mod("AT",r,e.id)))}}class Mi extends P{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Oxidon Spitter",this.iAttack=this.boof7914,this.iHealth=this.boof3510,this.tribe.push("DN"),this.l3=this.level===3,this.text=`Forge: Negate Armor from ${this.l3?"each":"an"} enemy creature.`}l3;jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!this.l3,r}jr8(t){if(this.l3)f.creatByTarget(p.crEnemyTarg()).forEach(e=>{e.negateArmor=!0}),x.triggerDone();else{const e=p.crEnemyActTarg("CARD",this.code,""),r=w.toActions(e);r.length>0?v.ddf5(r):x.triggerDone()}}handleAction(t){const e=f.ddf6(t);this.logAct(!1,e),e.negateArmor=!0,v.actionDone(!0)}}class se extends P{lookup(t){return{["AFS"]:{c:()=>this.afsC(),a:r=>this.afsA(r),t:r=>this.afsT(r)},["DMW"]:{c:()=>this.drixC(),a:r=>this.drixA(r),t:r=>this.drixT(r)},["FGG"]:{c:()=>this.fggC(),a:r=>this.fggA(r),t:r=>this.fggT(r)},["GHS"]:{c:()=>this.mvpC(),a:r=>this.mvpA(r),t:r=>this.mvpT(r)},["OWW"]:{c:()=>this.owwC(),a:r=>this.owwA(r),t:r=>this.owwT(r)},["UPM"]:{c:()=>this.upakC(),a:r=>this.upakA(r),t:r=>this.upakT(r)},["WFM"]:{c:()=>this.wfmC(),a:r=>this.wfmA(r),t:r=>this.wfmT(r)}}[t]}runAct(t,e){this.lookup(t).a(e)}testAct(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}preFight=!1;prePlay=!1;canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){const e=w.boardTarget("CARD",this.code);e.param=t.id,this.preFight&&(e.hint=["BB"]),this.prePlay&&(e.hint=["DF"]),v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);this.runAct(this.cardCode(),e),e.endActivation()}afsC(){this.faction="A",this.rarity="L",this.name="Arcflight Squadron",this.iAttack=this.boof4710,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.hints=["OL"],this.prePlay=!0,this.text=`Activate: You may play an additional ${m.levelGateText(this.level,!0)}Robot this turn.`}afsT(t){return!0}afsA(t){const e=M.freeCard(this.code);e.condition.tribe="RB",e.condition.level=w.ddf2(this.level)}drixC(){this.faction="A",this.rarity="L",this.name="Drix, the Mindwelder",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,12,21]),this.tribe.push("MM"),this.preFight=!0,this.addSp("A",this.level),this.text=`Activate, discard your hand: Each friendly Metamind gets ${m.jr9(this.level,0)} for each card discarded this way.`}drixT(t){return k.getActive().hand.length>0}drixA(t){const e=k.toPlayer(t.owner),r=e.hand.length*this.level;e.discard.push(...e.hand),e.hand=[];const s=p.crFriendTarg();s.tribe="MM",f.creatByTarget(s).forEach(h=>{h.buff(r,0)})}fggC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Gamma",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("RB","GD"),this.preFight=!0;const t=I.getCard(U.fgoc(this.level));this.addSp("N",t.iAttack),this.text=`Activate, destroy five friendly Robot Guardians: Put a ${m.tokName(t)} into this lane.`}fggT(t){return f.creatByTarget(this.fggTarg()).length===5}fggA(t){const e=t.lane,r=t.owner,s=N.tick();f.creatByTarget(this.fggTarg()).forEach(h=>O.destroy(h,this.code,s)),f.birth(U.fgoc(this.level),"P",r,e)}fggTarg(){const t=p.crFriendTarg();return t.tribe="GD",t}mvpC(){this.faction="U",this.rarity="C",this.name="Gemheart Sprout",this.iAttack=this.boof357,this.iHealth=this.iAttack+this.level,this.iDefend=!0,this.tribe.push("PL"),this.preFight=!0,this.addSp("L",this.level),this.text=`Activate: You gain health equal to ${this.level}x the number of friendly creatures.`}mvpT(t){return!0}mvpA(t){const e=f.ddf1().length;k.heal(t.owner,e*this.level)}owwC(){this.faction="A",this.rarity="L",this.name="Oreian Warwalker",this.iAttack=this.boof359,this.iHealth=this.boof61018,this.tribe.push("RB"),this.preFight=!0;const t=this.owwbuff+1;this.addSp("A",t),this.text=`Activate: ${this.name} gets ${t}x attack.`}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}upakC(){this.faction="U",this.rarity="L",this.name="Uterra Packmaster",this.iAttack=this.boof6914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.preFight=!0;const t=this.boof124;this.addSp("U",t),this.text=`Activate: each other friendly Uterra creature gets ${m.jr9(t,t)}.`}upakT(t){return f.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const e=this.boof124;f.creatByTarget(this.upakTarg(t.id)).forEach(r=>{r.buff(e,e)})}upakTarg(t){const e=p.crFriendNotMeTarg(t);return e.faction="U",e}wfmC(){this.faction="T",this.rarity="H",this.name="Wildfire Maiden",this.iAttack=this.boof4610,this.iHealth=this.boof5814,this.tribe.push("FR","AS"),this.text=`Activate, destroy ${this.name}: Deal damage equal to its attack to each enemy creature.`}wfmT(t){return!0}wfmA(t){const e=N.tick();f.creatByTarget(p.crEnemyTarg()).forEach(r=>{r.hurtDirect(t.attack,this.code,e)}),O.destroy(t,this.code)}}class nr extends P{lookup(t){return{["MDE"]:{c:()=>this.misdC(),f:r=>this.misdF(r)},["TAB"]:{c:()=>this.thraC(),f:r=>this.thraF(r)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const r=super.jr3(t,e);return r.jr4("AS",this.code),r}jr8(t){this.cardForge(this.cardCode(),t),x.triggerDone()}misdC(){this.faction="N",this.rarity="C",this.name="Misery Demon",this.iAttack=this.boof5915,this.iHealth=this.boof2510,this.tribe.push("DM"),this.hints=["OL"];const t=this.level+3;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health.`}misdF(t){const e=this.level+3;k.hurtDirect(!t.owner,e,this.code),k.heal(t.owner,e)}thraC(){this.faction="T",this.rarity="C",this.name="Thranik Ambusher",this.iAttack=this.boof5813,this.iHealth=this.iAttack,this.tribe.push("DK"),this.hints=["OL"];const t=this.boof234;this.ftext=`${this.name} gets ${m.jr9(t,t)}.`}thraF(t){const e=this.boof234;f.jr5(t.creatId).buff(e,e)}}class bt extends P{lookup(t){return{["ATT"]:{c:()=>this.atorC(),t:(r,s)=>this.atorT(r,s),b:(r,s)=>this.atorB(r,s)},["BRH"]:{c:()=>this.brhrC(),t:(r,s)=>this.brhrT(r,s),b:(r,s)=>this.brhrB(r,s)},["FGD"]:{c:()=>this.fgdC(),t:(r,s)=>this.fgdT(r,s),b:(r,s)=>this.fgdB(r,s)},["FSP"]:{c:()=>this.fspC(),t:(r,s)=>this.fspT(r,s),b:(r,s)=>this.fspB(r,s)},["HMF"]:{c:()=>this.hamfC(),t:(r,s)=>this.hamfT(r,s),b:(r,s)=>this.hamfB(r,s)},["HOD"]:{c:()=>this.haroldC(),t:(r,s)=>this.ocarT(r,s),b:(r,s)=>this.haroldB(r,s)},["OJC"]:{c:()=>this.ocarC(),t:(r,s)=>this.ocarT(r,s),b:(r,s)=>this.ocarB(r,s)},["RLW"]:{c:()=>this.restwandC(),t:(r,s)=>this.restwandT(r,s),b:(r,s)=>this.restwandB(r,s)},["RHW"]:{c:()=>this.ruthwandC(),t:(r,s)=>this.restwandT(r,s),b:(r,s)=>this.ruthwandB(r,s)},["SDR"]:{c:()=>this.spdryC(),t:(r,s)=>this.spdryT(r,s),b:(r,s)=>this.spdryB(r,s)},["TDW"]:{c:()=>this.tdwC(),t:(r,s)=>this.tdwT(r,s),b:(r,s)=>this.tdwB(r,s)},["TNL"]:{c:()=>this.tnlC(),t:(r,s)=>this.tnlT(r,s),b:(r,s)=>this.tnlB(r,s)},["UTR"]:{c:()=>this.urexC(),t:(r,s)=>this.urexT(r,s),b:(r,s)=>this.urexB(r,s)}}[t]}testBirth(t,e){return this.lookup(t).t(e,W.toEnterField(e.event))}actBirth(t,e){this.lookup(t).b(e,W.toEnterField(e.event))}iTrigger=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return this.iTrigger&&r.jr4("EF",this.code),r}ddf8(t){return t.event.code==="ENT"?this.testBirth(this.cardCode(),t):!1}jr8(t){this.actBirth(this.cardCode(),t),x.triggerDone()}atorC(){this.faction="T",this.rarity="L",this.name="Ator, Thunder Titan",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("GT"),this.text=`Each another friendly ${m.levelGateText(this.level,!0)}creature gets Assault: Aggressive.`}atorT(t,e){const r=e.creature;return e.forged&&t.trigger.creatId!==r.id&&r.owner===t.owner&&w.levelTargetTest(w.ddf2(this.level),r.level)&&!r.opposed}atorB(t,e){e.creature.aggressive=!0}brhrC(){this.faction="N",this.rarity="R",this.name="Brood Horror",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("AB"),this.text=`When another friendly creature enters play, it gets ${m.jr9(this.level,this.level)}. Then ${this.name} gets ${m.jr9(-this.level,-this.level)}.`}brhrT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}brhrB(t,e){bt.itBirthedFirst(e.creature.id,t.creatId)&&(this.logAct(!1,e.creature),e.creature.buff(this.level,this.level),f.jr5(t.creatId).buff(-this.level,-this.level))}fgdC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Delta",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("RB","GD");const t=I.getCard(U.fgoc(this.level));this.text=`When ${this.name} enters play, if there is a friendly Alpha Beta, and Gamma, put a ${m.tokName(t)} in your discard pile.`}fgdT(t,e){return e.creature.id===t.creatId}fgdB(t,e){const r=p.crTarg();r.player=k.toTarget(t.owner);const s=f.creatByTarget(r).map(h=>h.code.slice(0,3));s.includes("FGA")&&s.includes("FGB")&&s.includes("FGG")&&k.toPlayer(t.owner).discard.push(U.fgoc(this.level))}fspC(){if(this.faction="A",this.rarity="L",this.name="Flowsteel Prototype",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.lValN([8,15,20]),this.tribe.push("SS"),this.iTrigger=this.level>1,this.iTrigger){const t=m.levelGateText(this.level-1);this.text=`When you Forge a ${t} creature, ${this.name} gets +attack equal to that creature's attack.`}}fspT(t,e){return!!(e.forged&&e.creature.owner===t.owner&&I.getCard(e.creature.code).level0&&f.jr5(t.creatId).move(r[T.randInt(0,s)])}haroldC(){this.faction="T",this.rarity="R",this.name="Herald of Destruction",this.iAttack=this.boof369,this.iHealth=this.lValN([9,12,18]),this.tribe.push("FR","AS"),this.text=`When an enemy creature enters play, if it wasn't Forged, deal damage equal to ${this.name}'s attack to the enemy player.`}haroldB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const r=f.jr5(t.creatId);k.hurtDirect(!r.owner,r.attack,this.code)}}ocarC(){this.faction="A",this.rarity="H",this.name="Oreian Justicar",this.iAttack=this.boof5814,this.iHealth=this.boof81220,this.tribe.push("HM");const t=this.ocarbuff;this.text=`When an enemy creature enters play, if it wasn't Forged, it gets ${m.jr9(t,0)}.`,this.bonus={exist:this.ddp9(0,t,t,0)*-.5}}ocarT(t,e){return e.creature.owner!==t.owner&&!e.forged}ocarB(t,e){bt.itBirthedFirst(e.creature.id,t.creatId)&&e.creature.buff(this.ocarbuff,0)}get ocarbuff(){return this.lValN([-5,-10,-20])}restwandC(){this.faction="U",this.rarity="H",this.name="Restless Wanderers",this.iAttack=this.boof51014,this.iHealth=this.boof3610,this.tribe.push("ST","WD");const t=this.boof369;this.text=`When another friendly Spirit Wanderer enters play, ${this.name} gets ${m.jr9(t,t)}.`}restwandT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner?e.creature.isTribe("WD"):!1}restwandB(t,e){const r=f.jr5(t.trigger.creatId),s=this.boof369;r.buff(s,s)}ruthwandC(){this.faction="N",this.rarity="C",this.name="Ruthless Wanderers",this.iAttack=this.boof3610,this.iHealth=this.boof51014,this.tribe.push("ST","WD");const t=-this.boof369;this.text=`When another friendly Spirit Wanderer enters play, the creature opposing this gets ${m.jr9(t,t)}.`}ruthwandB(t,e){const s=f.jr5(t.trigger.creatId).opposed;if(s){const h=-this.boof369;s.buff(h,h)}}spdryC(){this.faction="U",this.rarity="R",this.name="Spring Dryad",this.iAttack=this.boof469,this.iHealth=this.iAttack,this.tribe.push("DY"),this.text=`When a friendly creature enters play, ${this.name} gets ${m.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)}}spdryT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}spdryB(t,e){f.jr5(t.trigger.creatId).buff(this.level,this.level)}tdwC(){this.faction="N",this.rarity="R",this.name="Tarsus Deathweaver",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof246;this.text=`When a friendly creature enters play, if it wasn't Forged, it gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}tdwT(t,e){return e.creature.owner===t.owner&&!e.forged}tdwB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const r=this.boof246;e.creature.buff(r,r)}}tnlC(){this.faction="N",this.rarity="L",this.name="Tarsus Necrolord",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof124,e=I.getCard(U.zomc(this.level));this.text=`Forge: Spawn a $${m.tokName(e)} for each friendly creature that was destroyed this turn.~When a friendly Zombie enters play, ${this.name} gets ${m.jr9(t,t)}.`}tnlT(t,e){return e.creature.owner===t.owner?e.creature.isTribe("ZB"):!1}tnlB(t,e){const r=f.jr5(t.trigger.creatId),s=this.boof124;r.buff(s,s)}urexC(){this.faction="U",this.rarity="H",this.name="Uterradon Rex",this.iAttack=this.boof4813,this.iHealth=this.boof71118,this.tribe.push("DN");const t=this.boof124;this.text=`When another friendly Dinosaur enters play, it gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}urexT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("DN")}urexB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const r=this.boof124;e.creature.buff(r,r)}}static itBirthedFirst(t,e){if(t===e)return!0;let r=!1;const s=O.findDeathTime(e);if(T.isUn(s))r=!0;else{const h=f.findBirthTime(t);(T.isUn(h)||h<=s)&&(r=!0)}return r}}class ae extends Ve{lookup(t){return{["AGM"]:{c:()=>this.agamC(),h:(r,s,h,u)=>this.agamH(r,s,h,u)},["BWK"]:{c:()=>this.blwalkC(),h:(r,s,h,u)=>this.blwalkH(r,s,h,u)},["BRF"]:{c:()=>this.bfangC(),h:(r,s,h,u)=>this.bfangH(r,s,h,u)},["CDT"]:{c:()=>this.cadtC(),h:(r,s,h,u)=>this.cadtH(r,s,h,u)},["GSC"]:{c:()=>this.gcobC(),h:(r,s,h,u)=>this.gcobH(r,s,h,u)},["IHA"]:{c:()=>this.ibhaC(),h:(r,s,h,u)=>this.ibhaH(r,s,h,u)},["SHS"]:{c:()=>this.shimfC(),h:(r,s,h,u)=>this.shimfH(r,s,h,u)}}[t]}image(t){return this.rarity==="T"?this.fixedImage(t):this.leveledImage(t)}cardConstruct(t){this.hints=["OP"],this.lookup(t).c()}creatHit(t,e,r,s,h){this.lookup(t).h(e,r,s,h)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const e=W.toDamage(t.event);this.creatHit(this.cardCode(),t,e,e.srcCreat,e.hurtCreat),x.triggerDone()}agamC(){this.faction="T",this.rarity="L",this.name="Agamemnon",this.iAttack=this.boof4814,this.iHealth=this.lValN([8,12,18]),this.level>1&&(this.iMobile=1,this.iAggro=this.level===3),this.tribe.push("GT"),this.text=`When ${this.name} ${m.dbdtac()} on your turn, this battles again.`}agamH(t,e,r,s){t.owner===k.getActiveB()&&(r.extraBattles+=1)}blwalkC(){this.faction="N",this.rarity="R",this.name="Blight Walker",this.iAttack=this.boof137,this.iHealth=this.lValN([5,10,17]),this.tribe.push("ZB"),this.text=`When ${this.name} ${m.dbdtac(this.level)}, destroy that creature.`}blwalkH(t,e,r,s){s.status==="A"&&w.levelTestCommon(s.level,this.level)&&O.destroy(s,this.code)}bfangC(){this.faction="U",this.rarity="T",this.name="Broodfang",this.iAttack=this.level,this.iHealth=this.level,this.maxLevel=this.level,this.minLevel=this.level,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack)}bfangH(t,e,r,s){s.addPoison(this.iAttack)}poisonText(t){return`When ${this.name} ${m.dbdtac()}, give that creature gets Poison ${t}.`}cadtC(){this.faction="U",this.rarity="R",this.name="Cadaverous Thicket",this.iAttack=this.boof135,this.iHealth=this.lValN([7,12,22]),this.tribe.push("PL"),this.text=this.poisonText(this.iAttack)}cadtH(t,e,r,s){s.addPoison(this.iAttack)}gcobC(){this.faction="U",this.rarity="C",this.name="Ghostscale Cobra",this.iAttack=this.boof4610,this.iHealth=this.boof135,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack)}gcobH(t,e,r,s){s.addPoison(this.iAttack)}ibhaC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Hammer of Anvillon",this.iAttack=this.lValN([4,7,12,15]),this.iHealth=this.lValN([7,11,17,25]),this.iArmor=this.lValN([1,3,5,20]),this.tribe.push("FB"),this.maxLevel=4;const t=this.level===4?"'s attack gets reduced to 0":` gets ${m.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${m.dbdtac()}, that creature${t}, and moves to an available enemy lane at random.`}ibhaH(t,e,r,s){if(s.status==="A"){const h=this.level===4?s.attack*-1:this.boof246n;s.buff(h,0);const u=f.emptyLanes(s.owner),g=u.length;g>0&&(this.logAct(!1,s),s.move(u[T.randInt(0,g)]))}}shimfC(){this.faction="U",this.rarity="R",this.name="Shimmerfang Serpent",this.iAttack=this.boof357,this.iHealth=this.boof61016,this.tribe.push("SN"),this.text=`When ${this.name} ${m.dbdtac()}, that creatures gets that much Poison.`}shimfH(t,e,r,s){s.addPoison(e.dmg)}}class Gt extends Ve{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(r,s,h)=>this.ashyH(r,s,h)},["AMY"]:{c:()=>this.ashmC(),h:(r,s,h)=>this.ashyH(r,s,h)},["CFB"]:{c:()=>this.cfbC(),h:(r,s,h)=>this.cfbH(r,s,h)},["EPS"]:{c:()=>this.epsdC(),h:(r,s,h)=>this.epsdH(r,s,h)},["EFM"]:{c:()=>this.efmC(),h:(r,s,h)=>this.efmH(r,s,h)},["FBC"]:{c:()=>this.fbcC(),h:(r,s,h)=>this.fbcH(r,s,h)},["RTS"]:{c:()=>this.rzstC(),h:(r,s,h)=>this.rzstH(r,s,h)},["RSE"]:{c:()=>this.rselC(),h:(r,s,h)=>this.rselH(r,s,h)},["SVH"]:{c:()=>this.strhyC(),h:(r,s,h)=>this.strhyH(r,s,h)},["URB"]:{c:()=>this.uridC(),h:(r,s,h)=>this.uridH(r,s,h)},["VES"]:{c:()=>this.veskC(),h:(r,s,h)=>this.veskH(r,s,h)}}[t]}cardConstruct(t){this.hints=["OL"],this.lookup(t).c()}creatHit(t,e,r,s){this.lookup(t).h(e,r,s)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}jr8(t){const e=W.toDamage(t.event);e.srcCreat&&(this.bothTurns||e.srcCreat.owner===k.getActiveB())&&this.creatHit(this.cardCode(),t,e,e.srcCreat),x.triggerDone()}ashyC(){this.faction="T",this.rarity="C",this.tribe.push("FR","AS");const t=this.boof124;this.text=`When ${this.name} ${m.dbdtap()}, it gets ${m.jr9(t,t)}.`}ashyH(t,e,r){const s=this.boof124;r.buff(s,s)}ashbC(){this.name="Ashurian Brawler",this.iAttack=this.boof7911,this.iHealth=this.iAttack,this.ashyC()}ashmC(){this.name="Ashurian Mystic",this.iAttack=this.boof3610,this.iHealth=this.boof5812,this.iAggro=!0,this.ashyC()}cfbC(){this.faction="T",this.rarity="H",this.name="Cinderfist Brawler",this.iAttack=this.boof71014,this.iHealth=this.boof357,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${m.dbdtap()}, deal that much damage to that player again.`}cfbH(t,e,r){k.hurtDirect(!r.owner,e.dmg,r.code)}epsdC(){this.faction="A",this.rarity="T",this.name="Epoch Soldier",this.minLevel=this.level,this.maxLevel=this.level,this.iAttack=this.boof4710,this.iHealth=this.iAttack,this.tribe.push("HM"),this.bothTurns=!1,this.text=`When ${this.name} ${m.dbdtap()} on your turn, draw a card at the end of the turn.`}epsdH(t,e,r){const s=p.trigger("TE","EPH"+this.level);s.changes=!0,k.toPlayer(t.owner).triggers.push(s)}efmC(){this.faction="T",this.rarity="L",this.name="Everflame Mystic",this.iAttack=this.boof5813,this.iHealth=this.iAttack+1,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${m.dbdtap()} on your turn, you may play ${this.lValS(["one","two","three"])} spells this turn.`}efmH(t,e,r){if(k.getActiveB()===r.owner)for(let s=0;sh.hurtDirect(e.dmg,this.code,s))}rzstC(){this.faction="T",this.rarity="C",this.name="Razortooth Stalker",this.iAttack=this.boof4812,this.iHealth=this.iAttack+1,this.iMobile=1,this.tribe.push("DN");const t=this.boof235;this.text=`When ${this.name} ${m.dbdtap()}, it gets ${m.jr9(t,t)}.`}rzstH(t,e,r){const s=this.boof235;r.buff(s,s)}rselC(){this.faction="T",this.rarity="H",this.name="Rumblestone Elemental",this.iAttack=this.boof246,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("ER","EL"),this.text=`When ${this.name} ${m.dbdtap()}, deal that much damage to itself as well.~Assault: Spawn a copy of ${this.name}. Then repeat this for each copy.`}rselH(t,e,r){r.hurtDirect(e.dmg,this.code)}strhyC(){this.faction="U",this.rarity="C",this.name="Stranglevine Hydra",this.iAttack=this.boof5815,this.iHealth=this.iAttack+1,this.tribe.push("HY"),this.text=`When ${this.name} ${m.dbdtap()}, it gets Regenerate ${this.level}.`}strhyH(t,e,r){r.addRegen(this.level)}uridC(){this.faction="U",this.rarity="L",this.name="Uterradon Ridgeback",this.iAttack=this.boof71117,this.iHealth=this.boof4713,this.iBT=!0,this.tribe.push("DN"),this.bothTurns=!1;const t=this.boof124;this.text=`When ${this.name} ${m.dbdtap()} on your turn, each friendly creature gets ${m.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}uridH(t,e,r){const s=this.boof124,h=this.level===3;f.ddf1().forEach(u=>{u.buff(s,s),h&&(u.breakthrough=!0)})}veskC(){this.faction="N",this.rarity="L",this.name="Vyric Ebonskull",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("VP"),this.text=`When Vyric ${m.dbdtap()}, destroy an enemy ${m.levelGateText(this.level,!0)} creature at random.${this.level===3?" Then Spawn a copy of that creature.":""}`}veskH(t,e,r){const s=p.crTarg();s.player=k.toTarget(e.hurtPlayer),s.level=w.ddf2(this.level);const h=f.creatByTarget(s);if(h.length>0){const u=N.tick(),g=h[T.randInt(0,h.length)];O.destroy(g,this.code,u),this.level===3&&f.birth(g.code,"S",r.owner,void 0,u)}}}class ye extends P{lookup(t){return{["CHR"]:{c:()=>this.crgC(),d:(r,s,h)=>this.crgD(r,s,h)},["DZD"]:{c:()=>this.dozC(),d:(r,s,h)=>this.dozD(r,s,h)},["IMD"]:{c:()=>this.eddieC(),d:(r,s,h)=>this.eddieD(r,s,h)},["NCM"]:{c:()=>this.ncmbC(),d:(r,s,h)=>this.ncmbD(r,s,h)},["TDS"]:{c:()=>this.tsrC(),d:(r,s,h)=>this.tsrD(r,s,h)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}cares=!0;cardDamaged(t,e){const r=W.toDamage(e.event);this.lookup(t).d(e,r.hurtCreat,r)}image(t){return this.cardCode()==="DZD"?this.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e);return this.cares&&r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.isCreatTarg&&e.target===t.creatId}return!1}jr8(t){this.cardDamaged(this.cardCode(),t),x.triggerDone()}crgC(){this.faction="U",this.rarity="L",this.name="Chrogias",this.iAttack=this.lValN([1,0,40]),this.iHealth=this.lValN([1,15,40]),this.tribe.push("PL"),this.level===1?(this.hints=["LV","RT"],this.bonus={play:1},this.cares=!1):this.level===2?(this.iRegen=2,this.iDefend=!0,this.bonus={play:1}):this.level===3&&(this.iBT=!0,this.iRegen=5),this.level>1&&(this.hints=["MC"],this.text="When Chrogias is dealt damage, you gain that much health.")}crgD(t,e,r){k.heal(t.owner,r.dmg)}dozC(){this.faction="U",this.rarity="L",this.name="Dozer, the Dormant",this.iAttack=0,this.iHealth=this.level*3+6,this.tribe.push("BR"),this.iDefend=!0,this.hints=["MC"];const t=I.getCard(this.dz());this.text=`When ${this.name} is dealt damage and survives, replace it with a ${m.tokName(t)}.`}dozD(t,e,r){if(e.health>0&&e.status==="A"){const s=f.birth(this.dz(),"R",e.owner,e.lane);s&&s.setHealth(e.health)}}dz(){return "DZA"+this.level}eddieC(){this.faction="A",this.rarity="L",this.name="Iron Maiden",this.iAttack=this.lValN([1,3,30]),this.iHealth=this.iAttack,this.tribe.push("RB"),this.consistent=this.level>1,this.level===3?(this.iBT=!0,this.hints=["MC"],this.text="When Iron Maiden is dealt damage, deal that much damage to the enemy player."):(this.cares=!1,this.hints=["LV","RT"],this.bonus={play:1})}eddieD(t,e,r){k.hurtDirect(!t.owner,r.dmg,this.code)}ncmbC(){this.faction="N",this.rarity="H",this.name="Necromoeba",this.iAttack=this.boof4710,this.iHealth=this.boof71117,this.tribe.push("OZ"),this.iRegen=3,this.hints=["MC"];const t=I.getCard(U.purpOzC(this.level));this.text=`When ${this.name} is dealt damage, Spawn a ${m.tokName(t)}.`}ncmbD(t,e,r){this.logAct(!1),f.birth(U.purpOzC(this.level),"S",t.owner)}tsrC(){this.faction="U",this.rarity="L",this.name="Thundersaur",this.iAttack=0,this.iHealth=this.level*12,this.tribe.push("DN"),this.iBT=!0,this.hints=["MC"],this.text=`When ${this.name} is dealt damage, it gets +1 attack for each damage dealt.`}tsrD(t,e,r){e.buff(r.dmg,0)}}class V extends P{lookup(t){return{["AGK"]:{c:()=>this.agknitC(),f:r=>this.agknitF(r)},["AMS"]:{c:()=>this.squadC(),f:r=>this.squadF(r)},["AFR"]:{c:()=>this.afsC(),f:r=>this.afsF(r)},["BZS"]:{c:()=>this.bzshC(),f:r=>this.bzshF(r)},["BTR"]:{c:()=>this.bwtC(),f:r=>this.bwtF(r)},["BSS"]:{c:()=>this.bssC(),f:r=>this.bssF(r)},["BZD"]:{c:()=>this.bzdrC(),f:r=>this.bzdrF(r)},["BFM"]:{c:()=>this.bfmC(),f:r=>this.bfmF(r)},["CTI"]:{c:()=>this.charnC(),f:r=>this.charnF(r)},["CHH"]:{c:()=>this.chihC(),f:r=>this.chihF(r)},["CSW"]:{c:()=>this.chickenC(),f:r=>this.chickenF(r)},["DFR"]:{c:()=>this.dfrC(),f:r=>this.dfrF(r)},["DBA"]:{c:()=>this.dbaC(),f:r=>this.dbaF(r)},["DBN"]:{c:()=>this.drbC(),f:r=>this.drbF(r)},["DDD"]:{c:()=>this.dddC(),f:r=>this.dddF(r)},["EWT"]:{c:()=>this.espwrC(),f:r=>this.espwrF(r)},["FWT"]:{c:()=>this.fwtC(),f:r=>this.fwtF(r)},["GSW"]:{c:()=>this.gwurmC(),f:r=>this.gwurmF(r)},["GSS"]:{c:()=>this.gsC(),f:r=>this.gsF(r)},["IMA"]:{c:()=>this.iracoC(),f:r=>this.iracoF(r)},["LGT"]:{c:()=>this.legtitC(),f:r=>this.legtitF(r)},["LBD"]:{c:()=>this.lbdC(),f:r=>this.lbdF(r)},["LMV"]:{c:()=>this.lyrC(),f:r=>this.lyrF(r)},["MOE"]:{c:()=>this.moeC(),f:r=>this.moeF(r)},["MMA"]:{c:()=>this.mmaC(),f:r=>this.mmaF(r)},["MMR"]:{c:()=>this.mmrC(),f:r=>this.mmrF(r)},["NSY"]:{c:()=>this.nysymC(),f:r=>this.nysymF(r)},["OXM"]:{c:()=>this.onxmarC(),f:r=>this.onxmarF(r)},["OFM"]:{c:()=>this.ofmC(),f:r=>this.ofmF(r)},["OPK"]:{c:()=>this.orpC(),f:r=>this.orpF(r)},["PHM"]:{c:()=>this.phmC(),f:r=>this.phmF(r)},["PSM"]:{c:()=>this.palsC(),f:r=>this.palsF(r)},["PMI"]:{c:()=>this.prinvC(),f:r=>this.prinvF(r)},["SMD"]:{c:()=>this.scorchC(),f:r=>this.scorchF(r)},["SOC"]:{c:()=>this.scythC(),f:r=>this.scythF(r)},["SDN"]:{c:()=>this.souldrC(),f:r=>this.souldrF(r)},["SGG"]:{c:()=>this.ssggC(),f:r=>this.ssggF(r)},["SBD"]:{c:()=>this.sbdC(),f:r=>this.sbdF(r)},["SSK"]:{c:()=>this.sssC(),f:r=>this.sssF(r)},["SYL"]:{c:()=>this.lotusC(),f:r=>this.lotusF(r)},["TGI"]:{c:()=>this.tgiC(),f:r=>this.tgiF(r)},["TRA"]:{c:()=>this.toraC(),f:r=>this.toraF(r)},["TRS"]:{c:()=>this.torsC(),f:r=>this.torsF(r)},["TRV"]:{c:()=>this.torvC(),f:r=>this.torvF(r)},["TRW"]:{c:()=>this.torwC(),f:r=>this.torwF(r)},["UGL"]:{c:()=>this.umglidC(),f:r=>this.umglidF(r)},["UWL"]:{c:()=>this.uwarC(),f:r=>this.uwarF(r)},["UWS"]:{c:()=>this.ustokeC(),f:r=>this.ustokeF(r)},["UIW"]:{c:()=>this.uiwC(),f:r=>this.uiwF(r)},["UTM"]:{c:()=>this.umaulC(),f:r=>this.umaulF(r)},["VIK"]:{c:()=>this.vikC(),f:r=>this.vikF(r)},["VND"]:{c:()=>this.vdrkC(),f:r=>this.vdrkF(r)},["VNS"]:{c:()=>this.vnsC(),f:r=>this.vnsF(r)},["WMC"]:{c:()=>this.warC(),f:r=>this.warF(r)},["WWP"]:{c:()=>this.wwpC(),f:r=>this.wwpF(r)},["WFB"]:{c:()=>this.wfbC(),f:r=>this.wfbF(r)},["XTR"]:{c:()=>this.xtmC(),f:r=>this.xtmF(r)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";forges=!0;flanks=!1;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let e="";this.flanks&&(e="Flank"),this.forges&&(e?e="Forge/"+e:e=m.forglied(this.allied)),e&&(this.text=e+": "+this.ftext),this.ftext=""}jr3(t,e){const r=super.jr3(t,e);return this.forges&&r.jr4("FR",this.code),this.flanks&&r.jr4("FK",this.code),r}ddf8(t){return St.extractCardCode(t.trigger.logicCode)==="MMR"&&t.trigger.type==="TE"}jr8(t){const e=this.cardCode();if(t.trigger.type==="TE"&&e==="MMR"){this.logAct(!1);const r=t.event,s=k.toPlayer(r.playerA);k.drawCard(s,this.level);const h=p.trigIdx(s.triggers,t.trigger);h>-1&&s.triggers.splice(h,1),x.triggerDone();return}this.cardForge(this.cardCode(),t),x.triggerDone()}agknitC(){this.faction="A",this.rarity="L",this.name="Aegis Knight",this.iAttack=this.boof5814,this.iHealth=this.iAttack,this.tribe.push("HM"),this.iArmor=this.lValN([1,2,5]),this.ftext="Each friendly creature deals damage equal to its Armor to the opposing creature"}agknitF(t){const e=p.crFriendTarg();e.hasArmor=!0;const r=N.tick();f.creatByTarget(e).forEach(s=>{s.opposed&&s.opposed.hurtDirect(s.armor,s.code,r)})}squadC(){this.faction="A",this.rarity="H",this.name="Aeromind Squadron",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("MM"),this.iMobile=1,this.ftext="Put a Metamind at random from your deck into your hand."}squadF(t){const e=k.toPlayer(t.owner),r=p.target("TH");r.player=k.toTarget(e),r.tribe="MM";const s=w.deckByTarget(r),h=s.length;if(h>0){const u=s[T.randInt(0,h)];e.deck.splice(u[1],1),e.hand.push(u[0])}}afsC(){this.faction="T",this.rarity="H",this.name="Ashurian Flamesculptor",this.iAttack=this.boof5915,this.iHealth=this.boof3610,this.tribe.push("FR","AS"),this.forges=this.level>1,this.consistent=this.forges,this.ftext=`You may play an additional ${m.levelGateText(this.level-1)} Tempys spell this turn.`,this.forges&&this.addSp("C",0)}afsF(t){const e=M.freeCard(this.code);e.condition.card="S",e.condition.level=w.ddf2(this.level-1),e.condition.faction="T"}bzshC(){this.faction="T",this.rarity="C",this.name="Blizzard Shaman",this.iAttack=this.boof61014,this.iHealth=this.iAttack+1,this.tribe.push("WN","AS"),this.ftext="Move another friendly creature at random to another available lane at random."}bzshF(t){const e=f.creatByTarget(p.crFriendNotMeTarg(t.creatId)),r=e.length;if(r<4&&r>0){const s=e[T.randInt(0,r)],h=f.emptyLanes(s.owner);this.logAct(!1,s),s.move(h[T.randInt(0,h.length)])}}bwtC(){if(this.faction="U",this.rarity="H",this.name="Bramblewood Tracker",this.iAttack=this.boof3712,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.forges=this.level>1,this.forges){const t=this.level-1;this.ftext=`You may play an additional ${m.levelGateText(t)} Uterra creature this turn.`,this.consistent=!0,this.addSp("C",0)}else this.hints=["LV"]}bwtF(t){const e=M.freeCard(this.code);e.condition.card="C",e.condition.faction="U",e.condition.level=w.ddf2(this.level-1)}bssC(){this.faction="A",this.rarity="L",this.name="Brightsteel Sentinal",this.iHealth=this.boof51015,this.iAttack=this.iHealth-1,this.tribe.push("RB"),this.addSp("M",this.iHealth),this.ftext=`Each friendly Robot gets Armor ${this.iHealth} this turn.`}bssF(t){const e=this.boof51015,r=p.crFriendTarg();r.tribe="RB",r.canArmor=!0,f.creatByTarget(r).forEach(h=>{const u=p.mod("AR",e,t.creatId);u.expiry="ET",h.addMod(u)})}bzdrC(){this.faction="N",this.rarity="R",this.name="Byzerak Drake",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.iRegen=this.level,this.allied="T",this.tribe.push("DG"),this.addSp("R",this.level),this.ftext=`Mobility ${this.level}.`}bzdrF(t){M.allied(this.allied)&&f.jr5(t.creatId).addMobility(this.level)}bfmC(){this.faction="N",this.rarity="H",this.name="Byzerak Frostmaiden",this.iAttack=this.boof135,this.iHealth=this.boof91420,this.tribe.push("HM"),this.flanks=!0;const t=this.boof246;this.ftext=`If ${this.name} is opposed, the opposing creature gets ${m.jr9(-1*t,0)} and this gets ${m.jr9(t,0)}.~Allied Tempys: Mobility ${this.level}.`;const e=this.ddp9(0,t*2,t*2,0);this.bonus={play:e,exist:e/2}}bfmF(t){const r=W.toEnterField(t.event).creature;t.trigger.type==="FR"&&M.allied("T")&&r.addMobility(this.level);const s=r.opposed;if(s){const h=this.boof246;s.buff(-1*h,0),r.buff(h,0)}}charnC(){this.faction="N",this.rarity="C",this.name="Charnel Titan",this.iAttack=this.boof359,this.iHealth=this.boof5814,this.tribe.push("AB");const t=this.boof357;this.ftext=`If there is an enemy creature with ${t} or less attack, ${this.name} gets ${m.jr9(t,t)}.`}charnF(t){const e=this.boof357,r=p.crEnemyTarg();r.maxAttack=e,f.creatByTarget(r).length>0&&f.jr5(t.creatId).buff(e,e)}chihC(){this.faction="U",this.rarity="C",this.name="Chistlehearth Hunter",this.iAttack=this.lValN([2,6,11]),this.iHealth=this.boof81217,this.tribe.push("HM"),this.ftext=`${this.name} gets ${m.jr9(1,0)} for each other friendly creature.`}chihF(t){const e=f.ddf1().length;e>1&&f.jr5(t.creatId).buff(e-1,0)}chickenC(){this.faction="T",this.rarity="L",this.name="Cindersmoke Wyvern",this.iAttack=this.boof3610,this.iHealth=this.lValN([7,12,17]),this.tribe.push("DG"),this.iMobile=this.boof124,this.forges=!1,this.flanks=!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.iAttack,this.iAttack,0)}}chickenF(t){const e=W.toEnterField(t.event),r=e.creature.attack,s=e.creature.opposed;s?s.hurtDirect(r,this.code):k.hurtDirect(!t.owner,r,this.code)}dfrC(){this.faction="N",this.rarity="H",this.name="Darkfrost Reaper",this.iAttack=this.boof6916,this.iHealth=this.boof3713,this.tribe.push("SK"),this.ftext="Destroy each creature with 1 or less attack."}dfrF(t){const e=p.crTarg();e.maxAttack=1;const r=f.creatByTarget(e),s=N.tick();r.forEach(h=>{O.destroy(h,this.code,s)})}dbaC(){this.faction="U",this.rarity="H",this.name="Deepbranch Ancient",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HY"),this.ftext=`If there is a friendly creature in each lane, ${this.name} gets ${m.jr9(this.iAttack,this.iHealth)}.`}dbaF(t){f.ddf1().length===5&&f.jr5(t.creatId).buff(this.iAttack,this.iHealth)}drbC(){this.faction="N",this.rarity="C",this.name="Dirge Banshee",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("ST"),this.hints=["OP"],this.flanks=!0;const t=this.boof246;this.ftext=`If ${this.name} is opposed, the opposing creature gets ${m.jr9(-t,0)} and this gets ${m.jr9(t,0)}.`}drbF(t){const e=W.toEnterField(t.event),r=e.creature.opposed;if(r){const s=this.boof246;r.buff(-s,0),e.creature.buff(s,0)}}dddC(){this.faction="N",this.rarity="L",this.name="Doomwing, Dire Drake",this.iAttack=this.boof61018,this.iHealth=this.lValN([2,6,10]),this.iMobile=this.level,this.tribe.push("DG"),this.forges=!1,this.flanks=!0,this.ftext=`Destroy the opposing ${m.levelGateText(this.level,!0)}creature.`}dddF(t){const r=W.toEnterField(t.event).creature.opposed;r&&w.levelTestCommon(r.level,this.level)&&O.destroy(r,this.code)}espwrC(){this.faction="U",this.rarity="R",this.name="Esperian Wartusk",this.iAttack=this.boof5916,this.iHealth=this.iAttack-1,this.iBT=!0,this.allied="A",this.tribe.push("TK");const t=this.boof124;this.ftext=`Armor ${t}.`}espwrF(t){M.allied(this.allied)&&f.jr5(t.creatId).addArmor(this.boof124)}fwtC(){this.faction="U",this.rarity="H",this.name="Frostwild Tracker",this.iAttack=this.boof4712,this.iHealth=this.boof248,this.tribe.push("TG"),this.forges=this.level>1;const t=this.level-1;this.ftext=`You may play an additional ${m.levelGateText(t)} creature this turn.`,this.level>1||(this.hints=["LV"])}fwtF(t){const e=M.freeCard(this.code);e.condition.card="C",e.condition.level=w.ddf2(this.level-1)}gwurmC(){this.faction="N",this.rarity="C",this.name="Gloomspire Wurm",this.iAttack=this.boof4813,this.iHealth=this.iAttack,this.tribe.push("WR"),this.ftext=`If there are no enemy creatures, ${this.name} gets ${m.jr9(4,4)}.`}gwurmF(t){f.qEnemyCreats().length===0&&f.jr5(t.creatId).buff(4,4)}gsC(){this.faction="U",this.rarity="C",this.name="Glowstride Stag",this.iAttack=this.boof5812,this.iHealth=this.iAttack+this.level,this.tribe.push("ST");const t=this.boof51015;this.ftext=`You gain ${t} health.`}gsF(t){const e=this.boof51015;k.heal(t.owner,e)}iracoC(){this.faction="A",this.rarity="L",this.name="Ironmind Acolyte",this.iAttack=this.boof61015,this.iHealth=this.iAttack-2,this.tribe.push("GN"),this.ftext="If you have five or more cards in your hand, you may play an additional card this turn."}iracoF(t){k.toPlayer(t.owner).hand.length>4&&(M.regularPlays+=1)}legtitC(){this.faction="N",this.rarity="R",this.name="Legion Titan",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.ftext=`${this.name} gets ${m.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`}legtitF(t){const e=p.crEnemyTarg();e.maxAttack=this.boof357;const r=f.creatByTarget(e);if(r.length>0){const s=this.level*r.length;f.jr5(t.creatId).buff(s,s)}}lbdC(){this.faction="U",this.rarity="H",this.name="Lifeblood Dryad",this.iAttack=this.lValN([4,7,9]),this.iHealth=this.iAttack,this.tribe.push("DY");const t=this.boof236;this.ftext=`If there is a friendly creature in each lane, each other friendly creature gets ${m.jr9(t,t)}.`}lbdF(t){const e=f.creatByTarget(p.crFriendNotMeTarg(t.creatId));if(e.length===4){const r=this.boof236;e.forEach(s=>s.buff(r,r))}}lyrC(){this.faction="N",this.rarity="L",this.name="Lyria, Muse of Varna",this.iAttack=this.boof5815,this.iHealth=this.boof4714,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.level===2?"Spawn a random creature that was destroyed this game.":"Put a random creature that was destroyed this game into each of your available lanes.",this.forges||(this.hints=["LV"])}lyrF(t){if(this.level===2){const e=O.gravedigger();e&&f.birth(e,"S",t.owner)}else if(this.level===3){const e=f.emptyLanes(t.owner),r=e.map(s=>O.gravedigger());if(e.length>0&&r[0]){const s=N.tick();e.forEach((h,u)=>{f.birth(r[u],"P",t.owner,h,s)})}}}moeC(){this.faction="T",this.rarity="H",this.name="Master of Elements",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=`You may play an additional ${m.levelGateText(this.level-1)} spell this turn.`}moeF(t){const e=M.freeCard(this.code);e.condition.card="S",e.condition.level=w.ddf2(this.level-1)}mmaC(){this.faction="A",this.rarity="C",this.name="Metamind Adept",this.iAttack=this.boof5915,this.iHealth=this.boof4813,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`Draw ${this.level} card${t}.`}mmaF(t){k.drawCard(t.owner,this.level)}mmrC(){this.faction="A",this.rarity="C",this.name="Metamind Archivist",this.iAttack=this.boof3713,this.iHealth=this.iAttack+5,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`If there is another friendly Metamind, draw ${this.level} card${t} at the end of your turn.`}mmrF(t){const e=p.crFriendNotMeTarg(t.creatId);if(e.tribe="MM",f.creatByTarget(e).length>0){const r=p.trigger("TE",this.code);r.changes=!0,k.toPlayer(t.owner).triggers.push(r)}}nysymC(){this.faction="N",this.rarity="C",this.name="Nyrali Symbiote",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`}nysymF(t){const e=W.toEnterField(t.event);e.creature.opposed&&e.creature.addRegen(this.boof246)}ofmC(){this.faction="A",this.rarity="R",this.name="Oreian Fieldmarshal",this.iAttack=this.boof5914,this.iHealth=this.iAttack-2,this.tribe.push("HM");const t=this.boof135;this.ftext=`Each other friendly creature gets ${m.jr9(t,0)}.`}ofmF(t){const e=this.boof135;f.creatByTarget(p.crFriendNotMeTarg(t.creatId)).forEach(s=>{s.buff(e,0)})}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.tribe.push("RB"),this.hints=["OP"],this.ftext=`${this.name} gets Armor ${this.iAttack} this turn.`}orpF(t){const e=f.jr5(t.creatId),r=p.mod("AR",this.iAttack,t.creatId);r.expiry="ET",e.addMod(r)}onxmarC(){this.faction="A",this.rarity="R",this.name="Onyxium Marauder",this.iAttack=this.boof4714,this.iHealth=this.lValN([6,9,17]),this.iArmor=this.level,this.allied="N",this.tribe.push("HM"),this.ftext=`Regenerate ${this.level}.`}onxmarF(t){M.allied(this.allied)&&f.jr5(t.creatId).addRegen(this.level)}phmC(){this.faction="A",this.rarity="R",this.name="Palladium Hindermind",this.iAttack=this.boof2612,this.iHealth=this.boof61016,this.tribe.push("HM"),this.ftext=`Each enemy creature gets ${m.jr9(this.boof123n,0)}.`}phmF(t){const e=this.boof123n;f.qEnemyCreats().forEach(r=>{r.buff(e,0)})}palsC(){this.faction="A",this.rarity="L",this.name="Palladium Simulacrum",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.iMobile=this.level-1,this.tribe.push("SS"),this.flanks=!0,this.ftext=`If ${this.name} is in the center lane, Spawn a copy.`}palsF(t){W.toEnterField(t.event).creature.lane===3&&f.birth(this.code,"S",t.owner)}prinvC(){this.faction="T",this.rarity="H",this.name="Primordial Invoker",this.iAttack=this.boof61016,this.iHealth=this.boof468,this.tribe.push("HM"),this.ftext=`Deal ${this.iHealth} damage divided at random between enemy creatures and the the enemy player.`}prinvF(t){const e=f.creatByTarget(p.crEnemyTarg()),r=e.length;if(r===0)k.hurtDirect(!t.owner,this.iHealth,this.code);else{const s=N.tick(),h=r+1,u=Array(h).fill(0);for(let g=0;g{u[y]>0&&g.hurtDirect(u[y],this.code,s)}),u[r]>0&&k.hurtDirect(!t.owner,u[r],this.code)}}scorchC(){this.faction="T",this.rarity="L",this.name="Scorchmane Dragon",this.iAttack=this.lValN([0,12,24]),this.iHealth=this.boof61224,this.tribe.push("DG"),this.iDefend=this.level===1,this.iMobile=this.level-1,this.forges=this.level>1,this.ftext="Deal 5 damage to "+(this.level===2?"the opposing creature.":"each enemy creature and player."),this.level===1&&(this.hints=["LV"])}scorchF(t){const e=W.toEnterField(t.event),r=!t.owner;if(this.level===2){const s=e.creature.opposed;s&&s.hurtDirect(5,this.code)}else if(this.level===3){const s=N.tick();f.qPlayerCreats(r).forEach(h=>h.hurtDirect(5,this.code,s)),k.hurtDirect(r,5,this.code)}}scythC(){this.faction="N",this.rarity="L",this.name="Chiron, Herald of Torment",this.iAttack=12,this.iHealth=6,this.tribe.push("DM"),this.ftext=`Each enemy creature gets ${m.jr9(-6,0)} and ${this.name} gets ${m.jr9(6,0)} for each enemy creature.`}scythF(t){const e=f.qEnemyCreats();e.forEach(r=>{r.buff(-6,0)}),e.length>0&&f.jr5(t.creatId).buff(6*e.length,0)}souldrC(){this.faction="N",this.rarity="L",this.name="Soul Drinker",this.iAttack=1,this.iHealth=this.boof4814,this.iMobile=this.level===3?1:0,this.tribe.push("VP"),this.hints=["OP"],this.flanks=this.level===3,this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`}souldrF(t){const e=W.toEnterField(t.event),r=e.creature.opposed;if(r){const s=r.attack;e.creature.buff(s,0),r.buff(-1*s,0)}}ssggC(){this.faction="N",this.rarity="H",this.name="Soulscourge Grimgaunt",this.iAttack=this.level+1,this.iHealth=this.iAttack,this.tribe.push("GG"),this.ftext=`${this.name} gets ${m.jr9(this.iAttack,this.iHealth)} for each creature that was destroyed this turn.`}ssggF(t){const e=this.iAttack*(M.deathsA.length+M.deathsB.length);e>0&&f.jr5(t.creatId).buff(e,e)}sbdC(){this.faction="U",this.rarity="C",this.name="Spiritbloom Dryad",this.iAttack=this.boof6812,this.iHealth=this.iAttack+this.level,this.tribe.push("DY"),this.ftext=`Each player gains ${this.boof468} health.`}sbdF(t){const e=this.boof468;k.heal(!0,e),k.heal(!1,e)}sssC(){this.faction="A",this.rarity="C",this.name="Steelskin Spelunker",this.iAttack=this.boof5814,this.iHealth=this.boof61018,this.tribe.push("HM"),this.ftext=`If there is another friendly creature in the center lane, that creature gets Armor ${this.boof124}`}sssF(t){const e=f.searchByLane(3,t.owner);e&&e.id!==t.creatId&&!e.negateArmor&&e.addArmor(this.boof124)}lotusC(){this.faction="U",this.rarity="H",this.name="Stygian Lotus",this.iAttack=this.boof468,this.iHealth=this.iAttack-1,this.tribe.push("PL"),this.hints=["OP"],this.ftext=`If ${this.name} is opposed, spawn a copy of it. Then repeat this for each copy.`}lotusF(t){if(W.toEnterField(t.event).creature.opposed){let r=!0;for(;r;){const s=f.emptyLanes(t.owner),h=s.length;if(h===0)r=!1;else{const u=s[T.randInt(0,h)];f.birth(this.code,"P",t.owner,u).opposed||(r=!1)}}}}tgiC(){this.faction="T",this.rarity="R",this.name="Thundergale Invoker",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("WN","GT"),this.ftext=`Each creature adjacent to ${this.name} moves one lane away if possible.`}tgiF(t){const e=f.jr5(t.creatId),r=e.lane,s=e.owner,h=[];if(r>2){const u=f.searchByLane(r-1,s);u&&(f.searchByLane(r-2,s)||(h.push(u),u.move(r-2)))}if(r<4){const u=f.searchByLane(r+1,s);u&&(f.searchByLane(r+2,s)||(h.push(u),u.move(r+2)))}h.length>0&&this.logAct(!1,...h)}tortex(t){return`Put a level ${this.level} ${t} into your hand.`}torf(t){const e=k.getActive(),r=t+this.level;e.hand.push(r)}toraC(){this.faction="A",this.rarity="R",this.name="Torrent Acolyte",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.tribe.push("MM"),this.forges=this.level>1,this.ftext=this.tortex("Power Torrent")}toraF(t){this.torf("PTR")}torsC(){this.faction="U",this.rarity="R",this.name="Torrent Soldier",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("IN"),this.forges=this.level>1,this.ftext=this.tortex("Spore Torrent")}torsF(t){this.torf("STO")}torvC(){this.faction="T",this.rarity="R",this.name="Torrent Valkyrie",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("IC","AS"),this.forges=this.level>1,this.ftext=this.tortex("Ice Torrent")}torvF(t){this.torf("ITO")}torwC(){this.faction="N",this.rarity="R",this.name="Torrent Witch",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.tortex("Spirit Torrent")}torwF(t){this.torf("STR")}umglidC(){this.faction="T",this.rarity="R",this.name="Umbruk Glider",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.iMobile=this.level,this.allied="U",this.tribe.push("DN"),this.ftext="Breakthrough."}umglidF(t){if(M.allied(this.allied)){const e=f.jr5(t.creatId);e.breakthrough=!0}}uwarC(){this.faction="T",this.rarity="H",this.name="Uranti Warlord",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("FR","YT"),this.hints=["OP"],this.ftext=`Each friendly Yeti deals ${this.iAttack} damage to the opposing creature.`}uwarF(t){const e=p.crFriendTarg();e.tribe="YT";const r=f.creatByTarget(e),s=N.tick();r.forEach(h=>{const u=h.opposed;u&&u.hurtDirect(this.iAttack,h.code,s)})}ustokeC(){this.faction="T",this.rarity="R",this.name="Uranti Warstoker",this.iAttack=this.boof6812,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.ftext=`Each other friendly Yeti get ${m.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const e=p.crFriendNotMeTarg(t.creatId);e.tribe="YT";const r=f.creatByTarget(e),s=this.stokeboof;r.forEach(h=>{const u=p.mod("AT",s,t.creatId);u.expiry="ET",h.addMod(u)})}get stokeboof(){return this.lValN([3,4,6])}uiwC(){this.faction="A",this.rarity="L",this.name="Uriel Ironwing",this.iAttack=this.lValN([6,8,13]),this.iHealth=this.boof81117,this.iMobile=this.level,this.tribe.push("AG"),this.flanks=!0;const t=this.boof246n,e=this.level===3?" If that creature has 0 or less attack, destroy it.":"";this.ftext=`The opposing creature gets ${m.jr9(t,0)}.${e}`}uiwF(t){const s=W.toEnterField(t.event).creature.opposed;s&&(s.buff(this.boof246n,0),this.level===3&&s.attack<1&&O.destroy(s,this.code))}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${m.jr9(t,t)}.`}umaulF(t){const e=W.toEnterField(t.event);if(e.creature.opposed){const r=this.boof246;e.creature.buff(r,r)}}vikC(){this.faction="N",this.rarity="L",this.name="Varna, Immortal King",this.maxLevel=4,this.iAttack=this.lValN([4,6,12,18]),this.iHealth=this.lValN([8,13,22,30]),this.tribe.push("FB");let t="";this.level===4&&(t="Destroy each other creature. Then "),this.ftext=t+"Spawn a random friendly creature that was destroyed this turn."}vikF(t){if(this.level===4){const s=f.creatByTarget(p.crNotMeTarg(t.creatId));if(s.length>0){const h=N.tick();s.forEach(u=>O.destroy(u,this.code,h))}}const e=t.owner?M.deathsA:M.deathsB,r=e.length;e.length>0&&f.birth(e[T.randInt(0,r)],"S",t.owner)}vdrkC(){this.faction="U",this.rarity="R",this.name="Venomdrinker",this.iAttack=this.lValN([5,9,13]),this.iHealth=this.iAttack,this.tribe.push("NG"),this.ftext=`${this.name} gets ${m.jr9(1,1).replaceAll("1","X")}, where X is the total amount of Poison on each enemy creature.`}vdrkF(t){const e=f.qEnemyCreats();let r=0;e.forEach(s=>{r+=s.poison}),r>0&&f.jr5(t.creatId).buff(r,r)}vnsC(){this.faction="U",this.rarity="H",this.name="Venomous Netherscale",this.iAttack=this.boof4713,this.iHealth=this.iAttack+4,this.tribe.push("NG"),this.ftext=`Double the Poison on each enemy creature${this.level===3?" and the enemy player":""}.`}vnsF(t){const e=p.crEnemyTarg();if(e.hasPoison=!0,f.creatByTarget(e).forEach(s=>{s.addPoison(s.poison)}),this.level===3){const s=k.toPlayer(!t.owner);s.poison+=k.totalPoison(s)}}warC(){this.faction="A",this.rarity="H",this.name="War Machine",this.iAttack=3,this.iHealth=3,this.tribe.push("RB"),this.maxLevel=1,this.overload=!0,this.ftext=`Each other friendly creature gets ${m.jr9(3,0)}.`}warF(t){const e=p.crFriendNotMeTarg(t.creatId);f.creatByTarget(e).forEach(r=>r.buff(3,0))}wwpC(){this.faction="U",this.rarity="H",this.name="Weirwood Patriarch",this.iAttack=this.boof5714,this.iHealth=this.lValN([7,10,17]),this.tribe.push("HM");const t=this.boof235;this.ftext=`Each friendly creature with ${this.boof357} or less attack gets ${m.jr9(t,t)}.`}wwpF(t){const e=this.boof235,r=p.crFriendNotMeTarg(t.creatId);r.maxAttack=this.boof357,f.creatByTarget(r).forEach(s=>s.buff(e,e))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("ST"),this.hints=["OP"],this.flanks=!0;const t=this.boof247n;this.ftext=`The opposing creature gets ${m.jr9(t,t)}.`}wfbF(t){const r=W.toEnterField(t.event).creature.opposed;if(r){const s=this.boof247n;r.buff(s,s)}}xtmC(){this.faction="N",this.rarity="H",this.name="Xithian Tormentor",this.iAttack=this.lValN([6,12,22]),this.iHealth=this.lValN([10,16,28]),this.tribe.push("AB"),this.ftext="Destroy each other friendly creature."}xtmF(t){const e=f.creatByTarget(p.crFriendNotMeTarg(t.creatId));if(e.length>0){const r=N.tick();e.forEach(s=>O.destroy(s,this.code,r))}}}class ze extends P{lookup(t){return{["RBG"]:{c:()=>this.rbgC(),g:(r,s)=>this.rbgG(r,s)},["SRV"]:{c:()=>this.sprvC(),g:(r,s)=>this.sprvG(r,s)},["TGK"]:{c:()=>this.tgkC(),g:(r,s)=>this.tgkG(r,s)}}[t]}onGain(t,e){this.lookup(t).g(e,e.event)}hPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("LG",this.code),r}ddf8(t){return t.trigger.type==="LG"&&this.validPlayer(t)}jr8(t){this.onGain(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.hPlayer===0)return!0;const e=t.event;return this.hPlayer===1?t.owner===e.playerA:t.owner!==e.playerA}rbgC(){this.faction="U",this.rarity="H",this.name="Runebark Guardian",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hPlayer=1;const t=this.boof135;this.text=`When you gain health, ${this.name} gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}rbgG(t,e){const r=f.jr5(t.creatId),s=this.boof135;r.buff(s,s)}sprvC(){this.faction="N",this.rarity="R",this.name="Spirit Reaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.hPlayer=-1;const t=this.boof234;this.text=`When an enemy player gains health, ${this.name} gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}sprvG(t,e){const r=f.jr5(t.creatId),s=this.boof234;r.buff(s,s)}tgkC(){this.faction="U",this.rarity="R",this.name="Tuskin Grovekeeper",this.iAttack=this.boof6912,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hPlayer=1,this.text=`When you gain health, Spawn a 3/3 ${U.minionName(this.level)}.`,this.bonus={exist:this.ddp9(1,6,3,0)*.5}}tgkG(t,e){const r=this.lValS(["SXD","SPL","TTF"])+this.level;f.birth(r,"S",t.owner)}}class Be extends P{lookup(t){return{["EWE"]:{c:()=>this.eweC(),m:(r,s)=>this.eweM(r,s)},["FFM"]:{c:()=>this.ffmC(),m:(r,s)=>this.ffmM(r,s)},["LUC"]:{c:()=>this.lugC(),m:(r,s)=>this.lugM(r,s)},["WBH"]:{c:()=>this.wbhC(),m:(r,s)=>this.wbhM(r,s)}}[t]}onMove(t,e){this.lookup(t).m(e,W.toCreature(e.event))}mPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("MV",this.code),r}ddf8(t){return t.trigger.type==="MV"&&this.validPlayer(t)}jr8(t){this.onMove(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=W.toCreature(t.event);return this.mPlayer===1?t.owner===e.creature.owner:t.owner!==e.creature.owner}eweC(){this.faction="T",this.rarity="H",this.name="Emberwind Evoker",this.iAttack=this.boof4914,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.mPlayer=1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)}}eweM(t,e){const r=this.boof124;e.creature.buff(r,r)}ffmC(){this.faction="T",this.rarity="H",this.name="Frostfang Maiden",this.iAttack=this.boof5814,this.iHealth=this.iAttack+this.level,this.tribe.push("HM"),this.iMobile=this.level,this.mPlayer=1;const t=this.ffbof;this.text=`When a friendly creature moves, deal ${t} to the creature opposing it.`,this.bonus={exist:this.ddp9(0,t,0,0)}}ffmM(t,e){const r=e.creature.opposed;r&&r.hurtDirect(this.ffbof,this.code)}get ffbof(){return this.level+2}lugC(){this.faction="T",this.rarity="L",this.name="Lug, Uranti Charger",this.iAttack=this.boof359,this.iHealth=this.lValN([9,13,19]),this.level===3&&(this.iMobile=1),this.tribe.push("YT"),this.mPlayer=1,this.text="When a friendly creature moves on your turn, Lug battles an additional time.",this.bonus={exist:this.ddp9(0,0,0,this.iAttack)}}lugM(t,e){if(t.owner===k.getActiveB()){const r=f.jr5(t.creatId);r.extraBattles+=1}}wbhC(){this.faction="T",this.rarity="R",this.name="Windborn Hellion",this.iAttack=this.boof4812,this.iHealth=this.boof81217,this.tribe.push("WN","EL"),this.mPlayer=1,this.text=`When a friendly creature moves, ${this.name} gets ${m.jr9(this.level,this.level)}.`,this.bonus={exist:this.ddp9(0,this.level*2,this.level,0)}}wbhM(t,e){f.jr5(t.creatId).buff(this.level,this.level)}}class Yt extends P{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.agrdP(r,s)},["ART"]:{c:()=>this.arootC(),t:(r,s)=>this.factionSpellMyTurn(r,s,"U"),p:(r,s)=>this.arootP(r,s)},["ARB"]:{c:()=>this.arbysC(),t:(r,s)=>this.enemyPlayed(r,s),p:(r,s)=>this.arbysP(r,s)},["BLH"]:{c:()=>this.bblhC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.bblhP(r,s)},["CYC"]:{c:()=>this.ccC(),t:(r,s)=>this.factionSpellMyTurn(r,s,"N"),p:(r,s)=>this.ccP(r,s)},["DHW"]:{c:()=>this.dhwC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.dhwP(r,s)},["FBI"]:{c:()=>this.fbiC(),t:(r,s)=>this.factionSpellMyTurn(r,s,"T"),p:(r,s)=>this.fbiP(r,s)},["FLS"]:{c:()=>this.flspkC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.flspkP(r,s)},["IZK"]:{c:()=>this.izzyC(),t:(r,s)=>this.izzyT(r,s),p:(r,s)=>this.izzyP(r,s)},["KAW"]:{c:()=>this.kasC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.kasP(r,s)}}[t]}testPlay(t,e){return this.lookup(t).t(e,e.event)}actPlay(t,e){this.lookup(t).p(e,e.event)}triggerLevels=[1,2,3,4];constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return this.triggerLevels.includes(this.level)&&r.jr4("PC",this.code),r}ddf8(t){return t.event.code==="PLC"?this.testPlay(this.cardCode(),t):t.event.code==="TRE"&&this.cardCode()==="BLH"}jr8(t){if(t.event.code==="PLC")this.actPlay(this.cardCode(),t);else{const e=f.jr5(t.creatId);O.destroy(e,this.code)}x.triggerDone()}spellMyTurn(t,e){return e.playerA===t.owner&&I.getCard(e.cardCode).type==="S"}factionSpellMyTurn(t,e,r){if(e.playerA===t.owner){const s=I.getCard(e.cardCode);if(s.type==="S"&&s.faction===r)return!0}return!1}enemyPlayed(t,e){return e.playerA!==t.owner}ownerAlive(t){return f.jr5(t).status==="A"}agrdC(){this.faction="A",this.rarity="C",this.name="Aetherguard",this.iAttack=this.boof6814,this.iHealth=this.iAttack-1,this.tribe.push("RB"),this.bonus={exist:this.ddp9(0,this.level,0,0)},this.text=`When you play a spell, ${this.name} gets Armor ${this.level}.`}agrdP(t,e){f.jr5(t.trigger.creatId).addArmor(this.level)}arootC(){this.faction="U",this.rarity="H",this.name="Aether Root",this.iAttack=this.boof3610,this.iHealth=this.iAttack,this.tribe.push("PL");const t=this.boof234;this.text=`When you play an Uterra spell, ${this.name} gets ${m.jr9(t,t)}.`,this.bonus={exist:this.ddp9(0,t*2,t,0)*.5}}arootP(t,e){const r=f.jr5(t.trigger.creatId),s=this.boof234;r.buff(s,s)}arbysC(){this.faction="A",this.rarity="H",this.name="Anvillon Arbiter",this.iAttack=this.boof3714,this.iHealth=this.iAttack+3,this.iArmor=1,this.tribe.push("RB"),this.text="When the enemy player plays their second card in a turn, that player discards their hand."}arbysP(t,e){if(M.cardsPlayed>1&&this.ownerAlive(t.creatId)){const r=k.getActive();r.discard.push(...r.hand),r.hand=[]}}bblhC(){this.faction="T",this.rarity="L",this.name="Binben, Lightning Herald",this.iAttack=this.boof61017,this.iHealth=this.boof468,this.tribe.push("LT","AS");const t=I.getCard(this.lwy());this.text=`When you play a spell, Spawn a ${m.tokName(t)}. At the end of your turn, destroy it.`}bblhP(t,e){if(this.ownerAlive(t.creatId)){const r=f.birth(this.lwy(),"S",t.owner);if(r){const s=r.jr4("TE",this.code);s.changes=!0}}}lwy(){return "LWY"+this.level}ccC(){this.faction="N",this.rarity="H",this.name="Crypt Conjurer",this.iAttack=this.boof258,this.iHealth=this.lValN([8,14,20]),this.tribe.push("VP"),this.text=`When you play a Nekrium spell, deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.bonus={exist:this.ddp9(0,0,0,this.iAttack)}}ccP(t,e){this.ownerAlive(t.creatId)&&(k.hurtDirect(!t.owner,this.iAttack,t.cardCode),k.heal(t.owner,this.iAttack))}dhwC(){this.faction="N",this.rarity="R",this.name="Darkheart Wanderer",this.iAttack=this.boof3612,this.iHealth=this.boof81116,this.tribe.push("HM");const t=this.boof124;this.text=`When you play a spell, ${this.name} gets Regenerate ${t}.`}dhwP(t,e){f.jr5(t.trigger.creatId).addRegen(this.boof124)}fbiC(){this.faction="T",this.rarity="H",this.name="Flamebreak Invoker",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("FR","GT"),this.text=`When you play a Tempys spell, deal ${this.level} damage to each enemy creature.`,this.bonus={exist:this.ddp9(0,this.level*2,0,0)*.5}}fbiP(t,e){if(this.ownerAlive(t.creatId)){const r=N.tick();f.qEnemyCreats().forEach(s=>{s.hurtDirect(this.level,this.code,r)})}}flspkC(){this.faction="T",this.rarity="C",this.name="Flame Speaker",this.iAttack=this.lValN([2,6,13]),this.iHealth=this.level*6,this.tribe.push("HM");const t=this.boof235;this.text=`When you play a spell, deal ${t} damage to the enemy player.`,this.bonus={exist:this.ddp9(0,0,0,t)*.5}}flspkP(t,e){this.ownerAlive(t.creatId)&&k.hurtDirect(!t.owner,this.boof235,t.cardCode)}izzyC(){this.faction="T",this.rarity="L",this.name="Iztek, Khan of Arrachtor",this.iAttack=this.boof6915,this.iHealth=this.iAttack,this.tribe.push("IC","FR","AS"),this.text=`When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.~When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.`}izzyT(t,e){if(e.playerA===t.owner){const s=I.getCard(e.cardCode).cardCode();if(s==="IFL"||s==="IFR")return!0}return!1}izzyP(t,e){const r=f.jr5(t.trigger.creatId),h=I.getCard(e.cardCode).cardCode()==="IFL"?"IZL":"IZR";f.birth(`${h}${this.level}`,"R",r.owner,r.lane)}kasC(){this.faction="T",this.rarity="L",this.name="Kas, Arcweaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("LT","AS"),this.hints=["OL"],this.text="When you play a spell, Kas battles an additional time this turn.",this.bonus={exist:this.ddp9(0,this.iAttack,this.iAttack,0)*.5}}kasP(t,e){const r=f.jr5(t.trigger.creatId);r.extraBattles+=1}}class Pe extends P{lookup(t){return{["KTS"]:{c:()=>this.kitC(),r:(r,s)=>this.kitR(r,s)},["RSC"]:{c:()=>this.scootC(),r:(r,s)=>this.scootR(r,s)},["SCC"]:{c:()=>this.shcrC(),r:(r,s)=>this.shcrR(r,s)},["SND"]:{c:()=>this.ssdC(),r:(r,s)=>this.ssdR(r,s)}}[t]}actReplace(t,e){this.lookup(t).r(e,W.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("RP",this.code),r}ddf8(t){if(t.event.code==="RPL"){const e=t.event;return t.creatId===e.replCreatId}return!1}jr8(t){this.actReplace(this.cardCode(),t),x.triggerDone()}kitC(){this.faction="U",this.rarity="H",this.name="Kitaru Sprite",this.iAttack=this.boof358,this.iHealth=this.boof71117,this.tribe.push("FY"),this.hints=["RT"],this.text=`When this is replaced, Spawn a ${this.name}.`}kitR(t,e){f.birth(this.code,"S",t.owner)}scootC(){this.faction="A",this.rarity="T",this.name="Relic Scout",this.iAttack=this.level,this.iHealth=this.level,this.iArmor=this.level,this.isFree=!0,this.tribe.push("RB"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${m.jr9(this.level,this.level,!0)} and Armor ${this.level}.`}scootR(t,e){e.creature.buff(this.level,this.level),e.creature.addArmor(this.level)}shcrC(){this.faction="U",this.rarity="C",this.name="Shardclaw Crusher",this.iAttack=this.boof5812,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${m.jr9(this.iAttack,this.iAttack)}.`}shcrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}ssdC(){this.faction="U",this.rarity="R",this.name="Spiritstone Druid",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("TG"),this.hints=["RT"],this.text=`When ${this.name} is replaced, put a ${this.iAttack}/${this.iHealth} Spirit into each adjacent available lane.`}ssdR(t,e){const r=e.replCreat.adjacent,s=f.emptyLanes(t.owner),h=N.tick();r.forEach(u=>{s.includes(u)&&f.birth("SPU"+this.level,"P",t.owner,u,h)})}}class ce extends P{lookup(t){return{["BST"]:{c:()=>this.brimC(),u:(r,s)=>this.brimR(r,s)},["OSV"]:{c:()=>this.scavC(),u:(r,s)=>this.scavR(r,s)},["RHU"]:{c:()=>this.tiaC(),u:(r,s)=>this.tiaR(r,s)},["SKS"]:{c:()=>this.spsoC(),u:(r,s)=>this.spsoR(r,s)},["SWG"]:{c:()=>this.stgrC(),u:(r,s)=>this.stgrR(r,s)},["VTW"]:{c:()=>this.weldC(),u:(r,s)=>this.weldR(r,s)}}[t]}actUpgrade(t,e){this.lookup(t).u(e,W.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("UP",this.code),r}jr8(t){this.actUpgrade(this.cardCode(),t),x.triggerDone()}brimC(){this.faction="T",this.rarity="L",this.name="Brimstone Tyrant",this.iAttack=this.boof6916,this.iHealth=this.iAttack,this.tribe.push("FR","EL"),this.hints=["RD"];const t=this.boof468;this.text=`Upgrade: Deal ${t} damage to each other creature.`}brimR(t,e){const r=N.tick(),s=this.boof468;f.creatByTarget(p.crNotMeTarg(t.creatId)).forEach(h=>h.hurtDirect(s,this.code,r))}scavC(){this.faction="A",this.rarity="H",this.name="Oreian Scavenger",this.iAttack=this.boof6916,this.iHealth=1,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Armor ${this.iAttack}.`}scavR(t,e){e.creature.addArmor(this.iAttack)}tiaC(){this.faction="A",this.rarity="L",this.name="Relic Hunter",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iBT=!0,this.tribe.push("HM"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets +attack and +health equal to the creature it replaced.`}tiaR(t,e){e.creature.buff(e.replCreat.attack,e.replCreat.health)}spsoC(){this.faction="T",this.rarity="C",this.name="Sparksoul",this.iAttack=this.boof6915,this.iHealth=this.iAttack-1,this.tribe.push("LT","EL"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Aggressive.`}spsoR(t,e){e.creature.aggressive=!0}stgrC(){this.faction="A",this.rarity="C",this.name="Steelwatch Guard",this.iAttack=this.boof4711,this.iHealth=this.iAttack,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets ${m.jr9(this.iAttack,this.iAttack)}.`}stgrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}weldC(){this.faction="A",this.rarity="R",this.name="Vault Welder",this.iAttack=this.boof71118,this.iHealth=this.lValN([9,14,22]),this.iDefend=!0,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: Negate Defender from ${this.name}.`}weldR(t,e){e.creature.negateDefender=!0}}class At extends P{lookup(t){return{["CGF"]:{c:()=>this.cfiendC(),v:(r,s)=>this.cfiendV(r,s)},["CSB"]:{c:()=>this.corpsC(),v:(r,s)=>this.corpsV(r,s)},["CYS"]:{c:()=>this.cslmC(),v:(r,s)=>this.cslmV(r,s)},["DSK"]:{c:()=>this.dskC(),v:(r,s)=>this.dskV(r,s)},["FST"]:{c:()=>this.fstrC(),v:(r,s)=>this.fstrV(r,s)},["FWK"]:{c:()=>this.fwlkC(),v:(r,s)=>this.fwlkV(r,s)},["FFD"]:{c:()=>this.ffC(),v:(r,s)=>this.ffV(r,s)},["GVS"]:{c:()=>this.ghsC(),v:(r,s)=>this.ghsV(r,s)},["GBG"]:{c:()=>this.ggC(),v:(r,s)=>this.ggV(r,s)},["GMR"]:{c:()=>this.gromC(),v:(r,s)=>this.gromV(r,s)},["MMX"]:{c:()=>this.mmeC(),v:(r,s)=>this.mmeV(r,s)},["NOZ"]:{c:()=>this.nyozC(),v:(r,s)=>this.nyozV(r,s)},["POX"]:{c:()=>this.poxC(),v:(r,s)=>this.poxV(r,s)},["RSZ"]:{c:()=>this.rszC(),v:(r,s)=>this.rszV(r,s)},["SFM"]:{c:()=>this.spirmC(),v:(r,s)=>this.spirmV(r,s)},["SNT"]:{c:()=>this.sssC(),v:(r,s)=>this.sssV(r,s)},["VGN"]:{c:()=>this.vgfsC(),v:(r,s)=>this.vgfsV(r,s)},["XHS"]:{c:()=>this.xhostC(),v:(r,s)=>this.xhostV(r,s)},["ZTU"]:{c:()=>this.zimusC(),v:(r,s)=>this.zimusV(r,s)}}[t]}cardVengeance(t,e){this.lookup(t).v(e,W.toCreature(e.event))}vtext="";venges=!0;fixedImgCreat=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.venges&&(this.text="Vengeance: "+this.vtext),this.vtext=""}image(t){return this.fixedImgCreat?this.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e);return this.venges&&r.jr4("VN",this.code),r}jr8(t){this.cardVengeance(this.cardCode(),t),x.triggerDone()}cfiendC(){this.faction="N",this.rarity="T",this.name="Contagion Fiend",this.iAttack=this.boof234,this.iHealth=this.boof5812,this.tribe.push("AB"),this.fixedImgCreat=!0;const t=-this.level;this.vtext=`Each enemy creature gets ${m.jr9(t,t)}.`}cfiendV(t,e){const r=-this.level,s=N.tick(),h=p.crTarg();h.player=k.toTarget(!t.owner),f.creatByTarget(h).forEach(u=>u.buff(r,r,s))}corpsC(){this.faction="N",this.rarity="C",this.name="Corpulent Shambler",this.iAttack=this.lValN([5,7,15]),this.iHealth=this.iAttack,this.tribe.push("ZB"),this.vtext="Put a 3/3 Zombie into this lane.",this.bonus={play:this.ddp9(1,6,3,0)}}corpsV(t,e){const r=`${"ZBS"}${this.level}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}cslmC(){this.faction="N",this.rarity="C",this.name="Crypt Slime",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.vtext="Put a 1/1 Oozeling into this lane.",this.bonus={play:this.ddp9(1,2,1,0)}}cslmV(t,e){const r=`${"COZ"}${this.level}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}dskC(){this.faction="N",this.rarity="C",this.name="Death Seeker",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.fixedImgCreat=!0,this.hints=["ST"];const t=this.boof51015;this.vtext=`Put a ${t}/${t} Spirit into this lane.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}dskV(t,e){const r=`${"SPN"}${this.level}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}fstrC(){this.faction="N",this.rarity="R",this.name="Fell Strider",this.iAttack=this.lValN([4,8,10]),this.iHealth=this.boof369,this.tribe.push("ZB");const t=I.getCard(this.fsz());this.vtext=`Put a ${m.tokName(t)} into this lane.`,this.bonus={play:this.ddp9(1,this.iAttack+this.iHealth,this.iAttack,0)}}fstrV(t,e){f.birth(this.fsz(),"P",e.creature.owner,e.creature.lane)}fsz(){return "ZST"+this.level}fwlkC(){this.faction="N",this.rarity="C",this.name="Fell Walker",this.iAttack=this.boof359,this.iHealth=this.iAttack,this.tribe.push("ZB");const t=I.getCard(U.zomc(this.level));this.vtext=`Put a ${m.tokName(t)} into this lane.`,this.bonus={play:this.ddp9(1,this.iAttack*2,this.iAttack,0)}}fwlkV(t,e){f.birth(U.zomc(this.level),"P",e.creature.owner,e.creature.lane)}ffC(){if(this.faction="N",this.rarity="H",this.name="Fleshfiend",this.iAttack=this.boof6812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.venges=this.level>1,this.vtext=`Put a level ${this.level-1} ${this.name} into this lane.`,this.venges){const t=this.lValN([0,6,15]);this.bonus={play:this.ddp9(1,t*2,t,0)}}}ffV(t,e){const r=`${"FFD"}${this.level-1}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}ghsC(){this.faction="U",this.rarity="C",this.name="Glowhive Siren",this.iAttack=this.boof3814,this.iHealth=this.boof61117,this.tribe.push("IN"),this.vtext=`You gain ${this.boof124} to ${this.gghigh-1} health.`,this.bonus={play:this.ddp9(0,0,0,this.boof258)}}ghsV(t,e){const r=T.randInt(this.boof124,this.gghigh);k.heal(t.owner,r)}get gghigh(){return this.lValN([5,9,13])}ggC(){this.faction="N",this.rarity="C",this.name="Graveborn Glutton",this.iAttack=this.boof61117,this.iHealth=this.boof3814,this.tribe.push("AB"),this.vtext=`Deal ${this.boof124} to ${this.gghigh-1} damage to the enemy player.`,this.bonus={play:this.ddp9(0,0,0,this.boof258)}}ggV(t,e){const r=T.randInt(this.boof124,this.gghigh);k.hurtDirect(!t.owner,r,this.code)}gromC(){this.faction="U",this.rarity="C",this.name="Grove Matriarch",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("PL");const t=U.minionBuff(this.level),e=U.minionName(this.level);this.vtext=`Put a ${t}/${t} ${e} into this lane.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}gromV(t,e){const r=U.minionCode(this.level);f.birth(r,"P",e.creature.owner,e.creature.lane)}mmeC(){this.faction="A",this.rarity="C",this.name="Metamind Explorer",this.iAttack=this.boof3713,this.iHealth=this.iAttack+2,this.tribe.push("MM"),this.vtext=`Draw ${this.level} cards.`}mmeV(t,e){k.drawCard(t.owner,this.level)}nyozC(){this.faction="N",this.rarity="R",this.name="Nyrali Ooze",this.iAttack=this.boof247,this.iHealth=this.iAttack,this.tribe.push("OZ");const t=this.level+this.iAttack+1;this.vtext=`Put a ${t}/${t} Oozeling into this lane.`,this.bonus={play:this.ddp9(1,t*2,t,0)}}nyozV(t,e){const r=`${"OOZ"}${this.level}`;f.birth(r,"P",e.creature.owner,e.creature.lane)}poxC(){if(this.faction="N",this.rarity="H",this.name="Progeny of Xith",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.tribe.push("AB"),this.hints=["DL"],this.venges=this.level<3,this.vtext=`Spawn a level ${this.level+1} ${this.name}.`,this.venges){const t=this.lValN([10,6,0]);this.bonus={play:this.ddp9(1,t*2,t,0)}}}poxV(t,e){const r=`${"POX"}${this.level+1}`;f.birth(r,"S",e.creature.owner)}rszC(){this.faction="N",this.rarity="R",this.name="Runescarred Zombie",this.iAttack=this.lValN([5,8,16]),this.iHealth=this.boof359,this.tribe.push("ZB"),this.vtext=`Put a ${m.levelGateText(this.level,!0)}spell at random from your discard pile into your hand.`,this.bonus={play:this.ddp9(0,0,0,0,.25)}}rszV(t,e){const r=k.toPlayer(t.owner),s=p.target("TD");s.player=k.toTarget(r),s.card="S",s.level=w.ddf2(this.level);const h=w.deckByTarget(s);if(h.length>0){const u=h[T.randInt(0,h.length)];r.discard.splice(u[1],1),r.hand.push(u[0])}}spirmC(){this.faction="T",this.rarity="H",this.name="Spiritflame Mystic",this.iAttack=this.boof6912,this.iHealth=this.iAttack-3,this.tribe.push("HM"),this.vtext=`Deal ${this.boof246} damage to each creature.`}spirmV(t,e){const r=this.boof246,s=N.tick();f.qActiveCreats().forEach(h=>h.hurtDirect(r,this.code,s))}sssC(){this.faction="N",this.rarity="L",this.name="Spiritstone Sentry",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("ST"),this.vtext=`If ${this.name} was in a side lane, Spawn a ${this.name}.`,this.hints=["ST"]}sssV(t,e){(e.creature.lane===1||e.creature.lane===5)&&f.birth(e.creature.code,"S",t.owner)}vgfsC(){this.faction="N",this.rarity="C",this.name="Vengeful Spirit",this.iAttack=this.boof357,this.iHealth=this.iAttack-2,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof369n;this.vtext=`Give the opposing creature ${m.jr9(t,t)}.`,this.bonus={play:this.ddp9(0,t*-2,-t,0)}}vgfsV(t,e){const r=e.creature.opposed;if(r){const s=this.boof369n;r.buff(s,s)}}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.iAttack=this.boof359,this.iHealth=this.boof135,this.tribe.push("AB"),this.vtext=`Deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.bonus={play:this.ddp9(0,0,0,this.iAttack*2)}}xhostV(t,e){const r=this.iAttack;k.hurtDirect(!t.owner,r,this.code),k.heal(t.owner,r)}zimusC(){this.faction="N",this.rarity="L",this.name="Zimus, the Undying",this.iAttack=this.boof51014,this.iHealth=this.lValN([2,5,7]),this.tribe.push(this.level===1?"HM":"ZB"),this.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,e){let r;this.level===2?r=`${"ZTR"}2`:r=`${"ZTU"}3`,f.birth(r,"S",t.owner)}}class $t extends yt{lookup(t){return{["AEC"]:{c:()=>this.anceC(),p:r=>this.echoZ(r)},["DIS"]:{c:()=>this.disnC(),p:r=>this.disnZ(r)},["DRE"]:{c:()=>this.dracC(),p:r=>this.echoZ(r)},["DCH"]:{c:()=>this.dchantC(),p:r=>this.dchantZ(r)},["ESU"]:{c:()=>this.esrgC(),p:r=>this.esrgZ(r)},["HOX"]:{c:()=>this.howlC(),p:r=>this.howlZ(r)},["ITO"]:{c:()=>this.itorC(),p:r=>this.itorZ(r)},["IME"]:{c:()=>this.imecC(),p:r=>this.echoZ(r)},["LCE"]:{c:()=>this.lucidC(),p:r=>this.echoZ(r)},["MSP"]:{c:()=>this.mendC(),p:r=>this.mendZ(r)},["NEM"]:{c:()=>this.netherC(),p:r=>this.netherZ(r)}}[t]}cardCast(t,e){this.lookup(t).p(e)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(p.playerActTarg(this.playTarg,"CARD",this.code,"")),t}handleAction(t){this.logSpell();const e=k.toPlayer(t.playerA);this.cardCast(this.cardCode(),e),v.spellCast()}ddf8(t){return t.trigger.type==="TE"?t.event.playerA===t.owner:!1}jr8(t){const e=St.extractCardCode(t.trigger.logicCode),r=t.event;if(e==="LCE"){const s=k.toPlayer(r.playerA),h=this.level===1?1:2;this.logAct(!1),k.drawCard(s,h)}else if(e==="IME"){const s=O.gravedigger(k.toTarget(t.owner),w.ddf2(this.level+1));s&&f.birth(s,"S",r.playerA)}else if(e==="DRE"){const s=this.level===1?11:21;k.hurtDirect(!r.playerA,T.randInt(1,s),this.code)}else if(e==="AEC"){const s=f.qPlayerCreats(t.owner);if(s.length>0){const h=this.level===1?[1,2]:[2,4];s.forEach(u=>{this.logAct(!1,u),u.buff(h[0],h[1])})}}else super.jr8(t);if(this.level<3){const s=k.toPlayer(r.playerA),h=p.trigIdx(s.triggers,t.trigger);h>-1?t.trigger.customCode==="P2"?s.triggers[h].customCode="P1":s.triggers.splice(h,1):console.error("Wery curious, could not find player trigger ",t.trigger)}x.triggerDone()}echTxt(){return"At the end of "+(this.level===3?"each of your turns":"this turn and your next turn")+", "}echoZ(t){const e=p.trigger("TE",this.code);this.level<3&&(e.customCode="P2"),e.changes=!0,t.triggers.push(e)}anceC(){this.faction="U",this.rarity="L",this.name="Ancestral Echoes",this.playTarg="F";const t=this.level===1?[1,2]:[2,4];this.text=`${this.echTxt()}each friendly creature gets ${m.jr9(t[0],t[1])}.`}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){k.hurtDirect(t,T.randInt(1,this.dshigh),this.code)}get dshigh(){return this.lValN([9,16,26])}dracC(){this.faction="T",this.rarity="L",this.name="Draconic Echoes",this.playTarg="F";const t=this.level===1?"10":"20";this.text=`${this.echTxt()}deal 1 to ${t} damage to the enemy player.`}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){k.heal(t,this.boof81220)}esrgC(){this.faction="A",this.rarity="R",this.name="Energy Surge",this.isFree=this.level>1,this.overload=this.level===3,this.level===1&&(this.hints=["LV"]),this.playTarg="F",this.text=`Draw ${this.level} card${this.level>1?"s":""}.`}esrgZ(t){k.drawCard(t,this.level)}howlC(){this.faction="N",this.rarity="R",this.name="Howl of Xith",this.maxLevel=1,this.playTarg="E",this.text="Deal X damage to the enemy player and gain X health, where X is three times your rank."}howlZ(t){const e=k.getActive(),r=e.rank*3;k.hurtDirect(t,r,this.code),k.heal(e,r)}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){k.hurtDirect(t,this.boof234,this.code)}imecC(){this.faction="N",this.rarity="L",this.name="Immortal Echoes",this.playTarg="F";const t=`Spawn a random friendly ${m.levelGateText(this.level+1,!0)}creature that was destroyed this game`;this.text=`${this.echTxt()}${t}.`}lucidC(){this.faction="A",this.rarity="L",this.name="Lucid Echoes",this.playTarg="F";const t=this.level===1?"draw 1 card":"draw 2 cards";this.text=`${this.echTxt()}${t}.`}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){k.heal(t,T.randInt(1,this.mendboof+1))}get mendboof(){return this.lValN([10,20,40])}netherC(){this.faction="N",this.rarity="C",this.name="Nether Embrace",this.playTarg="E";const t=this.boof4712;this.text=`Deal ${t} damage to the enemy player. You gain ${t} heal`}netherZ(t){const e=this.boof4712;k.hurtDirect(t,e,this.code),k.heal(!t.isPlayerA,e)}}class Ri extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Rageborn Hellion",this.iAttack=this.boof469,this.iHealth=this.iAttack*2,this.tribe.push("FR","EL"),this.hints=["OL"],this.text=`When a friendly creature ${m.dbdtap()}, ${this.name} gets ${m.jr9(this.level,this.level)}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}return!1}jr8(t){f.jr5(t.creatId).buff(this.level,this.level),x.triggerDone()}}class Nt extends P{lookup(t){return{["AIV"]:{c:()=>this.avinvC(),r:r=>this.avinvR(r)},["BSP"]:{c:()=>this.bskphC(),r:r=>this.bskphR(r)},["CRC"]:{c:()=>this.crucC(),r:r=>this.crucR(r)},["ESK"]:{c:()=>this.ebknC(),r:r=>this.ebknR(r)},["FWC"]:{c:()=>this.fwcC(),r:r=>this.fwcR(r)},["FME"]:{c:()=>this.feggC(),r:r=>this.feggR(r)},["MMV"]:{c:()=>this.mmovC(),r:r=>this.mmovR(r)},["PSH"]:{c:()=>this.porshC(),r:r=>this.porshR(r)},["RGG"]:{c:()=>this.runegC(),r:r=>this.runegR(r)},["SSR"]:{c:()=>this.solrevC(),r:r=>this.solrevR(r)},["SSM"]:{c:()=>this.spshamC(),r:r=>this.spshamR(r)},["SSG"]:{c:()=>this.snoutC(),r:r=>this.snoutR(r)},["UGM"]:{c:()=>this.mantisC(),r:r=>this.mantisR(r)}}[t]}rtext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Gain Rank: "+this.rtext,this.rtext=""}image(t){return this.rarity==="T"?this.cardCode()==="FWC"?this.rawImage("MPH",t):super.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e);return r.jr4("RU",this.code),r}ddf8(t){return t.trigger.type==="RU"?t.event.playerA===t.owner:!1}jr8(t){this.lookup(this.cardCode()).r(t),x.triggerDone()}avinvC(){this.faction="T",this.rarity="H",this.name="Avalanche Invoker",this.iAttack=this.boof6914,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS"),this.hints=["TL"],this.rtext=`Deal ${this.boof3612} damage to each non-Tempys creature.`}avinvR(t){const e=this.boof3612,r=N.tick();f.qActiveCreats().filter(s=>s.faction!=="T").forEach(s=>s.hurtDirect(e,this.code,r))}bskphC(){this.faction="N",this.rarity="C",this.name="Blightskull Phantasm",this.iAttack=this.boof5814,this.iHealth=this.boof61017,this.tribe.push("ST"),this.hints=["TL","OP"];const t=this.boof369n;this.rtext=`the opposing creature gets ${m.jr9(t,t)}.`}bskphR(t){const r=f.jr5(t.creatId).opposed;if(r){const s=this.boof369n;r.buff(s,s)}}crucC(){this.faction="A",this.rarity="R",this.name="Crucible Colossus",this.iAttack=this.boof61016,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.iDefend=!0,this.hints=["TL"],this.rtext=`Negate Defender from ${this.name}.`}crucR(t){const e=f.jr5(t.creatId);e.negateDefender=!0}ebknC(){this.faction="N",this.rarity="H",this.name="Ebonskull Knight",this.iAttack=this.lValN([9,13,18]),this.iHealth=this.iAttack-2,this.tribe.push("VP"),this.hints=["TL"],this.rtext=`Destroy ${this.name}.`}ebknR(t){const e=f.jr5(t.creatId);O.destroy(e,this.code)}fwcC(){this.faction="U",this.rarity="T",this.maxLevel=1,this.name="Feywing Chrysalis",this.iAttack=0,this.iHealth=3,this.tribe.push("CR"),this.iDefend=!0,this.rtext=`Replace ${this.name} with a 9/9 Feywing.`}fwcR(t){const e=f.jr5(t.creatId);f.birth(`${"FWG"}1`,"R",e.owner,e.lane)}feggC(){this.faction="T",this.rarity="T",this.minLevel=this.level,this.maxLevel=this.level,this.name="Frostmane Egg",this.iAttack=0,this.iHealth=6,this.tribe.push("DG"),this.iDefend=!0,this.rtext=`Replace ${this.name} with a level ${this.level} Frostmane Dragon.`}feggR(t){const e=f.jr5(t.creatId);f.birth(`${"FMD"}${this.level}`,"R",e.owner,e.lane)}mmovC(){this.faction="A",this.rarity="C",this.name="Metamind Overseer",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.hints=["TL"],this.rtext="Draw 2 cards."}mmovR(t){k.drawCard(t.owner,2)}porshC(){this.faction="N",this.rarity="H",this.name="Portal Shade",this.iAttack=this.boof5914,this.iHealth=this.boof71118,this.tribe.push("ST"),this.rtext="Spawn a random creature that was destroyed this game."}porshR(t){const e=O.gravedigger();e&&f.birth(e,"S",t.owner)}runegC(){this.faction="U",this.rarity="H",this.name="Runegrove Guardian",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=["TL"],this.rtext=`${this.name} gets ${m.jr9(this.iAttack,this.iAttack)}.`}runegR(t){f.jr5(t.creatId).buff(this.iAttack,this.iAttack)}solrevC(){this.faction="U",this.rarity="L",this.name="Solstice Reveler",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hints=["TL"];const t=this.solbof;this.rtext=`each friendly creature gets ${m.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}solrevR(t){const e=this.solbof;f.ddf1().forEach(r=>{r.buff(e,e),this.level===3&&(r.breakthrough=!0)})}get solbof(){return this.iAttack/2}spshamC(){this.faction="T",this.rarity="C",this.name="Spiritfrost Shaman",this.iAttack=this.boof71117,this.iHealth=this.boof4610,this.tribe.push("HM"),this.hints=["TL"],this.rtext=`Deal ${this.boof579} damage to the enemy player.`}spshamR(t){k.hurtDirect(!t.owner,this.boof579,this.code)}snoutC(){this.faction="U",this.rarity="C",this.name="Stouthide Stegadon",this.iAttack=this.boof4714,this.iHealth=this.boof71117,this.tribe.push("DN"),this.hints=["TL"],this.rtext=`Heal ${this.snoutbof} damage from ${this.name}.`}snoutR(t){f.jr5(t.creatId).heal(this.snoutbof)}get snoutbof(){return this.level*10}mantisC(){this.faction="U",this.rarity="C",this.name="Umbraglim Mantis",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("IN"),this.hints=["TL"],this.rtext=`You gain ${this.mantbof} health.`}mantisR(t){k.heal(t.owner,this.mantbof)}get mantbof(){return this.lValN([8,10,12])}}class Ei extends P{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Riftlasher",this.iAttack=this.boof359,this.iHealth=this.boof61016,this.tribe.push("FR","EL"),this.text=`When ${this.name} ${m.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.ddp9(0,this.iAttack,0,0)}}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM",this.code);return s.interactive=!0,r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&t.owner===k.getActiveB()}return!1}jr8(t){const e=t.event,r=w.toActions(p.crEnemyActTarg("CARD",this.code,T.enTil(t.creatId,e.dmg)));r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}handleAction(t){const e=T.deTil(t.param);f.ddf6(t).hurtDirect(parseInt(e[1]),this.code),v.actionDone(!0)}}class Ii extends Gt{jr3(t,e){const r=super.jr3(t,e);return r.jr4("AS",this.code),r}jr8(t){if(t.trigger.type==="AS"){let e=!0;for(;e;){const r=f.birth(this.code,"S",t.owner);r?r.opposed&&(e=!1):e=!1}x.triggerDone()}else super.jr8(t)}}class Li extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Scourgeflame Sorcerer",this.iAttack=this.boof358,this.iHealth=this.boof5914,this.tribe.push("ZB");const e=`Destroy an enemy ${m.levelGateText(this.level+1,!0)}creature.`,r=this.level===3?": ":", destroy another friendly creature: ";this.text=`Activate${r}${e}`}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){v.ddf5(this.getCardActions(p.ddf4(),t))}handleAction(t){const e=T.deTil(t.param);if(e[1]==="P1")v.ddf5(this.getCardActions(t));else{this.logAct(!0);const r=f.jr5(e[0]),s=N.tick(),h=f.ddf6(t);if(this.level<3){const u=f.jr5(e[2]);O.destroy(u,this.code,s)}O.destroy(h,this.code,s),r.endActivation()}}friends(t){const e=p.crFriendNotMeActTarg("CARD",t.id,this.code,T.enTil(t.id,"P1"));return w.toActions(e)}enemies(t,e=""){const r=p.crEnemyActTarg("CARD",this.code,T.enTil(t.id,"P2",e));return r.level=w.ddf2(this.level+1),w.toActions(r)}getCardActions(t,e){if(t.key==="ACTV"){const r=e??f.jr5(t.param);let s;return this.level===3?s=this.enemies(r):s=this.friends(r),s.push(v.cancelAction()),s}else if(t.key==="CARD"){const r=T.deTil(t.param),s=f.jr5(r[0]),h=f.ddf6(t),u=this.enemies(s,h.id);return u.push(v.cancelAction()),u}return super.getCardActions(t,e)}}class Gi extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Seismic Adept",this.iAttack=this.boof4712,this.iHealth=this.boof61218,this.tribe.push("HM"),this.text="Activate: Move an enemy creature to another available enemy lane.",this.bonus={exist:this.level*.5}}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){v.ddf5(this.getCardActions(p.ddf4(),t))}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.jr5(e[1]),s=f.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),r.endActivation()}}empties(t,e=""){const r=p.emptyPlayerActTarg("E","CARD",this.code,T.enTil("P2",t.id,e));return w.toActions(r)}enemies(t){const e=p.crEnemyActTarg("CARD",this.code,T.enTil("P1",t.id));return w.toActions(e)}getCardActions(t,e){if(t.key==="ACTV"){const r=e??f.jr5(t.param),s=this.enemies(r);return s.push(v.cancelAction()),s}else if(t.key==="CARD"){const r=f.ddf6(t),s=T.deTil(t.param),h=f.jr5(s[1]),u=this.empties(h,r.id);return u.push(v.cancelAction()),u}return super.getCardActions(t,e)}}class Ne extends P{constructor(t){super(t),this.rarity="R",this.iAttack=this.boof4612,this.iHealth=this.boof61016;const e=this.cardCode();if(e==="SSS"?this.steel():e==="LSS"?this.life():e==="FSS"?this.flame():e==="DSS"&&this.dark(),this.level>1){const r=m.levelGateText(this.level-1);this.text=`When you play a ${r} ${m.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 ${m.jr9(t,t)}`}life(){this.faction="U",this.name="Lifeshaper Savant",this.tribe.push("SE");const t=this.boof135;this.tuxt=`give another friendly creature ${m.jr9(t,t)}`}steel(){this.faction="A",this.name="Steelshaper Savant",this.tribe.push("HM"),this.tuxt=`give another friendly creature Armor ${this.boof124}`}flame(){this.faction="T",this.name="Flameshaper Savant",this.tribe.push("HM"),this.tuxt=`deal ${this.boof147} damage to target creature or player`}jr3(t,e){const r=super.jr3(t,e);if(this.level>1){const s=r.jr4("PC",this.code);s.interactive=!0}return r}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;if(e.playerA===t.owner){const r=I.getCard(e.cardCode);if(r.level0}startActivation(t){const e=this.empties(t);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){this.logAct(!0);const e=f.jr5(t.param);f.birth(`${this.hc()}`,"P",t.playerA,t.lane),e.endActivation()}empties(t){const e=p.emptyPlayerActTarg("F","CARD",this.code,t.id);return w.toActions(e)}}class Wi extends P{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Sparkstone Elemental",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("LT","EL"),this.text="Negate Defender from each creature."}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="A",r}enforceEffect(t,e){if(e.status==="A"){const s=p.mod("ND",!0,e.id);f.qActiveCreats().forEach(h=>h.addModSafe(s))}else f.qActiveCreats().forEach(s=>s.removeModSafe(e.id))}}class Ui extends yt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Spiritcleave",this.text=`Destroy a ${m.levelGateText(this.level+1,!0)}creature with the highest health among all creatures.${this.level===3?"~You gain health equal to that creature's health.":""}`}playTargets(){const t=super.playTargets();let e=-1;const r=f.qActiveCreats();r.forEach(u=>{u.health>e&&(e=u.health)});const s=r.filter(u=>u.health===e).map(u=>u.id),h=p.crActTarg("CARD",this.code,"");return h.level=w.ddf2(this.level+1),h.victims=T.enTil(...s),this.level<3&&(h.hint=["KL"]),t.push(h),t}handleAction(t){this.logSpell();const e=f.ddf6(t);O.destroy(e,this.code),this.level===3&&k.heal(k.getActiveB(),e.health),v.spellCast()}}class Vi extends yt{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Spiritleash";const e=this.boof5814;this.text=`Destroy a friendly creature.~Give a creature ${m.jr9(e,e)}.`}playTargets(){const t=super.playTargets(),e=p.crFriendActTarg("CARD",this.code,"P1");return f.creatByTarget(e).length>0&&f.qActiveCreats().length>1&&t.push(e),t}handleAction(t){const e=T.deTil(t.param),r=f.ddf6(t);if(e[0]==="P1"){const s=p.crNotMeActTarg("CARD",r.id,this.code,T.enTil("P2",r.id));s.hint=["BF"];const h=w.toActions(s);h.push(v.cancelAction()),v.ddf5(h)}else{this.logSpell(r);const s=f.jr5(e[1]),h=this.boof5814;O.destroy(s,this.code),r.buff(h,h),v.spellCast()}}}class zi extends P{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Spite Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.tribe.push("HY"),this.text=`When ${this.name} ${m.dbdtac()}, this gets ${m.jr9(this.level,this.level)}.~Allied Tempys: Activate: Deal ${this.level} damage to another creature. This gets ${m.jr9(this.level,this.level)}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r.jr4("DM",this.code),r}zapTargs(t){const e=p.crNotMeActTarg("CARD",t,this.code,t);return e.hint=["HR"],w.toActions([e,w.buttonTarget("CANC")])}canActivate(t){return this.zapTargs(t.id).length>1&&t.hasMod(t.id)}startActivation(t){v.ddf5(this.zapTargs(t.id))}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}handleAction(t){const e=f.ddf6(t),r=f.jr5(t.param);this.logAct(!0),e.hurtDirect(this.level,this.code),r.buff(this.level,this.level),r.endActivation()}jr8(t){const e=f.jr5(t.creatId);t.trigger.type==="FR"?M.allied("T")&&(e.addMod(p.mod("AL",!0,e.id)),e.changed=!0):t.trigger.type==="DM"&&e.buff(this.level,this.level),x.triggerDone()}}class Zi extends P{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Statis Warden",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.text="When you play a spell, give a friendly creature Defender until the end of the enemy player's next turn."}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC",this.code);return s.interactive=!0,r}handleAction(t){const e=f.ddf6(t);this.logAct(!1,e);const r=p.mod("DF",!0,t.param);r.expiry="EN",e.addMod(r),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;return e.playerA===t.owner&&I.getCard(e.cardCode).type==="S"}return!1}jr8(t){const e=p.crFriendNotMeActTarg("CARD",t.creatId,this.code,t.creatId);e.canDefender=!0;const r=w.toActions(e);r.length===0?x.triggerDone():(r.push(v.noneEndTrigger()),v.ddf5(r))}}class Yi extends P{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Steeleye Researcher",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.hints=["RD"],this.bonus={play:.5},this.text=`Upgrade: You may ${m.daluac()}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("UP",this.code);return s.interactive=!0,r}handleAction(t){M.levelAndDiscardA(t),v.actionDone(!0)}jr8(t){const e=p.lvlHandActTarg(this.code,t.creatId),r=w.toActions(e);r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}}class Ki extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steeleye Seer",this.iAttack=0,this.iHealth=this.lValN([8,12,18]),this.iDefend=!0,this.tribe.push("HM"),this.hints=["OL"];let e;this.level===3?(this.text="Activate: Level up a card in your hand. You may use this ability twice each turn.",e=1):(this.text="Activate: Level a card in your hand, then discard it if its level is higher than your Rank.",e=.5),this.bonus={exist:e}}jr3(t,e){const r=super.jr3(t,e);return this.level===3&&(r.jr4("TS",this.code),this.addExtraActivate(r)),r}jr8(t){if(t.trigger.type==="TS"){const e=f.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>I.getCard(r).canLevel())}startActivation(t){const e=p.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),r=k.toPlayer(e.owner);this.level===3||r.rank>parseInt(t.card.slice(3))?r.hand[t.position]=I.getCard(t.card).levelUpCard():M.levelAndDiscardA(t),e.endActivation()}}class Xi extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steelscale Dragon",this.iAttack=this.boof4812,this.iHealth=this.iAttack+2,this.tribe.push("RB","DG"),this.iMobile=this.level;const e=this.boof246;this.addSp("M",e),this.text=`While each other friendly creature has Defender, ${this.name} gets ${m.jr9(this.iAttack,0)}, Armor ${e}, and Breakthrough.`}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("DF",this.code);s.area="C";const h=r.addEffect("PS",this.code);return h.area="C",r}enforceEffect(t,e){const r=p.crNotMeTarg(e.id);if(r.player=k.toTarget(e.owner),f.creatByTarget(r).some(h=>!h.defender))e.removeModSafe(e.id);else{const h=p.mod("AT",this.iAttack,e.id),u=p.mod("AR",this.boof246,e.id),g=p.mod("BT",!0,e.id);e.addModSafe(h),e.addModSafe(u),e.addModSafe(g)}}}class qi extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Storm Bringer",this.iAttack=this.boof5814,this.iHealth=this.boof61018,this.tribe.push("WN","EL");const e=this.boof246;this.addSp("D",e),this.bonus={exist:this.ddp9(0,e+2,0,0)},this.text=`At the start of each turn, ${this.name} moves to an available lane at random. Flank: Deal ${e} damage to the opposing creature.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("TS",this.code),r.jr4("FK",this.code),r}ddf8(t){return t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="TS"){const e=f.emptyLanes(t.owner);e.length>0&&f.jr5(t.creatId).move(e[T.randInt(0,e.length)]),x.triggerDone()}else if(t.trigger.type==="FK"){const r=W.toCreature(t.event).creature.opposed;r&&r.hurtDirect(this.boof246,this.code),x.triggerDone()}else super.jr8(t)}}class ji extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Sulgrim, Herald of Force",this.iAttack=15,this.iHealth=15,this.tribe.push("GL"),this.addSp("M",6),this.text="Activate: Deal damage equal to a friendly creature's Armor to an enemy creature.~Forge: Each friendly creature gets Armor 6."}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=T.deTil(t.param),r=f.ddf6(t);if(e[1]==="P1"){const s=this.enemies(e[0],r.id);s.push(v.cancelAction()),v.ddf5(s)}else if(e[1]==="P2"){const s=f.jr5(e[0]),h=f.jr5(e[2]);this.logAct(!0,h),r.hurtDirect(h.armor,this.code),s.endActivation()}}jr8(t){f.ddf1().forEach(e=>e.addArmor(6)),x.triggerDone()}friends(t){const e=p.crFriendActTarg("CARD",this.code,T.enTil(t,"P1"));return e.hasArmor=!0,w.toActions(e)}enemies(t,e=""){const r=p.crEnemyActTarg("CARD",this.code,T.enTil(t,"P2",e));return w.toActions(r)}}class Ji extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Synapsis Oracle",this.iAttack=this.boof358,this.iHealth=this.lValN([9,15,24]),this.tribe.push("HM"),this.hints=["OL"];let e;this.level===3?(this.text="Activate: Level up a card in your hand.",e=1):(this.text=`Activate: ${m.daluac(!0)}.`,e=.5),this.bonus={exist:e}}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>I.getCard(r).canLevel())}startActivation(t){const e=p.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),v.ddf5(w.toActions([e,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=f.jr5(t.param),r=k.toPlayer(e.owner);this.level===3?r.hand[t.position]=I.getCard(t.card).levelUpCard():M.levelAndDiscardA(t),e.endActivation()}}class Qi extends bt{jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}jr8(t){if(t.trigger.type==="FR"){const e=t.owner?M.deathsA.length:M.deathsB.length;if(e>0){const r=N.tick();for(let s=0;s0}getCardActions(t,e){return w.toActions(p.crEnemyActTarg("CARD",this.code,"P2"))}}class ts extends P{constructor(t){super(t),this.rarity="C",this.faction="U",this.name="Toorgmai Mender",this.tribe.push("PL"),this.iAttack=this.lValN([2,5,9]),this.iHealth=this.iAttack+3,this.text=`Forge: Give a creature or player ${m.jr9(0,this.iHealth)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}jr8(t){const e=p.crActTarg("CARD",this.code,"");e.hint=["BF"];const r=p.actionTarget("TP","CARD",this.code,"");r.hint=["BF"];const s=[e,r,w.buttonTarget("NOTR")],h=w.toActions(s);v.ddf5(h)}handleAction(t){if(t.zone==="P")k.heal(t.playerA,this.iHealth);else{const e=f.ddf6(t);this.logAct(!1,e),e.buff(0,this.iHealth)}v.actionDone(!0)}}class Ze extends P{lookup(t){return{["SSD"]:{c:()=>this.ssdC(),t:r=>this.ssdT(r)},["SOL"]:{c:()=>this.stagC(),t:r=>this.stagT(r)},["WTK"]:{c:()=>this.tinkC(),t:r=>this.tinkT(r)}}[t]}mPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return r.jr4("TE",this.code),r}ddf8(t){return t.trigger.type==="TE"&&this.validPlayer(t)}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=t.event;return this.mPlayer===1?e.playerA===t.owner:e.playerA!==t.owner}ssdC(){this.faction="T",this.rarity="L",this.name="Smolderscale Dragon",this.iAttack=this.lValN([0,3,15]),this.iHealth=this.lValN([6,13,30]),this.tribe.push("DG"),this.level===3?this.iMobile=2:this.iDefend=!0,this.mPlayer=1;const t=this.boof135;this.text=`At the end of your turn, deal ${t} damage to each enemy creature.`}ssdT(t){const e=f.qEnemyCreats();if(e.length>0){const r=N.tick(),s=this.boof135;e.forEach(h=>h.hurtDirect(s,this.code,r))}}stagC(){this.faction="U",this.rarity="C",this.name="Stag of Lys",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("ST"),this.mPlayer=1;const t=this.boof246;this.text=`At the end of your turn, gain ${t} health.`}stagT(t){k.heal(t.owner,this.boof246)}tinkC(){this.faction="A",this.rarity="H",this.name="War Tinker",this.iAttack=this.level,this.iHealth=this.boof4812,this.tribe.push("GN"),this.mPlayer=-1,this.bonus={exist:this.ddp6()},this.text=`At the end of the enemy player's turn, replace ${this.name} with a copy of a random Robot from your deck.`}tinkT(t){const e=p.target("DK");e.player=k.toTarget(t.owner),e.tribe="RB";const r=w.deckByTarget(e),s=r.length;if(s>0){const h=r[T.randInt(0,s)][0],u=f.jr5(t.creatId);f.birth(h,"R",u.owner,u.lane)}}}class Ot extends P{lookup(t){return{["DCS"]:{c:()=>this.delphC(),t:r=>this.delphT(r)},["GMP"]:{c:()=>this.gmpC(),t:r=>this.gmpT(r)},["LBL"]:{c:()=>this.lbcC(),t:r=>this.lbcT(r)},["SBF"]:{c:()=>this.sfangC(),t:r=>this.sfangT(r)},["SSE"]:{c:()=>this.sseC(),t:r=>this.sseT(r)},["SPD"]:{c:()=>this.spdC(),t:r=>this.spdT(r)},["SPM"]:{c:()=>this.spmC(),t:r=>this.spmT(r)},["TBA"]:{c:()=>this.tbaC(),t:r=>this.tbaT(r)},["VCG"]:{c:()=>this.vgC(),t:r=>this.vgT(r)},["WBG"]:{c:()=>this.woeC(),t:r=>this.woeT(r)},["ZSH"]:{c:()=>this.zyxC(),t:r=>this.zyxT(r)}}[t]}bothTurns=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);r.jr4("TS",this.code);const s=St.extractCardCode(this.code);return(s==="ZSH"||s==="SBF")&&(r.extraBattles=1),r}ddf8(t){return t.trigger.type==="TS"?this.bothTurns?!0:t.event.playerA===t.owner:!1}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}delphC(){this.faction="A",this.rarity="L",this.name="Delpha, Chronosculptor",this.iAttack=this.boof7914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.level>1&&(this.hints=["OL"],this.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 e=k.toPlayer(t.owner),r=e.hand.map((h,u)=>{const g=I.getCard(h);return{idx:u,lvl:g.level,nxt:g.canLevel()?g.levelUpCard():""}}).filter(h=>h.nxt&&(this.level===3||h.lvl===1)),s=r.length;if(s>0){const h=r[T.randInt(0,s)];e.hand[h.idx]=h.nxt}}}gmpC(){this.faction="A",this.rarity="L",this.name="Ghox, Metamind Paragon",this.iAttack=this.boof4814,this.iHealth=this.boof61218,this.tribe.push("MM"),this.hints=["OL"];const t=this.level===1?"":"s";this.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){k.drawCard(t.owner,this.level)}lbcC(){this.faction="U",this.rarity="R",this.name="Lightbringer Cleric",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hints=["OL"],this.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){k.heal(t.owner,T.randInt(this.boof137,this.boof5914))}sfangC(){this.faction="T",this.rarity="H",this.name="Saberfang",this.iAttack=this.boof246,this.iHealth=1,this.iAggro=!0,this.tribe.push("CT"),this.text=`${this.name} battles an additional time on your turn.`}sfangT(t){const e=f.jr5(t.creatId);e.extraBattles+=1}sseC(){this.faction="U",this.rarity="L",this.name="Scatterspore Eidolon",this.iAttack=8,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=["DL"];const t=this.boof357,e=U.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} ${e}.`}sseT(t){const e=this.lValS(["SXD","SXP","SXT"])+this.level.toString();f.birth(e,"S",t.owner)}spdC(){this.faction="U",this.rarity="R",this.name="Shardplate Delver",this.iAttack=this.boof4612,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OL"];const t=this.boof246;this.bonus={exist:this.ddp9(0,t*2,t,0)},this.text=`At the start of your turn, ${this.name} gets ${m.jr9(t,t)}.`}spdT(t){const e=this.boof246;f.jr5(t.creatId).buff(e,e)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.iAttack=this.boof91421,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["OP"],this.text="At the start of your turn, randomly discard down to two cards in your hand."}spmT(t){const e=k.toPlayer(t.owner);if(e.hand.length>2){let r=e.hand.slice(),s=[];for(;r.length>2;)s.push(r.splice(T.randInt(0,r.length),1)[0]);e.discard.push(...s),e.hand=r}}tbaC(){this.faction="U",this.rarity="L",this.name="Talisin, Bard of Abundance",this.iAttack=this.lValN([8,12,16]),this.iHealth=this.lValN([10,14,20]),this.tribe.push("SY"),this.bothTurns=this.lValB([!0,!0,!1]),this.hints=["OL"],this.level===3&&(this.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){M.regularPlays+=1}vgC(){this.faction="T",this.rarity="C",this.name="Volcanic Giant",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("ER","GT"),this.hints=["OL"],this.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 e=T.randInt(this.boof137,this.boof5914);k.hurtDirect(!t.owner,e,this.code)}woeC(){this.faction="N",this.rarity="L",this.name="Woebringer",this.iAttack=this.lValN([7,10,18]),this.iHealth=this.boof5815,this.tribe.push("AB"),this.text=`At the start of your turn, destroy the ${this.level===3?"enemy ":""}creature with the lowest attack. If there is a tie, one is chosen at random.`}woeT(t){const e=p.crTarg();this.level===3&&(e.player=k.toTarget(!t.owner));const r=f.creatByTarget(e);let s=99999,h=[];r.forEach(g=>{g.attack===s?h.push(g):g.attack0){const g=h[T.randInt(0,u)];O.destroy(g,this.code)}}zyxC(){this.faction="T",this.rarity="L",this.name="Zyx, Storm Herald",this.iAttack=this.boof4712,this.iHealth=this.lValN([6,9,20]),this.iMobile=1,this.tribe.push("LT","AS"),this.text="Zyx battles an additional time on your turn."}zyxT(t){const e=f.jr5(t.creatId);e.extraBattles+=1}}class es extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Tuskin Sporelord",this.iAttack=this.lValN([2,6,10]),this.iHealth=this.lValN([10,14,18]),this.tribe.push("TK"),this.text=`Activate: Put a copy of friendly ${m.levelGateText(this.level,!0)}Plant into an available lane.`,this.bonus={exist:this.ddp6(this.level)/2}}canActivate(t){return this.emptySloots(t.id).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=this.emptySloots(e[1],r.code);s.push(v.cancelAction()),v.ddf5(s)}else{const r=f.jr5(e[1]),s=f.birth(e[2],"P",r.owner,t.lane);this.logAct(!0,s),r.endActivation()}}emptySloots(t,e=""){const r=p.emptyPlayerActTarg("F","CARD",this.code,T.enTil("P2",t,e));return w.toActions(r)}buddies(t){const e=p.crFriendActTarg("CARD",this.code,T.enTil("P1",t));return e.tribe="PL",e.level=w.ddf2(this.level),w.toActions(e)}}class or extends yt{constructor(t){super(t),this.faction="A",t==="PRI"+"1"?(this.rarity="R",this.name="Perilous Insight",this.maxLevel=1,this.overload=!0):(this.rarity="C",this.name="Metasight",this.maxLevel=2,this.isFree=this.level===2),this.text="Discard and level up two cards."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(v.shiftPlayCard(t.position),t.param==="P1"){this.logSpell(),M.levelAndDiscardA(t);const e=this.targParty("P2"),r=w.toActions(e);r.length===0?v.spellCast():v.ddf5(r)}else M.levelAndDiscardA(t),v.spellCast()}targParty(t){const e=p.lvlHandActTarg(this.code,t);return e.deckPositionSkip=v.playPosition(),e}}class Me extends yt{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(r,s)=>this.confZ(r,s)},["CSG"]:{c:()=>this.cystgC(),z:(r,s)=>this.cystgZ(r,s)},["GRN"]:{c:()=>this.grenC(),z:(r,s)=>this.grenZ(r,s)},["TWG"]:{c:()=>this.twstrC(),z:(r,s)=>this.twstrZ(r,s)}}[t]}cardCast(t,e,r){this.lookup(t).z(e,r)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=p.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",f.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const e=T.deTil(t.param),r=f.ddf6(t);if(e[0]==="P1"){this.playTarg.notMe=r.id,this.playTarg.param=T.enTil("P2",r.id);const s=w.toActions([this.playTarg,w.buttonTarget("CANC")]);v.ddf5(s)}else{const s=f.jr5(e[1]);this.xl?this.logSpell(s,r):this.logSpell(),this.cardCast(this.cardCode(),s,r),v.spellCast()}}confC(){this.faction="T",this.rarity="C",this.name="Conflagrate",this.xl=!1,this.text=`Deal ${this.boof369} to two enemy creatures.`,this.playTarg.player="E"}confZ(t,e){const r=N.tick(),s=this.boof369;t.hurtDirect(s,this.code,r),e.hurtDirect(s,this.code,r)}cystgC(){this.faction="A",this.rarity="C",this.name="Cypien Steelgraft",this.text=`Two friendly creatures get Armor ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canArmor=!0}cystgZ(t,e){const r=this.boof246;t.addArmor(r),e.addArmor(r)}grenC(){this.faction="N",this.rarity="C",this.name="Ghastly Renewal",this.text=`Give two friendly creatures Regenerate ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canRegen=!0}grenZ(t,e){const r=this.boof246;t.addRegen(r),e.addRegen(r)}get tsboof(){return this.level+2}twstrC(){this.faction="U",this.rarity="C",this.name="Twinstrength";const t=this.tsboof;this.text=`Two friendly creatures get ${m.jr9(t,t)}.`,this.playTarg.player="F"}twstrZ(t,e){const r=this.tsboof;t.buff(r,r),e.buff(r,r)}}class rs extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Umbruk Icecrusher",this.iAttack=this.boof61014,this.iHealth=this.boof246,this.tribe.push("DN"),this.bonus={exist:this.ddp9(0,5,this.iAttack+2,0)},this.text=`When ${this.name} ${m.dbdtap()}, deal that much damage to that player.~Allied Uterra: This gets ${m.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}return!1}jr8(t){if(t.trigger.type==="FR"){if(M.allied("U")){const e=f.jr5(t.creatId);e.breakthrough=!0,e.buff(2,2)}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event;k.hurtDirect(e.target,e.dmg,this.code),x.triggerDone()}}}class is extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Umbruk Lasher",this.iAttack=this.boof71014,this.iHealth=this.iAttack-1,this.iBT=!0,this.tribe.push("DN"),this.text=`Allied Tempys: When ${this.name} ${m.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.ddp9(0,this.iAttack,0,0)}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR",this.code),r}handleAction(t){f.ddf6(t).hurtDirect(parseInt(t.param),this.code),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}return!1}jr8(t){if(t.trigger.type==="FR"){if(M.allied("T")){const e=f.jr5(t.creatId),r=e.jr4("DM",this.code);r.interactive=!0,e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,r=w.toActions(p.crEnemyActTarg("CARD",this.code,e.dmg.toString()));r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}}}class Re extends P{lookup(t){return{["CBB"]:{c:()=>this.cindC(),f:r=>this.cindF(r)},["EBW"]:{c:()=>this.ebwC(),f:r=>this.ebwF(r)},["IBR"]:{c:()=>this.ibrfC(),f:r=>this.ibrfF(r)},["SBI"]:{c:()=>this.sbiC(),f:r=>this.sbiF(r)}}[t]}targAction(t,e){this.lookup(t).f(e)}enemy=!1;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text=`Forge: If you are rank ${this.level+1} or higher, `+this.ftext,this.ftext=""}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}handleAction(t){const e=f.ddf6(t);this.targAction(this.cardCode(),e),v.actionDone(!0)}jr8(t){if(f.jr5(t.creatId).rank>this.level){const r=p.crActTarg("CARD",this.code,t.creatId);this.enemy?r.player="E":r.hint=["BF"];const s=w.toActions(r);s.length>0?v.ddf5(s):x.triggerDone()}else x.triggerDone()}ebwC(){this.faction="N",this.rarity="C",this.name="Ebonbound Warlord",this.iAttack=this.boof3714,this.iHealth=this.iAttack+4,this.tribe.push("VP"),this.enemy=!0;const t=this.boof369n;this.ftext=`give an enemy creature ${m.jr9(t,t)}.`}ebwF(t){this.logAct(!1,t);const e=this.boof369n;t.buff(e,e)}sbiC(){this.faction="U",this.rarity="C",this.name="Shardbound Invoker",this.iAttack=this.boof4714,this.iHealth=this.iAttack+1,this.tribe.push("TK");const t=this.boof359;this.ftext=`give a creature ${m.jr9(t,t)}.`}sbiF(t){this.logAct(!1,t);const e=this.boof359;t.buff(e,e)}cindC(){this.faction="T",this.rarity="C",this.name="Cinderbound Barbarian",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("FR","AS");const t=this.boof6912;this.enemy=!0,this.ftext=`deal ${t} damage to an enemy creature.`}cindF(t){t.hurtDirect(this.boof6912,this.code)}ibrfC(){this.faction="A",this.rarity="C",this.name="Ironbound Reinforcements",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("GN");const t=this.boof5812;this.ftext=`give a creature ${m.jr9(t,0)}.`}ibrfF(t){this.logAct(!1,t),t.buff(this.boof5812,0)}}class ss extends P{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Uranti Elementalist",this.iAttack=this.boof4712,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.text=`Forge: You may move another friendly creature to an available lane adjacent to ${this.name}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}jr8(t){const e=f.jr5(t.creatId);if(this.emptySloots(e).length>0){const r=p.crFriendNotMeActTarg("CARD",e.id,this.code,T.enTil("P1",e.id)),s=w.toActions(r);s.length>0?(s.push(v.noneEndTrigger()),v.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")v.ddf5(this.getCardActions(t));else{const r=f.jr5(e[1]);this.logAct(!1,r),r.move(t.lane),v.actionDone(!0)}}emptySloots(t,e=""){return v.emptyAdjacents(t,T.enTil("P2",e))}getCardActions(t,e){const r=T.deTil(t.param),s=f.ddf6(t),h=f.jr5(r[1]),u=this.emptySloots(h,s.id);return u.push(v.cancelAction()),u}}class as extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Uranti Heartseeker",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("YT"),this.addSp("D",this.iAttack),this.text=`Activate: Deal ${this.iAttack} damage to an enemy creature or player with exactly ${this.iAttack} health.`}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){const e=this.findVictims(t.id);e.push(v.cancelAction()),v.ddf5(e)}handleAction(t){if(t.zone==="F"){const r=f.ddf6(t);this.logAct(!0,r),r.hurtDirect(this.iAttack,this.code)}else{this.logAct(!0);const r=t;k.hurtDirect(r.playerA,this.iAttack,this.code)}f.jr5(t.param).endActivation()}findVictims(t){const e=this.iAttack,r=p.crEnemyTarg(),h=f.creatByTarget(r).filter(g=>g.health===e).map(g=>p.fieldSelectAction("CARD",g.lane,g.owner)),u=k.toPlayer("E");return u.health===e&&h.push(p.playerSelectAction("CARD",u.isPlayerA)),h.forEach(g=>{g.host=this.code,g.param=t}),h}}class ns extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Vaerus, Herald of Fury",this.iAttack=15,this.iHealth=12,this.iMobile=2,this.tribe.push("DG"),this.hints=["OL"],this.text="Each friendly creature battles an additional time on each of your turns.",this.bonus={exist:this.ddp9(0,0,30,0)}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("EF",this.code),r.jr4("TS",this.code),r}ddf8(t){if(t.event.code==="ENT"){const e=W.toCreature(t.event);return t.owner===e.creature.owner&&t.owner===k.getActiveB()}else if(t.event.code==="TRS")return t.event.playerA===t.owner;return!1}giveXtra(t,e){t.hasMod(e)||(t.extraBattles+=1,t.addMod(p.mod("TK",!0,e)))}jr8(t){if(t.event.code==="ENT"){const e=W.toCreature(t.event);e.creature.id===t.creatId?f.ddf1().forEach(r=>{this.giveXtra(r,t.creatId)}):bt.itBirthedFirst(e.creature.id,t.creatId)&&this.giveXtra(e.creature,t.creatId)}else t.event.code==="TRS"&&f.ddf1().forEach(e=>{e.extraBattles+=1,e.hasMod(t.creatId)||e.addMod(p.mod("TK",!0,t.creatId))});x.triggerDone()}}class G extends P{constructor(t){super(t),this.cardConstruct(this.cardCode())}cardConstruct(t){({["AEN"]:()=>this.anvenf(),["AGU"]:()=>this.avguard(),["BTH"]:()=>this.batthid(),["BBB"]:()=>this.bart(),["BLW"]:()=>this.blitwi(),["BWG"]:()=>this.brambleguard(),["CHY"]:()=>this.cavernhyd(),["CDC"]:()=>this.cindcol(),["CNM"]:()=>this.cindmy(),["CTG"]:()=>this.citg(),["CWK"]:()=>this.crag(),["DBP"]:()=>this.prowler(),["DMR"]:()=>this.raptor(),["DBR"]:()=>this.bearride(),["DTD"]:()=>this.dmaw(),["DSZ"]:()=>this.duskzomb(),["FWB"]:()=>this.fangbear(),["FWR"]:()=>this.ravager(),["FFG"]:()=>this.ffang(),["FMS"]:()=>this.firemane(),["FPR"]:()=>this.flop(),["FGA"]:()=>this.falpha(),["FGB"]:()=>this.fbeta(),["FGO"]:()=>this.fomega(),["FPM"]:()=>this.minot(),["FPS"]:()=>this.forgeplate(),["GGE"]:()=>this.geist(),["GGH"]:()=>this.ghast(),["GGS"]:()=>this.ggs(),["GCL"]:()=>this.glacial(),["IWC"]:()=>this.warcharger(),["LWY"]:()=>this.lwyrm(),["LHY"]:()=>this.lyshyd(),["KDC"]:()=>this.kadc(),["MRF"]:()=>this.marrow(),["MMI"]:()=>this.mmin(),["MMO"]:()=>this.mmop(),["NGW"]:()=>this.narg(),["NCW"]:()=>this.necrotic(),["NXC"]:()=>this.nexcore(),["NAM"]:()=>this.nyam(),["OBD"]:()=>this.battledroid(),["OSP"]:()=>this.oss(),["OSL"]:()=>this.ogsl(),["PRG"]:()=>this.perd(),["RHY"]:()=>this.ravh(),["RHC"]:()=>this.rime(),["RSP"]:()=>this.runprim(),["SCS"]:()=>this.scorp(),["SCD"]:()=>this.scout(),["SFT"]:()=>this.scrap(),["SBA"]:()=>this.sparkblade(),["SKB"]:()=>this.sparkbot(),["SBR"]:()=>this.sparkass(),["STM"]:()=>this.sparkman(),["SSN"]:()=>this.sfsent(),["SMN"]:()=>this.steam(),["SGI"]:()=>this.stonefist(),["SCL"]:()=>this.stormcall(),["SMA"]:()=>this.ancient(),["SML"]:()=>this.lurker(),["TGS"]:()=>this.tsprout(),["TGN"]:()=>this.tgnome(),["TWS"]:()=>this.tscout(),["TWT"]:()=>this.tund(),["URD"]:()=>this.unrelenting(),["VBK"]:()=>this.vblock(),["VTC"]:()=>this.vtech(),["WTW"]:()=>this.waterwalk(),["WPD"]:()=>this.windprime(),["XCR"]:()=>this.xithcrush(),["XHU"]:()=>this.hulk(),["YWC"]:()=>this.yetiwar(),["ZIN"]:()=>this.zombinf()})[t]()}sist(){this.rarity="R",this.level===1?this.hints=["LV"]:this.consistent=!0}ancient(){this.faction="U",this.rarity="C",this.name="Swampmoss Ancient",this.iAttack=this.lValN([7,12]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.maxLevel=2}anvenf(){this.faction="A",this.rarity="C",this.name="Anvillon Enforcer",this.iAttack=this.boof5711,this.iHealth=this.iAttack-1,this.iArmor=this.boof246,this.tribe.push("RB")}avguard(){this.faction="T",this.rarity="R",this.name="Avalanche Guardian",this.iAttack=this.boof5915,this.iHealth=this.lValN([8,15,23]),this.iMobile=1,this.iDefend=!0,this.tribe.push("IC","EL")}bart(){this.faction="U",this.rarity="H",this.name="Big Bad Bartok",this.iAttack=this.level+8,this.iHealth=this.iAttack,this.consistent=!0,this.hints=["DL"],this.tribe.push("TG")}batthid(){this.faction="U",this.name="Batterhide",this.iAttack=this.boof3814,this.iHealth=this.iAttack+3,this.sist(),this.iBT=!0,this.tribe.push("DN")}battledroid(){this.faction="A",this.rarity="H",this.name="Oreian Battledroid",this.iAttack=this.lValN([5,7,17]),this.iHealth=1,this.iArmor=this.iAttack,this.tribe.push("RB")}bearride(){this.faction="U",this.rarity="C",this.name="Deepwood Bear Rider",this.iAttack=this.lValN([5,16,18]),this.iHealth=this.lValN([2,8,10]),this.tribe.push("LP")}blitwi(){this.faction="N",this.name="Blight Witch",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.boof71117,this.sist(),this.iRegen=this.boof234,this.tribe.push("ZB")}brambleguard(){this.faction="U",this.rarity="C",this.name="Bramblewood Guardian",this.iAttack=this.boof2612,this.iHealth=this.lValN([9,14,24]),this.tribe.push("PL")}cavernhyd(){this.faction="U",this.rarity="C",this.name="Cavern Hydra",this.iAttack=this.boof4711,this.iHealth=this.boof71015,this.iRegen=this.boof135,this.tribe.push("HY")}cindcol(){this.faction="T",this.rarity="C",this.name="Cinder Colossus",this.iAttack=this.lValN([3,13,24]),this.iHealth=this.lValN([4,14,27]),this.iDefend=!0,this.level===1&&(this.hints=["LV"]),this.tribe.push("ER","EL")}cindmy(){this.faction="T",this.rarity="C",this.name="Cinder Mystic",this.iAttack=this.lValN([4,11,21]),this.iHealth=this.boof3714,this.tribe.push("FR","AS")}citg(){this.faction="A",this.rarity="C",this.name="Citadel Guard",this.iAttack=this.lValN([8,12,25]),this.iHealth=this.lValN([9,13,30]),this.iDefend=!0,this.tribe.push("RB")}crag(){this.faction="T",this.rarity="C",this.name="Crag Walker",this.iAttack=this.lValN([7,12,18]),this.iHealth=this.boof246,this.iMobile=1,this.tribe.push("DN")}dmaw(){this.faction="N",this.rarity="L",this.name="Duskmaw, Twilight Drake",this.iAttack=this.boof61017,this.iHealth=this.boof5915,this.iMobile=1,this.tribe.push("ST","DG")}duskzomb(){this.faction="N",this.rarity="C",this.name="Duskspire Zombie",this.iAttack=this.lValN([2,5,16]),this.iHealth=this.lValN([5,8,19]),this.iRegen=4,this.tribe.push("ZB")}falpha(){this.faction="A",this.rarity="C",this.name="Forge Guardian Alpha",this.iAttack=this.lValN([4,8,20]),this.iHealth=this.lValN([8,14,26]),this.iDefend=!0,this.tribe.push("RB","GD")}fangbear(){this.faction="U",this.rarity="C",this.name="Fangwood Bear",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("BR")}fbeta(){this.faction="A",this.rarity="R",this.name="Forge Guardian Beta",this.iAttack=this.lValN([5,8,20]),this.iHealth=this.lValN([3,6,18]),this.iArmor=this.boof124,this.tribe.push("RB","GD")}ffang(){this.faction="U",this.rarity="C",this.name="Featherfang",this.iAttack=this.boof61218,this.iHealth=this.boof4812,this.tribe.push("DN")}firemane(){this.faction="T",this.rarity="C",this.name="Firemane Steed",this.iAttack=this.lValN([3,6,16]),this.iHealth=this.lValN([6,9,19]),this.iMobile=2,this.tribe.push("FR","EL")}flop(){this.faction="T",this.rarity="C",this.name="Flowstone Primordial",this.iAttack=this.lValN([6,7,15]),this.iHealth=this.iAttack+1,this.tribe.push("FR","EL")}fomega(){this.faction="A",this.rarity="L",this.name="Forge Guardian Omega",this.iAttack=this.boof255080,this.iHealth=this.iAttack,this.iMobile=this.boof124,this.iArmor=this.iMobile*10,this.iBT=!0,this.iAggro=!0,this.consistent=!0,this.tribe.push("RB","GD")}forgeplate(){this.faction="A",this.rarity="C",this.name="Forgeplate Sentry",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iArmor=this.boof135,this.tribe.push("RB")}ggs(){this.faction="N",this.rarity="C",this.name="Grimgaunt Spectre",this.iAttack=this.lValN([3,11,14]),this.iHealth=this.iAttack,this.iMobile=1,this.hints=["LV"],this.tribe.push("GG")}geist(){this.faction="N",this.rarity="C",this.name="Grave Geist",this.iAttack=this.boof71118,this.iHealth=this.boof4711,this.tribe.push("ST")}ghast(){this.faction="N",this.rarity="C",this.name="Grave Ghast",this.iHealth=this.boof71013,this.iAttack=this.iHealth-2,this.iRegen=this.boof246,this.tribe.push("ZB")}glacial(){this.faction="T",this.rarity="C",this.name="Glacial Colossus",this.iAttack=this.boof61016,this.iHealth=this.lValN([8,13,19]),this.tribe.push("IC","EL"),this.iDefend=!0}hulk(){this.faction="N",this.rarity="C",this.name="Xithian Hulk",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("AB")}kadc(){this.faction="T",this.rarity="C",this.name="Kadras Colossus",this.iAttack=this.lValN([6,11,13]),this.iHealth=this.iAttack,this.tribe.push("GT"),this.hints=["DL"]}lurker(){this.faction="U",this.rarity="C",this.name="Swampmoss Lurker",this.iAttack=this.lValN([8,13,22]),this.iHealth=this.lValN([4,6,15]),this.tribe.push("DN")}lwyrm(){this.faction="T",this.rarity="C",this.name="Lightning Wyrm",this.iAttack=this.boof4711,this.iHealth=this.boof258,this.tribe.push("LT","EL"),this.iAggro=!0}lyshyd(){this.faction="U",this.rarity="C",this.name="Lysian Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.level,this.tribe.push("HY")}marrow(){this.faction="N",this.rarity="C",this.name="Marrow Fiend",this.iAttack=this.boof81117,this.iHealth=this.lValN([1,5,13]),this.tribe.push("SK")}minot(){this.faction="A",this.name="Forgeplate Minotaur",this.iAttack=this.lValN([2,8,16]),this.iHealth=this.lValN([4,9,17]),this.sist(),this.iArmor=this.level,this.tribe.push("RB")}mmin(){this.faction="A",this.rarity="C",this.name="Metamind Infiltrator",this.iAttack=this.boof5917,this.iHealth=this.iAttack-1,this.tribe.push("MM")}mmop(){this.faction="A",this.rarity="C",this.name="Metamind Operator",this.iAttack=this.boof4610,this.iHealth=this.lValN([10,14,18]),this.tribe.push("MM")}narg(){this.faction="T",this.rarity="C",this.name="Nargath Warrior",this.iAttack=this.boof51014,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS")}necrotic(){this.faction="N",this.rarity="C",this.name="Necrotic Wurm",this.iAttack=this.lValN([4,7,18]),this.iHealth=this.lValN([5,8,19]),this.tribe.push("WR")}nexcore(){this.faction="A",this.rarity="C",this.name="Nexus Core",this.iAttack=0,this.iHealth=this.lValN([15,25,40]),this.tribe.push("RB"),this.iDefend=!0}nyam(){this.faction="N",this.rarity="C",this.name="Nyrali Ambusher",this.iAttack=this.boof71117,this.iHealth=this.lValN([3,6,13]),this.tribe.push("OZ")}ogsl(){this.faction="U",this.rarity="C",this.name="Overgrown Spineleaf",this.iAttack=this.lValN([6,12,16]),this.iHealth=this.boof4812,this.tribe.push("PL")}oss(){this.faction="N",this.rarity="R",this.name="Ossuary Spirit",this.iAttack=this.lValN([1,3,6]),this.iHealth=this.boof91420,this.iRegen=this.iAttack+2,this.tribe.push("ST")}perd(){this.faction="N",this.rarity="C",this.name="Perdition Guard",this.iAttack=this.lValN([3,12,15]),this.iHealth=this.iAttack-1,this.tribe.push("NG")}prowler(){this.faction="U",this.rarity="C",this.name="Deepbranch Prowler",this.iAttack=this.lValN([8,9,10]),this.iHealth=this.iAttack,this.tribe.push("CT"),this.hints=["DL"],this.iBT=!0}raptor(){this.faction="U",this.rarity="C",this.name="Deepmoss Raptor",this.iAttack=this.lValN([2,13,16]),this.iHealth=this.iAttack,this.level===1&&(this.hints=["LV","RT"]),this.tribe.push("DN")}ravager(){this.faction="U",this.rarity="C",this.name="Fangwood Ravager",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("BE")}ravh(){this.faction="U",this.rarity="C",this.name="Ravenous Hydra",this.iAttack=this.boof5813,this.iHealth=this.iAttack+this.level,this.iRegen=this.level,this.iBT=!0,this.tribe.push("HY")}rime(){this.faction="T",this.rarity="C",this.name="Rimehorn Charger",this.iAttack=this.lValN([5,8,10]),this.iHealth=this.iAttack+3,this.iMobile=1,this.hints=["DL"],this.tribe.push("RM")}runprim(){this.faction="T",this.name="Runestorm Primordial",this.iAttack=this.boof3714,this.iHealth=this.iAttack-1,this.sist(),this.iAggro=!0,this.tribe.push("LT","EL")}scorp(){this.faction="N",this.rarity="C",this.name="Scavenger Scorpion",this.iAttack=this.lValN([6,9,11]),this.iHealth=this.iAttack,this.iRegen=this.level,this.hints=["DL"],this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.isFree=this.level>1,this.hints=[this.level===1?"LV":"DL"],this.tribe.push("RB")}scrap(){this.faction="A",this.rarity="H",this.name="Scrapforge Titan",this.iAttack=this.lValN([1,5,20]),this.iHealth=this.iAttack,this.iArmor=this.lValN([1,5,10]),this.level===1&&(this.hints=["LV","RT"]),this.tribe.push("RB")}sfsent(){this.faction="A",this.rarity="C",this.name="Spiritforge Sentinel",this.iAttack=this.lValN([3,6,9]),this.iHealth=this.iAttack*2,this.iArmor=this.lValN([1,2,6]),this.tribe.push("RB")}sparkbot(){this.faction="A",this.rarity="C",this.name="Spark Bot",this.iAttack=this.boof5914,this.iHealth=this.lValN([6,11,16]),this.tribe.push("RB")}sparkblade(){this.faction="A",this.rarity="C",this.name="Sparkblade Assassin",this.iAttack=this.lValN([4,12,14]),this.iHealth=this.lValN([5,13,15]),this.tribe.push("HM")}sparkass(){this.faction="T",this.rarity="C",this.name="Sparkbrand Asir",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.lValN([6,11,13]),this.iAggro=!0,this.tribe.push("LT","AS")}sparkman(){this.faction="T",this.rarity="R",this.name="Sparktail Manticore",this.iAttack=this.boof369,this.iHealth=this.boof71116,this.iAggro=!0,this.iMobile=1,this.tribe.push("MT")}steam(){this.faction="T",this.rarity="C",this.name="Steam Sentinel",this.iAttack=this.lValN([8,14,20]),this.iHealth=this.boof61016,this.iDefend=!0,this.tribe.push("WT","EL")}stonefist(){this.faction="T",this.rarity="C",this.name="Stonefist Giant",this.iAttack=this.lValN([3,7,16]),this.iHealth=this.lValN([6,10,24]),this.tribe.push("ER","EL")}stormcall(){this.faction="T",this.rarity="C",this.name="Storm Caller",this.iAttack=this.lValN([8,11,14]),this.iHealth=this.iAttack-2,this.tribe.push("WN","AS")}tgnome(){this.faction="A",this.rarity="C",this.name="Technognome",this.iAttack=this.lValN([3,9,19]),this.iHealth=this.iAttack,this.level===1&&(this.hints=["LV"]),this.tribe.push("GN")}tscout(){this.faction="A",this.rarity="C",this.name="Tower Scout",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("HM")}tund(){this.faction="A",this.rarity="C",this.name="Tundra Watcher",this.iAttack=this.lValN([5,10,12]),this.iHealth=this.lValN([8,11,13]),this.hints=["DL"],this.tribe.push("RB")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.iAttack=this.boof7911,this.iHealth=this.iAttack+1,this.hints=["DL"],this.tribe.push("PL")}unrelenting(){this.faction="N",this.rarity="H",this.name="Unrelenting Dead",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.iRegen=this.iAttack,this.tribe.push("ZB")}vblock(){this.faction="A",this.rarity="R",this.name="Vault Blockade",this.iAttack=0,this.iHealth=this.boof135,this.iArmor=this.boof101520,this.iDefend=!0,this.tribe.push("RB")}vtech(){this.faction="A",this.rarity="C",this.name="Vault Technician",this.iAttack=this.boof61218,this.iHealth=this.boof3915,this.tribe.push("HM")}warcharger(){this.faction="A",this.rarity="C",this.name="Ionic Warcharger",this.iAttack=this.boof4915,this.iHealth=this.lValN([7,12,18]),this.iMobile=1,this.tribe.push("RB")}waterwalk(){this.faction="T",this.rarity="C",this.name="Water Walker",this.iAttack=this.lValN([5,12,14]),this.iHealth=this.lValN([2,9,11]),this.tribe.push("WT","AS")}windprime(){this.faction="T",this.rarity="C",this.name="Wind Primordial",this.iHealth=this.boof4814,this.iAttack=this.iHealth+2,this.iMobile=this.level,this.tribe.push("WN","EL")}xithcrush(){this.faction="N",this.rarity="C",this.name="Xithian Crusher",this.iAttack=this.lValN([4,10,16]),this.iHealth=this.iAttack+2,this.tribe.push("AB")}yetiwar(){this.faction="T",this.rarity="C",this.name="Yeti Warcaller",this.iAttack=this.boof248,this.iHealth=this.lValN([10,15,23]),this.tribe.push("YT")}zombinf(){this.faction="N",this.rarity="C",this.name="Zombie Infantry",this.iAttack=this.boof61015,this.iHealth=this.iAttack-1,this.tribe.push("ZB")}}class os extends yt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Varna's Pact";const e=this.lValS(["a","two","three"]),r=this.level===1?"":"s",s=this.level===1?"was":"were";this.text=`Put ${e} random creature${r} that ${s} destroyed this game into ${e} lane${r}.`}playTargets(){const t=super.playTargets();return t.push(this.fieldTarget("P1",[])),t}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1")if(this.level===1)this.endSpell([t.lane],t.playerA);else{const r=this.fieldTarget("P2",[t.lane]);v.ddf5(w.toActions(r))}else if(e[0]==="P2"){const r=[t.lane,parseInt(e[1])];if(this.level===2)this.endSpell(r,t.playerA);else{const s=this.fieldTarget("P3",r);v.ddf5(w.toActions(s))}}else this.endSpell([t.lane,parseInt(e[1]),parseInt(e[2])],t.playerA)}endSpell(t,e){this.logSpell();const r=N.tick();t.forEach(s=>{const h=O.gravedigger();h&&f.birth(h,"R",e,s,r)}),v.spellCast()}fieldTarget(t,e){const r=p.actionTarget("TF","CARD",this.code,T.enTil(t,...e));return r.player="F",r.hint=["FL"],r.lanes=f.laneIdx.filter(s=>!e.includes(s)),r}}class hs extends ge{jr3(t,e){const r=super.jr3(t,e);return r.jr4("LG",this.code),r}ddf8(t){const e=t.event;return t.trigger.type==="LG"&&t.owner===e.playerA}jr8(t){const e=t.event,r=this.boof124*e.healAmt;f.jr5(t.creatId).buff(r,r),x.triggerDone()}}class ls extends P{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Wildwood Sower",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,11,18]),this.tribe.push("HM");const e=U.minionBuff(this.level);this.text=`When you play a spell, you may put a ${e}/${e} ${U.minionName(this.level)} into an available lane.`,this.bonus={exist:this.ddp9(1,e*2,e,0)*.5}}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC",this.code);return s.interactive=!0,r}handleAction(t){f.birth(U.minionCode(this.level),"P",t.playerA,t.lane),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="PC"){const e=t.event;return e.playerA===t.owner&&I.getCard(e.cardCode).type==="S"}return!1}jr8(t){const e=p.emptyPlayerActTarg("F","CARD",this.code,""),r=w.toActions(e);r.length===0?x.triggerDone():(r.push(v.noneEndTrigger()),v.ddf5(r))}}class cs extends P{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Windcaller Shaman",this.iAttack=this.boof3713,this.iHealth=this.iAttack+4,this.tribe.push("WN","AS"),this.text=`Forge: You may move another friendly ${m.levelGateText(this.level,!0)}creature to an available lane adjacent to ${this.name}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR",this.code);return s.interactive=!0,r}jr8(t){const e=f.jr5(t.creatId);if(this.emptySloots(e).length>0){const r=p.crFriendNotMeActTarg("CARD",e.id,this.code,T.enTil("P1",e.id));r.level=w.ddf2(this.level);const s=w.toActions(r);s.length>0?(s.push(v.noneEndTrigger()),v.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=T.deTil(t.param);if(e[0]==="P1"){const r=f.ddf6(t),s=f.jr5(e[1]),h=this.emptySloots(s,r.id);h.push(v.cancelAction()),v.ddf5(h)}else{const r=f.jr5(e[1]);this.logAct(!1,r),r.move(t.lane),v.actionDone(!0)}}emptySloots(t,e=""){return v.emptyAdjacents(t,T.enTil("P2",e))}}class ds extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Windspark Elemental",this.iAttack=this.boof258,this.iHealth=this.lValN([7,14,21]),this.tribe.push("LT","EL"),this.text=`When an enemy creature is delt non-battle damage, deal ${this.boof246} damage to the enemy player.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("DM",this.code),r}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return!e.battle&&e.isCreatTarg&&e.hurtCreat.owner!==t.owner}return!1}jr8(t){k.hurtDirect(!t.owner,this.boof246,this.code),x.triggerDone()}}class us extends P{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Xithian Rotfiend",this.iAttack=this.lValN([7,12,20]),this.iHealth=this.iAttack+1,this.tribe.push("AB");const e=-this.boof135;this.text=`When ${this.name} becomes opposed, it gets ${m.jr9(e,e)}.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("EF",this.code),r.jr4("MV",this.code),r}ddf8(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const e=W.toCreature(t.event);return t.trigger.creatId===e.creature.id&&t.trigger.type==="MV"||e.creature.owner!==t.owner}return!1}jr8(t){let e=!1;const r=f.jr5(t.creatId),s=W.toCreature(t.event);if((r.id===s.creature.id&&r.opposed||s.creature.lane===f.oppositeLane(r.lane))&&(e=!0),e){const h=-this.boof135;r.buff(h,h)}x.triggerDone()}}class fs extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Zarox, the Raging",this.iAttack=this.lValN([2,4,10]),this.iHealth=this.lValN([8,12,18]),this.tribe.push("FR","EL"),this.text=`When Zaxox ${m.dbdtap()} on your turn, you may deal that much damage to an enemy creature.~Allied Nekrium: When a creature is destroyed, Zarox gets ${m.jr9(this.boof124,0)}.`}jr3(t,e){const r=super.jr3(t,e);r.jr4("FR",this.code);const s=r.jr4("DM",this.code);return s.interactive=!0,r}handleAction(t){f.ddf6(t).hurtDirect(parseInt(t.param),this.code),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=W.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}else if(t.trigger.type==="DS")return!0;return!1}jr8(t){if(t.trigger.type==="FR"){if(M.allied("N")){const e=f.jr5(t.creatId);e.jr4("DS",this.code),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,r=w.toActions(p.crEnemyActTarg("CARD",this.code,e.dmg.toString()));r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}else if(t.trigger.type==="DS"){const e=f.jr5(t.creatId);this.logAct(!1),e.buff(this.boof124,0),x.triggerDone()}}}class gs extends P{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Zombie Titan",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("ZB");const e=this.boof234;this.text=`While ${this.name} is in a side lane, it gets ${m.jr9(e,e,!0)} and Regenerate ${this.level}.`}jr3(t,e){const r=super.jr3(t,e),s=r.addEffect("PS",this.code);return s.area="C",r}enforceEffect(t,e){if(e.lane===1||e.lane===5){const r=this.boof234;[p.mod("AT",r,e.id),p.mod("HL",r,e.id),p.mod("MH",r,e.id),p.mod("RG",this.level,e.id)].forEach(h=>{e.addModSafe(h)})}else e.removeModSafe(e.id)}}class ms{cardCache=new Map;mapper={["AAK"]:Pr,["ABB"]:Nr,["ABM"]:gt,["AGC"]:gt,["AGK"]:V,["AGP"]:lt,["AGW"]:L,["ASG"]:L,["AMS"]:V,["AFO"]:le,["ATG"]:Yt,["ART"]:Yt,["ATP"]:Fe,["AGM"]:ae,["ALG"]:me,["AHL"]:Qr,["ALS"]:me,["AAA"]:Mr,["ABE"]:lt,["ATZ"]:L,["AEC"]:$t,["ARB"]:Yt,["AEN"]:G,["APM"]:Rr,["AQE"]:L,["AGD"]:Er,["AFS"]:se,["AMD"]:Ir,["ABR"]:Gt,["AFR"]:V,["AMY"]:Gt,["ABL"]:L,["ATT"]:bt,["AGU"]:G,["AIV"]:Nt,["BRS"]:ar,["BTB"]:rr,["BTH"]:G,["BTI"]:gt,["BTN"]:me,["BBB"]:G,["BLH"]:Yt,["BFT"]:L,["BSP"]:Nt,["BWK"]:ae,["BLW"]:G,["BZS"]:V,["BSR"]:gt,["BMY"]:Lr,["BSW"]:dt,["BWW"]:He,["BTM"]:L,["BOS"]:U,["BAW"]:gt,["BWG"]:G,["BTR"]:V,["BWD"]:pe,["BSG"]:$r,["BSS"]:V,["BTS"]:pe,["BST"]:ce,["BWT"]:Gr,["BRF"]:ae,["BRH"]:bt,["BWH"]:Or,["BRN"]:ie,["BZD"]:V,["BFM"]:V,["BSM"]:Wr,["CKB"]:gt,["CDT"]:ae,["CMF"]:We,["CTL"]:lt,["CCS"]:dt,["CHY"]:G,["CSR"]:ar,["CHV"]:Ur,["CRS"]:le,["COD"]:lt,["CTI"]:V,["CHA"]:gt,["CHH"]:V,["CHR"]:ye,["CBB"]:Re,["CDC"]:G,["CFB"]:Gt,["CNM"]:G,["CSW"]:V,["CTG"]:G,["CCT"]:Ue,["CFG"]:Me,["CGF"]:At,["CGL"]:dt,["CSU"]:L,["CCR"]:gt,["CSB"]:At,["CNT"]:L,["CWK"]:G,["CRC"]:Nt,["CYC"]:Yt,["COZ"]:U,["CYS"]:At,["CTW"]:L,["CTV"]:L,["CAG"]:L,["CBS"]:L,["CIN"]:ge,["CSH"]:dt,["CSG"]:Me,["DFR"]:V,["DHW"]:Yt,["DSS"]:Ne,["DCR"]:lt,["DSK"]:At,["DBA"]:V,["DBP"]:G,["DMR"]:G,["DBR"]:G,["DCS"]:Ot,["DDF"]:L,["DGZ"]:lt,["DNK"]:zr,["DBN"]:V,["DDS"]:Zr,["DIS"]:$t,["DSV"]:Yr,["DDD"]:V,["DPB"]:Kr,["DZA"]:U,["DZD"]:ye,["DRE"]:$t,["DGW"]:lt,["DBT"]:L,["DFB"]:Pt,["DMW"]:se,["DCH"]:$t,["DTD"]:G,["DSZ"]:G,["DYB"]:L,["DBQ"]:Xr,["DYS"]:qr,["DYL"]:jr,["EBW"]:Re,["ESK"]:Nt,["EHW"]:Jr,["ETN"]:L,["EWE"]:Be,["ENP"]:L,["ESU"]:$t,["ENR"]:L,["EPD"]:lt,["EPH"]:_r,["EPS"]:Gt,["ESG"]:ti,["ESC"]:pe,["ESP"]:ei,["EWT"]:V,["EHN"]:pe,["EFA"]:L,["EFM"]:Gt,["EFP"]:ri,["EFE"]:ii,["EXD"]:L,["FWB"]:G,["FWR"]:G,["FFG"]:G,["FST"]:At,["FWK"]:At,["FIN"]:L,["FRR"]:lt,["FVA"]:L,["FWG"]:U,["FWC"]:Nt,["FFU"]:dt,["FLH"]:We,["FMS"]:G,["FSM"]:lt,["FBC"]:Gt,["FBI"]:Yt,["FFS"]:dt,["FLN"]:L,["FJT"]:L,["FRI"]:gt,["FSS"]:Ne,["FLS"]:Yt,["FSH"]:dt,["FFD"]:At,["FRV"]:gt,["FSP"]:bt,["FPR"]:G,["FFL"]:L,["FGA"]:G,["FGB"]:G,["FGD"]:bt,["FGG"]:se,["FGO"]:G,["FOL"]:le,["FPM"]:G,["FPS"]:G,["FFM"]:Be,["FMD"]:si,["FME"]:Nt,["FSK"]:ai,["FWT"]:V,["FZS"]:L,["FUN"]:U,["GOS"]:ni,["GHS"]:se,["GHB"]:Ue,["GHR"]:oi,["GRN"]:Me,["GTH"]:L,["GSC"]:ae,["GMP"]:Ot,["GTT"]:hi,["GCL"]:G,["GCR"]:L,["GLF"]:gt,["GRW"]:gt,["GSW"]:V,["GVS"]:At,["GSS"]:V,["GBG"]:At,["GGE"]:G,["GGH"]:G,["GRP"]:li,["GGD"]:Pt,["GGR"]:Pt,["GGP"]:Pt,["GGS"]:G,["GRM"]:lt,["GHT"]:gt,["GMR"]:At,["HMF"]:bt,["HTR"]:He,["HAR"]:L,["HFA"]:De,["HOD"]:bt,["HWM"]:ge,["HOX"]:$t,["HGS"]:ci,["HTP"]:di,["IBF"]:lt,["ITO"]:$t,["IME"]:$t,["IVS"]:lt,["ICD"]:ui,["IWC"]:G,["IHA"]:ae,["IBR"]:Re,["IMD"]:ye,["IMA"]:V,["IZL"]:fi,["IZR"]:gi,["IZK"]:Yt,["IFL"]:ie,["IFR"]:L,["JPK"]:L,["KDC"]:G,["KAW"]:Yt,["KOD"]:dt,["KBE"]:mi,["KIW"]:pi,["KTS"]:Pe,["KKK"]:He,["LOD"]:lt,["LFA"]:yi,["LKP"]:bi,["LGT"]:V,["LLD"]:xe,["LLG"]:xe,["LLS"]:xe,["LLT"]:xe,["LBR"]:L,["LSK"]:ie,["LWY"]:G,["LBD"]:V,["LSS"]:Ne,["LBL"]:Ot,["LSP"]:ge,["LCE"]:$t,["LUC"]:Be,["LMV"]:V,["LHY"]:G,["LYR"]:ie,["LYS"]:L,["MMH"]:gt,["MHR"]:Ai,["MRF"]:G,["MOE"]:V,["MXW"]:gt,["MSP"]:$t,["MMA"]:V,["MMR"]:V,["MMX"]:At,["MMI"]:G,["MMO"]:G,["MMV"]:Nt,["MPH"]:L,["MSC"]:L,["MTS"]:or,["MTT"]:ki,["MML"]:vi,["MMW"]:Ti,["MDE"]:nr,["MBP"]:dt,["MND"]:dt,["NNS"]:L,["NGB"]:gt,["NGW"]:G,["NSL"]:L,["NCF"]:L,["NCM"]:ye,["POZ"]:U,["NCS"]:dt,["NCW"]:G,["NCV"]:L,["NSW"]:Si,["NDR"]:Ci,["NEM"]:$t,["NSH"]:lt,["NXA"]:wi,["NXC"]:G,["NXG"]:dt,["NXO"]:le,["NXP"]:sr,["NXT"]:me,["NGT"]:Pt,["NGQ"]:xi,["NSD"]:U,["NCL"]:lt,["NFF"]:dt,["NAM"]:G,["NOZ"]:At,["NSY"]:V,["ONN"]:Di,["OXA"]:Fi,["OXM"]:V,["OXP"]:Hi,["OOZ"]:U,["OBB"]:Bi,["OEX"]:L,["OWH"]:Pi,["OBD"]:G,["OFM"]:V,["OJC"]:bt,["OPK"]:V,["OSV"]:ce,["OSS"]:L,["OWW"]:se,["OHV"]:dt,["ODC"]:Ni,["OSP"]:G,["OSL"]:G,["OWF"]:lt,["OXS"]:Mi,["PHM"]:V,["PPM"]:dt,["PSM"]:V,["PLW"]:lt,["PRG"]:G,["PRI"]:or,["PHS"]:gt,["PTB"]:lt,["PSC"]:dt,["PSH"]:Nt,["PTR"]:L,["PSG"]:L,["PMI"]:V,["PMS"]:L,["POX"]:At,["PYG"]:Ue,["PYS"]:lt,["RBH"]:Ri,["ROK"]:lt,["RPT"]:U,["RHY"]:G,["RTS"]:Gt,["RHU"]:ce,["RSC"]:Pe,["RLW"]:bt,["RFL"]:Ei,["RHC"]:G,["ROG"]:L,["RWC"]:pe,["RFA"]:De,["RWD"]:gt,["RSE"]:Ii,["RBG"]:ze,["RGG"]:Nt,["RSZ"]:At,["RSP"]:G,["RHW"]:bt,["SBF"]:Ot,["SAP"]:L,["SPL"]:U,["SVO"]:L,["SSE"]:Ot,["SXP"]:U,["SXD"]:U,["SXT"]:U,["STS"]:lt,["SCS"]:G,["SMD"]:V,["SFS"]:Li,["SHY"]:gt,["SCD"]:G,["SFT"]:G,["SOC"]:L,["SOA"]:L,["SOD"]:L,["SOK"]:ie,["SOT"]:L,["SDL"]:U,["SAD"]:Gi,["SHG"]:L,["SBI"]:Re,["SCC"]:Pe,["SPB"]:$i,["SPD"]:Ot,["SPM"]:Ot,["STD"]:gt,["STB"]:ie,["SHS"]:ae,["SGF"]:dt,["SKG"]:sr,["SSD"]:Ze,["SDA"]:Oi,["SSR"]:Nt,["SNB"]:L,["SNP"]:lt,["SRD"]:lt,["SSH"]:Fe,["SRM"]:dt,["SRH"]:Pt,["SDN"]:V,["SHV"]:L,["SRP"]:L,["SGG"]:V,["SBA"]:G,["SKB"]:G,["SBR"]:G,["SKS"]:ce,["SEL"]:Wi,["STM"]:G,["SBD"]:V,["SCV"]:Ui,["SFM"]:At,["SSN"]:G,["SSM"]:Nt,["SLH"]:Vi,["SPN"]:U,["SSI"]:ge,["SND"]:Pe,["SNT"]:At,["SRV"]:ze,["STR"]:L,["SPU"]:U,["XYR"]:U,["SPH"]:zi,["SSA"]:dt,["STO"]:L,["SDR"]:bt,["SOL"]:Ze,["SOV"]:L,["SHK"]:ie,["SWR"]:Zi,["SMN"]:G,["SER"]:Yi,["SES"]:Ki,["SFA"]:De,["STG"]:Xi,["SSS"]:Ne,["SSK"]:V,["SWG"]:ce,["SWM"]:dt,["SIV"]:lt,["STN"]:L,["SGI"]:G,["SBG"]:qi,["SCL"]:G,["SGA"]:De,["STP"]:L,["SSG"]:Nt,["SVH"]:Gt,["SIN"]:L,["SYL"]:V,["SEV"]:gt,["SMA"]:G,["SML"]:G,["SYO"]:Ji,["TST"]:lt,["TBA"]:Ot,["TGL"]:L,["TGS"]:G,["TPT"]:L,["TDW"]:bt,["TNL"]:Qi,["TEX"]:le,["TGN"]:G,["TSM"]:le,["TUP"]:L,["TOT"]:L,["TAB"]:nr,["TGI"]:V,["TDS"]:ye,["TSP"]:_i,["TPG"]:Fe,["TMG"]:Fe,["TMM"]:ts,["TRA"]:V,["TRS"]:V,["TRV"]:V,["TRW"]:V,["TBB"]:We,["TOB"]:L,["TWS"]:G,["TVG"]:rr,["TXB"]:L,["TXS"]:L,["TFK"]:U,["TFD"]:U,["TFF"]:U,["TCG"]:L,["TWT"]:G,["TRN"]:lt,["TGK"]:ze,["TSL"]:es,["TTF"]:U,["TWG"]:Me,["UGM"]:Nt,["UGL"]:V,["UIC"]:rs,["ULR"]:is,["URD"]:G,["UBL"]:L,["UCM"]:dt,["UEM"]:ss,["UHS"]:as,["UIM"]:dt,["UWL"]:V,["UWS"]:V,["UIW"]:V,["URS"]:L,["UTM"]:V,["UTR"]:bt,["URB"]:Gt,["UPM"]:se,["VIK"]:V,["VRP"]:os,["VBK"]:G,["VTC"]:G,["VTW"]:ce,["VGN"]:At,["VND"]:V,["VNF"]:gt,["VNS"]:V,["VSK"]:L,["VCH"]:lt,["VGR"]:L,["VGL"]:L,["VOB"]:L,["VCG"]:Ot,["VES"]:Gt,["VYE"]:L,["WBY"]:gt,["WBU"]:gt,["WMC"]:V,["WMR"]:dt,["WMM"]:L,["WTK"]:Ze,["WTW"]:G,["WTA"]:hs,["WWP"]:V,["WWR"]:dt,["WOD"]:lt,["WFM"]:se,["WWS"]:ls,["WBH"]:Be,["WCS"]:cs,["WPD"]:G,["WSE"]:ds,["WFB"]:V,["WFS"]:dt,["WBG"]:Ot,["XCR"]:G,["XDH"]:gt,["XHS"]:At,["XHU"]:G,["XRF"]:us,["XSH"]:dt,["XTR"]:V,["XDV"]:He,["XRW"]:L,["YWC"]:G,["YNS"]:Pt,["ZXR"]:fs,["ZPM"]:dt,["ZTR"]:U,["ZTU"]:At,["ZIN"]:G,["ZBS"]:U,["ZST"]:U,["ZMT"]:gs,["ZMB"]:U,["ZSH"]:Ot};makeCard(t){try{let e;if(t==="SOV3"?e=new ns(t):t==="SOC3"?e=new V(t):t==="LOD3"?e=new Vr(t):t==="GOS3"?e=new ji(t):e=new this.mapper[St.extractCardCode(t)](t),e.type==="C"){const r=e;r.spice=[{icon:"A",num:r.iAttack},{icon:"H",num:r.iHealth}].concat(r.spice??[])}return e}catch(e){throw console.error("Make card screwed up on code: "+t),e}}getCard(t){let e=this.cardCache.get(t);return e||(e=this.makeCard(t),this.cardCache.set(t,e)),e}}const I=new ms;class ps{registry;constructor(){this.registry=[]}find(t){const e=this.registry.find(r=>r.action===t);if(e)return e;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,e){const r=this.find(t);r.enabled=e}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const e=this.registry.findIndex(r=>r.action===t);e>-1&&this.registry.splice(e,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,e,r){if(N.ui.animating)return;let s,h;this.scaleFactor===1?(s=t,h=e):(s=Math.round(t*this.scaleFactor),h=Math.round(e*this.scaleFactor));let u,g=T.clickMode;return g==="M"?u=r:r===rt.ForceRight?u=rt.Right:g==="T"?u=rt.Left:u=rt.Right,$e.arrayHit(this.registry,s,h,u)}updateScale(t){t===1?this.scaleFactor=1:this.scaleFactor=1/t}scaleFactor=1}const Q=new ps;class ys{memLoad=!0;step="O";vsAI=!0;p1=this.dud();p2=this.dud();initConstructed(){this.step="O",this.memLoad&&(this.memLoad=!1,this.p1.mode=T.readStringStorage("cMode"+"A","CP"),this.p2.mode=T.readStringStorage("cMode"+"B","CP"),this.p1.mode==="LK"&&(this.p1.mode="CP"),this.p2.mode==="LK"&&(this.p2.mode="CP"),this.vsAI=T.readBoolStorage("cAI",!0)),ft.drawAll()}handleMenuPick(t,e){if(t==="CI"||t==="CV")this.vsAI=t==="CI",T.writeBoolStorage("cAI",this.vsAI);else if(t==="CN")this.ezDeck(this.p1)?this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",v.ddf5(this.generateDeckPickerActions())):(this.step="A",v.ddf5(this.generateDeckPickerActions()));else{const r=e==="A"?this.p1:this.p2;t==="LK"?Xt.loadFromFile().then(s=>{typeof s=="string"?new Le().iAmError(s):(r.deck=s,r.mode=t,T.writeStorage("cMode"+e,t),ft.drawAll())}):(r.mode=t,T.writeStorage("cMode"+e,t))}ft.drawAll()}ezDeck(t){return t.mode==="CP"?!1:(t.mode==="CR"?t.deck=Xt.randomStockDeck():t.mode==="CX"&&(t.deck=Xt.treatsAbound(!0)),!0)}handleDeckPick(t){const e=T.deTil(t.param),r=Xt.stockDeckByName(e[0],e[1]);this.step==="A"?(this.p1.deck=r,this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",v.ddf5(this.generateDeckPickerActions()))):(this.p2.deck=r,this.launchConstructed())}generateDeckPickerActions(t=-1){const e=fe.map((r,s)=>{const h=p.basicAction("DSET");return h.param=s.toString(),h});if(t>-1){const r=fe[t],s=r.decks.map(h=>{const u=p.basicAction("DECK");return u.param=T.enTil(r.id,h.name),u});return e.concat(s)}return e}launchConstructed(){N.aiMode=this.vsAI,mt.setMode("G"),N.newGame(this.p1.deck.cards,this.p2.deck.cards)}replay(){N.newGame(this.p1.deck.cards,this.p2.deck.cards)}dud(){return{mode:"CP",deck:{cards:[],name:"",factions:[]}}}}const Bt=new ys;class bs{deathOrder=[];graveyard=[];reset(){this.graveyard=[],this.deathOrder=[]}purge(){this.deathOrder=[]}getState(){const t={dO:this.deathOrder,gY:this.graveyard};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.deathOrder=e.dO,this.graveyard=e.gY}deathCheck(){const t=N.tick();f.qActiveCreats().forEach(s=>{s.health<1&&(m.new().crd(s.code).txt(" died.").go(),this.smite(s,t))});const e=k.toPlayer(!0),r=k.toPlayer(!1);(e.health<1||r.health<1)&&(e.healthr.creatId===t.id)&&(this.deathOrder=this.deathOrder.filter(r=>r.creatId!==t.id))}findDeathTime(t){const e=this.deathOrder.filter(r=>r.creatId===t).map(r=>r.time);if(e.length!==0)return Math.min(...e)}destroy(t,e,r=void 0){t.status==="A"?(m.new().crd(t.code).txt(" was destroyed by ").crd(e).txt(".").go(),this.smite(t,r)):(console.warn(`Attempted to destroy creature that was not active. Targ creat ${t.code}; Killer creat ${e}`),console.trace())}gravedigger(t="X",e="LA"){if(t==="X"&&e==="LA"){const r=this.graveyard.length;return r===0?"":this.graveyard[T.randInt(0,r)].cardCode}else{const r=k.toBool(t);let s=this.graveyard.filter(u=>u.owner===r);e!=="LA"&&(s=s.filter(u=>w.levelTargetTest(e,parseInt(u.cardCode.slice(3)))));const h=s.length;return h===0?"":s[T.randInt(0,h)].cardCode}}smite(t,e=void 0){t.status="D",this.deathOrder.push({creatId:t.id,time:e||N.tick()}),this.graveyard.push({cardCode:t.code,owner:t.owner}),x.addEvents(W.creature("DIE",t)),te.positionChange(t.owner),t.owner?M.deathsA.push(t.code):M.deathsB.push(t.code)}}const O=new bs;class As{get youi(){return N.ui}initDeck(t,e){this.youi.deckContents=t,this.youi.deckScroll=0,this.youi.deckSummary=e,mt.setMode("T")}get canPageDown(){return this.youi.deckContents.length-this.youi.deckScroll>15}get canPageUp(){return this.youi.deckScroll>0}paginate(t){t?this.youi.deckScroll+=15:this.youi.deckScroll-=15}visibleContent(){const t=this.youi.deckScroll;return this.youi.deckContents.slice(t,t+15)}generateContent(t,e,r){const s=w.cardByTarget(t,r);if(s.sort((h,u)=>{const g=h[0],y=u[0];return y===g?0:g>y?1:-1}),e){const h=s.length;let u=0,g="",y=0;const C=[];for(;u0&&C.push({cardCode:g,sourceIdx:-1,cardCount:y}),g=s[u][0],y=1),u++;return h>0&&C.push({cardCode:g,sourceIdx:-1,cardCount:y}),C}else return s.map(h=>({cardCode:h[0],sourceIdx:h[1],cardCount:0}))}handleShowDeck(t){const e=k.getActive();this.showDeck(e,t.param==="VD")}handleDeckScroll(t){this.paginate(t.param==="D"),ft.drawAll()}showPlayerDeck(t){this.showDeck(t,!1)}showPlayerDiscard(t){this.showDeck(t,!1)}showCustomDeck(t,e){this.initDeck(t,!1);const r=this.rightClickers();v.ddf5(e.concat(r))}showDeck(t,e){const r=k.toPlayer(t);this.initDeck(this.generateContent(e?r.discard:r.deck,!0),!0);const s=v.cancelAction();s.key="CNCL",s.param="PM";const h=this.rightClickers();h.push(s),v.ddf5(h)}rightClickers(){return N.aiActive?[]:this.youi.deckContents.map((t,e)=>{const r=p.deckSelectAction("DEET",t.cardCode,e);return r.param=t.cardCode,r})}}const Ht=new As;class ks{friends;friendText;get browseStack(){return N.ui.detailStack}n(t,e){return`${t}${e}`}allLevelFriendo(t,e){const r=Array.isArray(e)?e:[e];[1,2,3].forEach(s=>{this.friends[this.n(t,s)]=r.map(h=>this.n(h,s))})}plont(t){this.friends[this.n(t,1)]=[this.n("SDL",1)],this.friends[this.n(t,2)]=[this.n("SPL",2)],this.friends[this.n(t,3)]=[this.n("TFK",3)]}constructor(){const t=this.n("FWC",1);this.friends={[this.n("CGL",1)]:[this.n("CGF",1)],[this.n("DTD",1)]:[this.n("TOT",1)],[t]:[this.n("FWG",1)],[this.n("MPH",1)]:[t],[this.n("MPH",2)]:[t],[this.n("MPH",3)]:[t],[this.n("NGQ",4)]:[this.n("NSD",4)],[this.n("RHU",1)]:[this.n("RSC",1)],[this.n("SSE",1)]:[this.n("SXD",1)],[this.n("SSE",2)]:[this.n("SXP",2)],[this.n("SSE",3)]:[this.n("SXT",3)],[this.n("TRA",2)]:[this.n("PTR",2)],[this.n("TRA",3)]:[this.n("PTR",3)],[this.n("TRS",2)]:[this.n("STO",2)],[this.n("TRS",3)]:[this.n("STO",3)],[this.n("TRV",2)]:[this.n("ITO",2)],[this.n("TRV",3)]:[this.n("ITO",3)],[this.n("TRW",2)]:[this.n("STR",2)],[this.n("TRW",3)]:[this.n("STR",3)],[this.n("TGK",1)]:[this.n("SXD",1)],[this.n("TGK",2)]:[this.n("SPL",2)],[this.n("TGK",3)]:[this.n("TTF",3)],[this.n("TSL",1)]:[this.n("FUN",1)],[this.n("ZTU",2)]:[this.n("ZTR",2)]},this.allLevelFriendo("BLH","LWY"),this.allLevelFriendo("BTM","BOS"),this.allLevelFriendo("BWD","TFD"),this.plont("BTS"),this.allLevelFriendo("BWT","DNK"),this.allLevelFriendo("CSB","ZBS"),this.allLevelFriendo("CYS","COZ"),this.allLevelFriendo("DSK","SPN"),this.allLevelFriendo("DDF","SXT"),this.allLevelFriendo("DNK","BWT"),this.allLevelFriendo("DZD","DZA"),this.allLevelFriendo("DBQ","BRF"),this.allLevelFriendo("EPH","EPS"),this.allLevelFriendo("FST","ZST"),this.allLevelFriendo("FWK","ZMB"),this.allLevelFriendo("FGD",["FGA","FGB","FGG","FGO"]),this.allLevelFriendo("FGG","FGO"),this.allLevelFriendo("FMD","FME"),this.plont("GMR"),this.allLevelFriendo("IZL",["IFL","IFR","IZR"]),this.allLevelFriendo("IZR",["IFL","IFR","IZL"]),this.allLevelFriendo("IZK",["IFL","IFR","IZL","IZR"]),this.allLevelFriendo("NCM","POZ"),this.allLevelFriendo("NSW","SPN"),this.allLevelFriendo("NSH","NDR"),this.allLevelFriendo("NGQ","NSD"),this.allLevelFriendo("NFF","TFF"),this.allLevelFriendo("NOZ","OOZ"),this.plont("PTB"),this.allLevelFriendo("RWC","RPT"),this.plont("STS"),this.allLevelFriendo("SDA","HTP"),this.allLevelFriendo("SND","SPU"),this.allLevelFriendo("SIV","KBE"),this.allLevelFriendo("TNL","ZMB"),this.plont("WWS"),this.allLevelFriendo("YNS","XYR");const e=42,r=31,s=40,h=51,u=38,g=52,y=66;this.friendText={["BOS"]:[h,""],["BWT"]:[68,"Bron"],["BRF"]:[18,""],["CGF"]:[65,"Fiend"],["COZ"]:[r,""],["DNK"]:[8,""],["DZA"]:[59,"Dozer"],["EPS"]:[49,"Soldier"],["FWG"]:[44,""],["FWC"]:[28,"Chrysalis"],["FGA"]:[65,"Alpha"],["FGB"]:[77,"Beta"],["FGG"]:[53,"Gamma"],["FGO"]:[57,"Omega"],["FME"]:[78,"Egg"],["FUN"]:[49,""],["HTP"]:[38,"Hunting"],["ITO"]:[e,"Torrent"],["IZL"]:[42,"Av Flame"],["IZR"]:[44,"Av Frost"],["IFL"]:[65,"Flame"],["IFR"]:[67,"Frost"],["KBE"]:[78,"Bee"],["LWY"]:[65,"Wyrm"],["POZ"]:[r,""],["NDR"]:[3,""],["NSD"]:[s,""],["OOZ"]:[r,""],["PTR"]:[e,"Torrent"],["RPT"]:[51,""],["RSC"]:[60,"Scout"],["SPL"]:[h,""],["SXP"]:[h,""],["SXD"]:[s,""],["SXT"]:[u,""],["SDL"]:[s,""],["SPN"]:[y,""],["STR"]:[e,"Torrent"],["SPU"]:[y,""],["XYR"]:[y,""],["STO"]:[e,"Torrent"],["TOT"]:[40,"Tendrils"],["TFK"]:[u,""],["TFD"]:[u,""],["TFF"]:[u,""],["TTF"]:[u,""],["ZTR"]:[32,"Returned"],["ZBS"]:[g,""],["ZST"]:[g,""],["ZMB"]:[g,""]}}get currentCard(){const t=this.browseStack;return t[t.length-1]}get friendos(){return this.friends[this.currentCard]??[]}get canGoBack(){return this.browseStack.length>1}init(t){if(!N.aiActive)if(N.ui.detailStack=[t],mt.mode!=="R"){mt.setMode("R");const e=p.basicAction("CNCL");e.zone=mt.baseMode==="G"?"B":"N",e.param="PM",v.ddf5([e])}else ft.drawAll()}changeLevel(t){const e=this.browseStack,r=e.length-1,s=e[r];e[r]=this.n(St.extractCardCode(s),t)}goBack(){this.browseStack.pop()}goToFriend(t){this.browseStack.push(t)}friendTxt(t){const e=this.friendText[t];return e||[3,"I am error"]}goBackAction(){const t=p.basicAction("DTUP");return t.param="DB",t}levelAction(t){const e=p.basicAction("DTUP");return e.param=T.enTil("DL",t),e}friendAction(t){const e=p.basicAction("DTUP");return e.param=T.enTil("DF",t),e}updateDetails(t){const e=T.deTil(t.param),r=e[0];r==="DB"?this.goBack():r==="DF"?this.goToFriend(e[1]):r==="DL"?this.changeLevel(parseInt(e[1])):console.error("Unknown detail arg",t)}}const Kt=new ks,Ye=[1,2,3,4,5].map(n=>n.toString());class vs{rarityCache={["L"]:[],["H"]:[],["R"]:[],["C"]:[],["T"]:[]};faction1="X";faction2="X";factionLock=!1;picks=[];picksAsDeck=[];currentPack=[];scrollIdx=0;memLoad=!0;step="O";stats;vsAI=!0;legDraft=!1;fatPacks=!1;overdraft=!1;rarityFilters;setFilters;pAdeck=[];pBdeck=[];get aiPicking(){return this.vsAI&&this.step==="B"}packOdds=[];constructor(){this.rarityFilters=new Map(oe.map(t=>[t,!0])),this.setFilters=new Map(Ye.map(t=>[t,!0])),this.stats=new tr}getRarity(t){return this.rarityFilters.get(t)??!0}toggleRarity(t){const e=!this.rarityFilters.get(t);return this.rarityFilters.set(t,e),e}getSet(t){return this.setFilters.get(t.toString())??!0}toggleSet(t){const e=t.toString(),r=!this.setFilters.get(e);return this.setFilters.set(e,r),r}get canPageDown(){return this.picksAsDeck.length-this.scrollIdx>15}get canPageUp(){return this.scrollIdx>0}paginate(t){t?this.scrollIdx+=15:this.scrollIdx-=15}initDraft(){this.step="O",this.memLoad&&(this.memLoad=!1,this.vsAI=T.readBoolStorage("dAI",!0),this.legDraft=T.readBoolStorage("legDraft",!1),this.fatPacks=T.readBoolStorage("fatPacks",!1),this.overdraft=T.readBoolStorage("overD",!1),Ye.forEach(t=>{this.setFilters.set(t,T.readBoolStorage("dSet"+t,!0))}),oe.forEach(t=>{this.rarityFilters.set(t,T.readBoolStorage("dRare"+t,!0))})),ft.drawAll()}setFArr(){let t=Ye.filter(e=>this.setFilters.get(e)).map(e=>parseInt(e));return t.length===5&&(t=[]),t}validRarities(){return oe.filter(t=>this.rarityFilters.get(t))}startDraftPicks(){const t=this.setFArr();oe.forEach(e=>{this.getRarity(e)?this.rarityCache[e]=Xt.getDeckCards([e],[],t):this.rarityCache[e]=[]}),oe.every(e=>this.rarityCache[e].length===0)&&(this.rarityCache["C"]=this.fun()),this.packOdds=this.fatPacks?[9,31,40]:[5,25,40],this.faction1="X",this.faction2="X",this.factionLock=!1,this.picks=[],this.picksAsDeck=[],this.scrollIdx=0,this.stats=new tr,this.resumeDraft("")}resumeDraft(t){if(t){this.picks.push(t),this.picksAsDeck=this.picksToDeck();const s=this.overdraft?60:30;if(this.picks.length===s){this.step==="A"?(this.pAdeck=this.picksAsDeck.slice(),this.step="B",this.startDraftPicks()):(this.pBdeck=this.picksAsDeck.slice(),this.launchDraft());return}const h=I.getCard(t);if(this.aiPicking||this.stats.addStat(h.type,h.faction),!this.factionLock){const u=h.faction;if(this.faction1==="X")this.faction1=u;else if(u!==this.faction1){this.faction2=u,this.factionLock=!0;const g=this.setFArr();this.validRarities().forEach(y=>{this.rarityCache[y]=Xt.getDeckCards([y],[this.faction1,this.faction2],g)})}}}const e=this.generatePack().slice(-1*(6-this.picks.length%5)),r=this.fillPack(e);if(this.aiPicking)this.resumeDraft(r[r.length-1]);else{this.currentPack=r;const s=r.map((h,u)=>{const g=p.draftSelectAction("DRFT",u,!0);return g.param=h,g});v.ddf5(s)}}replay(){this.launchDraft()}picksToDeck(){const t=[];return this.picks.forEach(e=>{const r=t.findIndex(s=>s.card===e);r===-1?t.push({card:e,num:1}):t[r].num+=1}),t.sort((e,r)=>{const s=I.getCard(e.card+"1"),h=I.getCard(r.card+"1");return s.name.toLowerCase(){const s=this.rarityCache[r].length;let h=!0;for(;h;){const u=this.rarityCache[r][T.randInt(0,s)];e.includes(u)||(e.push(u),h=!1)}}),e}handleMenuPick(t,e){if(t==="DI"||t==="DV")this.vsAI=t==="DI",T.writeBoolStorage("dAI",this.vsAI);else if(t==="DN")this.step="A",this.startDraftPicks();else if(t==="DR"){const r=e;T.writeBoolStorage("dRare"+e,this.toggleRarity(r))}else t==="DT"?T.writeBoolStorage("dSet"+e,this.toggleSet(e)):t==="LD"?(this.legDraft=!this.legDraft,T.writeBoolStorage("legDraft",this.legDraft)):t==="GP"?(this.fatPacks=!this.fatPacks,T.writeBoolStorage("fatPacks",this.fatPacks)):t==="OD"&&(this.overdraft=!this.overdraft,T.writeBoolStorage("overD",this.overdraft));ft.drawAll()}launchDraft(){N.aiMode=this.vsAI,mt.setMode("G"),N.newGame(this.pAdeck,this.pBdeck)}fun(){return[["ART","SVO","MPH","VSK","MSP","LYS"],["CAG","ATG","WMM","ESU","BWH","CBS"],["DHW","NCF","ROG","EXD","TPT","HOX"],["FLS","STP","BRN","TCG","AQE","VOB"]][T.randInt(0,4)]}}const ut=new vs;class Ts{async drawAll(){if(ot.simOn)return;const t=mt.mode;Q.removeAll(),this.clearDetails(),t==="G"?(this.clearDeck(),await Promise.all([this.drawHand(k.getLocal()),this.drawPlayers(),this.drawField(),this.drawActions(v.activeActions)]),N.winFlag!==0?await this.drawGameOver():await this.drawCommonButtons(!0,!0,!0)):t==="R"?await this.drawDetails(v.activeActions):t==="T"?N.aiActive||await this.drawDeck(v.activeActions):t==="D"?await this.drawDraft(v.activeActions):t==="C"?await this.drawConstructed():t==="I"?await this.drawInfoMenu():t==="X"?await this.drawExit(v.activeActions):t==="S"?await this.drawSwap():await this.drawMenu()}async drawGameOver(){await new be().drawGameOver()}async drawHand(t){await new ur().drawCards(t)}async drawField(){await new je().drawCards()}async drawPlayers(){await new be().drawAllPlayers()}async drawDeck(t){const e=t.find(u=>u.zone==="B"),r=[];e&&r.push(e),await new Ee().drawActions(r);const h=new $s;await h.drawCards(),await h.drawActions(t),await this.drawCommonButtons(!0,!0,!1)}async drawActions(t){if(ot.simOn)return;const e=new Ee;if(N.aiActive)await e.drawActions([]);else{et.get("effects").clear();const s=new ur,h=new je,u=new be;await Promise.all([s.drawActions(t),h.drawActions(t),e.drawActions(t),u.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;N.ui.animating=!0,et.get("effects").clear(),await new je().drawFight(t),N.ui.animating=!1}async drawDraft(t){et.get("effects").clear();const r=new Ws,s=et.get("game-ui");s.clear(),Q.removeAll(),ut.step==="O"?await r.drawDraftMenu(s):(await new Ae().drawPickerPlayer(s,ut.step==="A",!1),await r.drawPack(t,s),await r.drawList(t,s),await r.drawStats(s),await this.drawCommonButtons(!0,!0,!1))}async drawMenu(){const t=new Us,e=et.get("game-ui");e.clear(),Q.removeAll(),await t.drawMenu(e)}async drawInfoMenu(){const t=new Ae,e=et.get("game-ui");e.clear(),Q.removeAll(),await t.drawExtrasMenu(e)}async drawConstructed(){if(Bt.step==="O"){const t=new Le,e=et.get("game-ui");e.clear(),Q.removeAll(),await t.drawConstrMenu(e)}else await this.drawDeckPick(v.activeActions)}async drawDeckPick(t){const e=new Le,r=new Ae,s=et.get("game-ui");s.clear(),Q.removeAll(),await r.drawPickerPlayer(s,Bt.step==="A",Bt.vsAI),await e.drawSets(t,s),await e.drawList(t,s)}clearDetails(){et.get("card").clear()}clearDeck(){et.get("decklist").clear()}async drawDetails(t){await this.drawActions(t),await this.drawCommonButtons(!0,!0,!1),et.get("card").clear();const r=new Os,s=t.find(h=>h.key==="CNCL");s?await r.drawDetails(s):console.error("Attempted to show details view with no cancel action")}async drawCommonButtons(t,e,r){let s=979;const h=723,u=new qe,g=et.get("game-ui");if(r&&g.clear(),t&&(await u.makeIconButton(g,s,h,"EX"),s-=50),e){const y=T.clickMode;y!=="M"&&await u.makeIconButton(g,s,h,y==="I"?"TM":"DM")}}async drawExit(t){et.get("decklist").clear();const r=et.get("effects"),s=new ue;await s.drawButton(r,151,488,t[1],"Quit Game",24,!1),await s.drawButton(r,478,488,t[0],"Resume",52,!1)}async drawSwap(){const t=et.get("decklist");t.clear(),t.context.fillStyle="#000000",t.context.fillRect(0,0,T.gameWidth,T.gameHeight);const e=new be,r=k.getActive(),s="#AAF0C1",h=p.basicAction("USWP");h.param="PM",await e.drawPlayer(r,t,200,300);const u={fontSize:22,colour:s};await e.drawText(t,"Player "+(r.isPlayerA?"1":"2"),480,360,u),await e.drawText(t,"Click to start turn",480,420,u);const g=new nt(h,0,0,T.gameWidth,T.gameHeight,rt.Both);Q.add(g)}setBackground(t){const e="hide";this.allBackgrounds.forEach(r=>{const s=document.getElementById(r);t===r?s.classList.remove(e):s.classList.add(e)})}changeScale(t){this.clearAll();let e=T.options.scale;e===t&&(e="100");const r=t==="100"?1:.90625;Q.updateScale(r);const s=`uiSize${e}`,h=`uiSize${t}`;this.allCanvases.forEach(y=>{et.get(y).dom.classList.replace(s,h)}),this.allBackgrounds.forEach(y=>{document.getElementById(y).classList.replace(s,h)}),document.getElementById("solforge").classList.replace(`gameSize${e}`,`gameSize${t}`),document.getElementById("log").classList.replace(`logSize${e}`,`logSize${t}`),T.options.scale=t,T.writeStorage("scale",t)}clearAll(){this.allCanvases.forEach(t=>{et.get(t).clear()})}allCanvases=["game-ui","field","player","hand","effects","decklist","card"];allBackgrounds=["playmat","blueface","mainmenu"]}const ft=new Ts;class Ss{positionChange(t){f.creatByTarget().forEach(e=>{e.enforceEffects("PS",t)})}defenderChange(t){f.qActiveCreats().forEach(r=>{r.effects.filter(s=>s.watch==="DF").filter(s=>s.area==="C"&&r.owner===t||s.area==="A").forEach(s=>I.getCard(s.logicCode).enforceEffect(s,r))})}playerHealthChange(){f.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){f.qActiveCreats().forEach(e=>{e.enforceEffects("AT"),e.enforceEffects("AR"),e.enforceEffects("CH"),e.enforceEffects("DF",e.owner)})}}const te=new Ss;class Cs{getC(t){return f.jr5(t)}creature(t,e){return{code:t,creatId:e.id}}creatHeal(t,e){return{code:"CHL",creatId:t.id,healAmt:e}}damage(t,e,r,s,h,u){let g;return h instanceof Se?g=h.id:g=h,{code:"DMG",battle:t,dmg:e,isCreatSrc:r,isCreatTarg:s,target:g,srcId:u?.id}}enterField(t){return{code:"ENT",creatId:t.id,forged:!1}}playCard(t,e){return{code:"PLC",playerA:e,cardCode:t}}player(t,e){return{code:t,playerA:e}}playerHeal(t,e){return{code:"PHL",playerA:t,healAmt:e}}replaced(t,e){return{code:"RPL",creatId:t.id,replCreatId:e.id}}toCreature(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId)}}toDamage(t){const e=t;let r,s,h;return e.isCreatTarg?h=this.getC(e.target):s=k.toPlayer(e.target),e.isCreatSrc&&(r=this.getC(e.srcId)),{code:e.code,battle:e.battle,dmg:e.dmg,isCreatSrc:e.isCreatSrc,srcId:e.srcId,target:e.target,isCreatTarg:e.isCreatTarg,srcCreat:r,hurtCreat:h,hurtPlayer:s}}toEnterField(t){const e=t;return{code:e.code,creatId:e.creatId,forged:e.forged,creature:this.getC(e.creatId)}}toReplaced(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId),replCreatId:e.replCreatId,replCreat:this.getC(e.replCreatId)}}}const W=new Cs;class ws{field=[];birthOrder=[];laneIdx=[1,2,3,4,5];reset(){this.field=[],this.birthOrder=[]}purge(){this.field=this.field.filter(t=>t.status==="A"),this.birthOrder=[]}getState(){const t={field:this.field.map(e=>e.getState()),bO:this.birthOrder};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.field=e.field.map(r=>new Se(r)),this.birthOrder=e.bO}jr5(t){const e=this.searchById(t);if(e)return e;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByLane(t,e){const r=this.searchByLane(t,e);if(r)return r;throw console.error("naughty creature lane ",t,e),new Error("Could not find creature by lane")}ddf6(t){const e=this.searchByFSA(t);if(e)return e;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return this.field.find(e=>e.id===t)}searchByLane(t,e){return this.field.find(r=>r.lane===t&&r.owner===e&&r.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let e=this.field;if(t){if(t.player!=="X"){const r=k.toBool(t.player);e=e.filter(s=>s.owner===r)}if(t.creatStatus!=="A"){const r=this.creatStatusTargetToCS(t.creatStatus);e=e.filter(s=>s.status===r)}if(!T.isUn(t.lanes)){const r=w.lanesToArr(t.lanes);e=e.filter(s=>r.includes(s.lane))}if(T.isUn(t.maxAttack)||(e=e.filter(r=>r.attack<=t.maxAttack)),t.notMe&&(e=e.filter(r=>r.id!==t.notMe)),t.victims){const r=T.deTil(t.victims);e=e.filter(s=>r.includes(s.id))}if(t.tribe!=="AN"&&(e=e.filter(r=>r.isTribe(t.tribe))),t.canLevel&&(e=e.filter(r=>I.getCard(r.code).canLevel())),t.level!=="LA"){const r=w.levelTargetToLevel(t.level);e=e.filter(s=>r.includes(s.level))}t.cardCode&&(e=e.filter(r=>I.getCard(r.code).cardCode()===t.cardCode)),t.canDefender&&(e=e.filter(r=>!r.negateDefender)),t.hasDefender&&(e=e.filter(r=>r.defender)),t.canArmor&&(e=e.filter(r=>!r.negateArmor)),t.hasArmor&&(e=e.filter(r=>r.armor>0)),t.canMove&&(e=e.filter(r=>!r.negateMobility)),t.hasMobility&&(e=e.filter(r=>r.mobility>0)),t.hasPoison&&(e=e.filter(r=>r.poison>0)),t.canRegen&&(e=e.filter(r=>!r.negateRegen)),t.hasRegen&&(e=e.filter(r=>r.regen>0)),t.faction!=="X"&&(e=e.filter(r=>r.faction===t.faction))}return e}cst2cs={["A"]:()=>{throw new Error("goof passed any to field state target mapper")},["V"]:()=>"A",["D"]:()=>"D",["R"]:()=>"R"};creatStatusTargetToCS(t){return this.cst2cs[t]()}emptyLanes(t){return this.laneIdx.filter(e=>!this.field.find(s=>s.owner===t&&s.lane===e&&s.status==="A"))}oppositeLane(t){return 6-t}adjacentPositions(t){return[[2],[1,3],[2,4],[3,5],[4]][t-1]}canMove(t){return t.mobility>0&&t.mobilityAvailable&&(!t.sleeping||t.aggressive)?this.emptyLanes(t.owner).filter(e=>Math.abs(t.lane-e)<=t.mobility):[]}birth(t,e,r,s=0,h=void 0){if(e==="S"){const C=this.emptyLanes(r);if(C.length===0)return;s=C[T.randInt(0,C.length)]}else if(e==="P"&&!this.emptyLanes(r).includes(s))return;const g=(typeof t=="string"?I.getCard(t):t).jr3(r,s);if(r===k.getActiveB()&&M.birthRegistrar(g.id),e==="F"||e==="R"){const C=f.searchByLane(s,r);if(C){const D=m.new().crd(C.code).txt(" was replaced");e==="R"?D.txt(" with ").crd(g.code).txt(".").go():D.txt(".").go(),C.status="R",x.addEvents(W.replaced(g,C))}}this.field.push(g);const y=W.enterField(g);return y.forged=e==="F",this.birthOrder.push({creatId:g.id,time:h||N.tick()}),x.addEvents(y),g.enforceEffects("PH"),te.positionChange(r),g}findBirthTime(t){const e=this.birthOrder.filter(r=>r.creatId===t).map(r=>r.time);if(e.length!==0)return e.length>1&&console.warn("wery curious, more than one birth record for creat "+t),e[0]}qActiveCreats(){return this.creatByTarget(p.crTarg())}qPlayerCreats(t){const e=p.crTarg();return e.player=k.toTarget(t),this.creatByTarget(e)}ddf1(){return this.creatByTarget(p.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(p.crEnemyTarg())}}const f=new ws;class xs{creatFightState(t,e){return t?e===1||t.defender||t.sleeping&&!t.aggressive?1:e===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t,e,r,s){if(t>0){let h=0;if(e>0){const u=t===2&&r.breakthrough;h=s.hurtBattle(r.attack,r,u)}else t===2&&(h=r.attack);h>0&&k.hurtBattle(!r.owner,h,r)}}fight(t){const e=!ot.simOn;e&&m.add("FIGHT!");let r=2,s=1;t&&(M.mainBattle=!1,r=0,s=0);const h=k.getActiveB(),u=[],g=[];f.laneIdx.forEach(C=>{const D=f.searchByLane(C,h),$=f.searchByLane(6-C,!h),K=this.creatFightState(D,r),_=this.creatFightState($,s);(K===2||_===2)&&(g.push([K,_,D,$],[_,K,$,D]),K===2&&(M.ffs++,u.push([C,h])),_===2&&u.push([f.oppositeLane(C),!h]))}),this.barking&&u.length>0&&e&&T.dogBark();let y;e?y=ft.drawCombat(u):y=Promise.resolve(),y.then(()=>{g.forEach(C=>this.dukeItOut(...C)),te.playerHealthChange(),O.deathCheck(),x.type="C0",v.actionDone()})}barking=!0}const hr=new xs;class Ds{aiMode=!1;aiActive=!1;winFlag=0;ui=this.freshUI();idnum=0;clock=0;genId(){return this.idnum++,"@"+this.idnum.toString(36)}tick(){return this.clock++,this.clock}getState(){return{i:this.idnum,t:this.clock}}setState(t,e){this.idnum=t,this.clock=e}newGame(t,e){this.idnum=0,this.clock=0,hr.barking=T.options.bark,k.activePlayer=T.randInt(0,2)===0,this.aiActive=!k.activePlayer&&this.aiMode,k.isLocalA=this.aiMode||k.activePlayer,v.actionHistory=[],ot.turnSims=0,ot.turnTime=0,f.reset(),O.reset(),this.ui=this.freshUI(),M.firstTurn=!0,this.winFlag=0;const r=k.nameOSaurus();k.initPlayer(!0,t,"Forgy McGhee",25),k.initPlayer(!1,e,r[0],r[1]),m.setup(),m.add("Ready...FIGHT!"),M.startTurn()}freshUI(){return{handScrollLeft:0,detailStack:[],deckContents:[],deckScroll:0,deckSummary:!1,animating:!1}}}const N=new Ds;class Fs{loglist;you=!0;localPlayerKey="";oppPlayerKey="";localPlayerSpan="";oppPlayerSpan="";constructor(){this.loglist=document.getElementById("loglist")}setup(){this.you=k.getLocalB(),this.localPlayerKey=this.you?"^pa":"^pb",this.oppPlayerKey=this.you?"^pb":"^pa",this.localPlayerSpan=this.span(k.toPlayer(this.you).name,"green"),this.oppPlayerSpan=this.span(k.toPlayer(!this.you).name,"red")}addLi(t){const e=document.createElement("li");e.innerHTML=t,this.loglist.appendChild(e),e.scrollIntoView({behavior:"smooth",block:"end"})}span(t,e,r=""){const s=r.length>0?` onclick="sfapi.details('${r}')"`:"";return`${t}`}add(t){this.addLi(t)}debug(t,e=!0){(e||T.options.debug)&&this.addLi(this.span(t,"debug"))}clearAll(){this.loglist.innerHTML=""}new(){return new Tr}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let e=!0;for(;e;){const r=t.indexOf("^c");if(r===-1)e=!1;else{const s=t.slice(r+2,r+6);if(s==="POIS")t=t.replaceAll("^c"+s,this.span("Poison","green"));else{const h=I.getCard(s);t=t.replaceAll("^c"+s,this.span(`${h.name} ${h.level}`,this.factMap[h.faction],s))}}}return t}parse(t){const r=t.guts.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),s=this.parseCards(r);this.add(s)}cardText(t){let e;if(t.type==="C"){const r=t,s=[];r.iRegen>0&&s.push("Regenerate "+r.iRegen),r.iArmor>0&&s.push("Armor "+r.iArmor),r.iMobile>0&&s.push("Mobility "+r.iMobile),r.iBT&&s.push("Breakthrough"),r.iDefend&&s.push("Defender"),r.iAggro&&s.push("Aggressive"),r.consistent&&s.push("Consistent"),s.length>0&&s.push(""),e=s.join(". ")+t.text}else e=t.text;return(t.isFree?"Free. ":"")+(t.overload?"Overload. ":"")+e}cardTextSplit(t){const e=[];if(t.isFree&&e.push("Free"),t.consistent&&e.push("Consistent"),t.overload&&e.push("Overload"),t.type==="C"){const r=t;r.iRegen>0&&e.push("Regenerate "+r.iRegen),r.iArmor>0&&e.push("Armor "+r.iArmor),r.iMobile>0&&e.push("Mobility "+r.iMobile),r.iBT&&e.push("Breakthrough"),r.iDefend&&e.push("Defender"),r.iAggro&&e.push("Aggressive")}if(t.text.length>0&&e.push(...t.text.split("~")),t.level===1){const r=t.cardCode(),s=_e.find(h=>h[0]===r);if(s){let h;const u=s[1];u.length===2&&u[0]===u[1]?h="2x "+I.getCard(`${u[0]}1`).name:h=u.map(g=>I.getCard(`${g}1`).name).join(", "),e.push("Solbind: "+h)}}return e}factionText(t){switch(t){case "A":return"Alloyin";case "N":return"Nekrium";case "T":return"Tempys";case "U":return"Uterra";case "X":return""}}cardTypeText(t){return t==="C"?"Creature":"Spell"}rarityText(t){switch(t){case "C":return"Common";case "R":return"Rare";case "H":return"Heroic";case "L":return"Legendary";case "T":return"Token"}}levelGateText(t,e=!1){const r=e?" ":"";return t===1?`level 1${r}`:t===2?`level 2 or lower${r}`:""}jr9(t,e,r=!1){return t!==0&&e!==0?`${this.bufferson(t,!0)}${r?",":" and"} ${this.bufferson(e,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(e,!1)}bufferson(t,e){return`${t>0?"+":""}${t} ${e?"attack":"health"}`}dbdtac(t=-1){return`deals battle damage to a ${t===-1?"":this.levelGateText(t,!0)}creature`}dbdtap(){return"deals battle damage to a player"}daluac(t=!1){return(t?"D":"d")+"iscard and level up a card"}forglied(t){return t==="X"?"Forge":`Allied ${this.factionText(t)}`}fastName(t){t.length===3&&(console.warn("HEY a 3 char card code was passed to fastName, why?: "+t),t=`${t}1`);const e=I.getCard(t);return e.name+" "+e.level}pName(t){return t?"A":"B"}tokName(t){return`${t.iAttack}/${t.iHealth} ${t.name}`}cardActionText(t){let e=`Card (${this.fastName(t.host)}) `;if(t.zone==="F"){const r=t,s=r.playerA?r.lane:6-r.lane,h=f.searchByFSA(r),u=h?this.fastName(h.code):"Empty";e+=`Lane ${s}${this.pName(r.playerA)} ${u}`}else if(t.zone==="H"){const r=t;e+=`Hand (${this.fastName(r.card)})`}else if(t.zone==="P"){const r=t;e+=`Player (${this.pName(r.playerA)})`}else t.zone==="R"?e+="Full Board":t.zone==="B"?e+="Button":t.zone==="N"&&(e+="Special");return e}actionText(t){switch(t.key){case "ACTV":return`Activate (${this.fastName(t.host)})`;case "CARD":return this.cardActionText(t);case "FITE":return"Fight";case "FORG":return`Forge to Lane ${6-t.lane}`;case "HDSC":return`Hand Discard (${this.fastName(t.host)})`;case "HPLY":const r=t;return`Play (${this.fastName(r.card)})`;case "MEND":return"Move End";case "MOVE":return"Move Start";case "NOTR":return"Pick None";case "ENDT":return"Donethanks";case "CANC":return"Cancel";default:return t.key}}tribeT={["AN"]:"Any",["AB"]:"Abomination",["AG"]:"Angel",["AS"]:"Asir",["BR"]:"Bear",["BE"]:"Beast",["CT"]:"Cat",["CR"]:"Chrysalis",["CY"]:"Cyborg",["DF"]:"Darkforged",["DM"]:"Demon",["DN"]:"Dinosaur",["DG"]:"Dragon",["DK"]:"Drakin",["DY"]:"Dryad",["ER"]:"Earth",["EL"]:"Elemental",["EN"]:"Energeist",["FY"]:"Fairy",["FR"]:"Fire",["FB"]:"Forgeborn",["FT"]:"Frost",["GT"]:"Giant",["GN"]:"Gnome",["GL"]:"Golem",["GG"]:"Grimgaunt",["GD"]:"Guardian",["HM"]:"Human",["HY"]:"Hydra",["IC"]:"Ice",["IN"]:"Insect",["LT"]:"Lightning",["LP"]:"Lupin",["MT"]:"Manticore",["MC"]:"Mech",["MM"]:"Metamind",["NG"]:"Naga",["OZ"]:"Ooze",["PX"]:"Phoenix",["PL"]:"Plant",["RM"]:"Ram",["RB"]:"Robot",["SY"]:"Satyr",["SE"]:"Seraph",["SH"]:"Shaman",["SS"]:"Shapeshifter",["SK"]:"Skeleton",["SN"]:"Snake",["SP"]:"Spider",["ST"]:"Spirit",["TG"]:"Tigrin",["TK"]:"Tuskin",["VP"]:"Vampire",["WD"]:"Wanderer",["WT"]:"Water",["WN"]:"Wind",["WF"]:"Wolf",["WR"]:"Wurm",["YT"]:"Yeti",["ZB"]:"Zombie"};tribeText(t){return this.tribeT[t]}}const m=new Fs;class Hs{handleMainMenuButton(t){t.param==="D"?(mt.setMode("D"),T.options.wasDrafting=!0,ut.initDraft()):t.param==="C"?(mt.setMode("C"),T.options.wasDrafting=!1,Bt.initConstructed()):t.param==="I"?(mt.setMode("I"),ft.drawAll()):window.open("deckbuilder.html")}handleMenuButton(t){const e=T.deTil(t.param),r=e[0];let s=!0;if(r==="RP")s=!1,m.clearAll(),T.options.wasDrafting?ut.replay():Bt.replay();else if(r==="MM")mt.setMode("M"),m.clearAll();else if(r==="CN"||r==="CP"||r==="CX"||r==="CR"||r==="CI"||r==="CV"||r==="LK")Bt.handleMenuPick(r,e[1]);else if(r==="DN"||r==="DR"||r==="DI"||r==="DV"||r==="LD"||r==="GP"||r==="OD"||r==="DT")ut.handleMenuPick(r,e[1]);else if(r==="HH")T.toggleOption("highHealth");else if(r==="CH")T.toggleOption("cheater");else if(r==="BB")T.toggleOption("bark");else if(t.param==="BC")T.toggleOption("bigCards");else if(r==="90"){const h=T.options.scale==="90"?"100":"90";ft.changeScale(h)}else r==="RU"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/rules")):r==="FQ"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/faq")):(s=!1,console.error("missing handler for menu button param "+t.param));s&&ft.drawAll()}handleUIButton(t){t.param==="DM"?(T.setClickMode("I"),ft.drawAll()):t.param==="TM"?(T.setClickMode("T"),ft.drawAll()):t.param==="EX"?(mt.setMode("X"),v.ddf5(this.generateExitActions())):console.error("missing handler for common button param "+t.param)}generateExitActions(){const t=p.basicAction("CANC");return t.param="PM",[t,p.menuButtonAction("MM")]}}const Ke=new Hs;class Bs{stack=["M"];setMode(t){this.deetMode(t)||t==="X"||t==="S"?this.stack.push(t):(this.stack=[t],t==="G"?(et.get("game-ui").clear(),ft.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(et.get("game-ui").clear(),ft.setBackground("blueface")):t==="M"&&(ft.clearAll(),ft.setBackground("mainmenu")))}popMode(){this.stack.pop()}get mode(){const t=this.stack;return t[t.length-1]}get isDetailMode(){return this.deetMode(this.mode)}get baseMode(){return this.stack[0]}deetMode(t){return t==="R"||t==="T"}}const mt=new Bs;class Ps{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const e=k.toPlayer(t),r=[],s=[];if(e.deck.forEach(h=>{I.getCard(h).consistent?r.push(h):s.push(h)}),r.length===0)this.shuffle(e.deck);else{this.shuffle(s);const h=20-r.length,u=r.concat(s.slice(0,h));this.shuffle(u),e.deck=s.slice(h).concat(u)}}shuffle(t){const e=t.length,r=(s,h)=>{const u=t[s];t[s]=t[h],t[h]=u};if(e>0){let s,h;const u=e*4;for(let g=0;gr.decks).flat(),e=T.randInt(0,t.length);return t[e]}stockDeckByName(t,e){let r;if(fe.some(s=>s.id===t?s.decks.some(h=>{h.name===e&&(r=h)}):!1),r)return r;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+e)}ripper(t,e,r){const s=[[15,8,5],[30,15,10]],h=this.getDeckCards([],[t]),u=[],g=s[r===15?0:1][e-1];for(;u.length$===D)||u.push(D)}const y=u.map(C=>({card:C,num:e}));return e===2&&r===15&&(y[0].num=1),y}deckify(t){const e=t.map(r=>{const s=_e.find(h=>h[0]===r);return s?s[1]:[]}).flat();return t.concat(e).map(r=>`${r}1`)}parseDeck(t){const e=t.map(r=>Array(r.num).fill(r.card)).flat();return this.deckify(e)}validDeck(t){const e={};t.forEach(C=>{e[C.card]?e[C.card]+=C.num:e[C.card]=C.num});const r=Object.entries(e).map(C=>({card:C[0],num:C[1]})),s=r.map(C=>C.num).reduce((C,D)=>C+D,0);if(s!==30)return"Deck must have 30 cards, found "+s;const h=[];let u="";if(r.some(C=>{const D=Rt.findIndex($=>$.crd===C.card);return D===-1?(u=C.card,!0):(h.push(Rt[D].fct),!1)}))return`Invalid card code: '${u}'`;let g=0;if(r.some(C=>C.num>3?(u=C.card,g=C.num,!0):!1))return`${g} copies of '${u}' ${m.fastName(u).slice(0,-2)}`;const y=[...new Set(h)];return y.length>2?"Deck must have two or less factions, found: "+y.join():""}getDeckCards(t=[],e=[],r=[]){return t.length===0&&e.length===0&&r.length===0?Rt.map(s=>s.crd):t.length>0&&e.length>0&&r.length===0?Rt.filter(s=>t.includes(s.rty)&&e.includes(s.fct)).map(s=>s.crd):t.length>0&&e.length===0&&r.length===0?Rt.filter(s=>t.includes(s.rty)).map(s=>s.crd):t.length===0&&e.length>0&&r.length===0?Rt.filter(s=>e.includes(s.fct)).map(s=>s.crd):t.length>0&&e.length>0&&r.length>0?Rt.filter(s=>t.includes(s.rty)&&e.includes(s.fct)&&r.includes(Math.floor(s.set))).map(s=>s.crd):t.length>0&&e.length===0&&r.length>0?Rt.filter(s=>t.includes(s.rty)&&r.includes(Math.floor(s.set))).map(s=>s.crd):t.length===0&&e.length>0&&r.length>0?Rt.filter(s=>e.includes(s.fct)&&r.includes(Math.floor(s.set))).map(s=>s.crd):Rt.filter(s=>r.includes(Math.floor(s.set))).map(s=>s.crd)}getCardFaction(t){const e=Rt.find(r=>r.crd===t);return e?e.fct:"X"}getCardRarity(t){const e=Rt.find(r=>r.crd===t);return e?e.rty:"T"}cardStats(){Te.forEach(t=>{const e=`${m.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,r=oe.map(s=>`${m.rarityText(s)}: ${this.getDeckCards([s],[t]).length}`).join("; ");console.log(e+r)})}loadPromise=new we;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new we,this.loader.click(),await this.loadPromise.getPromise(),this.fileguts==="")return"";if(this.fileguts.startsWith("!")){const s=this.fileguts.substring(1);return this.fileguts="",s}const t=JSON.parse(this.fileguts);this.fileguts="";const e=t.cards,r=this.validDeck(e);return r||t}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const e=this.loader.files;if(e&&e.length>0){const s=e[0];var r=new FileReader;r.onload=h=>{try{var u=r.result;if(u){var g=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(u)));g.cards&&Array.isArray(g.cards)&&!g.cards.some(y=>!(y&&typeof y.card=="string"&&Number.isInteger(y.num)))?(this.fileguts=JSON.stringify(g),this.loadPromise.resolveMe()):this.readError("File format is invalid.")}else this.readError("File read was empty.")}catch(y){console.error(y),this.readError("Error reading file.")}};try{r.readAsArrayBuffer(s)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}const Xt=new Ps;class Ns{phase="ST";enterMainPhase(){this.phase="MN";const t=k.getActive(),e=this.getMainPhaseActions(t);N.aiActive&&ot.hitMainPhase(),v.ddf5(e,!0)}async whatNext(t=!1){if(N.winFlag!==0){ot.simOn?(ot.simEndpoint(N.winFlag===1?"L":"W"),N.winFlag=0):(v.actionHistory=[],N.aiActive=!1,N.ui.animating=!1,await ft.drawAll());return}if(await ft.drawAll(),v.actionHistory.length>0)v.ddf5();else if(t)mt.setMode("S"),ft.drawAll();else if(x.getNextTrigger())Xe.resolve(x.getNextTrigger());else if(!x.deathCheck)O.deathCheck(),this.whatNext();else if(x.events.length>0)x.startBatch();else switch(f.purge(),O.purge(),this.phase){case "MN":this.enterMainPhase();break;case "ET":this.phase="PT",x.addEvents(W.player("PTN",k.getActiveB())),Et.expireMods(),this.whatNext();break;case "PT":M.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),this.phase="MN",this.whatNext();break;case "ST":ot.simOn?ot.simEndpoint("T"):(this.phase="MN",ot.cheater()?T.sleep(500).then(()=>this.whatNext()):T.sleep(100).then(()=>this.whatNext()));break}}expireatron(t,e,r,s){e.mods.forEach(h=>{h.expiry===s?h.expiry=r:h.expiry===r&&t.push([e,h])})}expireMods(){const t=f.creatByTarget(p.crTarg());t.push(k.playerA,k.playerB);let e=[];this.phase==="PT"?t.forEach(r=>{this.expireatron(e,r,"ET","EN")}):this.phase==="ST"&&t.forEach(r=>{this.expireatron(e,r,"ST","SN")}),e.length>0&&(e.forEach(r=>{const s=r[0];s instanceof Se?s.expireMod(r[1]):k.expireMod(s,r[1])}),te.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const e=this.getHandActions(t),r=this.getFieldActions(t);let s=M.mainBattle,h="M";return s||(s=f.ddf1().some(g=>g.extraBattles>0&&g.isActive&&!g.defender),h="E"),s&&e.push({key:"FITE",zone:"B",param:h,host:""}),s||e.push({key:"ENDT",zone:"B",param:"",host:""}),[e,r].flat()}getHandActions(t){const e=[...new Set(t.hand)],r=[],s=[];e.forEach(y=>{I.getCard(y).isFree?r.push(y):s.push(y)});const h=r.map(y=>[y,"FREE"]);M.freeCards.forEach(y=>{w.cardByTarget(s,y.condition).forEach(D=>{h.push([D[0],y.id]),s.splice(s.indexOf(D[0]),1)})}),h.push(...s.map(y=>[y,""]));const u=M.regularPlays>0;let g=t.hand.map((y,C)=>[y,C]);return u||(g=g.filter(y=>!s.includes(y[0]))),g.map(y=>{const C=h.find(D=>D[0]===y[0]);return C||console.error("No cost found for card"+y[0]),p.handSelectAction("HPLY",y[0],C[1],y[1])})}getFieldActions(t){const e=f.qPlayerCreats(t.isPlayerA),r=e.filter(h=>f.canMove(h).length>0).map(h=>p.fieldSelectAction("MOVE",h.lane,h.owner)),s=e.filter(h=>h.isActive&&h.activationAvailable?I.getCard(h.code).canActivate(h):!1).map(h=>{const u=p.fieldSelectAction("ACTV",h.lane,h.owner);return u.host=h.code,u.param=h.id,u});return r.forEach(h=>{const u=s.findIndex(g=>g.lane===h.lane);u>-1&&(s.splice(u,1),h.param="ACTV")}),r.concat(s)}}const Et=new Ns;class Ms{playerA;playerB;activePlayer;isLocalA;constructor(){this.playerA=this.newPlayer(!0),this.playerB=this.newPlayer(!1),this.activePlayer=!0,this.isLocalA=!0}getPlayerState(t){return{deck:t.deck,discard:t.discard,hand:t.hand,health:t.health,triggers:t.triggers,turn:t.turn,rank:t.rank,poison:t.poison,armor:t.armor,armorDmg:t.armorDmg,mods:t.mods}}setPlayerState(t,e){e.deck=t.deck,e.discard=t.discard,e.hand=t.hand,e.health=t.health,e.triggers=t.triggers,e.turn=t.turn,e.rank=t.rank,e.poison=t.poison,e.mods=t.mods,e.armor=t.armor,e.armorDmg=t.armorDmg}getState(){const t={pA:this.getPlayerState(this.playerA),pB:this.getPlayerState(this.playerB),actP:this.activePlayer};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.setPlayerState(e.pA,this.playerA),this.setPlayerState(e.pB,this.playerB),this.activePlayer=e.actP}pt2pb={["X"]:()=>{throw new Error("goof passed any to player target boolean-o-fier")},["A"]:()=>!0,["B"]:()=>!1,["F"]:()=>this.getActiveB(),["E"]:()=>!this.getActiveB()};b2p(t){return t?this.playerA:this.playerB}toPlayer(t){return typeof t=="boolean"?this.b2p(t):typeof t=="string"?this.b2p(this.pt2pb[t]()):t}toBool(t){return typeof t=="boolean"?t:typeof t=="string"?this.pt2pb[t]():t.isPlayerA}toTarget(t){return typeof t=="string"?t:(typeof t=="boolean"?t:t.isPlayerA)?"A":"B"}getActive(){return this.b2p(this.activePlayer)}getActiveB(){return this.activePlayer}getLocal(){return this.b2p(this.isLocalA)}getLocalB(){return this.isLocalA}hurtPlayer(t,e){if(e<1)return 0;const r=this.totalArmor(t),s=Math.max(Math.min(e,r-t.armorDmg),0);let h=e-s;return t.armorDmg+=s,t.health-=h,h}hurtDirect(t,e,r){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(m.new().crd(r).txt(` dealt ${h} dmg to `).plr(s).txt(".").go(),x.addEvents(W.damage(!1,h,!1,!1,s.isPlayerA,void 0)),te.playerHealthChange())}hurtBattle(t,e,r){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(m.new().crd(r.code).txt(` dealt ${h} battle dmg to `).plr(s).txt(".").go(),x.addEvents(W.damage(!0,h,!0,!1,s.isPlayerA,r)))}heal(t,e){const r=this.toPlayer(t);r.health+=e,m.new().plr(r).txt(` gained ${e} health.`).go(),x.addEvents(W.playerHeal(r.isPlayerA,e)),te.playerHealthChange()}drawCard(t,e){const r=this.toPlayer(t);for(let s=0;ss.granter===e?(s.type==="AR"&&(r.armorDmg=Math.max(0,r.armorDmg-s.value)),!1):!0)}removeModSafe(t,e){const r=this.toPlayer(t);this.hasMod(r,e)&&this.removeMod(r,e)}expireMod(t,e){const r=this.toPlayer(t);r.mods.splice(p.modIdx(r.mods,e),1)}newPlayer(t){return{hand:[],deck:[],discard:[],isPlayerA:t,health:120,mods:[],name:"",nameOffset:0,triggers:[],turn:1,rank:1,armor:0,armorDmg:0,poison:0,avatar:Math.floor(Math.random()*17)}}initPlayer(t,e,r,s){const h=this.toPlayer(t);h.name=r,h.nameOffset=s,h.turn=1,h.rank=1,h.health=T.options.highHealth?360:120,h.discard=[],h.deck=Xt.parseDeck(e),h.mods=[],h.triggers=[],h.poison=0,h.armor=0,h.armorDmg=0,this.ambushScan(h),Xt.shuffleDeck(h),h.hand=h.deck.splice(-5,5)}ambushScan(t){this.boosh(t,"LLD","PC"),this.boosh(t,"LLG","MV"),this.boosh(t,"LLS","EF"),this.boosh(t,"LLT","LG")}boosh(t,e,r){const s=e+"1";if(t.deck.includes(s)){const h=p.trigger(r,s);h.cardCode=s,h.customCode="AB",t.triggers.push(h)}}nameOSaurus(){const t=[["The Garmgunt",5],["Dr. Lucksack",15],["Sgt. Misplay",22],["Salty O'Teary",12],["M.V.P. Sprout",19],["Uncle Punchy",7],["Yesetherian",20],["Rubbish Asir",20],["Hogwash Druid",0],["Offal Savant",15],["Filth Knight",17],["Dirty Mystic",16],["Ether Buffoon",6],["Nexus Dimwit",12],["Hairy Poppins",11],["Al E. Gator",26],["Anita Bath",28],["Bennie Factor",9],["Chris P. Bacon",9],["Don Keigh",29],["Earl E. Bird",25],["Hugh Jass",34],["Jay Walker",28],["Barb Dwyer",22],["Robyn Banks",18],["Anna Graham",9],["Holly Graham",6],["Justin Case",26],["Sir Loins",39]],e=t[T.randInt(0,t.length)];return[e[0],e[1]+18]}}const k=new Ms;class Rs{stateStack=[];popCheck(){if(this.stateStack.length===0)throw new Error("Attempted to manipulate empty stack")}saveState(){const t={action:v.getState(),aiInPhase:ot.inPhase,batch:x.getState(),death:O.getState(),field:f.getState(),game:N.getState(),mode:JSON.stringify(mt.stack),phase:Et.phase,player:k.getState(),turn:M.getState()};this.stateStack.push(t)}restoreState(){this.popCheck();const t=this.stateStack[this.stateStack.length-1];v.setState(t.action),ot.inPhase=t.aiInPhase,x.setState(t.batch),O.setState(t.death),f.setState(t.field),N.setState(t.game.i,t.game.t),mt.stack=JSON.parse(t.mode),Et.phase=t.phase,k.setState(t.player),M.setState(t.turn)}popState(){this.popCheck(),this.stateStack.pop()}}const de=new Rs;class Es{toActions(t){return(Array.isArray(t)?t:[t]).map(r=>{const s=this.actionTargGuts(r);return s.forEach(h=>{h.host=r.host,h.param=r.param,h.hint=r.hint}),s}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(e=>p.handSelectAction(t.key,e[0],"",e[1]));if(t.target==="TF"){if(t.field==="O")return f.creatByTarget(t).map(e=>p.fieldSelectAction(t.key,e.lane,e.owner));{const e=t.player==="X"?[!0,!1]:[k.toBool(t.player)],r=T.isUn(t.lanes)?f.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return e.map(s=>r.map(h=>p.fieldSelectAction(t.key,h,s))).flat();if(t.field==="E")return e.map(s=>f.emptyLanes(s).filter(h=>r.includes(h)).map(h=>p.fieldSelectAction(t.key,h,s))).flat()}}if(t.target==="TP")return t.player==="X"?[p.playerSelectAction(t.key,!0),p.playerSelectAction(t.key,!1)]:[p.playerSelectAction(t.key,k.toBool(t.player))];if(t.target==="TB")return[{key:t.key,zone:"B",host:t.host,param:""}];if(t.target==="TR")return[{key:t.key,zone:"R",host:t.host,param:""}];if(t.target==="TD")return[];throw new Error("Target encountered that doesnt have mappings to actions: "+t.target)}cardByTarget(t,e){let r=t.map((s,h)=>[s,h]);if(e){if(T.isUn(e.deckPositionSkip)||(r=r.filter(s=>s[1]!==e.deckPositionSkip)),e.faction!=="X"&&(r=r.filter(s=>I.getCard(s[0]).faction===e.faction)),e.tribe!=="AN"&&(r=r.filter(s=>{const h=I.getCard(s[0]);return h.type==="C"?h.isTribe(e.tribe):!1})),e.canLevel&&(r=r.filter(s=>I.getCard(s[0]).canLevel())),e.level!=="LA"){const s=w.levelTargetToLevel(e.level);r=r.filter(h=>{const u=parseInt(h[0].substring(3,4));return s.includes(u)})}if(e.card!=="A"){const s=e.card==="C"?"C":"S";r=r.filter(h=>I.getCard(h[0]).type===s)}e.cardCode&&(r=r.filter(s=>I.getCard(s[0]).cardCode()===e.cardCode))}return r}deckByTarget(t){const e=k.toPlayer(t.player);let r;if(t.target==="TH")r=e.hand;else if(t.target==="TD")r=e.discard;else if(t.target==="DK")r=e.deck;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(r,t)}buttonTarget(t,e="",r=""){return p.actionTarget("TB",t,e,r)}boardTarget(t,e){return p.actionTarget("TR",t,e,"")}ddf2(t){return t===1?"L1":t===2?"LN":"LA"}lt2l={["LA"]:()=>[1,2,3,4],["L1"]:()=>[1],["L2"]:()=>[2],["L3"]:()=>[3],["LN"]:()=>[1,2]};levelTargetToLevel(t){return this.lt2l[t]()}levelTargetTest(t,e){return this.levelTargetToLevel(t).includes(e)}levelTestCommon(t,e){return this.levelTargetTest(this.ddf2(e),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}const w=new Es;class Is{ddf8(t){return t.trigger.type==="FR"?this.forgeTriggerTest(t,!1):t.trigger.type==="VN"?this.vengeanceTriggerTest(t):t.trigger.type==="FK"?this.flankTriggerTest(t):t.trigger.type==="AS"?this.forgeTriggerTest(t,!0):t.trigger.type==="UP"?this.upgradeTriggerTest(t):t.trigger.type==="DM"&&t.event.code==="DMG"||t.trigger.type==="HG"&&t.event.code==="CHL"||t.trigger.type==="EF"&&t.event.code==="ENT"||t.trigger.type==="DS"&&t.event.code==="DIE"||t.trigger.type==="PC"&&t.event.code==="PLC"||t.trigger.type==="MV"&&t.event.code==="MOV"||t.trigger.type==="RP"&&t.event.code==="RPL"||t.trigger.type==="LG"&&t.event.code==="PHL"||t.trigger.type==="TS"&&t.event.code==="TRS"||t.trigger.type==="TE"&&t.event.code==="TRE"||t.trigger.type==="PT"&&t.event.code==="PTN"||t.trigger.type==="RU"&&t.event.code==="RKU"?this.generalTriggerTest(t):!1}resolve(t){t.trigger.interactive&&(t.host==="P"?console.error("Encountered player hosted trigger that is interactive!!"):x.iaTrigLane=f.jr5(t.creatId).lane),I.getCard(t.trigger.logicCode).jr8(t)}forgeTriggerTest(t,e){if(t.event.code==="ENT"){const r=t.event;if(r.forged){const s=f.jr5(t.creatId),h=s.id===r.creatId&&s.status==="A";return e&&h?!s.opposed:h}}return!1}upgradeTriggerTest(t){if(t.event.code==="RPL"){const e=t.event,r=f.searchById(t.creatId);if(r)return r.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const e=t.event,r=f.searchById(t.creatId);if(r)return r.status==="D"&&r.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const e=t.event,r=f.jr5(t.creatId);return r.status==="A"&&r.id===e.creatId}return!1}generalTriggerTest(t){return I.getCard(t.trigger.logicCode).ddf8(t)}}const Xe=new Is;class Ls{firstTurn=!0;mainBattle=!0;deathsA=[];deathsB=[];ffs=0;regularPlays=2;cardsPlayed=0;freeCards=[];newPre=[];newPost=[];getState(){const t={mB:this.mainBattle,dA:this.deathsA,dB:this.deathsB,cP:this.cardsPlayed,ffs:this.ffs,fC:this.freeCards,rP:this.regularPlays,n1:this.newPre,n2:this.newPost};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.mainBattle=e.mB,this.deathsA=e.dA,this.deathsB=e.dB,this.cardsPlayed=e.cP,this.ffs=e.ffs,this.freeCards=e.fC,this.regularPlays=e.rP,this.newPre=e.n1,this.newPost=e.n2}resetTurnData(){this.mainBattle=!0,this.deathsA=[],this.deathsB=[],this.ffs=0,this.regularPlays=2,this.cardsPlayed=0,this.freeCards=[],this.newPre=[],this.newPost=[],this.firstTurn&&(this.firstTurn=!1,this.regularPlays=1)}forgeCard(t,e,r,s){const h=this.cardPlayed(e,r,s),u=k.getActive();m.new().txt("Forged ").crd(h.code).txt(".").go(),f.birth(h,"F",u.isPlayerA,t.lane),v.actionDone()}levelAndDiscardA(t){return this.levelAndDiscard(t.card,t.position)}levelAndDiscard(t,e,r=!0,s="F"){const h=I.getCard(t),u=k.toPlayer(s);if(e>-1?u.hand.splice(e,1):m.debug("Bad play index: "+e+" ("+t+")"),!h.overload){const g=h.levelUpCard();u.discard.push(g),r&&g!==t&&m.new().plr(u).txt(" leveled a card.").go()}return h}cardPlayed(t,e,r,s=!1){const h=this.levelAndDiscard(t,r,s),u=k.getActive();if(e==="")this.regularPlays-=1;else if(e!=="FREE"){const g=this.freeCards.findIndex(y=>y.id===e);g>-1?this.freeCards.splice(g,1):console.error("Could not find free card rule!")}if(this.cardsPlayed+=1,!s){const g=W.playCard(t,u.isPlayerA);x.addEvents(g)}return h}passTheTurn(){if(k.activePlayer=!k.activePlayer,Et.phase="WT",N.aiMode){if(!ot.simOn)if(N.aiActive=!N.aiActive,N.aiActive)ot.turnSims=0,ot.turnTime=0;else{const t=`🤖: ${this.calma(ot.turnSims)} pontifications in ${(ot.turnTime/1e3).toFixed(1)} seconds.`;m.new().txt(t).go()}}else k.isLocalA=k.activePlayer;this.startTurn()}calma(t){let e=t.toString();return e.length<4?e:e.length>6?e.slice(0,-6)+","+e.slice(-6,-3)+","+e.slice(-3):e.slice(0,-3)+","+e.slice(-3)}startTurn(){const t="------";if(ot.log&&N.aiActive&&N.aiMode&&console.log(t+" AI Turn Start "+t),!ot.simOn&&(m.new().txt(t).go(),m.new().plr(k.getActiveB()).txt(" starts turn.").go(),N.aiActive&&N.aiMode&&T.options.debug)){const e=k.toPlayer(!1);m.debug("!! Opponent Hand !!"),e.hand.forEach(r=>m.new().crd(r).go()),m.debug("!! ~~~~~~~ !!")}this.resetTurnData(),Et.phase="ST",x.addEvents(W.player("TRS",k.getActiveB())),Et.expireMods(),Et.whatNext(!N.aiMode)}endTurn(){const t=k.getActive();t.discard.push(...t.hand),t.hand=[],t.turn++;const e=t.turn>4;x.addEvents(W.player("TRE",t.isPlayerA)),e&&(t.turn=1,t.rank++,m.new().plr(t).txt(" hits Rank "+t.rank+".").go(),x.addEvents(W.player("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],Xt.shuffleDeck(t.isPlayerA)),f.qActiveCreats().forEach(r=>{r.extraBattles=0}),k.drawCard(t,5),Et.phase="ET",v.actionDone()}mobility(t){const e=f.jr5(t.param);m.new().crd(e.code).txt(" moved.").go(),e.mobilityAvailable=!1,e.move(t.lane),v.actionDone()}allied(t,e){const r=e??k.getActive(),s=p.target("TH");return s.player=k.toTarget(r),s.faction=t,w.deckByTarget(s).length>0}freeCard(t){const e=p.freeCard(t);return this.freeCards.push(e),e}birthRegistrar(t){this.mainBattle?this.newPre.push(t):this.newPost.push(t)}}const M=new Ls;class lr{id;dom;context;width;height;constructor(t){if(this.id=t,this.dom=document.getElementById(t),!this.dom)throw new Error(`Could not find canvas id ${t}`);this.context=this.dom.getContext("2d"),this.width=this.dom.width,this.height=this.dom.height,this.context.textBaseline="top",this.context.shadowOffsetX=1,this.context.shadowOffsetY=1}show(){this.dom.hidden=!1}hide(){this.dom.hidden=!0}get visible(){return!this.dom.hidden}clear(){this.context.clearRect(0,0,this.width,this.height)}sprite(t,e,r){this.context.drawImage(t,e,r)}updateScale(t){this.context.scale(t,t)}}class Mt{getCanv(t){return t instanceof lr?t:et.get(t)}async drawSprite(t,e,r,s,h={}){const u=this.getCanv(t).context,g=await T.getSprite(T.imgRoot+e);let y=1;h&&(y=h.alpha??1),y<1&&(u.globalAlpha=y),u.drawImage(g,r,s,g.naturalWidth,g.naturalHeight),y<1&&(u.globalAlpha=1)}async drawText(t,e,r,s,h={}){const u=this.getCanv(t).context,g=h.fontSize??24;T.pxRatio===2&&(s=this.retinaTextY(s,g)),u.fillStyle=h.colour||"#000000",u.font=`${g}px ${h.fontName||"cinzel"}`,u.shadowColor=h.shadow?"#000000":"#00000000",u.fillText(e,r,s),u.shadowColor="#00000000"}async spriteNumber(t,e,r,s,h,u){let g=r-this.numOffset(e,h);const y=[];e.toString().split("").forEach(C=>{y.push(this.drawSprite(t,this.numSpriteUrl(C,h,u),g,s)),g+=this.numSize(C,h)}),await Promise.all(y)}async drawHighlight(t,e,r,s,h,u="#00FF00"){const g=u.length===7?u.concat("aa"):u,y=this.getCanv(t);y.context.strokeStyle=g,y.context.beginPath(),y.context.rect(e,r,s,h),y.context.stroke()}hlColour(t){return t==="CANC"?"#FF0000":"#00FF00"}drawRarity(t,e,r,s){return this.drawSprite(t,`icons/rarity/new/${m.rarityText(e).toLowerCase()}.png`,r,s)}drawFaction(t,e,r,s){const h=e==="T"?2:0;return this.drawSprite(t,`icons/faction/${m.factionText(e).toLowerCase()}.png`,r+h,s+3)}retinaTextY(t,e){let r;return e<21?r=6:e<27?r=7:r=8,t-r}smallNumSize={"-":7,0:10,1:9,2:10,3:8,4:10,5:9,6:10,7:9,8:8,9:9};bigNumSize={"-":8,0:13,1:9,2:13,3:11,4:14,5:12,6:12,7:12,8:12,9:12};numSize(t,e){return e==="S"?this.smallNumSize[t]:this.bigNumSize[t]}numOffset(t,e){const r=t.toString().split("").reduce((s,h)=>s+this.numSize(h,e),0)-(e==="B"?2:1);return Math.floor(r/2)}numSpriteUrl(t,e,r){return`text/nums/${e}/${r}/${t}.png`}haze="#222222d8"}class ue extends Mt{async drawButton(t,e,r,s,h,u=7,g=!1,y=!0){let C,D;g?(C="ui/button/menu_on.png",D="#d7fc03"):(C="ui/button/menu_off.png",D="#00DEF7");const $=this.buttonBounds(e,r);if(await this.drawSprite(t,C,$[0],$[1]),await this.drawText(t,h,$[0]+7+u,$[1]+24,{colour:D,fontSize:30}),!g||y){const K=new nt(s,...$,rt.Both);Q.add(K)}}async buttonMaker(t,e,r,s,h,u=7,g=!1,y=!0){const C={key:"MNBT",zone:"N",host:"",param:s};await this.drawButton(t,e,r,C,h,u,g,y)}buttonBounds(t,e){return[t-7,e-7,232,69]}}class qe extends Mt{async makeIconButton(t,e,r,s){let u;u=`ui/button/ui_${s}.png`,await this.drawSprite(t,u,e,r);const g=p.basicAction("UIBT");g.param=s;const y=new nt(g,e,r,40,40,rt.Both);Q.add(y)}async makeVScroller(t,e,r,s,h){const u=this.vScrollHilightBounds(e,r);await this.drawSprite(t,`ui/arrow/${s?"up":"down"}.png`,e,r);const g={zone:"N",key:h,host:"",param:s?"U":"D"},y=new nt(g,...u,rt.Both);Q.add(y)}vScrollHilightBounds(t,e){return[t-3,e-3,40,27]}}class Ee extends Mt{async drawActions(t){if(mt.baseMode==="G"){const e=et.get("effects"),r=t.filter(s=>s.zone==="B");if(r.length>1&&console.error("Two button actions encountered in one batch",r),r.length===0||N.aiActive||T.clickMode==="I"&&!mt.isDetailMode){const s=this.buttonBounds();await this.drawSprite(e,"ui/button/off.png",s[0],s[1])}else{const s=r[0],h=this.buttonBounds();await this.drawSprite(e,"ui/button/on.png",h[0],h[1]);let u;s.key==="CARD"?u=s.param:u=s.key,await this.drawSprite(e,`text/butt/${u}.png`,h[0]+23,h[1]+18);const g=this.highlightBounds(),y=new nt(s,...g);s.key==="CNCL"&&(y.mouse=rt.Both),Q.add(y)}}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),e=5,r=[-1,-1,2,2];return t.map((s,h)=>s+e*r[h])}}class Vt extends Mt{async drawCard(t,e,r,s){const h=this.getCanv(e),u=this.extractStats(t),g=u.cardClass;if(await this.drawSprite(h,g.image(!1),r+14,s+35),await this.drawSprite(h,this.frameImg(g.level,g.faction,g.type,!1),r,s),await this.drawSprite(h,`text/card/${g.cardCode()}.png`,r+12,s+16),u.isCreature){const y=s+178;await this.spriteNumber(h,u.att,r+24,y,"S","Y"),await this.spriteNumber(h,u.hlt,r+127,y,"S","Y")}if(u.sleeping&&await this.drawSprite(h,"icons/effects/defensive.png",r+5,s+40,{alpha:.7}),u.iconList.length>0){const y=r+57-17*(u.iconList.length-1);await Promise.all(u.iconList.map(async(C,D)=>this.drawIcon(h,y+D*35,s+140,C[0],C[1])))}}async drawBigCard(t,e,r,s){const h=this.extractStats(e);if(await this.drawSprite(t,e.image(!0),r+38,s+117),await this.drawSprite(t,this.frameImg(e.level,e.faction,e.type,!0),r,s),e.rarity!=="T"&&await this.drawRarity(t,e.rarity,r+309,s+394),h.isCreature){const u=s+555;await this.spriteNumber(t,h.att,r+44,u,"B","Y"),await this.spriteNumber(t,h.hlt,r+325,u,"B","Y")}}async drawIcon(t,e,r,s,h=0){const u=this.getCanv(t);if(await this.drawSprite(u,`icons/effects/${s}.png`,e,r),h>0){const g=s==="poison"?12:9;await this.spriteNumber(u,h,e+17,r+g,"S","B")}}extractStats(t){let e,r=!1,s=0,h=0,u=!1,g=0,y=!1,C=!1,D=!1,$=!1,K=0,_=0,z=0,tt=!1,pt=!1;if(!(t instanceof St))r=!0,s=t.attack,h=t.health,u=t.sleeping&&!t.aggressive,g=t.regen,y=t.breakthrough,C=t.defender,D=t.aggressive,K=t.armor,_=t.poison,z=t.mobility,$=t.changed,e=I.getCard(t.code);else{if(t.type==="C"){r=!0;const Dt=t;s=Dt.iAttack,h=Dt.iHealth,g=Dt.iRegen,y=Dt.iBT,C=Dt.iDefend,D=Dt.iAggro,K=Dt.iArmor,z=Dt.iMobile}tt=t.overload,pt=t.consistent,e=t}const ct=[];return tt&&ct.push(["overload",0]),pt&&ct.push(["consistent",0]),g>0&&ct.push(["regenerate",g]),y&&ct.push(["breakthrough",0]),C&&ct.push(["defender",0]),D&&ct.push(["aggressive",0]),K>0&&ct.push(["armor",K]),_>0&&ct.push(["poison",_]),z>0&&ct.push(["mobility",z]),$&&ct.push(["changed",0]),{cardClass:e,isCreature:r,iconList:ct,hlt:h,att:s,sleeping:u}}async drawHilight(t,e,r,s="#00FF00"){await super.drawHighlight(t,...this.highlightBounds(e,r),s)}cardBounds(t,e){return[t,e,150,205]}highlightBounds(t,e){const r=this.cardBounds(t,e),s=5,h=[-1,-1,2,2];return r.map((u,g)=>u+s*h[g])}frameImg(t,e,r,s){return`frames/${s?"big":"small"}/lvl${t}_${e}${r}.png`}levelImg(t){return`icons/frame/lvl${t}.png`}oldFrameImg(t){return`icons/frame/frame${t}.png`}factionImg(t){return`icons/faction/orb${t}.png`}}const cr=30,Ie=540,dr=5;class ur extends Mt{async drawCards(t){const e=et.get("hand");e.clear();const r=new Vt,s=r.highlightBounds(0,0)[2]+dr;let h=cr;const u=this.paginatron(t);for(let g=u[0];g<=u[1];g++){const y=I.getCard(t.hand[g]);await r.drawCard(y,e,h,Ie),h+=s}}async drawActions(t){const e=T.clickMode!=="I",r=et.get("effects"),s=new Vt,h=s.highlightBounds(0,0)[2]+dr,u=new Lt(0,520,1e3,250),g=new Lt(0,520,1e3,250,rt.Right),y=this.paginatron(k.getActive());await Promise.all(t.filter(C=>C.zone==="H").map(async C=>{const D=C;if(D.position>=y[0]&&D.position<=y[1]){const $=cr+(D.position-y[0])*h;if(C.key==="DEET"){const K=new nt(C,...s.highlightBounds($,Ie),rt.Right);g.addChild(K)}else if(e){const K=new nt(C,...s.highlightBounds($,Ie));u.addChild(K),await s.drawHilight(r,$,Ie,this.hlColour(D.key))}}})),e&&Q.add(u),Q.add(g),y[0]>0&&await this.makeScroller(r,!1),y[1]0&&t.hand.length-e<5&&(e=Math.max(0,t.hand.length-5),N.ui.handScrollLeft=e),[e,Math.min(e+4,t.hand.length-1),t.hand.length-1]}scrollHilightBounds(t,e){return[t-3,e-2,27,38]}async makeScroller(t,e){const r=e?894:856,s=726,h=this.scrollHilightBounds(r,s);await this.drawSprite(t,`ui/arrow/${e?"right":"left"}.png`,r,s),await this.drawHighlight(t,...h);const u={zone:"N",key:"SCRH",host:"",param:e?"R":"L"},g=new nt(u,...h,rt.Both);Q.add(g)}}class je extends Mt{fieldBoundary=[17,62,821,443];async drawCards(t){const e=k.getLocalB(),r=et.get("field");r.clear();const s=new Vt,h=f.qActiveCreats().map(u=>{let g=0;t&&t.scrappers.some(C=>C[0]===u.lane&&C[1]===u.owner)&&(g=t.battlePhase);const y=this.coordCalc(u.lane,u.owner,e,g);return s.drawCard(u,r,...y)});if(await Promise.all(h),x.iaTrigLane>0){const u=this.coordCalc(x.iaTrigLane,k.getActiveB(),e),g=s.cardBounds(...u),y=g[1]+g[3]+11,C=g[0]+g[2]/2;await this.drawSprite(r,"icons/rewards/gold.png",C-10,y),await this.drawSprite(r,"icons/rewards/gold.png",C-35,y),await this.drawSprite(r,"icons/rewards/gold.png",C-60,y),await this.drawSprite(r,"icons/rewards/gold.png",C+15,y),await this.drawSprite(r,"icons/rewards/gold.png",C+40,y)}}async drawActions(t){const e=T.clickMode!=="I",r=k.getLocalB(),s=et.get("effects"),h=new Vt,u=new Lt(...this.fieldBoundary),g=new Lt(...this.fieldBoundary,rt.Right);await Promise.all(t.filter(y=>y.zone==="F"||y.zone==="R").map(async y=>{if(y.zone==="R"&&e){const C=new nt(y,...this.fieldBoundary);Q.add(C),await this.drawHighlight(s,...this.fieldBoundary)}else{const C=y,D=this.coordCalc(C.lane,C.playerA,r);if(y.key==="DEET"){const $=new nt(y,...h.highlightBounds(...D),rt.Right);g.addChild($)}else if(e){const $=new nt(y,...h.highlightBounds(...D));u.addChild($),await h.drawHilight(s,...D,this.hlColour(C.key))}}})),e&&u.childs.length>0&&Q.add(u),g.childs.length>0&&Q.add(g)}async drawFight(t){if(t.length>0){const e={battlePhase:1,scrappers:t},r=72;await new Ee().drawActions([]),await this.drawCards(e),await T.sleep(r),e.battlePhase=2,await this.drawCards(e),await T.sleep(r),e.battlePhase=3,await this.drawCards(e),await T.sleep(r),e.battlePhase=4,await this.drawCards(e),await T.sleep(r+70),e.battlePhase=3,await this.drawCards(e),await T.sleep(r),e.battlePhase=2,await this.drawCards(e),await T.sleep(r),e.battlePhase=1,await this.drawCards(e),await T.sleep(r)}}coordCalc(t,e,r,s=0){const h=r===e,u=166,g=5;let y,C,D;return[y,D,C]=h?[22,290,1]:[687,65,-1],[y+(t-1)*u*C,D+s*g*(-1*C)]}}class be extends Mt{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,e,r,s){const h=this.getCanv(e);await this.drawSprite(h,`avatar/${this.avatars[t.avatar]}.jpg`,r+46,s+48),await this.drawSprite(h,"ui/player_frame.png",r,s),await this.drawSprite(h,"ui/player_health.png",r+10,s+102),await this.spriteNumber(h,t.health,r+45,s+149,"B","G"),await this.drawText(h,`Turn: ${t.turn} Rank: ${t.rank}`,r+25,s+210,{colour:"#f5f242",fontSize:20}),await this.drawText(h,t.name,r+t.nameOffset,s+185,{colour:"#42a4f5",fontSize:20});const u=k.totalPoison(t),g=k.totalArmor(t);if(u>0||g>0){const y=new Vt,C=s+9;u>0&&await y.drawIcon(h,r+15,C,"poison",u),g>0&&await y.drawIcon(h,r+150,C,"armor",g)}}async drawAllPlayers(){const t=et.get("player");t.clear();const e=!N.aiActive,r=k.getLocal(),s=k.toPlayer(!r.isPlayerA);if(await this.drawPlayer(r,t,...this.playerOrigin(!0)),await this.drawPlayer(s,t,...this.playerOrigin(!1)),r.isPlayerA===k.getActiveB()){let h=862;const u=295,g=Array(M.regularPlays).fill("blue").concat(M.freeCards.map(C=>C.sourceCard)),y=[];g.forEach(C=>{let D;if(C==="blue")D=C;else if(D="green",e){const $={key:"DEET",zone:"N",host:"",param:C},K=new nt($,h-1,u-1,28,41,rt.Both);Q.add(K)}y.push(this.drawSprite(t,`ui/${D}card.png`,h,u)),h+=30}),await Promise.all(y)}await this.drawDeckButton(t,r,!0,e),await this.drawDeckButton(t,r,!1,e)}async drawDeckButton(t,e,r,s){let h,u,g;if(r?(h=e.discard.length,u=935,g="T"):(h=e.deck.length,u=858,g="U"),await this.drawSprite(t,`ui/button/faction_${g}.png`,u,350),await this.spriteNumber(t,h,u+38,350+14,"S","Y"),h>0&&s){const C=p.basicAction("VWDK");C.param=r?"VD":"VR";const D=new nt(C,u,350,77,44,rt.Both);Q.add(D)}}async drawActions(t){if(T.clickMode==="I")return;const e=et.get("effects"),r=k.getLocalB();await Promise.all(t.filter(s=>s.zone==="P").map(s=>{const h=s,u=this.playerOrigin(h.playerA===r),g=this.highlightBounds(...u),y=new nt(s,...g);return Q.add(y),this.drawHighlight(e,...g)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,e){return[t+18,e+18,170,170]}highlightBounds(t,e){return this.playerBounds(t,e)}async drawGameOver(){const t=et.get("field"),e=94,r=k.getLocalB(),s=N.winFlag,h=r&&s===1||!r&&s===-1;await this.drawSprite(t,`ui/you-${h?"win":"lose"}.png`,e,89),Q.removeAll();const u=new ue,g=et.get("effects");await u.drawButton(g,e+62,520,p.menuButtonAction("MM"),"Main Menu",20,!1),await u.drawButton(g,e+389,520,p.menuButtonAction("RP"),"Replay",55,!1)}async drawAiGear(t,e){const h=t%6,u=Math.floor(t/6),g=et.get("effects"),y=`icons/rewards/${e?"gold":"silver"}.png`;await this.drawSprite(g,y,862+h*24,255+u*24)}hwhipe(){et.get("effects").clear()}}const fr=15,gr=15,Gs=5;class $s extends Mt{constructor(){super();const e=new Vt().highlightBounds(0,0);this.xOffset=e[2]+Gs,this.yOffset=e[3]+25}xOffset;yOffset;async drawCards(){const t=et.get("decklist");t.clear(),t.context.fillStyle=this.haze,t.context.fillRect(0,0,849,T.gameHeight);const e=new Vt,s=Ht.visibleContent().map((h,u)=>{const g=I.getCard(h.cardCode),y=this.listXY(u);return e.drawCard(g,t,...y).then(()=>{if(h.cardCount>0)return this.drawCount(t,y[0]+62,y[1]+163,h.cardCount)})});await Promise.all(s)}async drawActions(t){const e=et.get("decklist"),r=new Vt,s=new qe,h=T.clickMode!=="I",u=Ht.visibleContent(),g=N.ui,y=g.deckScroll,C=y+15,$=g.deckSummary?rt.Both:rt.Right,K=new Lt(...this.deckBoundary()),_=new Lt(...this.deckBoundary(),$),z=[];t.forEach(tt=>{if(tt.key==="DEET"){const pt=tt;if(pt.position>=y&&pt.positionDt.sourceIdx===pt.position);if(ct>-1){const Dt=this.listXY(ct-y),ke=new nt(tt,...r.highlightBounds(...Dt));K.addChild(ke),z.push(r.drawHilight(e,...Dt,this.hlColour(tt.key)))}}}),h&&K.childs.length>0&&Q.add(K),_.childs.length>0&&Q.add(_),Ht.canPageDown&&z.push(s.makeVScroller(e,319,723,!1,"SCRK")),Ht.canPageUp&&z.push(s.makeVScroller(e,487,723,!0,"SCRK")),await Promise.all(z)}async drawCount(t,e,r,s){await this.drawSprite(t,"ui/dullcard.png",e,r),await this.spriteNumber(t,s,e+13,r+13,"S","Y")}listXY(t){return[fr+t%5*this.xOffset,gr+Math.floor(t/5)*this.yOffset]}deckBoundary(){return[fr,gr,this.xOffset*5,this.yOffset*3]}}class Os extends Mt{async drawDetails(t){const e=[],r=et.get("card");r.clear(),r.context.fillStyle=this.haze,r.context.fillRect(0,0,849,T.gameHeight);const s=30,h=30,u=I.getCard(Kt.currentCard),g=new Vt;T.options.bigCards?e.push(g.drawBigCard(r,u,s,h)):e.push(g.drawCard(u,r,134,280));const y=435;let C=30;const D="#f5f242",$="#03fcfc",K=33,_=23,z=28;let tt=u.name;for(;tt.length>0;){C+=36;let kt;if(tt.length<_)kt=tt,tt="";else{const zt=tt.lastIndexOf(" ",_);kt=tt.substring(0,zt),tt=tt.substring(zt+1)}e.push(this.drawText(r,kt,y,C,{colour:$,fontSize:28}))}C+=36,e.push(this.drawText(r,this.cardSummary(u),y,C,{colour:$,fontSize:20})),u.type==="C"&&(C+=30,e.push(this.drawText(r,this.tribeSummary(u),y,C,{colour:$,fontSize:20})));let pt=m.cardTextSplit(u);C+=40,pt.forEach(kt=>{for(;kt.length>0;){let zt;if(kt.length1){const kt=u.cardCode(),zt=Dt===3?[19,147,270]:Dt===2?[78,216]:[0,98,196,294];ct.forEach((ne,Ge)=>{e.push(this.drawLevelButton(r,kt,ne,40+zt[Ge],658,ne===u.level))})}const ke=new ue;let ve=0;const Je=513,Qe=697,mr=74;mt.baseMode!=="G"&&(e.push(ke.drawButton(r,Je,Qe,t,"Close",62,!1)),ve++);const zs=new nt(t,s,h,377,603,rt.Both);if(Q.add(zs),Kt.canGoBack){const kt=Kt.goBackAction();e.push(ke.drawButton(r,Je,this.buttonY(Qe,ve,mr),kt,"Back",72,!1)),ve++}Kt.friendos.forEach(kt=>{const zt=I.getCard(kt),ne=Kt.friendAction(kt),Ge=Kt.friendTxt(zt.cardCode());e.push(ke.drawButton(r,Je,this.buttonY(Qe,ve,mr),ne,Ge[1]||zt.name,Ge[0],!1)),ve++}),await Promise.all(e)}buttonY(t,e,r){return t-e*r}cardSummary(t){const e=m.factionText(t.faction),r=m.rarityText(t.rarity),s=m.cardTypeText(t.type);return`${e}, ${r} ${s}`}tribeSummary(t){return t.tribe.map(e=>m.tribeText(e)).join(" ")}async drawLevelButton(t,e,r,s,h,u){if(await this.drawSprite(t,`icons/frame/level${r}.png`,s,h),!u){const D=Kt.levelAction(r),$=new nt(D,s-15,h-5,88,112,rt.Both);Q.add($)}const y=I.getCard(`${e}${r}`).levelSpice(),C=[[-16,55],[41,55],[11,79]];await Promise.all(y.map((D,$)=>{const K=s+C[$][0],_=h+C[$][1];if(D.icon==="A"||D.icon==="H"){let z,tt;return D.icon==="A"?(z="icons/frame/attack.png",tt=K+17):(z="icons/frame/health.png",tt=K+16),this.drawSprite(t,z,K-1,_-1).then(()=>this.spriteNumber(t,D.num,tt,_+10,"S","Y"))}else{let z=this.spiceIcon(D.icon);if(D.icon==="U"||D.icon==="D"||D.icon==="L"||D.icon==="N"){const tt=`icons/effects/${z}.png`;return this.drawSprite(t,tt,K-1,_-1).then(()=>this.spriteNumber(t,D.num,K+16,_+10,"S","B"))}else return new Vt().drawIcon(t,K,_,z,D.num)}}))}spiceIcon(t){return t==="N"?"new":t==="D"?"damage":t==="U"?"buff":t==="V"?"mobility":t==="P"?"poison":t==="M"?"armor":t==="G"?"aggressive":t==="F"?"defender":t==="B"?"breakthrough":t==="R"?"regenerate":t==="L"?"life":t==="C"?"consistent":t==="O"?"overload":"whoops"}levelFun(t){return t.maxLevel===3?t.minLevel===1?[1,2,3]:[3]:t.maxLevel===t.minLevel?[t.minLevel]:t.maxLevel===4?[1,2,3,4]:[1,2]}}class Ws extends Mt{packLeft=22;packTop=190;packBoundary=[this.packLeft-5,this.packTop-10,537,480];async drawPack(t,e){const r=new Vt,s=T.clickMode!=="I",h=[],u=new Lt(...this.packBoundary),g=new Lt(...this.packBoundary,rt.Right);t.filter(C=>C.pack).forEach(C=>{const D=this.coordCalcPack(C.index);if(C.key==="DRFT"){const $=I.getCard(C.param+"1");if(h.push(r.drawCard($,e,...D).then(()=>this.drawRarity(e,$.rarity,D[0]+112,D[1]+4))),s){const K=new nt(C,...r.highlightBounds(...D));u.addChild(K)}}else{const $=new nt(C,...r.highlightBounds(...D),rt.Right);g.addChild($)}}),s&&u.childs.length>0&&Q.add(u),g.childs.length>0&&Q.add(g),await Promise.all(h)}async drawList(t,e){let r=170;const s=570,h=[],u=ut.picksAsDeck,g=new Lt(s,r,600,600,rt.Both),y=t,C=15,D=ut.scrollIdx;ut.canPageDown&&await this.makeScroller(e,!1),ut.canPageUp&&await this.makeScroller(e,!0),y.filter($=>!$.pack).forEach($=>{if($.index>=D&&$.index{const u=e.getFactTotal(h);if(u[2]===0)return[Promise.resolve()];{r+=75;const g=this.threeLine(t,r,s,u),y=this.drawFaction(t,h,r-8,s-39);return[g,y]}}).flat())}async threeLine(t,e,r,s){const h={colour:"#ffd865",fontSize:18,fontName:"serif"},u=30;await Promise.all(s.map((g,y)=>this.drawText(t,g.toString(),e,r+u*y,h)))}async drawDraftMenu(t){const e=new ue,r=new Ae,s=240,h=80,u=45,g=34;let y=50,C=s;await r.headerText(y+28,C,"Opponent",t),C+=u,await e.buttonMaker(t,y,C,"DI","DUMB BOT",27,ut.vsAI,!1),C+=h,await e.buttonMaker(t,y,C,"DV","HUMAN",47,!ut.vsAI,!1),C+=h+16,await r.headerText(y+17,C,"Rarity Filter",t),C+=h-g-6,await this.rarityButton(t,y+20,C,"L",ut.getRarity("L")),await this.rarityButton(t,y+125,C,"H",ut.getRarity("H")),C+=h,await this.rarityButton(t,y+20,C,"R",ut.getRarity("R")),await this.rarityButton(t,y+125,C,"C",ut.getRarity("C")),C=s+u+h*5,await e.buttonMaker(t,y,C,"MM","MAIN MENU",16),y=404,C=s,await r.headerText(y+5,C,"Draft Modes",t),C+=u,await e.buttonMaker(t,y,C,"GP","GOOD PACKS",9,ut.fatPacks),C+=h,await e.buttonMaker(t,y,C,"LD","LEGENDARY",17,ut.legDraft),C+=h,await e.buttonMaker(t,y,C,"OD","OVERDRAFT",17,ut.overdraft),y=757,C=s,await r.headerText(y+76,C,"Sets",t),C+=u,await this.chestButton(t,y+3,C,1,ut.getSet(1)),await this.chestButton(t,y+124,C,2,ut.getSet(2)),C+=88,await this.chestButton(t,y+3,C,3,ut.getSet(3)),await this.chestButton(t,y+124,C,4,ut.getSet(4)),C+=88,await this.chestButton(t,y+3,C,5,ut.getSet(5)),C=s+u+h*5,await e.buttonMaker(t,y,C,"DN","NEXT",68)}async rarityButton(t,e,r,s,h){const u={key:"MNBT",zone:"N",host:"",param:T.enTil("DR",s)},g=`ui/button/rarity_${s}${h?"y":"n"}.png`;await this.drawSprite(t,g,e,r);const y=new nt(u,e,r,75,65,rt.Both);Q.add(y)}async chestButton(t,e,r,s,h){const u={key:"MNBT",zone:"N",host:"",param:T.enTil("DT",s)},g=`icons/sets/Chest_Set${s}${h?"y":"n"}.png`;await this.drawSprite(t,g,e,r);const y=new nt(u,e,r,90,74,rt.Both);Q.add(y)}}class Le extends Mt{async drawSets(t,e){let r=200;const s=100,h=[],u=new Lt(s,r,400,600);t.filter(g=>g.key==="DSET").forEach(g=>{const y=fe[parseInt(g.param)];h.push(this.drawText(e,y.name,s,r,{colour:"#f5f242"}),this.drawSprite(e,"icons/chest_small.png",s-48,r-5));const C=new nt(g,s,r-2,400,35,rt.Both);u.addChild(C),r+=45}),Q.add(u),await Promise.all(h)}async drawList(t,e){let r=170;const s=570,h=[],u=new Lt(s,r,600,600);t.filter(g=>g.key==="DECK").forEach(g=>{const y=T.deTil(g.param),C=Xt.stockDeckByName(y[0],y[1]);h.push(this.drawFaction(e,C.factions[0],s,r),this.drawText(e,C.name,s+65,r+7,{colour:"#f5f242"})),C.factions.length===2&&h.push(this.drawFaction(e,C.factions[1],s+28,r));const D=new nt(g,s,r-2,600,35,rt.Both);u.addChild(D),r+=35}),await Promise.all(h),Q.add(u)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,h=Math.floor(t/3);return[22+s*176,200+h*235]}iAmError(t){const e=et.get("game-ui");this.drawText(e,t,295,655,{colour:"#f5142e",fontSize:26})}async drawConstrMenu(t){const e=new ue,r=new Ae,s=240,h=80,u=45;let g=50,y=s;await r.headerText(g+28,y,"Opponent",t),y+=u,await e.buttonMaker(t,g,y,"CI","DUMB BOT",27,Bt.vsAI,!1),y+=h,await e.buttonMaker(t,g,y,"CV","HUMAN",47,!Bt.vsAI,!1),y+=h*4,await e.buttonMaker(t,g,y,"MM","MAIN MENU",16),g=404,y=s,await r.headerText(g+46,y,"Player 1",t);const C=Bt.p1.mode;y+=u,await e.buttonMaker(t,g,y,T.enTil("CP","A"),"PRE-CON",39,C==="CP",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("CR","A"),"RANDOM",36,C==="CR",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("CX","A"),"SCRAMBLE",30,C==="CX",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("LK","A"),"LOAD FILE",32,C==="LK"),C==="LK"&&await this.drawFileDeck(t,g,y,Bt.p1.deck),g=757,y=s,await r.headerText(g+44,y,"Player 2",t);const D=Bt.p2.mode;y+=u,await e.buttonMaker(t,g,y,T.enTil("CP","B"),"PRE-CON",39,D==="CP",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("CR","B"),"RANDOM",36,D==="CR",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("CX","B"),"SCRAMBLE",30,D==="CX",!1),y+=h,await e.buttonMaker(t,g,y,T.enTil("LK","B"),"LOAD FILE",32,D==="LK"),D==="LK"&&await this.drawFileDeck(t,g,y,Bt.p2.deck),y+=h*2,await e.buttonMaker(t,g,y,"CN","NEXT",68)}async drawFileDeck(t,e,r,s){const h=r+89;await this.drawText(t,s.name.slice(0,20),e,r+70,{colour:"#f5f242",fontSize:18}),s.factions.length===1?await this.drawFaction(t,s.factions[0],e+96,h):(await this.drawFaction(t,s.factions[0],e+78,h),await this.drawFaction(t,s.factions[1],e+113,h))}}class Ae extends Mt{async drawExtrasMenu(t){const e=new ue,r=240,s=80,h=45;let u=50,g=r;await this.headerText(u+28,g,"More Info",t),g+=h,await e.buttonMaker(t,u,g,"RU","RULES",66),g+=s,await e.buttonMaker(t,u,g,"FQ","INFO & FAQ",20),g+=s*3,await e.buttonMaker(t,u,g,"MM","MAIN MENU",16),u=404,g=r,await this.headerText(u+37,g,"UI Modes",t),g+=h,await e.buttonMaker(t,u,g,"90","90% SIZE",47,T.options.scale==="90"),g+=s,await e.buttonMaker(t,u,g,"BC","BIG CARDS",29,T.options.bigCards),u=757,g=r,await this.headerText(u+12,g,"Game Modes",t),g+=h,await e.buttonMaker(t,u,g,"HH","BIG HEALTH",20,T.options.highHealth),g+=s,await e.buttonMaker(t,u,g,"CH","CHEATER",37,T.options.cheater),g+=s,await e.buttonMaker(t,u,g,"BB","BATTLE BARK",13,T.options.bark),await this.drawText(t,"v0.7.2",494,730,{fontSize:16,colour:"#7b68ee"})}async headerText(t,e,r,s){await this.drawText(s,r,t,e,{colour:"#f5f242",fontSize:30})}async drawPickerPlayer(t,e,r){let s;e?s="Player 1":r?s="Dumb Bot":s="Player 2",await this.headerText(54,75,s,t)}}class Us extends Mt{async drawMenu(t){let r=22;await this.drawSprite(t,"ui/button/constructed.png",778,r);const s=new nt(this.makeAction("C"),...this.buttHilightBounds(778,r),rt.Both);Q.add(s),r=148,await this.drawSprite(t,"ui/button/draft.png",778,r);const h=new nt(this.makeAction("D"),...this.buttHilightBounds(778,r),rt.Both);Q.add(h),r=508,await this.drawSprite(t,"ui/button/deck.png",778,r);const u=new nt(this.makeAction("B"),...this.buttHilightBounds(778,r),rt.Both);Q.add(u),r=634,await this.drawSprite(t,"ui/button/info.png",778,r);const g=new nt(this.makeAction("I"),...this.buttHilightBounds(778,r),rt.Both);Q.add(g);const y=p.basicAction("DBUG"),C=new nt(y,426,191,62,65,rt.Right);Q.add(C),await this.drawSprite(t,"gwg/gwg_red.png",58,0)}buttBounds(t,e){return[t,e,242,113]}buttHilightBounds(t,e){const s=[-3,-3,6,6];return this.buttBounds(t,e).map((h,u)=>h+s[u])}makeAction(t){return{zone:"N",key:"MENU",host:"",param:t}}}class Vs{gameWidth;gameHeight;spriteCache;dogAudio;_clickMode;pxRatio=1;options;imgRoot;constructor(){this.spriteCache={},this.imgRoot="./img/",this.gameWidth=1024,this.gameHeight=768,this.dogAudio=document.getElementById("dogbark"),this._clickMode="M",this.options={bark:!0,bigCards:!0,highHealth:!1,cheater:!1,wasDrafting:!1,scale:"100",debug:!1}}randInt(t,e){return Math.floor(Math.random()*(e-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async getSprite(t){return this.spriteCache[t]||(this.spriteCache[t]=this.imageLoader(t)),this.spriteCache[t]}async bulkLoadSprite(t){await Promise.all(t.map(e=>this.getSprite(`${this.imgRoot}${e}`)))}dogBark(){this.dogAudio.volume=.3,this.dogAudio.play()}toggleDebug(){const t=!this.options.debug;this.options.debug=t,new Le().iAmError("Debug mode "+(t?"ON":"OFF"))}enTil(...t){return t.join("~")}deTil(t){return t.split("~")}imageLoader(t){return new Promise(e=>{const r=new Image;r.onload=()=>{e(r)},r.src=t})}writeStorage(t,e){localStorage.setItem(t,e)}readStorage(t){return localStorage.getItem(t)}readStringStorage(t,e){const r=this.readStorage(t);return r===null?e:r}readBoolStorage(t,e){const r=this.readStorage(t);return r===null?e:r==="Y"}writeBoolStorage(t,e){this.writeStorage(t,e?"Y":"N")}restoreOptions(){const t=this.options;t.bark=this.readBoolStorage("bark",!0),t.bigCards=this.readBoolStorage("bigCards",!0),t.cheater=this.readBoolStorage("cheater",!1),t.highHealth=this.readBoolStorage("highHealth",!1),t.scale=this.readStringStorage("scale","100")}toggleOption(t){T.options[t]=!T.options[t],this.writeBoolStorage(t,T.options[t])}setClickMode(t){this._clickMode=t}get clickMode(){return this._clickMode}}const T=new Vs;window.onload=async()=>{await document.fonts.ready;let n=[];document.fonts.forEach(z=>{z.load(),n.push(z.loaded)}),await Promise.all(n),["game-ui","field","player","hand","effects","decklist","card"].forEach(z=>{et.register(z)});const e=et.get("effects");e.context.lineWidth=2,T.pxRatio=window.devicePixelRatio;let r;(z=>{z.Neutral="N",z.Cancel="C",z.Down="D"})(r||(r={}));let s=!0,h=800,u="N",g;try{document.createEvent("TouchEvent"),T.setClickMode("T"),s=!1}catch{}const y=()=>{g&&(clearTimeout(g),g=void 0)},C=(z,tt,pt)=>{const ct=Q.hitTest(z,tt,pt);ct&&v.handleAction(ct)},D=z=>{C(z.pageX,z.pageY,z.button)},$=z=>{z.touches.length>1?(u="C",y()):u==="N"&&(u="D",g=setTimeout(()=>{u="C";const tt=z.touches[0];C(tt.pageX,tt.pageY,rt.ForceRight),g=void 0},h))},K=z=>{if(u==="D"){if(y(),u="N",z.changedTouches.length>0){const tt=z.changedTouches[0];C(tt.pageX,tt.pageY,rt.Left)}}else z.touches.length===0&&(u="N")},_=document.getElementById("solforge");s?(_.addEventListener("click",D),_.addEventListener("contextmenu",z=>(z.preventDefault(),D(z),!1))):(_.addEventListener("touchstart",$),_.addEventListener("touchend",K)),window.sfapi={details:z=>{Kt.init(z)},setLog:z=>{ot.setLog(z)},peekAll:()=>{ot.peekAllCards()},peekDeck:()=>{ot.peekDecks()},dumb:()=>{console.log("Am I dumb? "+ot.dumb)},debug:()=>{T.toggleDebug()}},T.restoreOptions(),T.options.scale!=="100"&&ft.changeScale(T.options.scale),ft.drawAll()}})();