From 91331879dc38260d2f126487467f9b0f4019707d Mon Sep 17 00:00:00 2001 From: james-rae Date: Fri, 24 Nov 2023 19:05:30 -0500 Subject: [PATCH] :package: beta build v0.8.1 --- play/dist/solforge.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/play/dist/solforge.js b/play/dist/solforge.js index 497aa0e..fe641e2 100644 --- a/play/dist/solforge.js +++ b/play/dist/solforge.js @@ -1,4 +1,4 @@ -(function(){"use strict";const xe=["A","N","T","U"];const de=["C","R","H","L"];const Et=[{c:"AAK",f:"T",r:"L",s:1,t:"C",ds:["AH"]},{c:"ABB",f:"N",r:"R",s:4,t:"C",dp:["SL"],ds:["RG","ZB"]},{c:"ABM",f:"N",r:"C",s:5,t:"C",dp:["AB"]},{c:"AGC",f:"A",r:"C",s:1,t:"C",ds:["AR"]},{c:"AGK",f:"A",r:"L",s:2.1,t:"C",dp:["AR"]},{c:"AGP",f:"A",r:"C",s:1.1,t:"S",ds:["AR"]},{c:"AGW",f:"A",r:"R",s:4,t:"S",dp:["AH"],ds:["AR","MV"]},{c:"ASG",f:"T",r:"R",s:1,t:"S",ds:["MV","SP","LV"]},{c:"AMS",f:"A",r:"H",s:5,t:"C",dp:["MM"],ds:["MV"]},{c:"AFO",f:"A",r:"C",s:2.1,t:"C",dp:["LV"],ds:["SP"]},{c:"ATG",f:"A",r:"C",s:2,t:"C",dp:["SP"],ds:["AR","RB"]},{c:"ATP",f:"U",r:"H",s:3,t:"C",dn:["SP","CD"]},{c:"ART",f:"U",r:"H",s:2.1,t:"C",dp:["MU","SP","PL"]},{c:"ATS",f:"T",r:"C",s:6,t:"C",ds:["SP","MV"]},{c:"AGM",f:"T",r:"L",s:2.2,t:"C",dp:["XA"],ds:["RG","AR","MV"]},{c:"ALG",f:"A",r:"R",s:1,t:"C",ds:["AH"]},{c:"AHL",f:"A",r:"H",s:1,t:"C",dp:["HL"],ds:["RB"]},{c:"ALS",f:"A",r:"H",s:2,t:"C",ds:["AH","MV"]},{c:"ASB",f:"A",r:"L",s:6,t:"C",dp:["MS","SB"]},{c:"AAA",f:"A",r:"L",s:5.1,t:"C",dp:["HL"],dn:["FC","AG","BN"]},{c:"ABE",f:"A",r:"H",s:5.1,t:"S",ds:["HL","TD"],dn:["GW"]},{c:"ATZ",f:"A",r:"C",s:4,t:"S",ds:["FR","AL","SP"]},{c:"AEC",f:"U",r:"L",s:5,t:"S",ds:["GW"]},{c:"ARB",f:"A",r:"H",s:4,t:"C",ds:["AR","RB"],dn:["TK","LZ"]},{c:"AEN",f:"A",r:"C",s:2,t:"C",dp:[],ds:["RB","AR"],dn:[]},{c:"APM",f:"A",r:"H",s:2,t:"C",dp:["MA","LV"],ds:["SP"]},{c:"AQE",f:"T",r:"C",s:1,t:"S",ds:["HR"]},{c:"AGD",f:"U",r:"L",s:1,t:"C",dp:["LG"],ds:["DR"]},{c:"AFS",f:"A",r:"L",s:1,t:"C",dp:["RB"],ds:["FR","VT"]},{c:"AWU",f:"T",r:"R",s:6,t:"C",dp:["MV"],ds:["BN"]},{c:"ASQ",f:"N",r:"L",s:6,t:"C",ds:["RV"]},{c:"AMD",f:"T",r:"H",s:5,t:"C",dp:["FC"],ds:["AG"]},{c:"ABR",f:"T",r:"C",s:2,t:"C",dp:["FC"]},{c:"AFR",f:"T",r:"H",s:3.1,t:"C",dp:["MT","SP"],ds:["CS"]},{c:"AMY",f:"T",r:"C",s:1,t:"C",dp:["FC"]},{c:"ABL",f:"T",r:"R",s:1,t:"S",ds:["FC"]},{c:"ATT",f:"T",r:"L",s:4.1,t:"C",ds:["FC","AG","AS"]},{c:"AGU",f:"T",r:"R",s:2.1,t:"C",ds:["WL","MV"]},{c:"AIV",f:"T",r:"H",s:1,t:"C",dp:["MT"],ds:["RK"]},{c:"BRS",f:"A",r:"C",s:5,t:"C",dn:["FC","AG","BN"]},{c:"BTB",f:"A",r:"R",s:5,t:"C",dp:["AR"],ds:["RB","DI"]},{c:"BTH",f:"U",r:"R",s:3,t:"C",ds:["DI","CS"]},{c:"BTI",f:"A",r:"C",s:4,t:"C",ds:["MM","AL"]},{c:"BTN",f:"A",r:"H",s:1,t:"C",ds:["NX","AH"]},{c:"BBB",f:"U",r:"H",s:4,t:"C",ds:["CS","UD"]},{c:"BLH",f:"T",r:"L",s:2,t:"C",dp:["SP"],ds:["AG","TK","GW","SF"]},{c:"BFT",f:"N",r:"C",s:5,t:"S",dp:["UD"]},{c:"BSP",f:"N",r:"C",s:2.2,t:"C",ds:["RK"]},{c:"BWK",f:"N",r:"R",s:1,t:"C",ds:["RV","ZB"]},{c:"BLW",f:"N",r:"R",s:3,t:"C",ds:["ZB","CS"]},{c:"BZS",f:"T",r:"C",s:5,t:"C",ds:["MV","FC"]},{c:"BBR",f:"A",r:"C",s:6,t:"S",ds:["AR","SV"]},{c:"BBD",f:"N",r:"C",s:6,t:"S",ds:["SV"]},{c:"BBL",f:"T",r:"C",s:6,t:"S",ds:["SV"]},{c:"BBN",f:"U",r:"C",s:6,t:"S",ds:["SV"]},{c:"BSR",f:"N",r:"R",s:1,t:"C",ds:["AB","RV"]},{c:"BMY",f:"T",r:"H",s:2.1,t:"C",ds:["MV"]},{c:"BSW",f:"T",r:"C",s:3,t:"C",ds:["MS"]},{c:"BWW",f:"T",r:"H",s:4,t:"C",ds:["MV"]},{c:"BTM",f:"U",r:"H",s:1,t:"S",ds:["PL","RV","RP"]},{c:"BAW",f:"U",r:"R",s:2,t:"C",ds:["FC"]},{c:"BWG",f:"U",r:"C",s:1,t:"C",ds:["PL"]},{c:"BTR",f:"U",r:"H",s:3.1,t:"C",dp:["MU"],ds:["CS","FR"]},{c:"BWD",f:"U",r:"C",s:2,t:"C",ds:["PL","GW","SF","TK"]},{c:"BSG",f:"A",r:"L",s:1,t:"C",ds:["RB","MV","AR"]},{c:"BSS",f:"A",r:"L",s:1,t:"C",dp:["RB"],ds:["AR"]},{c:"BTS",f:"U",r:"C",s:1.1,t:"C",ds:["PL","TK","GW"]},{c:"BST",f:"T",r:"L",s:4,t:"C",dp:["RP"],ds:["MS"]},{c:"BWT",f:"U",r:"L",s:4.2,t:"C",dp:["DI"],ds:["RP","HR"]},{c:"BRH",f:"N",r:"R",s:5,t:"C",ds:["AB"]},{c:"BWH",f:"A",r:"R",s:1,t:"S",dp:["AR"]},{c:"BRN",f:"T",r:"R",s:3,t:"S",ds:["BN","TD"]},{c:"BZD",f:"N",r:"R",s:2,t:"C",dp:["QT"],ds:["DR","RG","MV"]},{c:"BFM",f:"N",r:"H",s:2.3,t:"C",dp:["QT"],ds:["MV","AL"]},{c:"BSM",f:"T",r:"H",s:2,t:"C",dp:["QN"],ds:["RV","AG"]},{c:"CKB",f:"N",r:"H",s:5,t:"C",ds:["RV"]},{c:"CDT",f:"U",r:"R",s:1,t:"C",ds:["PL","PS"]},{c:"CMF",f:"N",r:"R",s:4,t:"C",ds:["AS"]},{c:"CTL",f:"T",r:"L",s:1,t:"S",ds:["XA"]},{c:"CCS",f:"N",r:"C",s:3,t:"C",ds:["RG"]},{c:"CHY",f:"U",r:"C",s:1,t:"C",ds:["RG"]},{c:"CSR",f:"U",r:"C",s:5,t:"C",ds:["PS"]},{c:"CSL",f:"N",r:"C",s:6,t:"C",ds:["RG"]},{c:"CHV",f:"N",r:"L",s:2,t:"C",ds:["MV","RV"]},{c:"CRS",f:"A",r:"R",s:3,t:"C",dp:["MM"],ds:["LV"],dn:[]},{c:"COD",f:"T",r:"R",s:4,t:"S",dp:["UD"],dn:["GW"]},{c:"CTI",f:"N",r:"C",s:1.1,t:"C",dp:["AL"],ds:["AB"]},{c:"CHA",f:"U",r:"R",s:2.1,t:"C",dn:["MV"]},{c:"CHH",f:"U",r:"C",s:2,t:"C",dp:["GW"]},{c:"CHR",f:"U",r:"L",s:1,t:"C",ds:["PL","MS","LV","RG"]},{c:"CBB",f:"T",r:"C",s:3,t:"C",dp:["UD"]},{c:"CDC",f:"T",r:"C",s:2,t:"C",ds:["WL"]},{c:"CFB",f:"T",r:"H",s:1,t:"C",ds:["FC"]},{c:"CNM",f:"T",r:"C",s:2,t:"C"},{c:"CSW",f:"T",r:"L",s:2.3,t:"C",ds:["DR","MV"]},{c:"CTG",f:"A",r:"C",s:3,t:"C",ds:["RB","WL"]},{c:"CCT",f:"T",r:"R",s:2,t:"C",ds:["MV","FC"]},{c:"CFG",f:"T",r:"C",s:2,t:"S"},{c:"CGL",f:"N",r:"H",s:3,t:"C",dp:["AB"],ds:["FR"]},{c:"CSU",f:"N",r:"R",s:1,t:"S",ds:["FR"]},{c:"CCR",f:"N",r:"C",s:1,t:"C",dp:["SF"],ds:["AB","LZ"]},{c:"CSB",f:"N",r:"C",s:2,t:"C",ds:["ZB","TK","VG"]},{c:"CNT",f:"A",r:"R",s:5,t:"S",ds:["AL","AH"]},{c:"CWK",f:"T",r:"C",s:3,t:"C",ds:["DI","MV"]},{c:"CRC",f:"A",r:"R",s:2,t:"C",ds:["RB","RK","WL"]},{c:"CYC",f:"N",r:"H",s:2,t:"C",dp:["MN","SP"],ds:["BN","LG"]},{c:"CYS",f:"N",r:"C",s:4,t:"C",ds:["TK","VG"]},{c:"CTW",f:"N",r:"C",s:1,t:"S",dp:["AL"],ds:["RV"]},{c:"CTV",f:"U",r:"H",s:1,t:"S",dp:["PL"],ds:["RP"]},{c:"CAG",f:"A",r:"R",s:1,t:"S",ds:["NX","FR","LV"]},{c:"CBS",f:"A",r:"C",s:2.1,t:"S",dp:["MA"],ds:["AH","AR"]},{c:"CIN",f:"A",r:"R",s:1.1,t:"C",dp:["AH"]},{c:"CSH",f:"A",r:"C",s:3,t:"C",ds:["AR"]},{c:"CSG",f:"A",r:"C",s:2,t:"S",ds:["AR"]},{c:"DFR",f:"N",r:"H",s:2,t:"C",dp:["AL"]},{c:"DHC",f:"N",r:"H",s:6,t:"C",ds:["SP","RG"]},{c:"DHW",f:"N",r:"R",s:1,t:"C",dp:["SP"],ds:["RG"]},{c:"DRS",f:"U",r:"C",s:6,t:"C",dp:["DF"],ds:["PL"]},{c:"DSS",f:"N",r:"R",s:1,t:"C",dp:["MN"],ds:["ZB"]},{c:"DSW",f:"N",r:"C",s:6,t:"C",dp:["DF"],ds:["LG","BN"]},{c:"DSE",f:"A",r:"C",s:6,t:"C",dp:["DF"],ds:["RB","AH"]},{c:"DSA",f:"T",r:"C",s:6,t:"C",dp:["DF"]},{c:"DCR",f:"N",r:"R",s:2,t:"S",ds:["RV"]},{c:"DSK",f:"N",r:"C",s:1,t:"C",ds:["TK","SF","VG"]},{c:"DBA",f:"U",r:"H",s:1,t:"C",dp:["GW"]},{c:"DBP",f:"U",r:"C",s:1,t:"C",ds:["UD"]},{c:"DMR",f:"U",r:"C",s:2,t:"C",ds:["DI"]},{c:"DBR",f:"U",r:"C",s:1,t:"C"},{c:"DCS",f:"A",r:"L",s:2,t:"C",ds:["LV"]},{c:"DWW",f:"N",r:"C",s:6,t:"C",dn:["AG"]},{c:"DDF",f:"U",r:"R",s:5,t:"S",ds:["RP","UD","TD"]},{c:"DGZ",f:"A",r:"R",s:2,t:"S",ds:["AL"],dn:["GW"]},{c:"DBN",f:"N",r:"C",s:4,t:"C",ds:["AL"]},{c:"DDS",f:"A",r:"H",s:4.2,t:"S",dp:["QN"],ds:["AL"]},{c:"DIS",f:"T",r:"R",s:1,t:"S",ds:["BN"]},{c:"DSV",f:"U",r:"R",s:2,t:"S",dp:["PS"],ds:["FR"]},{c:"DDD",f:"N",r:"L",s:1,t:"C",ds:["MV","RV","DR"]},{c:"DPB",f:"A",r:"L",s:5.2,t:"C",ds:["RB","RP"]},{c:"DZD",f:"U",r:"L",s:3,t:"C",dp:["MS"],ds:["AG"]},{c:"DRE",f:"T",r:"L",s:5,t:"S",ds:["BN"]},{c:"DGS",f:"U",r:"H",s:6,t:"C",ds:["RV"],dn:["DR"]},{c:"DGW",f:"T",r:"L",s:5.2,t:"S",dp:["DR"],ds:["AG","TK"]},{c:"DBT",f:"N",r:"H",s:1,t:"S",ds:["RV"]},{c:"DTR",f:"U",r:"L",s:6,t:"C",dp:["MS","SQ"],ds:["FR","RG","PL"]},{c:"DFB",f:"N",r:"R",s:1,t:"C",dp:["AB"],ds:["BN","SF","LZ","SV"]},{c:"DMW",f:"A",r:"L",s:1.1,t:"C",dp:["MM","CD"],ds:["AH"]},{c:"DCH",f:"U",r:"C",s:1,t:"S",ds:["LG"]},{c:"DTD",f:"N",r:"L",s:4.2,t:"C",dp:["DR"],ds:["MV"]},{c:"DHM",f:"U",r:"R",s:6,t:"C",dp:["DF"],ds:["SB"]},{c:"DSZ",f:"N",r:"C",s:2,t:"C",ds:["ZB","RG"]},{c:"DYB",f:"U",r:"R",s:2,t:"S",dp:["GW","TK"]},{c:"DBQ",f:"N",r:"H",s:3,t:"C",dp:["QU"],ds:["TK","RV","PS"]},{c:"DYS",f:"N",r:"R",s:3,t:"S",dp:["QU"]},{c:"DYL",f:"U",r:"L",s:3,t:"C",dp:["QN","LG"],ds:["TK"]},{c:"EBW",f:"N",r:"C",s:3,t:"C",dp:["UD"]},{c:"ESK",f:"N",r:"H",s:2,t:"C",dp:["RK"],ds:["UD"]},{c:"EHW",f:"U",r:"L",s:1,t:"C",ds:["GW","TK"]},{c:"ETN",f:"A",r:"C",s:1,t:"S",ds:["AL"]},{c:"EWE",f:"T",r:"H",s:2,t:"C",dp:["MV"]},{c:"EVT",f:"U",r:"L",s:6.1,t:"S",dp:["MU"],ds:["TD"]},{c:"ENP",f:"A",r:"H",s:1,t:"S",ds:["FR","WL"]},{c:"ESU",f:"A",r:"R",s:1,t:"S",ds:["CD","TD","FR"]},{c:"ENR",f:"U",r:"C",s:1,t:"S"},{c:"EPD",f:"N",r:"H",s:1,t:"S",dn:["GW"]},{c:"EPH",f:"A",r:"L",s:4.2,t:"C",dp:["CD"],ds:["TK"]},{c:"ESG",f:"A",r:"H",s:4.1,t:"C",dp:["QU","LV"],ds:["TK","GW"]},{c:"ESC",f:"A",r:"H",s:2,t:"C",dp:["QU"],ds:["RB","TK","GW","AR"]},{c:"ESP",f:"U",r:"H",s:2.3,t:"C",dp:["QA"],ds:["AR","HR"]},{c:"EWT",f:"U",r:"R",s:2,t:"C",dp:["QA"],ds:["AR"]},{c:"EHN",f:"U",r:"C",s:1,t:"C",ds:["TK","GW"]},{c:"EFA",f:"T",r:"R",s:5,t:"S",ds:["MV"]},{c:"EFM",f:"T",r:"L",s:2.1,t:"C",dp:["FC","SP"],ds:["FR"]},{c:"EFP",f:"T",r:"L",s:1,t:"C",dp:["RK"],ds:["MV","TK","VG"]},{c:"EFE",f:"U",r:"L",s:5.2,t:"C",ds:["PL","TK","GW","UD"]},{c:"EXD",f:"N",r:"H",s:1,t:"S",ds:["LG","BN","SF"]},{c:"FWB",f:"U",r:"C",s:2.3,t:"C"},{c:"FWR",f:"U",r:"C",s:1,t:"C"},{c:"FFG",f:"U",r:"C",s:4,t:"C",ds:["DI"]},{c:"FST",f:"N",r:"R",s:4,t:"C",ds:["ZB","TK","VG"]},{c:"FWK",f:"N",r:"C",s:1,t:"C",ds:["ZB","TK","VG"]},{c:"FIN",f:"U",r:"C",s:1,t:"S",ds:["FC"]},{c:"FRR",f:"U",r:"H",s:1,t:"S",dp:["GW"]},{c:"FVA",f:"T",r:"H",s:1,t:"S",ds:["MV"]},{c:"FFU",f:"T",r:"H",s:1,t:"C",ds:["YT"]},{c:"FLH",f:"T",r:"C",s:4,t:"C",ds:["AS"]},{c:"FMS",f:"T",r:"C",s:2,t:"C",ds:["MV"]},{c:"FSM",f:"T",r:"H",s:1,t:"S",ds:["MS"],dn:["GW"]},{c:"FBC",f:"T",r:"L",s:1,t:"C",dp:["FC"],dn:["GW"]},{c:"FBI",f:"T",r:"H",s:2.2,t:"C",dp:["MT","SP"]},{c:"FFS",f:"T",r:"R",s:2,t:"C",ds:["AH"]},{c:"FJT",f:"T",r:"C",s:5,t:"S",dp:["UD"]},{c:"FLN",f:"T",r:"R",s:2,t:"S",ds:["BN"]},{c:"FRI",f:"T",r:"C",s:3,t:"C",dp:["WL"]},{c:"FSS",f:"T",r:"R",s:1,t:"C",dp:["MT"],ds:["BN"]},{c:"FLS",f:"T",r:"C",s:1,t:"C",dp:["SP"],ds:["BN"]},{c:"FSH",f:"T",r:"R",s:1,t:"C",ds:["AG","FC"]},{c:"FFD",f:"N",r:"H",s:1,t:"C",ds:["AB","TK","VG"]},{c:"FRV",f:"N",r:"H",s:3,t:"C",ds:["AB","RV","CS"]},{c:"FSC",f:"A",r:"C",s:6,t:"C",dp:["RB"],ds:["VG","AR"]},{c:"FSP",f:"A",r:"L",s:1,t:"C",ds:["UD"]},{c:"FPR",f:"T",r:"C",s:2.1,t:"C"},{c:"FFL",f:"A",r:"C",s:1,t:"S",ds:["AR"]},{c:"FGA",f:"A",r:"C",s:1,t:"C",ds:["RB","WL","VT"]},{c:"FGB",f:"A",r:"R",s:1,t:"C",ds:["RB","VT"]},{c:"FGD",f:"A",r:"H",s:3,t:"C",dp:["VT"],ds:["RB"]},{c:"FGG",f:"A",r:"H",s:1,t:"C",dp:["VT"],ds:["RB","TK"]},{c:"FOL",f:"A",r:"H",s:3.1,t:"C",dp:["MA"],ds:["CS"]},{c:"FPM",f:"A",r:"R",s:3,t:"C",ds:["RB","AR","CS"]},{c:"FPS",f:"A",r:"C",s:1,t:"C",ds:["RB","AR"]},{c:"FWS",f:"A",r:"H",s:6,t:"C",ds:["RB","AR"]},{c:"FFM",f:"T",r:"H",s:3,t:"C",dp:["MV"]},{c:"FMD",f:"T",r:"L",s:3,t:"C",dp:["RK"],ds:["TK","GW","MV","DR"]},{c:"FSK",f:"T",r:"C",s:2.3,t:"S",ds:["AH"]},{c:"FKS",f:"T",r:"H",s:6,t:"C",dp:["SQ"],ds:["YT","BN"]},{c:"FWT",f:"U",r:"H",s:1,t:"C",ds:["UD","FR","GW"]},{c:"FZS",f:"T",r:"R",s:1,t:"S",ds:["RV"]},{c:"GOS",f:"A",r:"L",s:4,t:"S",dp:["AR"]},{c:"GHS",f:"U",r:"C",s:2.2,t:"C",dp:["GW"],ds:["PL","SQ","LG"]},{c:"GHB",f:"U",r:"R",s:1,t:"C",ds:["DI","RV"]},{c:"GHR",f:"U",r:"H",s:4.2,t:"C",dp:["QT"],ds:["FC","LG","MV","DI"]},{c:"GRN",f:"N",r:"C",s:2,t:"S",ds:["RG"]},{c:"GTH",f:"N",r:"C",s:1,t:"S"},{c:"GSC",f:"U",r:"C",s:1,t:"C",ds:["PS"]},{c:"GMP",f:"A",r:"L",s:1,t:"C",ds:["MM","CD"]},{c:"GTT",f:"T",r:"L",s:2,t:"C",dp:["RK"],ds:["RV"]},{c:"GCL",f:"T",r:"C",s:1,t:"C",ds:["WL"]},{c:"GCR",f:"T",r:"C",s:2,t:"S",ds:["FR","BN"],dn:["WL","SQ"]},{c:"GLF",f:"N",r:"C",s:2,t:"C",ds:["AB"]},{c:"GRW",f:"N",r:"C",s:1,t:"C",dp:["AL"],ds:["RV"]},{c:"GSW",f:"N",r:"C",s:2,t:"C"},{c:"GVS",f:"U",r:"C",s:2,t:"C",ds:["VG","LG"]},{c:"GSS",f:"U",r:"C",s:1,t:"C",ds:["LG"]},{c:"GPV",f:"U",r:"C",s:6,t:"C",ds:["PL"],dn:["MV"]},{c:"GBG",f:"N",r:"C",s:1,t:"C",ds:["AB","VG","BN"]},{c:"GGE",f:"N",r:"C",s:2,t:"C"},{c:"GGH",f:"N",r:"C",s:1,t:"C",ds:["ZB","RG"]},{c:"GRP",f:"N",r:"R",s:1,t:"S",dp:["SF"],ds:["RV","FR"]},{c:"GGB",f:"N",r:"H",s:6,t:"C",dp:["DF"]},{c:"GGD",f:"N",r:"L",s:1,t:"C",dp:["SV","SB"]},{c:"GGR",f:"N",r:"L",s:3,t:"C",ds:["SF","MV","SV"]},{c:"GGP",f:"N",r:"H",s:1,t:"C",dp:["RV"],ds:["MV","SV"]},{c:"GGS",f:"N",r:"C",s:1,t:"C",ds:["MV"]},{c:"GGW",f:"N",r:"H",s:6.1,t:"C",dp:["SV"]},{c:"GRM",f:"N",r:"R",s:2,t:"S",ds:["GW"],dn:["GW"]},{c:"GHT",f:"U",r:"C",s:1,t:"C"},{c:"GMR",f:"U",r:"C",s:1,t:"C",ds:["TK","VG","PL"]},{c:"HMF",f:"T",r:"H",s:3,t:"C",ds:["YT","MV"]},{c:"HTR",f:"U",r:"L",s:1,t:"C",ds:["RG","SQ","PL"]},{c:"HAR",f:"A",r:"C",s:1,t:"C",ds:["AH"]},{c:"HFA",f:"N",r:"H",s:1,t:"C",dp:["MN"],ds:["AB","RG"]},{c:"HOD",f:"T",r:"R",s:3,t:"C",ds:["BN"],dn:["TK","LZ"]},{c:"HRM",f:"A",r:"H",s:6,t:"C",ds:["RB","AR"]},{c:"HWM",f:"A",r:"L",s:1,t:"C",dp:["AH"],ds:["MV","RG","AR"]},{c:"HOX",f:"N",r:"R",s:4,t:"S",dp:["UD"],ds:["BN","LG"]},{c:"HGS",f:"N",r:"R",s:1,t:"S",ds:["AH","AL"]},{c:"HTP",f:"U",r:"C",s:1,t:"C",ds:["TK","GW"]},{c:"IBF",f:"T",r:"R",s:1,t:"S",ds:["HR","GW"]},{c:"IGR",f:"T",r:"L",s:6.1,t:"S",ds:["TD","BN"]},{c:"ITO",f:"T",r:"R",s:2,t:"S",dp:["MT","SP"],ds:["FR","BN"]},{c:"IKA",f:"T",r:"L",s:6,t:"C",dp:["FB"],ds:["BN"]},{c:"IME",f:"N",r:"L",s:5,t:"S",ds:["TK","GW"]},{c:"IRT",f:"N",r:"L",s:6.1,t:"S",dp:["MN"],ds:["TD","RG","SL"]},{c:"IVS",f:"N",r:"C",s:4,t:"S",ds:["RG","SL"]},{c:"ICD",f:"N",r:"L",s:5,t:"C",dp:["RG"],ds:["VG","SV","MV"]},{c:"IWC",f:"A",r:"C",s:1,t:"C",ds:["RB","MV"]},{c:"IHA",f:"A",r:"L",s:2,t:"C",ds:["AR","AL"]},{c:"IBR",f:"A",r:"C",s:3,t:"C",dp:["UD"],ds:["AH"]},{c:"IMD",f:"A",r:"L",s:3,t:"C",ds:["RB","BN","MS"]},{c:"IMA",f:"A",r:"L",s:2.3,t:"C",dp:["CD"],ds:["FR"]},{c:"IZK",f:"T",r:"L",s:3,t:"C",ds:["FC","RP","BN"]},{c:"JPK",f:"A",r:"C",s:1,t:"S",dp:["UD"],ds:["AH","MV","FC"]},{c:"KDC",f:"T",r:"C",s:3,t:"C"},{c:"KSB",f:"T",r:"C",s:6,t:"C",ds:["DI"]},{c:"KAW",f:"T",r:"L",s:1.1,t:"C",dp:["SP"],ds:["XA"]},{c:"KOD",f:"N",r:"L",s:1,t:"C",dp:["LZ"],ds:["ZB"]},{c:"KBE",f:"U",r:"H",s:5,t:"C",ds:["PS","MV"]},{c:"KIW",f:"A",r:"L",s:3,t:"C",dp:["LV"]},{c:"KTS",f:"U",r:"H",s:4,t:"C",dp:["RP"],ds:["TK"]},{c:"KKK",f:"T",r:"L",s:2,t:"C",ds:["AG","FC"]},{c:"LOD",f:"U",r:"L",s:4,t:"S",ds:["PS"]},{c:"LFA",f:"T",r:"H",s:4,t:"C",ds:["FC","AH"]},{c:"LKP",f:"U",r:"L",s:1,t:"C",ds:["PL","TK"]},{c:"LGT",f:"N",r:"R",s:2.3,t:"C",dp:["SL"],ds:["ZB","RG"]},{c:"LLD",f:"N",r:"H",s:5,t:"C",dn:["FR"]},{c:"LLG",f:"U",r:"H",s:5,t:"C",dn:["MV"]},{c:"LLS",f:"A",r:"H",s:5,t:"C",ds:["RB"],dn:["TK","LZ"]},{c:"LLT",f:"T",r:"H",s:5,t:"C",dn:["LG"]},{c:"LBD",f:"U",r:"H",s:1,t:"C",dp:["GW"]},{c:"LSS",f:"U",r:"R",s:1,t:"C",dp:["MU"],ds:["UD"]},{c:"LBL",f:"U",r:"R",s:1,t:"C",ds:["LG"]},{c:"LBR",f:"T",r:"C",s:1,t:"S",dp:["FC"],ds:["AG"]},{c:"LSK",f:"T",r:"C",s:1,t:"S",ds:["BN"]},{c:"LWY",f:"T",r:"C",s:1,t:"C",ds:["AG"]},{c:"LSP",f:"A",r:"C",s:1,t:"C",dp:["AH"],ds:["AR"]},{c:"LCE",f:"A",r:"L",s:5,t:"S",ds:["CD"]},{c:"LUC",f:"T",r:"L",s:4.2,t:"C",dp:["MV"],ds:["XA","YT"]},{c:"LMV",f:"N",r:"L",s:1,t:"C",ds:["TK","LZ","GW"]},{c:"LHY",f:"U",r:"C",s:2,t:"C",ds:["RG"]},{c:"LYR",f:"U",r:"C",s:4,t:"S",ds:["LG","HR"]},{c:"LYS",f:"U",r:"R",s:3,t:"S",ds:["TD"]},{c:"MMH",f:"T",r:"C",s:1,t:"C"},{c:"MHR",f:"U",r:"L",s:5.1,t:"C",dp:["PS"],ds:["YT"]},{c:"MRF",f:"N",r:"C",s:1,t:"C"},{c:"MMG",f:"A",r:"L",s:6,t:"C",dp:["RB"],ds:["TK","AR"]},{c:"MOE",f:"T",r:"H",s:1,t:"C",dp:["SP"],ds:["FR"]},{c:"MXW",f:"A",r:"C",s:1,t:"C",ds:["RB","AH"]},{c:"MSP",f:"U",r:"R",s:2,t:"S",ds:["LG"]},{c:"MMA",f:"A",r:"C",s:1,t:"C",ds:["CD","MM"]},{c:"MMR",f:"A",r:"C",s:5,t:"C",dp:["MM"],ds:["CD"]},{c:"MMX",f:"A",r:"C",s:2,t:"C",ds:["MM","CD","VG"]},{c:"MMI",f:"A",r:"C",s:4,t:"C",ds:["MM"]},{c:"MMO",f:"A",r:"C",s:2,t:"C",ds:["MM"]},{c:"MMV",f:"A",r:"C",s:2.2,t:"C",ds:["MM","CD","RK"]},{c:"MPH",f:"U",r:"H",s:3,t:"S",ds:["RK","DR","RV","RP","TK","MV"]},{c:"MSC",f:"A",r:"H",s:1,t:"S",ds:["NT","FR"]},{c:"MTS",f:"A",r:"C",s:1.1,t:"S",ds:["LV","FR"]},{c:"MTT",f:"A",r:"C",s:2,t:"S",ds:["LV","AL"]},{c:"MML",f:"U",r:"H",s:2,t:"C",ds:["TK","GW","PL"]},{c:"MMW",f:"U",r:"L",s:2.2,t:"C",ds:["TK","GW"]},{c:"MBR",f:"A",r:"R",s:6,t:"C",dp:["MM"],ds:["CD"]},{c:"MDE",f:"N",r:"C",s:4,t:"C",ds:["AS","LG","BN"]},{c:"MBP",f:"U",r:"H",s:1,t:"C",ds:["HR","PL"]},{c:"MTD",f:"U",r:"R",s:6,t:"C",dp:["DI"]},{c:"MND",f:"A",r:"R",s:1,t:"C",ds:["RB","SQ","AH"]},{c:"NNS",f:"A",r:"R",s:3,t:"S",ds:["NT","AL"]},{c:"NGB",f:"T",r:"C",s:1,t:"C",ds:["HR"]},{c:"NGW",f:"T",r:"C",s:4,t:"C"},{c:"NSL",f:"U",r:"R",s:1,t:"S",dp:["GW"],ds:["RV"]},{c:"NCF",f:"N",r:"C",s:4,t:"S",ds:["FR"]},{c:"NCM",f:"N",r:"H",s:5,t:"C",ds:["MS","TK","RG","GW"]},{c:"NCS",f:"N",r:"R",s:1,t:"C"},{c:"NCW",f:"N",r:"C",s:1,t:"C"},{c:"NCV",f:"N",r:"C",s:1,t:"S",ds:["RG"]},{c:"NSW",f:"N",r:"L",s:3,t:"C",dp:["SF"],ds:["SQ","TK","GW"]},{c:"NDY",f:"N",r:"R",s:6,t:"S",dn:["SV"]},{c:"NEM",f:"N",r:"C",s:1,t:"S",ds:["LG","BN"]},{c:"NSH",f:"N",r:"L",s:2.3,t:"S",ds:["DR","RV","MV"],dn:["GW"]},{c:"NXA",f:"A",r:"L",s:3.1,t:"C",ds:["NX","AH","AR","MV"]},{c:"NXB",f:"A",r:"L",s:6.1,t:"S",dp:["MA"],ds:["NX","AR","TD"]},{c:"NXC",f:"A",r:"C",s:1,t:"C",ds:["RB","WL"]},{c:"NXG",f:"A",r:"H",s:3,t:"C",dp:["NX"],ds:["AH"]},{c:"NXO",f:"A",r:"C",s:5,t:"C",dp:["NX"],ds:["LV"]},{c:"NXP",f:"A",r:"C",s:1,t:"C",dp:["NX"]},{c:"NXT",f:"A",r:"H",s:2,t:"C",dp:["NX"],ds:["AR"]},{c:"NGT",f:"N",r:"R",s:2,t:"C",ds:["RG","SV"]},{c:"NGQ",f:"U",r:"L",s:4.1,t:"C",dp:["RP"],ds:["TK","GW","PL"]},{c:"NCL",f:"U",r:"R",s:1.1,t:"S",ds:["PS"],dn:["GW"]},{c:"NFF",f:"U",r:"L",s:2,t:"C",dp:["PL"],ds:["RP","SQ","TK"]},{c:"NAM",f:"N",r:"C",s:3,t:"C"},{c:"NOZ",f:"N",r:"R",s:2,t:"C",ds:["TK","VG"]},{c:"NSY",f:"N",r:"C",s:2.1,t:"C",ds:["RG"]},{c:"ONN",f:"N",r:"H",s:1.1,t:"S",dp:["ZB"]},{c:"OXA",f:"A",r:"H",s:2.3,t:"C",dp:["QN"],ds:["LV","SQ","RG"]},{c:"OXM",f:"A",r:"R",s:2,t:"C",dp:["QN"],ds:["RG","AR"]},{c:"OXP",f:"N",r:"H",s:2,t:"C",dp:["QA"],ds:["RG","AL","SQ"]},{c:"OBB",f:"T",r:"R",s:3,t:"S",dp:["QA"],ds:["LV"]},{c:"OEX",f:"A",r:"H",s:3,t:"S",dp:["QT"],ds:["FC","AH"],dn:["GW"]},{c:"OWH",f:"T",r:"H",s:3,t:"C",dp:["QA"],ds:["FC","MV","LV"]},{c:"OBD",f:"A",r:"H",s:1,t:"C",ds:["AR","RB"]},{c:"OFM",f:"A",r:"R",s:2.1,t:"C",ds:["AH"]},{c:"OJC",f:"A",r:"H",s:1.1,t:"C",ds:["AL"],dn:["TK","LZ"]},{c:"OPK",f:"A",r:"R",s:2,t:"C",ds:["RB","AR"]},{c:"OSV",f:"A",r:"H",s:4,t:"C",dp:["RP"],ds:["AR","RB"]},{c:"OSS",f:"A",r:"C",s:5,t:"S",dp:["UD"],ds:["AR"]},{c:"OWW",f:"A",r:"L",s:1,t:"C",ds:["RB"]},{c:"OHV",f:"N",r:"R",s:2,t:"C",ds:["AB","RV"]},{c:"ODC",f:"U",r:"L",s:2,t:"C",ds:["LG"]},{c:"OSP",f:"N",r:"R",s:2,t:"C",ds:["RG"]},{c:"OAP",f:"U",r:"L",s:6,t:"C",dp:["RK"],ds:["PS"]},{c:"OSL",f:"U",r:"C",s:3,t:"C",ds:["PL"]},{c:"OWF",f:"A",r:"H",s:2,t:"S",ds:["AH","GW"]},{c:"OXS",f:"U",r:"R",s:1,t:"C",ds:["DI"],dn:["AR"]},{c:"PHM",f:"A",r:"R",s:2,t:"C",ds:["AL"],dn:["GW"]},{c:"PPM",f:"A",r:"R",s:1,t:"C",ds:["AL","SQ"]},{c:"PSM",f:"A",r:"L",s:2.2,t:"C",dp:["NX"],ds:["MV","TK"]},{c:"PLW",f:"A",r:"R",s:4,t:"S",dp:["UD"],ds:["AL"],dn:["GW"]},{c:"POA",f:"A",r:"H",s:6.1,t:"C",dp:["MA"],ds:["AH"]},{c:"POD",f:"U",r:"H",s:6.1,t:"C",dp:["MU"],ds:["GW","TK"]},{c:"POK",f:"T",r:"H",s:6.1,t:"C",dp:["MT"],ds:["AH"]},{c:"POT",f:"N",r:"H",s:6.1,t:"C",dp:["MN"],dn:["GW"]},{c:"PRG",f:"N",r:"C",s:4,t:"C"},{c:"PRI",f:"A",r:"R",s:3,t:"S",dp:["LV"],ds:["TD"]},{c:"PHS",f:"A",r:"R",s:2.2,t:"C",dp:["AR"]},{c:"PHC",f:"T",r:"L",s:6.2,t:"S",ds:["MV","TK","BN"]},{c:"PTB",f:"U",r:"H",s:1,t:"S",ds:["PL","TK","GW"]},{c:"PLI",f:"N",r:"R",s:6,t:"C"},{c:"PSC",f:"U",r:"R",s:2,t:"C",ds:["PS","SQ"]},{c:"PSH",f:"N",r:"H",s:4,t:"C",ds:["RK","LZ","TK"]},{c:"PTR",f:"A",r:"R",s:2,t:"S",ds:["AH","FR"]},{c:"PSG",f:"U",r:"R",s:1,t:"S",ds:["FR"]},{c:"PMI",f:"T",r:"H",s:5.1,t:"C",ds:["BN"]},{c:"PMS",f:"T",r:"C",s:1,t:"S",ds:["AH"]},{c:"POX",f:"N",r:"H",s:4.2,t:"C",dp:["UD"],ds:["TK","VG","AB"]},{c:"PMP",f:"A",r:"R",s:6,t:"S",dp:["HL"],ds:["AR","AH"]},{c:"PYG",f:"T",r:"H",s:1,t:"C",dp:["FC"],ds:["AG"]},{c:"PYM",f:"T",r:"R",s:6,t:"C",dn:["LG"],ds:["BN"]},{c:"PYS",f:"T",r:"C",s:1.1,t:"S",dp:["GW"],dn:["GW"]},{c:"RBH",f:"T",r:"L",s:1,t:"C",dp:["FC"]},{c:"ROK",f:"T",r:"L",s:3.1,t:"S",dp:["MT"],ds:["TD"]},{c:"RHY",f:"U",r:"C",s:3,t:"C",ds:["RG"]},{c:"RTS",f:"T",r:"C",s:2.2,t:"C",ds:["MV","FC","DI"]},{c:"RLW",f:"U",r:"H",s:1,t:"C",dp:["WD"]},{c:"RHU",f:"A",r:"L",s:4.1,t:"C",ds:["RP","WL"]},{c:"RMB",f:"N",r:"L",s:6.2,t:"S",dp:["TD"],ds:["TK"]},{c:"RFL",f:"T",r:"R",s:1,t:"C",dp:["FC"]},{c:"RHC",f:"T",r:"C",s:1,t:"C",ds:["MV"]},{c:"ROG",f:"N",r:"H",s:1,t:"S",ds:["SV"]},{c:"RWC",f:"U",r:"C",s:4,t:"C",ds:["DI","TK","GW"]},{c:"RFA",f:"U",r:"H",s:1,t:"C",dp:["MU"]},{c:"RWD",f:"N",r:"C",s:5,t:"C",dp:["AL"],ds:["ZB"]},{c:"RSD",f:"U",r:"L",s:6.2,t:"C",ds:["SQ","GW","LG","DR"]},{c:"RSE",f:"T",r:"H",s:4.1,t:"C",dp:["FC"],ds:["AG"]},{c:"RBG",f:"U",r:"H",s:2,t:"C",dp:["LG"]},{c:"RGG",f:"U",r:"H",s:1,t:"C",dp:["RK"],ds:["PL"]},{c:"RSZ",f:"N",r:"R",s:1.1,t:"C",ds:["ZB","VG","SP"]},{c:"RSP",f:"T",r:"R",s:3,t:"C",ds:["CS","AG"]},{c:"RHW",f:"N",r:"C",s:3,t:"C",dp:["WD"]},{c:"SBF",f:"T",r:"H",s:4,t:"C",ds:["AG","XA"]},{c:"SAP",f:"A",r:"C",s:2,t:"S",ds:["AL"]},{c:"SVO",f:"U",r:"C",s:2.1,t:"S",dp:["MU"]},{c:"SSE",f:"U",r:"L",s:2.1,t:"C",ds:["PL","TK","GW"]},{c:"STS",f:"U",r:"C",s:3,t:"S",ds:["PL","TK","GW"]},{c:"SCS",f:"N",r:"C",s:1,t:"C",ds:["AB","RG"]},{c:"SMD",f:"T",r:"L",s:1,t:"C",ds:["DR","MV"]},{c:"SFS",f:"N",r:"L",s:1,t:"C",ds:["ZB","SF","RV"]},{c:"SHY",f:"N",r:"C",s:5,t:"C",ds:["MS"]},{c:"SCD",f:"A",r:"H",s:1,t:"C",ds:["RB","FR"]},{c:"SFT",f:"A",r:"H",s:1,t:"C",ds:["AR","RB"]},{c:"SOC",f:"N",r:"L",s:4,t:"S",ds:["AL"]},{c:"SOA",f:"A",r:"C",s:3,t:"S",dp:["CS"],ds:["AH"]},{c:"SOD",f:"U",r:"C",s:3,t:"S",dp:["CS"]},{c:"SOK",f:"T",r:"C",s:3,t:"S",dp:["CS"]},{c:"SOT",f:"N",r:"C",s:3,t:"S",dp:["CS"],ds:["BN"]},{c:"SAD",f:"T",r:"H",s:1,t:"C",ds:["FC"]},{c:"SCZ",f:"N",r:"R",s:6,t:"C",dp:["DF"],ds:["RG","ZB"]},{c:"SFE",f:"T",r:"H",s:6,t:"C",dp:["DF"],ds:["AG"]},{c:"SWS",f:"A",r:"H",s:6,t:"C",dp:["DF"],ds:["LV"]},{c:"SHA",f:"A",r:"R",s:6,t:"C",dp:["DF"],ds:["AR"]},{c:"SHG",f:"N",r:"L",s:2,t:"S",dp:["LZ"]},{c:"SBI",f:"U",r:"C",s:3,t:"C",dp:["UD"]},{c:"SCC",f:"U",r:"C",s:4,t:"C",dp:["RP"]},{c:"SPB",f:"U",r:"L",s:5,t:"C",dp:["HR"]},{c:"SPD",f:"U",r:"R",s:1,t:"C",dp:["SB"],ds:["DI"]},{c:"SPG",f:"U",r:"R",s:6.2,t:"S",ds:["SB"]},{c:"SPM",f:"U",r:"L",s:1,t:"C",dp:["UD"]},{c:"STD",f:"A",r:"H",s:2.2,t:"C",ds:["MM"],dn:["RG"]},{c:"STB",f:"T",r:"C",s:5,t:"S",ds:["BN"],dn:["AR"]},{c:"SHS",f:"U",r:"R",s:2.2,t:"C",dp:["AH"],ds:["PS"]},{c:"SSP",f:"U",r:"H",s:6,t:"C",dp:["DF"],ds:["PL","TK","GW"]},{c:"SGF",f:"N",r:"H",s:2.2,t:"C",dp:["SQ","SF"],ds:["AB","LG","BN"]},{c:"SKG",f:"A",r:"C",s:2,t:"C",ds:["NX","MV"]},{c:"SSD",f:"T",r:"L",s:5,t:"C",dp:["SQ"],ds:["DR"],dn:["GW"]},{c:"SDA",f:"U",r:"H",s:5,t:"C",ds:["TK","GW"]},{c:"SSR",f:"U",r:"L",s:2,t:"C",dp:["RK"],ds:["GW","FC"]},{c:"SNB",f:"A",r:"C",s:2.3,t:"S",dp:[],ds:[],dn:[]},{c:"SNP",f:"A",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SRD",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SSH",f:"U",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SRM",f:"N",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SRH",f:"N",r:"C",s:2.3,t:"C",dp:["AB"],ds:[],dn:[]},{c:"SDN",f:"N",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SHV",f:"N",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SRP",f:"N",r:"L",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"SGG",f:"N",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SBA",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SKB",f:"A",r:"C",s:1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SBR",f:"T",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SKS",f:"T",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SEL",f:"T",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"STM",f:"T",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SWA",f:"T",r:"H",s:6,t:"C",dp:["SP","MT"],ds:["MV","AH"]},{c:"SFG",f:"A",r:"L",s:6.2,t:"C",dp:["VT"],ds:["TK","RB"]},{c:"SBD",f:"U",r:"C",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"SCV",f:"N",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"SFM",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SSN",f:"A",r:"C",s:2.2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SSM",f:"T",r:"C",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"SLH",f:"N",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SRV",f:"N",r:"R",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"SSI",f:"A",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SND",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SNT",f:"N",r:"L",s:5.1,t:"C",dp:[],ds:[],dn:[]},{c:"STR",f:"N",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SPH",f:"N",r:"H",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"SSA",f:"N",r:"H",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"STO",f:"U",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SDR",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SOL",f:"U",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SOV",f:"T",r:"L",s:4,t:"S",dp:[],ds:["DR"],dn:[]},{c:"SHK",f:"T",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SWR",f:"A",r:"R",s:1,t:"C",dp:[],ds:["MM"],dn:[]},{c:"SMN",f:"T",r:"C",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SER",f:"A",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SES",f:"A",r:"L",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SFA",f:"A",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STG",f:"A",r:"L",s:2,t:"C",dp:[],ds:["DR","RB"],dn:[]},{c:"SSS",f:"A",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SSK",f:"A",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"SWG",f:"A",r:"C",s:4,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SWM",f:"A",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SIV",f:"U",r:"H",s:5.1,t:"S",dp:[],ds:[],dn:[]},{c:"STN",f:"T",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SGI",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SBG",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SCL",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SGA",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STP",f:"T",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"SSG",f:"U",r:"C",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SVH",f:"U",r:"C",s:2.3,t:"C",dp:[],ds:[],dn:[]},{c:"SIN",f:"U",r:"C",s:1.1,t:"S",dp:[],ds:[],dn:[]},{c:"SYL",f:"U",r:"H",s:2.2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"SEV",f:"N",r:"L",s:3.1,t:"C",dp:[],ds:[],dn:[]},{c:"SMA",f:"U",r:"C",s:5,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SML",f:"U",r:"C",s:1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SYO",f:"A",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TST",f:"T",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"TBA",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TGL",f:"U",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"TGS",f:"U",r:"C",s:2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TPT",f:"N",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"TDW",f:"N",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"TNL",f:"N",r:"L",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"TEX",f:"A",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TGN",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TSM",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TUP",f:"A",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TAB",f:"T",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TGI",f:"T",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TDS",f:"U",r:"L",s:1.1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"TSP",f:"T",r:"H",s:4.2,t:"S",dp:["DI"],ds:[],dn:[]},{c:"TPG",f:"N",r:"H",s:3.1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"TMG",f:"U",r:"R",s:3,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TMM",f:"U",r:"C",s:5,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TRA",f:"A",r:"R",s:5,t:"C",dp:[],ds:["MM"],dn:[]},{c:"TRS",f:"U",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TRV",f:"T",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TRW",f:"N",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TBB",f:"T",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TOB",f:"N",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TWS",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TVG",f:"A",r:"R",s:1.1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"TXB",f:"U",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"TXS",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TCG",f:"T",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"TMS",f:"U",r:"H",s:6,t:"C",dp:["SB"],dn:["BN"]},{c:"TBC",f:"T",r:"H",s:6.2,t:"S",ds:["AH","MS"]},{c:"TWT",f:"A",r:"C",s:3,t:"C",dp:[],ds:["RB"],dn:[]},{c:"TRN",f:"T",r:"H",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"TGK",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TSL",f:"U",r:"H",s:3,t:"C",dp:["PL"],ds:["TK","GW"]},{c:"TWG",f:"U",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"UGM",f:"U",r:"C",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"USY",f:"T",r:"R",s:6,t:"C",dp:["DF"],ds:["YT","MV"]},{c:"UGL",f:"T",r:"R",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UIC",f:"T",r:"H",s:2.3,t:"C",dp:[],ds:["DI"],dn:[]},{c:"ULR",f:"U",r:"H",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"URD",f:"N",r:"H",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"UBL",f:"T",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"UCM",f:"T",r:"R",s:1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UEM",f:"T",r:"C",s:4,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UHS",f:"T",r:"H",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UIM",f:"T",r:"C",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UWL",f:"T",r:"H",s:2,t:"C",dp:["YT"],ds:[],dn:[]},{c:"UWS",f:"T",r:"R",s:2.3,t:"C",dp:["YT"],ds:[],dn:[]},{c:"UIW",f:"A",r:"L",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"URS",f:"U",r:"C",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"UTM",f:"U",r:"C",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UTR",f:"U",r:"H",s:2,t:"C",dp:["DI"],ds:[],dn:[]},{c:"URB",f:"U",r:"L",s:2.3,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UPM",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VIC",f:"T",r:"L",s:6,t:"C",ds:["MV","FR"],dn:["TD"]},{c:"VIK",f:"N",r:"L",s:5.2,t:"C",dp:[],ds:[],dn:[]},{c:"VRP",f:"N",r:"L",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"VBK",f:"A",r:"R",s:2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"VIN",f:"A",r:"C",s:6,t:"C",ds:["RB"]},{c:"VTC",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VTW",f:"A",r:"R",s:4,t:"C",dp:[],ds:["RB"],dn:[]},{c:"VGN",f:"N",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VND",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"VNF",f:"U",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"VNS",f:"U",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"VSK",f:"U",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"VCH",f:"U",r:"H",s:4.1,t:"S",dp:[],ds:[],dn:[]},{c:"VGR",f:"U",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"VSP",f:"U",r:"C",s:6,t:"S",ds:["LG"]},{c:"VGL",f:"N",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"VGW",f:"U",r:"R",s:6,t:"C",dp:["HR"],ds:["GW"]},{c:"VOB",f:"T",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"VCG",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VES",f:"N",r:"L",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"VYE",f:"N",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"WBY",f:"T",r:"R",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"WBU",f:"T",r:"C",s:1.1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"WMC",f:"A",r:"H",s:5,t:"C",dp:[],ds:["RB"],dn:[]},{c:"WMR",f:"A",r:"H",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"WTK",f:"A",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"WMM",f:"A",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WTW",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WTA",f:"U",r:"L",s:4,t:"C",dp:[],ds:["PL"],dn:[]},{c:"WWP",f:"U",r:"H",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WWR",f:"U",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"WOD",f:"U",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"WFM",f:"T",r:"H",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WWS",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WBH",f:"T",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WCS",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WPD",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WSE",f:"T",r:"L",s:5.1,t:"C",dp:[],ds:[],dn:[]},{c:"WPC",f:"A",r:"H",s:6.2,t:"S",ds:["TD"],dp:["NT"]},{c:"WFB",f:"N",r:"C",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WFS",f:"N",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WBG",f:"N",r:"L",s:1.1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XTE",f:"N",r:"L",s:6,t:"C",dp:["MN"],ds:["TK","LZ"]},{c:"XCR",f:"N",r:"C",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XDH",f:"N",r:"R",s:3,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XHS",f:"N",r:"C",s:2.2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XHU",f:"N",r:"C",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XRF",f:"N",r:"C",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XSH",f:"N",r:"L",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XTR",f:"N",r:"H",s:5.1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XDV",f:"N",r:"H",s:1,t:"C",dp:["ZB"],ds:[],dn:[]},{c:"XRW",f:"N",r:"H",s:2,t:"S",dp:["ZB"],ds:[],dn:[]},{c:"YWC",f:"T",r:"C",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"YNS",f:"N",r:"L",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"ZXR",f:"T",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"ZPM",f:"T",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"ZTU",f:"N",r:"L",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZDK",f:"N",r:"H",s:6,t:"C",dp:["RG"],ds:["ZB"]},{c:"ZIN",f:"N",r:"C",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZMT",f:"N",r:"C",s:3,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZSH",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]}],ti=[["ASQ",["SLG","SLG"]],["CGL",["CGF"]],["DHC",["DYF"]],["DTD",["TOT"]],["FGD",["FGA","FGB","FGG"]],["IBA",["AVB"]],["IZK",["IFL","IFR"]],["RHU",["RSC"]],["SLS",["MMY"]],["TSL",["FUN"]],["WHR",["WHC"]]];class ei{raw={["C"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0},["S"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0}};addStat(t,e){this.raw[t][e]++}g(t,e){return this.raw[t][e]}typeSum(t){return xe.map(e=>this.g(t,e)).reduce((e,i)=>e+i,0)}getTotal(){const t=this.typeSum("C"),e=this.typeSum("S");return[t,e,t+e]}getFactTotal(t){const e=this.g("C",t),i=this.g("S",t);return[e,i,e+i]}}const c=(n,t)=>({card:n,num:t}),bi={name:"Official 1 - 3",id:"SBE1",decks:[{name:"Alloyin Starter",factions:["A"],cards:[c("SYO",1),c("BSS",1),c("SFT",2),c("SNP",2),c("TSM",2),c("SSS",2),c("ALG",2),c("MXW",3),c("TUP",3),c("FPS",3),c("MND",3),c("IWC",3),c("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[c("SFS",1),c("GGD",1),c("FFD",3),c("EPD",2),c("CCR",2),c("HGS",2),c("DSS",2),c("BWK",2),c("GBG",3),c("DSK",3),c("GRP",3),c("VGN",3),c("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[c("FBC",1),c("RBH",1),c("CFB",3),c("FSM",2),c("FSH",2),c("FSS",2),c("PMS",2),c("RFL",2),c("UBL",3),c("WPD",3),c("SGI",3),c("AMY",3),c("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[c("UPM",1),c("EHW",1),c("FRR",3),c("SPD",2),c("HTP",2),c("LSS",2),c("SDR",2),c("SRD",2),c("FWR",3),c("DBP",3),c("GHT",3),c("GSS",3),c("TXS",3)]},{name:"Cruel Corrosion",factions:["A","N"],cards:[c("IHA",1),c("WBG",1),c("OXP",1),c("DFR",1),c("APM",1),c("SNP",1),c("GRM",2),c("ETN",2),c("DHW",2),c("OXM",2),c("AEN",2),c("ATG",2),c("CTI",2),c("CTW",2),c("FPS",2),c("GRW",2),c("MTT",2),c("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[c("ZTU",1),c("VRP",1),c("GGP",1),c("EPD",1),c("DBT",1),c("BSM",1),c("TDW",2),c("NGT",2),c("UBL",2),c("FWK",2),c("BZD",2),c("CSB",2),c("SLH",2),c("MMH",2),c("LSK",2),c("GBG",2),c("CFG",2),c("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[c("TDS",1),c("SSR",1),c("FRR",1),c("ULR",1),c("UTR",1),c("BTM",1),c("UGL",2),c("EHN",2),c("SPD",2),c("GHB",2),c("FLN",2),c("SML",2),c("RFL",2),c("OXS",2),c("UTM",2),c("TWG",2),c("ENR",2),c("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[c("CSW",1),c("SMD",1),c("FRR",1),c("UIC",1),c("CFB",1),c("UGL",2),c("FSH",2),c("FLN",2),c("WPD",1),c("TWG",2),c("TCG",2),c("TGS",2),c("SML",2),c("SVH",1),c("SCL",2),c("RTS",1),c("FWB",2),c("ENR",2),c("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[c("IMA",1),c("GMP",1),c("OXA",1),c("EPD",1),c("OJC",1),c("ESU",2),c("OXM",2),c("MMA",2),c("SAP",1),c("AFO",2),c("GBG",2),c("CTW",2),c("SRH",1),c("TSM",2),c("SLH",1),c("MTT",1),c("DCR",1),c("DFB",1),c("BSR",1),c("LGT",1),c("XRF",2),c("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[c("SBG",1),c("NSH",1),c("FFU",1),c("EWE",1),c("BFM",1),c("WBH",1),c("UWS",1),c("TGI",2),c("RFL",2),c("GRM",1),c("ASG",1),c("YWC",2),c("XRF",2),c("WPD",2),c("WCS",2),c("WBU",2),c("TCG",1),c("FSK",1),c("SLH",2),c("CFG",1),c("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[c("URB",1),c("AGK",1),c("ESP",1),c("FRR",1),c("NXT",1),c("ALG",1),c("FGB",1),c("PHS",2),c("TUP",1),c("EWT",2),c("PTR",1),c("VBK",1),c("AGC",1),c("AEN",2),c("ETN",1),c("FPS",2),c("MXW",2),c("GHT",1),c("TWG",2),c("SNB",1),c("SML",1),c("JPK",1),c("ENR",1),c("IWC",1)]},{name:"Spare Parts",factions:["N"],cards:[c("SEV",1),c("SHG",1),c("TPG",1),c("CGL",1),c("FRV",1),c("HFA",2),c("XDH",1),c("GRM",1),c("SCV",1),c("DFB",2),c("EBW",2),c("GBG",2),c("GLF",2),c("XHS",2),c("SOT",1),c("XRF",2),c("SCS",1),c("ZMT",1),c("SLH",1),c("VYE",1),c("XCR",2),c("XHU",1)]},{name:"Future Forged",factions:["A"],cards:[c("NXA",1),c("IMD",1),c("FOL",1),c("SFA",2),c("SFT",1),c("SCD",1),c("CAG",1),c("ESU",1),c("NNS",1),c("FPM",1),c("PRI",1),c("SSS",1),c("CTG",1),c("TSM",2),c("IWC",1),c("MMA",2),c("TGN",2),c("MTT",1),c("SKG",1),c("AFO",1),c("MMV",1),c("TWS",1),c("SBA",2),c("SSK",1),c("JPK",1)]},{name:"Burning Rage",factions:["T"],cards:[c("ROK",1),c("KKK",1),c("MOE",1),c("AFR",1),c("FBI",1),c("FSS",2),c("FLN",2),c("CCT",2),c("BRN",2),c("WPD",2),c("SSM",2),c("SOK",1),c("RTS",2),c("FSK",2),c("CWK",2),c("CFG",2),c("BSW",2),c("FMS",2)]},{name:"Awakened Fury",factions:["U"],cards:[c("DZD",1),c("SSE",1),c("BTR",1),c("TSL",1),c("MPH",1),c("CDT",1),c("DYB",1),c("BTH",2),c("TMG",2),c("BWD",2),c("RHY",2),c("SBD",2),c("GMR",2),c("STS",1),c("OSL",2),c("SBI",2),c("LYS",2),c("TGS",2),c("SOD",2)]}]},Ai={name:"Official 4 - 6",id:"SBE2",decks:[{name:"Titan's Assault",factions:["N","T"],cards:[c("ATT",1),c("TNL",1),c("RSE",1),c("SPH",1),c("SCV",2),c("ABB",2),c("TBB",2),c("BRN",2),c("FLN",2),c("CMF",2),c("XDH",2),c("FST",2),c("TAB",2),c("MDE",2),c("FSK",2),c("FLH",2),c("CBB",2)]},{name:"Verdant Fortress",factions:["A","U"],cards:[c("NGQ",1),c("RHU",1),c("VCH",1),c("ESG",1),c("PLW",2),c("NNS",2),c("SND",2),c("WOD",2),c("IBR",2),c("BWD",2),c("SBI",2),c("RWC",2),c("TEX",2),c("SER",2),c("SWG",2),c("SCC",2),c("DYB",2)]},{name:"Umbruk Uprising",factions:["T","U"],cards:[c("LUC",1),c("BWT",1),c("GHR",1),c("TSP",1),c("WBH",1),c("COD",1),c("SDR",1),c("ZPM",1),c("OXS",1),c("WOD",1),c("RWC",2),c("SSG",2),c("VGR",2),c("CFG",2),c("UEM",2),c("FFG",2),c("UGL",2),c("DMR",2),c("RTS",2),c("CWK",2)]},{name:"Onyxium Twilight",factions:["A","N"],cards:[c("EPH",1),c("DTD",1),c("POX",1),c("DDS",1),c("OHV",1),c("PHS",1),c("DFB",1),c("TDW",1),c("CAG",1),c("ALG",1),c("TUP",2),c("CTW",2),c("XCR",2),c("SSK",2),c("SRH",2),c("ATG",2),c("MTT",2),c("SLH",2),c("GLF",2),c("AFO",2)]},{name:"Blistering Chaos",factions:["T","U"],cards:[c("WSE",1),c("MHR",1),c("PMI",1),c("SIV",1),c("BRN",1),c("HOD",1),c("CHA",1),c("LYS",1),c("TRS",2),c("PSC",2),c("FLN",2),c("EFA",2),c("SHS",2),c("TXB",2),c("VNF",2),c("CFG",2),c("FSK",2),c("CBB",2),c("VND",2)]},{name:"Dark Retribution",factions:["A","N"],cards:[c("AAA",1),c("SNT",1),c("ABE",1),c("XTR",1),c("CNT",1),c("HOX",1),c("PLW",1),c("AGW",1),c("OHV",2),c("OXM",2),c("XDH",2),c("VGL",2),c("ETN",2),c("MTT",2),c("VYE",2),c("DSK",2),c("BFT",2),c("ATZ",2),c("IBR",2)]},{name:"Iron Tide",factions:["A","U"],cards:[c("EFE",1),c("DPB",1),c("HWM",1),c("HTR",1),c("OJC",1),c("RBG",1),c("EWT",1),c("CIN",1),c("TGK",2),c("CAG",2),c("TGN",3),c("SCC",3),c("URS",3),c("LSP",3),c("TSM",3),c("TMM",3)]},{name:"Dragon Forge",factions:["N","T"],cards:[c("DGW",1),c("VIK",1),c("DDD",1),c("SMD",1),c("FFM",1),c("SHV",1),c("GRP",1),c("TGI",1),c("SLH",1),c("WBH",2),c("BZD",2),c("EFA",2),c("WFB",3),c("BZS",3),c("CCR",3),c("DSK",3),c("RHC",3)]},{name:"Call of Deepwood",factions:["U"],cards:[c("EVT",1),c("POD",1),c("RFA",1),c("TMS",1),c("LSS",1),c("DYB",1),c("TRS",1),c("VGW",1),c("UTM",2),c("RHY",2),c("SMA",2),c("TMM",2),c("BBN",2),c("GHS",2),c("SBI",2),c("BTS",2),c("STS",2),c("SVO",2),c("GMR",2)]},{name:"Kadras' Fury",factions:["T"],cards:[c("IGR",1),c("POK",1),c("SWA",1),c("SGA",1),c("FLN",1),c("TRV",1),c("FSS",1),c("AWU",1),c("STB",2),c("CFG",2),c("BBL",2),c("KSB",2),c("NGW",2),c("ATS",2),c("ABR",2),c("BSW",2),c("TCG",2),c("CBB",2),c("WPD",2)]},{name:"Tarsus Unleashed",factions:["N"],cards:[c("IRT",1),c("POT",1),c("ZDK",1),c("HFA",1),c("GRM",1),c("DSS",1),c("TRW",1),c("ABB",1),c("XCR",2),c("CSB",2),c("SHY",2),c("BBD",2),c("EBW",2),c("NSY",2),c("TPT",2),c("XRF",2),c("GGS",2),c("ZMT",2),c("IVS",2)]},{name:"Might of Anvillon",factions:["A"],cards:[c("NXB",1),c("FWS",1),c("POA",1),c("SFA",1),c("SSS",1),c("TRA",1),c("BTB",1),c("BWH",1),c("TWT",2),c("TEX",2),c("IBR",2),c("VIN",2),c("BBR",2),c("NXP",2),c("CBS",2),c("FPS",2),c("ATG",2),c("SNB",2),c("SSK",2)]},{name:"Nature's Defenses",factions:["T","U"],cards:[c("RSD",1),c("PHC",1),c("SPG",1),c("TBC",1),c("GHR",1),c("NGB",1),c("DDF",1),c("VGW",3),c("UEM",3),c("FSK",2),c("TMM",2),c("VSP",2),c("BZS",2),c("SPD",3),c("RTS",3),c("TGK",3)]},{name:"Unlikely Alliance",factions:["A","N"],cards:[c("RMB",1),c("SFG",1),c("GGW",1),c("WPC",1),c("SBA",2),c("IBR",1),c("BSR",1),c("MMV",1),c("CRC",1),c("BSP",1),c("NNS",1),c("XDH",2),c("EBW",2),c("SLH",2),c("CTG",3),c("XRF",3),c("OHV",3),c("TSM",3)]}]},ki={name:"Set 1 & 2 Tournies",id:"T1309",decks:[{name:"Axel: Lifegain",factions:["T","U"],cards:[c("AGD",3),c("EHW",3),c("FRR",3),c("FIN",1),c("UPM",1),c("LKP",2),c("BTM",2),c("LBL",3),c("GSS",3),c("RFA",3),c("GHB",3),c("EFP",3)]},{name:"Derk: Metaminds",factions:["A"],cards:[c("OJC",3),c("DMW",3),c("MMV",3),c("JPK",3),c("MMO",3),c("GMP",3),c("ALS",3),c("MMA",3),c("SFA",3),c("BTN",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[c("DBP",3),c("EHW",2),c("FRR",3),c("FWT",3),c("UPM",3),c("LKP",2),c("BTM",3),c("HTR",2),c("LBD",2),c("RFA",3),c("GHB",2),c("SDR",2)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[c("ALS",3),c("TDS",3),c("FRR",3),c("WWP",3),c("SML",2),c("BSG",3),c("JPK",2),c("ODC",3),c("NXT",2),c("WMM",3),c("GHB",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[c("SCS",3),c("ROG",1),c("GGP",1),c("GGD",3),c("WFS",1),c("DSS",3),c("ZTU",1),c("GBG",3),c("HFA",3),c("EXD",1),c("EPD",1),c("BSR",1),c("MRF",2),c("HGS",3),c("GTH",3)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[c("SHK",3),c("MOE",3),c("FRR",3),c("LSK",3),c("FFU",3),c("UBL",3),c("WWS",3),c("FSS",3),c("ENR",3),c("MMH",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[c("DBP",2),c("EHW",2),c("FRR",3),c("HTP",2),c("UPM",3),c("LKP",2),c("GHT",3),c("GGP",2),c("LBD",1),c("EPD",2),c("DBT",2),c("SPD",3),c("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[c("IWC",3),c("FSS",3),c("ETN",1),c("WPD",2),c("FSM",1),c("AHL",1),c("UBL",3),c("SMD",2),c("BTN",3),c("LSK",1),c("MMH",3),c("FFU",1),c("TSM",3),c("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[c("DSS",3),c("FSS",3),c("EPD",2),c("GTH",3),c("FSM",1),c("MOE",1),c("UBL",3),c("GGP",3),c("GBG",1),c("LSK",3),c("HGS",1),c("CTW",1),c("SHK",3),c("GGD",1),c("DBT",1)]}]},vi={name:"The Forge",id:"TG10",decks:[{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[c("BWK",3),c("TDS",2),c("FRR",3),c("WWP",3),c("GGP",3),c("GGD",3),c("DBT",1),c("WFS",3),c("CTW",3),c("EPD",3),c("GHB",3)]},{name:"ErrorAsh: Burn",factions:["N","T"],cards:[c("UBL",2),c("EFM",2),c("FBI",3),c("ESK",3),c("FLN",3),c("EFP",3),c("MOE",3),c("FSS",3),c("SHK",3),c("EPD",3),c("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[c("WWS",3),c("DYB",3),c("FRR",3),c("SYL",3),c("EPD",3),c("SSE",2),c("NSH",2),c("TDW",3),c("NFF",2),c("CHR",2),c("LKP",2),c("EXD",2)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[c("NSH",2),c("SMD",2),c("DDD",3),c("TDW",3),c("VRP",3),c("WCS",3),c("BSM",3),c("SHG",2),c("TGI",2),c("EPD",3),c("FVA",2),c("DBT",1),c("TRN",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[c("UWL",3),c("FFU",3),c("WBY",3),c("UIM",3),c("WBU",3),c("SSR",1),c("TRN",1),c("GTT",1),c("GCR",3),c("FRR",3),c("UBL",3),c("WWP",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[c("DDD",3),c("DBT",3),c("EPD",3),c("EFP",3),c("GGP",3),c("LSK",3),c("SHK",3),c("UBL",3),c("WCS",3),c("ZTU",3)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[c("XSH",3),c("SPM",3),c("FRR",3),c("ODC",3),c("SSE",3),c("ESK",3),c("TGS",3),c("XRF",3),c("VRP",3),c("URB",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[c("RBH",3),c("TDS",3),c("FRR",3),c("WWP",3),c("EFP",3),c("AMY",2),c("FVA",2),c("ENR",3),c("ZSH",3),c("EHW",3),c("GHB",2)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[c("BWK",2),c("KOD",2),c("CYC",3),c("GRM",3),c("VYE",3),c("XRW",3),c("MOE",2),c("ZTU",3),c("BSM",3),c("EPD",3),c("DSS",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[c("AGM",3),c("TDS",2),c("FRR",3),c("WWP",3),c("CSW",3),c("FLN",3),c("EFP",2),c("UWL",3),c("WBY",2),c("WCS",2),c("EHW",2),c("SHS",2)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[c("UHS",2),c("FLN",3),c("STG",3),c("CRC",3),c("SHK",3),c("EFP",2),c("WMR",2),c("WMM",3),c("JPK",3),c("SMD",3),c("FVA",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[c("LSK",2),c("WBG",3),c("EPD",3),c("DDD",3),c("SHK",3),c("EFP",3),c("ZTU",2),c("GGD",2),c("GGP",3),c("CTW",3),c("DBT",3)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[c("DMW",3),c("GMP",3),c("MMA",3),c("MMV",2),c("TDW",3),c("VRP",3),c("EPD",3),c("SHG",2),c("OJC",2),c("ESK",2),c("CHV",2),c("CTW",2)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[c("CTW",1),c("GCR",1),c("CFG",1),c("FZS",1),c("FBI",3),c("MOE",3),c("EFP",3),c("LSK",3),c("FLN",3),c("SHK",3),c("RTS",3),c("GGP",3),c("UBL",2)]}]},Ti={name:"Fundecks",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[c("DFB",3),c("BSR",3),c("HGS",3),c("HFA",3),c("FFD",3),c("XSH",3),c("XHU",3),c("WBG",3),c("GBG",3),c("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[c("TBA",3),c("SVH",3),c("MBP",2),c("FSH",3),c("RBH",3),c("FBC",3),c("LBR",2),c("CFB",3),c("AAK",3),c("KKK",2),c("FRR",1),c("FIN",1),c("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[c("MMA",3),c("DMW",3),c("GMP",3),c("SYO",3),c("KAW",3),c("SHK",3),c("CTL",2),c("CAG",2),c("MSC",2),c("MTS",2),c("ASG",2),c("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[c("CTV",3),c("TDW",3),c("BTS",3),c("CHR",3),c("GMR",3),c("KOD",2),c("LKP",2),c("SHV",2),c("DBA",2),c("CCR",2),c("PTB",2),c("FIN",1),c("DBT",2)]},{name:"Voltron",factions:["A"],cards:[c("FGA",3),c("FGB",3),c("FGD",3),c("FGG",3),c("AFS",3),c("BSS",3),c("PRI",3),c("TUP",2),c("JPK",2),c("BWH",2),c("SFT",3)]},{name:"Do Fear The Reaper",factions:["A","N"],cards:[c("CTI",3),c("DFR",3),c("GRW",3),c("LGT",3),c("OXM",3),c("OXP",3),c("PHM",3),c("CTW",2),c("NNS",2),c("OXA",2),c("SDN",3)]},{name:"Muadib",factions:["N","U"],cards:[c("DBA",3),c("DYL",3),c("GSW",3),c("LBD",3),c("MMW",3),c("NCW",3),c("SRV",3),c("LBL",2),c("MSP",2),c("VYE",2),c("SBD",3)]},{name:"Triassic Park",factions:["T","U"],cards:[c("URB",3),c("UTR",3),c("UTM",3),c("ULR",3),c("UIC",3),c("UGL",3),c("RTS",3),c("BRN",2),c("LBR",2),c("IBF",2),c("GHB",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[c("DDD",3),c("WBH",3),c("HMF",3),c("WCS",3),c("GGP",3),c("SAD",3),c("SDN",3),c("EWE",3),c("SBG",3),c("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[c("WWP",3),c("EHN",2),c("SDR",2),c("HTR",2),c("MML",2),c("HTP",2),c("SHS",3),c("MND",2),c("NXC",2),c("CDT",2),c("PTB",2),c("SVO",2),c("MPH",2),c("SYO",2)]},{name:"Braaiins",factions:["N"],cards:[c("XDV",3),c("XRW",3),c("ONN",2),c("SLH",2),c("FWK",2),c("BWK",2),c("URD",2),c("TPG",2),c("DSS",2),c("KOD",2),c("ZMT",2),c("RSZ",2),c("BLW",2),c("CSB",2)]},{name:"Wanderin",factions:["N","U"],cards:[c("LYS",3),c("STR",2),c("MBP",2),c("OSL",2),c("RLW",3),c("SSR",1),c("SVO",2),c("SSE",2),c("RHW",3),c("SYL",2),c("TGS",2),c("TMG",3),c("XDH",3)]},{name:"Walls",factions:["A","T"],cards:[c("CDC",3),c("CTG",3),c("CRC",3),c("DCS",3),c("FRI",3),c("FGA",2),c("OBB",3),c("FVA",2),c("TGN",2),c("OWH",3),c("STN",3)]},{name:"Snakes In A Lane",factions:["A","U"],cards:[c("AFO",3),c("DSV",3),c("PSC",3),c("SHS",3),c("STO",3),c("NCL",2),c("VNF",3),c("LYS",2),c("SVO",1),c("VNS",3),c("TXS",2),c("ART",2)]},{name:"Benny & Izzy",factions:["A","T"],cards:[c("BRN",3),c("EFM",2),c("IZK",3),c("JPK",1),c("MTT",1),c("NNS",1),c("OBB",2),c("OWF",2),c("OEX",3),c("PRI",2),c("PTR",1),c("TST",1),c("FLS",2),c("BLH",3),c("SHK",3)]}]},ye=[bi,Ai,ki,vi,Ti];class Be{state;constructor(t){this.state=t}getState(){return this.state}get adjacent(){return g.adjacentPositions(this.lane)}get attack(){return this.state.attack+this.modSum("AT")}get activationAvailable(){return this.state.negateActivate?!1:this.state.activationAvailable}set activationAvailable(t){this.state.activationAvailable=t}get aggressive(){return this.state.aggressive||this.modBool("AG")}set aggressive(t){this.state.aggressive=t}get armor(){return this.negateArmor?0:this.state.armor+this.modSum("AR")}get armorDmg(){return this.state.armorDmg}set armorDmg(t){this.state.armorDmg=t}get breakthrough(){return this.state.breakthrough||this.modBool("BT")}set breakthrough(t){this.state.breakthrough=t}get changed(){return this.state.changed||this.negateDefender||this.negateArmor||this.negateActivate||this.negateMobility||this.negateRegen||this.state.triggers.some(t=>t.changes)}set changed(t){this.state.changed=t}get code(){return this.state.code}get defender(){return this.negateDefender?!1:this.state.defender||this.modBool("DF")}set defender(t){this.negateDefender||(this.state.defender=t,this.enforceEffects("DF"))}get effects(){return this.state.effects}get extraBattles(){return this.state.extraBattles}set extraBattles(t){this.state.extraBattles=t}get faction(){return L.getCard(this.code).faction}get health(){return this.state.health+this.modSum("HL")}get id(){return this.state.id}get isActive(){return!this.sleeping||this.aggressive}isTribe(t){return L.getCard(this.code).isTribe(t)}get lane(){return this.state.lane}get level(){return L.getCard(this.code).level}get maxHealth(){return this.state.maxHealth+this.modSum("MH")}get mobility(){return this.negateMobility?0:this.state.mobility+this.modSum("MB")}get mobilityAvailable(){return this.state.mobilityAvailable}set mobilityAvailable(t){this.state.mobilityAvailable=t}get mods(){return this.state.mods}get negateActivate(){return this.state.negateActivate}set negateActivate(t){this.state.negateActivate=t}get negateArmor(){return this.state.negateArmor||this.modBool("NA")}set negateArmor(t){this.state.negateArmor=t,this.enforceEffects("AR")}get negateDefender(){return this.state.negateDefender||this.modBool("ND")}set negateDefender(t){this.state.negateDefender=t,this.enforceEffects("DF")}get negateMobility(){return this.state.negateMobility||this.modBool("NM")}set negateMobility(t){this.state.negateMobility=t}get negateRegen(){return this.state.negateRegen}set negateRegen(t){this.state.negateRegen=t}get opposed(){const t=y.crTarg();return t.player=k.toTarget(!this.owner),t.lanes=g.oppositeLane(this.lane),g.creatByTarget(t)[0]}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get rank(){return 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,i=void 0){t!==0&&(this.state.attack+=t,this.enforceEffects("AT")),e!==0&&(this.state.health+=e,this.state.maxHealth+=e,this.enforceEffects("CH"),W.deathProdder(this,i),e>0&&x.addEvents($.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($.creatHeal(this,e)),e}setHealth(t){this.state.health=t}hurt(t,e=!1){if(t<1)return[0,0];const i=Math.max(Math.min(t,this.armor-this.armorDmg),0);let s=t-i,h=this.health-s;this.state.armorDmg+=i;let f=0;return e&&h<0&&(f=s-this.health,s=this.health),s>0&&(this.state.health-=s,this.enforceEffects("CH")),[s,f]}hurtBattle(t,e,i=!1){const s=this.hurt(t,i);return s[0]>0&&x.addEvents($.damage(!0,s[0],this.health,!0,!0,this,e)),s[1]}hurtDirect(t,e,i=void 0){const s=this.hurt(t,!1);return s[0]>0&&(p.new().crd(e).txt(` dealt ${t} dmg to `).crd(this.code).txt(".").go(),x.addEvents($.damage(!1,s[0],this.health,!1,!0,this,void 0)),W.deathProdder(this,i)),s[0]}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),W.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF")}modSum(t){return y.modSum(this.mods,t)}modBool(t){return y.modBool(this.mods,t)}hasMod(t){return y.hasModG(this.mods,t)}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){y.hasMod(this.mods,t)||this.addMod(t)}removeMod(t){const e=this.state.mods.filter(i=>i.granter===t);this.state.mods=this.state.mods.filter(i=>i.granter!==t),e.forEach(i=>{this.modEffectPropagator(i),i.type==="AR"&&(this.state.armorDmg=Math.max(0,this.state.armorDmg-i.value))})}removeModSafe(t){this.hasMod(t)&&this.removeMod(t)}expireMod(t){this.state.mods.splice(y.modIdx(this.state.mods,t),1)}bonusTotal(){let t=lt.sumNuggets(this.triggers);return this.state.actvBonus&&(t=lt.addNuggets(t,this.state.actvBonus)),t}endActivation(){this.modBool("EA")?this.removeMod(this.id):this.state.activationAvailable=!1,W.deathCheck(),T.actionDone()}move(t){this.state.lane=t,ae.positionChange(this.owner),x.addEvents($.creature("MOV",this))}addEffect(t,e){const i=y.effect(t,e);return this.effects.push(i),i}enforceEffects(t,e=!1){this.effects.filter(i=>i.watch===t).filter(i=>i.area==="A"||i.area==="C"&&this.owner===e).forEach(i=>L.getCard(i.logicCode).enforceEffect(i,this))}jr4(t,e=""){e===""&&(e=this.code);const i=y.trigger(t,e);return i.cardCode=this.code,i.creatId=this.id,this.triggers.push(i),i}removeTrigger(t){const e=y.trigIdx(this.triggers,t);e>-1?this.triggers.splice(e,1):console.error("Wery curious, could not find trigger to remove",t)}wipeAll(){this.preWipe(),this.state.hints=[],this.state.armor=0,this.state.mobility=0,this.state.poison=0,this.state.regen=0,this.state.aggressive=!1,this.state.defender=!1,this.state.breakthrough=!1,this.state.defender=!1,this.state.negateDefender=!1,this.state.negateArmor=!1,this.state.actvBonus=void 0,this.state.changed=!0,this.state.negateActivate=!0,g.creatByTarget(y.crTarg()).forEach(t=>{t.removeMod(this.id),t.enforceEffects("PS",this.owner)}),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),ae.defenderChange(this.owner)}preWipe(){this.state.mods=[],this.state.triggers=[],this.state.effects=[]}get hints(){return this.state.hints}aiHints(){return this.hints}}class y{static creatureState(t,e){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,actvBonus:void 0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:e,maxHealth:0,mobility:0,mobilityAvailable:!0,mods:[],negateActivate:!1,negateArmor:!1,negateDefender:!1,negateMobility:!1,negateRegen:!1,owner:t,poison:0,regen:0,sleeping:!0,status:"A",triggers:[]}}static effect(t,e){return{area:"A",watch:t,logicCode:e}}static freeCard(t){return{id:R.genId(),condition:y.target("TH"),sourceCard:t}}static mod(t,e,i=""){return{type:t,value:typeof e=="boolean"?e?1:0:e,granter:i,expiry:"NN"}}static trigger(t,e){return{id:R.genId(),type:t,logicCode:e,cardCode:"",creatId:"",customCode:"",interactive:!1,changes:!1,bonus:void 0}}static triggerReaction(t,e,i,s){return{event:t,owner:i,creatId:"",cardCode:"",trigger:e,host:s}}static basicAction(t){return{zone:"N",key:t,host:"",param:""}}static fieldSelectAction(t,e=-1,i=!0){return{zone:"F",key:t,playerA:i,lane:e,host:"",param:""}}static deckSelectAction(t,e,i){return{zone:"N",key:t,card:e,position:i,host:"",param:""}}static handSelectAction(t,e="",i="",s=-1){return{zone:"H",key:t,card:e,cost:i,position:s,host:"",param:""}}static playerSelectAction(t,e){return{zone:"P",key:t,playerA:e,host:"",param:""}}static draftSelectAction(t,e,i){return{zone:"N",key:t,index:e,pack:i,host:"",param:""}}static menuButtonAction(t){return{zone:"N",key:"MNBT",host:"",param:t}}static actionifier(t,e,i,s){const h=t;return h.key=e,h.host=i,h.param=s,h}static target(t){return{target:t,level:"LA",canLevel:!1,faction:"X",player:"X",card:"A",field:"A",creatStatus:"A",tribe:"AN",notMe:"",hasArmor:!1,canArmor:!1,hasDefender:!1,canDefender:!1,hasMobility:!1,canMove:!1,hasPoison:!1,hasRegen:!1,canRegen:!1,cardCode:"",victims:""}}static actionTarget(t,e,i,s){return y.actionifier(y.target(t),e,i,s)}static crTarg(){const t=y.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,e,i){return y.actionifier(y.crTarg(),t,e,i)}static crNotMeTarg(t){const e=y.target("TF");return e.field="O",e.creatStatus="V",e.notMe=t,e}static crNotMeActTarg(t,e,i,s){return y.actionifier(y.crNotMeTarg(e),t,i,s)}static crFriendTarg(){const t=y.crTarg();return t.player="F",t}static crFriendActTarg(t,e,i){return y.actionifier(y.crFriendTarg(),t,e,i)}static crFriendNotMeTarg(t){const e=y.crNotMeTarg(t);return e.player="F",e}static crFriendNotMeActTarg(t,e,i,s){return y.actionifier(y.crFriendNotMeTarg(e),t,i,s)}static crEnemyTarg(){const t=y.crTarg();return t.player="E",t}static crEnemyActTarg(t,e,i){return y.actionifier(y.crEnemyTarg(),t,e,i)}static playerTarg(t){const e=y.target("TP");return e.player=k.toTarget(t),e}static playerActTarg(t,e,i,s){return y.actionifier(y.playerTarg(t),e,i,s)}static lvlHandActTarg(t,e){const i=this.actionTarget("TH","CARD",t,e);return i.player="F",i.canLevel=!0,i.hint=["CD"],i}static emptyTarg(){const t=y.target("TF");return t.field="E",t}static emptyActTarg(t,e,i){return y.actionifier(y.emptyTarg(),t,e,i)}static emptyPlayerTarg(t){const e=y.emptyTarg();return e.player=k.toTarget(t),e}static emptyPlayerActTarg(t,e,i,s){return y.actionifier(y.emptyPlayerTarg(t),e,i,s)}static modSum(t,e){return t.filter(i=>i.type===e).map(i=>i.value).reduce((i,s)=>i+s,0)}static modBool(t,e){return t.some(i=>i.type===e&&i.value===1)}static hasModG(t,e){return t.findIndex(i=>i.granter===e)>-1}static hasMod(t,e){return y.modIdx(t,e)>-1}static modIdx(t,e){return t.findIndex(i=>i.granter===e.granter&&i.type===e.type)}static trigIdx(t,e){return t.findIndex(i=>i.id===e.id)}}class Nt{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return Nt.extractCardCode(this.code)}image(t){return this.type==="S"?this.fixedImage(t):this.leveledImage(t)}leveledImage(t){return this.rawImage(this.code,t)}fixedImage(t){return this.rawImage(this.cardCode(),t)}rawImage(t,e){return`card/${e?"b":"s"}/${this.faction}/${t}.jpg`}isFree=!1;level;maxLevel=3;minLevel=1;name="";overload=!1;rarity="T";spice;text="";get type(){return "C"}hints;addSp(t,e){}aiHints(){return this.hints??[]}canLevel(){return this.level{h+=s[m]*i[0][m],f+=s[m]*i[1][m]}),[h,f]}rawNug(t,e,i,s,h=0){return lt.rawNugget(t,e,i,s,h)}buffNug(t,e){return this.rawNug(0,e+t,t,0,0)}playerNug(t){return this.rawNug(0,0,0,t,0)}spawnNug(t){const e=lt.cardCreatValueFormula(t);return this.rawNug(1,e,t.iAttack,0,0)}statSpawnNug(t,e){const i=this.buffNug(t,e);return i.count=1,i}avgSpawnNug(t){const e=this.avgCreatureStats(t);return this.statSpawnNug(e[0],e[1])}regnNug(t){return this.rawNug(0,lt.calcCreatValueFormula(0,0,0,0,t,!1,0),0,0,0)}multNug(t,e){return t.attack*=e,t.value*=e,t.count*=e,t.pHealth*=e,t}static extractCardCode(t){return t.substring(0,3)}get boof123n(){return this.level*-1}get boof124(){return this.lValN([1,2,4])}get boof135(){return this.lValN([1,3,5])}get boof137(){return this.lValN([1,3,7])}get boof147(){return this.lValN([1,4,7])}get boof234(){return this.level+1}get boof235(){return this.lValN([2,3,5])}get boof236(){return this.lValN([2,3,6])}get boof246(){return this.level*2}get boof246n(){return this.level*-2}get boof247(){return this.lValN([2,4,7])}get boof247n(){return this.lValN([-2,-4,-7])}get boof248(){return this.lValN([2,4,8])}get boof258(){return this.lValN([2,5,8])}get boof2510(){return this.lValN([2,5,10])}get boof2612(){return this.lValN([2,6,12])}get boof357(){return this.lValN([3,5,7])}get boof358(){return this.lValN([3,5,8])}get boof359(){return this.lValN([3,5,9])}get boof3510(){return this.lValN([3,5,10])}get boof3612(){return this.lValN([3,6,12])}get boof369(){return this.level*3}get boof369n(){return this.level*-3}get boof3610(){return this.lValN([3,6,10])}get boof3711(){return this.lValN([3,7,11])}get boof3712(){return this.lValN([3,7,12])}get boof3713(){return this.lValN([3,7,13])}get boof3714(){return this.lValN([3,7,14])}get boof3814(){return this.lValN([3,8,14])}get boof3915(){return this.lValN([3,9,15])}get boof468(){return this.lValN([4,6,8])}get boof469(){return this.lValN([4,6,9])}get boof4610(){return this.lValN([4,6,10])}get boof4612(){return this.lValN([4,6,12])}get boof4710(){return this.lValN([4,7,10])}get boof4711(){return this.lValN([4,7,11])}get boof4712(){return this.lValN([4,7,12])}get boof4713(){return this.lValN([4,7,13])}get boof4714(){return this.lValN([4,7,14])}get boof4812(){return this.level*4}get boof4812n(){return this.level*-4}get boof4813(){return this.lValN([4,8,13])}get boof4814(){return this.lValN([4,8,14])}get boof4815(){return this.lValN([4,8,15])}get boof4816(){return this.lValN([4,8,16])}get boof4914(){return this.lValN([4,9,14])}get boof4915(){return this.lValN([4,9,15])}get boof579(){return this.lValN([5,7,9])}get boof5711(){return this.lValN([5,7,11])}get boof5714(){return this.lValN([5,7,14])}get boof5812(){return this.lValN([5,8,12])}get boof5813(){return this.lValN([5,8,13])}get boof5814(){return this.lValN([5,8,14])}get boof5815(){return this.lValN([5,8,15])}get boof5914(){return this.lValN([5,9,14])}get boof5915(){return this.lValN([5,9,15])}get boof5916(){return this.lValN([5,9,16])}get boof5917(){return this.lValN([5,9,17])}get boof51014(){return this.lValN([5,10,14])}get boof51015(){return this.level*5}get boof51020(){return this.lValN([5,10,20])}get boof6812(){return this.lValN([6,8,12])}get boof6814(){return this.lValN([6,8,14])}get boof6912(){return this.lValN([6,9,12])}get boof6914(){return this.lValN([6,9,14])}get boof6915(){return this.lValN([6,9,15])}get boof6916(){return this.lValN([6,9,16])}get boof61014(){return this.lValN([6,10,14])}get boof61015(){return this.lValN([6,10,15])}get boof61016(){return this.lValN([6,10,16])}get boof61017(){return this.lValN([6,10,17])}get boof61018(){return this.lValN([6,10,18])}get boof61117(){return this.lValN([6,11,17])}get boof61218(){return this.lValN([6,12,18])}get boof61224(){return this.lValN([6,12,24])}get boof7911(){return this.lValN([7,9,11])}get boof7914(){return this.lValN([7,9,14])}get boof71013(){return this.lValN([7,10,13])}get boof71014(){return this.lValN([7,10,14])}get boof71015(){return this.lValN([7,10,15])}get boof71116(){return this.lValN([7,11,16])}get boof71117(){return this.lValN([7,11,17])}get boof71118(){return this.lValN([7,11,18])}get boof81116(){return this.lValN([8,11,16])}get boof81117(){return this.lValN([8,11,17])}get boof81217(){return this.lValN([8,12,17])}get boof81220(){return this.lValN([8,12,20])}get boof81318(){return this.lValN([8,13,18])}get boof91420(){return this.lValN([9,14,20])}get boof91421(){return this.lValN([9,14,21])}get boof101520(){return this.lValN([10,15,20])}get boof255080(){return this.lValN([25,50,80])}}class P extends Nt{constructor(t){super(t)}iHealth=0;iAttack=0;iAggro=!1;iArmor=0;iBT=!1;iDefend=!1;iMobile=0;iRegen=0;tribe=[];isTribe(t){return(Array.isArray(t)?t:[t]).every(i=>this.tribe.includes(i))}jr3(t,e){const i=y.creatureState(t,e);return i.id=R.genId(),i.code=this.code,i.health=this.iHealth,i.attack=this.iAttack,i.maxHealth=i.health,i.regen=this.iRegen,i.breakthrough=this.iBT,i.defender=this.iDefend,i.aggressive=this.iAggro,i.armor=this.iArmor,i.mobility=this.iMobile,i.hints=this.aiHints(),i.actvBonus=this.bonus?.activ8,new Be(i)}playTargets(){const t=super.playTargets(),e=y.actionTarget("TF","FORG",this.code,"");return e.player="F",t.push(e),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}addExtraActivate(t){const e=y.mod("EA",!0,t.id);e.expiry="ET",t.addMod(e)}}class kt extends Nt{constructor(t){super(t)}get type(){return "S"}logSpell(t=void 0,e=void 0){let i=p.new().txt("Casted ").crd(this.code);t&&(i=i.txt(" on ").crd(t.code),e&&(i=i.txt(" and ").crd(e.code))),i.txt(".").go()}}class te{paStats;pbStats;constructor(t,e){this.paStats=t,this.pbStats=e}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const e=this.playerStats(t),i=this.playerStats(!t);return te.deltafier(e,i)}static deltafier(t,e){const i=te.blankStats(!0);return i.creatCount=t.creatCount-e.creatCount,i.creatValue=t.creatValue-e.creatValue,i.threatValue=t.threatValue-e.threatValue,i.playerHealth=t.playerHealth-e.playerHealth,i.bonus=t.bonus-e.bonus,i}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0,bonus:0}}}class lt{static dcWeight=.4;fromState(){const t=g.qActiveCreats(),i=[!0,!1].map(s=>{const h=te.blankStats(s),f=k.toPlayer(s);h.playerHealth=lt.playerFormula(f.health,k.totalArmor(f),k.totalPoison(f),f.effects.length);const m=lt.sumNuggets(f.triggers);return h.playerHealth+=m.pHealth,h.creatCount=m.count,h.creatValue=m.value,h.threatValue=m.attack,h.bonus=m.bonus,t.filter(A=>A.owner===s).forEach(A=>{const C=A.bonusTotal();h.playerHealth+=C.pHealth,h.bonus+=C.bonus,h.creatCount+=1+C.count,h.creatValue+=lt.creatValueFormula(A)+C.value,h.threatValue+=lt.threatFormula(A,t)+C.attack}),h});return new te(i[0],i[1])}static ddp9(t,e,i,s,h=0){return lt.ddp9Nugget(t,e,i,s,h)[0]}static ddp9Nugget(t,e,i,s,h=0){const f=t/4,m=e/10,A=i/12,C=s/8;return[f+m+A+C+h,f,m,A,C,h]}static creatValueFormula(t){return lt.calcCreatValueFormula(t.attack,t.health,t.armor,t.mobility,t.regen,t.breakthrough,t.poison)}static cardCreatValueFormula(t){return lt.calcCreatValueFormula(t.iAttack,t.iHealth,t.iArmor,t.iMobile,t.iRegen,t.iBT,0)}static calcCreatValueFormula(t,e,i,s,h,f,m){const A=f?1:0;return e+Math.max(0,t)+(i+Math.min(s,3)+A+h-m)*1.5}static playerFormula(t,e,i,s){return t+(e-i)*2+s*4}static threatFormula(t,e){let i=0,s=0;if(t.defender)i=t.attack;else{const h=e.find(f=>f.owner!==t.owner&&f.lane===6-t.lane);h?(t.breakthrough&&(s=Math.max(t.attack-h.health,0)),i=t.attack-s):s=t.attack,s>0&&(s+=lt.scalingBonus(s))}return Math.max(i,0)+Math.max(s,0)}static rawNugget(t,e,i,s,h=0){return{count:t,value:e,attack:i,pHealth:s,bonus:h}}static addNuggets(t,e){return lt.rawNugget(t.count+e.count,t.value+e.value,t.attack+e.attack,t.pHealth+e.pHealth,t.bonus+e.bonus)}static sumNuggets(t){let e=lt.rawNugget(0,0,0,0,0);return t.forEach(i=>{i.bonus&&(e=lt.addNuggets(e,i.bonus))}),e}static scalingBonus(t){let e=7;if(t<=e)return 0;let i=!0,s=0,h=1;const f=7;for(;i;)t>e+f?(s+=h*f,e+=f,h++):(s+=h*(t-e),i=!1);return s}weighState(t,e,i){const s=t.deltaStats(i),h=e.deltaStats(i),f=te.deltafier(h,s),m=f.playerHealth<0?-1:1,A=lt.scalingBonus(f.playerHealth*m)*m+f.playerHealth;return lt.ddp9Nugget(f.creatCount,f.creatValue,f.threatValue,A,f.bonus)[0]}}class Si{aiPlayer;constructor(t){this.aiPlayer=t}jr7(t,e=3){return`${t}${e}`}jr6(t,e){const i=S.randInt(0,e.length),s=e[i];return e.splice(i,1),g.birth(t,"F",this.aiPlayer,s)}cheatin(){const t=k.toPlayer(this.aiPlayer),e=k.toPlayer(!this.aiPlayer),i=e.health-t.health;let s=0;i>85?s=3:i>65?s=2:i>45&&(s=1);const h=g.emptyLanes(this.aiPlayer);if(s===0||h.length===0)return!1;p.new().plr(this.aiPlayer).txt(" is a cheaty cheaterton.").go();let f=0;if(s===1){if(E.regularPlays-=1,f=S.randInt(0,13),f===0)this.jr6(this.jr7("HTR"),h);else if(f===1)this.jr6(this.jr7("AGM"),h).addRegen(8);else if(f===2){const m=this.jr6(this.jr7("YNS"),h);m.buff(0,15),m.addRegen(4)}else if(f===3)this.jr6(this.jr7("TBA"),h);else if(f===4)this.jr6(this.jr7("DCS"),h);else if(f===5)this.jr6(this.jr7("GGP"),h).addRegen(8);else if(f===6){const m=this.jr6(this.jr7("WFM"),h);m.aggressive=!0}else if(f===7){const m=this.jr6(this.jr7("FFU"),h);m.aggressive=!0}else if(f===8){const m=this.jr6(this.jr7("URB"),h);m.aggressive=!0}else if(f===9){const m=this.jr6(this.jr7("KOD"),h);m.aggressive=!0,m.addRegen(6)}else if(f===10)this.jr6(this.jr7("AGK"),h).addArmor(3);else if(f===11){const m=this.jr6(this.jr7("PSC"),h);m.aggressive=!0}else if(f===12){const m=this.jr6(this.jr7("SAD"),h);m.aggressive=!0}}else if(s===2)if(E.regularPlays-=1,f=S.randInt(0,17),f===0){const m=this.jr6(this.jr7("NDR"),h);m.aggressive=!0}else if(f===1){const m=this.jr6(this.jr7("CSW"),h);m.aggressive=!0}else if(f===2)this.jr6(this.jr7("GGD"),h).addRegen(6);else if(f===3)this.jr6(this.jr7("EFP"),h);else if(f===4)this.jr6(this.jr7("ZTU"),h);else if(f===5){const m=this.jr6(this.jr7("DDD"),h);m.aggressive=!0}else if(f===6)this.jr6(this.jr7("RBH"),h).addRegen(8);else if(f===7)this.jr6(this.jr7("SFT"),h);else if(f===8)this.jr6(this.jr7("GTT"),h);else if(f===9)this.jr6(this.jr7("SMD"),h);else if(h.length===5)this.jr6(this.jr7("DFB"),h),[1,2,3,4].forEach(m=>this.jr6(this.jr7("XHS"),h));else if(h.length===4)this.jr6(this.jr7("LMV"),h);else if(h.length===3)this.jr6(this.jr7("LHY"),h),this.jr6(this.jr7("SVH"),h),this.jr6(this.jr7("DBA"),h);else if(h.length===2)this.jr6(this.jr7("UTR"),h),this.jr6(this.jr7("TDS"),h);else if(t.turn===4)this.jr6(this.jr7("SSR"),h);else if(t.turn===1)this.jr6(this.jr7("ESK"),h);else{const m=this.jr6(this.jr7("XSH"),h);m.aggressive=!0}else if(s===3)if(f=S.randInt(0,20),f===0){const m=this.jr6(this.jr7("IHA",4),h);m.aggressive=!0}else if(f===1)this.jr6(this.jr7("CHR"),h);else if(f===2)this.jr6(this.jr7("FGO",1),h);else if(f===3)this.jr6(this.jr7("CHV",4),h);else if(f===4)this.jr6(this.jr7("KKK",4),h);else if(t.health<20){const m=this.jr6(this.jr7("ODC",4),h);m.aggressive=!0}else if(h.length===5){const m=S.randInt(0,4);if(m===0)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("UWL",2),h));else if(m===1)[1,2].forEach(A=>this.jr6(this.jr7("DFB"),h)),[1,2,3].forEach(A=>this.jr6(this.jr7("FFD"),h));else if(m===2)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("BWK"),h));else if(m===3){this.jr6(this.jr7("SBG"),h),this.jr6(this.jr7("EWE"),h);const A=this.jr6(this.jr7("BMY"),h);A.defender=!0,A.aggressive=!0}}else if(e.health>350)t.health<180&&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 m=S.randInt(0,3);m===0?(this.jr6(this.jr7("AGK"),h),[1,2,3].forEach(A=>this.jr6(this.jr7("VBK"),h))):m===1?(this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("TDS"),h),this.jr6(this.jr7("UTR"),h)):m===2&&[1,2,3,4].forEach(A=>this.jr6(this.jr7("CDC"),h))}else if(h.length===3)if(S.randInt(0,2)){this.jr6(this.jr7("SDR"),h),this.jr6(this.jr7("SDR"),h);const m=this.jr6(this.jr7("UPM"),h);m.aggressive=!0}else{this.jr6(this.jr7("SDL"),h);const m=this.jr6(this.jr7("NFF"),h);m.aggressive=!0}else if(h.length===2)this.jr6(this.jr7("SPM"),h),this.jr6(this.jr7("SPM"),h);else{const m=this.jr6(this.jr7("NXC"),h);m.buff(10,0),m.aggressive=!0,m.addMobility(2),m.addRegen(5)}return t.health<30&&k.heal(t,50-t.health),!0}}var at=(n=>(n[n.Left=0]="Left",n[n.Both=1]="Both",n[n.Right=2]="Right",n[n.ForceRight=3]="ForceRight",n))(at||{});class Ue{action;hitTest(t,e,i){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,e,i,s){let h,f=0;const m=t.length;for(;h===void 0&&f=t&&this.originY<=e&&this.endY>=e?this.action:void 0}}class Vt extends dt{constructor(t,e,i,s,h=0){super({zone:"N",key:"BNDL",host:"",param:""},t,e,i,s,h)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,e,i){if(super.hitTest(t,e,i))return Ue.arrayHit(this.childs,t,e,i)}}class Ci{guts="";txt(t){return ht.simOn||(this.guts+=t),this}plr(t){if(!ht.simOn){const e=k.toBool(t);this.guts+="^p"+(e?"a":"b")}return this}crd(t){return ht.simOn||(this.guts+="^c"+t),this}go(){ht.simOn||p.parse(this)}}class Ne{realPromise;resolveMe(t){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,e)=>{this.resolveMe=t,this.rejectMe=e})}}const Oe=25,ii=9999,wi=-9999,Di=-999999,xi=["CANC","DEET","SCRH"],Bi=["HPLY","ACTV","MOVE"];class Hi{log=!1;simOn=!1;dumb=!1;inPhase=!0;promStack=[];peekStack=[];peeking=!1;slowpoke=0;endCount=0;aiPlayer=!1;brdEval;rootBoardStats;turnSims=0;turnTime=0;kickOut=!1;kickTimer=0;constructor(){this.brdEval=new lt,this.rootBoardStats=new te(te.blankStats(!0),te.blankStats(!1))}setLog(t){this.log=t}lNum(t){return t<-899999?"NUNS":t<-8999?"LOSS":t>8888?"KILL":t.toFixed(1)}popProm(t){this.promStack.pop().resolveMe(t)}popPeeker(t){this.peekStack.pop().resolveMe(t)}hitMainPhase(){this.dumb&&this.simOn&&this.inPhase&&E.mainBattle&&(this.inPhase=!1)}simEndpoint(t){if(this.endCount++,this.promStack.length===0)p.debug("Tried to end a sim, but no promise to unlock."),console.trace();else{let e;if(t==="T"){const i=this.brdEval.fromState();e=this.brdEval.weighState(this.rootBoardStats,i,this.aiPlayer)}else t==="W"?e=ii:t==="L"?e=wi:e=Di;this.popProm(e)}}async processAction(t,e,i=!1){const s=!this.simOn;let h=0,f,m=this.actionPruner(t);if(m=this.noHandDoubles(m),this.peeking){this.popPeeker(m);return}if(s&&this.dumb&&e&&(this.dumb=!1,p.debug("Smart Again.",!1)),this.dumb&&!this.inPhase){let F=m.filter(V=>V.key==="FITE"||V.key==="ENDT");F.length>0&&(m=F)}if(s){f=new Se,f.hwhipe();const F=m.map((et,vt)=>f.drawAiGear(vt,!1));await Promise.all(F),await new Ge().drawActions([]),await S.sleep(Oe),this.kickOut=!1,this.simOn=!0,this.slowpoke=Date.now(),this.rootBoardStats=this.brdEval.fromState(),this.endCount=0;const Y=await this.peeker(m),j=[];let mt=0,z=0,rt=[];Y.forEach(et=>{mt+=et.peek.length,et.free&&(et.free==="FREE"?z++:rt.includes(et.free)||(z++,rt.push(et.free))),et.wasPeek&&et.peek.some(vt=>this.hasHint(vt,"DF"))&&j.push(et.root)}),j.length>0?(m=j,this.dumb=!0,p.debug("Do firsts; dumb mode. Action count "+m.length,!1)):i?(this.dumb=!0,p.debug("Forced dumb mode.",!1)):E.regularPlays+z>3?(this.dumb=!0,p.debug("4+ plays; dumb mode. Peek was "+mt,!1)):k.getActive().hand.length>7?(this.dumb=!0,p.debug("8+ in hand; dumb mode. Peek was "+mt,!1)):mt>29&&S.options.debug&&this.peekerReport(Y)}if(m.length===0){s&&(console.error("Root eval set consisted of 0 valid actions"),p.debug("!! Zero Action Root !!")),this.simEndpoint("D");return}let A=-99999;const C=[];if(m.length===1&&s)C.push({a:m[0],weight:99});else{me.saveState();for(let F=0;F4e4&&(this.kickOut=!0),j+=this.hintWeight(V),j>A&&(A=j),me.restoreState(),s&&(C.push({a:V,weight:j}),await f.drawAiGear(F,!0),h++,await S.sleep(Oe))}me.popState()}if(s)if(this.simOn=!1,this.kickOut){const F="🤖: High complexity encountered. Recombobulating.";p.new().txt(F).go(),this.processAction(t,e,!0)}else{const F=A-.4;let V=C.filter(rt=>rt.weight>F);V.length>1&&V.findIndex(rt=>rt.a.key==="ENDT")>-1&&(V=V.filter(rt=>rt.a.key!=="ENDT"));let Y;if(F>ii-100){const rt=V.find(et=>et.a.key==="FITE");rt?Y=rt.a:Y=V[S.randInt(0,V.length)].a}else Y=V[S.randInt(0,V.length)].a;const j=Date.now()-this.slowpoke,mt=Math.max(1,350-j),z=j-Oe*h;this.turnSims+=this.endCount,this.turnTime+=z,S.options.debug&&Y.key==="HPLY"&&(p.debug("▪"),p.debug("🧠 Hand Choices 🧠"),C.filter(rt=>rt.a.key==="HPLY").sort((rt,et)=>et.weight-rt.weight).forEach(rt=>{let et="";rt.a===Y?et=" 🏆":rt.weight>F&&(et=" 🌻"),p.new().crd(rt.a.card).txt(" : "+this.lNum(rt.weight)+et).go()}),p.debug("🧠 ~~~~~~~~~~~~ 🧠"),p.debug("▪")),S.sleep(mt).then(()=>{T.handleAction(Y)})}else this.popProm(A)}actionPruner(t){let e=t.filter(i=>xi.indexOf(i.key)===-1);return E.mainBattle?e=e.filter(i=>i.key!=="HDSC"):e=e.filter(i=>!this.hasHint(i,"BB")),e=e.filter(i=>{if(this.hasHint(i,"HR")){if(i.zone==="P")return i.playerA!==this.aiPlayer;{const s=i,h=g.ddf6(s);if(h.owner===this.aiPlayer){const f=h.aiHints();return f.includes("MC")||f.includes("LZ")}else return!0}}else return!0}),e=e.filter(i=>{if(this.hasHint(i,"KL")){const s=i,h=g.ddf6(s);if(h.owner===this.aiPlayer){const f=h.aiHints();return f.includes("ST")||f.includes("LZ")}else return!0}else return!0}),e=e.filter(i=>this.hasHint(i,"BF")?i.playerA===this.aiPlayer:!0),e=e.filter(i=>this.hasHint(i,"DB")?i.playerA!==this.aiPlayer:!0),e=e.filter(i=>{if(this.hasHint(i,"PN")){if(i.zone==="P")return i.playerA!==this.aiPlayer;{const s=i,h=g.ddf6(s);return h.owner===this.aiPlayer?h.aiHints().includes("MC"):!0}}else return!0}),e=e.filter(i=>{const s=i.key==="FORG";if(s||this.hasHint(i,"FL")){const h=i,f=g.searchByFSA(h);return f&&(E.mainBattle?E.newPre:E.newPost).includes(f.id)?f.aiHints().includes("RT")?!0:s?L.getCard(h.host).aiHints().includes("RD"):!1:!0}else return!0}),e}noHandDoubles(t){const e=[],i=[],s=[];return t.forEach(h=>{h.key==="HPLY"?e.push(h):i.push(h)}),e.forEach(h=>{const f=h.card;s.includes(f)||(s.push(f),i.push(h))}),i}async peeker(t){this.peeking=!0;const e=[],i=[];t.forEach(s=>{Bi.includes(s.key)?i.push(s):e.push({root:s,peek:[s],wasPeek:!1,free:""})}),me.saveState();for(let s=0;s0){let A="";if(h.key==="HPLY"){const C=h;C.cost!==""&&(A=C.cost)}e.push({root:h,peek:m,wasPeek:!0,free:A})}me.restoreState()}return me.popState(),this.peeking=!1,e}peekerReport(t){let e=0,i=0,s=0,h=[],f=[];t.forEach(m=>{const A=m.peek.length;if(A>0){const C=m.root.key;if(C==="HPLY")if(m.peek[0].key==="FORG")i+=A;else{const F=p.fastName(m.root.card)+": "+A;h.push(F)}else if(C==="MOVE")s+=A;else if(C==="ACTV"){const F=p.fastName(m.root.host)+": "+A;f.push(F)}else e+=A}}),p.debug("High complexity hit: Root: "+t.length),i>0&&p.debug("Forges: "+i),s>0&&p.debug("Mobility: "+s),h.forEach(m=>p.debug(m)),f.forEach(m=>p.debug(m)),e>0&&p.debug("Other: "+e)}hintWeight(t){let e=!1,i=!1,s="",h=0;if(t.key==="HDSC"?(s=t.host,i=!0):this.hasHint(t,"CD")?s=t.card:t.key==="HPLY"&&(s=t.card,e=!0),s){const f=L.getCard(s);h+=this.levelBonusFormula(f,!e,i),e&&(h+=this.hintAdjuster(f))}return h}levelBonusFormula(t,e,i){let s=0;const h=t.aiHints();return h.includes("LG")?(s+=1,h.includes("LM")&&(s+=.8)):h.includes("LB")?s-=1.3:e&&(s+=.4),i&&s>0&&(s=s/2.5),s}hintAdjuster(t){let e=0;const s=t.aiHints().find(h=>h.startsWith("ZZ"));return s&&(e=.5*parseInt(s.slice(2))),e}hasHint(t,e){return!t.hint||t.hint.length===0?!1:t.hint.includes(e)}logStats(t,e){const s=["Crt Cnt","Crt Val","Threat","P Health"].map((h,f)=>`${h}: ${this.numNum(e[f])}`).join(", ");console.log(t+s)}numNum(t){return t.length>6?t.charAt(0)==="-"?"NUNS":"KILL":t.padEnd(4)}cheater(){return R.aiMode&&R.aiActive&&S.options.cheater?new Si(this.aiPlayer).cheatin():!1}peekAllCards(){const t=k.toPlayer(this.aiPlayer),e=t.deck.concat(t.hand,t.discard).sort();console.log(e.map(i=>p.fastName(i)).join(` -`))}peekDecks(){const t=k.toPlayer(!1),e=t.deck.map(f=>p.fastName(f)).sort(),i=t.hand.map(f=>p.fastName(f)).sort(),s=t.discard.map(f=>p.fastName(f)).sort(),h=["-- Deck --"].concat(e,"-- Hand --",i,"-- Discard --",s);console.log(h.join(` -`))}}const ht=new Hi;class Ni{getState(){const t={cCrd:this.currPlayCard,cCst:this.currPlayCost,cPos:this.currPlayPos,aa:this.actionHistory};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.currPlayCard=e.cCrd,this.currPlayCost=e.cCst,this.currPlayPos=e.cPos,this.actionHistory=e.aa}handleAction(t){if(t.key==="DEET"){jt.init(t.param);return}if(t.key==="HPLY"){this.playCardSelect(t);return}if(t.key==="FORG"){E.forgeCard(t,this.currPlayCard,this.currPlayCost,this.currPlayPos);return}if(t.key==="FITE"){ci.fight(t.param==="M");return}if(t.key==="ENDT"){E.endTurn();return}if(t.key==="MOVE"){this.mobilitySelect(t);return}if(t.key==="MEND"){E.mobility(t);return}if(t.key==="HDSC"){this.currPlayCost="",E.cardPlayed(this.currPlayCard,this.currPlayCost,this.currPlayPos,!0),this.actionDone();return}if(t.key==="ACTV"){const e=g.jr5(t.param);L.getCard(e.code).startActivation(e);return}if(t.key==="NOTR"){t.param==="PM"&&At.popMode(),this.actionDone(!0);return}if(t.key==="CARD"){L.getCard(t.host).handleAction(t);return}if(t.key==="CANC"||t.key==="CNCL"){t.param==="PM"&&At.popMode(),this.actionHistory.pop(),this.ddf5();return}if(t.key==="USWP"){At.popMode(),Rt.whatNext();return}if(t.key==="DTUP"){jt.updateDetails(t),yt.drawAll();return}if(t.key==="VWDK"){wt.handleShowDeck(t);return}if(t.key==="SCRK"){wt.handleDeckScroll(t);return}if(t.key==="SCRH"){t.param==="R"?R.ui.handScrollLeft+=1:R.ui.handScrollLeft-=1,yt.drawAll();return}if(t.key==="DRFT"){pt.resumeDraft(t.param);return}if(t.key==="SCRD"){pt.paginate(t.param==="D"),yt.drawAll();return}if(t.key==="UIBT"){Xe.handleUIButton(t);return}if(t.key==="MENU"){Xe.handleMainMenuButton(t);return}if(t.key==="MNBT"){Xe.handleMenuButton(t);return}if(t.key==="DSET"){this.ddf5(Mt.generateDeckPickerActions(parseInt(t.param)));return}if(t.key==="DECK"){Mt.handleDeckPick(t);return}if(t.key==="DBUG"){S.toggleDebug();return}}ddf5(t,e=!1){let i;if(t){const s=this.generateDetailActions();i=t.concat(s),this.actionHistory.push(i)}else i=this.actionHistory[this.actionHistory.length-1];R.aiActive?ht.processAction(i,e):yt.drawAll()}currPlayCard="";currPlayCost="";currPlayPos=-1;shiftPlayCard(t){t0&&e.canLevel()&&i.push(D.buttonTarget("HDSC",t.card));const s=D.toActions(i);return s.push(y.handSelectAction("CANC",t.card,"",t.position)),s}mobilitySelect(t){const e=this.getMoveCardActions(t);this.ddf5(e)}getMoveCardActions(t){if(t.key!=="MOVE")throw new Error("Unexpected action passed to getMoveCardActions: "+t.key);const e=g.ddf6(t);let i=[];if(t.param==="ACTV"){const s=y.actionTarget("TB","ACTV",e.code,e.id);i=D.toActions(s)}return i.push(y.fieldSelectAction("CANC",t.lane,t.playerA)),g.canMove(e).map(s=>{const h=y.fieldSelectAction("MEND",s,t.playerA);return h.param=e.id,h}).concat(i)}noneEndTrigger(){return D.toActions(D.buttonTarget("NOTR"))[0]}cancelAction(){return D.toActions(D.buttonTarget("CANC"))[0]}emptyAdjacents(t,e){const i=e||t.id,s=y.emptyPlayerActTarg("F","CARD",t.code,i);return s.lanes=t.adjacent,D.toActions(s)}generateDetailActions(){const t=At.mode;if(R.aiActive)return[];if(t==="G"){const e=k.getLocal().hand.map((s,h)=>{const f=y.handSelectAction("DEET",s,"",h);return f.param=s,f}),i=g.qActiveCreats().map(s=>{const h=y.fieldSelectAction("DEET",s.lane,s.owner);return h.param=s.code,h});return e.concat(i)}else if(t==="D"){const e=pt.currentPack.map((s,h)=>{const f=y.draftSelectAction("DEET",h,!0);return f.param=`${s}1`,f}),i=pt.picksAsDeck.map((s,h)=>{const f=y.draftSelectAction("DEET",h,!1);return f.param=`${s.card}1`,f});return e.concat(i)}return[]}}const T=new Ni;class Fi{type="N0";events=[];triggerActions=[];deathCheck=!0;iaTrigLane=0;getState(){const t={type:this.type,events:this.events,tA:this.triggerActions,dC:this.deathCheck,tL:this.iaTrigLane};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.type=e.type,this.events=e.events,this.triggerActions=e.tA,this.deathCheck=e.dC,this.iaTrigLane=e.tL}startBatch(){this.deathCheck=!1,this.type==="C0"?this.type="C1":this.type==="C1"?this.type="C2":this.type==="C2"&&(this.type="N0");const t=this.type;let e;if(t==="N0")e=this.events.slice(),this.events=[];else{const s=this.events.filter(f=>f.code==="DIE"),h=this.events.filter(f=>f.code!=="DIE");t==="C1"?(e=h,this.events=s):(e=s,this.events=h)}const i=this.generateTriggers(e);this.triggerActions=this.sortTriggers(i),Rt.whatNext()}generateTriggers(t){let e;const i=t.map(s=>{s.code==="TRS"&&(e=s);const h=g.field.map(m=>m.triggers.map(A=>{const C=y.triggerReaction(s,A,m.owner,"C");return C.creatId=m.id,C.cardCode=m.code,C}).filter(A=>qe.ddf8(A))).flat(),f=[!0,!1].map(m=>k.toPlayer(m).triggers.map(C=>y.triggerReaction(s,C,m,"P")).filter(C=>qe.ddf8(C))).flat();return h.concat(f)}).flat();return e&&this.handleTurnStart(e),i}sortTriggers(t){const e=k.getActiveB(),i=t.filter(f=>!f.trigger.interactive&&f.owner===e),s=t.filter(f=>!f.trigger.interactive&&f.owner!==e);return t.filter(f=>f.trigger.interactive&&f.owner===e).concat(s,i)}handleTurnStart(t){const e=k.getActiveB();g.qPlayerCreats(e).filter(s=>s.sleeping).forEach(s=>{s.sleeping=!1});const i=R.tick();g.qActiveCreats().forEach(s=>{s.owner===t.playerA&&(s.activationAvailable=!0,s.mobilityAvailable=!0,s.sleeping=!1),s.armorDmg=0,s.poison>0&&s.hurtDirect(s.poison,"POIS",i),s.regen>0&&s.heal(s.regen),W.deathProdder(s,i)}),[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),Rt.whatNext()}addEvents(...t){this.events.push(...t)}}const x=new Fi;class Pi{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new di(t)}get(t){return this.registry[t]}}const st=new Pi;class Mi 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.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}targ(t){const e=y.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(e.lanes=t.adjacent),e}canActivate(t){return g.creatByTarget(this.targ(t)).length>0}startActivation(t){let e;this.level===1?e=this.targ(t):(e=D.boardTarget("CARD",this.code),e.param=t.id),e.hint=["BB"],T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){const e=g.jr5(t.param);if(t.zone==="F"){const i=g.ddf6(t);this.logAct(!0,i),this.applyMod(i)}else{this.logAct(!0);const i=this.targ(e);g.creatByTarget(i).forEach(s=>{this.applyMod(s)})}e.endActivation()}applyMod(t){const e=y.mod("AT",t.attack);e.expiry="ET",t.addMod(e)}}class Ri 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 ${p.jr9(this.level,this.level,!0)} and Regenerate ${this.level}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("EF");s.bonus=this.buffNug(this.level,this.level);const h=i.jr4("MV");return h.bonus=this.regnNug(this.level),i}ddf8(t){const e=$.toCreature(t.event);return(e.creature.lane===1||e.creature.lane===5)&&e.creature.owner===t.owner}jr8(t){const e=$.toCreature(t.event);e.creature.buff(this.level,this.level),e.creature.addRegen(this.level),x.triggerDone()}}class Ei 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 i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){const i=e.status==="A",s=y.crNotMeTarg(e.id);s.player=k.toTarget(e.owner);const h=g.creatByTarget(s);if(i&&h.length===0){const f=y.mod("AR",this.boof101520,e.id);k.addModSafe(e.owner,f);const m=y.mod("AR",this.level+1,e.id),A=y.mod("MB",1,e.id);e.addModSafe(m),e.addModSafe(A)}else k.removeModSafe(e.owner,e.id),e.removeModSafe(e.id)}}class Fe extends P{lookup(t){return{["LLD"]:{c:()=>this.demC(),t:i=>this.demT(i)},["LLG"]:{c:()=>this.golC(),t:i=>this.golT(i)},["LLS"]:{c:()=>this.senC(),t:i=>this.senT(i)},["LLT"]:{c:()=>this.tyrC(),t:i=>this.tyrT(i)}}[t]}testAmbush(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}ddf8(t){return!ht.simOn&&this.testAmbush(this.cardCode(),t)}jr8(t){const e=this.cardCode(),i=k.toPlayer(t.owner),s=i.hand.length;for(let h=s-1;h>-1;h--){const f=i.hand[h];f.startsWith(e)&&(p.new().crd(f).txt(" Ambushed.").go(),g.birth(f,"S",i.isPlayerA),E.levelAndDiscard(f,h,!1,"E"))}x.triggerDone()}ambT(){return`Spawn a ${this.name}. Then discard ${this.level===3?"":"and level up "} ${this.name}.`}demC(){this.faction="N",this.rarity="H",this.name="Leyline Demon",this.iAttack=this.lValN([3,9,14]),this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.text="Ambush: When the enemy player plays a card, if it is their third card played that turn, "+this.ambT()}demT(t){return t.event.code==="PLC"?t.owner!==t.event.playerA&&E.cardsPlayed===3:!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=$.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=$.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){return t.event.code==="PHL"?t.owner!==t.event.playerA&&k.getActiveB()===t.event.playerA:!1}}class Ii 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 i=super.jr3(t,e),s=i.jr4("PC");return s.bonus=this.rawNug(0,0,0,0,.5),s.interactive=!0,i}handleAction(t){E.levelAndDiscardA(t),T.actionDone(!0)}ddf8(t){if(t.event.playerA===t.owner){const e=L.getCard(t.event.cardCode);if(e.type==="S"&&e.faction==="A")return!0}return!1}jr8(t){const e=y.lvlHandActTarg(this.code,t.creatId),i=D.toActions([e,D.buttonTarget("NOTR")]);i.length>1?T.ddf5(i):x.triggerDone()}}class Li 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 ${p.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e);return i.addEffect("PH",this.code),i}enforceEffect(t,e){if(k.toPlayer(e.owner).health>120&&e.status==="A"){const s=this.boof;e.addModSafe(y.mod("HL",s,e.id)),e.addModSafe(y.mod("MH",s,e.id)),e.addModSafe(y.mod("AT",s,e.id))}else e.removeModSafe(e.id)}get boof(){return this.lValN([4,8,80])}}class Gi 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 ${p.dbdtap()}, it gets ${p.jr9(this.level,this.level)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),i}ddf8(t){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}jr8(t){const e=$.toDamage(t.event);this.logAct(!1,e.srcCreat),e.srcCreat.buff(this.level,this.level),x.triggerDone()}}class Pe 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 ${p.jr9(this.level,this.level)} for each ${p.factionText(this.faction)} card in your hand.`}hell(){this.faction="N",this.name="Hellforged Avatar",this.iRegen=this.level,this.tribe.push("AB")}root(){this.faction="U",this.name="Rootforged Avatar",this.iBT=!0,this.tribe.push("HM")}steel(){this.faction="A",this.name="Steelforged Avatar",this.iArmor=this.level,this.tribe.push("CY")}storm(){this.faction="T",this.name="Stormforged Avatar",this.iMobile=this.level,this.tribe.push("MT")}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){const e=$.toEnterField(t.event),i=k.toPlayer(t.owner).hand.filter(s=>L.getCard(s).faction===this.faction).length;if(i>0){const s=i*this.level;e.creature.buff(s,s)}x.triggerDone()}}class Z extends P{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["COZ"]:()=>this.cooze(),["DFM"]:()=>this.dfmimic(),["DZA"]:()=>this.dozer(),["FWG"]:()=>this.feywing(),["FUN"]:()=>this.funguy(),["POZ"]:()=>this.purpz(),["NSD"]:()=>this.fixedSeedling(1),["OOZ"]:()=>this.nooze(),["RPT"]:()=>this.raptor(),["SPL"]:()=>this.minion(),["SXP"]:()=>this.fixedSapling(5),["SXD"]:()=>this.fixedSeedling(3),["SXT"]:()=>this.fixedTreefolk(7),["SDL"]:()=>this.minion(),["SPN"]:()=>this.nekSpirit(),["SPU"]:()=>this.uspirit(),["XYR"]:()=>this.yuruSpirit(),["TFK"]:()=>this.minion(),["TFD"]:()=>this.fixedTreefolk(this.boof5714),["TFF"]:()=>this.tfFight(),["TTF"]:()=>this.fixedTreefolk(3),["ZTR"]:()=>this.zimus(),["ZBS"]:()=>this.threeZomb(),["ZST"]:()=>this.strideZomb(),["ZMB"]:()=>this.commonZomb()}[t]}constructor(t){super(t),this.rarity="T";const e=this.cardCode();this.imgKey=e,this.minLevel=this.level,this.maxLevel=this.level,this.lookup(e)()}image(t){return this.rawImage(this.imgKey,t)}static fgoc(t){return "FGO"+t}fixedNekSpirit(t){this.faction="N",this.rarity="T",this.name="Spirit",this.tribe.push("ST"),this.iAttack=t,this.iHealth=t,this.imgKey=`${"SPN"}${this.level}`}nekSpirit(){this.fixedNekSpirit(this.boof51015)}yuruSpirit(){this.fixedNekSpirit(this.boof5814)}static purpOzC(t){return "POZ"+t}oozer(t){this.faction="N",this.rarity="T",this.name="Oozeling",this.tribe.push("OZ"),this.iHealth=this.iAttack,this.imgKey=t?"POZ":"OOZ"}purpz(){this.iAttack=this.boof135,this.oozer(!0)}nooze(){this.iAttack=this.boof4711,this.oozer(!1)}cooze(){this.iAttack=1,this.oozer(!1),this.hints=["RT"]}minion(){this.iAttack=Z.minionBuff(this.level),this.plont(),this.name=Z.minionName(this.level),this.hints=["RT"]}static tffc(t){return "TFF"+t}static minionCode(t){return(t===1?"SDL":t===2?"SPL":"TFK")+t}static minionName(t){return t===1?"Seedling":t===2?"Sapling":"Treefolk"}static minionBuff(t){return t===1?1:t===2?3:5}plont(){this.faction="U",this.iHealth=this.iAttack,this.tribe.push("PL")}fixedSapling(t){this.iAttack=t,this.plont(),this.name=Z.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.iAttack=t,this.plont(),this.name=Z.minionName(1),this.imgKey="SDL",this.hints=["RT"]}fixedTreefolk(t){this.iAttack=t,this.plont(),this.name=Z.minionName(3),this.imgKey="TFK"}tfFight(){this.iAttack=this.boof91421,this.plont(),this.name=Z.minionName(3),this.imgKey="TFK"}dfmimic(){this.faction="U",this.rarity="T",this.name="Darkforged Mimic",this.tribe.push("DF","PL"),this.iHealth=this.boof3711,this.iAttack=this.iHealth-1,this.imgKey="SSP"+this.level}dozer(){this.faction="U",this.name="Dozer, the Awakened",this.iAttack=this.level*3+6,this.iHealth=this.iAttack,this.iAggro=!0,this.iBT=!0,this.tribe.push("BR"),this.imgKey=this.code,this.text=`${this.name} enters play with health equal to the Dozer, the Dormant it replaced.`}feywing(){this.faction="U",this.name="Feywing",this.iAttack=9,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("DG")}funguy(){this.name="Funguy",this.iAttack=this.lValN([6,12,14]),this.plont(),this.minLevel=1,this.maxLevel=3,this.level===1?this.hints=["ZZ-1"]:this.level===2&&(this.hints=["LB"])}raptor(){this.faction="U",this.name="Raptor",this.iAttack=1,this.iHealth=1,this.tribe.push("DN"),this.hints=["RT"]}uspirit(){this.faction="U",this.name="Spirit",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("ST")}static zomc(t){return "ZMB"+t}zimus(){this.faction="N",this.rarity="T",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 ut extends kt{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ()},["ABE"]:{c:()=>this.edicC(),z:()=>this.edicZ()},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ()},["COD"]:{c:()=>this.chontC(),z:()=>this.chontZ()},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ()},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ()},["DGW"]:{c:()=>this.drwkC(),z:()=>this.drwkZ()},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ()},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ()},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ()},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ()},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ()},["IVS"]:{c:()=>this.infvC(),z:()=>this.infvZ()},["LOD"]:{c:()=>this.lashC(),z:()=>this.lashZ()},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ()},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ()},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ()},["PLW"]:{c:()=>this.palwC(),z:()=>this.palwZ()},["PHC"]:{c:()=>this.pcallC(),z:()=>this.pcallZ()},["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()},["WPC"]:{c:()=>this.wipeC(),z:()=>this.wipeZ()}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){const e=this.cardCode();return e==="NSH"||e==="PHC"?this.leveledImage(t):this.fixedImage(t)}playTargets(){const t=super.playTargets();if(this.cardCode()==="ABE"&&this.aeSides().some(i=>i.length===0))return t;const e=D.boardTarget("CARD",this.code);return t.push(e),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),T.spellCast()}ddf8(t){return Nt.extractCardCode(t.trigger.logicCode)==="DGW"}jr8(t){if(Nt.extractCardCode(t.trigger.logicCode)==="DGW"){const i=g.jr5(t.trigger.creatId);i.status==="A"&&W.destroy(i,this.code)}x.triggerDone()}apulseC(){this.faction="A",this.rarity="C",this.name="Aegis Pulse",this.text=`Each friendly creature gets Armor ${this.boof234}.`}apulseZ(){const t=this.boof234;g.ddf1().forEach(e=>{e.addArmor(t)})}aeSides(){return[g.qPlayerCreats(!0),g.qPlayerCreats(!1)]}edicC(){this.faction="A",this.rarity="H",this.name="Ambriel's Edict",this.maxLevel=1,this.overload=!0,this.text="If each player has at least one creature in play, destroy all but the highest attack creature that each player controls.~Then discard you hand."}edicZ(){const t=this.aeSides(),e=R.tick();let i=[];t.forEach(m=>{if(m.length>1){let A=[],C=-999999;m.forEach(F=>{F.attack>C?(C=F.attack,i.push(...A),A=[F]):F.attack===C?A.push(F):i.push(F)}),A.length>1&&(A.splice(S.randInt(0,A.length),1),i.push(...A))}}),i.forEach(m=>W.destroy(m,this.code,e));const s=k.getActive(),h=T.playPosition(),f=s.hand.length;for(let m=f-1;m>-1;m--)m!==h&&(s.discard.push(s.hand[m]),s.hand.splice(m,1),T.shiftPlayCard(m))}get ctlboof(){return(this.level-1)*2}ctlC(){this.faction="T",this.rarity="L",this.name="Call the Lightning";const t=this.level>1?` gets ${p.jr9(this.ctlboof,0)} this turn. Those creatures`:"";this.text=`Each friendly creature${t} battles an additional time this turn.`}ctlZ(){const t=this.ctlboof;g.ddf1().forEach(e=>{const i=y.mod("AT",t);i.expiry="ET",e.addMod(i),e.extraBattles+=1})}chontC(){this.faction="T",this.rarity="R",this.name="Chant of Dragonwatch",this.maxLevel=1,this.text="Deal X damaage to each enemy creature, where X is your rank."}chontZ(){const t=k.getActive().rank,e=R.tick();g.qEnemyCreats().forEach(i=>{i.hurtDirect(t,this.code,e)})}dcurC(){this.faction="N",this.rarity="R",this.name="Death Current";const t=this.lValS(["a level 2 or lower","an","two"]);this.text=`Destroy ${t} enemy creature at random.`}dcurZ(){const t=this.dCurrHunter(),e=t.length;if(e>0){const i=S.randInt(0,e),s=R.tick();W.destroy(t[i],this.code,s),this.level===3&&e>1&&(t.splice(i,1),W.destroy(t[S.randInt(0,e-1)],this.code,s))}}dCurrHunter(){const t=y.crEnemyTarg();return t.level=D.ddf2(this.level+1),g.creatByTarget(t)}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${p.jr9(this.boof4812n,0)}.`}digiZ(){const t=this.boof4812n;g.qEnemyCreats().forEach(e=>{e.buff(t,0)})}drwkC(){this.faction="T",this.rarity="L",this.name="Dragonwake",this.text=`Search your deck for a ${p.levelGateText(this.level+1,!0)}Dragon and Spawn a copy of it. It gets Aggressive${this.level===3?".":' and "At the end of your turn, destroy this.'}`}drwkZ(){const t=y.target("DK");t.tribe="DG",t.level=D.ddf2(this.level+1),t.player="F";const e=D.deckByTarget(t),i=e.length;if(i>0){const s=g.birth(e[S.randInt(0,i)][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 ${p.jr9(t,t)}.`}epiZ(){const t=this.boof246n,e=y.crEnemyTarg();g.creatByTarget(e).forEach(i=>{i.buff(t,t)})}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${p.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;g.ddf1().forEach(e=>{e.buff(t,t),this.level===3&&(e.breakthrough=!0)})}get fszap(){return this.level+4}fstormC(){this.faction="T",this.rarity="H",this.name="Firestorm",this.text=`Deal ${this.fszap} damage to each creature.`}fstormZ(){const t=this.fszap,e=R.tick();g.qActiveCreats().forEach(i=>{i.hurtDirect(t,this.code,e)})}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${p.jr9(-1*t,0)}. Each friendly creature gets ${p.jr9(t,0)}.`}mealZ(){const t=this.boof234,e=k.getActiveB();g.qActiveCreats().forEach(i=>{const s=i.owner===e?t:-1*t;i.buff(s,0)})}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${p.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,e=y.crFriendTarg();g.creatByTarget(e).forEach(i=>{i.buff(0,t)})}infvC(){this.faction="N",this.rarity="C",this.name="Infernal Visage";const t=this.boof246;this.text=`Each friendly creature in a side lane gets ${p.jr9(t,t,!0)} and Regenerate ${this.level}.`}infvZ(){const t=this.boof246,e=y.crFriendTarg();e.lanes=[1,5],g.creatByTarget(e).forEach(i=>{i.buff(t,t),i.addRegen(this.level)})}lashC(){this.faction="U",this.rarity="L",this.name="Lash of Demara",this.text=`Each enemy creature gets Poison ${this.level+2}.`}lashZ(){const t=this.level+2;g.qEnemyCreats().forEach(e=>{e.addPoison(t)})}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=L.getCard(this.ndc());this.text=`Spawn a ${p.tokName(t)}.`}shriekZ(){g.birth(this.ndc(),"S",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;g.qEnemyCreats().forEach(e=>{e.addPoison(t)})}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${p.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)g.ddf1().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;g.ddf1().forEach(e=>{e.buff(t,0)})}}palwC(){this.faction="A",this.rarity="R",this.name="Palladium Wave",this.maxLevel=1,this.text=`Each enemy creature gets ${p.jr9(-1,0).replaceAll("1","X")}, where X is two times your rank.`}palwZ(){const t=-2*k.getActive().rank;g.qEnemyCreats().forEach(e=>{e.buff(t,0)})}pcallC(){this.faction="T",this.rarity="L",this.name="Phoenix Call";const t=L.getCard(this.cpc());this.text=`Spawn a ${p.tokName(t)}.`}pcallZ(){g.birth(this.cpc(),"S",k.getActiveB())}cpc(){return "CYP"+this.level}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=L.getCard(Z.minionCode(this.level));this.text=`Put a ${p.tokName(t)} into each players available lanes.`}phyZ(){const t=Z.minionCode(this.level),e=R.tick();[!0,!1].forEach(i=>{g.emptyLanes(i).forEach(s=>{g.birth(t,"P",i,s,e)})})}pyreC(){this.faction="T",this.rarity="C",this.name="Pyre Song",this.text=`Each friendly creature deals ${this.level} damage to each enemy creature.`}pyreZ(){const t=this.level,e=R.tick(),i=g.qEnemyCreats();g.ddf1().forEach(s=>{i.forEach(h=>{h.hurtDirect(t,s.code,e)})})}rokC(){this.faction="T",this.rarity="L",this.name="Rage of Kadras",this.overload=!0,this.maxLevel=1,this.text="Each friendly Tempys creature gets +1 attack and deals damage equal to its attack to the creature opposing it."}rokZ(){const t=R.tick(),e=y.crFriendTarg();e.faction="T",g.creatByTarget(e).forEach(i=>{i.buff(1,0);const s=i.opposed;s&&s.hurtDirect(i.attack,i.code,t)})}stsC(){this.faction="U",this.rarity="C",this.name="Scatter the Seeds";const t=L.getCard(Z.minionCode(this.level));this.text=`Spawn three ${p.tokName(t)}s.`}stsZ(){const t=Z.minionCode(this.level),e=R.tick();[1,2,3].forEach(i=>{g.birth(t,"S",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 ${p.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;g.qEnemyCreats().forEach(e=>{e.buff(t,0)})}sradC(){this.faction="U",this.rarity="C",this.name="Soothing Radiance",this.text=`Heal ${this.boof61224} damage from each friendly creature.`}sradZ(){const t=this.boof61224;g.ddf1().forEach(e=>{e.heal(t)})}beec(){return "KBE"+this.level}beesC(){this.faction="U",this.rarity="H",this.name="Stinging Invocation";const t=L.getCard(this.beec());this.text=`Spawn one to three ${p.tokName(t)}s.`}beesZ(){const t=this.beec(),e=R.tick(),i=S.randInt(2,5);[1,2,3].forEach(s=>{s{const i=y.mod("AT",t);i.expiry="ET",e.addMod(i)})}talinTarg(){const t=y.crFriendTarg();return t.faction="T",g.creatByTarget(t)}turnbC(){this.faction="T",this.rarity="H",this.name="Turnabout",this.isFree=this.level===3;const t=this.boof235;this.text=`Each creature gets ${p.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,e=-1*t;g.qActiveCreats().forEach(i=>{const s=y.mod("AT",t),h=y.mod("HL",e),f=y.mod("MH",e);s.expiry="ET",h.expiry="ET",f.expiry="ET",i.addMod(s),i.addMod(h),i.addMod(f)})}verdC(){this.faction="U",this.rarity="H",this.name="Verdant Charge";const t=this.verdb;this.text=`Each friendly creature gets ${p.jr9(t,t,!0)} and Regenerate ${t}.`}verdZ(){const t=this.verdb;g.ddf1().forEach(e=>{e.buff(t,t),e.addRegen(t)})}get verdb(){return this.lValN([1,3,6])}wdenC(){this.faction="U",this.rarity="R",this.name="Whispers of Dendris",this.maxLevel=1,this.text=`Each friendly creature gets ${p.jr9(1,1).replaceAll("1","X")}, where X is your rank.`}wdenZ(){const t=k.getActive().rank;g.ddf1().forEach(e=>{e.buff(t,t)})}wipeC(){this.faction="A",this.rarity="H",this.name="Wipe Clean",this.overload=!0,this.maxLevel=1,this.text="Remove all abilities from each creature and player."}wipeZ(){[!0,!1].forEach(e=>{const i=k.toPlayer(e);i.effects=[],i.mods=[],i.triggers=i.triggers.filter(s=>s.customCode==="AB"),i.poison=0,i.armor=0});const t=g.qActiveCreats();t.forEach(e=>{e.preWipe()}),t.forEach(e=>{e.wipeAll()})}}class $i 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}.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=g.jr5(e[1]),h=this.emptySloots(s,i.id);h.push(T.cancelAction()),T.ddf5(h)}else{const i=g.jr5(e[1]),s=g.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),i.endActivation()}}emptySloots(t,e=""){return T.emptyAdjacents(t,S.enTil("P2",t.id,e))}buddies(t){return D.toActions(y.crFriendNotMeActTarg("CARD",t,this.code,S.enTil("P1",t)))}}class Wi 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.text=`Upgrade Dinosaur: Replace Bron with a level ${this.level} Dino Knight.~When this ${p.dbdtap()}, heal ${e} damage from each other friendly creature.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("UP");const s=i.jr4("DM");return s.bonus=this.buffNug(0,this.boof357),i}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){if(t.trigger.type==="UP"){const i=$.toReplaced(t.event).replCreat;i.isTribe("DN")&&g.birth("DNK"+this.level,"R",i.owner,i.lane)}else if(t.trigger.type==="DM"){const e=this.boof357,i=y.crNotMeTarg(t.creatId);i.player=k.toTarget(t.owner),g.creatByTarget(i).forEach(h=>h.heal(e))}x.triggerDone()}}class Vi 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 i=super.jr3(t,e);return i.jr4("PT"),i}ddf8(t){return t.event.playerA===t.owner}jr8(t){const e=y.mod("AR",this.boof2510),i=y.mod("DF",!0);e.expiry="ET",i.expiry="ET";const s=g.jr5(t.creatId);s.addMod(e),s.addMod(i),x.triggerDone()}}class Ui extends kt{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Bullwark Bash",this.text=`Deal damage equal to ${this.level>1?this.level+"x ":""}the Armor on a friendly creature to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");e.hasArmor=!0,t.push(e)}return t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=this.enemyTargActions(i.id);s.push(T.cancelAction()),T.ddf5(s)}else{const i=g.ddf6(t),s=g.jr5(e[1]);this.logSpell(s),i.hurtDirect(s.armor*this.level,this.code),T.spellCast()}}enemyTargActions(t=""){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(e)}}class Oi 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} ${p.dbdtac(this.level)}, destroy it.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}ddf8(t){const e=$.toDamage(t.event);return e.battle&&e.isCreatSrc&&e.isCreatTarg&&e.srcId===t.creatId&&D.levelTestCommon(e.hurtCreat.level,this.level)}jr8(t){if(t.trigger.type==="FR"&&E.allied("N")){const e=g.jr5(t.creatId),i=e.jr4("DM");i.bonus=this.avgSpawnNug(),e.changed=!0}else if(t.trigger.type==="DM"){const i=$.toDamage(t.event).hurtCreat;i.status==="A"&&W.destroy(i,this.code)}x.triggerDone()}}class zi 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.hints=["ZZ-2"],this.iMobile=1,this.maxLevel=4;const e=this.level===4?`When ${this.name} ${p.dbdtap()}, deal damamge to that player equal to their health.~`:"";this.text=e+`When ${this.name} ${p.dbdtac(this.level)}, destroy that creature.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return this.level===4?s.bonus=this.rawNug(0,0,0,0,10):s.bonus=this.avgSpawnNug(),i}ddf8(t){const e=$.toDamage(t.event);if(e.battle&&e.isCreatSrc&&e.srcId===t.creatId){if(this.level===4)return!0;if(e.isCreatTarg){const i=e.hurtCreat;return D.levelTestCommon(i.level,this.level)}}return!1}jr8(t){const e=$.toDamage(t.event);if(e.isCreatTarg){const i=e.hurtCreat;i.status==="A"&&W.destroy(i,this.code)}else k.hurtDirect(e.hurtPlayer,e.hurtPlayer.health,this.code);x.triggerDone()}}class ft extends P{lookup(t){return{["ASQ"]:{c:()=>this.asqC(),a:(i,s)=>this.asqA(i,s),t:i=>this.asqT(i)},["BSW"]:{c:()=>this.bswC(),a:(i,s)=>this.bswA(i,s),t:i=>this.bswT(i)},["CCS"]:{c:()=>this.ccsC(),a:(i,s)=>this.ccsA(i,s),t:i=>this.ccsT(i)},["CGL"]:{c:()=>this.clordC(),a:(i,s)=>this.clordA(i,s),t:i=>this.clordT(i)},["CSH"]:{c:()=>this.cswC(),a:(i,s)=>this.cswA(i,s),t:i=>this.cswT(i)},["FFU"]:{c:()=>this.ffuC(),a:(i,s)=>this.ffuA(i,s),t:i=>this.ffuT(i)},["FFS"]:{c:()=>this.ffsC(),a:(i,s)=>this.ffsA(i,s),t:i=>this.ffsT(i)},["FSH"]:{c:()=>this.fssC(),a:(i,s)=>this.fssA(i,s),t:i=>this.fssT(i)},["KOD"]:{c:()=>this.kodC(),a:(i,s)=>this.kodA(i,s),t:i=>this.kodT(i)},["LOD"]:{c:()=>this.lashC(),a:(i,s)=>this.lashA(i,s),t:i=>this.lashT(i)},["MBP"]:{c:()=>this.mbpC(),a:(i,s)=>this.mbpA(i,s),t:i=>this.mbpT(i)},["MND"]:{c:()=>this.mndC(),a:(i,s)=>this.mndA(i,s),t:i=>this.mndT(i)},["NCS"]:{c:()=>this.ncsC(),a:(i,s)=>this.ncsA(i,s),t:i=>this.ncsT(i)},["NXG"]:{c:()=>this.nxgC(),a:(i,s)=>this.nxgA(i,s),t:i=>this.nxgT(i)},["NFF"]:{c:()=>this.nffC(),a:(i,s)=>this.nffA(i,s),t:i=>this.nffT(i)},["OHV"]:{c:()=>this.orghC(),a:(i,s)=>this.orghA(i,s),t:i=>this.orghT(i)},["PPM"]:{c:()=>this.ppmC(),a:(i,s)=>this.ppmA(i,s),t:i=>this.ppmT(i)},["PSC"]:{c:()=>this.pcoilC(),a:(i,s)=>this.pcoilA(i,s),t:i=>this.pcoilT(i)},["SGF"]:{c:()=>this.siggyC(),a:(i,s)=>this.siggyA(i,s),t:i=>this.siggyT(i)},["SRM"]:{c:()=>this.srmdC(),a:(i,s)=>this.srmdA(i,s),t:i=>this.srmdT(i)},["SFG"]:{c:()=>this.sfgdC(),a:(i,s)=>this.sfgdA(i,s),t:i=>this.sfgdT(i)},["SSA"]:{c:()=>this.ssaC(),a:(i,s)=>this.ssaA(i,s),t:i=>this.ssaT(i)},["SWM"]:{c:()=>this.swmC(),a:(i,s)=>this.swmA(i,s),t:i=>this.swmT(i)},["UCM"]:{c:()=>this.ucmC(),a:(i,s)=>this.ucmA(i,s),t:i=>this.ucmT(i)},["UIM"]:{c:()=>this.uimC(),a:(i,s)=>this.uimA(i,s),t:i=>this.uimT(i)},["WMR"]:{c:()=>this.warmC(),a:(i,s)=>this.warmA(i,s),t:i=>this.warmT(i)},["WWR"]:{c:()=>this.wwrC(),a:(i,s)=>this.wwrA(i,s),t:i=>this.wwrT(i)},["WFS"]:{c:()=>this.wfsC(),a:(i,s)=>this.wfsA(i,s),t:i=>this.wfsT(i)},["XSH"]:{c:()=>this.shambC(),a:(i,s)=>this.shambA(i,s),t:i=>this.shambT(i)},["ZPM"]:{c:()=>this.zpmC(),a:(i,s)=>this.zpmA(i,s),t:i=>this.zpmT(i)}}[t]}targAction(t,e,i){this.lookup(t).a(e,i)}actTargets(t,e){return this.lookup(t).t(e)}xl=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return this.doubleActivator()&&(i.jr4("TS"),this.addExtraActivate(i)),i}canActivate(t){return D.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){const e=D.toActions([this.actTargets(this.cardCode(),t),D.buttonTarget("CANC")]);T.ddf5(e)}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.logAct(!0,this.xl?e:void 0),this.targAction(this.cardCode(),e,i),i.endActivation()}makeCreatTarg(t){return y.crActTarg("CARD",this.code,t.id)}makeOtherCreatTarg(t){const e=this.makeCreatTarg(t);return e.notMe=t.id,e}doubleActivator(){return this.code==="CGL"+"3"||this.code==="XSH"+"3"}ddf8(t){return Nt.extractCardCode(t.trigger.logicCode)==="KOD"&&(t.trigger.type==="PT"||t.trigger.type==="VN")?!0:t.trigger.type==="TS"&&this.doubleActivator()?t.event.playerA===t.owner:super.ddf8(t)}jr8(t){if(t.trigger.type==="VN"){const e=t.event,i=g.jr5(e.creatId);g.birth(i.code,"S",t.owner),x.triggerDone()}else if(t.trigger.type==="PT"){const e=t.trigger.customCode,i=g.jr5(t.creatId);i.triggers.filter(h=>h.customCode===e).forEach(h=>i.removeTrigger(h)),x.triggerDone()}else if(t.trigger.type==="TS"){const e=g.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}asqC(){this.faction="N",this.rarity="L",this.name="Ariadne, Spider Queen",this.iAttack=this.boof3712,this.iHealth=this.lValN([8,12,19]),this.tribe.push("SP"),this.xl=!1,this.text="Activate, destroy a Web: Ariadne gets +attack and +health equal to the destroyed Web.";const t=this.avgCreatureStats();this.bonus={activ8:this.multNug(this.buffNug(t[0],t[1]),.7)}}asqT(t){const e=this.makeCreatTarg(t);return e.tribe="WB",e}asqA(t,e){e.buff(t.attack,t.health),W.destroy(t,this.code)}bswC(){this.faction="T",this.rarity="C",this.name="Borean Stormweaver",this.iAttack=this.boof4816,this.iHealth=this.lValN([6,10,20]),this.tribe.push("GT"),this.xl=!1;const t=this.boof234;this.text=`Activate: Deal ${t} damage to a creature.`,this.bonus={activ8:this.buffNug(0,t)}}bswT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}bswA(t,e){t.hurtDirect(this.boof234,this.code)}ccsC(){this.faction="N",this.rarity="C",this.name="Catacomb Spider",this.iAttack=this.boof4815,this.iHealth=this.lValN([5,10,16]),this.tribe.push("SP");const t=this.boof246;this.text=`Activate: Give another creature Regenerate ${t}.`,this.bonus={activ8:this.regnNug(t)}}ccsT(t){const e=this.makeOtherCreatTarg(t);return e.canRegen=!0,e.hint=["BF"],e}ccsA(t,e){t.addRegen(this.boof246)}clordC(){this.faction="N",this.rarity="H",this.name="Contagion Lord",this.iAttack=this.boof4914,this.iHealth=this.iAttack+3,this.tribe.push("AB"),this.xl=!1,this.text="Activate, destroy a friendly Abomination: You may play an additional card this turn.",this.level===3&&(this.text+="~You may use this ability twice per turn."),this.bonus={activ8:this.multNug(this.avgSpawnNug(),.3)}}clordT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="AB",e}clordA(t,e){W.destroy(t,this.code),E.regularPlays+=1}cswC(){this.faction="A",this.rarity="C",this.name="Cypien Shieldwarden",this.iAttack=this.boof4610,this.iHealth=this.boof61016,this.tribe.push("HM");const t=this.boof246;this.text=`Activate: Give a creature Armor ${t} this turn.`,this.bonus={activ8:this.regnNug(t)}}cswT(t){const e=this.makeCreatTarg(t);return e.canArmor=!0,e.hint=["BF"],e}cswA(t,e){const i=y.mod("AR",this.boof246);i.expiry="ET",t.addMod(i)}ffuC(){this.faction="T",this.rarity="H",this.name="Firefist Uranti",this.iAttack=this.boof357,this.iHealth=this.boof71116,this.tribe.push("FR","YT"),this.xl=!1,this.text=`Activate: Deal damage equal to ${this.name}'s attack to a creature.`,this.bonus={activ8:this.buffNug(0,this.iAttack)}}ffuT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],t.attack<1&&(e.victims="???"),e}ffuA(t,e){t.hurtDirect(e.attack,this.code)}ffsC(){this.faction="T",this.rarity="R",this.name="Flamefury Shaman",this.iAttack=this.boof369,this.iHealth=this.boof81116,this.tribe.push("HM"),this.text=`Activate: Grant another creature ${p.jr9(this.iAttack,0)} this turn.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}ffsT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}ffsA(t,e){const i=y.mod("AT",this.iAttack);i.expiry="ET",t.addMod(i)}fssC(){this.faction="T",this.rarity="R",this.name="Flamestoke Shaman",this.iAttack=this.boof61218,this.iHealth=this.boof3712,this.tribe.push("HM"),this.text=`Activate: Grant an adjacent ${p.levelGateText(this.level,!0)}creature Aggressive.`,this.bonus={activ8:this.regnNug(1)}}fssT(t){const e=this.makeCreatTarg(t);return e.level=D.ddf2(this.level),e.lanes=t.adjacent,e.player="F",e}fssA(t,e){t.aggressive=!0}kodC(){this.faction="N",this.rarity="L",this.name="Keeper of the Damned",this.iAttack=this.boof5815,this.iHealth=this.boof61017,this.tribe.push("ZB"),this.text=`Activate: another friendly ${p.levelGateText(this.level,!0)}creature gets "Vengeance: Spawn this" this turn.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}kodT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.player="F",e}kodA(t,e){const i=t.jr4("VN");i.customCode=e.id,i.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e.id}lashC(){this.faction="U",this.rarity="L",this.name="Demara, Herald of Affliction",this.iAttack=14,this.iHealth=20,this.tribe.push("NG"),this.text="Activate: Give an enemy creature with Poison Defender.~Forge: Each enemy creature gets Poison 6.",this.bonus={activ8:this.rawNug(0,0,0,0,.1)}}lashT(t){const e=this.makeCreatTarg(t);return e.player="E",e.hasPoison=!0,e.canDefender=!0,e}lashA(t,e){t.defender=!0}mbpC(){this.faction="U",this.rarity="H",this.name="Mossbeard Patriarch",this.iAttack=this.boof137,this.iHealth=this.boof81220,this.tribe.push("PL");const t=this.boof468;this.text=`Activate: Give another creature ${p.jr9(0,t)}.`,this.bonus={activ8:this.buffNug(0,t)}}mbpT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mbpA(t,e){t.buff(0,this.boof468)}mndC(){this.faction="A",this.rarity="R",this.name="Munitions Drone",this.iAttack=this.boof137,this.iHealth=this.boof6814,this.tribe.push("RB");const t=this.boof357;this.text=`Activate: Give another creature ${p.jr9(t,0)}.`,this.bonus={activ8:this.buffNug(t,0)}}mndT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mndA(t,e){t.buff(this.boof357,0)}ncsC(){this.faction="N",this.rarity="R",this.name="Necroslime",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.xl=!1;const t=this.boof248;this.text=`Activate, deal 3 damage to another friendly creature: ${this.name} gets ${p.jr9(t,t)}.`,this.bonus={activ8:this.buffNug(t,t-3)}}ncsT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}ncsA(t,e){const i=this.boof248;t.hurtDirect(3,this.code),e.buff(i,i)}nxgC(){this.faction="A",this.rarity="H",this.name="Nexus Gunner",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("HM"),this.text=`Activate: Give a creature ${p.jr9(this.iAttack,0)}. Use this ability only if ${this.name} is in the center lane.`,this.bonus={activ8:this.buffNug(this.iAttack/2,0)}}nxgT(t){const e=this.makeCreatTarg(t);return t.lane!==3?e.victims="???":e.hint=["BF","BB"],e}nxgA(t,e){t.buff(this.iAttack,0)}nffC(){this.faction="U",this.rarity="L",this.name="Nuada, Faith's Flourish",this.iAttack=this.boof246,this.iHealth=this.lValN([10,17,25]),this.iDefend=!0,this.tribe.push("TK"),this.xl=!1,this.hints=[this.lValH(["ZZ-1","ZZ-2","ZZ-2"])];const t=L.getCard(Z.tffc(this.level));this.text=`Activate: Replace a friendly Plant with a ${p.tokName(t)}.`,this.bonus={activ8:this.multNug(this.spawnNug(t),.5)}}nffT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="PL",e}nffA(t,e){g.birth(Z.tffc(this.level),"R",e.owner,t.lane)}orghC(){this.faction="N",this.rarity="R",this.name="Organ Harvester",this.iAttack=this.lValN([2,6,9]),this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1,this.text=`Activate, destroy ${this.name}: Destroy a ${p.levelGateText(this.level,!0)}creature.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.4)}}orghT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.hint=["KL"],e}orghA(t,e){const i=R.tick();W.destroy(t,this.code,i),W.destroy(e,this.code,i)}ppmC(){this.faction="A",this.rarity="R",this.name="Palladium Pulsemage",this.iAttack=this.lValN([2,8,12]),this.iHealth=this.lValN([7,12,15]),this.tribe.push("HM"),this.text=`Activate: give a creature ${p.jr9(this.boof4812n,0)} this turn.`,this.bonus={activ8:this.buffNug(this.boof246,0)}}ppmT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}ppmA(t,e){const i=y.mod("AT",this.boof4812n);i.expiry="ET",t.addMod(i)}pcoilC(){this.faction="U",this.rarity="R",this.name="Poisoncoil",this.iAttack=this.boof357,this.iHealth=this.boof71013,this.iDefend=!0,this.tribe.push("SN");const t=this.boof135;this.text=`Activate: Give another creature Poison ${t}.`,this.bonus={activ8:this.regnNug(t)}}pcoilT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["PN","DF"],e}pcoilA(t,e){t.addPoison(this.boof135)}siggyC(){this.faction="N",this.rarity="H",this.name="Sigmund Fraud",this.iAttack=this.boof357,this.iHealth=this.lValN([9,14,19]),this.iDefend=!0,this.tribe.push("AB"),this.xl=!1;const t=this.boof4812;this.text=`Activate, destroy another friendly creature: Deal ${t} damage to the enemy player and you gain ${t} health.`,this.bonus={activ8:this.playerNug(t)}}siggyT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}siggyA(t,e){W.destroy(t,this.code);const i=this.boof4812;k.hurtDirect(!e.owner,i,this.code),k.heal(e.owner,i)}srmdC(){this.faction="N",this.rarity="H",this.name="Sorrow Maiden",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.xl=!1,this.text=`Activate: Destroy an enemy creature with ${this.iAttack} or less attack.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.4)}}srmdT(t){const e=this.makeCreatTarg(t);return e.player="E",e.maxAttack=this.iAttack,e}srmdA(t,e){W.destroy(t,this.code)}sfgdC(){this.faction="A",this.rarity="L",this.name="Sparky, Forge Guard Dog",this.iAttack=this.lValN([4,10,14]),this.iHealth=this.lValN([5,11,16]),this.tribe.push("RB","GD"),this.xl=!1;const t=this.lValS(["level 2 Sparky","level 3 Sparky","25/25 Forge Guardian Omega"]);this.text=`Activate, destroy Sparky and another friendly ${this.level===3?"level 3 ":""}Sparky: Spawn a ${t}.`,this.bonus={activ8:this.playerNug(5)}}sfgdT(t){const e=this.makeOtherCreatTarg(t);return e.cardCode="SFG",this.level===3&&(e.level="L3"),e}sfgdA(t,e){const i=R.tick();W.destroy(t,this.code,i),W.destroy(e,this.code,i);const s=this.lValS(["SFG"+"2","SFG"+"3","FGO"+"1"]);g.birth(s,"S",e.owner)}ssaC(){this.faction="N",this.rarity="H",this.name="Spitesower Acolyte",this.iAttack=this.boof234,this.iHealth=this.lValN([8,14,22]),this.tribe.push("HM");const t=this.boof246n;this.text=`Activate, deal ${-t} damage to ${this.name}: Give a creature ${p.jr9(t,t)}.`,this.bonus={activ8:this.buffNug(-t,0)}}ssaT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","BB"],e}ssaA(t,e){const i=this.boof246n,s=R.tick();e.hurtDirect(-i,this.code,s),t.buff(i,i,s)}swmC(){this.faction="A",this.rarity="R",this.name="Steelwelder Medic",this.iAttack=this.lValN([3,5,13]),this.iHealth=this.boof61014,this.tribe.push("HM"),this.text=`Activate: Give another creature Armor ${this.level}.`,this.bonus={activ8:this.regnNug(this.level)}}swmT(t){const e=this.makeOtherCreatTarg(t);return e.canArmor=!0,e.hint=["BF","BB"],e}swmA(t,e){t.addArmor(this.level)}ucmC(){this.faction="T",this.rarity="R",this.name="Uranti Cryomancer",this.iAttack=this.boof247,this.iHealth=this.lValN([8,13,17]),this.tribe.push("IC","YT"),this.xl=!1;const t=this.boof135;this.text=`Activate: Deal ${t} damage to a creature.`,this.bonus={activ8:this.buffNug(0,t)}}ucmT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}ucmA(t,e){t.hurtDirect(this.boof135,this.code)}uimC(){this.faction="T",this.rarity="C",this.name="Uranti Icemage",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.lValN([8,13,20]),this.tribe.push("IC","YT"),this.text="Activate: Negate Defender this turn.",this.bonus={activ8:this.regnNug(1)}}uimT(t){const e=this.makeCreatTarg(t);return e.hint=["BB"],e}uimA(t,e){const i=y.mod("ND",!0);i.expiry="ET",t.addMod(i)}warmC(){this.faction="A",this.rarity="H",this.name="War Merchant",this.iAttack=this.boof468,this.iHealth=this.iAttack,this.iDefend=!0,this.tribe.push("HM");const t=this.level===3?this.iAttack:0;this.text=`Activate: Give a creature in a center lane ${p.jr9(this.iAttack,t)}.`,this.bonus={activ8:this.multNug(this.buffNug(this.iAttack,t),.5)}}warmT(t){const e=this.makeCreatTarg(t);return e.lanes=3,e.hint=["BF","BB"],e}warmA(t,e){t.buff(this.iAttack,this.level===3?this.iAttack:0)}wwrC(){this.faction="U",this.rarity="C",this.name="Weirwood Ranger",this.iAttack=this.boof51015,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.text=`Activate: Give another creature ${p.jr9(this.level,this.level)}.`,this.bonus={activ8:this.buffNug(this.level,this.level)}}wwrT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF","BB"],e}wwrA(t,e){t.buff(this.level,this.level)}wfsC(){this.faction="N",this.rarity="H",this.name="Witherfrost Succubus",this.iAttack=this.boof147,this.iHealth=this.boof61018,this.tribe.push("DM");const t=this.boof357;this.text=`Activate: Give a creature ${p.jr9(-t,-t)} this turn.`,this.bonus={activ8:this.buffNug(t,t)}}wfsT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}wfsA(t,e){const i=-this.boof357,s=y.mod("AT",i);s.expiry="ET",t.addMod(s);const h=y.mod("HL",i);h.expiry="ET",t.addMod(h);const f=y.mod("MH",i);f.expiry="ET",t.addMod(f)}shambC(){this.faction="N",this.rarity="L",this.name="Xithian Shambler",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1;let t="";this.level===3&&(t="~You may use this ability twice per turn."),this.text=`Activate, destroy an adjacent creature: ${this.name} moves into that creature's lane, then gets +attack and +health equal to that creature's attack and health.${t}`,this.bonus={activ8:this.rawNug(0,0,0,0,this.lValN([.6,1.2,2.2]))}}shambT(t){const e=y.crFriendActTarg("CARD",this.code,t.id);return e.lanes=t.adjacent,e}shambA(t,e){const i=t.attack,s=t.health;W.destroy(t,this.code),e.move(t.lane),e.buff(i,s)}zpmC(){this.faction="T",this.rarity="R",this.name="Zephyr Mage",this.iAttack=this.boof4813,this.iHealth=this.boof61017,this.tribe.push("WN","AS"),this.text=`Activate: Give another ${p.levelGateText(this.level,!0)}creature Mobility ${this.level}.`,this.bonus={activ8:this.regnNug(this.level)}}zpmT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.canMove=!0,e.hint=["BF","BB"],e}zpmA(t,e){t.addMobility(this.level)}}class ze extends P{lookup(t){return{["CMF"]:{c:()=>this.aconC(),f:(i,s)=>this.aconF(i,s)},["FLH"]:{c:()=>this.flhC(),f:(i,s)=>this.flhF(i,s)},["TBB"]:{c:()=>this.tbbC(),f:(i,s)=>this.tbbF(i,s)}}[t]}targAction(t,e,i){this.lookup(t).f(e,i)}playTarg;optional=!1;notme=!1;ftext="";constructor(t){super(t),this.playTarg=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("AS");return s.interactive=!0,i}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.targAction(this.cardCode(),e,i),T.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const e=D.toActions(this.playTarg);e.length>0?(e.forEach(i=>{i.param=t.creatId}),this.optional&&e.push(T.noneEndTrigger()),T.ddf5(e)):x.triggerDone()}aconC(){this.faction="N",this.rarity="R",this.name="Calamity Fiend",this.iAttack=this.boof4814,this.iHealth=this.lValN([5,10,16]),this.tribe.push("DM");const t=-this.boof234;this.addSp("U",t),this.playTarg.player="E",this.ftext=`Give an enemy creature ${p.jr9(t,t)}.`}aconF(t,e){this.logAct(!1,t);const i=-this.boof234;t.buff(i,i)}flhC(){this.faction="T",this.rarity="C",this.name="Firelight Hunter",this.iAttack=this.boof468,this.iHealth=this.iAttack-2,this.tribe.push("HM"),this.playTarg.player="E",this.addSp("D",this.iAttack),this.ftext=`Deal ${this.iAttack} to an enemy creature.`}flhF(t,e){t.hurtDirect(this.iAttack,this.code)}tbbC(){this.faction="T",this.rarity="R",this.name="Totembound Berserker",this.iAttack=this.boof81318,this.iHealth=this.lValN([2,4,10]),this.tribe.push("GT"),this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level),this.optional=!0,this.ftext=`You may move an enemy ${p.levelGateText(this.level,!0)}creature to the space opposing ${this.name}.`}tbbF(t,e){e.opposed||(this.logAct(!1,t),t.move(g.oppositeLane(e.lane)))}}class gt extends P{lookup(t){return{["ABM"]:{c:()=>this.mawC(),f:(i,s)=>this.mawF(i,s)},["AGC"]:{c:()=>this.aconC(),f:(i,s)=>this.aconF(i,s)},["BTI"]:{c:()=>this.binvC(),f:(i,s)=>this.binvF(i,s)},["BSR"]:{c:()=>this.bsrC(),f:(i,s)=>this.bsrF(i,s)},["BAW"]:{c:()=>this.bawC(),f:(i,s)=>this.bawF(i,s)},["CKB"]:{c:()=>this.cacC(),f:(i,s)=>this.cacF(i,s)},["CHA"]:{c:()=>this.chaC(),f:(i,s)=>this.chaF(i,s)},["CCR"]:{c:()=>this.ccC(),f:(i,s)=>this.ccF(i,s)},["DRS"]:{c:()=>this.drsC(),f:(i,s)=>this.drsF(i,s)},["DSE"]:{c:()=>this.dseC(),f:(i,s)=>this.dseF(i,s)},["DSA"]:{c:()=>this.dsaC(),f:(i,s)=>this.dsaF(i,s)},["DGS"]:{c:()=>this.drslC(),f:(i,s)=>this.drslF(i,s)},["FRI"]:{c:()=>this.friC(),f:(i,s)=>this.friF(i,s)},["FRV"]:{c:()=>this.freavC(),f:(i,s)=>this.freavF(i,s)},["GLF"]:{c:()=>this.gfiendC(),f:(i,s)=>this.gfiendF(i,s)},["GRW"]:{c:()=>this.grwC(),f:(i,s)=>this.grwF(i,s)},["GHT"]:{c:()=>this.grhC(),f:(i,s)=>this.grhF(i,s)},["MMH"]:{c:()=>this.houndC(),f:(i,s)=>this.houndF(i,s)},["MXW"]:{c:()=>this.mtxC(),f:(i,s)=>this.mtxF(i,s)},["NGB"]:{c:()=>this.ngbC(),f:(i,s)=>this.ngbF(i,s)},["POA"]:{c:()=>this.poaC(),f:(i,s)=>this.poaF(i,s)},["PHS"]:{c:()=>this.phxsC(),f:(i,s)=>this.phxsF(i,s)},["RWD"]:{c:()=>this.rotC(),f:(i,s)=>this.rotF(i,s)},["SHY"]:{c:()=>this.schyC(),f:(i,s)=>this.schyF(i,s)},["STD"]:{c:()=>this.stdC(),f:(i,s)=>this.stdF(i,s)},["SEV"]:{c:()=>this.surzC(),f:(i,s)=>this.surzF(i,s)},["VNF"]:{c:()=>this.vnfC(),f:(i,s)=>this.vnfF(i,s)},["WBY"]:{c:()=>this.wbyC(),f:(i,s)=>this.wbyF(i,s)},["WBU"]:{c:()=>this.wbuC(),f:(i,s)=>this.wbuF(i,s)},["XDH"]:{c:()=>this.dogsC(),f:(i,s)=>this.dogsF(i,s)}}[t]}targAction(t,e,i){this.lookup(t).f(e,i)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}jr3(t,e){const i=super.jr3(t,e);if(this.forges){const s=i.jr4("FR");s.interactive=!0}return i}ddf8(t){return Nt.extractCardCode(t.trigger.logicCode)==="CKB"}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.targAction(this.cardCode(),e,i),T.actionDone(!0)}jr8(t){const e=this.cardCode();if(t.trigger.type==="TS"&&e==="CKB"){this.logAct(!1),E.regularPlays+=1;const s=t.event,h=k.toPlayer(s.playerA),f=y.trigIdx(h.triggers,t.trigger);f>-1&&h.triggers.splice(f,1),x.triggerDone();return}if(e==="ABM"){const s=y.crFriendNotMeTarg(t.creatId);if(s.tribe="AB",g.creatByTarget(s).length===0){x.triggerDone();return}}if(e==="POA"&&!E.patron("A")){x.triggerDone();return}if((e==="DRS"||e==="DSE"||e==="DSA")&&this.dfbuff(t.creatId)===0){x.triggerDone();return}this.notme&&(this.playTarg.notMe=t.creatId);const i=D.toActions(this.playTarg);i.length>0?(i.forEach(s=>{s.param=t.creatId}),this.optional&&i.push(T.noneEndTrigger()),T.ddf5(i)):x.triggerDone()}dfbuff(t){const e=y.crFriendNotMeTarg(t);return e.tribe="DF",this.boof234*g.creatByTarget(e).length}mawC(){this.faction="N",this.rarity="C",this.name="Abyssal Maw",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=-this.boof359;this.ftext=`If there is another friendly Abomination, give an enemy creature ${p.jr9(t,t)}.`}mawF(t,e){this.logAct(!1,t);const i=-this.boof359;t.buff(i,i)}aconC(){this.faction="A",this.rarity="C",this.name="Aegis Conscript",this.iAttack=this.boof3612,this.iHealth=this.boof6915,this.tribe.push("HM"),this.playTarg.canArmor=!0,this.playTarg.player="F",this.ftext=`Give a friendly creature Armor ${this.boof124}.`}aconF(t,e){this.logAct(!1,t),t.addArmor(this.boof124)}binvC(){this.faction="A",this.rarity="C",this.name="Battletech Inventor",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("MM"),this.playTarg.player="E",this.ftext=`Give an enemy creature ${p.jr9(-this.iAttack,0)}.`}binvF(t,e){this.logAct(!1,t),t.buff(-this.iAttack,0)}bsrC(){if(this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.iAttack=this.boof5813,this.iHealth=this.boof3712,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.playTarg.level=D.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy an enemy ${p.levelGateText(t,!0)}creature.`,this.optional=!0}else this.hints=["LG"]}bsrF(t,e){W.destroy(t,this.code)}bawC(){this.faction="U",this.rarity="R",this.name="Brambleaxe Warrior",this.iAttack=this.boof61014,this.iHealth=this.iAttack-4,this.tribe.push("HM"),this.playTarg.hint=["BF"],this.ftext="Give a creature Breakthrough this turn."}bawF(t,e){this.logAct(!1,t);const i=y.mod("BT",!0);i.expiry="ET",t.addMod(i)}cacC(){this.faction="N",this.rarity="H",this.name="Cacklebones",this.iAttack=this.boof5915,this.iHealth=this.iAttack-this.level,this.tribe.push("SK"),this.playTarg.level=D.ddf2(this.level),this.playTarg.player="E",this.ftext=`Destroy an enemy ${p.levelGateText(this.level,!0)}creature. If you do, the enemy player may play an additional card next turn.`,this.optional=!0}cacF(t,e){W.destroy(t,this.code);const i=k.toPlayer(t.owner),s=y.trigger("TS",this.code);s.bonus=this.avgSpawnNug(),i.triggers.push(s)}chaC(){this.faction="U",this.rarity="R",this.name="Chistlehearth Archer",this.iAttack=this.boof2510,this.iHealth=this.iAttack+7,this.tribe.push("HM");const t=this.boof4816;this.playTarg.player="E",this.playTarg.hasMobility=!0,this.ftext=`Deal ${t} damage to an enemy creature with Mobility. Negate Mobility from that creature.`}chaF(t,e){t.hurtDirect(this.boof4816,this.code),t.negateMobility=!0}ccC(){this.faction="N",this.rarity="C",this.name="Corpse Crawler",this.iAttack=this.boof81220,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.hints=[this.lValH(["ZZ-1","ZZ-2","ZZ-5"])],this.playTarg.player="F",this.ftext="Destroy a friendly creature."}ccF(t,e){W.destroy(t,this.code)}drsC(){this.faction="U",this.rarity="C",this.name="Darkroot Shambler",this.iHealth=this.lValN([2,6,7]),this.iAttack=this.iHealth*2,this.tribe.push("DF","PL"),this.level===2&&(this.hints=["LB"]),this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature ${p.jr9(0,t)} for each other friendly Darkforged.`}drsF(t,e){this.logAct(!1,t),t.buff(0,this.dfbuff(e.id))}dseC(){this.faction="A",this.rarity="C",this.name="Darksteel Enforcer",this.iAttack=this.boof468,this.iHealth=this.iAttack+2,this.tribe.push("DF","RB"),this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature ${p.jr9(t,0)} for each other friendly Darkforged.`}dseF(t,e){this.logAct(!1,t),t.buff(this.dfbuff(e.id),0)}dsaC(){this.faction="T",this.rarity="C",this.name="Darkstone Asir",this.iAttack=this.lValN([2,4,10]),this.iHealth=this.iAttack*2,this.tribe.push("DF","AS"),this.playTarg.player="E";const t=this.boof234;this.ftext=`Deal ${t} damage to an enemy creature for each other friendly Darkforged.`}dsaF(t,e){t.hurtDirect(this.dfbuff(e.id),this.code)}drslC(){this.faction="U",this.rarity="H",this.name="Dragon Slayer",this.iAttack=this.boof81220,this.iHealth=this.boof4610,this.tribe.push("HM"),this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level),this.playTarg.tribe="DG",this.ftext=`Destroy an enemy ${p.levelGateText(this.level,!0)}Dragon.`}drslF(t,e){W.destroy(t,this.code)}friC(){this.faction="T",this.rarity="C",this.name="Flamerift Instigator",this.iAttack=this.lValN([7,12,17]),this.iHealth=this.iAttack-5,this.tribe.push("GT"),this.ftext="Negate Defender from a creature."}friF(t,e){this.logAct(!1,t),t.negateDefender=!0}freavC(){if(this.faction="N",this.rarity="H",this.name="Fleshreaver",this.iAttack=this.boof6915,this.iHealth=this.boof235,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.consistent=!0,this.playTarg.level=D.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy a ${p.levelGateText(t)} enemy creature.`,this.optional=!0}else this.hints=["LG"]}freavF(t,e){W.destroy(t,this.code)}get fiendBof(){return this.lValN([-1,-2,-5])}gfiendC(){this.faction="N",this.rarity="C",this.name="Gloomfiend",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=this.fiendBof;this.ftext=`You may give an enemy creature ${p.jr9(t,t)}.`,this.optional=!0}gfiendF(t,e){this.logAct(!1,t);const i=this.fiendBof;t.buff(i,i)}grwC(){this.faction="N",this.rarity="C",this.name="Gloomreaper Witch",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof147;this.playTarg.maxAttack=t,this.playTarg.player="E",this.ftext=`You may destroy an enemy creature with ${t} or less attack.`,this.optional=!0}grwF(t,e){W.destroy(t,this.code)}grhC(){this.faction="U",this.rarity="C",this.name="Grove Huntress",this.iAttack=this.boof4711,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.playTarg.player="F";const t=this.boof135;this.ftext=`Give a friendly creature ${p.jr9(t,t)}.`}grhF(t,e){this.logAct(!1,t);const i=this.boof135;t.buff(i,i)}houndC(){this.faction="T",this.rarity="C",this.name="Magma Hound",this.iAttack=this.boof4813,this.iHealth=this.iAttack-1,this.tribe.push("ER","EL");const t=this.boof246;this.optional=!0,this.playTarg.player="E",this.ftext=`You may deal ${t} damage to an enemy creature.`}houndF(t,e){t.hurtDirect(this.boof246,this.code)}mtxC(){this.faction="A",this.rarity="C",this.name="Matrix Warden",this.iAttack=this.lValN([3,8,12]),this.iHealth=this.iAttack,this.tribe.push("RB");const t=this.boof3510;this.playTarg.player="F",this.ftext=`Give a friendly creature ${p.jr9(t,0)}.`}mtxF(t,e){this.logAct(!1,t),t.buff(this.boof3510,0)}ngbC(){this.faction="T",this.rarity="C",this.name="Nargath Bruiser",this.iAttack=this.boof5814,this.iHealth=this.iAttack-1,this.tribe.push("ER","AS");const t=this.boof248;this.playTarg.player="F",this.ftext=`Give a friendly creature ${p.jr9(0,t)}.`}ngbF(t,e){this.logAct(!1,t),t.buff(0,this.boof248)}poaC(){this.faction="A",this.rarity="H",this.name="Patron of Anvillon",this.iAttack=this.boof369,this.iHealth=this.boof71117,this.tribe.push("CY"),this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["BF"],this.ftext=`If you have three or more Alloyin cards in your hand, give a ${p.levelGateText(this.level,!0)}creature 2x attack.`}poaF(t,e){this.logAct(!1,t),t.buff(t.attack,0)}phxsC(){this.faction="A",this.rarity="R",this.name="Phalanx Squadron",this.iAttack=this.boof3714,this.iHealth=this.boof61117,this.tribe.push("HM"),this.playTarg.hasArmor=!0,this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature with Armor ${p.jr9(t,t)}.`}phxsF(t,e){this.logAct(!1,t);const i=this.boof234;t.buff(i,i)}rotC(){this.faction="N",this.rarity="C",this.name="Rot Wanderer",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.playTarg.maxAttack=this.iAttack,this.playTarg.player="E",this.ftext=`Destroy an enemy creature with ${this.iAttack} or less attack.`}rotF(t,e){W.destroy(t,this.code)}schyC(){this.faction="N",this.rarity="C",this.name="Scourge Hydra",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("HY"),this.playTarg.player="F",this.ftext="Deal 3 damage to a friendly creature."}schyF(t,e){t.hurtDirect(3,this.code)}stdC(){this.faction="A",this.rarity="H",this.name="Shardthief Druid",this.iAttack=this.boof5813,this.iHealth=this.boof81318,this.tribe.push("MM"),this.playTarg.canRegen,this.playTarg.player="E",this.ftext=`Negate and remove all Regenerate from an enemy creature. ${this.name} gets that much Renerate.`}stdF(t,e){this.logAct(!1,t);const i=t.regen;t.negateRegen=!0,e.addRegen(i)}surzC(){this.faction="N",this.rarity="L",this.name="Suruzal, Emissary of Varna",this.iAttack=this.boof4814,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.playTarg.player="F",this.playTarg.level=D.ddf2(this.level),this.notme=!0,this.ftext=`You may destroy another friendly ${p.levelGateText(this.level,!0)}creature. If you do, spawn a copy of it.`}surzF(t,e){const i=R.tick();W.destroy(t,this.code,i),g.birth(t.code,"S",e.owner,void 0,i)}vnfC(){this.faction="U",this.rarity="R",this.name="Venomfang",this.iAttack=this.boof61014,this.iHealth=this.iAttack-2,this.tribe.push("SN");const t=this.boof246;this.playTarg.player="E",this.ftext=`Give an enemy creature Poison ${t}.`}vnfF(t,e){this.logAct(!1,t),t.addPoison(this.boof246)}wbyC(){this.faction="T",this.rarity="R",this.name="Wallbreaker Yeti",this.iAttack=this.boof4712,this.iHealth=this.boof71116,this.tribe.push("ER","YT"),this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${p.levelGateText(this.level,!0)}enemy creature with Defender.`,this.optional=!0}wbyF(t,e){W.destroy(t,this.code)}wbuC(){this.faction="T",this.rarity="C",this.name="Warbringer Uranti",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("LT","YT");const t=this.boof4812;this.notme=!0,this.playTarg.player="F",this.addSp("A",t),this.ftext=`Give another friendly creature ${p.jr9(t,0)} this turn.`}wbuF(t,e){this.logAct(!1,t);const i=y.mod("AT",this.boof4812);i.expiry="ET",t.addMod(i)}dogsC(){this.faction="N",this.rarity="R",this.name="Xithian Direhound",this.iAttack=4,this.iHealth=4,this.tribe.push("AB"),this.overload=!0,this.maxLevel=1,this.optional=!0,this.playTarg.player="E",this.ftext=`You may give an enemy creature ${p.jr9(-4,-4)}.`}dogsF(t,e){this.logAct(!1,t),t.buff(-4,-4)}}class G extends kt{lookup(t){return{["AGW"]:{c:()=>this.awingC(),z:i=>this.awingZ(i)},["ASG"]:{c:()=>this.asurgeC(),z:i=>this.asurgeZ(i)},["ATZ"]:{c:()=>this.anatC(),z:i=>this.anatZ(i)},["AQE"]:{c:()=>this.aqatC(),z:i=>this.aqatZ(i)},["ABL"]:{c:()=>this.ablC(),z:i=>this.ablZ(i)},["BFT"]:{c:()=>this.bftC(),z:i=>this.bftZ(i)},["BBR"]:{c:()=>this.bbrC(),z:i=>this.bbrZ(i)},["BBD"]:{c:()=>this.bbdC(),z:i=>this.bbdZ(i)},["BBL"]:{c:()=>this.bblC(),z:i=>this.bblZ(i)},["BBN"]:{c:()=>this.bbnC(),z:i=>this.bbnZ(i)},["BTM"]:{c:()=>this.botC(),z:i=>this.botZ(i)},["CSU"]:{c:()=>this.csurgeC(),z:i=>this.csurgeZ(i)},["CNT"]:{c:()=>this.ctmsC(),z:i=>this.ctmsZ(i)},["CTW"]:{c:()=>this.cullC(),z:i=>this.cullZ(i)},["CTV"]:{c:()=>this.cultC(),z:i=>this.cultZ(i)},["CAG"]:{c:()=>this.cypaC(),z:i=>this.cypaZ(i)},["CBS"]:{c:()=>this.cypbC(),z:i=>this.cypbZ(i)},["DDF"]:{c:()=>this.dendC(),z:i=>this.dendZ(i)},["DBT"]:{c:()=>this.dreadC(),z:i=>this.dreadZ(i)},["DYB"]:{c:()=>this.drybC(),z:i=>this.drybZ(i)},["DYF"]:{c:()=>this.dyinC(),z:i=>this.dyinZ(i)},["ETN"]:{c:()=>this.elnC(),z:i=>this.elnZ(i)},["ENP"]:{c:()=>this.enpC(),z:i=>this.enpZ(i)},["ENR"]:{c:()=>this.rageC(),z:i=>this.rageZ(i)},["EFA"]:{c:()=>this.efauC(),z:i=>this.efauZ(i)},["EXD"]:{c:()=>this.expdmC(),z:i=>this.expdmZ(i)},["FIN"]:{c:()=>this.feralC(),z:i=>this.feralZ(i)},["FVA"]:{c:()=>this.fervassC(),z:i=>this.fervassZ(i)},["FJT"]:{c:()=>this.fjetC(),z:i=>this.fjetZ(i)},["FLN"]:{c:()=>this.flncC(),z:i=>this.flncZ(i)},["FFL"]:{c:()=>this.ffldC(),z:i=>this.ffldZ(i)},["FZS"]:{c:()=>this.frozC(),z:i=>this.frozZ(i)},["GTH"]:{c:()=>this.ghastC(),z:i=>this.ghastZ(i)},["GCR"]:{c:()=>this.crushC(),z:i=>this.crushZ(i)},["HAR"]:{c:()=>this.hartC(),z:i=>this.hartZ(i)},["IFR"]:{c:()=>this.izftC(),z:i=>this.izftZ(i)},["JPK"]:{c:()=>this.jpC(),z:i=>this.jpZ(i)},["LBR"]:{c:()=>this.lbrandC(),z:i=>this.lbrandZ(i)},["LYS"]:{c:()=>this.shartC(),z:i=>this.shartZ(i)},["MPH"]:{c:()=>this.morphC(),z:i=>this.morphZ(i)},["MSC"]:{c:()=>this.sculptC(),z:i=>this.sculptZ(i)},["NNS"]:{c:()=>this.nanoC(),z:i=>this.nanoZ(i)},["NSL"]:{c:()=>this.natselC(),z:i=>this.natselZ(i)},["NCF"]:{c:()=>this.nflayC(),z:i=>this.nflayZ(i)},["NCV"]:{c:()=>this.nviveC(),z:i=>this.nviveZ(i)},["NDY"]:{c:()=>this.ntdcC(),z:i=>this.ntdcZ(i)},["OEX"]:{c:()=>this.oexpC(),z:i=>this.oexpZ(i)},["OSS"]:{c:()=>this.orssC(),z:i=>this.orssZ(i)},["PTR"]:{c:()=>this.pwtorC(),z:i=>this.pwtorZ(i)},["PSG"]:{c:()=>this.psurgeC(),z:i=>this.psurgeZ(i)},["PMS"]:{c:()=>this.pslamC(),z:i=>this.pslamZ(i)},["PMP"]:{c:()=>this.pummC(),z:i=>this.pummZ(i)},["ROG"]:{c:()=>this.rotgC(),z:i=>this.rotgZ(i)},["SAP"]:{c:()=>this.sapC(),z:i=>this.sapZ(i)},["SVO"]:{c:()=>this.soathC(),z:i=>this.soathZ(i)},["SOC"]:{c:()=>this.scythC(),z:i=>this.scythZ(i)},["SOA"]:{c:()=>this.soaC(),z:i=>this.soaZ(i)},["SOD"]:{c:()=>this.sodC(),z:i=>this.sodZ(i)},["SOT"]:{c:()=>this.sotC(),z:i=>this.sotZ(i)},["SHG"]:{c:()=>this.shgrC(),z:i=>this.shgrZ(i)},["SPG"]:{c:()=>this.spgrC(),z:i=>this.spgrZ(i)},["SNB"]:{c:()=>this.snbC(),z:i=>this.snbZ(i)},["SHV"]:{c:()=>this.sharvC(),z:i=>this.sharvZ(i)},["SRP"]:{c:()=>this.sreapC(),z:i=>this.sreapZ(i)},["STR"]:{c:()=>this.sttorC(),z:i=>this.sttorZ(i)},["STO"]:{c:()=>this.sptorC(),z:i=>this.sptorZ(i)},["SOV"]:{c:()=>this.sovC(),z:i=>this.sovZ(i)},["STN"]:{c:()=>this.stbrnC(),z:i=>this.stbrnZ(i)},["STP"]:{c:()=>this.ssperC(),z:i=>this.ssperZ(i)},["SIN"]:{c:()=>this.sinC(),z:i=>this.sinZ(i)},["TGL"]:{c:()=>this.tanglC(),z:i=>this.tanglZ(i)},["TPT"]:{c:()=>this.tpactC(),z:i=>this.tpactZ(i)},["TUP"]:{c:()=>this.tugC(),z:i=>this.tugZ(i)},["TOT"]:{c:()=>this.totsC(),z:i=>this.totsZ(i)},["TOB"]:{c:()=>this.blightC(),z:i=>this.blightZ(i)},["TXB"]:{c:()=>this.txbnC(),z:i=>this.txbnZ(i)},["TXS"]:{c:()=>this.sporeC(),z:i=>this.sporeZ(i)},["TCG"]:{c:()=>this.tremcC(),z:i=>this.tremcZ(i)},["URS"]:{c:()=>this.urstC(),z:i=>this.urstZ(i)},["VSK"]:{c:()=>this.vensC(),z:i=>this.vensZ(i)},["VGR"]:{c:()=>this.vgraC(),z:i=>this.vgraZ(i)},["VSP"]:{c:()=>this.vrdsC(),z:i=>this.vrdsZ(i)},["VGL"]:{c:()=>this.vglchC(),z:i=>this.vglchZ(i)},["VOB"]:{c:()=>this.vobC(),z:i=>this.vobZ(i)},["VYE"]:{c:()=>this.vembC(),z:i=>this.vembZ(i)},["UBL"]:{c:()=>this.uboltC(),z:i=>this.uboltZ(i)},["WMM"]:{c:()=>this.warC(),z:i=>this.warZ(i)},["XRW"]:{c:()=>this.xwillC(),z:i=>this.xwillZ(i)}}[t]}cardCast(t,e){this.lookup(t).z(e)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.cardCode()==="NSL"&&g.creatByTarget(y.crFriendTarg()).length<5||t.push(this.playTarg),t}handleAction(t){const e=g.ddf6(t);this.logSpell(this.xl?e:void 0),this.cardCast(this.cardCode(),e),T.spellCast()}ddf8(t){const e=Nt.extractCardCode(t.trigger.logicCode);if(e==="TOB"&&t.trigger.type==="DM"){const i=$.toDamage(t.event);if(i.battle&&i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId)return this.level===3?!0:L.getCard(i.hurtCreat.code).level<=this.level}else if((e==="ABL"||e==="OEX"||e==="VOB")&&t.trigger.type==="DM"){const i=t.event;return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId}else if((e==="FZS"||e==="IFR")&&t.trigger.type==="DM"){const i=t.event;if(i.isCreatTarg&&i.target===t.creatId)return!0}else if(e==="DYB"&&t.trigger.type==="EF"){const i=$.toEnterField(t.event);return t.trigger.creatId!==i.creature.id&&i.creature.owner===t.owner}else{if(e==="SPG"&&t.trigger.type==="TS")return t.event.playerA===t.owner;if(e==="FVA"&&t.trigger.type==="FK"||(e==="ROG"||e==="NDY")&&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=Nt.extractCardCode(t.trigger.logicCode);if(e==="TOB"){const i=t.event,s=g.jr5(i.target);s.status==="A"&&W.destroy(s,this.code)}else if(e==="FVA"){const i=g.jr5(t.creatId),s=g.searchByLane(g.oppositeLane(i.lane),!i.owner);s&&s.hurtDirect(this.boof3612,i.code)}else if(e==="FZS"||e==="IFR"&&t.trigger.type==="DM"){const i=g.jr5(t.creatId);i.status==="A"&&W.destroy(i,this.code)}else if(e==="ROG"||e==="DYB"||e==="ABL"){const i=g.jr5(t.creatId);this.logAct(!1,i),i.buff(this.level,this.level)}else if(e==="SHG"){if(t.trigger.type==="VN"){const i=t.event,s=g.jr5(i.creatId);g.birth(s.code,"S",t.owner)}else if(t.trigger.type==="PT"){const i=t.trigger.customCode,s=g.jr5(t.creatId);s.triggers.filter(f=>f.customCode===i).forEach(f=>s.removeTrigger(f))}}else if(e==="IFR"&&t.trigger.type==="PT"){const i=S.deTil(t.trigger.customCode),s=i[1],h=g.jr5(t.creatId);if(i[0]==="P2"){const f=y.trigIdx(h.triggers,t.trigger);h.triggers[f].customCode=S.enTil("P1",s)}else{const f=h.triggers.find(m=>m.customCode===s);f&&h.removeTrigger(f),h.removeTrigger(t.trigger)}}else if(e==="OEX"){if(t.trigger.type==="DM"){const i=t.event,s=g.qEnemyCreats(),h=s.length,f=R.tick();let m;h>0&&(this.level===1?m=[s[S.randInt(0,h)]]:this.level===2?(m=s.splice(S.randInt(0,h),1),s.length>0&&m.push(s[S.randInt(0,h-1)])):m=s,m.forEach(A=>A.hurtDirect(i.dmg,this.code,f)))}else if(t.trigger.type==="PT"){const i=t.trigger.customCode,s=g.jr5(t.creatId);s.triggers.filter(f=>f.customCode===i).forEach(f=>s.removeTrigger(f))}}else if(e==="VOB"){const i=$.toDamage(t.event);i.srcCreat.hurtDirect(i.dmg,this.code)}else if(e==="NDY"){const i=g.jr5(t.creatId);if(i.status==="A"){const s=this.ndcbuf;this.logAct(!1,i),i.buff(s,s)}}else if(e==="SPG"){const i=g.jr5(t.creatId),s=this.boof246;this.logAct(!1,i),i.buff(s,s)}else super.jr8(t);x.triggerDone()}rankT(){return`If you are rank ${this.level+1} or higher`}awingC(){this.faction="A",this.rarity="R",this.name="Aegis Wings",this.text=`Give a creature ${p.jr9(this.boof369,0)}. Then if that creature has the highest attack, it also gets Mobility 1 and Armor ${this.boof246}.`,this.playTarg.hint=["BF"]}awingZ(t){t.buff(this.boof369,0);const e=t.attack;g.qActiveCreats().every(i=>i.attack<=e)&&(t.addMobility(1),t.addArmor(this.boof246))}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.canMove=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Mobility ${this.level}.`}asurgeZ(t){t.addMobility(this.level)}anatC(){this.faction="A",this.rarity="C",this.name="Anatomize",this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(-this.boof4816,0)}.~You may play an additional ${this.name} this turn.`}anatZ(t){t.buff(-this.boof4816,0);const e=E.freeCard(this.code);e.condition.cardCode="ATZ"}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${p.jr9(0,this.boof51015)}.`,this.playTarg.hint=["BF"]}aqatZ(t){t.buff(0,this.boof51015)}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${p.dbdtap()}, it gets ${p.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}ablZ(t){t.changed=!0;const e=t.jr4("DM",this.code);e.bonus=this.buffNug(this.level,this.level)}bftC(){this.faction="N",this.rarity="C",this.name="Bitterfrost Totem";const t=this.boof4812n;this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(t,t)}. ${this.rankT()}, it gets an additional ${p.jr9(-2,-2)}.`}bftZ(t){const e=this.boof4812n-(k.getActive().rank>this.level?2:0);t.buff(e,e)}blod(){return E.deathsA.length>0||E.deathsB.length>0}bbrC(){this.faction="A",this.rarity="C",this.name="Blood Barrier";const t=this.boof234;this.text=`Give a creature Armor ${t}.~If a creature was destroyed this turn, it gets an additional Armor ${t}.`,this.playTarg.hint=["BF"],this.playTarg.canArmor=!0}bbrZ(t){const e=this.boof234;t.addArmor(e),this.blod()&&t.addArmor(e)}bbdC(){this.faction="N",this.rarity="C",this.name="Blood Bindings";const t=this.boof369n,e=p.jr9(t,t);this.text=`Give a creature ${e}.~If a creature was destroyed this turn, it gets an additional ${e}.`,this.playTarg.hint=["DB"]}bbdZ(t){const e=this.boof369n;t.buff(e,e),this.blod()&&t.buff(e,e)}bblC(){this.faction="T",this.rarity="C",this.name="Blood Boil";const t=this.lValN([5,6,10]);this.text=`Deal ${t} damage to a creature.~If a creature was destroyed this turn, deal an additional ${t} damage to that creature.`,this.playTarg.hint=["HR"]}bblZ(t){const e=this.lValN([5,6,10]),i=R.tick();t.hurtDirect(e,this.code,i),this.blod()&&t.hurtDirect(e,this.code,i)}bbnC(){this.faction="U",this.rarity="C",this.name="Blood Boon";const t=this.lValN([3,4,7]),e=p.jr9(t,t);this.text=`Give a creature ${e}.~If a creature was destroyed this turn, it gets an additional ${e}.`,this.playTarg.hint=["BF"]}bbnZ(t){const e=this.lValN([3,4,7]);t.buff(e,e),this.blod()&&t.buff(e,e)}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.xl=!1,this.text=`Replace an enemy ${p.levelGateText(this.level,!0)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level)}botZ(t){g.birth(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof123n;this.text=`Give a creature ${p.jr9(t,t)}.`,this.playTarg.hint=["DB"]}csurgeZ(t){const e=this.boof123n;t.buff(e,e)}ctmsC(){this.faction="A",this.rarity="R",this.name="Countermeasure";const t=this.boof4816;this.text=`Give an enemy creature ${p.jr9(-t,0)}, or give a friendly creature ${p.jr9(t,0)}.`}ctmsZ(t){const e=this.boof4816;t.owner===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){W.destroy(t,this.code)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate",this.xl=!1;const t=L.getCard(Z.tffc(this.level));this.text=`Replace a friendly Plant with a ${p.tokName(t)}.`,this.playTarg.player="F",this.playTarg.tribe="PL"}cultZ(t){g.birth(Z.tffc(this.level),"R",t.owner,t.lane)}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof246;this.text=`Give a creature in a center lane ${p.jr9(t,t)}.`,this.playTarg.lanes=3,this.playTarg.hint=["BF"]}cypaZ(t){const e=this.boof246;t.buff(e,e)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${p.jr9(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.hint=["BF"],this.playTarg.faction="A"}cypbZ(t){t.buff(this.boof51015,0),t.addArmor(this.boof124)}dendC(){this.faction="U",this.rarity="R",this.name="Dendrify",this.xl=!1,this.level===3&&(this.isFree=!0,this.overload=!0),this.text=`Replace a ${p.levelGateText(this.level+1,!0)}creature with a 7/7 Treefolk.`,this.playTarg.level=D.ddf2(this.level+1)}dendZ(t){g.birth(`${"SXT"}${this.level}`,"R",t.owner,t.lane)}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.xl=!1,this.hints=["LG"],this.text=`Destroy a ${p.levelGateText(this.level,!0)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"]}dreadZ(t){W.destroy(t,this.code)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${p.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${p.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}drybZ(t){t.buff(this.level,this.level),t.changed=!0;const e=t.jr4("EF",this.code);e.bonus=this.buffNug(this.level,this.level)}dyinC(){this.faction="U",this.rarity="T",this.name="Dysian Infusion",this.playTarg.hint=["BF"];const t=this.boof135,e=this.boof4710;this.text=`Give a creature ${p.jr9(e,e)} and Regenerate ${t}.`}dyinZ(t){const e=this.boof4710;t.buff(e,e),t.addRegen(this.boof135)}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.isFree=this.level===3,this.text=`Give a ${p.levelGateText(this.level,!0)}creature Defender.`,this.playTarg.canDefender=!0,this.playTarg.level=D.ddf2(this.level)}enpZ(t){t.defender=!0}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${p.jr9(-this.boof51015,0)}.`,this.playTarg.hint=["DB"]}elnZ(t){t.buff(-this.boof51015,0)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${p.jr9(t,t)}.`,this.playTarg.hint=["BF"]}rageZ(t){const e=this.boof3612;t.buff(e,e)}efauC(){this.faction="T",this.rarity="R",this.name="Everflame Aura",this.text=`Deal ${this.level+6} damage to an enemy creature, or give a friendly creature Mobility ${this.level}.`}efauZ(t){t.owner===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 ${p.levelGateText(this.level+1,!0)}creature.~Deal damage equal to its attack to the enemy player.${this.level===3?"~You gain that much health.":""}`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F"}expdmZ(t){const e=t.attack;W.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 ${p.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"]}feralZ(t){const e=this.fiboof;t.breakthrough=!0,t.buff(e,e)}fervassC(){this.faction="T",this.rarity="H",this.name="Fervent Assault",this.playTarg.player="F",this.text=`Give a friendly creature Mobility ${this.level} and "Flank: Deal ${this.boof3612} damage to the opposing creature.`}fervassZ(t){t.changed=!0,t.addMobility(this.level);const e=t.jr4("FK",this.code);e.bonus=this.buffNug(this.boof3612,0)}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=y.mod("AR",this.boof51020);e.expiry="ET",t.addMod(e)}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"],this.text=`Give a ${p.levelGateText(this.level,!0)}creature "When this is dealt damage, destroy it".`}frozZ(t){t.changed=!0;const e=t.jr4("DM",this.code);e.bonus=this.avgSpawnNug()}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${p.jr9(t,t)}.`,this.playTarg.hint=["DB"]}ghastZ(t){const e=-this.boof3612;t.buff(e,e)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.xl=!1,this.isFree=this.level>1,this.isFree||(this.hints=["LG"]),this.playTarg.player="E",this.playTarg.hasDefender=!0,this.text=`Destroy an enemy creature with Defender.${this.level===3?" Deal damage equal to its health to the enemy player.":""}`}crushZ(t){const e=t.health;W.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 ${p.jr9(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}izftC(){this.faction="T",this.rarity="T",this.name="Iztek's Frost",this.isFree=this.level===3,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hint=["KL"],this.text=`Until the end of the next turn, give a ${p.levelGateText(this.level+1,!0)}creature "When this is dealt damage, destroy it".`}izftZ(t){const e=R.genId(),i=t.jr4("DM",this.code);i.changes=!0,i.customCode=e,i.bonus=this.avgSpawnNug();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 ${p.jr9(this.boof369,0)} and Mobility 1.`}jpZ(t){t.buff(this.boof369,0),t.addMobility(1)}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hint=["BF"],this.text=`Give a ${p.levelGateText(this.level+1)}creature ${p.jr9(this.boof124,0)} and Aggressive this turn.`}lbrandZ(t){const e=y.mod("AT",this.boof124),i=y.mod("AG",!0);e.expiry="ET",i.expiry="ET",t.addMod(e),t.addMod(i)}shartC(){this.faction="U",this.rarity="R",this.name="Lysian Shard",this.overload=!0,this.maxLevel=1,this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(6,6)}.`}shartZ(t){t.buff(6,6)}morphC(){this.faction="U",this.rarity="H",this.name="Metamorphosis",this.xl=!1,this.text=`Replace a ${p.levelGateText(this.level,!0)}creature with a 0/3 Feywing Chrysalis.`,this.playTarg.level=D.ddf2(this.level)}morphZ(t){g.birth(`${"FWC"}1`,"R",t.owner,t.lane)}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.level===3?this.isFree=!0:this.hints=["LG"],this.playTarg.level=D.ddf2(this.level+1),this.text=`Remove all abilities from a ${p.levelGateText(this.level+1,!0)}creature.`,this.playTarg.hint=["DB"]}sculptZ(t){t.wipeAll()}nanoC(){this.faction="A",this.rarity="R",this.name="Nanoswarm",this.playTarg.level=D.ddf2(this.level),this.text=`Give a ${p.levelGateText(this.level,!0)}creature ${p.jr9(-this.boof51015,0)} and remove all abilities from it.`,this.playTarg.hint=["DB"]}nanoZ(t){t.buff(-this.boof51015,0),t.wipeAll()}natselC(){this.faction="U",this.rarity="R",this.name="Natural Selection",this.xl=!1,this.text=`If there is a friendly creature in each lane, destroy a ${p.levelGateText(this.level,!0)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"]}natselZ(t){W.destroy(t,this.code)}nflayC(){this.faction="N",this.rarity="C",this.name="Necroflay";const t=-this.boof3711;this.text=`Give a creature ${p.jr9(t,t)}.~You may play an additional ${this.name} this turn.`,this.playTarg.hint=["DB"]}nflayZ(t){const e=-this.boof3711;t.buff(e,e);const i=E.freeCard(this.code);i.condition.cardCode="NCF"}nviveC(){this.faction="N",this.rarity="C",this.name="Necrovive",this.playTarg.canRegen=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Regenerate ${this.boof3612}.`}nviveZ(t){t.addRegen(this.boof3612)}ntdcC(){this.faction="N",this.rarity="R",this.name="Nether Decay";const t=this.ndcbuf;this.text=`Give a creature "When a creature is destroyed, this gets ${p.jr9(t,t)}."`,this.playTarg.hint=["DB"]}ntdcZ(t){t.changed=!0;const e=t.jr4("DS",this.code),i=this.ndcbuf;e.bonus=this.buffNug(i,i)}get ndcbuf(){return-4-this.level}oexpC(){this.faction="A",this.rarity="H",this.name="Oratek Explosives",this.playTarg.player="F";const t=this.lValS(["an enemy creature at random","up to two enemy creatures at random","each enemy creature"]);this.text=`Give a friendly creature ${p.jr9(5,0)}.~Allied Tempys: This turn, when that creature ${p.dbdtap()}, deal that much damage to ${t}.`}oexpZ(t){if(t.buff(5,0),E.allied("T")){const e=R.genId(),i=t.jr4("DM",this.code);i.changes=!0,i.customCode=e;const s=t.jr4("PT",this.code);s.customCode=e}}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=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.level,this.level)}.`}psurgeZ(t){t.buff(this.level,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.boof71116,0)} this turn.`}pslamZ(t){const e=y.mod("AT",this.boof71116);e.expiry="ET",t.addMod(e)}pummC(){this.faction="A",this.rarity="R",this.name="Pummel Pack";const t=this.boof236,e=`${p.jr9(t,0)} and Armor ${t}.`;this.text=`Give a friendly creature ${e}~If it is the only friendly creature, it gets an additional ${e}`,this.playTarg.player="F"}pummZ(t){const e=this.boof236;t.buff(e,0),t.addArmor(e),g.ddf1().length===1&&(t.buff(e,0),t.addArmor(e))}rotgC(){this.faction="N",this.rarity="H",this.name="Rite of the Grimgaunt",this.playTarg.hint=["BF"],this.text=`Give a creature "When a creature is destroyed, this gets ${p.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0;const e=t.jr4("DS",this.code);e.bonus=this.buffNug(this.level,this.level)}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=D.ddf2(this.level),this.text=`Reduce a ${p.levelGateText(this.level,!0)}creature's attack to 0.`,this.playTarg.hint=["DB"]}sapZ(t){t.buff(-t.attack,0)}soathC(){this.faction="U",this.rarity="C",this.name="Savage Oath",this.level===1&&(this.hints=["LG"]);const t=this.saboof;this.text=`Give an Uterra creature ${p.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"],this.playTarg.faction="U"}soathZ(t){const e=this.saboof;t.buff(e,e),t.breakthrough=!0}get saboof(){return this.lValN([2,6,15])}scythC(){this.faction="N",this.rarity="L",this.name="Scythe of Chiron";const t=this.boof246;this.playTarg.player="F",this.text=`Each enemy creature gets ${p.jr9(-t,0)}. Give a friendly creature ${p.jr9(t,0)} for each enemy creature.`}scythZ(t){const e=-this.boof246,i=g.qEnemyCreats();i.forEach(s=>{s.buff(e,0)}),i.length>0&&t.buff(-e*i.length,0)}soaC(){this.faction="A",this.rarity="C",this.name="Seal of Anvillon",this.level===1?this.hints=["LG"]:this.consistent=!0,this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.ubzap,0)}.`}soaZ(t){t.buff(this.ubzap,0)}sodC(){this.faction="U",this.rarity="C",this.name="Seal of Deepwood",this.level===1?this.hints=["LG"]:this.consistent=!0;const t=this.derpboof;this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(t,t)}.`}sodZ(t){const e=this.derpboof;t.buff(e,e)}get derpboof(){return this.lValN([1,6,12])}sotC(){this.faction="N",this.rarity="C",this.name="Seal of Tarsus",this.level===1?this.hints=["LG"]:this.consistent=!0;const t=this.tars;this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(t,t)}.`}sotZ(t){const e=this.tars;t.buff(e,e)}get tars(){return this.lValN([-2,-8,-16])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.isFree=this.level===3,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F",this.text=`Give a ${p.levelGateText(this.level+1,!0)}friendly creature "Vengeance: Spawn this" this turn.`}shgrZ(t){const e=R.genId(),i=t.jr4("VN",this.code);i.customCode=e,i.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e}spgrC(){this.faction="U",this.rarity="R",this.name="Shardplate Graft";const t=this.boof246;this.text=`Give a creature ${p.jr9(t,t,!0)}, and "At the start of your turn, this gets ${p.jr9(t,t)}."`,this.playTarg.hint=["BF"]}spgrZ(t){const e=this.boof246;t.buff(e,e),t.changed=!0;const i=t.jr4("TS",this.code);i.bonus=this.buffNug(e,e)}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){const e=this.level*g.ddf1().length;t.buff(e,e)}get snbboof(){return-1*(this.level+7)}snbC(){this.faction="A",this.rarity="C",this.name="Sonic Burst",this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(this.snbboof,0)}.`}snbZ(t){t.buff(this.snbboof,0)}sharvC(){this.faction="N",this.rarity="H",this.name="Soul Harvest",this.xl=!1;const t=this.lValS(["an additional level 1 card","an additional card","two additional cards"]);this.text=`Destroy a friendly creature. You may play ${t} this turn.`,this.playTarg.player="F"}sharvZ(t){if(W.destroy(t,this.code),this.level===1){const e=E.freeCard(this.code);e.condition.level=D.ddf2(1)}else E.regularPlays+=this.level-1}sreapC(){this.faction="N",this.rarity="L",this.name="Soulreap",this.xl=!1;const t=this.boof248;this.text=`Destroy an enemy creature with ${t} or less attack. Then Spawn a copy of it.`,this.playTarg.player="E",this.playTarg.maxAttack=t}sreapZ(t){W.destroy(t,this.code),g.birth(t.code,"S",!t.owner)}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.text=`Give a creature Regenerate ${this.boof234}.`,this.playTarg.hint=["BF"],this.playTarg.canRegen=!0}sttorZ(t){t.addRegen(this.boof234)}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.text=`Give a creature Poison ${this.boof234}.`,this.playTarg.hint=["PN"]}sptorZ(t){t.addPoison(this.boof234)}sovC(){this.faction="T",this.rarity="L",this.name="Staff of Vaerus",this.text=`Give a friendly ${p.levelGateText(this.level+1,!0)}creature Mobility ${this.level}. That creature battles an additional time this turn.`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F"}sovZ(t){t.extraBattles+=1,t.addMobility(this.level)}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${p.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hint=["BF"],this.playTarg.hasDefender=!0}stbrnZ(t){const e=this.boof579;t.buff(e,e),t.negateDefender=!0}ssperC(){this.faction="T",this.rarity="C",this.name="Stormspear",this.xl=!1,this.playTarg.hint=["HR"],this.text=`Deal ${this.sspb} to a creature.~You may play an additional ${this.name} this turn.`}ssperZ(t){t.hurtDirect(this.sspb,this.code);const e=E.freeCard(this.code);e.condition.cardCode="STP"}get sspb(){return this.lValN([3,8,12])}tanglC(){this.faction="U",this.rarity="R",this.name="Tangle",this.xl=!1;let t="";this.level===3?t=" You gain health equal to that creature's attack.":this.playTarg.hint=["KL"],this.text=`Destroy a ${p.levelGateText(this.level+1,!0)}creature with Mobility.${t}`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hasMobility=!0}tanglZ(t){W.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 ${p.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.hint=["BF"],this.playTarg.faction="N"}tpactZ(t){const e=this.boof235;t.buff(e,e),t.addRegen(e)}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.playTarg.hint=["BF"],this.text=`Give a Robot ${p.jr9(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),t.buff(this.boof4612,0)}totsC(){this.faction="N",this.rarity="T",this.name="Tendrils Of Twilight",this.isFree=!0;const t=-this.boof7911;this.text=`Give an enemy creature ${p.jr9(-1,-1)}.~If that creature is opposing a friendly Duskmaw, give that creature ${p.jr9(t,t)} instead.`,this.playTarg.player="E"}totsZ(t){const e=this.duskBof(t);t.buff(e,e)}duskBof(t){const e=t.opposed;let i=!1;return e&&(i=Nt.extractCardCode(e.code)==="DTD"),i?-this.boof7911:-1}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${p.dbdtac(this.level)}, destroy that creature."`,this.playTarg.hint=["BF"]}blightZ(t){t.changed=!0;const e=t.jr4("DM",this.code);e.bonus=this.avgSpawnNug()}txbnC(){this.faction="U",this.rarity="R",this.name="Toxic Boon";const t=this.boof357;this.text=`Give an enemy creature Poison ${t}, or give a friendly creature ${p.jr9(t,t)}.`}txbnZ(t){const e=this.boof357;t.owner===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 ${p.jr9(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T",this.playTarg.hint=["BF"]}tremcZ(t){t.buff(0,this.boof4812),t.addMobility(this.level)}uboltC(){this.faction="T",this.rarity="R",this.name="Uranti Bolt",this.xl=!1,this.text=`Deal ${this.ubzap} damage to a creature.~It gets Defender until the end of the next turn.`}uboltZ(t){t.hurtDirect(this.ubzap,this.code);const e=y.mod("DF",!0);e.expiry="EN",t.addMod(e)}get ubzap(){return this.lValN([3,10,20])}urstC(){this.faction="U",this.rarity="C",this.name="Ursine Strength";const t=this.boof3711;this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(t,t)}. ${this.rankT()}, it gets an additional ${p.jr9(2,2)}.`}urstZ(t){const e=this.boof3711+(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=E.freeCard(this.code);e.condition.cardCode="VSK"}vgraC(){this.faction="U",this.rarity="C",this.name="Verdant Grace",this.playTarg.player="F",this.text=`Heal ${this.boof101520} damage from a friendly creature and ${this.boof246} health from each other friendly creature.`}vgraZ(t){t.heal(this.boof101520);const e=this.boof246;g.creatByTarget(y.crFriendNotMeTarg(t.id)).forEach(i=>{i.heal(e)})}vrdsC(){this.faction="U",this.rarity="C",this.name="Verdant Sphere";const t=this.boof5812;this.text=`Give a creature ${p.jr9(0,t)} and you gain ${t} health.`,this.playTarg.hint=["BF"]}vrdsZ(t){const e=this.boof5812;t.buff(0,e),k.heal(k.getActive(),e)}vglchC(){this.faction="N",this.rarity="R",this.name="Vigor Leech";const t=this.boof369n;this.text=`Give an enemy creature ${p.jr9(t,t)}, or give a friendly creature Regenerate ${-t}.`}vglchZ(t){const e=this.boof369n;t.owner===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=["LG"],this.text=`Give a ${p.levelGateText(this.level+1,!0)}creature Aggressive and, "When this creature ${p.dbdtap()}, it also deals that much damage to itself."`}vobZ(t){t.aggressive=!0,t.changed=!0,t.jr4("DM",this.code)}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace",this.playTarg.hint=["DB"];const t=this.boof468,e=-t;this.text=`Give a creature ${p.jr9(e,e)}.~You gain ${t} health.`}vembZ(t){const e=this.boof468,i=-e;t.buff(i,i),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 ${p.levelGateText(e,!0)}creature ${t}x attack.`}warZ(t){const e=this.level===3?2:1;t.buff(t.attack*e,0)}xwillC(){this.faction="N",this.rarity="H",this.name="Xrath's Will",this.xl=!1;const t=this.boof3612;this.text=`Destroy an enemy creature with ${t} or less attack.~You may play an additional Zombie this turn.`,this.playTarg.player="E",this.playTarg.maxAttack=t}xwillZ(t){W.destroy(t,this.code);const e=E.freeCard(this.code);e.condition.tribe="ZB"}}class Zi extends P{constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Cryophoenix",this.iAttack=this.boof3711,this.iHealth=this.iAttack+3,this.iMobile=this.lValN([0,0,1]),this.tribe.push("PX"),this.text=`When ${this.name} enters play or moves, deal damage equal to its attack to the opposing creature.~If there is no opposing creature, deal that damage to the enemy player instead.`}image(t){return this.rawImage(`${"PHC"}${this.level}`,t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FK");return s.bonus=this.playerNug(this.iAttack),i.jr4("EF"),i}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const i=$.toCreature(t.event).creature,s=i.opposed;s?s.hurtDirect(i.attack,this.code):k.hurtDirect(!i.owner,i.attack,this.code),x.triggerDone()}}class ue extends P{lookup(t){return{["ATP"]:{c:()=>this.phagC(),t:()=>this.phagT(),f:(i,s)=>this.hdiscardF(i,s)},["PLI"]:{c:()=>this.pimpC(),t:()=>this.pimpT(),f:(i,s)=>this.hdiscardF(i,s)},["SSH"]:{c:()=>this.sshmC(),t:()=>this.sshmT(),f:(i,s)=>this.sshmF(i,s)},["TPG"]:{c:()=>this.pillC(),t:()=>this.pillT(),f:(i,s)=>this.pillF(i,s)},["TMG"]:{c:()=>this.grootC(),t:()=>this.grootT(),f:(i,s)=>this.grootF(i,s)},["VIN"]:{c:()=>this.vintC(),t:()=>this.vintT(),f:(i,s)=>{}}}[t]}forgTargets(t){return this.lookup(t).t()}forgAction(t,e,i){this.lookup(t).f(e,i)}optional=!0;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Forge: "+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}handleAction(t){const e=g.jr5(t.param);this.forgAction(this.cardCode(),t.position,e),At.popMode(),T.actionDone(!0)}jr8(t){const e=this.cardCode()==="VIN";if(e&&R.aiActive)x.triggerDone();else{const i=this.forgTargets(this.cardCode());if(i.length>0){let s;if(e?s=[]:s=i.map(h=>{const f=y.deckSelectAction("CARD",h.cardCode,h.sourceIdx);return f.param=t.creatId,f.host=this.code,f}),this.optional){const h=T.noneEndTrigger();h.param="PM",s.push(h)}wt.showCustomDeck(i,s)}else x.triggerDone()}}hdiscardF(t,e){const i=k.toPlayer(!e.owner),s=i.hand[t];i.hand.splice(t,1),i.discard.push(s)}phagC(){this.faction="U",this.rarity="H",this.name="Aetherphage",this.iAttack=this.lValN([7,10,16]),this.iHealth=this.boof3612,this.tribe.push("IN"),this.ftext=`Look at the ${p.levelGateText(this.level,!0)}spells in the enemy player's hand and choose one. The enemy player discards the chosen spell.`}phagT(){const t=k.toPlayer(!k.getActiveB()),e=y.target("TH");return e.player=k.toTarget(t),e.level=D.ddf2(this.level),e.card="S",wt.generateContent(t.hand,!1,e)}pimpC(){this.faction="N",this.rarity="R",this.name="Plunder Imp",this.iAttack=this.boof61016,this.iHealth=this.iAttack-1,this.tribe.push("DM");const t=this.boof369;this.ftext=`Look at the creatures with ${t} or less attack in the enemy player's hand and choose one. The enemy player discards the chosen creature.`}pimpT(){const t=k.toPlayer(!k.getActiveB()),e=y.target("TH");return e.player=k.toTarget(t),e.maxAttack=this.boof369,e.card="C",wt.generateContent(t.hand,!1,e)}sshmC(){this.faction="U",this.rarity="H",this.name="Soothsayer Hermit",this.iAttack=this.boof61016,this.iHealth=this.iAttack-1,this.tribe.push("LP"),this.ftext=`You may put a ${p.levelGateText(this.level)} creature from your discard pile into your hand.`}sshmT(){const t=k.getActive(),e=y.target("TD");return e.player=k.toTarget(t),e.card="C",e.level=D.ddf2(this.level),wt.generateContent(t.discard,!1,e)}sshmF(t,e){const i=k.toPlayer(e.owner),s=i.discard.splice(t,1);i.hand.push(s[0])}pillC(){this.faction="N",this.rarity="H",this.name="Tomb Pillager",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("ZB"),this.consistent=this.level>1,this.ftext="You may banish a Nekrium card from your discard pile."}pillT(){const t=k.getActive(),e=y.target("TD");return e.player=k.toTarget(t),e.faction="N",wt.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 ${p.jr9(t,t)}.`}grootT(){const t=k.getActive(),e=y.target("TD");return e.player=k.toTarget(t),e.tribe="PL",wt.generateContent(t.discard,!1,e)}grootF(t,e){k.toPlayer(e.owner).discard.splice(t,1);const s=this.boof358;e.buff(s,s)}vintC(){this.faction="A",this.rarity="C",this.name="Vault Intruder",this.iAttack=this.lValN([7,12,18]),this.iHealth=this.boof5914,this.tribe.push("RB"),this.ftext="Look at the enemy player's hand."}vintT(){const t=k.toPlayer(!k.getActiveB()),e=y.target("TH");return e.player=k.toTarget(t),wt.generateContent(t.hand,!1,e)}}class Yi extends P{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Darkheart Conjurer",this.iAttack=this.boof4813,this.iHealth=this.boof71116,this.tribe.push("HM"),this.text=`When you play a spell, give a friendly creature Regenerate ${this.boof135}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.interactive=!0,s.bonus=this.regnNug(this.boof135),i}handleAction(t){const e=g.ddf6(t);this.logAct(!1,e),e.addRegen(this.boof135),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&L.getCard(t.event.cardCode).type==="S"}jr8(t){const e=y.crFriendActTarg("CARD",this.code,"");e.canRegen=!0;const i=D.toActions(e);i.length===0?x.triggerDone():(i.push(T.noneEndTrigger()),T.ddf5(i))}}class Ki extends ft{jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){g.qEnemyCreats().forEach(e=>{e.addPoison(6)}),x.triggerDone()}}class Xi extends P{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Demonweb Watcher",this.iAttack=this.boof4714,this.iHealth=this.lValN([7,12,18]),this.tribe.push("SP");const e=this.boof246n;this.text=`When an enemy creature with Aggressive deals battle damage, it gets ${p.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),i}ddf8(t){const e=$.toDamage(t.event);return e.battle&&e.isCreatSrc&&e.srcCreat.owner!==t.owner&&e.srcCreat.aggressive}jr8(t){const e=$.toDamage(t.event);this.logAct(!1,e.srcCreat);const i=this.boof246n;e.srcCreat.buff(i,i),x.triggerDone()}}class qi 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 ${p.dbdtap()}, heal ${e} damage from each other friendly creature.~Vengeance: Put a level ${this.level} Bron, Wild Tamer into this lane.`}image(t){return this.fixedImage(t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("VN");s.bonus=this.buffNug(this.iAttack,this.iHealth);const h=i.jr4("DM");return h.bonus=this.buffNug(0,this.boof357),i}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){if(t.trigger.type==="VN"){const e=g.jr5(t.creatId);g.birth("BWT"+this.level,"P",e.owner,e.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,i=y.crNotMeTarg(t.creatId);i.player=k.toTarget(t.owner),g.creatByTarget(i).forEach(h=>h.heal(e)),x.triggerDone()}}}class ji extends kt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Discordant Strike";const e=-this.boof4610;this.text=`Give an enemy creature ${p.jr9(e,0)}.~Allied Nekrium: Give an enemy creature ${p.jr9(0,e)}.`}playTargets(){const t=super.playTargets(),e=y.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=S.deTil(t.param),i=-this.boof4610,s=g.ddf6(t);e[0]==="P1"?(this.logSpell(s),s.buff(i,0),E.allied("N")?T.ddf5(D.toActions(y.crEnemyActTarg("CARD",this.code,"P2"))):T.spellCast()):(this.logSpell(s),s.buff(0,i),T.spellCast())}}class Ji extends kt{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.isFree=this.level===3,this.level<3&&(this.hints=["LG"]),this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}playTargets(){const t=super.playTargets(),e=this.poisTarg();return this.level===1?t.push(e):g.creatByTarget(e).length>0&&t.push(D.boardTarget("CARD",this.code)),t}handleAction(t){if(this.level===1){const e=g.ddf6(t);this.logSpell(e),e.addPoison(e.poison)}else this.logSpell(),g.creatByTarget(this.poisTarg()).forEach(i=>{i.addPoison(i.poison)});T.spellCast()}poisTarg(){const t=y.crEnemyActTarg("CARD",this.code,"");return t.hasPoison=!0,t}}class Qi 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="";const i=this.lValN([0,5,10]);this.level>1&&(e=`, then give it ${p.jr9(i,0)}`),this.text=`Activate: Look at the creatures in the enemy player's hand and choose one. Replace ${this.name} with the chosen creature${e}.`;const s=this.avgCreatureStats();this.bonus={activ8:this.buffNug(i+s[0]-this.iAttack,s[1])}}canActivate(t){return k.toPlayer(!t.owner).hand.some(i=>L.getCard(i).type==="C")}startActivation(t){let e;if(ht.simOn)e=[{cardCode:"VND"+this.level,sourceIdx:0,cardCount:0}];else{const s=k.toPlayer(!k.getActiveB()),h=y.target("TH");h.player=k.toTarget(s),h.card="C",e=wt.generateContent(s.hand,!1,h)}const i=e.map(s=>{const h=y.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return h.param=t.id,h.host=this.code,h});wt.showCustomDeck(e,i)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),i=g.birth(t.card,"R",e.owner,e.lane);this.level>1&&i?.buff(this.level===3?10:5,0),At.popMode(),e.endActivation()}}class _i 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=L.getCard(this.bfc()),i=`Destroy an enemy ${p.levelGateText(this.level,!0)}creature.`;this.text=`Activate, destroy another friendly creature: ${i}~Allied Uterra: Put a ${p.tokName(e)} into an available lane.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.5)}}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[1]==="P1"){const i=g.ddf6(t),s=this.enemies(e[0],i.id);s.push(T.cancelAction()),T.ddf5(s)}else if(e[1]==="P2"){this.logAct(!0);const i=g.jr5(e[0]),s=R.tick(),h=g.jr5(e[2]),f=g.ddf6(t);W.destroy(h,this.code,s),W.destroy(f,this.code,s),i.endActivation()}else g.birth(this.bfc(),"P",t.playerA,t.lane),T.actionDone(!0)}jr8(t){if(E.allied("U")){const e=y.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId),i=D.toActions(e);i.length>0?T.ddf5(i):x.triggerDone()}else x.triggerDone()}friends(t){const e=y.crFriendNotMeActTarg("CARD",t,this.code,S.enTil(t,"P1"));return D.toActions(e)}enemies(t,e=""){const i=y.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",e));return i.level=D.ddf2(this.level),D.toActions(i)}bfc(){return "BRF"+this.level}}class tr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Dysian Siphon";const e=this.boof357;this.text=`Give an enemy creature ${p.jr9(-e,-e)}.~Allied Uterra: Give a friendly creature ${p.jr9(e,e)}. `}playTargets(){const t=super.playTargets(),e=y.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=S.deTil(t.param),i=this.boof357,s=g.ddf6(t);if(e[0]==="P1"){const h=y.crFriendActTarg("CARD",this.code,S.enTil("P2",s.id)),f=D.toActions(h);E.allied("U")&&f.length>0?(f.push(T.cancelAction()),T.ddf5(f)):(this.logSpell(s),s.buff(-i,-i),T.spellCast())}else{const h=g.jr5(e[1]);this.logSpell(h,s),h.buff(-i,-i),s.buff(i,i),T.spellCast()}}}class er 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 ${p.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,s.customCode=i.id,i.jr4("EF"),i}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const e=$.toEnterField(t.event);if(e.forged&&e.creature.id===t.trigger.customCode)if(k.getActive().health>120){const i=y.actionTarget("TF","CARD",this.code,"");i.player="F",i.hint=["FL"],i.lanes=g.laneIdx.filter(h=>h!==e.creature.lane);const s=D.toActions(i);s.push(T.noneEndTrigger()),T.ddf5(s)}else x.triggerDone();else{const i=e.creature.opposed;if(i&&E.allied("N",e.creature.owner)){const s=-this.boof135;i.buff(s,s)}x.triggerDone()}}handleAction(t){g.birth(this.code,"R",t.playerA,t.lane),T.actionDone(!0)}}class ir 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 i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=this.level<3,i}jr8(t){if(this.level<3){const e=g.jr5(t.trigger.creatId),i=y.actionTarget("TF","CARD",this.code,"");i.player="F",i.lanes=e.adjacent,i.hint=["FL"];const s=D.toActions(i);s.push(T.noneEndTrigger()),T.ddf5(s)}else{const e=y.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId);let i=D.toActions(e);if(i.length>0){const s=R.tick();i.forEach(h=>g.birth(this.code,"P",h.playerA,h.lane,s))}x.triggerDone()}}handleAction(t){g.birth(this.code,"P",t.playerA,t.lane),T.actionDone(!0)}}class ri extends P{lookup(t){return{["BTB"]:{c:()=>this.bbtC(),m:i=>this.bbtM(i)},["TVG"]:{c:()=>this.tvgC(),m:i=>this.tvgM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}armThreshold=1;wipe=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("AR",this.code);return s.area="A",i}enforceEffect(t,e){this.armThreshold<=e.armor?this.createMods(this.cardCode(),e).forEach(i=>{this.wipe&&e.removeModSafe(e.id),e.addModSafe(i)}):e.removeModSafe(e.id)}bbtC(){this.faction="A",this.rarity="R",this.name="Batterbot",this.iAttack=this.boof6914,this.iHealth=this.iAttack+2,this.tribe.push("RB","DN"),this.wipe=!0,this.text=`${this.name} gets +Attack equal to its Armor.`}bbtM(t){return[y.mod("AT",t.armor,t.id)]}tvgC(){this.faction="A",this.rarity="R",this.name="Tower Vanguard",this.iAttack=this.lValN([3,6,11]),this.iHealth=this.lValN([7,13,21]),this.tribe.push("RB");const t=this.boof247;this.text=`While ${this.name} has Armor, it gets ${p.jr9(t,0)}.`}tvgM(t){return[y.mod("AT",this.boof247,t.id)]}}class be extends P{lookup(t){return{["CIN"]:{c:()=>this.cyinC(),m:i=>this.cyinM(i)},["HWM"]:{c:()=>this.hlwmC(),m:i=>this.hlwmM(i)},["LSP"]:{c:()=>this.lspC(),m:i=>this.lspM(i)},["SSI"]:{c:()=>this.ssinC(),m:i=>this.ssinM(i)},["WTA"]:{c:()=>this.weguC(),m:i=>this.weguM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return i.addEffect("AT",this.code),i}enforceEffect(t,e){this.attThreshold<=e.attack?this.createMods(this.cardCode(),e).forEach(i=>{e.addModSafe(i)}):e.removeModSafe(e.id)}cyinC(){this.faction="A",this.rarity="R",this.name="Cypien Infiltrator",this.iAttack=this.boof61117,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.attThreshold=this.lValN([7,14,21]),this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Breakthrough.`}cyinM(t){return[y.mod("BT",!0,t.id)]}hlwmC(){this.faction="A",this.rarity="L",this.name="Hinterland Watchman",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.lValN([7,10,20]),this.tribe.push("MC"),this.attThreshold=this.boof51020;const t=this.lValS(["Mobility 3","Armor 5 and Mobility 3","Armor 5, Breakthrough, Aggressive, Mobility 3, and Regenerate 5"]);this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets ${t}.`}hlwmM(t){const e=[y.mod("MB",3,t.id)];return this.level>1&&e.push(y.mod("AR",5,t.id)),this.level===3&&(e.push(y.mod("BT",!0,t.id)),e.push(y.mod("AG",!0,t.id)),e.push(y.mod("RG",5,t.id))),e}lspC(){this.faction="A",this.rarity="C",this.name="Lightshield Patrol",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.boof51020,this.tribe.push("HM"),this.attThreshold=this.iHealth,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Armor ${this.boof234}.`}lspM(t){return[y.mod("AR",this.boof234,t.id)]}ssinC(){this.faction="A",this.rarity="R",this.name="Spiritsteel Infiltrator",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("EN"),this.attThreshold=this.boof51020,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Mobility ${this.level} and Armor ${this.boof246}.`}ssinM(t){return[y.mod("MB",this.level,t.id),y.mod("AR",this.boof246,t.id)]}weguC(){this.faction="U",this.rarity="L",this.name="Wegu, the Ancient",this.iAttack=0,this.iHealth=1,this.tribe.push("PL"),this.iDefend=!0,this.attThreshold=this.lValN([10,25,100]);const t=this.boof124,e=this.level===3?"it gets Breakthrough and ":"";this.text=`When you gain health, Wegu gets ${p.jr9(t,t)} for each health you gained.~While Wegu has ${this.attThreshold} or more attack, ${e}Negate Defender from it.`}weguM(t){const e=[y.mod("ND",!0,t.id)];return this.level===3&&e.push(y.mod("BT",!0,t.id)),e}}class si extends P{friendNotMe(t){const e=y.crNotMeTarg(t.id);return e.player=k.toTarget(t.owner),e}friendNone(t){const e=y.crTarg();return e.player=k.toTarget(t.owner),e.lanes=[],e}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforcementActive(t){return t.status==="A"}applyEffect(t,e,i){const s=this.friendNotMe(t),h=g.creatByTarget(s),f=g.creatByTarget(i);h.forEach(m=>{f.includes(m)?m.addModSafe(e):m.removeModSafe(t.id)})}}class Ae extends si{lookup(t){return{["BWW"]:{c:()=>this.bwwC(),m:i=>this.bwwM(i),t:i=>this.bwwT(i)},["HTR"]:{c:()=>this.hrtC(),m:i=>this.hrtM(i),t:i=>this.hrtT(i)},["KKK"]:{c:()=>this.kkkC(),m:i=>this.kkkM(i),t:i=>this.kkkT(i)},["SFE"]:{c:()=>this.sfeC(),m:i=>this.sfeM(i),t:i=>this.sfeT(i)},["XDV"]:{c:()=>this.xdvC(),m:i=>this.xdvM(i),t:i=>this.xdvT(i)}}[t]}createMod(t,e){return this.lookup(t).m(e)}effTargs(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t,e){const i=this.cardCode(),s=this.createMod(i,e),h=this.enforcementActive(e)?this.effTargs(i,e):this.friendNone(e);this.applyEffect(e,s,h)}bwwC(){this.faction="T",this.rarity="H",this.name="Borean Windweaver",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.iMobile=this.level,this.tribe.push("WN","AS"),this.text=`Each other friendly creature gets Mobility ${this.level}.`}bwwM(t){return y.mod("MB",this.level,t.id)}bwwT(t){return this.friendNotMe(t)}hrtC(){this.faction="U",this.rarity="L",this.name="Heart Tree",this.iAttack=0,this.iHealth=this.lValN([10,15,30]),this.iRegen=this.boof246,this.iDefend=!0,this.tribe.push("PL"),this.text=`Each other friendly creature gets Regenerate ${this.iRegen}.`}hrtM(t){return y.mod("RG",this.iRegen,t.id)}hrtT(t){return this.friendNotMe(t)}kkkC(){if(this.faction="T",this.rarity="L",this.name="Korok, Khan of Kadras",this.iAttack=this.lValN([4,7,12,18]),this.iHealth=this.lValN([7,12,18,26]),this.iAggro=!0,this.tribe.push("FB"),this.maxLevel=4,this.level>1){const t=this.lValS(["","friendly level 1","friendly level 2 or lower","other friendly"]);this.text=`Each ${t} creature gets Aggressive.`}}kkkM(t){return y.mod("AG",!0,t.id)}kkkT(t){const e=this.friendNotMe(t);return this.level===1?e.lanes=[]:e.level=D.ddf2(this.level-1),e}sfeC(){this.faction="T",this.rarity="H",this.name="Shadowflame Elemental",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.iAggro=!0,this.tribe.push("DF","EL"),this.text="Each other friendly Darkforged gets Aggressive."}sfeM(t){return y.mod("AG",!0,t.id)}sfeT(t){const e=this.friendNotMe(t);return e.tribe="DF",e}xdvC(){this.faction="N",this.rarity="H",this.name="Xrath, Dreadnight Of Varna",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.boof248,this.tribe.push("ZB"),this.text=`Each other friendly Zombie gets Regenerate ${this.iRegen}`}xdvM(t){return y.mod("RG",this.iRegen,t.id)}xdvT(t){const e=this.friendNotMe(t);return e.tribe="ZB",e}}class rr extends P{lookup(t){return{["AHL"]:{c:()=>this.ahlC(),m:i=>this.ahlM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){const i=y.crNotMeTarg(e.id);i.player=k.toTarget(e.owner),g.creatByTarget(i).length===0?this.createMods(this.cardCode(),e).forEach(h=>{e.addModSafe(h)}):e.removeModSafe(e.id)}ahlC(){this.faction="A",this.rarity="H",this.name="Alloyin Highlander",this.iAttack=this.lValN([5,7,10]),this.iHealth=this.boof6914,this.tribe.push("HM"),this.text=`While ${this.name} is your only friendly creature, it gets ${p.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}ahlM(t){return[y.mod("AT",this.boof4812,t.id),y.mod("AR",this.boof248,t.id)]}}class ai extends P{lookup(t){return{["NXP"]:{c:()=>this.nxpC(),m:i=>this.nxpM(i)},["SKG"]:{c:()=>this.skgC(),m:i=>this.skgM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){e.lane===3?this.createMods(this.cardCode(),e).forEach(i=>{e.addModSafe(i)}):e.removeModSafe(e.id)}nxpC(){this.faction="A",this.rarity="C",this.name="Nexus Pilot",this.iAttack=this.boof358,this.iHealth=this.boof4710,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets ${p.jr9(this.iAttack,this.iHealth)}.`}nxpM(t){return[y.mod("AT",this.iAttack,t.id),y.mod("HL",this.iHealth,t.id),y.mod("MH",this.iHealth,t.id)]}skgC(){this.faction="A",this.rarity="C",this.name="Skyknight Glider",this.iAttack=this.boof5916,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets Mobility 2.`}skgM(t){return[y.mod("MB",2,t.id)]}}class Ze extends P{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:i=>this.cctM(i)},["GHB"]:{c:()=>this.ghbC(),m:i=>this.ghbM(i)},["PYG"]:{c:()=>this.pygC(),m:i=>this.pygM(i)}}[t]}createMods(t,e){return this.lookup(t).m(e)}likesOpposed=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=[this.likesOpposed?"OP":"OL"]}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){!!e.opposed===this.likesOpposed?this.createMods(this.cardCode(),e).forEach(i=>{e.addModSafe(i)}):e.removeModSafe(e.id)}cctC(){this.faction="T",this.rarity="R",this.name="Cloudcleaver Titan",this.iAttack=this.boof4812,this.iHealth=this.lValN([7,10,16]),this.tribe.push("WN","GT"),this.iMobile=this.level;const t=this.boof246;this.text=`While ${this.name} is unopposed, it gets ${p.jr9(t,0)}.`}cctM(t){return[y.mod("AT",this.boof246,t.id)]}ghbC(){this.faction="U",this.rarity="R",this.name="Gemhide Basher",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.lValN([3,7,10]),this.tribe.push("DN"),this.likesOpposed=!0,this.text=`While ${this.name} is opposed, it gets Aggressive.`}ghbM(t){return[y.mod("AG",!0,t.id)]}pygC(){this.faction="T",this.rarity="H",this.name="Pyre Giant",this.iAttack=this.boof468,this.iHealth=this.boof234,this.tribe.push("FR","GT"),this.iAggro=!0,this.text=`While ${this.name} is unopposed, it gets ${p.jr9(this.iAttack,0)}.`}pygM(t){return[y.mod("AT",this.iAttack,t.id)]}}class ni extends P{lookup(t){return{["BRS"]:{c:()=>this.barryC(),m:i=>this.barryM(i)},["CSR"]:{c:()=>this.cvsC(),m:i=>this.cvsM(i)}}[t]}mPlayer=0;targetPlayer(t){if(this.mPlayer===1)return t.owner;if(this.mPlayer===-1)return!t.owner;throw new Error("didnt write code OBDD")}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){const i=e.status==="A",s=this.targetPlayer(e);if(i){const h=this.createMod(this.cardCode(),e);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.hints=[this.lValH(["ZZ-1","ZZ-3","ZZ-5"])],this.text=`You get Armor ${this.iHealth}.`}barryM(t){return y.mod("AR",this.iHealth,t.id)}cvsC(){this.faction="U",this.rarity="C",this.name="Cavern Serpent",this.iAttack=this.boof4914,this.iHealth=this.iAttack,this.tribe.push("SN"),this.mPlayer=-1,this.text=`The enemy player has Poison ${this.boof246}.`}cvsM(t){return y.mod("PN",this.boof246,t.id)}}class ke extends si{lookup(t){return{["ALG"]:{c:()=>this.algnC(),m:i=>this.algnM(i)},["ALS"]:{c:()=>this.alstC(),m:i=>this.alstM(i)},["BTN"]:{c:()=>this.btcC(),m:i=>this.btcM(i)},["NXA"]:{c:()=>this.aeroC(),m:i=>this.aeroM(i)},["NXT"]:{c:()=>this.ntcC(),m:i=>this.ntcM(i)}}[t]}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}nexus=!1;enforcementActive(t){return super.enforcementActive(t)?this.nexus?t.lane===3:!0:!1}enforceEffect(t,e){const i=this.cardCode(),s=this.createMod(i,e);let h;this.enforcementActive(e)?(h=this.friendNotMe(e),this.nexus?h.lanes=[1,2,4,5]:h.lanes=e.adjacent):h=this.friendNone(e),this.applyEffect(e,s,h)}algnC(){this.faction="A",this.rarity="R",this.name="Alloyin General",this.iAttack=this.boof246,this.iHealth=this.boof81318,this.tribe.push("HM"),this.text=`Adjacent creatures gets ${p.jr9(this.iAttack,0)}.`}algnM(t){return y.mod("AT",this.iAttack,t.id)}alstC(){this.faction="A",this.rarity="H",this.name="Alloyin Strategist",this.iAttack=this.boof4814,this.iHealth=this.iAttack+1,this.iMobile=this.level,this.tribe.push("HM");const t=this.boof246;this.text=`Adjacent creatures gets ${p.jr9(t,0)}.`}alstM(t){return y.mod("AT",this.boof246,t.id)}btcC(){this.faction="A",this.rarity="H",this.name="Battle Techtician",this.iAttack=this.boof3714,this.iHealth=this.boof71117,this.tribe.push("HM"),this.nexus=!0;const t=this.boof248;this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${p.jr9(t,0)}.`}btcM(t){return y.mod("AT",this.boof248,t.id)}aeroC(){this.faction="A",this.rarity="L",this.name="Nexus Aeronaut",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.iMobile=1;const t=this.boof236;this.nexus=!0,this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${p.jr9(t,0)}. Otherwise this gets Armor ${t}.`}aeroM(t){return y.mod("AT",this.boof236,t.id)}ntcC(){this.faction="A",this.rarity="H",this.name="Nexus Techtician",this.iHealth=this.boof6916,this.iAttack=this.iHealth-3,this.tribe.push("HM"),this.nexus=!0;const t=this.boof235;this.text=`While ${this.name} is in the center lane, each other friendly creature gets Armor ${t}.`}ntcM(t){return y.mod("AR",this.boof235,t.id)}}class fe extends P{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC(),["POD"]:()=>this.podC(),["RWC"]:()=>this.roamC()})[t]()}targAction(t){g.birth(this.spawnCode,"R",t.playerA,t.lane)}adjacent=!1;optional=!1;needsEmpty=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const e=p.forglied(this.allied);this.text=e+": "+this.ftext}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){if(this.cardCode()==="POD"&&!E.patron("U")){x.triggerDone();return}if(this.allied==="X"||E.allied(this.allied)){const e=g.jr5(t.creatId),i=y.emptyPlayerActTarg("F","CARD",this.code,t.creatId);this.needsEmpty||(i.field="A",i.hint=["FL"],i.lanes=g.laneIdx.filter(h=>h!==e.lane)),this.adjacent&&(i.lanes=e.adjacent);const s=D.toActions(i);s.length>0?(this.optional&&s.push(T.noneEndTrigger()),T.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){this.targAction(t),T.actionDone(!0)}bwdC(){this.faction="U",this.rarity="C",this.name="Branchweaver Druid",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.hints=["RT"],this.spawnCode=`${"TFD"}${this.level}`,this.optional=!0;const t=L.getCard(this.spawnCode);this.ftext=`You may put a ${p.tokName(t)} into another lane.`}btsC(){this.faction="U",this.rarity="C",this.name="Brighttusk Sower",this.iAttack=this.lValN([6,8,10]),this.iHealth=this.iAttack,this.tribe.push("TK"),this.level===1&&(this.hints=["ZZ-1"]),this.spawnCode=Z.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=L.getCard(this.spawnCode);this.ftext=`You may put a ${p.tokName(t)} into an adjacent lane.`}escarC(){this.faction="A",this.rarity="H",this.name="Esperian Scarab",this.iAttack=this.lValN([3,4,7]),this.iHealth=this.boof5711,this.iArmor=this.boof135,this.tribe.push("RB"),this.allied="U",this.spawnCode=this.code,this.optional=!0,this.ftext=`You may but a copy of ${this.name} into another lane.`}ethhC(){this.faction="U",this.rarity="C",this.name="Ether Hounds",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ST"),this.needsEmpty=!0,this.spawnCode=this.code,this.ftext="Put a copy of this into an available lane."}podC(){this.faction="U",this.rarity="H",this.name="Patron of Deepwood",this.iHealth=this.boof4713,this.iAttack=this.iHealth+3,this.tribe.push("ST"),this.spawnCode=this.code,this.optional=!0,this.adjacent=!0,this.ftext=`If you have three or more Uterra cards in your hand, you may put a copy of ${this.name} into an adjacent 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 sr 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=L.getCard(this.soldier);this.addSp("N",e.iAttack),this.text=`While you have 6 or more cards in hand, this gets "Activate: Put a ${p.tokName(e)} into an available lane."`,this.bonus={activ8:this.multNug(this.spawnNug(e),.3)}}canActivate(t){return k.toPlayer(t.owner).hand.length>5&&g.emptyLanes(t.owner).length>0}startActivation(t){const e=y.emptyPlayerActTarg(t.owner,"CARD",this.code,t.id),i=D.toActions(e);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const e=g.jr5(t.param);this.logAct(!0),g.birth(this.soldier,"P",t.playerA,t.lane),e.endActivation()}ddf8(t){return!0}jr8(t){const e=k.toPlayer(t.owner);k.drawCard(e,1);const i=y.trigIdx(e.triggers,t.trigger);i>-1&&e.triggers.splice(i,1),x.triggerDone()}get soldier(){return "EPS"+this.level}}class ar 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 i=super.jr3(t,e),s=i.jr4("FR");s.interactive=!0;const h=i.jr4("EF");return h.interactive=!0,i}handleAction(t){if(t.zone==="H")E.levelAndDiscardA(t);else{const e=t;g.birth(this.code,"R",e.playerA,e.lane)}T.actionDone(!0)}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(t.trigger.type==="FR")if(E.allied("U")){const e=g.jr5(t.creatId),i=y.actionTarget("TF","CARD",this.code,t.creatId);i.player="F",i.lanes=g.laneIdx.filter(h=>h!==e.lane),i.hint=["FL"];const s=D.toActions(i);s.push(T.noneEndTrigger()),T.ddf5(s)}else x.triggerDone();else{const e=y.lvlHandActTarg(this.code,t.creatId),i=D.toActions(e);i.length>0?T.ddf5(i):x.triggerDone()}}}class nr 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}.`,this.bonus={activ8:this.buffNug(0,e)}}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){const e=y.crFriendNotMeTarg(t.id);return g.creatByTarget(e).length>0}startActivation(t){const e=D.boardTarget("CARD",this.code);e.param=t.id,T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),i=this.boof358,s=y.crFriendNotMeTarg(e.id);g.creatByTarget(s).forEach(h=>{h.heal(i)}),e.endActivation()}jr8(t){E.allied("A")&&g.jr5(t.creatId).addArmor(this.boof247),x.triggerDone()}}class or 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","LG"]):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this lane.`,this.hints=["ZZ-3"])}jr3(t,e){const i=super.jr3(t,e);if(this.level===2){const s=i.jr4("RU");s.bonus=this.buffNug(10,9)}else if(this.level===3){const s=i.jr4("VN");s.bonus=this.statSpawnNug(0,1)}return i}ddf8(t){return t.event.playerA===t.owner}jr8(t){if(t.trigger.type==="RU"){const e=g.jr5(t.creatId);g.birth(`${"EFP"}3`,"R",e.owner,e.lane)}else if(t.trigger.type==="VN"){const i=$.toCreature(t.event).creature;g.birth(`${"EFP"}2`,"P",i.owner,i.lane)}x.triggerDone()}}class hr 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 i=super.jr3(t,e),s=i.jr4("HG");return s.bonus=this.playerNug(this.iHealth/2),i}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const e=this.level===3?2:1;k.heal(t.owner,t.event.healAmt*e),x.triggerDone()}}class lr 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 i=super.jr3(t,e);return i.jr4("FR"),i}handleAction(t){g.birth(`${"FME"}${this.level}`,"P",t.playerA,t.lane),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner}jr8(t){const e=g.jr5(t.creatId);if(t.event.code==="ENT"){const i=e.jr4("TS");i.interactive=!0,i.changes=!0,i.bonus=this.rawNug(1,0,6,0),x.triggerDone()}else if(t.event.code==="TRS"){const i=y.trigIdx(e.triggers,t.trigger);i>-1&&e.removeTrigger(e.triggers[i]);const s=y.emptyPlayerActTarg("F","CARD",this.code,""),h=D.toActions(s);h.length===0?x.triggerDone():(h.push(T.noneEndTrigger()),T.ddf5(h))}}}class cr extends kt{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const e=this.boof4711;this.text=`Deal ${e} damage to an enemy creature.~Give a friendly creature ${p.jr9(e,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(y.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const e=S.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=this.friends(i.id);s.push(T.cancelAction()),T.ddf5(s)}else{this.logSpell(i);const s=g.jr5(e[1]),h=this.boof4711;s.hurtDirect(h,this.code);const f=y.mod("AT",h);f.expiry="ET",i.addMod(f),T.spellCast()}}friends(t=""){const e=y.crFriendActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(e)}}class dr extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Frostspeaker Shaman",this.iAttack=this.boof248,this.iHealth=this.boof71116,this.iDefend=!0,this.tribe.push("IC","YT"),this.addSp("D",this.iAttack),this.text=`Activate: Deal ${this.iAttack} damage to an enemy creature or player.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}canActivate(t){return!0}startActivation(t){const e=y.crActTarg("CARD",this.code,t.id);e.hint=["HR"];const i=y.playerActTarg("X","CARD",this.code,t.id);i.hint=["HR"];const s=D.toActions([e,i]);s.push(T.cancelAction()),T.ddf5(s)}handleAction(t){if(t.zone==="F"){const i=g.ddf6(t);this.logAct(!0,i),i.hurtDirect(this.iAttack,this.code)}else{this.logAct(!0);const i=t;k.hurtDirect(i.playerA,this.iAttack,this.code)}g.jr5(t.param).endActivation()}}class ur extends kt{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Gauntlets of Sulgrim";const e=this.boof2510;this.text=`Give a friendly creature Armor ${e}, then deal damage equal to its Armor to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.baddies().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");e.canArmor=!0,t.push(e)}return t}handleAction(t){const e=S.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=T.cancelAction(),h=this.baddies(i.id);h.push(s),T.ddf5(h)}else{const s=g.jr5(e[1]);this.logSpell(s);const h=this.boof2510;s.addArmor(h),i.hurtDirect(s.armor,this.code),T.spellCast()}}baddies(t=""){return D.toActions(y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t)))}}class fr 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.text=`When ${this.name} ${p.dbdtap()}, you gain that much health.~Allied Tempys: Mobility ${this.level}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.bonus=this.playerNug(this.iAttack),i}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){if(t.trigger.type==="FR")E.allied("T")&&g.jr5(t.creatId).addMobility(this.level),x.triggerDone();else if(t.trigger.type==="DM"){const e=t.event;k.heal(t.owner,e.dmg),x.triggerDone()}}}class gr 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 ${p.levelGateText(this.level,!0)}creature gets "When this is dealt damage, destroy it."`,i=this.level===3?"At the start of each turn, deal 1 damage to each enemy creature.~":"";this.text=i+e}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("RU");if(s.bonus=this.statSpawnNug(0,0),this.level===3){const h=i.jr4("TS");h.bonus=this.buffNug(3,0)}return i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;if(e.isCreatTarg&&e.target===t.creatId)return!0}return t.trigger.type==="RU"?t.event.playerA===t.owner:t.trigger.type==="TS"}jr8(t){if(t.trigger.type==="RU"){const e=y.crEnemyTarg();e.level=D.ddf2(this.level),g.creatByTarget(e).forEach(i=>{const s=i.jr4("DM");s.bonus=this.rawNug(0,0,0,0,-2),s.changes=!0})}else if(t.trigger.type==="TS"){const e=R.tick();g.qEnemyCreats().forEach(i=>{i.hurtDirect(1,this.code,e)})}else if(t.trigger.type==="DM"){const e=g.jr5(t.creatId);e.status==="A"&&W.destroy(e,this.code)}x.triggerDone()}}class mr extends P{constructor(t){super(t),this.faction="U",this.rarity="C",this.name="Grapplevine",this.iAttack=this.boof357,this.iHealth=this.lValN([9,12,18]),this.tribe.push("PL"),this.text="Negate Mobility from each creature.",this.level===3&&(this.hints=["ZZ+2"])}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){const i=g.qActiveCreats();e.status==="A"?i.forEach(s=>{s.addModSafe(y.mod("NM",!0,e.id))}):i.forEach(s=>{s.removeModSafe(e.id)})}}class pr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Grave Pact",this.isFree=this.level===3,this.text=`Destroy a friendly creature.~Destroy an ${p.levelGateText(this.level+1,!0)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=S.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=this.enemyTargActions(i.id);s.push(T.cancelAction()),T.ddf5(s)}else{this.logSpell();const s=g.jr5(e[1]),h=R.tick();W.destroy(s,this.code,h),W.destroy(i,this.code,h),T.spellCast()}}enemyTargActions(t=""){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return e.level=D.ddf2(this.level+1),D.toActions(e)}}class yr extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="H.E.R.M.E.S.",this.iAttack=this.boof6915,this.iHealth=this.iAttack,this.tribe.push("RB"),this.text=`At the end of your turn, each other friendly creature gets Defender and Armor ${this.boof124} until the end of the next turn.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("TE",this.code);const s=i.addEffect("PS",this.code);return s.area="C",i}ddf8(t){return!0}jr8(t){const e=g.jr5(t.creatId),i=y.effect("PS",this.code);this.enforceEffect(i,e),x.triggerDone()}enforceEffect(t,e){const i=this.boof124,s=y.crNotMeTarg(e.id);s.player=k.toTarget(e.owner);const h=g.creatByTarget(s),f=e.status==="A",m=k.activePlayer===e.owner,A=Rt.phase==="ET"||Rt.phase==="PT";f&&(m&&A||!m&&!A)?h.forEach(C=>{C.addModSafe(y.mod("AR",i,e.id)),C.addModSafe(y.mod("DF",!0,e.id))}):h.forEach(C=>{C.removeModSafe(e.id)})}}class br extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const e=this.boof359;this.text=`Give a friendly creature +${e} attack.~Give an enemy creature -${e} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=S.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=this.enemyTargActions(i.id);s.push(T.cancelAction()),T.ddf5(s)}else{const s=g.jr5(e[1]);this.logSpell(s,i);const h=this.boof359;s.buff(h,0),i.buff(-h,0),T.spellCast()}}enemyTargActions(t=""){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(e)}}class Ar 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 i=super.jr3(t,e),s=i.jr4("EF");return s.interactive=!0,i}handleAction(t){g.birth(this.code,"P",t.playerA,t.lane),T.actionDone(!0)}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(S.randInt(0,ht.simOn?4:2)===1){const i=y.emptyPlayerActTarg("F","CARD",this.code,""),s=y.actionTarget("TB","NOTR",this.code,""),h=D.toActions([i,s]);h.length===1?x.triggerDone():T.ddf5(h)}else x.triggerDone()}}class kr 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,this.hints=["ZZ-5"]);let i;this.level===3?i="When this gains health, deal that much damage to the enemy player.~Vengeance: Put a level 1 Iniog into this lane.":i=`When a creature is destroyed, this gets Regenerate 1.~At the end of your turn, if this has Regenerate ${e} or higher, replace it with a level ${this.level+1} Iniog.`,this.text=i}jr3(t,e){const i=super.jr3(t,e);if(this.level===3){const s=i.jr4("HG");s.bonus=this.playerNug(4);const h=i.jr4("VN");h.bonus=this.buffNug(0,3)}else{const s=i.jr4("DS");s.bonus=this.regnNug(2);const h=i.jr4("TE"),f=L.getCard(this.levelUpCard());h.bonus=this.multNug(this.buffNug(f.iAttack,f.iHealth),.4)}return i}ddf8(t){return t.trigger.type==="TE"?t.event.playerA===t.owner:t.trigger.type==="HG"?t.event.creatId===t.creatId:t.trigger.type==="DS"}jr8(t){const e=g.jr5(t.creatId);if(t.trigger.type==="HG"){const i=t.event;k.hurtDirect(!t.owner,i.healAmt,this.code)}else if(t.trigger.type==="VN")g.birth("ICD"+"1","P",e.owner,e.lane);else if(t.trigger.type==="DS")e.addRegen(1);else if(t.trigger.type==="TE"){const i=this.level===1?4:9;e.regen>i&&g.birth(this.levelUpCard(),"R",e.owner,e.lane)}x.triggerDone()}}class vr 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 ${p.dbdtap()}, deal that much damage to that player again.~When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");s.bonus=this.buffNug(0,this.iAttack);const h=i.jr4("DM");return h.bonus=this.buffNug(this.iAttack,0),i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId}else if(t.trigger.type==="PC"){const e=t.event;if(e.playerA===t.owner)return L.getCard(e.cardCode).cardCode()==="IFR"}return!1}jr8(t){if(t.trigger.type==="DM"){const e=t.event;k.hurtDirect(!t.owner,e.dmg,this.code)}else if(t.trigger.type==="PC"){const e=g.jr5(t.trigger.creatId);g.birth(`${"IZR"}${this.level}`,"R",e.owner,e.lane)}x.triggerDone()}}class Tr 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.`,this.bonus={activ8:this.buffNug(e,0)}}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.bonus=this.buffNug(0,this.iAttack),i}canActivate(t){return!0}startActivation(t){const e=y.crActTarg("CARD",this.code,t.id);e.hint=["HR"];const i=D.toActions([e,D.buttonTarget("CANC")]);T.ddf5(i)}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.logAct(!0),e.hurtDirect(this.boof2510,this.code),i.endActivation()}ddf8(t){return t.event.playerA===t.owner&&t.event.cardCode.slice(0,3)==="IFL"}jr8(t){const e=g.jr5(t.trigger.creatId);g.birth(`${"IZL"}${this.level}`,"R",e.owner,e.lane),x.triggerDone()}}class Sr 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",this.lValH(["ZZ+2","ZZ+2","ZZ+3"])];const e=this.lValS(["Poison 1","Poison 3","that much Poison"]);this.text=`When ${this.name} deals battle damage to a creature or player, they get ${e}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.regnNug(this.iAttack),s.bonus.pHealth=this.iAttack,i}ddf8(t){return t.event.battle&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){const e=$.toDamage(t.event),i=this.lValN([1,3,e.dmg]);e.isCreatTarg?e.hurtCreat.addPoison(i):e.hurtPlayer.poison+=i,x.triggerDone()}}class Cr 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 ${p.levelGateText(this.level)} card in your`:this.level===3?e="a card in your hand and":e="each card in your hand, deck, and",this.text=`Forge: Level up ${e} discard pile.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=this.level<4,i}handleAction(t){const e=k.getActive();if(t.zone==="N"){const i=L.getCard(e.discard[t.position]);e.discard[t.position]=i.levelUpCard(),At.popMode(),T.actionDone(!0)}else{const i=L.getCard(e.hand[t.position]);e.hand[t.position]=i.levelUpCard(),this.discardLevel(!0)}}jr8(t){if(this.level<3)this.discardLevel(!1);else if(this.level===3){const e=D.toActions(y.lvlHandActTarg(this.code,""));e.length>0?T.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(),i=y.target("TD");i.player=k.toTarget(e),i.level=D.ddf2(this.level),i.canLevel=!0;const s=wt.generateContent(e.discard,!1,i);if(s.length>0){const h=s.map(f=>{const m=y.deckSelectAction("CARD",f.cardCode,f.sourceIdx);return m.host=this.code,m.hint=["CD"],m});wt.showCustomDeck(s,h)}else t?T.actionDone(!0):x.triggerDone()}levelDeck(t){t.map(i=>{const s=L.getCard(i);return s.canLevel()?s.levelUpCard():i}).forEach((i,s)=>t[s]=i)}}class wr 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 ${p.jr9(this.iAttack,0)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){const i=y.crTarg(),s=e.status!=="A";i.player=k.toTarget(e.owner);const h=g.creatByTarget(i),f=y.mod("AT",this.iAttack,e.id);h.forEach(m=>{m.opposed||s?m.removeModSafe(e.id):m.addModSafe(f)})}}class Dr extends P{constructor(t){if(super(t),this.faction="U",this.rarity="L",this.name="Leafkin Progenitor",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level===3)this.text=`Activate: Put a level 1 ${this.name} into an adjacent available lane.`,this.bonus={activ8:this.statSpawnNug(3,3)};else{this.text=`Activate: Replace this with a level ${this.level+1} ${this.name}.`;const e=3*this.level;this.bonus={activ8:this.buffNug(e,e)}}}canActivate(t){return this.level===3?T.emptyAdjacents(t,"").length>0:!0}startActivation(t){let e;if(this.level===3)e=T.emptyAdjacents(t,"");else{const i=y.fieldSelectAction("CARD",t.lane,t.owner);i.param=t.id,i.host=this.code,e=[i]}e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);this.level===3?g.birth(this.leafCode(1),"P",t.playerA,t.lane):g.birth(this.leafCode(this.level+1),"R",e.owner,e.lane),e.endActivation()}leafCode(t){return`${"LKP"}${t}`}}class ge 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,i){({["AFO"]:(h,f)=>this.doNossing(h,f),["CRS"]:(h,f)=>this.doNossing(h,f),["FOL"]:(h,f)=>this.doNossing(h,f),["NXO"]:(h,f)=>this.doNossing(h,f),["TEX"]:(h,f)=>this.doNossing(h,f),["TSM"]:(h,f)=>this.doNossing(h,f)})[t](e,i)}playTarg;optional=!1;ftext="";forgeLevels=[1,2,3,4];constructor(t){super(t),this.playTarg=y.lvlHandActTarg(this.code,""),this.cardConstruct(this.cardCode()),this.forgeLevels.includes(this.level)&&(this.text="Forge: "+this.ftext)}jr3(t,e){const i=super.jr3(t,e);if(this.forgeLevels.includes(this.level)){const s=i.jr4("FR");s.interactive=!0}return i}handleAction(t){E.levelAndDiscardA(t);const e=g.jr5(t.param);this.targAction(this.cardCode(),t,e),T.actionDone(!0)}jr8(t){if(this.cardCode()==="NXO"&&g.jr5(t.creatId).lane!==3){x.triggerDone();return}const e=D.toActions(this.playTarg);e.length>0?(e.forEach(i=>{i.param=t.creatId}),this.optional&&e.push(T.noneEndTrigger()),T.ddf5(e)):x.triggerDone()}doNossing(t,e){}aetorC(){this.faction="A",this.rarity="C",this.name="Aetherforge Oracle",this.iAttack=this.boof61218,this.iHealth=this.boof246,this.tribe.push("HM"),this.optional=!0,this.playTarg.card="S",this.ftext="You may discard and level up a spell."}scootC(){this.faction="A",this.rarity="R",this.name="Cerebral Scout",this.iAttack=this.boof51015,this.iHealth=this.boof3712,this.tribe.push("MM"),this.optional=!0,this.playTarg.tribe="MM",this.ftext="You may discard and level up a Metamind."}forcC(){this.faction="A",this.rarity="H",this.name="Forge Oracle",this.iAttack=this.lValN([1,10,20]),this.iHealth=this.iAttack,this.tribe.push("ST"),this.playTarg.faction="A",this.optional=!0,this.ftext="You may discard an Alloyin card and level it.",this.level===1?this.hints=["LG","RT"]:(this.consistent=!0,this.addSp("C",0),this.level===3&&(this.hints=["ZZ-2"]))}nexoC(){this.faction="A",this.rarity="C",this.name="Nexus Overwatch",this.iHealth=this.boof71014,this.iAttack=this.iHealth-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`If ${this.name} is in the center lane, you may ${p.daluac()}.`}texC(){this.faction="A",this.rarity="C",this.name="Tech Explorer",this.iAttack=this.lValN([1,8,18]),this.iHealth=this.iAttack+2,this.tribe.push("GN"),this.level===1&&(this.hints=["LG","RT"]),this.optional=!0,this.playTarg.card="C",this.ftext="You may discard and level up a creature."}tsmithC(){this.faction="A",this.rarity="C",this.name="Technosmith",this.iAttack=this.boof5915,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`You may ${p.daluac()}.`}}class Ft extends P{lookup(t){return{["DFB"]:{c:()=>this.dfbC(),d:(i,s)=>this.dfbD(i,s)},["GGB"]:{c:()=>this.ggbC(),d:(i,s)=>this.ggbD(i,s)},["GGD"]:{c:()=>this.ggdC(),d:(i,s)=>this.ggdD(i,s)},["GGR"]:{c:()=>this.ggdrC(),d:(i,s)=>this.ggdrD(i,s)},["GGP"]:{c:()=>this.ggpC(),d:(i,s)=>this.ggpD(i,s)},["GGW"]:{c:()=>this.ggwC(),d:(i,s)=>this.ggwD(i,s)},["MHR"]:{c:()=>this.mhermC(),d:(i,s)=>this.mhermD(i,s)},["NGT"]:{c:()=>this.ngauntC(),d:(i,s)=>this.ngauntD(i,s)},["SRH"]:{c:()=>this.sharvC(),d:(i,s)=>this.sharvD(i,s)},["YNS"]:{c:()=>this.yuruC(),d:(i,s)=>this.yuruD(i,s)}}[t]}trigB;creatDied(t,e){this.lookup(t).d(e,$.toCreature(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DS");return s.bonus=this.trigB,i}ddf8(t){return!0}jr8(t){this.creatDied(this.cardCode(),t),x.triggerDone()}dfbC(){this.faction="N",this.rarity="R",this.name="Dr. Frankenbaum",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("AB");const t=this.boof234;this.text=`When a friendly Abomination is destroyed, deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t*2)}dfbD(t,e){const i=g.jr5(t.creatId),s=e.creature;(i.id===s.id||s.owner===i.owner&&s.isTribe("AB")&&Ft.itDiedFirst(s.id,i.id))&&k.hurtDirect(!i.owner,this.boof234,this.code)}ggbC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Betrayer",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("DF","GG");const t=-this.level;this.text=`When a friendly Darkforged is destroyed, the creature opposing it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(this.level,this.level)}ggbD(t,e){const i=g.jr5(t.creatId),s=e.creature;if(i.id===s.id||s.owner===i.owner&&s.isTribe("DF")&&Ft.itDiedFirst(s.id,i.id)){const h=s.opposed;if(h){const f=-this.level;h.buff(f,f),this.logAct(!1,h)}}}ggdC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Devourer",this.iAttack=this.boof579,this.iHealth=this.iAttack-2,this.tribe.push("GG"),this.hints=["OL"],this.text=`When a creature is destroyed, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),2)}ggdD(t,e){g.jr5(t.creatId).buff(this.level,this.level)}get doomb(){return this.lValN([1,1,2])}ggdrC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Doomrider",this.iAttack=this.boof4712,this.iHealth=this.iAttack+2,this.tribe.push("GG");const t=this.doomb;this.text=`When a friendly creature is destroyed, ${this.name} moves to that creatures lane and gets ${p.jr9(t,t)}. Then give the opposing creature ${p.jr9(-t,-t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}ggdrD(t,e){const i=g.jr5(t.creatId),s=e.creature;if(s.owner===i.owner&&i.id!==s.id&&Ft.itDiedFirst(s.id,i.id)&&!g.searchByLane(s.lane,s.owner)){const f=this.doomb;i.move(s.lane),i.buff(f,f);const m=i.opposed;m&&(this.logAct(!1,m),m.buff(-f,-f))}}ggpC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Predator",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("GG"),this.hints=["OP"];const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}ggpD(t,e){if(e.creature.owner!==t.owner){const i=g.jr5(t.creatId),s=g.oppositeLane(i.lane);if(e.creature.lane===s){const h=this.boof246;i.buff(h,h),this.logAct(!1)}}}ggwC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Warrior",this.iAttack=this.boof4710,this.iHealth=this.iAttack+1,this.tribe.push("GG");const t=this.boof234;this.text=`When an adjacent creature is destroyed, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}ggwD(t,e){if(e.creature.owner===t.owner){const i=g.jr5(t.creatId);if(i.adjacent.includes(e.creature.lane)){const s=this.boof234;i.buff(s,s),this.logAct(!1)}}}mhermC(){this.faction="U",this.rarity="L",this.name="Malice Hermit",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("YT");const t=this.boof124;this.text=`Forge: Each other creature gets Poison ${t}.~When a creature with Poison is destroyed, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}mhermD(t,e){if(e.creature.poison>0){const i=this.boof124,s=g.jr5(t.creatId);this.logAct(!1,e.creature),s.buff(i,i)}}ngauntC(){this.faction="N",this.rarity="R",this.name="Nightgaunt",this.iAttack=this.boof4815,this.iHealth=this.iAttack+1,this.tribe.push("GG"),this.text=`When a creature is destroyed, ${this.name} gets Regenerate 1.`,this.trigB=this.regnNug(2)}ngauntD(t,e){g.jr5(t.creatId).addRegen(1)}sharvC(){this.faction="N",this.rarity="C",this.name="Sorrow Harvester",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("AB"),this.text="When a friendly Abomination is destroyed on your turn, draw a card.",this.trigB=this.rawNug(0,0,0,0,lt.dcWeight)}sharvD(t,e){const i=e.creature;i.owner===t.owner&&i.isTribe("AB")&&k.getActiveB()===t.owner&&Ft.itDiedFirst(i.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"),this.level===1&&(this.hints=["ZZ-1"]);const t=L.getCard(this.syc());this.text=`When an adjacent non-Spirit creature is destroyed, put a ${p.tokName(t)} into that lane.`,this.trigB=this.spawnNug(t)}yuruD(t,e){const i=g.jr5(t.creatId),s=e.creature;s.owner===i.owner&&i.adjacent.includes(s.lane)&&!s.isTribe("ST")&&Ft.itDiedFirst(s.id,i.id)&&g.birth(this.syc(),"P",i.owner,s.lane)}syc(){return "XYR"+this.level}static itDiedFirst(t,e){if(t===e)return!0;let i=!1;const s=W.findDeathTime(e);if(S.isUn(s))i=!0;else{const h=W.findDeathTime(t);(S.isUn(h)||h<=s)&&(i=!0)}return i}}class xr extends Ft{jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){if(t.trigger.type==="FR"){const e=g.creatByTarget(y.crNotMeTarg(t.creatId)),i=this.boof124;e.forEach(s=>s.addPoison(i)),x.triggerDone()}else super.jr8(t)}}class Br extends kt{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metatransfer",this.text=`Give a creature ${p.jr9(-this.boof579,0)}.~Discard and level up a card.`}playTargets(){const t=super.playTargets(),e=y.crActTarg("CARD",this.code,"P1");return e.hint=["DB"],t.push(e),t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=y.lvlHandActTarg(this.code,S.enTil("P2",i.id));s.deckPositionSkip=T.playPosition();const h=D.toActions(s);h.length===0?(this.logSpell(i),i.buff(-this.boof579,0),T.spellCast()):(h.push(T.cancelAction()),T.ddf5(h))}else{const i=g.jr5(e[1]);this.logSpell(i),i.buff(-this.boof579,0);const s=t;T.shiftPlayCard(s.position),E.levelAndDiscardA(s),T.spellCast()}}}class Hr 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.`,this.bonus={activ8:this.statSpawnNug(this.iAttack,this.iHealth)}}canActivate(t){return T.emptyAdjacents(t,"").length>0}startActivation(t){const e=T.emptyAdjacents(t,"");e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);g.birth(e.code,"P",t.playerA,t.lane),e.endActivation()}}class Nr 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 i=super.jr3(t,e);if(this.level>1){const s=i.jr4("FR");s.interactive=!0}return i}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")if(this.level===3){this.wurmsign(2,t);const i=[t.lane,parseInt(e[1])],s=this.fieldActions("P2",i);T.ddf5(s)}else this.wurmsign(1,t),T.actionDone(!0);else this.wurmsign(1,t),T.actionDone(!0)}jr8(t){const e=$.toCreature(t.event);T.ddf5(this.fieldActions("P1",[e.creature.lane]))}fieldActions(t,e){const i=y.actionTarget("TF","CARD",this.code,S.enTil(t,e[0]));i.player="F",i.hint=["FL"],i.lanes=g.laneIdx.filter(h=>!e.includes(h));const s=D.toActions(i);return s.push(T.noneEndTrigger()),s}wurmsign(t,e){g.birth(this.wurmCode(t),"R",e.playerA,e.lane)}wurmCode(t){return`${"MMW"}${t}`}}class oe extends kt{lookup(t){return{["BRN"]:{c:()=>this.boutC(),z:(i,s)=>this.burner(i,s,8)},["IFL"]:{c:()=>this.izfmC(),z:(i,s)=>this.burner(i,s,this.boof6915)},["LSK"]:{c:()=>this.lspkC(),z:(i,s)=>this.burner(i,s,this.boof6812)},["LYR"]:{c:()=>this.rainC(),z:(i,s)=>this.rainZ(i,s)},["SOK"]:{c:()=>this.sealkC(),z:(i,s)=>this.burner(i,s,this.sealzap)},["STB"]:{c:()=>this.shatC(),z:(i,s)=>this.shatZ(i,s)},["SHK"]:{c:()=>this.shkC(),z:(i,s)=>this.shkZ(i,s)}}[t]}cardCast(t,e,i){this.lookup(t).z(e,i)}hurts=!0;burner(t,e,i){e?t.hurtDirect(i,this.code):k.hurtDirect(t,i,this.code)}burnText(t){return`Deal ${t} damage to a creature or player.`}constructor(t){super(t),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets(),e=this.hurts?["HR"]:["BF"],i=y.crActTarg("CARD",this.code,"");i.hint=e;const s=y.actionTarget("TP","CARD",this.code,"");return s.hint=e,t.push(i,s),t}handleAction(t){let e,i;t.zone==="P"?(this.logSpell(),e=!1,i=t.playerA):(i=g.ddf6(t),this.logSpell(this.hurts?void 0:i),e=!0),this.cardCast(this.cardCode(),i,e),T.spellCast()}boutC(){this.faction="T",this.rarity="R",this.name="Burnout",this.overload=!0,this.maxLevel=1,this.text=this.burnText(8)}izfmC(){this.faction="T",this.rarity="T",this.name="Iztek's Flame";const t=this.boof6915;this.addSp("D",t),this.text=this.burnText(t)}lspkC(){this.faction="T",this.rarity="C",this.name="Lightning Spark";const t=this.boof6812;this.addSp("D",t),this.text=this.burnText(t)}rainC(){this.faction="U",this.rarity="C",this.name="Lysian Rain",this.hurts=!1;const t=this.boof7911;this.addSp("H",t),this.text=`Give a creature or player +${t} health.`}rainZ(t,e){const i=this.boof7911;e?t.buff(0,i):k.heal(t,i)}sealkC(){this.faction="T",this.rarity="C",this.name="Seal of Kadras",this.level<3&&(this.hints=["LG"]),this.consistent=this.level>1;const t=this.sealzap;this.addSp("D",t),this.consistent&&this.addSp("C",0),this.text=this.burnText(t)}get sealzap(){return this.lValN([1,2,25])}shatC(){this.faction="T",this.rarity="C",this.name="Shatterbolt";const t=this.boof5914;this.addSp("D",t),this.text=`Negate Armor from a creature or player this turn, then deal ${t} damage to that creature or player.`}shatZ(t,e){const i=this.boof5914,s=y.mod("NA",!0);if(s.expiry="ET",e){const h=t;h.addMod(s),h.hurtDirect(i,this.code)}else{const h=k.toPlayer(t);k.addMod(h,s),k.hurtDirect(h,i,this.code)}}shkC(){this.faction="T",this.rarity="H",this.name="Static Shock";const t=this.boof124;this.addSp("D",t),this.hints=["ZZ+1"],this.text=`${this.burnText(t)} You may play an additional ${p.levelGateText(this.level,!0)}spell this turn.`}shkZ(t,e){this.burner(t,e,this.boof124);const i=E.freeCard(this.code);i.condition.level=D.ddf2(this.level),i.condition.card="S"}}class Fr 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"),this.hints=["ZZ-2"];const e=L.getCard(this.spc());this.text=`Activate: Put a ${p.tokName(e)} into an available lane.~Forge: Destroy a friendly creature.`,this.bonus={activ8:this.spawnNug(e)}}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}canActivate(t){return this.empties(t).length>0}startActivation(t){const e=this.empties(t);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){this.logAct(!0);const i=g.jr5(e[1]);g.birth(this.spc(),"P",t.playerA,t.lane),i.endActivation()}else{const i=g.ddf6(t);W.destroy(i,this.code),T.actionDone(!0)}}jr8(t){const e=y.crFriendActTarg("CARD",this.code,""),i=D.toActions(e);T.ddf5(i)}spc(){return "SPN"+this.level}empties(t){const e=y.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P1",t.id));return D.toActions(e)}}class Pr 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 ${p.levelGateText(this.level,!0)}creature.`}image(t){return this.rawImage(`${"NSH"}${this.level}`,t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FK");return s.bonus=this.multNug(this.avgSpawnNug(),.5),i.jr4("EF"),i}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const i=$.toCreature(t.event).creature.opposed;i&&D.levelTestCommon(i.level,this.level)&&W.destroy(i,this.code),x.triggerDone()}}class Mr extends ke{enforceEffect(t,e){e.lane===3?e.removeModSafe(e.id):e.addModSafe(y.mod("AR",this.boof236,e.id)),super.enforceEffect(t,e)}}class Rr 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,i=this.lValS(["an adjacent","each adjacent","each","each"]);this.text=`Forge: Put a 1/1 Seedling into ${i} available space.~When a friendly creature is replaced, Nova gets ${p.jr9(e,e)}.`}get nbuf(){return this.lValN([1,3,5,10])}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");this.level===1&&(s.interactive=!0);const h=i.jr4("RP"),f=this.nbuf;return h.bonus=this.buffNug(f,f),i}ddf8(t){const e=$.toReplaced(t.event);return t.creatId!==e.replCreatId&&t.owner===e.replCreat.owner}jr8(t){const e=g.jr5(t.creatId);if(t.event.code==="RPL"){const i=this.nbuf;e.buff(i,i),x.triggerDone()}else{const i=g.emptyLanes(t.owner);if(this.level>1){const s=this.level===2?e.adjacent.filter(f=>i.includes(f)):i,h=R.tick();s.forEach(f=>{g.birth(this.seed,"P",e.owner,f,h)}),x.triggerDone()}else{const s=e.adjacent.filter(h=>i.includes(h));if(s.length===0)x.triggerDone();else if(s.length===1)g.birth(this.seed,"P",e.owner,s[0]),x.triggerDone();else{const h=T.emptyAdjacents(e,"");T.ddf5(h)}}}}handleAction(t){g.birth(this.seed,"P",t.playerA,t.lane),T.actionDone(!0)}get seed(){return "NSD"+this.level}}class Er extends kt{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const e=this.boof246,i=e*-1;this.text=`Give a friendly Zombie ${p.jr9(e,e,!0)}, and Regenerate ${e}.~Then give an enemy non-Zombie ${p.jr9(i,i)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");e.tribe="ZB",t.push(e)}return t}handleAction(t){const e=S.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=T.cancelAction(),h=this.nonZombies(i.id);h.push(s),T.ddf5(h)}else{const s=g.jr5(e[1]);this.logSpell(s,i);const h=this.boof246;s.buff(h,h),s.addRegen(h),i.buff(-h,-h),T.spellCast()}}nonZombies(t=""){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(e).filter(i=>{const s=i;return!g.ddf6(s).isTribe("ZB")})}}class Ir 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={activ8:this.rawNug(0,0,0,0,.5)}}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){return k.toPlayer(t.owner).hand.some(i=>L.getCard(i).canLevel())}startActivation(t){const e=y.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);E.levelAndDiscardA(t),e.endActivation()}jr8(t){E.allied("N")&&g.jr5(t.creatId).addRegen(this.boof358),x.triggerDone()}}class Lr 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 ${p.jr9(e,0)}`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){return t.hasMod(t.id)}startActivation(t){const e=y.crActTarg("CARD",this.code,t.id);e.hint=["DF","DB"];const i=D.toActions(e);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const e=g.jr5(t.param),i=g.ddf6(t);this.logAct(!0,i),i.buff(this.boof4812n,0),e.endActivation()}jr8(t){if(E.allied("A")){const e=g.jr5(t.creatId);e.addMod(y.mod("AL",!0,e.id)),e.changed=!0;const i=e.jr4("PT");i.bonus=this.buffNug(this.boof4812,0)}x.triggerDone()}}class Gr extends kt{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Oratek Battlebrand";const e=this.boof71013;this.addSp("D",e),this.text=`Deal ${e} damage to a creature.~Allied Alloyin: You may discard a card and level it.`}playTargets(){const t=super.playTargets(),e=y.crActTarg("CARD",this.code,"");return e.hint=["HR"],t.push(e),t}handleAction(t){if(t.zone==="F"){const e=t,i=g.ddf6(e);if(this.logSpell(),i.hurtDirect(this.boof71013,this.code),E.allied("A")){const s=this.levelActs();s.length===1?T.spellCast():T.ddf5(s)}else T.spellCast()}else if(t.zone==="H"){const e=t;T.shiftPlayCard(e.position),E.levelAndDiscardA(e),T.spellCast()}else t.zone==="B"&&t.param==="NOTR"?T.spellCast():super.handleAction(t)}levelActs(){const t=y.actionTarget("TB","CARD",this.code,"NOTR"),e=y.lvlHandActTarg(this.code,"");return e.deckPositionSkip=T.playPosition(),D.toActions([e,t])}}class $r 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} ${p.dbdtap()} on your turn, you may discard and level up a card.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.bonus=this.rawNug(0,0,0,0,.5),i}handleAction(t){E.levelAndDiscardA(t),T.actionDone(!0)}ddf8(t){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}jr8(t){if(t.trigger.type==="FR"){if(E.allied("A")){const e=g.jr5(t.creatId),i=e.jr4("DM");i.interactive=!0,e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=D.toActions(y.lvlHandActTarg(this.code,""));e.length>0?(e.push(T.noneEndTrigger()),T.ddf5(e)):x.triggerDone()}}}class Ye extends P{hitCreature;constructor(t,e){super(t),this.hitCreature=e}trigB;jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.trigB,i}ddf8(t){return t.event.battle&&t.event.isCreatTarg===this.hitCreature&&t.event.isCreatSrc&&t.event.srcId===t.creatId}}class Wr extends Ye{constructor(t){super(t,!1),this.faction="U",this.rarity="L",this.name="Oros, Deepwood's Chosen",this.iAttack=this.lValN([7,11,16,0]),this.iHealth=this.iAttack,this.iBT=!0,this.maxLevel=4,this.tribe.push("FB"),this.hints=["OL"];const e=`When Oros ${p.dbdtap()}, you gain that much health.`,i=this.level===4?"Oros gets +attack and +health equal to your health.~":"";this.text=i+e}jr3(t,e){const i=super.jr3(t,e);return this.level===4&&i.addEffect("PH",this.code),i}jr8(t){const e=t.event;k.heal(t.owner,e.dmg),x.triggerDone()}enforceEffect(t,e){const i=k.toPlayer(e.owner).health;e.status==="A"&&(e.removeModSafe(e.id),e.addModSafe(y.mod("HL",i,e.id)),e.addModSafe(y.mod("MH",i,e.id)),e.addModSafe(y.mod("AT",i,e.id)))}}class Vr extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Othra, Apex Predator",this.iAttack=this.lValN([8,0,10]),this.iHealth=this.lValN([6,12,50]),this.tribe.push("IN"),this.level===3?(this.iMobile=1,this.text="When Othra deals battle damage to a creature or player, they get Poison 10.",this.hints=["ZZ-5"]):(this.text=`Gain Rank: Replace this with a level ${this.level+1} Othra.`,this.hints=["TL"],this.level===2?this.iDefend=!0:this.hints.push("ZZ-1"))}jr3(t,e){const i=super.jr3(t,e);if(this.level===3){const s=i.jr4("DM");s.bonus=this.regnNug(10)}else{const s=i.jr4("RU");s.bonus=this.regnNug(this.level)}return i}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatSrc&&e.srcId===t.creatId}return t.trigger.type==="RU"?t.event.playerA===t.owner:!1}jr8(t){if(t.trigger.type==="RU"){const e=g.jr5(t.creatId);g.birth(this.levelUpCard(),"R",e.owner,e.lane)}else if(t.trigger.type==="DM"){const e=$.toDamage(t.event);e.isCreatTarg?e.hurtCreat.addPoison(10):e.hurtPlayer.poison+=10}x.triggerDone()}}class Ur 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 i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!this.l3,i}jr8(t){if(this.l3)g.creatByTarget(y.crEnemyTarg()).forEach(e=>{e.negateArmor=!0}),x.triggerDone();else{const e=y.crEnemyActTarg("CARD",this.code,""),i=D.toActions(e);i.length>0?T.ddf5(i):x.triggerDone()}}handleAction(t){const e=g.ddf6(t);this.logAct(!1,e),e.negateArmor=!0,T.actionDone(!0)}}class ee extends P{lookup(t){return{["AFS"]:{c:()=>this.afsC(),a:i=>this.afsA(i),t:i=>this.afsT(i)},["DMW"]:{c:()=>this.drixC(),a:i=>this.drixA(i),t:i=>this.drixT(i)},["FGG"]:{c:()=>this.fggC(),a:i=>this.fggA(i),t:i=>this.fggT(i)},["GHS"]:{c:()=>this.mvpC(),a:i=>this.mvpA(i),t:i=>this.mvpT(i)},["MMG"]:{c:()=>this.mmgC(),a:i=>this.mmgA(i),t:i=>this.mmgT(i)},["OWW"]:{c:()=>this.owwC(),a:i=>this.owwA(i),t:i=>this.owwT(i)},["UPM"]:{c:()=>this.upakC(),a:i=>this.upakA(i),t:i=>this.upakT(i)},["WFM"]:{c:()=>this.wfmC(),a:i=>this.wfmA(i),t:i=>this.wfmT(i)},["XTE"]:{c:()=>this.xerxC(),a:i=>this.xerxA(i),t:i=>this.xerxT(i)}}[t]}runAct(t,e){this.lookup(t).a(e)}testAct(t,e){return this.lookup(t).t(e)}constructor(t){super(t),this.lookup(this.cardCode()).c()}preFight=!1;prePlay=!1;canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){const e=D.boardTarget("CARD",this.code);e.param=t.id,this.preFight&&(e.hint=["BB"]),this.prePlay&&(e.hint=["DF"]),T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);this.runAct(this.cardCode(),e),e.endActivation()}afsC(){this.faction="A",this.rarity="L",this.name="Arcflight Squadron",this.iAttack=this.boof4710,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.hints=["OL",this.level===1?"ZZ-3":"ZZ-2"],this.prePlay=!0,this.text=`Activate: You may play an additional ${p.levelGateText(this.level,!0)}Robot this turn.`,this.bonus={activ8:this.avgSpawnNug()}}afsT(t){return!0}afsA(t){const e=E.freeCard(this.code);e.condition.tribe="RB",e.condition.level=D.ddf2(this.level)}drixC(){this.faction="A",this.rarity="L",this.name="Drix, the Mindwelder",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,12,21]),this.tribe.push("MM"),this.preFight=!0,this.addSp("A",this.level),this.text=`Activate, discard your hand: Each friendly Metamind gets ${p.jr9(this.level,0)} for each card discarded this way.`,this.bonus={activ8:this.buffNug(3*this.level,0)}}drixT(t){return k.getActive().hand.length>0}drixA(t){const e=k.toPlayer(t.owner),i=e.hand.length*this.level;e.discard.push(...e.hand),e.hand=[];const s=y.crFriendTarg();s.tribe="MM",g.creatByTarget(s).forEach(h=>{h.buff(i,0)})}fggC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Gamma",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("RB","GD"),this.preFight=!0;const t=L.getCard(Z.fgoc(this.level));this.addSp("N",t.iAttack),this.text=`Activate, destroy five friendly Robot Guardians: Put a ${p.tokName(t)} into this lane.`,this.bonus={activ8:this.rawNug(0,0,0,0,1)}}fggT(t){return g.creatByTarget(this.fggTarg()).length===5}fggA(t){const e=t.lane,i=t.owner,s=R.tick();g.creatByTarget(this.fggTarg()).forEach(h=>W.destroy(h,this.code,s)),g.birth(Z.fgoc(this.level),"P",i,e)}fggTarg(){const t=y.crFriendTarg();return t.tribe="GD",t}mvpC(){this.faction="U",this.rarity="C",this.name="Gemheart Sprout",this.iAttack=this.boof357,this.iHealth=this.iAttack+this.level,this.iDefend=!0,this.tribe.push("PL"),this.preFight=!0,this.addSp("L",this.level),this.text=`Activate: You gain health equal to ${this.level}x the number of friendly creatures.`,this.bonus={activ8:this.playerNug(this.level*3)}}mvpT(t){return!0}mvpA(t){const e=g.ddf1().length;k.heal(t.owner,e*this.level)}mmgC(){this.faction="A",this.rarity="L",this.name="Marty McGear",this.iAttack=this.boof3612,this.iHealth=this.boof71117,this.tribe.push("GN"),this.hints=[this.lValH(["ZZ-2","ZZ-2","ZZ-5"])],this.addSp("A",this.level),this.addSp("M",this.level),this.text=`Activate: Spawn a copy of a random ${p.levelGateText(this.level,!0)}Robot from your deck. That Robot gets ${p.jr9(this.level,0)} and Armor ${this.level}.`,this.bonus={activ8:this.avgSpawnNug()}}mmgT(t){return g.ddf1().length<5&&this.mmgBots().length>0}mmgA(t){const e=this.mmgBots(),i=e[S.randInt(0,e.length)],s=g.birth(i,"S",t.owner);s&&(s.addArmor(this.level),s.buff(this.level,0))}mmgBots(){const t=y.target("DK");return t.player="F",t.tribe="RB",t.level=D.ddf2(this.level),D.deckByTarget(t).map(i=>i[0])}owwC(){this.faction="A",this.rarity="L",this.name="Oreian Warwalker",this.iAttack=this.boof359,this.iHealth=this.boof61018,this.tribe.push("RB"),this.preFight=!0;const t=this.owwbuff+1;this.addSp("A",t),this.text=`Activate: ${this.name} gets ${t}x attack.`,this.bonus={activ8:this.buffNug(2*this.iAttack,0)}}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}upakC(){this.faction="U",this.rarity="L",this.name="Uterra Packmaster",this.iAttack=this.boof6914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.preFight=!0;const t=this.boof124;this.addSp("U",t),this.text=`Activate: Each other friendly Uterra creature gets ${p.jr9(t,t)}.`,this.bonus={activ8:this.multNug(this.buffNug(t,t),1.5)}}upakT(t){return g.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const e=this.boof124;g.creatByTarget(this.upakTarg(t.id)).forEach(i=>{i.buff(e,e)})}upakTarg(t){const e=y.crFriendNotMeTarg(t);return e.faction="U",e}wfmC(){this.faction="T",this.rarity="H",this.name="Wildfire Maiden",this.iAttack=this.boof4610,this.iHealth=this.boof5814,this.tribe.push("FR","AS"),this.text=`Activate, destroy ${this.name}: Deal damage equal to its attack to each enemy creature.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}wfmT(t){return!0}wfmA(t){const e=R.tick();g.creatByTarget(y.crEnemyTarg()).forEach(i=>{i.hurtDirect(t.attack,this.code,e)}),W.destroy(t,this.code)}xerxC(){this.faction="N",this.rarity="L",this.name="Xerxes, the Executioner",this.iAttack=this.boof5915,this.iHealth=this.iAttack+2,this.tribe.push("GG");const t=-this.boof135;this.addSp("U",t),this.text=`Activate: Each non-Nekrium creature gets ${p.jr9(t,t)}.~If any enemy creatures are destroyed this way, Spawn one of them at random.`,this.bonus={activ8:this.buffNug(-t,-t)}}xerxT(t){return this.xerxTargs().length>0}xerxA(t){const e=-this.boof135,i=[],s=R.tick();this.xerxTargs().forEach(f=>{f.buff(e,e,s),f.owner!==t.owner&&f.health<1&&i.push(f)});const h=i.length;h>0&&g.birth(i[S.randInt(0,h)].code,"S",t.owner)}xerxTargs(){return g.qActiveCreats().filter(t=>t.faction!=="N")}}class oi extends P{lookup(t){return{["MDE"]:{c:()=>this.misdC(),f:i=>this.misdF(i)},["TAB"]:{c:()=>this.thraC(),f:i=>this.thraF(i)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e);return i.jr4("AS"),i}jr8(t){this.cardForge(this.cardCode(),t),x.triggerDone()}misdC(){this.faction="N",this.rarity="C",this.name="Misery Demon",this.iAttack=this.boof5915,this.iHealth=this.boof2510,this.tribe.push("DM"),this.hints=["OL"];const t=this.level+3;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health.`}misdF(t){const e=this.level+3;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 ${p.jr9(t,t)}.`}thraF(t){const e=this.boof234;g.jr5(t.creatId).buff(e,e)}}class bt extends P{lookup(t){return{["ATT"]:{c:()=>this.atorC(),t:(i,s)=>this.atorT(i,s),b:(i,s)=>this.atorB(i,s)},["BRH"]:{c:()=>this.brhrC(),t:(i,s)=>this.brhrT(i,s),b:(i,s)=>this.brhrB(i,s)},["DHM"]:{c:()=>this.dhamC(),t:(i,s)=>this.donkforgeT(i,s),b:(i,s)=>this.donkforgeB(i,s)},["FGD"]:{c:()=>this.fgdC(),t:(i,s)=>this.fgdT(i,s),b:(i,s)=>this.fgdB(i,s)},["FSP"]:{c:()=>this.fspC(),t:(i,s)=>this.fspT(i,s),b:(i,s)=>this.fspB(i,s)},["HMF"]:{c:()=>this.hamfC(),t:(i,s)=>this.hamfT(i,s),b:(i,s)=>this.hamfB(i,s)},["HOD"]:{c:()=>this.haroldC(),t:(i,s)=>this.ocarT(i,s),b:(i,s)=>this.haroldB(i,s)},["OJC"]:{c:()=>this.ocarC(),t:(i,s)=>this.ocarT(i,s),b:(i,s)=>this.ocarB(i,s)},["RLW"]:{c:()=>this.restwandC(),t:(i,s)=>this.restwandT(i,s),b:(i,s)=>this.restwandB(i,s)},["RHW"]:{c:()=>this.ruthwandC(),t:(i,s)=>this.restwandT(i,s),b:(i,s)=>this.ruthwandB(i,s)},["SCZ"]:{c:()=>this.sczC(),t:(i,s)=>this.donkforgeT(i,s),b:(i,s)=>this.donkforgeB(i,s)},["SHA"]:{c:()=>this.smaC(),t:(i,s)=>this.donkforgeT(i,s),b:(i,s)=>this.donkforgeB(i,s)},["SSP"]:{c:()=>this.shspC(),t:(i,s)=>this.shspT(i,s),b:(i,s)=>this.shspB(i,s)},["SDR"]:{c:()=>this.spdryC(),t:(i,s)=>this.spdryT(i,s),b:(i,s)=>this.spdryB(i,s)},["TDW"]:{c:()=>this.tdwC(),t:(i,s)=>this.tdwT(i,s),b:(i,s)=>this.tdwB(i,s)},["TNL"]:{c:()=>this.tnlC(),t:(i,s)=>this.tnlT(i,s),b:(i,s)=>this.tnlB(i,s)},["USY"]:{c:()=>this.usyC(),t:(i,s)=>this.donkforgeT(i,s),b:(i,s)=>this.donkforgeB(i,s)},["UTR"]:{c:()=>this.urexC(),t:(i,s)=>this.urexT(i,s),b:(i,s)=>this.urexB(i,s)}}[t]}testBirth(t,e){return this.lookup(t).t(e,$.toEnterField(e.event))}actBirth(t,e){this.lookup(t).b(e,$.toEnterField(e.event))}iTrigger=!0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);if(this.iTrigger){const s=i.jr4("EF");s.bonus=this.trigB}return i}ddf8(t){return this.testBirth(this.cardCode(),t)}jr8(t){this.actBirth(this.cardCode(),t),x.triggerDone()}donkforgeT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("DF")}donkforgeB(t,e){const i=g.jr5(t.trigger.creatId);this.logAct(!1),i.buff(this.level,this.level)}dftxt(){this.text=`When another friendly Darkforged enters play, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),.5)}atorC(){this.faction="T",this.rarity="L",this.name="Ator, Thunder Titan",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("GT"),this.text=`Each another friendly ${p.levelGateText(this.level,!0)}creature gets Assault: Aggressive.`,this.trigB=this.rawNug(0,0,0,0,.5)}atorT(t,e){const i=e.creature;return e.forged&&t.trigger.creatId!==i.id&&i.owner===t.owner&&D.levelTargetTest(D.ddf2(this.level),i.level)&&!i.opposed}atorB(t,e){e.creature.aggressive=!0}brhrC(){this.faction="N",this.rarity="R",this.name="Brood Horror",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("AB"),this.text=`When another friendly creature enters play, it gets ${p.jr9(this.level,this.level)}. Then ${this.name} gets ${p.jr9(-this.level,-this.level)}.`}brhrT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}brhrB(t,e){bt.itBirthedFirst(e.creature.id,t.creatId)&&(this.logAct(!1,e.creature),e.creature.buff(this.level,this.level),g.jr5(t.creatId).buff(-this.level,-this.level))}dhamC(){this.faction="U",this.rarity="R",this.name="Dusk Hammer",this.iAttack=this.boof51015,this.iHealth=this.boof4812,this.iBT=!0,this.tribe.push("DF","TK"),this.dftxt()}fgdC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Delta",this.iAttack=this.boof71117,this.iHealth=this.iAttack,this.tribe.push("RB","GD");const t=L.getCard(Z.fgoc(this.level));this.text=`When ${this.name} enters play, if there is a friendly Alpha Beta, and Gamma, put a ${p.tokName(t)} in your discard pile.`}fgdT(t,e){return e.creature.id===t.creatId}fgdB(t,e){const i=y.crTarg();i.player=k.toTarget(t.owner);const s=g.creatByTarget(i).map(h=>h.code.slice(0,3));if(s.includes("FGA")&&s.includes("FGB")&&s.includes("FGG")){const h=k.toPlayer(t.owner);h.discard.push(Z.fgoc(this.level));const f=y.trigger("NT",this.code);f.bonus=this.rawNug(0,0,0,0,10),h.triggers.push(f)}}fspC(){if(this.faction="A",this.rarity="L",this.name="Flowsteel Prototype",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.lValN([8,15,20]),this.tribe.push("SS"),this.iTrigger=this.level>1,this.iTrigger){const t=p.levelGateText(this.level-1);this.text=`When you Forge a ${t} creature, ${this.name} gets +attack equal to that creature's attack.`;const e=this.avgCreatureStats(this.level-1);this.trigB=this.buffNug(e[0],0)}}fspT(t,e){return!!(e.forged&&e.creature.owner===t.owner&&L.getCard(e.creature.code).level0&&g.jr5(t.creatId).move(i[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.`,this.trigB=this.playerNug(this.iAttack*.5)}haroldB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const i=g.jr5(t.creatId);k.hurtDirect(!i.owner,i.attack,this.code)}}ocarC(){this.faction="A",this.rarity="H",this.name="Oreian Justicar",this.iAttack=this.boof5814,this.iHealth=this.boof81220,this.tribe.push("HM");const t=this.ocarbuff;this.text=`When an enemy creature enters play, if it wasn't Forged, it gets ${p.jr9(t,0)}.`,this.trigB=this.buffNug(-.5*t,0)}ocarT(t,e){return e.creature.owner!==t.owner&&!e.forged}ocarB(t,e){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 ${p.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),.5)}restwandT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("WD")}restwandB(t,e){const i=g.jr5(t.trigger.creatId),s=this.boof369;this.logAct(!1),i.buff(s,s)}ruthwandC(){this.faction="N",this.rarity="C",this.name="Ruthless Wanderers",this.iAttack=this.boof3610,this.iHealth=this.boof51014,this.tribe.push("ST","WD");const t=this.boof369,e=-t;this.text=`When another friendly Spirit Wanderer enters play, the creature opposing this gets ${p.jr9(e,e)}.`,this.trigB=this.multNug(this.buffNug(t,t),.5)}ruthwandB(t,e){const s=g.jr5(t.trigger.creatId).opposed;if(s){const h=-this.boof369;this.logAct(!1,s),s.buff(h,h)}}sczC(){this.faction="N",this.rarity="R",this.name="Shadeclaw Zombie",this.iAttack=this.boof4812,this.iHealth=this.iAttack+this.level,this.iRegen=this.level,this.tribe.push("DF","ZB"),this.dftxt()}smaC(){this.faction="A",this.rarity="R",this.name="Shadowmist Angel",this.iHealth=this.boof369,this.iAttack=this.iHealth*2,this.iArmor=this.level,this.tribe.push("DF","AG"),this.dftxt()}shspC(){this.faction="U",this.rarity="H",this.name="Shroudthorn Splicer",this.iHealth=this.boof3711,this.iAttack=this.iHealth-1,this.tribe.push("DF","PL"),this.text=`When another friendly Darkforged enters play, if it was Forged, Spawn a ${this.iAttack}/${this.iHealth} Darkforged Mimic.`,this.trigB=this.statSpawnNug(this.iAttack,this.iHealth)}shspT(t,e){return t.creatId!==e.creatId&&e.forged&&e.creature.owner===t.owner&&e.creature.isTribe("DF")}shspB(t,e){bt.itBirthedFirst(e.creature.id,t.creatId)&&g.birth("DFM"+this.level,"S",t.owner)}spdryC(){this.faction="U",this.rarity="R",this.name="Spring Dryad",this.iAttack=this.boof469,this.iHealth=this.iAttack,this.tribe.push("DY"),this.text=`When a friendly creature enters play, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),1.5)}spdryT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}spdryB(t,e){g.jr5(t.trigger.creatId).buff(this.level,this.level)}tdwC(){this.faction="N",this.rarity="R",this.name="Tarsus Deathweaver",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof246;this.text=`When a friendly creature enters play, if it wasn't Forged, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}tdwT(t,e){return e.creature.owner===t.owner&&!e.forged}tdwB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const i=this.boof246;e.creature.buff(i,i)}}tnlC(){this.faction="N",this.rarity="L",this.name="Tarsus Necrolord",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof124,e=L.getCard(Z.zomc(this.level));this.text=`Forge: Spawn a ${p.tokName(e)} for each friendly creature that was destroyed this turn.~When a friendly Zombie enters play, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}tnlT(t,e){return e.creature.owner===t.owner?e.creature.isTribe("ZB"):!1}tnlB(t,e){const i=g.jr5(t.trigger.creatId),s=this.boof124;i.buff(s,s)}usyC(){this.faction="T",this.rarity="R",this.name="Umbraskin Yeti",this.iAttack=this.boof369,this.iHealth=this.iAttack*2,this.iMobile=this.level,this.tribe.push("DF","YT"),this.dftxt()}urexC(){this.faction="U",this.rarity="H",this.name="Uterradon Rex",this.iAttack=this.boof4813,this.iHealth=this.boof71118,this.tribe.push("DN");const t=this.boof124;this.text=`When another friendly Dinosaur enters play, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}urexT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("DN")}urexB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const i=this.boof124;e.creature.buff(i,i)}}static itBirthedFirst(t,e){if(t===e)return!0;let i=!1;const s=W.findDeathTime(e);if(S.isUn(s))i=!0;else{const h=g.findBirthTime(t);(S.isUn(h)||h<=s)&&(i=!0)}return i}}class he extends Ye{lookup(t){return{["AGM"]:{c:()=>this.agamC(),h:(i,s,h,f)=>this.agamH(i,s,h,f)},["BWK"]:{c:()=>this.blwalkC(),h:(i,s,h,f)=>this.blwalkH(i,s,h,f)},["BRF"]:{c:()=>this.bfangC(),h:(i,s,h,f)=>this.bfangH(i,s,h,f)},["CDT"]:{c:()=>this.cadtC(),h:(i,s,h,f)=>this.cadtH(i,s,h,f)},["GSC"]:{c:()=>this.gcobC(),h:(i,s,h,f)=>this.gcobH(i,s,h,f)},["IHA"]:{c:()=>this.ibhaC(),h:(i,s,h,f)=>this.ibhaH(i,s,h,f)},["SHS"]:{c:()=>this.shimfC(),h:(i,s,h,f)=>this.shimfH(i,s,h,f)}}[t]}image(t){return this.rarity==="T"?this.fixedImage(t):this.leveledImage(t)}cardConstruct(t){this.hints=["OP"],this.lookup(t).c()}creatHit(t,e,i,s,h){this.lookup(t).h(e,i,s,h)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const e=$.toDamage(t.event);this.creatHit(this.cardCode(),t,e,e.srcCreat,e.hurtCreat),x.triggerDone()}agamC(){this.faction="T",this.rarity="L",this.name="Agamemnon",this.iAttack=this.boof4814,this.iHealth=this.lValN([8,12,18]),this.level>1&&(this.iMobile=1,this.iAggro=this.level===3),this.tribe.push("GT"),this.text=`When ${this.name} ${p.dbdtac()} on your turn, this battles again.`,this.trigB=this.buffNug(this.iAttack/2,0)}agamH(t,e,i,s){t.owner===k.getActiveB()&&(i.extraBattles+=1)}blwalkC(){this.faction="N",this.rarity="R",this.name="Blight Walker",this.iAttack=this.boof137,this.iHealth=this.lValN([5,10,17]),this.tribe.push("ZB"),this.text=`When ${this.name} ${p.dbdtac(this.level)}, destroy that creature.`,this.trigB=this.avgSpawnNug()}blwalkH(t,e,i,s){s.status==="A"&&D.levelTestCommon(s.level,this.level)&&W.destroy(s,this.code)}bfangC(){this.faction="U",this.rarity="T",this.name="Broodfang",this.iAttack=this.level,this.iHealth=this.level,this.maxLevel=this.level,this.minLevel=this.level,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}bfangH(t,e,i,s){s.addPoison(this.iAttack)}poisonText(t){return`When ${this.name} ${p.dbdtac()}, give that creature gets Poison ${t}.`}cadtC(){this.faction="U",this.rarity="R",this.name="Cadaverous Thicket",this.iAttack=this.boof135,this.iHealth=this.lValN([7,12,22]),this.tribe.push("PL"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}cadtH(t,e,i,s){s.addPoison(this.iAttack)}gcobC(){this.faction="U",this.rarity="C",this.name="Ghostscale Cobra",this.iAttack=this.boof4610,this.iHealth=this.boof135,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}gcobH(t,e,i,s){s.addPoison(this.iAttack)}ibhaC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Hammer of Anvillon",this.iAttack=this.lValN([4,7,12,15]),this.iHealth=this.lValN([7,11,17,25]),this.iArmor=this.lValN([1,3,5,20]),this.tribe.push("FB"),this.maxLevel=4;const t=this.level===4?"'s attack gets reduced to 0":` gets ${p.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${p.dbdtac()}, that creature${t}, and moves to an available enemy lane at random.`,this.trigB=this.buffNug(this.lValN([2,4,6,16]),0)}ibhaH(t,e,i,s){if(s.status==="A"){const h=this.level===4?s.attack*-1:this.boof246n;s.buff(h,0);const f=g.emptyLanes(s.owner),m=f.length;m>0&&(this.logAct(!1,s),s.move(f[S.randInt(0,m)]))}}shimfC(){this.faction="U",this.rarity="R",this.name="Shimmerfang Serpent",this.iAttack=this.boof357,this.iHealth=this.boof61016,this.tribe.push("SN"),this.text=`When ${this.name} ${p.dbdtac()}, that creatures gets that much Poison.`,this.trigB=this.regnNug(this.iAttack)}shimfH(t,e,i,s){s.addPoison(e.dmg)}}class Ut extends Ye{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(i,s,h)=>this.ashyH(i,s,h)},["AMY"]:{c:()=>this.ashmC(),h:(i,s,h)=>this.ashyH(i,s,h)},["CFB"]:{c:()=>this.cfbC(),h:(i,s,h)=>this.cfbH(i,s,h)},["EPS"]:{c:()=>this.epsdC(),h:(i,s,h)=>this.epsdH(i,s,h)},["EFM"]:{c:()=>this.efmC(),h:(i,s,h)=>this.efmH(i,s,h)},["FBC"]:{c:()=>this.fbcC(),h:(i,s,h)=>this.fbcH(i,s,h)},["RTS"]:{c:()=>this.rzstC(),h:(i,s,h)=>this.rzstH(i,s,h)},["RSE"]:{c:()=>this.rselC(),h:(i,s,h)=>this.rselH(i,s,h)},["SVH"]:{c:()=>this.strhyC(),h:(i,s,h)=>this.strhyH(i,s,h)},["URB"]:{c:()=>this.uridC(),h:(i,s,h)=>this.uridH(i,s,h)},["VES"]:{c:()=>this.veskC(),h:(i,s,h)=>this.veskH(i,s,h)}}[t]}cardConstruct(t){this.hints=["OL"],this.lookup(t).c()}creatHit(t,e,i,s){this.lookup(t).h(e,i,s)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}jr8(t){const e=$.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} ${p.dbdtap()}, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}ashyH(t,e,i){const s=this.boof124;i.buff(s,s)}ashbC(){this.name="Ashurian Brawler",this.iAttack=this.boof7911,this.iHealth=this.iAttack,this.ashyC()}ashmC(){this.name="Ashurian Mystic",this.iAttack=this.boof3610,this.iHealth=this.boof5812,this.iAggro=!0,this.ashyC()}cfbC(){this.faction="T",this.rarity="H",this.name="Cinderfist Brawler",this.iAttack=this.boof71014,this.iHealth=this.boof357,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${p.dbdtap()}, deal that much damage to that player again.`,this.trigB=this.playerNug(this.iAttack/2)}cfbH(t,e,i){k.hurtDirect(!i.owner,e.dmg,i.code)}epsdC(){this.faction="A",this.rarity="T",this.name="Epoch Soldier",this.minLevel=this.level,this.maxLevel=this.level,this.iAttack=this.boof4710,this.iHealth=this.iAttack,this.tribe.push("HM"),this.bothTurns=!1,this.text=`When ${this.name} ${p.dbdtap()} on your turn, draw a card at the end of the turn.`,this.trigB=this.rawNug(0,0,0,0,.2)}epsdH(t,e,i){const s=y.trigger("TE","EPH"+this.level);s.changes=!0,s.bonus=this.rawNug(0,0,0,0,lt.dcWeight),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} ${p.dbdtap()} on your turn, you may play ${this.lValS(["one","two","three"])} spells this turn.`,this.trigB=this.rawNug(0,0,0,0,this.level*.5)}efmH(t,e,i){if(k.getActiveB()===i.owner)for(let s=0;sh.hurtDirect(e.dmg,this.code,s))}rzstC(){this.faction="T",this.rarity="C",this.name="Razortooth Stalker",this.iAttack=this.boof4812,this.iHealth=this.iAttack+1,this.iMobile=1,this.tribe.push("DN");const t=this.boof235;this.text=`When ${this.name} ${p.dbdtap()}, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}rzstH(t,e,i){const s=this.boof235;i.buff(s,s)}rselC(){this.faction="T",this.rarity="H",this.name="Rumblestone Elemental",this.iAttack=this.boof246,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("ER","EL"),this.text=`When ${this.name} ${p.dbdtap()}, deal that much damage to itself as well.~Assault: Spawn a copy of ${this.name}. Then repeat this for each copy.`,this.trigB=this.rawNug(0,0,0,0,-.1)}rselH(t,e,i){i.hurtDirect(e.dmg,this.code)}strhyC(){this.faction="U",this.rarity="C",this.name="Stranglevine Hydra",this.iAttack=this.boof5815,this.iHealth=this.iAttack+1,this.tribe.push("HY"),this.text=`When ${this.name} ${p.dbdtap()}, it gets Regenerate ${this.level}.`,this.trigB=this.regnNug(this.level)}strhyH(t,e,i){i.addRegen(this.level)}uridC(){this.faction="U",this.rarity="L",this.name="Uterradon Ridgeback",this.iAttack=this.boof71117,this.iHealth=this.boof4713,this.iBT=!0,this.tribe.push("DN"),this.bothTurns=!1;const t=this.boof124;this.text=`When ${this.name} ${p.dbdtap()} on your turn, each friendly creature gets ${p.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`,this.trigB=this.buffNug(t,t)}uridH(t,e,i){const s=this.boof124,h=this.level===3;g.ddf1().forEach(f=>{f.buff(s,s),h&&(f.breakthrough=!0)})}veskC(){this.faction="N",this.rarity="L",this.name="Vyric Ebonskull",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("VP");let t="",e=.5;this.level===3&&(t=" Then Spawn a copy of that creature."),this.text=`When Vyric ${p.dbdtap()}, destroy an enemy ${p.levelGateText(this.level,!0)} creature at random.`+t,this.trigB=this.multNug(this.avgSpawnNug(),e)}veskH(t,e,i){const s=y.crTarg();s.player=k.toTarget(e.hurtPlayer),s.level=D.ddf2(this.level);const h=g.creatByTarget(s);if(h.length>0){const f=R.tick(),m=h[S.randInt(0,h.length)];W.destroy(m,this.code,f),this.level===3&&g.birth(m.code,"S",i.owner,void 0,f)}}}class se extends P{lookup(t){return{["ASB"]:{c:()=>this.asbC(),d:(i,s,h)=>this.asbD(i,s,h)},["CHR"]:{c:()=>this.crgC(),d:(i,s,h)=>this.crgD(i,s,h)},["DZD"]:{c:()=>this.dozC(),d:(i,s,h)=>this.dozD(i,s,h)},["DTR"]:{c:()=>this.dtrC(),d:(i,s,h)=>this.dtrD(i,s,h)},["FWS"]:{c:()=>this.fwsC(),d:(i,s,h)=>this.fwsD(i,s,h)},["IMD"]:{c:()=>this.eddieC(),d:(i,s,h)=>this.eddieD(i,s,h)},["NCM"]:{c:()=>this.ncmbC(),d:(i,s,h)=>this.ncmbD(i,s,h)},["TDS"]:{c:()=>this.tsrC(),d:(i,s,h)=>this.tsrD(i,s,h)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}cares=!0;trigB;cardDamaged(t,e){const i=$.toDamage(e.event);this.lookup(t).d(e,i.hurtCreat,i)}image(t){return this.cardCode()==="DZD"?this.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e);if(this.cares){const s=i.jr4("DM");s.bonus=this.trigB}return i}ddf8(t){return t.event.isCreatTarg&&t.event.target===t.creatId}jr8(t){this.cardDamaged(this.cardCode(),t),x.triggerDone()}asbC(){this.faction="A",this.rarity="L",this.name="Alyssa, Strifeborn",this.iAttack=this.lValN([2,4,10]),this.iHealth=this.lValN([12,16,24]),this.tribe.push("HM"),this.hints=["MC"],this.trigB=this.buffNug(this.iAttack,0),this.text=`When ${this.name} is dealt non-battle damage and survives, it gets ${p.jr9(this.level,1)} for each damage dealt.`}asbD(t,e,i){!i.battle&&i.life>0&&e.buff(i.dmg*this.level,i.dmg)}crgC(){this.faction="U",this.rarity="L",this.name="Chrogias",this.iAttack=this.lValN([1,0,40]),this.iHealth=this.lValN([1,15,40]),this.tribe.push("PL"),this.level>1&&(this.hints=["MC"],this.text="When Chrogias is dealt damage, you gain that much health."),this.level===1?(this.hints=["LG","LM","RT"],this.cares=!1):this.level===2?(this.iRegen=2,this.iDefend=!0,this.trigB=this.playerNug(10),this.hints?.push("LG")):this.level===3&&(this.iBT=!0,this.iRegen=5,this.trigB=this.playerNug(20))}crgD(t,e,i){k.heal(t.owner,i.dmg)}dozC(){this.faction="U",this.rarity="L",this.name="Dozer, the Dormant",this.iAttack=0,this.iHealth=this.level*3+6,this.tribe.push("BR"),this.iDefend=!0,this.hints=["MC"],this.level===1&&this.hints.push("ZZ-2"),this.trigB=this.buffNug(this.iHealth,0),this.trigB.bonus=.3;const t=L.getCard(this.dz());this.text=`When ${this.name} is dealt damage and survives, replace it with a ${p.tokName(t)}.`}dozD(t,e,i){if(e.health>0&&e.status==="A"){const s=g.birth(this.dz(),"R",e.owner,e.lane);s&&s.setHealth(e.health)}}dz(){return "DZA"+this.level}dtrC(){this.faction="U",this.rarity="L",this.name="Dream Tree",this.iAttack=0,this.iHealth=this.lValN([7,11,20]),this.iDefend=!0,this.tribe.push("PL"),this.level===3&&(this.iRegen=5),this.hints=["MC"],this.trigB=this.avgSpawnNug(),this.text=`When ${this.name} is dealt damage and survives, if it is your turn, you may play an additional card this turn.`}dtrD(t,e,i){e.owner===k.activePlayer&&i.life>0&&(this.logAct(!1),E.regularPlays++)}fwsC(){this.faction="A",this.rarity="H",this.name="Forgewatch Sentry",this.iAttack=this.boof6912,this.iHealth=this.iAttack,this.iArmor=this.iAttack,this.tribe.push("RB"),this.trigB=this.rawNug(0,0,0,0,-1),this.text=`When ${this.name} is dealt damage, destroy it.`}fwsD(t,e,i){W.destroy(e,this.code)}eddieC(){this.faction="A",this.rarity="L",this.name="Iron Maiden",this.iAttack=this.lValN([1,3,30]),this.iHealth=this.iAttack,this.tribe.push("RB"),this.consistent=this.level>1,this.level===3?(this.iBT=!0,this.hints=["MC"],this.text="When Iron Maiden is dealt damage, deal that much damage to the enemy player.",this.trigB=this.playerNug(16)):(this.cares=!1,this.hints=["LG","LM","RT"])}eddieD(t,e,i){k.hurtDirect(!t.owner,i.dmg,this.code)}ncmbC(){this.faction="N",this.rarity="H",this.name="Necromoeba",this.iAttack=this.boof4710,this.iHealth=this.boof71117,this.tribe.push("OZ"),this.iRegen=3,this.hints=["MC"],this.level===1&&this.hints.push("ZZ-1");const t=L.getCard(Z.purpOzC(this.level));this.text=`When ${this.name} is dealt damage, Spawn a ${p.tokName(t)}.`,this.trigB=this.spawnNug(t)}ncmbD(t,e,i){this.logAct(!1),g.birth(Z.purpOzC(this.level),"S",t.owner)}tsrC(){this.faction="U",this.rarity="L",this.name="Thundersaur",this.iAttack=0,this.iHealth=this.level*12,this.tribe.push("DN"),this.iBT=!0,this.hints=["MC",this.level===2?"ZZ-3":"ZZ-1"],this.trigB=this.buffNug(this.iHealth/2,0),this.text=`When ${this.name} is dealt damage, it gets +1 attack for each damage dealt.`}tsrD(t,e,i){e.buff(i.dmg,0)}}class O extends P{lookup(t){return{["AGK"]:{c:()=>this.agknitC(),f:i=>this.agknitF(i)},["AMS"]:{c:()=>this.squadC(),f:i=>this.squadF(i)},["AFR"]:{c:()=>this.afsC(),f:i=>this.afsF(i)},["BZS"]:{c:()=>this.bzshC(),f:i=>this.bzshF(i)},["BTR"]:{c:()=>this.bwtC(),f:i=>this.bwtF(i)},["BSS"]:{c:()=>this.bssC(),f:i=>this.bssF(i)},["BZD"]:{c:()=>this.bzdrC(),f:i=>this.bzdrF(i)},["BFM"]:{c:()=>this.bfmC(),f:i=>this.bfmF(i)},["CTI"]:{c:()=>this.charnC(),f:i=>this.charnF(i)},["CHH"]:{c:()=>this.chihC(),f:i=>this.chihF(i)},["CSW"]:{c:()=>this.chickenC(),f:i=>this.chickenF(i)},["DFR"]:{c:()=>this.dfrC(),f:i=>this.dfrF(i)},["DSW"]:{c:()=>this.dswC(),f:i=>this.dswF(i)},["DBA"]:{c:()=>this.dbaC(),f:i=>this.dbaF(i)},["DBN"]:{c:()=>this.drbC(),f:i=>this.drbF(i)},["DDD"]:{c:()=>this.dddC(),f:i=>this.dddF(i)},["EWT"]:{c:()=>this.espwrC(),f:i=>this.espwrF(i)},["FWT"]:{c:()=>this.fwtC(),f:i=>this.fwtF(i)},["GSW"]:{c:()=>this.gwurmC(),f:i=>this.gwurmF(i)},["GSS"]:{c:()=>this.gsC(),f:i=>this.gsF(i)},["IMA"]:{c:()=>this.iracoC(),f:i=>this.iracoF(i)},["KSB"]:{c:()=>this.ksbC(),f:i=>this.ksbF(i)},["LGT"]:{c:()=>this.legtitC(),f:i=>this.legtitF(i)},["LBD"]:{c:()=>this.lbdC(),f:i=>this.lbdF(i)},["LMV"]:{c:()=>this.lyrC(),f:i=>this.lyrF(i)},["MOE"]:{c:()=>this.moeC(),f:i=>this.moeF(i)},["MMA"]:{c:()=>this.mmaC(),f:i=>this.mmaF(i)},["MMR"]:{c:()=>this.mmrC(),f:i=>this.mmrF(i)},["MBR"]:{c:()=>this.mbrC(),f:i=>this.mbrF(i)},["MTD"]:{c:()=>this.mossC(),f:i=>this.mossF(i)},["NSY"]:{c:()=>this.nysymC(),f:i=>this.nysymF(i)},["OXM"]:{c:()=>this.onxmarC(),f:i=>this.onxmarF(i)},["OFM"]:{c:()=>this.ofmC(),f:i=>this.ofmF(i)},["OPK"]:{c:()=>this.orpC(),f:i=>this.orpF(i)},["PHM"]:{c:()=>this.phmC(),f:i=>this.phmF(i)},["PSM"]:{c:()=>this.palsC(),f:i=>this.palsF(i)},["POK"]:{c:()=>this.pokC(),f:i=>this.pokF(i)},["POT"]:{c:()=>this.potC(),f:i=>this.potF(i)},["PMI"]:{c:()=>this.prinvC(),f:i=>this.prinvF(i)},["SMD"]:{c:()=>this.scorchC(),f:i=>this.scorchF(i)},["SOC"]:{c:()=>this.scythC(),f:i=>this.scythF(i)},["SDN"]:{c:()=>this.souldrC(),f:i=>this.souldrF(i)},["SGG"]:{c:()=>this.ssggC(),f:i=>this.ssggF(i)},["SLG"]:{c:()=>this.splgC(),f:i=>this.splgF(i)},["SBD"]:{c:()=>this.sbdC(),f:i=>this.sbdF(i)},["SSK"]:{c:()=>this.sssC(),f:i=>this.sssF(i)},["SYL"]:{c:()=>this.lotusC(),f:i=>this.lotusF(i)},["TGI"]:{c:()=>this.tgiC(),f:i=>this.tgiF(i)},["TRA"]:{c:()=>this.toraC(),f:i=>this.toraF(i)},["TRS"]:{c:()=>this.torsC(),f:i=>this.torsF(i)},["TRV"]:{c:()=>this.torvC(),f:i=>this.torvF(i)},["TRW"]:{c:()=>this.torwC(),f:i=>this.torwF(i)},["UGL"]:{c:()=>this.umglidC(),f:i=>this.umglidF(i)},["UWL"]:{c:()=>this.uwarC(),f:i=>this.uwarF(i)},["UWS"]:{c:()=>this.ustokeC(),f:i=>this.ustokeF(i)},["UIW"]:{c:()=>this.uiwC(),f:i=>this.uiwF(i)},["UTM"]:{c:()=>this.umaulC(),f:i=>this.umaulF(i)},["VIC"]:{c:()=>this.vlfxC(),f:i=>this.vlfxF(i)},["VIK"]:{c:()=>this.vikC(),f:i=>this.vikF(i)},["VND"]:{c:()=>this.vdrkC(),f:i=>this.vdrkF(i)},["VNS"]:{c:()=>this.vnsC(),f:i=>this.vnsF(i)},["WMC"]:{c:()=>this.warC(),f:i=>this.warF(i)},["WWP"]:{c:()=>this.wwpC(),f:i=>this.wwpF(i)},["WFB"]:{c:()=>this.wfbC(),f:i=>this.wfbF(i)},["XTR"]:{c:()=>this.xtmC(),f:i=>this.xtmF(i)},["ZDK"]:{c:()=>this.zdkC(),f:i=>this.zdkF(i)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";forges=!0;flanks;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let e="";this.flanks&&(e="Flank"),this.forges&&(e?e="Forge/"+e:e=p.forglied(this.allied)),e&&(this.text=e+": "+this.ftext),this.ftext=""}image(t){return this.rarity==="T"?super.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e);if(this.forges&&i.jr4("FR"),this.flanks){const s=i.jr4("FK");s.bonus=this.flanks}return i}ddf8(t){return Nt.extractCardCode(t.trigger.logicCode)==="MMR"}jr8(t){const e=this.cardCode();if(t.trigger.type==="TE"&&e==="MMR"){this.logAct(!1);const i=t.event,s=k.toPlayer(i.playerA);k.drawCard(s,this.level);const h=y.trigIdx(s.triggers,t.trigger);h>-1&&s.triggers.splice(h,1)}else this.cardForge(this.cardCode(),t);x.triggerDone()}agknitC(){this.faction="A",this.rarity="L",this.name="Aegis Knight",this.iAttack=this.boof5814,this.iHealth=this.iAttack,this.tribe.push("HM"),this.iArmor=this.lValN([1,2,5]),this.ftext="Each friendly creature deals damage equal to its Armor to the opposing creature"}agknitF(t){const e=y.crFriendTarg();e.hasArmor=!0;const i=R.tick();g.creatByTarget(e).forEach(s=>{s.opposed&&s.opposed.hurtDirect(s.armor,s.code,i)})}squadC(){this.faction="A",this.rarity="H",this.name="Aeromind Squadron",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("MM"),this.iMobile=1,this.ftext="Put a Metamind at random from your deck into your hand."}squadF(t){const e=k.toPlayer(t.owner),i=y.target("TH");i.player=k.toTarget(e),i.tribe="MM";const s=D.deckByTarget(i),h=s.length;if(h>0){const f=s[S.randInt(0,h)];e.deck.splice(f[1],1),e.hand.push(f[0])}}afsC(){this.faction="T",this.rarity="H",this.name="Ashurian Flamesculptor",this.iAttack=this.boof5915,this.iHealth=this.boof3610,this.tribe.push("FR","AS"),this.forges=this.level>1,this.consistent=this.forges,this.ftext=`You may play an additional ${p.levelGateText(this.level-1)} Tempys spell this turn.`,this.forges&&this.addSp("C",0)}afsF(t){const e=E.freeCard(this.code);e.condition.card="S",e.condition.level=D.ddf2(this.level-1),e.condition.faction="T"}bzshC(){this.faction="T",this.rarity="C",this.name="Blizzard Shaman",this.iAttack=this.boof61014,this.iHealth=this.iAttack+1,this.tribe.push("WN","AS"),this.ftext="Move another friendly creature at random to another available lane at random."}bzshF(t){const e=g.creatByTarget(y.crFriendNotMeTarg(t.creatId)),i=e.length;if(i<4&&i>0){const s=e[S.randInt(0,i)],h=g.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 ${p.levelGateText(t)} Uterra creature this turn.`,this.consistent=!0,this.addSp("C",0)}else this.hints=["LG"]}bwtF(t){const e=E.freeCard(this.code);e.condition.card="C",e.condition.faction="U",e.condition.level=D.ddf2(this.level-1)}bssC(){this.faction="A",this.rarity="L",this.name="Brightsteel Sentinal",this.iHealth=this.boof51015,this.iAttack=this.iHealth-1,this.tribe.push("RB"),this.addSp("M",this.iHealth),this.ftext=`Each friendly Robot gets Armor ${this.iHealth} this turn.`}bssF(t){const e=this.boof51015,i=y.crFriendTarg();i.tribe="RB",i.canArmor=!0,g.creatByTarget(i).forEach(h=>{const f=y.mod("AR",e);f.expiry="ET",h.addMod(f)})}bzdrC(){this.faction="N",this.rarity="R",this.name="Byzerak Drake",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.iRegen=this.level,this.allied="T",this.tribe.push("DG"),this.addSp("R",this.level),this.ftext=`Mobility ${this.level}.`}bzdrF(t){E.allied(this.allied)&&g.jr5(t.creatId).addMobility(this.level)}bfmC(){this.faction="N",this.rarity="H",this.name="Byzerak Frostmaiden",this.iAttack=this.boof135,this.iHealth=this.boof91420,this.tribe.push("HM");const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${p.jr9(-1*t,0)} and this gets ${p.jr9(t,0)}.~Allied Tempys: Mobility ${this.level}.`}bfmF(t){const i=$.toEnterField(t.event).creature;t.trigger.type==="FR"&&E.allied("T")&&i.addMobility(this.level);const s=i.opposed;if(s){const h=this.boof246;s.buff(-1*h,0),i.buff(h,0)}}charnC(){this.faction="N",this.rarity="C",this.name="Charnel Titan",this.iAttack=this.boof359,this.iHealth=this.boof5814,this.tribe.push("AB");const t=this.boof357;this.ftext=`If there is an enemy creature with ${t} or less attack, ${this.name} gets ${p.jr9(t,t)}.`}charnF(t){const e=this.boof357,i=y.crEnemyTarg();i.maxAttack=e,g.creatByTarget(i).length>0&&g.jr5(t.creatId).buff(e,e)}chihC(){this.faction="U",this.rarity="C",this.name="Chistlehearth Hunter",this.iAttack=this.lValN([2,6,11]),this.iHealth=this.boof81217,this.tribe.push("HM"),this.ftext=`${this.name} gets ${p.jr9(1,0)} for each other friendly creature.`}chihF(t){const e=g.ddf1().length;e>1&&g.jr5(t.creatId).buff(e-1,0)}chickenC(){this.faction="T",this.rarity="L",this.name="Cindersmoke Wyvern",this.iAttack=this.boof3610,this.iHealth=this.lValN([7,12,17]),this.tribe.push("DG"),this.iMobile=this.boof124,this.forges=!1,this.flanks=this.buffNug(this.iAttack,0),this.ftext="Deal damage equal to its attack to the opposing creature. If there is no opposing creature, deal that damage to the enemy player instead."}chickenF(t){const e=$.toEnterField(t.event),i=e.creature.attack,s=e.creature.opposed;s?s.hurtDirect(i,this.code):k.hurtDirect(!t.owner,i,this.code)}dfrC(){this.faction="N",this.rarity="H",this.name="Darkfrost Reaper",this.iAttack=this.boof6916,this.iHealth=this.boof3713,this.tribe.push("SK"),this.ftext="Destroy each creature with 1 or less attack."}dfrF(t){const e=y.crTarg();e.maxAttack=1;const i=g.creatByTarget(e),s=R.tick();i.forEach(h=>{W.destroy(h,this.code,s)})}dswC(){this.faction="N",this.rarity="C",this.name="Darkshard Witch",this.iAttack=this.boof51015,this.iHealth=this.iAttack-1,this.tribe.push("DF","HM");const t=this.boof234;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health for each other friendly Darkforged.`}dswF(t){const e=y.crFriendNotMeTarg(t.creatId);e.tribe="DF";const i=this.boof234*g.creatByTarget(e).length;i>0&&(k.heal(t.owner,i),k.hurtDirect(!t.owner,i,this.code))}dbaC(){this.faction="U",this.rarity="H",this.name="Deepbranch Ancient",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HY"),this.ftext=`If there is a friendly creature in each lane, ${this.name} gets ${p.jr9(this.iAttack,this.iHealth)}.`}dbaF(t){g.ddf1().length===5&&g.jr5(t.creatId).buff(this.iAttack,this.iHealth)}drbC(){this.faction="N",this.rarity="C",this.name="Dirge Banshee",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${p.jr9(-t,0)} and this gets ${p.jr9(t,0)}.`}drbF(t){const e=$.toEnterField(t.event),i=e.creature.opposed;if(i){const s=this.boof246;i.buff(-s,0),e.creature.buff(s,0)}}dddC(){this.faction="N",this.rarity="L",this.name="Doomwing, Dire Drake",this.iAttack=this.boof61018,this.iHealth=this.lValN([2,6,10]),this.iMobile=this.level,this.tribe.push("DG"),this.level>1&&(this.hints=[this.level===2?"ZZ-2":"ZZ-5"]),this.forges=!1,this.flanks=this.multNug(this.avgSpawnNug(),.5),this.ftext=`Destroy the opposing ${p.levelGateText(this.level,!0)}creature.`}dddF(t){const i=$.toEnterField(t.event).creature.opposed;i&&D.levelTestCommon(i.level,this.level)&&W.destroy(i,this.code)}espwrC(){this.faction="U",this.rarity="R",this.name="Esperian Wartusk",this.iAttack=this.boof5916,this.iHealth=this.iAttack-1,this.iBT=!0,this.allied="A",this.tribe.push("TK");const t=this.boof124;this.ftext=`Armor ${t}.`}espwrF(t){E.allied(this.allied)&&g.jr5(t.creatId).addArmor(this.boof124)}fwtC(){this.faction="U",this.rarity="H",this.name="Frostwild Tracker",this.iAttack=this.boof4712,this.iHealth=this.boof248,this.tribe.push("TG"),this.forges=this.level>1;const t=this.level-1;this.ftext=`You may play an additional ${p.levelGateText(t)} creature this turn.`,this.level===1&&(this.hints=["LG"])}fwtF(t){const e=E.freeCard(this.code);e.condition.card="C",e.condition.level=D.ddf2(this.level-1)}gwurmC(){this.faction="N",this.rarity="C",this.name="Gloomspire Wurm",this.iAttack=this.boof4813,this.iHealth=this.iAttack,this.tribe.push("WR"),this.ftext=`If there are no enemy creatures, ${this.name} gets ${p.jr9(4,4)}.`}gwurmF(t){g.qEnemyCreats().length===0&&g.jr5(t.creatId).buff(4,4)}gsC(){this.faction="U",this.rarity="C",this.name="Glowstride Stag",this.iAttack=this.boof5812,this.iHealth=this.iAttack+this.level,this.tribe.push("ST");const t=this.boof51015;this.ftext=`You gain ${t} health.`}gsF(t){const e=this.boof51015;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&&(E.regularPlays+=1)}ksbC(){this.faction="T",this.rarity="C",this.name="Kadrasian Stoneback",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("DN"),this.iMobile=1,this.iDefend=!0,this.forges=!1,this.flanks=this.regnNug(1),this.ftext=`Negate Defender from ${this.name} this turn.`}ksbF(t){const e=$.toEnterField(t.event),i=y.mod("ND",!0,e.creatId);i.expiry="ET",e.creature.addModSafe(i)}legtitC(){this.faction="N",this.rarity="R",this.name="Legion Titan",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.ftext=`${this.name} gets ${p.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`}legtitF(t){const e=y.crEnemyTarg();e.maxAttack=this.boof357;const i=g.creatByTarget(e);if(i.length>0){const s=this.level*i.length;g.jr5(t.creatId).buff(s,s)}}lbdC(){this.faction="U",this.rarity="H",this.name="Lifeblood Dryad",this.iAttack=this.lValN([4,7,9]),this.iHealth=this.iAttack,this.tribe.push("DY");const t=this.boof236;this.ftext=`If there is a friendly creature in each lane, each other friendly creature gets ${p.jr9(t,t)}.`}lbdF(t){const e=g.creatByTarget(y.crFriendNotMeTarg(t.creatId));if(e.length===4){const i=this.boof236;e.forEach(s=>s.buff(i,i))}}lyrC(){this.faction="N",this.rarity="L",this.name="Lyria, Muse of Varna",this.iAttack=this.boof5815,this.iHealth=this.boof4714,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.level===2?"Spawn a random creature that was destroyed this game.":"Put a random creature that was destroyed this game into each of your available lanes.",this.forges||(this.hints=["LG"])}lyrF(t){if(this.level===2){const e=W.gravedigger();e&&g.birth(e,"S",t.owner)}else if(this.level===3){const e=g.emptyLanes(t.owner),i=e.map(s=>W.gravedigger());if(e.length>0&&i[0]){const s=R.tick();e.forEach((h,f)=>{g.birth(i[f],"P",t.owner,h,s)})}}}moeC(){this.faction="T",this.rarity="H",this.name="Master of Elements",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=`You may play an additional ${p.levelGateText(this.level-1)} spell this turn.`}moeF(t){const e=E.freeCard(this.code);e.condition.card="S",e.condition.level=D.ddf2(this.level-1)}mmaC(){this.faction="A",this.rarity="C",this.name="Metamind Adept",this.iAttack=this.boof5915,this.iHealth=this.boof4813,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`Draw ${this.level} card${t}.`}mmaF(t){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=y.crFriendNotMeTarg(t.creatId);if(e.tribe="MM",g.creatByTarget(e).length>0){const i=y.trigger("TE",this.code);i.changes=!0,i.bonus=this.rawNug(0,0,0,0,this.level*lt.dcWeight),k.toPlayer(t.owner).triggers.push(i)}}mbrC(){this.faction="A",this.rarity="R",this.name="Mind Breaker",this.iAttack=this.boof248,this.iHealth=this.lValN([8,14,20]),this.tribe.push("MM"),this.ftext="Draw a card for each friendly Metamind."}mbrF(t){const e=y.crFriendTarg();e.tribe="MM",k.drawCard(t.owner,g.creatByTarget(e).length)}mossC(){this.faction="U",this.rarity="R",this.name="Mosstodon",this.iAttack=this.boof71117,this.iHealth=this.boof4713,this.tribe.push("DN"),this.ftext=`Each other friendly Dinosaur gets ${p.jr9(0,this.boof357)}.`}mossF(t){const e=y.crFriendNotMeTarg(t.creatId);e.tribe="DN";const i=this.boof357;g.creatByTarget(e).forEach(s=>s.buff(0,i))}nysymC(){this.faction="N",this.rarity="C",this.name="Nyrali Symbiote",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`}nysymF(t){const e=$.toEnterField(t.event);e.creature.opposed&&e.creature.addRegen(this.boof246)}ofmC(){this.faction="A",this.rarity="R",this.name="Oreian Fieldmarshal",this.iAttack=this.boof5914,this.iHealth=this.iAttack-2,this.tribe.push("HM");const t=this.boof135;this.ftext=`Each other friendly creature gets ${p.jr9(t,0)}.`}ofmF(t){const e=this.boof135;g.creatByTarget(y.crFriendNotMeTarg(t.creatId)).forEach(s=>{s.buff(e,0)})}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.tribe.push("RB"),this.hints=["OP"],this.ftext=`${this.name} gets Armor ${this.iAttack} this turn.`}orpF(t){const e=g.jr5(t.creatId),i=y.mod("AR",this.iAttack);i.expiry="ET",e.addMod(i)}onxmarC(){this.faction="A",this.rarity="R",this.name="Onyxium Marauder",this.iAttack=this.boof4714,this.iHealth=this.lValN([6,9,17]),this.iArmor=this.level,this.allied="N",this.tribe.push("HM"),this.ftext=`Regenerate ${this.level}.`}onxmarF(t){E.allied(this.allied)&&g.jr5(t.creatId).addRegen(this.level)}phmC(){this.faction="A",this.rarity="R",this.name="Palladium Hindermind",this.iAttack=this.boof2612,this.iHealth=this.boof61016,this.tribe.push("HM"),this.ftext=`Each enemy creature gets ${p.jr9(this.boof123n,0)}.`}phmF(t){const e=this.boof123n;g.qEnemyCreats().forEach(i=>{i.buff(e,0)})}palsC(){this.faction="A",this.rarity="L",this.name="Palladium Simulacrum",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.iMobile=this.level-1,this.tribe.push("SS"),this.flanks=this.multNug(this.statSpawnNug(this.iAttack,this.iHealth),.5),this.ftext=`If ${this.name} is in the center lane, Spawn a copy.`}palsF(t){$.toEnterField(t.event).creature.lane===3&&g.birth(this.code,"S",t.owner)}pokC(){this.faction="T",this.rarity="H",this.name="Patron of Kadras",this.iAttack=this.boof4812,this.iHealth=this.iAttack+2,this.tribe.push("ER","EL"),this.ftext=`If you have three or more Tempys cards in your hand, each friendly creature gets ${p.jr9(this.iAttack,0)} this turn.`}pokF(t){E.patron("T")&&g.ddf1().forEach(e=>{const i=y.mod("AT",this.iAttack);i.expiry="ET",e.addMod(i)})}potC(){this.faction="N",this.rarity="H",this.name="Patron of Tarsus",this.iAttack=this.boof5914,this.iHealth=this.boof4712,this.tribe.push("DM");const t=this.potbuf;this.ftext=`If you have three or more Nekrium cards in your hand, each enemy creature gets ${p.jr9(t,t)}.`}potF(t){if(E.patron("N")){const e=g.qEnemyCreats();if(e.length>0){const i=this.potbuf;this.logAct(!1),e.forEach(s=>{s.buff(i,i)})}}}get potbuf(){return this.lValN([-1,-3,-6])}prinvC(){this.faction="T",this.rarity="H",this.name="Primordial Invoker",this.iAttack=this.boof61016,this.iHealth=this.boof468,this.tribe.push("HM"),this.ftext=`Deal ${this.iHealth} damage divided at random between enemy creatures and the the enemy player.`}prinvF(t){const e=g.creatByTarget(y.crEnemyTarg()),i=e.length;if(i===0)k.hurtDirect(!t.owner,this.iHealth,this.code);else{const s=R.tick(),h=i+1,f=Array(h).fill(0);for(let m=0;m{f[A]>0&&m.hurtDirect(f[A],this.code,s)}),f[i]>0&&k.hurtDirect(!t.owner,f[i],this.code)}}scorchC(){this.faction="T",this.rarity="L",this.name="Scorchmane Dragon",this.iAttack=this.lValN([0,12,24]),this.iHealth=this.boof61224,this.tribe.push("DG"),this.iDefend=this.level===1,this.iMobile=this.level-1,this.forges=this.level>1,this.ftext="Deal 5 damage to "+(this.level===2?"the opposing creature.":"each enemy creature and player."),this.level===1&&(this.hints=["LG","LM"])}scorchF(t){const e=$.toEnterField(t.event),i=!t.owner;if(this.level===2){const s=e.creature.opposed;s&&s.hurtDirect(5,this.code)}else if(this.level===3){const s=R.tick();g.qPlayerCreats(i).forEach(h=>h.hurtDirect(5,this.code,s)),k.hurtDirect(i,5,this.code)}}scythC(){this.faction="N",this.rarity="L",this.name="Chiron, Herald of Torment",this.iAttack=12,this.iHealth=6,this.tribe.push("DM"),this.ftext=`Each enemy creature gets ${p.jr9(-6,0)} and ${this.name} gets ${p.jr9(6,0)} for each enemy creature.`}scythF(t){const e=g.qEnemyCreats();e.forEach(i=>{i.buff(-6,0)}),e.length>0&&g.jr5(t.creatId).buff(6*e.length,0)}souldrC(){if(this.faction="N",this.rarity="L",this.name="Soul Drinker",this.iAttack=1,this.iHealth=this.boof4814,this.iMobile=this.level===3?1:0,this.tribe.push("VP"),this.hints=["OP"],this.level===3){const t=this.avgCreatureStats();this.flanks=this.buffNug(t[0]*2,0)}this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`}souldrF(t){const e=$.toEnterField(t.event),i=e.creature.opposed;if(i){const s=i.attack;e.creature.buff(s,0),i.buff(-1*s,0)}}ssggC(){this.faction="N",this.rarity="H",this.name="Soulscourge Grimgaunt",this.iAttack=this.level+1,this.iHealth=this.iAttack,this.tribe.push("GG"),this.ftext=`${this.name} gets ${p.jr9(this.iAttack,this.iHealth)} for each creature that was destroyed this turn.`}ssggF(t){const e=this.iAttack*(E.deathsA.length+E.deathsB.length);e>0&&g.jr5(t.creatId).buff(e,e)}splgC(){this.faction="N",this.rarity="T",this.name="Spiderling",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("SP"),this.hints=["OP"],this.ftext=`Replace the opposing ${p.levelGateText(this.level,!0)}creature with a Web.`}splgF(t){const e=$.toEnterField(t.event);if(e.creature.opposed){const i=e.creature.opposed;D.levelTestCommon(i.level,this.level)&&g.birth("WEB"+this.level,"R",i.owner,i.lane)}}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=g.searchByLane(3,t.owner);e&&e.id!==t.creatId&&!e.negateArmor&&e.addArmor(this.boof124)}lotusC(){this.faction="U",this.rarity="H",this.name="Stygian Lotus",this.iAttack=this.boof468,this.iHealth=this.iAttack-1,this.tribe.push("PL"),this.hints=["ZZ-1"],this.ftext=`If ${this.name} is opposed, spawn a copy of it. Then repeat this for each copy.`}lotusF(t){if($.toEnterField(t.event).creature.opposed){let i=!0;for(;i;){const s=g.emptyLanes(t.owner),h=s.length;if(h===0)i=!1;else{const f=s[S.randInt(0,h)];g.birth(this.code,"P",t.owner,f).opposed||(i=!1)}}}}tgiC(){this.faction="T",this.rarity="R",this.name="Thundergale Invoker",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("WN","GT"),this.ftext=`Each creature adjacent to ${this.name} moves one lane away if possible.`}tgiF(t){const e=g.jr5(t.creatId),i=e.lane,s=e.owner,h=[];if(i>2){const f=g.searchByLane(i-1,s);f&&(g.searchByLane(i-2,s)||(h.push(f),f.move(i-2)))}if(i<4){const f=g.searchByLane(i+1,s);f&&(g.searchByLane(i+2,s)||(h.push(f),f.move(i+2)))}h.length>0&&this.logAct(!1,...h)}tortex(t){return`Put a level ${this.level} ${t} into your hand.`}handhoss(t,e){const i=k.toPlayer(e),s=t+this.level;i.hand.push(s)}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.handhoss("PTR",t.owner)}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.handhoss("STO",t.owner)}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.handhoss("ITO",t.owner)}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.handhoss("STR",t.owner)}umglidC(){this.faction="T",this.rarity="R",this.name="Umbruk Glider",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.iMobile=this.level,this.allied="U",this.tribe.push("DN"),this.ftext="Breakthrough."}umglidF(t){if(E.allied(this.allied)){const e=g.jr5(t.creatId);e.breakthrough=!0}}uwarC(){this.faction="T",this.rarity="H",this.name="Uranti Warlord",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("FR","YT"),this.hints=["OP"],this.ftext=`Each friendly Yeti deals ${this.iAttack} damage to the opposing creature.`}uwarF(t){const e=y.crFriendTarg();e.tribe="YT";const i=R.tick();g.creatByTarget(e).forEach(s=>{const h=s.opposed;h&&h.hurtDirect(this.iAttack,s.code,i)})}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 gets ${p.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const e=y.crFriendNotMeTarg(t.creatId);e.tribe="YT";const i=this.stokeboof;g.creatByTarget(e).forEach(s=>{const h=y.mod("AT",i);h.expiry="ET",s.addMod(h)})}get stokeboof(){return this.lValN([3,4,6])}uiwC(){this.faction="A",this.rarity="L",this.name="Uriel Ironwing",this.iAttack=this.lValN([6,8,13]),this.iHealth=this.boof81117,this.iMobile=this.level,this.tribe.push("AG"),this.hints=["ZZ-1"];const t=this.boof246n;this.flanks=this.buffNug(-t,0);let e="";this.level===3&&(e=" If that creature has 0 or less attack, destroy it.",this.flanks.count=1),this.ftext=`The opposing creature gets ${p.jr9(t,0)}.${e}`}uiwF(t){const s=$.toEnterField(t.event).creature.opposed;s&&(s.buff(this.boof246n,0),this.level===3&&s.attack<1&&W.destroy(s,this.code))}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${p.jr9(t,t)}.`}umaulF(t){const e=$.toEnterField(t.event);if(e.creature.opposed){const i=this.boof246;e.creature.buff(i,i)}}vlfxC(){this.faction="T",this.rarity="L",this.name="Valifrax, Iztek's Champion",this.iAttack=this.boof4816,this.iHealth=this.iAttack+4,this.iMobile=1,this.tribe.push("FR","IC","DG"),this.forges=!1,this.flanks=this.rawNug(0,0,0,0,.5);const t=(e,i)=>`If there is ${i?"an":"no"} opposing creature, put a level ${this.level} Iztek's ${e} into your hand.`;this.ftext=`${t("Frost",!0)} ${t("Flame",!1)}`}vlfxF(t){const e=$.toCreature(t.event);this.handhoss(e.creature.opposed?"IFR":"IFL",t.owner)}vikC(){this.faction="N",this.rarity="L",this.name="Varna, Immortal King",this.maxLevel=4,this.iAttack=this.lValN([4,6,12,18]),this.iHealth=this.lValN([8,13,22,30]),this.tribe.push("FB");let t="";this.level===4&&(t="Destroy each other creature. Then "),this.ftext=t+"Spawn a random friendly creature that was destroyed this turn."}vikF(t){if(this.level===4){const s=g.creatByTarget(y.crNotMeTarg(t.creatId));if(s.length>0){const h=R.tick();s.forEach(f=>W.destroy(f,this.code,h))}}const e=t.owner?E.deathsA:E.deathsB,i=e.length;e.length>0&&g.birth(e[S.randInt(0,i)],"S",t.owner)}vdrkC(){this.faction="U",this.rarity="R",this.name="Venomdrinker",this.iAttack=this.lValN([5,9,13]),this.iHealth=this.iAttack,this.tribe.push("NG"),this.ftext=`${this.name} gets ${p.jr9(1,1).replaceAll("1","X")}, where X is the total amount of Poison on each enemy creature.`}vdrkF(t){const e=g.qEnemyCreats();let i=0;e.forEach(s=>{i+=s.poison}),i>0&&g.jr5(t.creatId).buff(i,i)}vnsC(){this.faction="U",this.rarity="H",this.name="Venomous Netherscale",this.iAttack=this.boof4713,this.iHealth=this.iAttack+4,this.tribe.push("NG"),this.ftext=`Double the Poison on each enemy creature${this.level===3?" and the enemy player":""}.`}vnsF(t){const e=y.crEnemyTarg();if(e.hasPoison=!0,g.creatByTarget(e).forEach(s=>{s.addPoison(s.poison)}),this.level===3){const s=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 ${p.jr9(3,0)}.`}warF(t){const e=y.crFriendNotMeTarg(t.creatId);g.creatByTarget(e).forEach(i=>i.buff(3,0))}wwpC(){this.faction="U",this.rarity="H",this.name="Weirwood Patriarch",this.iAttack=this.boof5714,this.iHealth=this.lValN([7,10,17]),this.tribe.push("HM");const t=this.boof235;this.ftext=`Each friendly creature with ${this.boof357} or less attack gets ${p.jr9(t,t)}.`}wwpF(t){const e=this.boof235,i=y.crFriendTarg();i.maxAttack=this.boof357,g.creatByTarget(i).forEach(s=>s.buff(e,e))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof247n;this.flanks=this.buffNug(-t,-t),this.ftext=`The opposing creature gets ${p.jr9(t,t)}.`}wfbF(t){const i=$.toEnterField(t.event).creature.opposed;if(i){const s=this.boof247n;i.buff(s,s)}}xtmC(){this.faction="N",this.rarity="H",this.name="Xithian Tormentor",this.iAttack=this.lValN([6,12,22]),this.iHealth=this.lValN([10,16,28]),this.tribe.push("AB"),this.ftext="Destroy each other friendly creature."}xtmF(t){const e=g.creatByTarget(y.crFriendNotMeTarg(t.creatId));if(e.length>0){const i=R.tick();e.forEach(s=>W.destroy(s,this.code,i))}}zdkC(){this.faction="N",this.rarity="H",this.name="Zombie Dreadknight",this.iAttack=this.boof5814,this.iHealth=this.iAttack-2,this.tribe.push("ZB");const t=this.boof246;this.ftext=`Each friendly creature with Regenerate gets ${p.jr9(t,t)}.`}zdkF(t){const e=this.boof246,i=y.crFriendTarg();i.hasRegen=!0,g.creatByTarget(i).forEach(s=>s.buff(e,e))}}class Me extends P{lookup(t){return{["PYM"]:{c:()=>this.pymC(),g:(i,s)=>this.pymG(i,s)},["RBG"]:{c:()=>this.rbgC(),g:(i,s)=>this.rbgG(i,s)},["SRV"]:{c:()=>this.sprvC(),g:(i,s)=>this.sprvG(i,s)},["TGK"]:{c:()=>this.tgkC(),g:(i,s)=>this.tgkG(i,s)}}[t]}onGain(t,e){this.lookup(t).g(e,e.event)}hPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("LG",this.code);return s.bonus=this.trigB,i}ddf8(t){return this.validPlayer(t)}jr8(t){this.onGain(this.cardCode(),t),x.triggerDone()}validPlayer(t){return this.hPlayer===0?!0:this.hPlayer===1?t.owner===t.event.playerA:t.owner!==t.event.playerA}pymC(){this.faction="T",this.rarity="R",this.name="Pyre Mystic",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("FR","AS"),this.hPlayer=-1;const t=this.lValS(["","2x ","3x "]);this.text=`When an enemy player gains health, deal ${t}that much damage to the enemy player.`,this.trigB=this.playerNug(this.boof369)}pymG(t,e){k.hurtDirect(e.playerA,e.healAmt*this.level,this.code)}rbgC(){this.faction="U",this.rarity="H",this.name="Runebark Guardian",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hPlayer=1;const t=this.boof135;this.text=`When you gain health, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}rbgG(t,e){const i=g.jr5(t.creatId),s=this.boof135;i.buff(s,s)}sprvC(){this.faction="N",this.rarity="R",this.name="Spirit Reaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("DM"),this.hPlayer=-1;const t=this.boof234;this.text=`When an enemy player gains health, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t),this.hints=["ZZ-1"]}sprvG(t,e){const i=g.jr5(t.creatId),s=this.boof234;i.buff(s,s)}tgkC(){this.faction="U",this.rarity="R",this.name="Tuskin Grovekeeper",this.iAttack=this.boof6912,this.iHealth=this.iAttack,this.tribe.push("TK"),this.hPlayer=1,this.text=`When you gain health, Spawn a 3/3 ${Z.minionName(this.level)}.`,this.trigB=this.rawNug(.5,3,3,0)}tgkG(t,e){const i=this.lValS(["SXD","SPL","TTF"])+this.level;g.birth(i,"S",t.owner)}}class ve extends P{lookup(t){return{["AWU"]:{c:()=>this.awuC(),m:(i,s)=>this.awuM(i,s)},["EWE"]:{c:()=>this.eweC(),m:(i,s)=>this.eweM(i,s)},["FFM"]:{c:()=>this.ffmC(),m:(i,s)=>this.ffmM(i,s)},["LUC"]:{c:()=>this.lugC(),m:(i,s)=>this.lugM(i,s)},["WBH"]:{c:()=>this.wbhC(),m:(i,s)=>this.wbhM(i,s)}}[t]}onMove(t,e){this.lookup(t).m(e,$.toCreature(e.event))}mPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("MV");return s.bonus=this.trigB,i}ddf8(t){return this.validPlayer(t)}jr8(t){this.onMove(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=$.toCreature(t.event);return this.mPlayer===1?t.owner===e.creature.owner:t.owner!==e.creature.owner}awuC(){this.faction="T",this.rarity="R",this.name="Arc Wurm",this.iAttack=this.boof4813,this.iHealth=this.iAttack+3,this.tribe.push("LT","EL"),this.iMobile=1,this.mPlayer=1;const t=this.boof234;this.text=`When a friendly creature moves, deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t)}awuM(t,e){k.hurtDirect(!e.creature.owner,this.boof234,this.code)}eweC(){this.faction="T",this.rarity="H",this.name="Emberwind Evoker",this.iAttack=this.boof4914,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.mPlayer=1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}eweM(t,e){const i=this.boof124;e.creature.buff(i,i)}ffmC(){this.faction="T",this.rarity="H",this.name="Frostfang Maiden",this.iAttack=this.boof5814,this.iHealth=this.iAttack+this.level,this.tribe.push("HM"),this.iMobile=this.level,this.mPlayer=1;const t=this.ffbof;this.text=`When a friendly creature moves, deal ${t} to the creature opposing it.`,this.trigB=this.buffNug(t,0)}ffmM(t,e){const i=e.creature.opposed;i&&i.hurtDirect(this.ffbof,this.code)}get ffbof(){return this.level+2}lugC(){this.faction="T",this.rarity="L",this.name="Lug, Uranti Charger",this.iAttack=this.boof359,this.iHealth=this.lValN([9,13,19]),this.level===3&&(this.iMobile=1),this.tribe.push("YT"),this.mPlayer=1,this.text="When a friendly creature moves on your turn, Lug battles an additional time.",this.trigB=this.buffNug(this.iAttack,0)}lugM(t,e){if(t.owner===k.getActiveB()){const i=g.jr5(t.creatId);i.extraBattles+=1}}wbhC(){this.faction="T",this.rarity="R",this.name="Windborn Hellion",this.iAttack=this.boof4812,this.iHealth=this.boof81217,this.tribe.push("WN","EL"),this.mPlayer=1,this.text=`When a friendly creature moves, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.buffNug(this.level,this.level)}wbhM(t,e){g.jr5(t.creatId).buff(this.level,this.level)}}class $t extends P{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.agrdP(i,s)},["ART"]:{c:()=>this.arootC(),t:(i,s)=>this.factionSpellMyTurn(i,s),p:(i,s)=>this.arootP(i,s)},["ATS"]:{c:()=>this.atrapC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.atrapP(i,s)},["ARB"]:{c:()=>this.arbysC(),t:(i,s)=>this.enemyPlayed(i,s),p:(i,s)=>this.arbysP(i,s)},["BLH"]:{c:()=>this.bblhC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.bblhP(i,s)},["CYC"]:{c:()=>this.ccC(),t:(i,s)=>this.factionSpellMyTurn(i,s),p:(i,s)=>this.ccP(i,s)},["DHW"]:{c:()=>this.dhwC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.dhwP(i,s)},["FBI"]:{c:()=>this.fbiC(),t:(i,s)=>this.factionSpellMyTurn(i,s),p:(i,s)=>this.fbiP(i,s)},["FLS"]:{c:()=>this.flspkC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.flspkP(i,s)},["IZK"]:{c:()=>this.izzyC(),t:(i,s)=>this.izzyT(i,s),p:(i,s)=>this.izzyP(i,s)},["KAW"]:{c:()=>this.kasC(),t:(i,s)=>this.spellMyTurn(i,s),p:(i,s)=>this.kasP(i,s)},["SWA"]:{c:()=>this.swaC(),t:(i,s)=>this.factionSpellMyTurn(i,s),p:(i,s)=>this.swaP(i,s)}}[t]}testPlay(t,e){return this.lookup(t).t(e,e.event)}actPlay(t,e){this.lookup(t).p(e,e.event)}trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e);return this.trigB&&i.jr4("PC"),i}ddf8(t){return t.event.code==="PLC"?this.testPlay(this.cardCode(),t):t.event.code==="TRE"&&this.cardCode()==="BLH"}jr8(t){if(t.event.code==="PLC")this.actPlay(this.cardCode(),t);else{const e=g.jr5(t.creatId);W.destroy(e,this.code)}x.triggerDone()}spellMyTurn(t,e){return e.playerA===t.owner&&L.getCard(e.cardCode).type==="S"}factionSpellMyTurn(t,e){if(e.playerA===t.owner){const i=L.getCard(e.cardCode);if(i.type==="S"&&i.faction===this.faction)return!0}return!1}enemyPlayed(t,e){return e.playerA!==t.owner}ownerAlive(t){return g.jr5(t).status==="A"}agrdC(){this.faction="A",this.rarity="C",this.name="Aetherguard",this.iAttack=this.boof6814,this.iHealth=this.iAttack-1,this.tribe.push("RB"),this.trigB=this.rawNug(0,lt.calcCreatValueFormula(0,0,this.level,0,0,!1,0),0,0),this.text=`When you play a spell, ${this.name} gets Armor ${this.level}.`}agrdP(t,e){g.jr5(t.trigger.creatId).addArmor(this.level)}arootC(){this.faction="U",this.rarity="H",this.name="Aether Root",this.iAttack=this.boof3610,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=[this.lValH(["ZZ+1","ZZ+2","ZZ+3"])];const t=this.boof234;this.text=`When you play an Uterra spell, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}arootP(t,e){const i=g.jr5(t.trigger.creatId),s=this.boof234;i.buff(s,s)}atrapC(){this.faction="T",this.rarity="C",this.name="Aethertap Shaman",this.iAttack=this.lValN([7,9,16]),this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.trigB=this.rawNug(0,lt.calcCreatValueFormula(0,0,0,0,1,!1,0),0,0),this.text=`When you play a spell, ${this.name} gets Mobility 1 this turn.`}atrapP(t,e){const i=g.jr5(t.trigger.creatId),s=y.mod("MB",1);s.expiry="ET",i.addMod(s)}arbysC(){this.faction="A",this.rarity="H",this.name="Anvillon Arbiter",this.iAttack=this.boof3714,this.iHealth=this.iAttack+3,this.iArmor=1,this.tribe.push("RB"),this.text="When the enemy player plays their second card in a turn, that player discards their hand.",this.trigB=this.rawNug(0,0,0,0,1)}arbysP(t,e){if(E.cardsPlayed>1&&this.ownerAlive(t.creatId)){const i=k.getActive();i.discard.push(...i.hand),i.hand=[]}}bblhC(){this.faction="T",this.rarity="L",this.name="Binben, Lightning Herald",this.iAttack=this.boof61017,this.iHealth=this.boof468,this.tribe.push("LT","AS");const t=L.getCard(this.lwy());this.text=`When you play a spell, Spawn a ${p.tokName(t)}. At the end of your turn, destroy it.`,this.trigB=this.spawnNug(t)}bblhP(t,e){if(this.ownerAlive(t.creatId)){const i=g.birth(this.lwy(),"S",t.owner);if(i){const s=i.jr4("TE",this.code);s.changes=!0}}}lwy(){return "LWY"+this.level}ccC(){this.faction="N",this.rarity="H",this.name="Crypt Conjurer",this.iAttack=this.boof258,this.iHealth=this.lValN([8,14,20]),this.tribe.push("VP"),this.text=`When you play a Nekrium spell, deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.trigB=this.playerNug(2*this.iAttack)}ccP(t,e){this.ownerAlive(t.creatId)&&(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}.`,this.trigB=this.regnNug(t)}dhwP(t,e){g.jr5(t.trigger.creatId).addRegen(this.boof124)}fbiC(){this.faction="T",this.rarity="H",this.name="Flamebreak Invoker",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("FR","GT"),this.text=`When you play a Tempys spell, deal ${this.level} damage to each enemy creature.`,this.trigB=this.buffNug(0,this.level*2)}fbiP(t,e){if(this.ownerAlive(t.creatId)){const i=R.tick();g.qEnemyCreats().forEach(s=>{s.hurtDirect(this.level,this.code,i)})}}flspkC(){this.faction="T",this.rarity="C",this.name="Flame Speaker",this.iAttack=this.lValN([2,6,13]),this.iHealth=this.level*6,this.tribe.push("HM");const t=this.boof235;this.text=`When you play a spell, deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t)}flspkP(t,e){this.ownerAlive(t.creatId)&&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.`,this.trigB=this.rawNug(0,0,0,0,.5)}izzyT(t,e){if(e.playerA===t.owner){const s=L.getCard(e.cardCode).cardCode();if(s==="IFL"||s==="IFR")return!0}return!1}izzyP(t,e){const i=g.jr5(t.trigger.creatId),h=L.getCard(e.cardCode).cardCode()==="IFL"?"IZL":"IZR";g.birth(`${h}${this.level}`,"R",i.owner,i.lane)}kasC(){this.faction="T",this.rarity="L",this.name="Kas, Arcweaver",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("LT","AS"),this.hints=["OL"],this.text="When you play a spell, Kas battles an additional time this turn.",this.trigB=this.buffNug(this.iAttack,0)}kasP(t,e){const i=g.jr5(t.trigger.creatId);i.extraBattles+=1}swaC(){this.faction="T",this.rarity="H",this.name="Sparkweaver Acolyte",this.iAttack=this.boof4610,this.iHealth=this.boof61218,this.tribe.push("LT","AS"),this.text=`When you play a Tempys spell, ${this.name} gets ${p.jr9(this.iAttack,0)} this turn.`,this.trigB=this.multNug(this.buffNug(this.iAttack,0),.5)}swaP(t,e){const i=g.jr5(t.trigger.creatId),s=y.mod("AT",this.iAttack);s.expiry="ET",i.addMod(s)}}class Re extends P{lookup(t){return{["KTS"]:{c:()=>this.kitC(),r:(i,s)=>this.kitR(i,s)},["RSC"]:{c:()=>this.scootC(),r:(i,s)=>this.scootR(i,s)},["SCC"]:{c:()=>this.shcrC(),r:(i,s)=>this.shcrR(i,s)},["SND"]:{c:()=>this.ssdC(),r:(i,s)=>this.ssdR(i,s)}}[t]}trigB;actReplace(t,e){this.lookup(t).r(e,$.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("RP");return s.bonus=this.trigB,i}ddf8(t){return t.creatId===t.event.replCreatId}jr8(t){this.actReplace(this.cardCode(),t),x.triggerDone()}kitC(){this.faction="U",this.rarity="H",this.name="Kitaru Sprite",this.iAttack=this.boof358,this.iHealth=this.boof71117,this.tribe.push("FY"),this.hints=["RT"],this.text=`When this is replaced, Spawn a ${this.name}.`,this.trigB=this.buffNug(0,this.iHealth)}kitR(t,e){g.birth(this.code,"S",t.owner)}scootC(){this.faction="A",this.rarity="T",this.name="Relic Scout",this.iAttack=this.level,this.iHealth=this.level,this.iArmor=this.level,this.isFree=!0,this.tribe.push("RB"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${p.jr9(this.level,this.level,!0)} and Armor ${this.level}.`,this.trigB=this.buffNug(this.level,lt.calcCreatValueFormula(this.level,this.level,this.level,0,0,!1,0))}scootR(t,e){e.creature.buff(this.level,this.level),e.creature.addArmor(this.level)}shcrC(){this.faction="U",this.rarity="C",this.name="Shardclaw Crusher",this.iAttack=this.boof5812,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${p.jr9(this.iAttack,this.iAttack)}.`,this.trigB=this.multNug(this.buffNug(this.iAttack,this.iAttack),.5)}shcrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}ssdC(){this.faction="U",this.rarity="R",this.name="Spiritstone Druid",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("TG"),this.hints=["RT"],this.text=`When ${this.name} is replaced, put a ${this.iAttack}/${this.iHealth} Spirit into each adjacent available lane.`,this.trigB=this.buffNug(this.iAttack,this.iHealth),this.trigB.count=1}ssdR(t,e){const i=e.replCreat.adjacent,s=g.emptyLanes(t.owner),h=R.tick();i.forEach(f=>{s.includes(f)&&g.birth("SPU"+this.level,"P",t.owner,f,h)})}}class le extends P{lookup(t){return{["BST"]:{c:()=>this.brimC(),u:(i,s)=>this.brimR(i,s)},["OSV"]:{c:()=>this.scavC(),u:(i,s)=>this.scavR(i,s)},["RHU"]:{c:()=>this.tiaC(),u:(i,s)=>this.tiaR(i,s)},["SKS"]:{c:()=>this.spsoC(),u:(i,s)=>this.spsoR(i,s)},["SWG"]:{c:()=>this.stgrC(),u:(i,s)=>this.stgrR(i,s)},["VTW"]:{c:()=>this.weldC(),u:(i,s)=>this.weldR(i,s)},["WEB"]:{c:()=>this.webC(),u:(i,s)=>this.webR(i,s)}}[t]}actUpgrade(t,e){this.lookup(t).u(e,$.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){return this.rarity==="T"?super.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e);return i.jr4("UP"),i}jr8(t){this.actUpgrade(this.cardCode(),t),x.triggerDone()}brimC(){this.faction="T",this.rarity="L",this.name="Brimstone Tyrant",this.iAttack=this.boof6916,this.iHealth=this.iAttack,this.tribe.push("FR","EL"),this.hints=["RD"];const t=this.boof468;this.text=`Upgrade: Deal ${t} damage to each other creature.`}brimR(t,e){const i=R.tick(),s=this.boof468;g.creatByTarget(y.crNotMeTarg(t.creatId)).forEach(h=>h.hurtDirect(s,this.code,i))}scavC(){this.faction="A",this.rarity="H",this.name="Oreian Scavenger",this.iAttack=this.boof6916,this.iHealth=1,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Armor ${this.iAttack}.`}scavR(t,e){e.creature.addArmor(this.iAttack)}tiaC(){this.faction="A",this.rarity="L",this.name="Relic Hunter",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iBT=!0,this.tribe.push("HM"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets +attack and +health equal to the creature it replaced.`}tiaR(t,e){e.creature.buff(e.replCreat.attack,e.replCreat.health)}spsoC(){this.faction="T",this.rarity="C",this.name="Sparksoul",this.iAttack=this.boof6915,this.iHealth=this.iAttack-1,this.tribe.push("LT","EL"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets Aggressive.`}spsoR(t,e){e.creature.aggressive=!0}stgrC(){this.faction="A",this.rarity="C",this.name="Steelwatch Guard",this.iAttack=this.boof4711,this.iHealth=this.iAttack,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: ${this.name} gets ${p.jr9(this.iAttack,this.iAttack)}.`}stgrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}weldC(){this.faction="A",this.rarity="R",this.name="Vault Welder",this.iAttack=this.boof71118,this.iHealth=this.lValN([9,14,22]),this.iDefend=!0,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: Negate Defender from ${this.name}.`}weldR(t,e){e.creature.negateDefender=!0}webC(){this.faction="N",this.rarity="T",this.name="Web",this.iAttack=0,this.iHealth=1,this.iDefend=!0,this.tribe.push("WB"),this.text=`Upgrade: ${this.name} attack and health become equal to the creature it replaced.`}webR(t,e){e.creature.buff(e.replCreat.attack,e.replCreat.health-1)}}class St extends P{lookup(t){return{["CGF"]:{c:()=>this.cfiendC(),v:(i,s)=>this.cfiendV(i,s)},["CSB"]:{c:()=>this.corpsC(),v:(i,s)=>this.corpsV(i,s)},["CYS"]:{c:()=>this.cslmC(),v:(i,s)=>this.cslmV(i,s)},["DSK"]:{c:()=>this.dskC(),v:(i,s)=>this.dskV(i,s)},["FST"]:{c:()=>this.fstrC(),v:(i,s)=>this.fstrV(i,s)},["FWK"]:{c:()=>this.fwlkC(),v:(i,s)=>this.fwlkV(i,s)},["FFD"]:{c:()=>this.ffC(),v:(i,s)=>this.ffV(i,s)},["FSC"]:{c:()=>this.flwcC(),v:(i,s)=>this.flwcV(i,s)},["GVS"]:{c:()=>this.ghsC(),v:(i,s)=>this.ghsV(i,s)},["GBG"]:{c:()=>this.ggC(),v:(i,s)=>this.ggV(i,s)},["GMR"]:{c:()=>this.gromC(),v:(i,s)=>this.gromV(i,s)},["MMX"]:{c:()=>this.mmeC(),v:(i,s)=>this.mmeV(i,s)},["NOZ"]:{c:()=>this.nyozC(),v:(i,s)=>this.nyozV(i,s)},["POX"]:{c:()=>this.poxC(),v:(i,s)=>this.poxV(i,s)},["RSZ"]:{c:()=>this.rszC(),v:(i,s)=>this.rszV(i,s)},["SFM"]:{c:()=>this.spirmC(),v:(i,s)=>this.spirmV(i,s)},["SNT"]:{c:()=>this.sssC(),v:(i,s)=>this.sssV(i,s)},["VGN"]:{c:()=>this.vgfsC(),v:(i,s)=>this.vgfsV(i,s)},["XHS"]:{c:()=>this.xhostC(),v:(i,s)=>this.xhostV(i,s)},["ZTU"]:{c:()=>this.zimusC(),v:(i,s)=>this.zimusV(i,s)}}[t]}cardVengeance(t,e){this.lookup(t).v(e,$.toCreature(e.event))}vtext="";trigB;fixedImgCreat=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.trigB&&(this.text="Vengeance: "+this.vtext),this.vtext=""}image(t){return this.fixedImgCreat?this.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e);if(this.trigB){const s=i.jr4("VN");s.bonus=this.trigB}return i}jr8(t){this.cardVengeance(this.cardCode(),t),x.triggerDone()}cfiendC(){this.faction="N",this.rarity="T",this.name="Contagion Fiend",this.iAttack=this.boof234,this.iHealth=this.boof5812,this.tribe.push("AB"),this.fixedImgCreat=!0;const t=-this.level;this.vtext=`Each enemy creature gets ${p.jr9(t,t)}.`;const e=this.boof246;this.trigB=this.buffNug(e,e)}cfiendV(t,e){const i=-this.level,s=R.tick(),h=y.crTarg();h.player=k.toTarget(!t.owner),g.creatByTarget(h).forEach(f=>f.buff(i,i,s))}corpsC(){this.faction="N",this.rarity="C",this.name="Corpulent Shambler",this.iAttack=this.lValN([5,7,15]),this.iHealth=this.iAttack,this.tribe.push("ZB"),this.vtext="Put a 3/3 Zombie into this lane.",this.trigB=this.buffNug(3,3)}corpsV(t,e){const i=`${"ZBS"}${this.level}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}cslmC(){this.faction="N",this.rarity="C",this.name="Crypt Slime",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.vtext="Put a 1/1 Oozeling into this lane.",this.trigB=this.buffNug(1,1)}cslmV(t,e){const i=`${"COZ"}${this.level}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}dskC(){this.faction="N",this.rarity="C",this.name="Death Seeker",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.fixedImgCreat=!0,this.hints=["ST"];const t=this.boof51015;this.vtext=`Put a ${t}/${t} Spirit into this lane.`,this.trigB=this.buffNug(t,t)}dskV(t,e){const i=`${"SPN"}${this.level}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}fstrC(){this.faction="N",this.rarity="R",this.name="Fell Strider",this.iAttack=this.lValN([4,8,10]),this.iHealth=this.boof369,this.tribe.push("ZB");const t=L.getCard(this.fsz());this.vtext=`Spawn a ${p.tokName(t)}.`,this.trigB=this.multNug(this.buffNug(t.iAttack,t.iHealth),.5)}fstrV(t,e){g.birth(this.fsz(),"S",e.creature.owner)}fsz(){return "ZST"+this.level}fwlkC(){this.faction="N",this.rarity="C",this.name="Fell Walker",this.iAttack=this.boof359,this.iHealth=this.iAttack,this.tribe.push("ZB");const t=L.getCard(Z.zomc(this.level));this.vtext=`Put a ${p.tokName(t)} into this lane.`,this.trigB=this.buffNug(t.iAttack,t.iHealth)}fwlkV(t,e){g.birth(Z.zomc(this.level),"P",e.creature.owner,e.creature.lane)}ffC(){this.faction="N",this.rarity="H",this.name="Fleshfiend",this.iAttack=this.boof6812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.vtext=`Put a level ${this.level-1} ${this.name} into this lane.`,this.level>1&&(this.trigB=this.buffNug(0,this.lValN([0,6,15])))}ffV(t,e){const i=`${"FFD"}${this.level-1}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}flwcC(){this.faction="A",this.rarity="C",this.name="Flowsteel Carrier",this.iAttack=this.boof5915,this.iHealth=this.boof358,this.tribe.push("RB"),this.vtext=`Give a friendly Robot at random Armor ${this.iHealth}.`,this.trigB=this.regnNug(this.iHealth)}flwcV(t,e){const i=y.crTarg();i.player=k.toTarget(t.owner),i.tribe="RB";const s=g.creatByTarget(i);if(s.length>0){const h=s[S.randInt(0,s.length)];h.addArmor(this.iHealth),this.logAct(!1,h)}}ghsC(){this.faction="U",this.rarity="C",this.name="Glowhive Siren",this.iAttack=this.boof3814,this.iHealth=this.boof61117,this.tribe.push("IN"),this.vtext=`You gain ${this.boof124} to ${this.gghigh-1} health.`,this.trigB=this.playerNug(this.boof258)}ghsV(t,e){const i=S.randInt(this.boof124,this.gghigh);k.heal(t.owner,i)}get gghigh(){return this.lValN([5,9,13])}ggC(){this.faction="N",this.rarity="C",this.name="Graveborn Glutton",this.iAttack=this.boof61117,this.iHealth=this.boof3814,this.tribe.push("AB"),this.vtext=`Deal ${this.boof124} to ${this.gghigh-1} damage to the enemy player.`,this.trigB=this.playerNug(this.boof258)}ggV(t,e){const i=S.randInt(this.boof124,this.gghigh);k.hurtDirect(!t.owner,i,this.code)}gromC(){this.faction="U",this.rarity="C",this.name="Grove Matriarch",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("PL");const t=Z.minionBuff(this.level),e=Z.minionName(this.level);this.vtext=`Put a ${t}/${t} ${e} into this lane.`,this.trigB=this.buffNug(t,t)}gromV(t,e){const i=Z.minionCode(this.level);g.birth(i,"P",e.creature.owner,e.creature.lane)}mmeC(){this.faction="A",this.rarity="C",this.name="Metamind Explorer",this.iAttack=this.boof3713,this.iHealth=this.iAttack+2,this.tribe.push("MM"),this.vtext=`Draw ${this.level} cards.`,this.trigB=this.rawNug(0,0,0,0,this.level*lt.dcWeight)}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.trigB=this.buffNug(t,t)}nyozV(t,e){const i=`${"OOZ"}${this.level}`;g.birth(i,"P",e.creature.owner,e.creature.lane)}poxC(){if(this.faction="N",this.rarity="H",this.name="Progeny of Xith",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.tribe.push("AB"),this.hints=["LB"],this.vtext=`Spawn a level ${this.level+1} ${this.name}.`,this.level<3){const t=this.lValN([10,6,0]);this.trigB=this.buffNug(t,t)}}poxV(t,e){const i=`${"POX"}${this.level+1}`;g.birth(i,"S",e.creature.owner)}rszC(){this.faction="N",this.rarity="R",this.name="Runescarred Zombie",this.iAttack=this.lValN([5,8,16]),this.iHealth=this.boof359,this.tribe.push("ZB"),this.vtext=`Put a ${p.levelGateText(this.level,!0)}spell at random from your discard pile into your hand.`,this.trigB=this.rawNug(0,0,0,0,.5)}rszV(t,e){const i=k.toPlayer(t.owner),s=y.target("TD");s.player=k.toTarget(i),s.card="S",s.level=D.ddf2(this.level);const h=D.deckByTarget(s);if(h.length>0){const f=h[S.randInt(0,h.length)];i.discard.splice(f[1],1),i.hand.push(f[0])}}spirmC(){this.faction="T",this.rarity="H",this.name="Spiritflame Mystic",this.iAttack=this.boof6912,this.iHealth=this.iAttack-3,this.tribe.push("HM"),this.vtext=`Deal ${this.boof246} damage to each creature.`,this.trigB=this.rawNug(0,0,0,0,.2)}spirmV(t,e){const i=this.boof246,s=R.tick();g.qActiveCreats().forEach(h=>h.hurtDirect(i,this.code,s))}sssC(){this.faction="N",this.rarity="L",this.name="Spiritstone Sentry",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("ST"),this.vtext=`If ${this.name} was in a side lane, Spawn a ${this.name}.`,this.hints=["ST"],this.trigB=this.buffNug(this.iAttack,this.iAttack)}sssV(t,e){(e.creature.lane===1||e.creature.lane===5)&&g.birth(e.creature.code,"S",t.owner)}vgfsC(){this.faction="N",this.rarity="C",this.name="Vengeful Spirit",this.iAttack=this.boof357,this.iHealth=this.iAttack-2,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof369n;this.vtext=`Give the opposing creature ${p.jr9(t,t)}.`,this.trigB=this.buffNug(-t,-t)}vgfsV(t,e){const i=e.creature.opposed;if(i){const s=this.boof369n;i.buff(s,s)}}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.iAttack=this.boof359,this.iHealth=this.boof135,this.tribe.push("AB"),this.vtext=`Deal ${this.iAttack} damage to the enemy player and you gain ${this.iAttack} health.`,this.trigB=this.playerNug(this.iAttack*2)}xhostV(t,e){const i=this.iAttack;k.hurtDirect(!t.owner,i,this.code),k.heal(t.owner,i)}zimusC(){this.faction="N",this.rarity="L",this.name="Zimus, the Undying",this.iAttack=this.boof51014,this.iHealth=this.lValN([2,5,7]),this.tribe.push(this.level===1?"HM":"ZB"),this.vtext=`Spawn a Zimus, the ${this.level===2?"Returned":"Undying"}.`,this.level<3?(this.hints=["LG"],this.level===2?(this.trigB=this.buffNug(this.iAttack,this.iHealth),this.hints.push("ZZ-5")):this.hints.push("ZZ-1")):(this.hints=["ST","ZZ-5"],this.trigB=this.buffNug(this.iAttack,this.iHealth),this.trigB.bonus=1)}zimusV(t,e){let i;this.level===2?i=`${"ZTR"}2`:i=`${"ZTU"}3`,g.birth(i,"S",t.owner)}}class hi extends kt{lookup(t){return{["IRT"]:{c:()=>this.infrC(),m:i=>this.infrM(i)},["NXB"]:{c:()=>this.nexbC(),m:i=>this.nexbM(i)}}[t]}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.overload=!0,this.maxLevel=1,this.lookup(this.cardCode()).c()}nexus=!1;playTargets(){const t=super.playTargets();return t.push(y.playerActTarg("F","CARD",this.code,"")),t}handleAction(t){this.logSpell();const e=k.toPlayer(t.playerA),i={effId:R.genId(),logicCode:this.code};e.effects.push(i),this.enforcePlayerEffect(i,e),T.spellCast()}enforcePlayerEffect(t,e){const i=this.cardCode(),s=this.createMod(i,t.effId),h=this.nexus?[3]:[1,5];g.qPlayerCreats(e.isPlayerA).forEach(f=>{f.faction===this.faction&&h.includes(f.lane)?f.addModSafe(s):f.removeModSafe(t.effId)})}infrC(){this.faction="N",this.rarity="L",this.name="Infernal Ritual",this.text='You get "Each friendly Nekrium creature in the side lanes get Regenerate 2".'}infrM(t){return y.mod("RG",2,t)}nexbC(){this.faction="A",this.rarity="L",this.name="Nexus Bubble",this.nexus=!0,this.text='You get "Friendly Alloyin creatures in the center lane get Armor 3".'}nexbM(t){return y.mod("AR",3,t)}}class It extends kt{lookup(t){return{["AEC"]:{c:()=>this.anceC(),p:i=>this.aeZ(i)},["DIS"]:{c:()=>this.disnC(),p:i=>this.disnZ(i)},["DRE"]:{c:()=>this.dracC(),p:i=>this.deZ(i)},["DCH"]:{c:()=>this.dchantC(),p:i=>this.dchantZ(i)},["EVT"]:{c:()=>this.endvC(),p:i=>this.endvZ(i)},["ESU"]:{c:()=>this.esrgC(),p:i=>this.esrgZ(i)},["HOX"]:{c:()=>this.howlC(),p:i=>this.howlZ(i)},["IGR"]:{c:()=>this.icegC(),p:i=>this.icegZ(i)},["ITO"]:{c:()=>this.itorC(),p:i=>this.itorZ(i)},["IME"]:{c:()=>this.imecC(),p:i=>this.ieZ(i)},["LCE"]:{c:()=>this.lucidC(),p:i=>this.leZ(i)},["MSP"]:{c:()=>this.mendC(),p:i=>this.mendZ(i)},["NEM"]:{c:()=>this.netherC(),p:i=>this.netherZ(i)}}[t]}cardCast(t,e){this.lookup(t).p(e)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(y.playerActTarg(this.playTarg,"CARD",this.code,"")),t}handleAction(t){this.logSpell();const e=k.toPlayer(t.playerA);this.cardCast(this.cardCode(),e),T.spellCast()}ddf8(t){if(t.trigger.type==="TE")return t.event.playerA===t.owner;if(t.trigger.type==="PC"){const e=t.event,i=L.getCard(e.cardCode);return i.type==="S"&&i.faction==="T"&&e.playerA===t.owner}else if(t.trigger.type==="EF"){const e=$.toEnterField(t.event);return e.creature.faction==="U"&&e.creature.owner===t.owner}else return!1}jr8(t){const e=Nt.extractCardCode(t.trigger.logicCode),i=t.event;let s=!1;if(e==="LCE"){s=!0;const h=k.toPlayer(i.playerA),f=this.level===1?1:2;this.logAct(!1),k.drawCard(h,f)}else if(e==="IME"){s=!0;const h=W.gravedigger(k.toTarget(t.owner),D.ddf2(this.level+1));h&&g.birth(h,"S",i.playerA)}else if(e==="DRE"){s=!0;const h=this.level===1?11:21;k.hurtDirect(!i.playerA,S.randInt(1,h),this.code)}else if(e==="IGR")k.hurtDirect(!i.playerA,2,this.code);else if(e==="EVT"){const h=$.toEnterField(t.event);h.creature.buff(1,1),this.logAct(!1,h.creature)}else if(e==="AEC"){s=!0;const h=g.qPlayerCreats(t.owner);if(h.length>0){const f=this.level===1?[1,2]:[2,4];h.forEach(m=>{this.logAct(!1,m),m.buff(f[0],f[1])})}}else super.jr8(t);if(s&&this.level<3){const h=k.toPlayer(i.playerA),f=y.trigIdx(h.triggers,t.trigger);f>-1?t.trigger.customCode==="P2"?h.triggers[f].customCode="P1":h.triggers.splice(f,1):console.error("Wery curious, could not find player trigger ",t.trigger)}x.triggerDone()}echTxt(){return"At the end of "+(this.level===3?"each of your turns":"this turn and your next turn")+", "}echoZ(t){const e=y.trigger("TE",this.code);return this.level<3&&(e.customCode="P2"),e.changes=!0,t.triggers.push(e),e}anceC(){this.faction="U",this.rarity="L",this.name="Ancestral Echoes",this.playTarg="F";const t=this.level===1?[1,2]:[2,4];this.text=`${this.echTxt()}each friendly creature gets ${p.jr9(t[0],t[1])}.`}aeZ(t){const e=this.echoZ(t),i=this.boof248;e.bonus=this.buffNug(i,i*2)}disnC(){this.faction="T",this.rarity="R",this.name="Disintigrate",this.playTarg="E",this.text=`Deal 1 to ${this.dshigh-1} damage to the enemy player.`}disnZ(t){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.`}deZ(t){const e=this.echoZ(t),i=this.lValN([4,9,25]);e.bonus=this.playerNug(i)}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){k.heal(t,this.boof81220)}endvC(){this.faction="U",this.rarity="L",this.name="Enduring Vitality",this.overload=!0,this.maxLevel=1,this.playTarg="F",this.text=`You get "When a friendly Uterra creature enters play, it gets ${p.jr9(1,1)}".`}endvZ(t){const e=y.trigger("EF",this.code);e.changes=!0,t.triggers.push(e),e.bonus=this.buffNug(4,4)}esrgC(){this.faction="A",this.rarity="R",this.name="Energy Surge",this.isFree=this.level>1,this.overload=this.level===3,this.level===1&&(this.hints=["LG"]),this.playTarg="F",this.text=`Draw ${this.level} card${this.level>1?"s":""}.`}esrgZ(t){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(),i=e.rank*3;k.hurtDirect(t,i,this.code),k.heal(e,i)}icegC(){this.faction="T",this.rarity="L",this.name="Ice Grasp",this.overload=!0,this.maxLevel=1,this.playTarg="F",this.text='You get "When you play a Tempys spell, deal 2 damage to the enemy player".'}icegZ(t){const e=y.trigger("PC",this.code);e.changes=!0,t.triggers.push(e),e.bonus=this.playerNug(6)}itorC(){this.faction="T",this.rarity="R",this.name="Ice Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg="E",this.text=`Deal ${this.boof234} damage to the enemy player.`}itorZ(t){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 ${p.levelGateText(this.level+1,!0)}creature that was destroyed this game`;this.text=`${this.echTxt()}${t}.`}ieZ(t){const e=this.echoZ(t),i=this.lValN([1,1,3]);e.bonus=this.multNug(this.avgSpawnNug(),i)}lucidC(){this.faction="A",this.rarity="L",this.name="Lucid Echoes",this.playTarg="F";const t=this.level===1?"draw 1 card":"draw 2 cards";this.text=`${this.echTxt()}${t}.`}leZ(t){const e=this.echoZ(t),i=this.boof124*lt.dcWeight;e.bonus=this.rawNug(0,0,0,0,i)}mendC(){this.faction="U",this.rarity="R",this.name="Mending Spring",this.playTarg="F",this.text=`You gain 1 to ${this.mendboof} Health.`}mendZ(t){ht.simOn?this.boof61224:this.mendboof+1,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 Or 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 ${p.dbdtap()}, ${this.name} gets ${p.jr9(this.level,this.level)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM"),h=this.boof246;return s.bonus=this.buffNug(h,h),i}ddf8(t){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}jr8(t){g.jr5(t.creatId).buff(this.level,this.level),x.triggerDone()}}class Lt extends P{lookup(t){return{["AIV"]:{c:()=>this.avinvC(),r:i=>this.avinvR(i)},["BSP"]:{c:()=>this.bskphC(),r:i=>this.bskphR(i)},["CRC"]:{c:()=>this.crucC(),r:i=>this.crucR(i)},["ESK"]:{c:()=>this.ebknC(),r:i=>this.ebknR(i)},["FWC"]:{c:()=>this.fwcC(),r:i=>this.fwcR(i)},["FME"]:{c:()=>this.feggC(),r:i=>this.feggR(i)},["MMV"]:{c:()=>this.mmovC(),r:i=>this.mmovR(i)},["PSH"]:{c:()=>this.porshC(),r:i=>this.porshR(i)},["RGG"]:{c:()=>this.runegC(),r:i=>this.runegR(i)},["SSR"]:{c:()=>this.solrevC(),r:i=>this.solrevR(i)},["SSM"]:{c:()=>this.spshamC(),r:i=>this.spshamR(i)},["SSG"]:{c:()=>this.snoutC(),r:i=>this.snoutR(i)},["UGM"]:{c:()=>this.mantisC(),r:i=>this.mantisR(i)}}[t]}rtext="";trigB;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Gain Rank: "+this.rtext,this.rtext=""}image(t){return this.rarity==="T"?this.cardCode()==="FWC"?this.rawImage("MPH",t):super.fixedImage(t):super.image(t)}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("RU");return s.bonus=this.trigB,i}ddf8(t){return t.event.playerA===t.owner}jr8(t){this.lookup(this.cardCode()).r(t),x.triggerDone()}avinvC(){this.faction="T",this.rarity="H",this.name="Avalanche Invoker",this.iAttack=this.boof6914,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS"),this.hints=["TL"];const t=this.boof3612;this.trigB=this.buffNug(t,0),this.rtext=`Deal ${t} damage to each non-Tempys creature.`}avinvR(t){const e=this.boof3612,i=R.tick();g.qActiveCreats().filter(s=>s.faction!=="T").forEach(s=>s.hurtDirect(e,this.code,i))}bskphC(){this.faction="N",this.rarity="C",this.name="Blightskull Phantasm",this.iAttack=this.boof5814,this.iHealth=this.boof61017,this.tribe.push("ST"),this.hints=["TL","OP"];const t=this.boof369n;this.trigB=this.buffNug(0,-t),this.rtext=`The opposing creature gets ${p.jr9(t,t)}.`}bskphR(t){const i=g.jr5(t.creatId).opposed;if(i){const s=this.boof369n;i.buff(s,s)}}crucC(){this.faction="A",this.rarity="R",this.name="Crucible Colossus",this.iAttack=this.boof61016,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.iDefend=!0,this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,.2),this.rtext=`Negate Defender from ${this.name}.`}crucR(t){const e=g.jr5(t.creatId);e.negateDefender=!0}ebknC(){this.faction="N",this.rarity="H",this.name="Ebonskull Knight",this.iAttack=this.lValN([9,13,18]),this.iHealth=this.iAttack-2,this.tribe.push("VP"),this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,-1),this.rtext=`Destroy ${this.name}.`}ebknR(t){const e=g.jr5(t.creatId);W.destroy(e,this.code)}fwcC(){this.faction="U",this.rarity="T",this.maxLevel=1,this.name="Feywing Chrysalis",this.iAttack=0,this.iHealth=3,this.tribe.push("CR"),this.iDefend=!0,this.trigB=this.buffNug(5,5),this.rtext=`Replace ${this.name} with a 9/9 Feywing.`}fwcR(t){const e=g.jr5(t.creatId);g.birth(`${"FWG"}1`,"R",e.owner,e.lane)}feggC(){this.faction="T",this.rarity="T",this.minLevel=this.level,this.maxLevel=this.level,this.name="Frostmane Egg",this.iAttack=0,this.iHealth=6,this.tribe.push("DG"),this.iDefend=!0;const t=this.lValN([6,9,13]);this.trigB=this.buffNug(t,t),this.rtext=`Replace ${this.name} with a level ${this.level} Frostmane Dragon.`}feggR(t){const e=g.jr5(t.creatId);g.birth(`${"FMD"}${this.level}`,"R",e.owner,e.lane)}mmovC(){this.faction="A",this.rarity="C",this.name="Metamind Overseer",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,lt.dcWeight*.6),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.trigB=this.multNug(this.avgSpawnNug(),.4),this.rtext="Spawn a random creature that was destroyed this game."}porshR(t){const e=W.gravedigger();e&&g.birth(e,"S",t.owner)}runegC(){this.faction="U",this.rarity="H",this.name="Runegrove Guardian",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=["TL"],this.trigB=this.buffNug(0,this.iAttack),this.rtext=`${this.name} gets ${p.jr9(this.iAttack,this.iAttack)}.`}runegR(t){g.jr5(t.creatId).buff(this.iAttack,this.iAttack)}solrevC(){this.faction="U",this.rarity="L",this.name="Solstice Reveler",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hints=["TL"];const t=this.boof248;this.trigB=this.buffNug(t,t);const e=this.level===3;let i="";e&&(i=", and Breakthrough"),this.rtext=`Each friendly creature gets ${p.jr9(t,t,e)}${i}.`}solrevR(t){const e=this.boof248;g.ddf1().forEach(i=>{i.buff(e,e),this.level===3&&(i.breakthrough=!0)})}spshamC(){this.faction="T",this.rarity="C",this.name="Spiritfrost Shaman",this.iAttack=this.boof71117,this.iHealth=this.boof4610,this.tribe.push("HM"),this.hints=["TL"];const t=this.boof579;this.rtext=`Deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t)}spshamR(t){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}.`,this.trigB=this.buffNug(0,this.iHealth)}snoutR(t){g.jr5(t.creatId).heal(this.snoutbof)}get snoutbof(){return this.level*10}mantisC(){this.faction="U",this.rarity="C",this.name="Umbraglim Mantis",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("IN"),this.hints=["TL"];const t=this.mantbof;this.rtext=`You gain ${t} health.`,this.trigB=this.playerNug(t/3)}mantisR(t){k.heal(t.owner,this.mantbof)}get mantbof(){return this.lValN([8,10,12])}}class zr extends kt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Remembrance",this.text=`Banish a ${p.levelGateText(this.level,!0)}creature from your discard pile, then Spawn a copy of it.`}playTargets(){const t=super.playTargets();if(this.remCrds().length===0)return t;const e=D.boardTarget("CARD",this.code);return e.param="P1",t.push(e),t}remCrds(){const t=k.getActive(),e=y.target("TD");return e.player=k.toTarget(t),e.card="C",e.level=D.ddf2(this.level),wt.generateContent(t.discard,!1,e)}handleAction(t){if(t.param==="P1"){const e=this.remCrds(),i=e.map(h=>{const f=y.deckSelectAction("CARD",h.cardCode,h.sourceIdx);return f.host=this.code,f}),s=T.cancelAction();s.param="PM",i.push(s),wt.showCustomDeck(e,i)}else{const e=t,i=k.getActive();i.discard.splice(e.position,1);const s=g.birth(e.card,"S",i.isPlayerA);this.logSpell(s),At.popMode(),T.spellCast()}}}class Zr 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} ${p.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.interactive=!0,s.bonus=this.buffNug(this.iAttack,0),i}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId&&t.owner===k.getActiveB()}jr8(t){const e=D.toActions(y.crEnemyActTarg("CARD",this.code,S.enTil(t.creatId,t.event.dmg)));e.length>0?(e.push(T.noneEndTrigger()),T.ddf5(e)):x.triggerDone()}handleAction(t){const e=S.deTil(t.param);g.ddf6(t).hurtDirect(parseInt(e[1]),this.code),T.actionDone(!0)}}class Yr extends Ut{jr3(t,e){const i=super.jr3(t,e);return i.jr4("AS"),i}jr8(t){if(t.trigger.type==="AS"){let e=!0;for(;e;){const i=g.birth(this.code,"S",t.owner);i?i.opposed&&(e=!1):e=!1}x.triggerDone()}else super.jr8(t)}}class Kr 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");let e=": ",i=1;this.level<3&&(e=", destroy another friendly creature: ",i=.5);const s=`Destroy an enemy ${p.levelGateText(this.level+1,!0)}creature.`;this.text=`Activate${e}${s}`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),i)}}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){let e;this.level===3?e=this.enemies(t):e=this.friends(t),e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param),i=g.jr5(e[0]),s=g.ddf6(t);if(e[1]==="P1"){const h=this.enemies(i,s.id);h.push(T.cancelAction()),T.ddf5(h)}else{this.logAct(!0);const h=R.tick();if(this.level<3){const f=g.jr5(e[2]);W.destroy(f,this.code,h)}W.destroy(s,this.code,h),i.endActivation()}}friends(t){const e=y.crFriendNotMeActTarg("CARD",t.id,this.code,S.enTil(t.id,"P1"));return D.toActions(e)}enemies(t,e=""){const i=y.crEnemyActTarg("CARD",this.code,S.enTil(t.id,"P2",e));return i.level=D.ddf2(this.level+1),D.toActions(i)}}class Xr 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={activ8:this.rawNug(0,0,0,0,this.level*.5)}}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){const e=this.enemies(t);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param),i=g.jr5(e[1]);if(e[0]==="P1"){const s=g.ddf6(t),h=this.empties(i,s.id);h.push(T.cancelAction()),T.ddf5(h)}else{const s=g.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),i.endActivation()}}empties(t,e=""){const i=y.emptyPlayerActTarg("E","CARD",this.code,S.enTil("P2",t.id,e));return D.toActions(i)}enemies(t){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P1",t.id));return D.toActions(e)}}class qr extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Shadowsmith",this.iAttack=this.boof3612,this.iHealth=this.boof6915,this.tribe.push("DF","HM"),this.text=`When ${this.name} or another friendly Darkforged enters play on your turn, you may discard and level up a card.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("EF");return s.bonus=this.rawNug(0,0,0,0,.5),s.interactive=!0,i}handleAction(t){E.levelAndDiscardA(t),T.actionDone(!0)}ddf8(t){const e=$.toCreature(t.event);return e.creature.owner===t.owner&&t.owner===k.activePlayer&&e.creature.isTribe("DF")}jr8(t){const e=y.lvlHandActTarg(this.code,t.creatId),i=D.toActions([e,D.buttonTarget("NOTR")]);i.length>1?T.ddf5(i):x.triggerDone()}}class Ee 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 i=p.levelGateText(this.level-1);this.text=`When you play a ${i} ${p.factionText(this.faction)} card, you may ${this.tuxt}.`}else this.hints=["LG"];this.tuxt=""}tuxt="";dark(){this.faction="N",this.name="Darkshaper Savant",this.tribe.push("ZB");const t=-this.boof135;this.tuxt=`give an enemy creature ${p.jr9(t,t)}`}life(){this.faction="U",this.name="Lifeshaper Savant",this.tribe.push("SE");const t=this.boof135;this.tuxt=`give another friendly creature ${p.jr9(t,t)}`}steel(){this.faction="A",this.name="Steelshaper Savant",this.tribe.push("HM"),this.tuxt=`give another friendly creature Armor ${this.boof124}`}flame(){this.faction="T",this.name="Flameshaper Savant",this.tribe.push("HM"),this.tuxt=`deal ${this.boof147} damage to target creature or player`}jr3(t,e){const i=super.jr3(t,e);if(this.level>1){const s=i.jr4("PC");s.interactive=!0,s.bonus=this.rawNug(0,0,0,0,this.level*.5)}return i}ddf8(t){if(t.event.playerA===t.owner){const e=L.getCard(t.event.cardCode);if(e.level0}startActivation(t){const e=this.empties(t);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);g.birth(`${this.hc()}`,"P",t.playerA,t.lane),e.endActivation()}empties(t){const e=y.emptyPlayerActTarg("F","CARD",this.code,t.id);return D.toActions(e)}}class Qr 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 i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="A",i}enforceEffect(t,e){if(e.status==="A"){const s=y.mod("ND",!0,e.id);g.qActiveCreats().forEach(h=>h.addModSafe(s))}else g.qActiveCreats().forEach(s=>s.removeModSafe(e.id))}}class _r extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Spiritcleave",this.text=`Destroy a ${p.levelGateText(this.level+1,!0)}creature with the highest health among all creatures.${this.level===3?"~You gain health equal to that creature's health.":""}`}playTargets(){const t=super.playTargets();let e=-1;const i=g.qActiveCreats();i.forEach(f=>{f.health>e&&(e=f.health)});const s=i.filter(f=>f.health===e).map(f=>f.id),h=y.crActTarg("CARD",this.code,"");return h.level=D.ddf2(this.level+1),h.victims=S.enTil(...s),this.level<3&&(h.hint=["KL"]),t.push(h),t}handleAction(t){this.logSpell();const e=g.ddf6(t);W.destroy(e,this.code),this.level===3&&k.heal(k.getActiveB(),e.health),T.spellCast()}}class ts extends kt{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Spiritleash";const e=this.boof5814;this.text=`Destroy a friendly creature.~Give a creature ${p.jr9(e,e)}.`}playTargets(){const t=super.playTargets(),e=y.crFriendActTarg("CARD",this.code,"P1");return g.creatByTarget(e).length>0&&g.qActiveCreats().length>1&&t.push(e),t}handleAction(t){const e=S.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=y.crNotMeActTarg("CARD",i.id,this.code,S.enTil("P2",i.id));s.hint=["BF"];const h=D.toActions(s);h.push(T.cancelAction()),T.ddf5(h)}else{this.logSpell(i);const s=g.jr5(e[1]),h=this.boof5814;W.destroy(s,this.code),i.buff(h,h),T.spellCast()}}}class es 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} ${p.dbdtac()}, this gets ${p.jr9(this.level,this.level)}.~Allied Tempys: Activate: Deal ${this.level} damage to another creature. This gets ${p.jr9(this.level,this.level)}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),i}zapTargs(t){const e=y.crNotMeActTarg("CARD",t,this.code,t);return e.hint=["HR"],D.toActions([e,D.buttonTarget("CANC")])}canActivate(t){return this.zapTargs(t.id).length>1&&t.hasMod(t.id)}startActivation(t){T.ddf5(this.zapTargs(t.id))}ddf8(t){return t.event.battle&&t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}handleAction(t){const e=g.ddf6(t),i=g.jr5(t.param);this.logAct(!0),e.hurtDirect(this.level,this.code),i.buff(this.level,this.level),i.endActivation()}jr8(t){const e=g.jr5(t.creatId);if(t.trigger.type==="FR"){if(E.allied("T")){e.addMod(y.mod("AL",!0,e.id)),e.changed=!0;const i=e.jr4("NT");i.bonus=this.buffNug(this.boof246,this.level)}}else t.trigger.type==="DM"&&e.buff(this.level,this.level);x.triggerDone()}}class is 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 i=super.jr3(t,e),s=i.jr4("PC");return s.interactive=!0,s.bonus=this.rawNug(0,0,0,0,.5),i}handleAction(t){const e=g.ddf6(t);this.logAct(!1,e);const i=y.mod("DF",!0);i.expiry="EN",e.addMod(i),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&L.getCard(t.event.cardCode).type==="S"}jr8(t){const e=y.crFriendActTarg("CARD",this.code,t.creatId);e.canDefender=!0;const i=D.toActions(e);i.length===0?x.triggerDone():(i.push(T.noneEndTrigger()),T.ddf5(i))}}class rs 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.text=`Upgrade: You may ${p.daluac()}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("UP");return s.interactive=!0,i}handleAction(t){E.levelAndDiscardA(t),T.actionDone(!0)}jr8(t){const e=y.lvlHandActTarg(this.code,t.creatId),i=D.toActions(e);i.length>0?(i.push(T.noneEndTrigger()),T.ddf5(i)):x.triggerDone()}}class ss 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"],this.level===3?this.text="Activate: Level up a card in your hand. You may use this ability twice each turn.":this.text="Activate: Level a card in your hand, then discard it if its level is higher than your Rank.",this.bonus={activ8:this.rawNug(0,0,0,0,this.lValN([.8,1.7,3]))}}jr3(t,e){const i=super.jr3(t,e);return this.level===3&&(i.jr4("TS"),this.addExtraActivate(i)),i}jr8(t){if(t.trigger.type==="TS"){const e=g.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}canActivate(t){return k.toPlayer(t.owner).hand.some(i=>L.getCard(i).canLevel())}startActivation(t){const e=y.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),i=k.toPlayer(e.owner);this.level===3||i.rank>parseInt(t.card.slice(3))?i.hand[t.position]=L.getCard(t.card).levelUpCard():E.levelAndDiscardA(t),e.endActivation()}}class as 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 ${p.jr9(this.iAttack,0)}, Armor ${e}, and Breakthrough.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("DF",this.code);s.area="C";const h=i.addEffect("PS",this.code);return h.area="C",i}enforceEffect(t,e){const i=y.crNotMeTarg(e.id);if(i.player=k.toTarget(e.owner),g.creatByTarget(i).some(h=>!h.defender))e.removeModSafe(e.id);else{const h=y.mod("AT",this.iAttack,e.id),f=y.mod("AR",this.boof246,e.id),m=y.mod("BT",!0,e.id);e.addModSafe(h),e.addModSafe(f),e.addModSafe(m)}}}class ns 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.text=`At the start of each turn, ${this.name} moves to an available lane at random. Flank: Deal ${e} damage to the opposing creature.`}jr3(t,e){const i=this.boof246,s=super.jr3(t,e),h=s.jr4("TS");h.bonus=this.rawNug(0,0,i,0,.2);const f=s.jr4("FK");return f.bonus=this.buffNug(i,0),s}ddf8(t){return!0}jr8(t){if(t.trigger.type==="TS"){const e=g.emptyLanes(t.owner);e.length>0&&g.jr5(t.creatId).move(e[S.randInt(0,e.length)]),x.triggerDone()}else if(t.trigger.type==="FK"){const i=$.toCreature(t.event).creature.opposed;i&&i.hurtDirect(this.boof246,this.code),x.triggerDone()}else super.jr8(t)}}class os 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.bonus={activ8:this.buffNug(6,0)},this.text="Activate: Deal damage equal to a friendly creature's Armor to an enemy creature.~Forge: Each friendly creature gets Armor 6."}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const e=this.friends(t.id);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param),i=g.ddf6(t);if(e[1]==="P1"){const s=this.enemies(e[0],i.id);s.push(T.cancelAction()),T.ddf5(s)}else if(e[1]==="P2"){const s=g.jr5(e[0]),h=g.jr5(e[2]);this.logAct(!0,h),i.hurtDirect(h.armor,this.code),s.endActivation()}}jr8(t){g.ddf1().forEach(e=>e.addArmor(6)),x.triggerDone()}friends(t){const e=y.crFriendActTarg("CARD",this.code,S.enTil(t,"P1"));return e.hasArmor=!0,D.toActions(e)}enemies(t,e=""){const i=y.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",e));return D.toActions(i)}}class hs 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: ${p.daluac(!0)}.`,e=.5),this.bonus={activ8:this.rawNug(0,0,0,0,e)}}canActivate(t){return k.toPlayer(t.owner).hand.some(i=>L.getCard(i).canLevel())}startActivation(t){const e=y.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),i=k.toPlayer(e.owner);this.level===3?i.hand[t.position]=L.getCard(t.card).levelUpCard():E.levelAndDiscardA(t),e.endActivation()}}class ls extends bt{jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}jr8(t){if(t.trigger.type==="FR"){const e=t.owner?E.deathsA.length:E.deathsB.length;if(e>0){const i=R.tick();for(let s=0;s0}}class ds 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 ${p.jr9(0,this.iHealth)}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){const e=y.crActTarg("CARD",this.code,"");e.hint=["BF"];const i=y.actionTarget("TP","CARD",this.code,"");i.hint=["BF"];const s=[e,i,D.buttonTarget("NOTR")],h=D.toActions(s);T.ddf5(h)}handleAction(t){if(t.zone==="P")k.heal(t.playerA,this.iHealth);else{const e=g.ddf6(t);this.logAct(!1,e),e.buff(0,this.iHealth)}T.actionDone(!0)}}class us extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Tremorsaur",this.iAttack=0,this.iHealth=this.lValN([8,16,24]),this.tribe.push("DN"),this.text=`When you are dealt damage, ${this.name} gets +attack equal to ${this.level===3?"2x ":""}the damage dealt.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.buffNug(this.boof3610,0),i}ddf8(t){return!t.event.isCreatTarg&&t.event.target===t.owner}jr8(t){const e=this.level===3?2:1;g.jr5(t.creatId).buff(t.event.dmg*e,0),x.triggerDone()}}class fs extends kt{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Trial by Combat";const e=this.boof369;this.text=`Give a friendly creature ${p.jr9(e,0)} this turn. Then it and an enemy creature deal damage equal to their attacks to each other.`}playTargets(){const t=super.playTargets();return this.baddies().length>0&&t.push(y.crFriendActTarg("CARD",this.code,"P1")),t}handleAction(t){const e=S.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){const s=T.cancelAction(),h=this.baddies(i.id);h.push(s),T.ddf5(h)}else{const s=g.jr5(e[1]),h=y.mod("AT",this.boof369);s.addMod(h);const f=R.tick();i.hurtDirect(s.attack,this.code,f),s.hurtDirect(i.attack,this.code,f),T.spellCast()}}baddies(t=""){return D.toActions(y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t)))}}class Te extends P{lookup(t){return{["IKA"]:{c:()=>this.ikaC(),t:i=>this.ikaT(i)},["RSD"]:{c:()=>this.rsdC(),t:i=>this.rsdT(i)},["SSD"]:{c:()=>this.ssdC(),t:i=>this.ssdT(i)},["SOL"]:{c:()=>this.stagC(),t:i=>this.stagT(i)},["WTK"]:{c:()=>this.tinkC(),t:i=>this.tinkT(i)}}[t]}mPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("TE");return s.bonus=this.trigB,i}ddf8(t){return 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}ikaC(){this.faction="T",this.rarity="L",this.name="Ignir, Khan of Ashur",this.iAttack=this.lValN([4,8,14,24]),this.iHealth=this.iAttack,this.tribe.push("FB"),this.maxLevel=4;let t;this.level<3?(this.hints=["LG","ZZ-2"],t="an enemy creature or player at random."):this.level===3?t="an enemy creature at random and the enemy player.":t="each enemy creature and player.",this.mPlayer=1,this.trigB=this.buffNug(0,this.iAttack),this.text=`At the end of your turn, deal ${this.iAttack} damage to `+t}ikaT(t){const e=g.qEnemyCreats(),i=e.length>0;let s=this.level>2,h=-1;if(this.level===4&&i){const f=R.tick();e.forEach(m=>m.hurtDirect(this.iAttack,this.code,f))}if(this.level===3&&i&&(h=S.randInt(0,e.length)),this.level<3){const f=S.randInt(0,e.length+1);f===e.length?s=!0:h=f}h>-1&&e[h].hurtDirect(this.iAttack,this.code),s&&k.hurtDirect("E",this.iAttack,this.code)}rsdC(){this.faction="U",this.rarity="L",this.name="Rubyscale Dragon",this.iAttack=this.lValN([2,8,18]),this.iHealth=this.lValN([7,11,24]),this.tribe.push("DG"),this.level===1?(this.iDefend=!0,this.hints=["LG"]):(this.iMobile=1,this.level===3&&(this.hints=["ZZ-5"])),this.mPlayer=1;const t=this.lValN([1,2,5]);this.trigB=this.playerNug(t),this.text=`At the end of your turn, you and each other friendly creature gets ${p.jr9(0,t)}.`}rsdT(t){const e=this.lValN([1,2,5]);g.creatByTarget(y.crFriendNotMeTarg(t.creatId)).forEach(s=>s.buff(0,e)),k.heal(t.owner,e)}ssdC(){this.faction="T",this.rarity="L",this.name="Smolderscale Dragon",this.iAttack=this.lValN([0,3,15]),this.iHealth=this.lValN([6,13,30]),this.tribe.push("DG"),this.level===3?this.iMobile=2:(this.hints=["LG"],this.iDefend=!0),this.mPlayer=1;const t=this.boof135;this.trigB=this.buffNug(t*2,0),this.text=`At the end of your turn, deal ${t} damage to each enemy creature.`}ssdT(t){const e=g.qEnemyCreats();if(e.length>0){const i=R.tick(),s=this.boof135;e.forEach(h=>h.hurtDirect(s,this.code,i))}}stagC(){this.faction="U",this.rarity="C",this.name="Stag of Lys",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("ST"),this.mPlayer=1;const t=this.boof246;this.trigB=this.playerNug(t),this.text=`At the end of your turn, gain ${t} health.`}stagT(t){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.trigB=this.avgSpawnNug(),this.text=`At the end of the enemy player's turn, replace ${this.name} with a copy of a random Robot from your deck.`}tinkT(t){const e=y.target("DK");e.player=k.toTarget(t.owner),e.tribe="RB";const i=D.deckByTarget(e),s=i.length;if(s>0){const h=i[S.randInt(0,s)][0],f=g.jr5(t.creatId);g.birth(h,"R",f.owner,f.lane)}}}class Ot extends P{lookup(t){return{["DCS"]:{c:()=>this.delphC(),t:i=>this.delphT(i)},["GMP"]:{c:()=>this.gmpC(),t:i=>this.gmpT(i)},["LBL"]:{c:()=>this.lbcC(),t:i=>this.lbcT(i)},["SBF"]:{c:()=>this.sfangC(),t:i=>this.sfangT(i)},["SSE"]:{c:()=>this.sseC(),t:i=>this.sseT(i)},["SPD"]:{c:()=>this.spdC(),t:i=>this.spdT(i)},["SPM"]:{c:()=>this.spmC(),t:i=>this.spmT(i)},["TBA"]:{c:()=>this.tbaC(),t:i=>this.tbaT(i)},["VCG"]:{c:()=>this.vgC(),t:i=>this.vgT(i)},["WBG"]:{c:()=>this.woeC(),t:i=>this.woeT(i)},["ZSH"]:{c:()=>this.zyxC(),t:i=>this.zyxT(i)}}[t]}bothTurns=!1;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("TS");s.bonus=this.trigB;const h=Nt.extractCardCode(this.code);return(h==="ZSH"||h==="SBF")&&(i.extraBattles=1),i}ddf8(t){return this.bothTurns||t.event.playerA===t.owner}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}delphC(){this.faction="A",this.rarity="L",this.name="Delpha, Chronosculptor",this.iAttack=this.boof7914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.level>1&&(this.hints=["OL"],this.trigB=this.buffNug(5,4),this.text=`At the start of your turn, level a ${this.level===2?"level 1 ":""}card in your hand at random.`)}delphT(t){if(this.level>1){const e=k.toPlayer(t.owner),i=e.hand.map((h,f)=>{const m=L.getCard(h);return{idx:f,lvl:m.level,nxt:m.canLevel()?m.levelUpCard():""}}).filter(h=>h.nxt&&(this.level===3||h.lvl===1)),s=i.length;if(s>0){const h=i[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.trigB=this.rawNug(0,0,0,0,this.level*lt.dcWeight),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.trigB=this.playerNug(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.trigB=this.buffNug(this.iAttack,0),this.text=`${this.name} battles an additional time on your turn.`}sfangT(t){const e=g.jr5(t.creatId);e.extraBattles+=1}sseC(){this.faction="U",this.rarity="L",this.name="Scatterspore Eidolon",this.iAttack=8,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level<3&&(this.hints=["LB"]);const t=this.boof357,e=Z.minionName(this.level);this.trigB=this.statSpawnNug(t,t),this.text=`At the start of your turn, Spawn a ${t}/${t} ${e}.`}sseT(t){const e=this.lValS(["SXD","SXP","SXT"])+this.level.toString();g.birth(e,"S",t.owner)}spdC(){this.faction="U",this.rarity="R",this.name="Shardplate Delver",this.iAttack=this.boof4612,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OL"];const t=this.boof246;this.trigB=this.buffNug(t,t),this.text=`At the start of your turn, ${this.name} gets ${p.jr9(t,t)}.`}spdT(t){const e=this.boof246;g.jr5(t.creatId).buff(e,e)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.iAttack=this.boof91421,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["OP"],this.trigB=this.rawNug(0,0,0,0,this.lValN([-1.5,-2.1,-3])),this.text="At the start of your turn, randomly discard down to two cards in your hand."}spmT(t){const e=k.toPlayer(t.owner);if(e.hand.length>2){let i=e.hand.slice(),s=[];for(;i.length>2;)s.push(i.splice(S.randInt(0,i.length),1)[0]);e.discard.push(...s),e.hand=i}}tbaC(){this.faction="U",this.rarity="L",this.name="Talisin, Bard of Abundance",this.iAttack=this.lValN([8,12,16]),this.iHealth=this.lValN([10,14,20]),this.tribe.push("SY"),this.bothTurns=this.lValB([!0,!0,!1]),this.hints=["OL"],this.level===3?this.trigB=this.multNug(this.avgSpawnNug(),.5):this.hints.push("LG","ZZ-3"),this.text=`At the start of ${this.bothTurns?"each player's":"your"} turn, ${this.bothTurns?"that player":"you"} may play an additional card.`}tbaT(t){E.regularPlays+=1}vgC(){this.faction="T",this.rarity="C",this.name="Volcanic Giant",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("ER","GT"),this.hints=["OL"],this.trigB=this.playerNug(this.boof3610),this.text=`At the start of your turn, deals ${this.boof137} to ${this.boof5914-1} damage to the enemy player.`}vgT(t){const e=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=y.crTarg();this.level===3&&(e.player=k.toTarget(!t.owner));const i=g.creatByTarget(e);let s=99999,h=[];i.forEach(m=>{m.attack===s?h.push(m):m.attack0){const m=h[S.randInt(0,f)];W.destroy(m,this.code)}}zyxC(){this.faction="T",this.rarity="L",this.name="Zyx, Storm Herald",this.iAttack=this.boof4712,this.iHealth=this.lValN([6,9,20]),this.iMobile=1,this.tribe.push("LT","AS"),this.text="Zyx battles an additional time on your turn.",this.trigB=this.buffNug(this.iAttack,0)}zyxT(t){const e=g.jr5(t.creatId);e.extraBattles+=1}}class gs 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 ${p.levelGateText(this.level,!0)}Plant into an available lane.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.5)}}canActivate(t){return this.emptySloots(t.id).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=this.emptySloots(e[1],i.code);s.push(T.cancelAction()),T.ddf5(s)}else{const i=g.jr5(e[1]),s=g.birth(e[2],"P",i.owner,t.lane);this.logAct(!0,s),i.endActivation()}}emptySloots(t,e=""){const i=y.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P2",t,e));return D.toActions(i)}buddies(t){const e=y.crFriendActTarg("CARD",this.code,S.enTil("P1",t));return e.tribe="PL",e.level=D.ddf2(this.level),D.toActions(e)}}class li extends kt{constructor(t){super(t),this.faction="A",t==="PRI"+"1"?(this.rarity="R",this.name="Perilous Insight",this.maxLevel=1,this.overload=!0):(this.rarity="C",this.name="Metasight",this.maxLevel=2,this.isFree=this.level===2),this.text="Discard and level up two cards."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(T.shiftPlayCard(t.position),t.param==="P1"){this.logSpell(),E.levelAndDiscardA(t);const e=this.targParty("P2"),i=D.toActions(e);i.length===0?T.spellCast():T.ddf5(i)}else E.levelAndDiscardA(t),T.spellCast()}targParty(t){const e=y.lvlHandActTarg(this.code,t);return e.deckPositionSkip=T.playPosition(),e}}class Ie extends kt{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(i,s)=>this.confZ(i,s)},["CSG"]:{c:()=>this.cystgC(),z:(i,s)=>this.cystgZ(i,s)},["GRN"]:{c:()=>this.grenC(),z:(i,s)=>this.grenZ(i,s)},["TWG"]:{c:()=>this.twstrC(),z:(i,s)=>this.twstrZ(i,s)}}[t]}cardCast(t,e,i){this.lookup(t).z(e,i)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",g.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const e=S.deTil(t.param),i=g.ddf6(t);if(e[0]==="P1"){this.playTarg.notMe=i.id,this.playTarg.param=S.enTil("P2",i.id);const s=D.toActions([this.playTarg,D.buttonTarget("CANC")]);T.ddf5(s)}else{const s=g.jr5(e[1]);this.xl?this.logSpell(s,i):this.logSpell(),this.cardCast(this.cardCode(),s,i),T.spellCast()}}confC(){this.faction="T",this.rarity="C",this.name="Conflagrate",this.xl=!1,this.text=`Deal ${this.boof369} to two enemy creatures.`,this.playTarg.player="E"}confZ(t,e){const i=R.tick(),s=this.boof369;t.hurtDirect(s,this.code,i),e.hurtDirect(s,this.code,i)}cystgC(){this.faction="A",this.rarity="C",this.name="Cypien Steelgraft",this.text=`Two friendly creatures get Armor ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canArmor=!0}cystgZ(t,e){const i=this.boof246;t.addArmor(i),e.addArmor(i)}grenC(){this.faction="N",this.rarity="C",this.name="Ghastly Renewal",this.text=`Give two friendly creatures Regenerate ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canRegen=!0}grenZ(t,e){const i=this.boof246;t.addRegen(i),e.addRegen(i)}get tsboof(){return this.level+2}twstrC(){this.faction="U",this.rarity="C",this.name="Twinstrength";const t=this.tsboof;this.text=`Two friendly creatures get ${p.jr9(t,t)}.`,this.playTarg.player="F"}twstrZ(t,e){const i=this.tsboof;t.buff(i,i),e.buff(i,i)}}class ms 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.text=`When ${this.name} ${p.dbdtap()}, deal that much damage to that player.~Allied Uterra: This gets ${p.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.bonus=this.playerNug(this.boof357),i}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){if(t.trigger.type==="FR"){if(E.allied("U")){const e=g.jr5(t.creatId);e.breakthrough=!0,e.buff(2,2)}}else t.trigger.type==="DM"&&k.hurtDirect(t.event.target,t.event.dmg,this.code);x.triggerDone()}}class ps 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} ${p.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,e){const i=super.jr3(t,e);return i.jr4("FR"),i}handleAction(t){g.ddf6(t).hurtDirect(parseInt(t.param),this.code),T.actionDone(!0)}ddf8(t){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}jr8(t){if(t.trigger.type==="FR"){if(E.allied("T")){const e=g.jr5(t.creatId),i=e.jr4("DM");i.interactive=!0,i.bonus=this.buffNug(this.iAttack,0),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,i=D.toActions(y.crEnemyActTarg("CARD",this.code,e.dmg.toString()));i.length>0?(i.push(T.noneEndTrigger()),T.ddf5(i)):x.triggerDone()}}}class Le extends P{lookup(t){return{["CBB"]:{c:()=>this.cindC(),f:i=>this.cindF(i)},["EBW"]:{c:()=>this.ebwC(),f:i=>this.ebwF(i)},["IBR"]:{c:()=>this.ibrfC(),f:i=>this.ibrfF(i)},["SBI"]:{c:()=>this.sbiC(),f:i=>this.sbiF(i)}}[t]}targAction(t,e){this.lookup(t).f(e)}enemy=!1;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text=`Forge: If you are rank ${this.level+1} or higher, `+this.ftext,this.ftext=""}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}handleAction(t){const e=g.ddf6(t);this.targAction(this.cardCode(),e),T.actionDone(!0)}jr8(t){if(g.jr5(t.creatId).rank>this.level){const i=y.crActTarg("CARD",this.code,t.creatId);this.enemy?i.player="E":i.hint=["BF"];const s=D.toActions(i);s.length>0?T.ddf5(s):x.triggerDone()}else x.triggerDone()}ebwC(){this.faction="N",this.rarity="C",this.name="Ebonbound Warlord",this.iAttack=this.boof3714,this.iHealth=this.iAttack+4,this.tribe.push("VP"),this.enemy=!0;const t=this.boof369n;this.ftext=`give an enemy creature ${p.jr9(t,t)}.`}ebwF(t){this.logAct(!1,t);const e=this.boof369n;t.buff(e,e)}sbiC(){this.faction="U",this.rarity="C",this.name="Shardbound Invoker",this.iAttack=this.boof4714,this.iHealth=this.iAttack+1,this.tribe.push("TK");const t=this.boof359;this.ftext=`give a creature ${p.jr9(t,t)}.`}sbiF(t){this.logAct(!1,t);const e=this.boof359;t.buff(e,e)}cindC(){this.faction="T",this.rarity="C",this.name="Cinderbound Barbarian",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("FR","AS");const t=this.boof6912;this.enemy=!0,this.ftext=`deal ${t} damage to an enemy creature.`}cindF(t){t.hurtDirect(this.boof6912,this.code)}ibrfC(){this.faction="A",this.rarity="C",this.name="Ironbound Reinforcements",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("GN");const t=this.boof5812;this.ftext=`give a creature ${p.jr9(t,0)}.`}ibrfF(t){this.logAct(!1,t),t.buff(this.boof5812,0)}}class ys 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 i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){const e=g.jr5(t.creatId);if(this.emptySloots(e).length>0){const i=y.crFriendNotMeActTarg("CARD",e.id,this.code,S.enTil("P1",e.id)),s=D.toActions(i);s.length>0?(s.push(T.noneEndTrigger()),T.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=g.jr5(e[1]),h=this.emptySloots(s,i.id);h.push(T.cancelAction()),T.ddf5(h)}else{const i=g.jr5(e[1]);this.logAct(!1,i),i.move(t.lane),T.actionDone(!0)}}emptySloots(t,e=""){return T.emptyAdjacents(t,S.enTil("P2",e))}}class bs 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.`,this.bonus={activ8:this.buffNug(this.iAttack/2,0)}}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){const e=this.findVictims(t.id);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){if(t.zone==="F"){const i=g.ddf6(t);this.logAct(!0,i),i.hurtDirect(this.iAttack,this.code)}else{this.logAct(!0);const i=t;k.hurtDirect(i.playerA,this.iAttack,this.code)}g.jr5(t.param).endActivation()}findVictims(t){const e=this.iAttack,i=y.crEnemyTarg(),h=g.creatByTarget(i).filter(m=>m.health===e).map(m=>y.fieldSelectAction("CARD",m.lane,m.owner)),f=k.toPlayer("E");return f.health===e&&h.push(y.playerSelectAction("CARD",f.isPlayerA)),h.forEach(m=>{m.host=this.code,m.param=t}),h}}class As 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."}jr3(t,e){const i=super.jr3(t,e);i.jr4("EF");const s=i.jr4("TS");return s.bonus=this.buffNug(20,0),i}ddf8(t){if(t.event.code==="ENT"){const e=$.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(y.mod("TK",!0,e)))}jr8(t){if(t.event.code==="ENT"){const e=$.toCreature(t.event);e.creature.id===t.creatId?g.ddf1().forEach(i=>{this.giveXtra(i,t.creatId)}):bt.itBirthedFirst(e.creature.id,t.creatId)&&this.giveXtra(e.creature,t.creatId)}else t.event.code==="TRS"&&g.ddf1().forEach(e=>{e.extraBattles+=1,e.hasMod(t.creatId)||e.addMod(y.mod("TK",!0,t.creatId))});x.triggerDone()}}class U 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(),["CSL"]:()=>this.cslime(),["CDC"]:()=>this.cindcol(),["CNM"]:()=>this.cindmy(),["CTG"]:()=>this.citg(),["CWK"]:()=>this.crag(),["DBP"]:()=>this.prowler(),["DMR"]:()=>this.raptor(),["DBR"]:()=>this.bearride(),["DTD"]:()=>this.dmaw(),["DSZ"]:()=>this.duskzomb(),["FWB"]:()=>this.fangbear(),["FWR"]:()=>this.ravager(),["FFG"]:()=>this.ffang(),["FMS"]:()=>this.firemane(),["FPR"]:()=>this.flop(),["FGA"]:()=>this.falpha(),["FGB"]:()=>this.fbeta(),["FGO"]:()=>this.fomega(),["FPM"]:()=>this.minot(),["FPS"]:()=>this.forgeplate(),["GGE"]:()=>this.geist(),["GGH"]:()=>this.ghast(),["GGS"]:()=>this.ggs(),["GCL"]:()=>this.glacial(),["IWC"]:()=>this.warcharger(),["LWY"]:()=>this.lwyrm(),["LHY"]:()=>this.lyshyd(),["KDC"]:()=>this.kadc(),["MRF"]:()=>this.marrow(),["MMI"]:()=>this.mmin(),["MMO"]:()=>this.mmop(),["NGW"]:()=>this.narg(),["NCW"]:()=>this.necrotic(),["NXC"]:()=>this.nexcore(),["NAM"]:()=>this.nyam(),["OBD"]:()=>this.battledroid(),["OSP"]:()=>this.oss(),["OSL"]:()=>this.ogsl(),["PRG"]:()=>this.perd(),["RHY"]:()=>this.ravh(),["RHC"]:()=>this.rime(),["RSP"]:()=>this.runprim(),["SCS"]:()=>this.scorp(),["SCD"]:()=>this.scout(),["SFT"]:()=>this.scrap(),["SBA"]:()=>this.sparkblade(),["SKB"]:()=>this.sparkbot(),["SBR"]:()=>this.sparkass(),["STM"]:()=>this.sparkman(),["SSN"]:()=>this.sfsent(),["SMN"]:()=>this.steam(),["SGI"]:()=>this.stonefist(),["SCL"]:()=>this.stormcall(),["SMA"]:()=>this.ancient(),["SML"]:()=>this.lurker(),["TGS"]:()=>this.tsprout(),["TGN"]:()=>this.tgnome(),["TWS"]:()=>this.tscout(),["TWT"]:()=>this.tund(),["URD"]:()=>this.unrelenting(),["VBK"]:()=>this.vblock(),["VTC"]:()=>this.vtech(),["WTW"]:()=>this.waterwalk(),["WPD"]:()=>this.windprime(),["XCR"]:()=>this.xithcrush(),["XHU"]:()=>this.hulk(),["YWC"]:()=>this.yetiwar(),["ZIN"]:()=>this.zombinf()})[t]()}sist(){this.rarity="R",this.level===1?this.hints=["LG"]:this.consistent=!0}ancient(){this.faction="U",this.rarity="C",this.name="Swampmoss Ancient",this.iAttack=this.lValN([7,12]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=[this.level===1?"ZZ-1":"ZZ-2"],this.maxLevel=2}anvenf(){this.faction="A",this.rarity="C",this.name="Anvillon Enforcer",this.iAttack=this.boof5711,this.iHealth=this.iAttack-1,this.iArmor=this.boof246,this.tribe.push("RB")}avguard(){this.faction="T",this.rarity="R",this.name="Avalanche Guardian",this.iAttack=this.boof5915,this.iHealth=this.lValN([8,15,23]),this.iMobile=1,this.iDefend=!0,this.tribe.push("IC","EL")}bart(){this.faction="U",this.rarity="H",this.name="Big Bad Bartok",this.iAttack=this.level+8,this.iHealth=this.iAttack,this.consistent=!0,this.level<3&&(this.hints=["LB"]),this.tribe.push("TG")}batthid(){this.faction="U",this.name="Batterhide",this.iAttack=this.boof3814,this.iHealth=this.iAttack+3,this.sist(),this.iBT=!0,this.tribe.push("DN")}battledroid(){this.faction="A",this.rarity="H",this.name="Oreian Battledroid",this.iAttack=this.lValN([5,7,17]),this.iHealth=1,this.iArmor=this.iAttack,this.tribe.push("RB")}bearride(){this.faction="U",this.rarity="C",this.name="Deepwood Bear Rider",this.iAttack=this.lValN([5,16,18]),this.iHealth=this.lValN([2,8,10]),this.tribe.push("LP"),this.level===2&&(this.hints=["LB"])}blitwi(){this.faction="N",this.name="Blight Witch",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.boof71117,this.sist(),this.iRegen=this.boof234,this.tribe.push("ZB")}brambleguard(){this.faction="U",this.rarity="C",this.name="Bramblewood Guardian",this.iAttack=this.boof2612,this.iHealth=this.lValN([9,14,24]),this.tribe.push("PL")}cavernhyd(){this.faction="U",this.rarity="C",this.name="Cavern Hydra",this.iAttack=this.boof4711,this.iHealth=this.boof71015,this.iRegen=this.boof135,this.tribe.push("HY")}cslime(){this.faction="N",this.rarity="C",this.name="Cavern Slime",this.iAttack=this.boof61218,this.iHealth=this.boof246,this.iRegen=this.iAttack,this.tribe.push("OZ"),this.hints=[this.lValH(["ZZ-2","ZZ-3","ZZ-5"])]}cindcol(){this.faction="T",this.rarity="C",this.name="Cinder Colossus",this.iAttack=this.lValN([3,13,24]),this.iHealth=this.lValN([4,14,27]),this.iDefend=!0,this.level===1&&(this.hints=["LG"]),this.tribe.push("ER","EL")}cindmy(){this.faction="T",this.rarity="C",this.name="Cinder Mystic",this.iAttack=this.lValN([4,11,21]),this.iHealth=this.boof3714,this.tribe.push("FR","AS")}citg(){this.faction="A",this.rarity="C",this.name="Citadel Guard",this.iAttack=this.lValN([8,12,25]),this.iHealth=this.lValN([9,13,30]),this.iDefend=!0,this.hints=[this.level===3?"ZZ-5":"ZZ-1"],this.tribe.push("RB")}crag(){this.faction="T",this.rarity="C",this.name="Crag Walker",this.iAttack=this.lValN([7,12,18]),this.iHealth=this.boof246,this.iMobile=1,this.tribe.push("DN")}dmaw(){this.faction="N",this.rarity="L",this.name="Duskmaw, Twilight Drake",this.iAttack=this.boof61017,this.iHealth=this.boof5915,this.iMobile=1,this.tribe.push("ST","DG")}duskzomb(){this.faction="N",this.rarity="C",this.name="Duskspire Zombie",this.iAttack=this.lValN([2,5,16]),this.iHealth=this.lValN([5,8,19]),this.iRegen=4,this.tribe.push("ZB")}falpha(){this.faction="A",this.rarity="C",this.name="Forge Guardian Alpha",this.iAttack=this.lValN([4,8,20]),this.iHealth=this.lValN([8,14,26]),this.iDefend=!0,this.tribe.push("RB","GD")}fangbear(){this.faction="U",this.rarity="C",this.name="Fangwood Bear",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("BR")}fbeta(){this.faction="A",this.rarity="R",this.name="Forge Guardian Beta",this.iAttack=this.lValN([5,8,20]),this.iHealth=this.lValN([3,6,18]),this.iArmor=this.boof124,this.tribe.push("RB","GD"),this.level===3&&(this.hints=["ZZ-3"])}ffang(){this.faction="U",this.rarity="C",this.name="Featherfang",this.iAttack=this.boof61218,this.iHealth=this.boof4812,this.tribe.push("DN")}firemane(){this.faction="T",this.rarity="C",this.name="Firemane Steed",this.iAttack=this.lValN([3,6,16]),this.iHealth=this.lValN([6,9,19]),this.iMobile=2,this.tribe.push("FR","EL")}flop(){this.faction="T",this.rarity="C",this.name="Flowstone Primordial",this.iAttack=this.lValN([6,7,15]),this.iHealth=this.iAttack+1,this.tribe.push("FR","EL")}fomega(){this.faction="A",this.rarity="L",this.name="Forge Guardian Omega",this.iAttack=this.boof255080,this.iHealth=this.iAttack,this.iMobile=this.boof124,this.iArmor=this.iMobile*10,this.iBT=!0,this.iAggro=!0,this.consistent=!0,this.tribe.push("RB","GD")}forgeplate(){this.faction="A",this.rarity="C",this.name="Forgeplate Sentry",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iArmor=this.boof135,this.tribe.push("RB")}ggs(){this.faction="N",this.rarity="C",this.name="Grimgaunt Spectre",this.iAttack=this.lValN([3,11,14]),this.iHealth=this.iAttack,this.iMobile=1,this.level===1?this.hints=["LG"]:this.level===2&&(this.hints=["LB"]),this.tribe.push("GG")}geist(){this.faction="N",this.rarity="C",this.name="Grave Geist",this.iAttack=this.boof71118,this.iHealth=this.boof4711,this.tribe.push("ST")}ghast(){this.faction="N",this.rarity="C",this.name="Grave Ghast",this.iHealth=this.boof71013,this.iAttack=this.iHealth-2,this.iRegen=this.boof246,this.tribe.push("ZB")}glacial(){this.faction="T",this.rarity="C",this.name="Glacial Colossus",this.iAttack=this.boof61016,this.iHealth=this.lValN([8,13,19]),this.tribe.push("IC","EL"),this.iDefend=!0}hulk(){this.faction="N",this.rarity="C",this.name="Xithian Hulk",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("AB")}kadc(){this.faction="T",this.rarity="C",this.name="Kadras Colossus",this.iAttack=this.lValN([6,11,13]),this.iHealth=this.iAttack,this.tribe.push("GT"),this.level<3&&(this.hints=["LB"],this.level===1&&this.hints.push("ZZ+1"))}lurker(){this.faction="U",this.rarity="C",this.name="Swampmoss Lurker",this.iAttack=this.lValN([8,13,22]),this.iHealth=this.lValN([4,6,15]),this.tribe.push("DN"),this.level===3?this.hints=["ZZ-5"]:this.hints=["ZZ-1"]}lwyrm(){this.faction="T",this.rarity="C",this.name="Lightning Wyrm",this.iAttack=this.boof4711,this.iHealth=this.boof258,this.tribe.push("LT","EL"),this.iAggro=!0}lyshyd(){this.faction="U",this.rarity="C",this.name="Lysian Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.level,this.tribe.push("HY")}marrow(){this.faction="N",this.rarity="C",this.name="Marrow Fiend",this.iAttack=this.boof81117,this.iHealth=this.lValN([1,5,13]),this.tribe.push("SK")}minot(){this.faction="A",this.name="Forgeplate Minotaur",this.iAttack=this.lValN([2,8,16]),this.iHealth=this.lValN([4,9,17]),this.sist(),this.iArmor=this.level,this.tribe.push("RB")}mmin(){this.faction="A",this.rarity="C",this.name="Metamind Infiltrator",this.iAttack=this.boof5917,this.iHealth=this.iAttack-1,this.tribe.push("MM")}mmop(){this.faction="A",this.rarity="C",this.name="Metamind Operator",this.iAttack=this.boof4610,this.iHealth=this.lValN([10,14,18]),this.tribe.push("MM")}narg(){this.faction="T",this.rarity="C",this.name="Nargath Warrior",this.iAttack=this.boof51014,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS")}necrotic(){this.faction="N",this.rarity="C",this.name="Necrotic Wurm",this.iAttack=this.lValN([4,7,18]),this.iHealth=this.lValN([5,8,19]),this.tribe.push("WR")}nexcore(){this.faction="A",this.rarity="C",this.name="Nexus Core",this.iAttack=0,this.iHealth=this.lValN([15,25,40]),this.tribe.push("RB"),this.iDefend=!0}nyam(){this.faction="N",this.rarity="C",this.name="Nyrali Ambusher",this.iAttack=this.boof71117,this.iHealth=this.lValN([3,6,13]),this.tribe.push("OZ")}ogsl(){this.faction="U",this.rarity="C",this.name="Overgrown Spineleaf",this.iAttack=this.lValN([6,12,16]),this.iHealth=this.boof4812,this.tribe.push("PL")}oss(){this.faction="N",this.rarity="R",this.name="Ossuary Spirit",this.iAttack=this.lValN([1,3,6]),this.iHealth=this.boof91420,this.iRegen=this.iAttack+2,this.tribe.push("ST")}perd(){this.faction="N",this.rarity="C",this.name="Perdition Guard",this.iAttack=this.lValN([3,12,15]),this.iHealth=this.iAttack-1,this.tribe.push("NG"),this.level===1?this.hints=["LG","ZZ-1"]:this.level===2&&(this.hints=["LB"])}prowler(){this.faction="U",this.rarity="C",this.name="Deepbranch Prowler",this.iAttack=this.lValN([8,9,10]),this.iHealth=this.iAttack,this.tribe.push("CT"),this.level<3&&(this.hints=["LB"]),this.iBT=!0}raptor(){this.faction="U",this.rarity="C",this.name="Deepmoss Raptor",this.iAttack=this.lValN([2,13,16]),this.iHealth=this.iAttack,this.level===1?this.hints=["LG","RT"]:this.level===2&&(this.hints=["LB"]),this.tribe.push("DN")}ravager(){this.faction="U",this.rarity="C",this.name="Fangwood Ravager",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("BE")}ravh(){this.faction="U",this.rarity="C",this.name="Ravenous Hydra",this.iAttack=this.boof5813,this.iHealth=this.iAttack+this.level,this.iRegen=this.level,this.iBT=!0,this.tribe.push("HY")}rime(){this.faction="T",this.rarity="C",this.name="Rimehorn Charger",this.iAttack=this.lValN([5,8,10]),this.iHealth=this.iAttack+3,this.iMobile=1,this.level<3&&(this.hints=["LB"]),this.tribe.push("RM")}runprim(){this.faction="T",this.name="Runestorm Primordial",this.iAttack=this.boof3714,this.iHealth=this.iAttack-1,this.sist(),this.iAggro=!0,this.tribe.push("LT","EL")}scorp(){this.faction="N",this.rarity="C",this.name="Scavenger Scorpion",this.iAttack=this.lValN([6,9,11]),this.iHealth=this.iAttack,this.iRegen=this.level,this.level<3&&(this.hints=["LB"]),this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.isFree=this.level>1,this.level<3&&(this.hints=[this.level===1?"LG":"LB"]),this.tribe.push("RB")}scrap(){this.faction="A",this.rarity="H",this.name="Scrapforge Titan",this.iAttack=this.lValN([1,5,20]),this.iHealth=this.iAttack,this.iArmor=this.lValN([1,5,10]),this.level===1&&(this.hints=["LG","LM","RT"]),this.tribe.push("RB")}sfsent(){this.faction="A",this.rarity="C",this.name="Spiritforge Sentinel",this.iAttack=this.lValN([3,6,9]),this.iHealth=this.iAttack*2,this.iArmor=this.lValN([1,2,6]),this.tribe.push("RB")}sparkbot(){this.faction="A",this.rarity="C",this.name="Spark Bot",this.iAttack=this.boof5914,this.iHealth=this.lValN([6,11,16]),this.tribe.push("RB")}sparkblade(){this.faction="A",this.rarity="C",this.name="Sparkblade Assassin",this.iAttack=this.lValN([4,12,14]),this.iHealth=this.lValN([5,13,15]),this.tribe.push("HM")}sparkass(){this.faction="T",this.rarity="C",this.name="Sparkbrand Asir",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.lValN([6,11,13]),this.iAggro=!0,this.tribe.push("LT","AS")}sparkman(){this.faction="T",this.rarity="R",this.name="Sparktail Manticore",this.iAttack=this.boof369,this.iHealth=this.boof71116,this.iAggro=!0,this.iMobile=1,this.tribe.push("MT")}steam(){this.faction="T",this.rarity="C",this.name="Steam Sentinel",this.iAttack=this.lValN([8,14,20]),this.iHealth=this.boof61016,this.iDefend=!0,this.tribe.push("WT","EL")}stonefist(){this.faction="T",this.rarity="C",this.name="Stonefist Giant",this.iAttack=this.lValN([3,7,16]),this.iHealth=this.lValN([6,10,24]),this.tribe.push("ER","EL")}stormcall(){this.faction="T",this.rarity="C",this.name="Storm Caller",this.iAttack=this.lValN([8,11,14]),this.iHealth=this.iAttack-2,this.tribe.push("WN","AS")}tgnome(){this.faction="A",this.rarity="C",this.name="Technognome",this.iAttack=this.lValN([3,9,19]),this.iHealth=this.iAttack,this.level===1&&(this.hints=["LG"]),this.tribe.push("GN")}tscout(){this.faction="A",this.rarity="C",this.name="Tower Scout",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("HM")}tund(){this.faction="A",this.rarity="C",this.name="Tundra Watcher",this.iAttack=this.lValN([5,10,12]),this.iHealth=this.lValN([8,11,13]),this.level<3&&(this.hints=["LB"]),this.tribe.push("RB")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.iAttack=this.boof7911,this.iHealth=this.iAttack+1,this.level<3&&(this.hints=["LB"]),this.tribe.push("PL")}unrelenting(){this.faction="N",this.rarity="H",this.name="Unrelenting Dead",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.iRegen=this.iAttack,this.tribe.push("ZB")}vblock(){this.faction="A",this.rarity="R",this.name="Vault Blockade",this.iAttack=0,this.iHealth=this.boof135,this.iArmor=this.boof101520,this.iDefend=!0,this.tribe.push("RB")}vtech(){this.faction="A",this.rarity="C",this.name="Vault Technician",this.iAttack=this.boof61218,this.iHealth=this.boof3915,this.tribe.push("HM")}warcharger(){this.faction="A",this.rarity="C",this.name="Ionic Warcharger",this.iAttack=this.boof4915,this.iHealth=this.lValN([7,12,18]),this.iMobile=1,this.tribe.push("RB")}waterwalk(){this.faction="T",this.rarity="C",this.name="Water Walker",this.iAttack=this.lValN([5,12,14]),this.iHealth=this.lValN([2,9,11]),this.tribe.push("WT","AS")}windprime(){this.faction="T",this.rarity="C",this.name="Wind Primordial",this.iHealth=this.boof4814,this.iAttack=this.iHealth+2,this.iMobile=this.level,this.tribe.push("WN","EL")}xithcrush(){this.faction="N",this.rarity="C",this.name="Xithian Crusher",this.iAttack=this.lValN([4,10,16]),this.iHealth=this.iAttack+2,this.tribe.push("AB")}yetiwar(){this.faction="T",this.rarity="C",this.name="Yeti Warcaller",this.iAttack=this.boof248,this.iHealth=this.lValN([10,15,23]),this.tribe.push("YT")}zombinf(){this.faction="N",this.rarity="C",this.name="Zombie Infantry",this.iAttack=this.boof61015,this.iHealth=this.iAttack-1,this.tribe.push("ZB")}}class ks extends kt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Varna's Pact";const e=this.lValS(["a","two","three"]),i=this.level===1?"":"s",s=this.level===1?"was":"were";this.text=`Put ${e} random creature${i} that ${s} destroyed this game into ${e} lane${i}.`}playTargets(){const t=super.playTargets();return t.push(this.fieldTarget("P1",[])),t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1")if(this.level===1)this.endSpell([t.lane],t.playerA);else{const i=this.fieldTarget("P2",[t.lane]);T.ddf5(D.toActions(i))}else if(e[0]==="P2"){const i=[t.lane,parseInt(e[1])];if(this.level===2)this.endSpell(i,t.playerA);else{const s=this.fieldTarget("P3",i);T.ddf5(D.toActions(s))}}else this.endSpell([t.lane,parseInt(e[1]),parseInt(e[2])],t.playerA)}endSpell(t,e){this.logSpell();const i=R.tick();t.forEach(s=>{const h=W.gravedigger();h&&g.birth(h,"R",e,s,i)}),T.spellCast()}fieldTarget(t,e){const i=y.actionTarget("TF","CARD",this.code,S.enTil(t,...e));return i.player="F",i.hint=["FL"],i.lanes=g.laneIdx.filter(s=>!e.includes(s)),i}}class vs extends P{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Vigorwisp",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("ST"),this.text=`When ${this.name} gains health, heal that much damage from each other friendly creature.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("HG");return s.bonus=this.buffNug(0,this.boof369),i}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const e=y.crNotMeTarg(t.creatId);e.player=k.toTarget(t.owner),g.creatByTarget(e).forEach(i=>i.heal(t.event.healAmt)),x.triggerDone()}}class Ts extends be{jr3(t,e){const i=super.jr3(t,e),s=i.jr4("LG",this.code),h=this.boof124*5;return s.bonus=this.buffNug(h,h),i}ddf8(t){return t.owner===t.event.playerA}jr8(t){const e=this.boof124*t.event.healAmt;g.jr5(t.creatId).buff(e,e),x.triggerDone()}}class Ss 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=L.getCard(Z.minionCode(this.level));this.text=`When you play a spell, you may put a ${p.tokName(e)} into an available lane.`,this.spB=this.spawnNug(e)}spB;jr3(t,e){const i=super.jr3(t,e),s=i.jr4("PC");return s.interactive=!0,s.bonus=this.spB,i}handleAction(t){g.birth(Z.minionCode(this.level),"P",t.playerA,t.lane),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&L.getCard(t.event.cardCode).type==="S"}jr8(t){const e=y.emptyPlayerActTarg("F","CARD",this.code,""),i=D.toActions(e);i.length===0?x.triggerDone():(i.push(T.noneEndTrigger()),T.ddf5(i))}}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 ${p.levelGateText(this.level,!0)}creature to an available lane adjacent to ${this.name}.`}jr3(t,e){const i=super.jr3(t,e),s=i.jr4("FR");return s.interactive=!0,i}jr8(t){const e=g.jr5(t.creatId);if(this.emptySloots(e).length>0){const i=y.crFriendNotMeActTarg("CARD",e.id,this.code,S.enTil("P1",e.id));i.level=D.ddf2(this.level);const s=D.toActions(i);s.length>0?(s.push(T.noneEndTrigger()),T.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const i=g.ddf6(t),s=g.jr5(e[1]),h=this.emptySloots(s,i.id);h.push(T.cancelAction()),T.ddf5(h)}else{const i=g.jr5(e[1]);this.logAct(!1,i),i.move(t.lane),T.actionDone(!0)}}emptySloots(t,e=""){return T.emptyAdjacents(t,S.enTil("P2",e))}}class ws 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 i=super.jr3(t,e),s=i.jr4("DM");return s.bonus=this.playerNug(this.boof246),i}ddf8(t){const e=$.toDamage(t.event);return!e.battle&&e.isCreatTarg&&e.hurtCreat.owner!==t.owner}jr8(t){k.hurtDirect(!t.owner,this.boof246,this.code),x.triggerDone()}}class Ds 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 ${p.jr9(e,e)}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("EF");const s=i.jr4("MV"),h=-this.boof135;return s.bonus=this.buffNug(h,h),i}ddf8(t){const e=$.toCreature(t.event);return t.trigger.creatId===e.creature.id&&t.trigger.type==="MV"||e.creature.owner!==t.owner}jr8(t){let e=!1;const i=g.jr5(t.creatId),s=$.toCreature(t.event);if((i.id===s.creature.id&&i.opposed||s.creature.lane===g.oppositeLane(i.lane))&&(e=!0),e){const h=-this.boof135;i.buff(h,h)}x.triggerDone()}}class xs 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 ${p.dbdtap()} on your turn, you may deal that much damage to an enemy creature.~Allied Nekrium: When a creature is destroyed, Zarox gets ${p.jr9(this.boof124,0)}.`}jr3(t,e){const i=super.jr3(t,e);i.jr4("FR");const s=i.jr4("DM");return s.interactive=!0,s.bonus=this.buffNug(this.lValN([3,6,14]),0),i}handleAction(t){g.ddf6(t).hurtDirect(parseInt(t.param),this.code),T.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}else return!0}jr8(t){if(t.trigger.type==="FR"){if(E.allied("N")){const e=g.jr5(t.creatId),i=e.jr4("DS");i.bonus=this.buffNug(this.boof124,0),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,i=D.toActions(y.crEnemyActTarg("CARD",this.code,e.dmg.toString()));i.length>0?(i.push(T.noneEndTrigger()),T.ddf5(i)):x.triggerDone()}else if(t.trigger.type==="DS"){const e=g.jr5(t.creatId);this.logAct(!1),e.buff(this.boof124,0),x.triggerDone()}}}class Bs 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 ${p.jr9(e,e,!0)} and Regenerate ${this.level}.`}jr3(t,e){const i=super.jr3(t,e),s=i.addEffect("PS",this.code);return s.area="C",i}enforceEffect(t,e){if(e.lane===1||e.lane===5){const i=this.boof234;[y.mod("AT",i,e.id),y.mod("HL",i,e.id),y.mod("MH",i,e.id),y.mod("RG",this.level,e.id)].forEach(h=>{e.addModSafe(h)})}else e.removeModSafe(e.id)}}class Hs{cardCache=new Map;mapper={["AAK"]:Mi,["ABB"]:Ri,["ABM"]:gt,["AGC"]:gt,["AGK"]:O,["AGP"]:ut,["AGW"]:G,["ASG"]:G,["AMS"]:O,["AFO"]:ge,["ATG"]:$t,["ATP"]:ue,["ART"]:$t,["ATS"]:$t,["AGM"]:he,["ALG"]:ke,["AHL"]:rr,["ALS"]:ke,["ASB"]:se,["AAA"]:Ei,["ABE"]:ut,["ATZ"]:G,["AEC"]:It,["ARB"]:$t,["AEN"]:U,["APM"]:Ii,["AQE"]:G,["AGD"]:Li,["AFS"]:ee,["AWU"]:ve,["ASQ"]:ft,["AMD"]:Gi,["ABR"]:Ut,["AFR"]:O,["AMY"]:Ut,["ABL"]:G,["ATT"]:bt,["AGU"]:U,["AIV"]:Lt,["BRS"]:ni,["BTB"]:ri,["BTH"]:U,["BTI"]:gt,["BTN"]:ke,["BBB"]:U,["BLH"]:$t,["BFT"]:G,["BSP"]:Lt,["BWK"]:he,["BLW"]:U,["BZS"]:O,["BBR"]:G,["BBD"]:G,["BBL"]:G,["BBN"]:G,["BSR"]:gt,["BMY"]:$i,["BSW"]:ft,["BWW"]:Ae,["BTM"]:G,["BOS"]:Z,["BAW"]:gt,["BWG"]:U,["BTR"]:O,["BWD"]:fe,["BSG"]:Vi,["BSS"]:O,["BTS"]:fe,["BST"]:le,["BWT"]:Wi,["BRF"]:he,["BRH"]:bt,["BWH"]:Ui,["BRN"]:oe,["BZD"]:O,["BFM"]:O,["BSM"]:Oi,["CKB"]:gt,["CDT"]:he,["CMF"]:ze,["CTL"]:ut,["CCS"]:ft,["CHY"]:U,["CSR"]:ni,["CSL"]:U,["CHV"]:zi,["CRS"]:ge,["COD"]:ut,["CTI"]:O,["CHA"]:gt,["CHH"]:O,["CHR"]:se,["CBB"]:Le,["CDC"]:U,["CFB"]:Ut,["CNM"]:U,["CSW"]:O,["CTG"]:U,["CCT"]:Ze,["CFG"]:Ie,["CGF"]:St,["CGL"]:ft,["CSU"]:G,["CCR"]:gt,["CSB"]:St,["CNT"]:G,["CWK"]:U,["CRC"]:Lt,["CYP"]:Zi,["CYC"]:$t,["COZ"]:Z,["CYS"]:St,["CTW"]:G,["CTV"]:G,["CAG"]:G,["CBS"]:G,["CIN"]:be,["CSH"]:ft,["CSG"]:Ie,["DFM"]:Z,["DFR"]:O,["DHC"]:Yi,["DHW"]:$t,["DRS"]:gt,["DSS"]:Ee,["DSW"]:O,["DSE"]:gt,["DSA"]:gt,["DCR"]:ut,["DSK"]:St,["DBA"]:O,["DBP"]:U,["DMR"]:U,["DBR"]:U,["DCS"]:Ot,["DWW"]:Xi,["DDF"]:G,["DGZ"]:ut,["DNK"]:qi,["DBN"]:O,["DDS"]:ji,["DIS"]:It,["DSV"]:Ji,["DDD"]:O,["DPB"]:Qi,["DZA"]:Z,["DZD"]:se,["DRE"]:It,["DGS"]:gt,["DGW"]:ut,["DBT"]:G,["DTR"]:se,["DFB"]:Ft,["DMW"]:ee,["DCH"]:It,["DTD"]:U,["DHM"]:bt,["DSZ"]:U,["DYB"]:G,["DBQ"]:_i,["DYF"]:G,["DYS"]:tr,["DYL"]:er,["EBW"]:Le,["ESK"]:Lt,["EHW"]:ir,["ETN"]:G,["EWE"]:ve,["EVT"]:It,["ENP"]:G,["ESU"]:It,["ENR"]:G,["EPD"]:ut,["EPH"]:sr,["EPS"]:Ut,["ESG"]:ar,["ESC"]:fe,["ESP"]:nr,["EWT"]:O,["EHN"]:fe,["EFA"]:G,["EFM"]:Ut,["EFP"]:or,["EFE"]:hr,["EXD"]:G,["FWB"]:U,["FWR"]:U,["FFG"]:U,["FST"]:St,["FWK"]:St,["FIN"]:G,["FRR"]:ut,["FVA"]:G,["FWG"]:Z,["FWC"]:Lt,["FFU"]:ft,["FLH"]:ze,["FMS"]:U,["FSM"]:ut,["FBC"]:Ut,["FBI"]:$t,["FFS"]:ft,["FLN"]:G,["FJT"]:G,["FRI"]:gt,["FSS"]:Ee,["FLS"]:$t,["FSH"]:ft,["FFD"]:St,["FRV"]:gt,["FSC"]:St,["FSP"]:bt,["FPR"]:U,["FFL"]:G,["FGA"]:U,["FGB"]:U,["FGD"]:bt,["FGG"]:ee,["FGO"]:U,["FOL"]:ge,["FPM"]:U,["FPS"]:U,["FWS"]:se,["FFM"]:ve,["FMD"]:lr,["FME"]:Lt,["FSK"]:cr,["FKS"]:dr,["FWT"]:O,["FZS"]:G,["FUN"]:Z,["GOS"]:ur,["GHS"]:ee,["GHB"]:Ze,["GHR"]:fr,["GRN"]:Ie,["GTH"]:G,["GSC"]:he,["GMP"]:Ot,["GTT"]:gr,["GCL"]:U,["GCR"]:G,["GLF"]:gt,["GRW"]:gt,["GSW"]:O,["GVS"]:St,["GSS"]:O,["GPV"]:mr,["GBG"]:St,["GGE"]:U,["GGH"]:U,["GRP"]:pr,["GGB"]:Ft,["GGD"]:Ft,["GGR"]:Ft,["GGP"]:Ft,["GGS"]:U,["GGW"]:Ft,["GRM"]:ut,["GHT"]:gt,["GMR"]:St,["HMF"]:bt,["HTR"]:Ae,["HAR"]:G,["HFA"]:Pe,["HOD"]:bt,["HRM"]:yr,["HWM"]:be,["HOX"]:It,["HGS"]:br,["HTP"]:Ar,["IBF"]:ut,["IGR"]:It,["ITO"]:It,["IKA"]:Te,["IME"]:It,["IRT"]:hi,["IVS"]:ut,["ICD"]:kr,["IWC"]:U,["IHA"]:he,["IBR"]:Le,["IMD"]:se,["IMA"]:O,["IZL"]:vr,["IZR"]:Tr,["IZK"]:$t,["IFL"]:oe,["IFR"]:G,["JPK"]:G,["KDC"]:U,["KSB"]:O,["KAW"]:$t,["KOD"]:ft,["KBE"]:Sr,["KIW"]:Cr,["KTS"]:Re,["KKK"]:Ae,["LOD"]:ut,["LFA"]:wr,["LKP"]:Dr,["LGT"]:O,["LLD"]:Fe,["LLG"]:Fe,["LLS"]:Fe,["LLT"]:Fe,["LBR"]:G,["LSK"]:oe,["LWY"]:U,["LBD"]:O,["LSS"]:Ee,["LBL"]:Ot,["LSP"]:be,["LCE"]:It,["LUC"]:ve,["LMV"]:O,["LHY"]:U,["LYR"]:oe,["LYS"]:G,["MMH"]:gt,["MHR"]:xr,["MRF"]:U,["MMG"]:ee,["MOE"]:O,["MXW"]:gt,["MSP"]:It,["MMA"]:O,["MMR"]:O,["MMX"]:St,["MMI"]:U,["MMO"]:U,["MMV"]:Lt,["MPH"]:G,["MSC"]:G,["MTS"]:li,["MTT"]:Br,["MML"]:Hr,["MMW"]:Nr,["MBR"]:O,["MDE"]:oi,["MBP"]:ft,["MTD"]:O,["MND"]:ft,["NNS"]:G,["NGB"]:gt,["NGW"]:U,["NSL"]:G,["NCF"]:G,["NCM"]:se,["POZ"]:Z,["NCS"]:ft,["NCW"]:U,["NCV"]:G,["NSW"]:Fr,["NDY"]:G,["NDR"]:Pr,["NEM"]:It,["NSH"]:ut,["NXA"]:Mr,["NXB"]:hi,["NXC"]:U,["NXG"]:ft,["NXO"]:ge,["NXP"]:ai,["NXT"]:ke,["NGT"]:Ft,["NGQ"]:Rr,["NSD"]:Z,["NCL"]:ut,["NFF"]:ft,["NAM"]:U,["NOZ"]:St,["NSY"]:O,["ONN"]:Er,["OXA"]:Ir,["OXM"]:O,["OXP"]:Lr,["OOZ"]:Z,["OBB"]:Gr,["OEX"]:G,["OWH"]:$r,["OBD"]:U,["OFM"]:O,["OJC"]:bt,["OPK"]:O,["OSV"]:le,["OSS"]:G,["OWW"]:ee,["OHV"]:ft,["ODC"]:Wr,["OSP"]:U,["OAP"]:Vr,["OSL"]:U,["OWF"]:ut,["OXS"]:Ur,["PHM"]:O,["PPM"]:ft,["PSM"]:O,["PLW"]:ut,["POA"]:gt,["POD"]:fe,["POK"]:O,["POT"]:O,["PRG"]:U,["PRI"]:li,["PHS"]:gt,["PHC"]:ut,["PTB"]:ut,["PLI"]:ue,["PSC"]:ft,["PSH"]:Lt,["PTR"]:G,["PSG"]:G,["PMI"]:O,["PMS"]:G,["POX"]:St,["PMP"]:G,["PYG"]:Ze,["PYM"]:Me,["PYS"]:ut,["RBH"]:Or,["ROK"]:ut,["RPT"]:Z,["RHY"]:U,["RTS"]:Ut,["RHU"]:le,["RSC"]:Re,["RMB"]:zr,["RLW"]:bt,["RFL"]:Zr,["RHC"]:U,["ROG"]:G,["RWC"]:fe,["RFA"]:Pe,["RWD"]:gt,["RSD"]:Te,["RSE"]:Yr,["RBG"]:Me,["RGG"]:Lt,["RSZ"]:St,["RSP"]:U,["RHW"]:bt,["SBF"]:Ot,["SAP"]:G,["SPL"]:Z,["SVO"]:G,["SSE"]:Ot,["SXP"]:Z,["SXD"]:Z,["SXT"]:Z,["STS"]:ut,["SCS"]:U,["SMD"]:O,["SFS"]:Kr,["SHY"]:gt,["SCD"]:U,["SFT"]:U,["SOC"]:G,["SOA"]:G,["SOD"]:G,["SOK"]:oe,["SOT"]:G,["SDL"]:Z,["SAD"]:Xr,["SCZ"]:bt,["SFE"]:Ae,["SWS"]:qr,["SHA"]:bt,["SHG"]:G,["SBI"]:Le,["SCC"]:Re,["SPB"]:jr,["SPD"]:Ot,["SPG"]:G,["SPM"]:Ot,["STD"]:gt,["STB"]:oe,["SHS"]:he,["SSP"]:bt,["SGF"]:ft,["SKG"]:ai,["SSD"]:Te,["SDA"]:Jr,["SSR"]:Lt,["SNB"]:G,["SNP"]:ut,["SRD"]:ut,["SSH"]:ue,["SRM"]:ft,["SRH"]:Ft,["SDN"]:O,["SHV"]:G,["SRP"]:G,["SGG"]:O,["SBA"]:U,["SKB"]:U,["SBR"]:U,["SKS"]:le,["SEL"]:Qr,["STM"]:U,["SWA"]:$t,["SFG"]:ft,["SLG"]:O,["SBD"]:O,["SCV"]:_r,["SFM"]:St,["SSN"]:U,["SSM"]:Lt,["SLH"]:ts,["SPN"]:Z,["SSI"]:be,["SND"]:Re,["SNT"]:St,["SRV"]:Me,["STR"]:G,["SPU"]:Z,["XYR"]:Z,["SPH"]:es,["SSA"]:ft,["STO"]:G,["SDR"]:bt,["SOL"]:Te,["SOV"]:G,["SHK"]:oe,["SWR"]:is,["SMN"]:U,["SER"]:rs,["SES"]:ss,["SFA"]:Pe,["STG"]:as,["SSS"]:Ee,["SSK"]:O,["SWG"]:le,["SWM"]:ft,["SIV"]:ut,["STN"]:G,["SGI"]:U,["SBG"]:ns,["SCL"]:U,["SGA"]:Pe,["STP"]:G,["SSG"]:Lt,["SVH"]:Ut,["SIN"]:G,["SYL"]:O,["SEV"]:gt,["SMA"]:U,["SML"]:U,["SYO"]:hs,["TST"]:ut,["TBA"]:Ot,["TGL"]:G,["TGS"]:U,["TPT"]:G,["TDW"]:bt,["TNL"]:ls,["TEX"]:ge,["TGN"]:U,["TSM"]:ge,["TUP"]:G,["TOT"]:G,["TAB"]:oi,["TGI"]:O,["TDS"]:se,["TSP"]:cs,["TPG"]:ue,["TMG"]:ue,["TMM"]:ds,["TRA"]:O,["TRS"]:O,["TRV"]:O,["TRW"]:O,["TBB"]:ze,["TOB"]:G,["TWS"]:U,["TVG"]:ri,["TXB"]:G,["TXS"]:G,["TFK"]:Z,["TFD"]:Z,["TFF"]:Z,["TCG"]:G,["TMS"]:us,["TBC"]:fs,["TWT"]:U,["TRN"]:ut,["TGK"]:Me,["TSL"]:gs,["TTF"]:Z,["TWG"]:Ie,["UGM"]:Lt,["USY"]:bt,["UGL"]:O,["UIC"]:ms,["ULR"]:ps,["URD"]:U,["UBL"]:G,["UCM"]:ft,["UEM"]:ys,["UHS"]:bs,["UIM"]:ft,["UWL"]:O,["UWS"]:O,["UIW"]:O,["URS"]:G,["UTM"]:O,["UTR"]:bt,["URB"]:Ut,["UPM"]:ee,["VIC"]:O,["VIK"]:O,["VRP"]:ks,["VBK"]:U,["VIN"]:ue,["VTC"]:U,["VTW"]:le,["VGN"]:St,["VND"]:O,["VNF"]:gt,["VNS"]:O,["VSK"]:G,["VCH"]:ut,["VGR"]:G,["VSP"]:G,["VGL"]:G,["VGW"]:vs,["VOB"]:G,["VCG"]:Ot,["VES"]:Ut,["VYE"]:G,["WBY"]:gt,["WBU"]:gt,["WMC"]:O,["WMR"]:ft,["WMM"]:G,["WTK"]:Te,["WTW"]:U,["WEB"]:le,["WTA"]:Ts,["WWP"]:O,["WWR"]:ft,["WOD"]:ut,["WFM"]:ee,["WWS"]:Ss,["WBH"]:ve,["WCS"]:Cs,["WPD"]:U,["WSE"]:ws,["WPC"]:ut,["WFB"]:O,["WFS"]:ft,["WBG"]:Ot,["XTE"]:ee,["XCR"]:U,["XDH"]:gt,["XHS"]:St,["XHU"]:U,["XRF"]:Ds,["XSH"]:ft,["XTR"]:O,["XDV"]:Ae,["XRW"]:G,["YWC"]:U,["YNS"]:Ft,["ZXR"]:xs,["ZPM"]:ft,["ZTR"]:Z,["ZTU"]:St,["ZIN"]:U,["ZDK"]:O,["ZBS"]:Z,["ZST"]:Z,["ZMT"]:Bs,["ZMB"]:Z,["ZSH"]:Ot};makeCard(t){try{let e;if(t==="SOV3"?e=new As(t):t==="SOC3"?e=new O(t):t==="LOD3"?e=new Ki(t):t==="GOS3"?e=new os(t):e=new this.mapper[Nt.extractCardCode(t)](t),e.type==="C"){const i=e;i.spice=[{icon:"A",num:i.iAttack},{icon:"H",num:i.iHealth}].concat(i.spice??[])}return e}catch(e){throw console.error("Make card screwed up on code: "+t),e}}getCard(t){let e=this.cardCache.get(t);return e||(e=this.makeCard(t),this.cardCache.set(t,e)),e}}const L=new Hs;class Ns{registry;constructor(){this.registry=[]}find(t){const e=this.registry.find(i=>i.action===t);if(e)return e;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,e){const i=this.find(t);i.enabled=e}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const e=this.registry.findIndex(i=>i.action===t);e>-1&&this.registry.splice(e,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,e,i){if(R.ui.animating)return;let s,h;this.scaleFactor===1?(s=t,h=e):(s=Math.round(t*this.scaleFactor),h=Math.round(e*this.scaleFactor));let f,m=S.clickMode;return m==="M"?f=i:i===at.ForceRight?f=at.Right:m==="T"?f=at.Left:f=at.Right,Ue.arrayHit(this.registry,s,h,f)}updateScale(t){t===1?this.scaleFactor=1:this.scaleFactor=1/t}scaleFactor=1}const tt=new Ns;class Fs{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)),yt.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",T.ddf5(this.generateDeckPickerActions())):(this.step="A",T.ddf5(this.generateDeckPickerActions()));else{const i=e==="A"?this.p1:this.p2;t==="LK"?Jt.loadFromFile().then(s=>{typeof s=="string"?new We().iAmError(s):(i.deck=s,i.mode=t,S.writeStorage("cMode"+e,t),yt.drawAll())}):(i.mode=t,S.writeStorage("cMode"+e,t))}yt.drawAll()}ezDeck(t){return t.mode==="CP"?!1:(t.mode==="CR"?t.deck=Jt.randomStockDeck():t.mode==="CX"&&(t.deck=Jt.treatsAbound(!0)),!0)}handleDeckPick(t){const e=S.deTil(t.param),i=Jt.stockDeckByName(e[0],e[1]);this.step==="A"?(this.p1.deck=i,this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",T.ddf5(this.generateDeckPickerActions()))):(this.p2.deck=i,this.launchConstructed())}generateDeckPickerActions(t=-1){const e=ye.map((i,s)=>{const h=y.basicAction("DSET");return h.param=s.toString(),h});if(t>-1){const i=ye[t],s=i.decks.map(h=>{const f=y.basicAction("DECK");return f.param=S.enTil(i.id,h.name),f});return e.concat(s)}return e}launchConstructed(){R.aiMode=this.vsAI,At.setMode("G"),R.newGame(this.p1.deck.cards,this.p2.deck.cards)}replay(){R.newGame(this.p1.deck.cards,this.p2.deck.cards)}dud(){return{mode:"CP",deck:{cards:[],name:"",factions:[]}}}}const Mt=new Fs;class Ps{deathOrder=[];graveyard=[];reset(){this.graveyard=[],this.deathOrder=[]}purge(){this.deathOrder=[]}getState(){const t={dO:this.deathOrder,gY:this.graveyard};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.deathOrder=e.dO,this.graveyard=e.gY}deathCheck(){const t=R.tick();g.qActiveCreats().forEach(s=>{s.health<1&&(p.new().crd(s.code).txt(" died.").go(),this.smite(s,t))});const e=k.toPlayer(!0),i=k.toPlayer(!1);(e.health<1||i.health<1)&&(e.healthi.creatId===t.id)&&(this.deathOrder=this.deathOrder.filter(i=>i.creatId!==t.id))}findDeathTime(t){const e=this.deathOrder.filter(i=>i.creatId===t).map(i=>i.time);if(e.length!==0)return Math.min(...e)}destroy(t,e,i=void 0){t.status==="A"?(p.new().crd(t.code).txt(" was destroyed by ").crd(e).txt(".").go(),this.smite(t,i)):(console.warn(`Attempted to destroy creature that was not active. Targ creat ${t.code}; Killer creat ${e}`),console.trace())}gravedigger(t="X",e="LA"){if(t==="X"&&e==="LA"){const i=this.graveyard.length;return i===0?"":this.graveyard[S.randInt(0,i)].cardCode}else{const i=k.toBool(t);let s=this.graveyard.filter(f=>f.owner===i);e!=="LA"&&(s=s.filter(f=>D.levelTargetTest(e,parseInt(f.cardCode.slice(3)))));const h=s.length;return h===0?"":s[S.randInt(0,h)].cardCode}}smite(t,e=void 0){t.status="D",this.deathOrder.push({creatId:t.id,time:e||R.tick()}),this.graveyard.push({cardCode:t.code,owner:t.owner}),x.addEvents($.creature("DIE",t)),ae.positionChange(t.owner),t.owner?E.deathsA.push(t.code):E.deathsB.push(t.code)}}const W=new Ps;class Ms{get youi(){return R.ui}initDeck(t,e){this.youi.deckContents=t,this.youi.deckScroll=0,this.youi.deckSummary=e,At.setMode("T")}get canPageDown(){return this.youi.deckContents.length-this.youi.deckScroll>15}get canPageUp(){return this.youi.deckScroll>0}paginate(t){t?this.youi.deckScroll+=15:this.youi.deckScroll-=15}visibleContent(){const t=this.youi.deckScroll;return this.youi.deckContents.slice(t,t+15)}generateContent(t,e,i){const s=D.cardByTarget(t,i);if(s.sort((h,f)=>{const m=h[0],A=f[0];return A===m?0:m>A?1:-1}),e){const h=s.length;let f=0,m="",A=0;const C=[];for(;f0&&C.push({cardCode:m,sourceIdx:-1,cardCount:A}),m=s[f][0],A=1),f++;return h>0&&C.push({cardCode:m,sourceIdx:-1,cardCount:A}),C}else return s.map(h=>({cardCode:h[0],sourceIdx:h[1],cardCount:0}))}handleShowDeck(t){const e=k.getActive();this.showDeck(e,t.param==="VD")}handleDeckScroll(t){this.paginate(t.param==="D"),yt.drawAll()}showPlayerDeck(t){this.showDeck(t,!1)}showPlayerDiscard(t){this.showDeck(t,!1)}showCustomDeck(t,e){this.initDeck(t,!1);const i=this.rightClickers(),s=e.concat(i);return T.ddf5(s),s}showDeck(t,e){const i=k.toPlayer(t);this.initDeck(this.generateContent(e?i.discard:i.deck,!0),!0);const s=T.cancelAction();s.key="CNCL",s.param="PM";const h=this.rightClickers();h.push(s),T.ddf5(h)}rightClickers(){return R.aiActive?[]:this.youi.deckContents.map((t,e)=>{const i=y.deckSelectAction("DEET",t.cardCode,e);return i.param=t.cardCode,i})}}const wt=new Ms;class Rs{friends;friendText;get browseStack(){return R.ui.detailStack}n(t,e){return`${t}${e}`}friendo(t,e){const i=Array.isArray(e)?e:[e];[1,2,3].forEach(s=>{this.friends[this.n(t,s)]=i.map(h=>this.n(h,s))})}plont(t){this.friends[this.n(t,1)]=[this.n("SDL",1)],this.friends[this.n(t,2)]=[this.n("SPL",2)],this.friends[this.n(t,3)]=[this.n("TFK",3)]}constructor(){const t=this.n("FWC",1);this.friends={[this.n("ASQ",1)]:[this.n("SLG",1),this.n("WEB",1)],[this.n("ASQ",2)]:[this.n("WEB",2)],[this.n("ASQ",3)]:[this.n("WEB",3)],[this.n("CGL",1)]:[this.n("CGF",1)],[this.n("DHC",1)]:[this.n("DYF",1)],[this.n("DTD",1)]:[this.n("TOT",1)],[t]:[this.n("FWG",1)],[this.n("MPH",1)]:[t],[this.n("MPH",2)]:[t],[this.n("MPH",3)]:[t],[this.n("NGQ",4)]:[this.n("NSD",4)],[this.n("RHU",1)]:[this.n("RSC",1)],[this.n("SSE",1)]:[this.n("SXD",1)],[this.n("SSE",2)]:[this.n("SXP",2)],[this.n("SSE",3)]:[this.n("SXT",3)],[this.n("TRA",2)]:[this.n("PTR",2)],[this.n("TRA",3)]:[this.n("PTR",3)],[this.n("TRS",2)]:[this.n("STO",2)],[this.n("TRS",3)]:[this.n("STO",3)],[this.n("TRV",2)]:[this.n("ITO",2)],[this.n("TRV",3)]:[this.n("ITO",3)],[this.n("TRW",2)]:[this.n("STR",2)],[this.n("TRW",3)]:[this.n("STR",3)],[this.n("TGK",1)]:[this.n("SXD",1)],[this.n("TGK",2)]:[this.n("SPL",2)],[this.n("TGK",3)]:[this.n("TTF",3)],[this.n("TSL",1)]:[this.n("FUN",1)],[this.n("ZTU",2)]:[this.n("ZTR",2)]},this.friendo("BLH","LWY"),this.friendo("BTM","BOS"),this.friendo("BWD","TFD"),this.plont("BTS"),this.friendo("BWT","DNK"),this.friendo("CSB","ZBS"),this.friendo("CYS","COZ"),this.friendo("DSK","SPN"),this.friendo("DDF","SXT"),this.friendo("DNK","BWT"),this.friendo("DZD","DZA"),this.friendo("DBQ","BRF"),this.friendo("EPH","EPS"),this.friendo("FST","ZST"),this.friendo("FWK","ZMB"),this.friendo("FGD",["FGA","FGB","FGG","FGO"]),this.friendo("FGG","FGO"),this.friendo("FMD","FME"),this.plont("GMR"),this.friendo("IZL",["IFL","IFR","IZR"]),this.friendo("IZR",["IFL","IFR","IZL"]),this.friendo("IZK",["IFL","IFR","IZL","IZR"]),this.friendo("NCM","POZ"),this.friendo("NSW","SPN"),this.friendo("NSH","NDR"),this.friendo("NGQ","NSD"),this.friendo("NFF","TFF"),this.friendo("NOZ","OOZ"),this.friendo("PHC","CYP"),this.plont("PTB"),this.friendo("RWC","RPT"),this.plont("STS"),this.friendo("SSP","DFM"),this.friendo("SDA","HTP"),this.friendo("SLG","WEB"),this.friendo("SND","SPU"),this.friendo("SIV","KBE"),this.friendo("TNL","ZMB"),this.friendo("VIC",["IFL","IFR"]),this.plont("WWS"),this.friendo("YNS","XYR");const e=42,i=31,s=40,h=51,f=38,m=52,A=66;this.friendText={["BOS"]:[h,""],["BWT"]:[68,"Bron"],["BRF"]:[18,""],["CGF"]:[65,"Fiend"],["CYP"]:[4,""],["COZ"]:[i,""],["DFM"]:[33,"Mimic"],["DNK"]:[8,""],["DZA"]:[59,"Dozer"],["DYF"]:[38,"Infusion"],["EPS"]:[49,"Soldier"],["FWG"]:[44,""],["FWC"]:[28,"Chrysalis"],["FGA"]:[65,"Alpha"],["FGB"]:[77,"Beta"],["FGG"]:[53,"Gamma"],["FGO"]:[57,"Omega"],["FME"]:[78,"Egg"],["FUN"]:[49,""],["HTP"]:[38,"Hunting"],["ITO"]:[e,"Torrent"],["IZL"]:[42,"Av Flame"],["IZR"]:[44,"Av Frost"],["IFL"]:[65,"Flame"],["IFR"]:[67,"Frost"],["KBE"]:[78,"Bee"],["LWY"]:[65,"Wyrm"],["POZ"]:[i,""],["NDR"]:[3,""],["NSD"]:[s,""],["OOZ"]:[i,""],["PTR"]:[e,"Torrent"],["RPT"]:[51,""],["RSC"]:[60,"Scout"],["SPL"]:[h,""],["SXP"]:[h,""],["SXD"]:[s,""],["SXT"]:[f,""],["SDL"]:[s,""],["SLG"]:[25,""],["SPN"]:[A,""],["STR"]:[e,"Torrent"],["SPU"]:[A,""],["XYR"]:[A,""],["STO"]:[e,"Torrent"],["TOT"]:[40,"Tendrils"],["TFK"]:[f,""],["TFD"]:[f,""],["TFF"]:[f,""],["TTF"]:[f,""],["WEB"]:[78,""],["ZTR"]:[32,"Returned"],["ZBS"]:[m,""],["ZST"]:[m,""],["ZMB"]:[m,""]}}get currentCard(){const t=this.browseStack;return t[t.length-1]}get friendos(){return this.friends[this.currentCard]??[]}get canGoBack(){return this.browseStack.length>1}init(t){if(!R.aiActive)if(R.ui.detailStack=[t],At.mode!=="R"){At.setMode("R");const e=y.basicAction("CNCL");e.zone=At.baseMode==="G"?"B":"N",e.param="PM",T.ddf5([e])}else yt.drawAll()}changeLevel(t){const e=this.browseStack,i=e.length-1,s=e[i];e[i]=this.n(Nt.extractCardCode(s),t)}goBack(){this.browseStack.pop()}goToFriend(t){this.browseStack.push(t)}friendTxt(t){const e=this.friendText[t];return e||[3,"I am error"]}goBackAction(){const t=y.basicAction("DTUP");return t.param="DB",t}levelAction(t){const e=y.basicAction("DTUP");return e.param=S.enTil("DL",t),e}friendAction(t){const e=y.basicAction("DTUP");return e.param=S.enTil("DF",t),e}updateDetails(t){const e=S.deTil(t.param),i=e[0];i==="DB"?this.goBack():i==="DF"?this.goToFriend(e[1]):i==="DL"?this.changeLevel(parseInt(e[1])):console.error("Unknown detail arg",t)}}const jt=new Rs,Ke=[1,2,3,4,5,6].map(n=>n.toString());class Es{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(de.map(t=>[t,!0])),this.setFilters=new Map(Ke.map(t=>[t,!0])),this.stats=new ei}getRarity(t){return this.rarityFilters.get(t)??!0}toggleRarity(t){const e=!this.rarityFilters.get(t);return this.rarityFilters.set(t,e),e}getSet(t){return this.setFilters.get(t.toString())??!0}toggleSet(t){const e=t.toString(),i=!this.setFilters.get(e);return this.setFilters.set(e,i),i}get canPageDown(){return this.picksAsDeck.length-this.scrollIdx>15}get canPageUp(){return this.scrollIdx>0}paginate(t){t?this.scrollIdx+=15:this.scrollIdx-=15}initDraft(){this.step="O",this.memLoad&&(this.memLoad=!1,this.vsAI=S.readBoolStorage("dAI",!0),this.legDraft=S.readBoolStorage("legDraft",!1),this.fatPacks=S.readBoolStorage("fatPacks",!1),this.overdraft=S.readBoolStorage("overD",!1),Ke.forEach(t=>{this.setFilters.set(t,S.readBoolStorage("dSet"+t,!0))}),de.forEach(t=>{this.rarityFilters.set(t,S.readBoolStorage("dRare"+t,!0))})),yt.drawAll()}setFArr(){let t=Ke.filter(e=>this.setFilters.get(e)).map(e=>parseInt(e));return t.length===6&&(t=[]),t}validRarities(){return de.filter(t=>this.rarityFilters.get(t))}startDraftPicks(){const t=this.setFArr();de.forEach(e=>{this.getRarity(e)?this.rarityCache[e]=Jt.getDeckCards([e],[],t):this.rarityCache[e]=[]}),de.every(e=>this.rarityCache[e].length===0)&&(this.rarityCache["C"]=this.fun()),this.packOdds=this.fatPacks?[9,31,40]:[5,25,40],this.faction1="X",this.faction2="X",this.factionLock=!1,this.picks=[],this.picksAsDeck=[],this.scrollIdx=0,this.stats=new ei,this.resumeDraft("")}resumeDraft(t){if(t){this.picks.push(t),this.picksAsDeck=this.picksToDeck();const s=this.overdraft?60:30;if(this.picks.length===s){this.step==="A"?(this.pAdeck=this.picksAsDeck.slice(),this.step="B",this.startDraftPicks()):(this.pBdeck=this.picksAsDeck.slice(),this.launchDraft());return}const h=L.getCard(t);if(this.aiPicking||this.stats.addStat(h.type,h.faction),!this.factionLock){const f=h.faction;if(this.faction1==="X")this.faction1=f;else if(f!==this.faction1){this.faction2=f,this.factionLock=!0;const m=this.setFArr();this.validRarities().forEach(A=>{this.rarityCache[A]=Jt.getDeckCards([A],[this.faction1,this.faction2],m)})}}}const e=this.generatePack().slice(-1*(6-this.picks.length%5)),i=this.fillPack(e);if(this.aiPicking)this.resumeDraft(i[i.length-1]);else{this.currentPack=i;const s=i.map((h,f)=>{const m=y.draftSelectAction("DRFT",f,!0);return m.param=h,m});T.ddf5(s)}}replay(){this.launchDraft()}picksToDeck(){const t=[];return this.picks.forEach(e=>{const i=t.findIndex(s=>s.card===e);i===-1?t.push({card:e,num:1}):t[i].num+=1}),t.sort((e,i)=>{const s=L.getCard(e.card+"1"),h=L.getCard(i.card+"1");return s.name.toLowerCase(){const s=this.rarityCache[i].length;let h=!0,f=0;for(;h&&f<100;){const m=this.rarityCache[i][S.randInt(0,s)];e.includes(m)?f++:(e.push(m),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 i=e;S.writeBoolStorage("dRare"+e,this.toggleRarity(i))}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));yt.drawAll()}launchDraft(){R.aiMode=this.vsAI,At.setMode("G"),R.newGame(this.pAdeck,this.pBdeck)}fun(){return[["ART","SVO","MPH","VSK","MSP","LYS"],["CAG","ATG","WMM","ESU","BWH","CBS"],["DHW","NCF","ROG","EXD","TPT","HOX"],["FLS","STP","BRN","TCG","AQE","VOB"]][S.randInt(0,4)]}}const pt=new Es;class Is{async drawAll(){if(ht.simOn)return;const t=At.mode;tt.removeAll(),this.clearDetails(),t==="G"?(this.clearDeck(),await Promise.all([this.drawHand(k.getLocal()),this.drawPlayers(),this.drawField(),this.drawActions(T.activeActions)]),R.winFlag!==0?await this.drawGameOver():await this.drawCommonButtons(!0,!0,!0)):t==="R"?await this.drawDetails(T.activeActions):t==="T"?R.aiActive||await this.drawDeck(T.activeActions):t==="D"?await this.drawDraft(T.activeActions):t==="C"?await this.drawConstructed():t==="I"?await this.drawInfoMenu():t==="X"?await this.drawExit(T.activeActions):t==="S"?await this.drawSwap():await this.drawMenu()}async drawGameOver(){await new Se().drawGameOver()}async drawHand(t){await new gi().drawCards(t)}async drawField(){await new Je().drawCards()}async drawPlayers(){await new Se().drawAllPlayers()}async drawDeck(t){const e=t.find(f=>f.zone==="B"),i=[];e&&i.push(e),await new Ge().drawActions(i);const h=new _s;await h.drawCards(),await h.drawActions(t),await this.drawCommonButtons(!0,!0,!1)}async drawActions(t){if(ht.simOn)return;const e=new Ge;if(R.aiActive)await e.drawActions([]);else{st.get("effects").clear();const s=new gi,h=new Je,f=new Se;await Promise.all([s.drawActions(t),h.drawActions(t),e.drawActions(t),f.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;R.ui.animating=!0,st.get("effects").clear(),await new Je().drawFight(t),R.ui.animating=!1}async drawDraft(t){st.get("effects").clear();const i=new ea,s=st.get("game-ui");s.clear(),tt.removeAll(),pt.step==="O"?await i.drawDraftMenu(s):(await new Ce().drawPickerPlayer(s,pt.step==="A",!1),await i.drawPack(t,s),await i.drawList(t,s),await i.drawStats(s),await this.drawCommonButtons(!0,!0,!1))}async drawMenu(){const t=new ia,e=st.get("game-ui");e.clear(),tt.removeAll(),await t.drawMenu(e)}async drawInfoMenu(){const t=new Ce,e=st.get("game-ui");e.clear(),tt.removeAll(),await t.drawExtrasMenu(e)}async drawConstructed(){if(Mt.step==="O"){const t=new We,e=st.get("game-ui");e.clear(),tt.removeAll(),await t.drawConstrMenu(e)}else await this.drawDeckPick(T.activeActions)}async drawDeckPick(t){const e=new We,i=new Ce,s=st.get("game-ui");s.clear(),tt.removeAll(),await i.drawPickerPlayer(s,Mt.step==="A",Mt.vsAI),await e.drawSets(t,s),await e.drawList(t,s)}clearDetails(){st.get("card").clear()}clearDeck(){st.get("decklist").clear()}async drawDetails(t){await this.drawActions(t),await this.drawCommonButtons(!0,!0,!1),st.get("card").clear();const i=new ta,s=t.find(h=>h.key==="CNCL");s?await i.drawDetails(s):console.error("Attempted to show details view with no cancel action")}async drawCommonButtons(t,e,i){let s=979;const h=723,f=new je,m=st.get("game-ui");if(i&&m.clear(),t&&(await f.makeIconButton(m,s,h,"EX"),s-=50),e){const A=S.clickMode;A!=="M"&&await f.makeIconButton(m,s,h,A==="I"?"TM":"DM")}}async drawExit(t){st.get("decklist").clear();const i=st.get("effects"),s=new pe;await s.drawButton(i,151,488,t[1],"Quit Game",24,!1),await s.drawButton(i,478,488,t[0],"Resume",52,!1)}async drawSwap(){const t=st.get("decklist");t.clear(),t.context.fillStyle="#000000",t.context.fillRect(0,0,S.gameWidth,S.gameHeight);const e=new Se,i=k.getActive(),s="#AAF0C1",h=y.basicAction("USWP");h.param="PM",await e.drawPlayer(i,t,200,300);const f={fontSize:22,colour:s};await e.drawText(t,"Player "+(i.isPlayerA?"1":"2"),480,360,f),await e.drawText(t,"Click to start turn",480,420,f);const m=new dt(h,0,0,S.gameWidth,S.gameHeight,at.Both);tt.add(m)}setBackground(t){const e="hide";this.allBackgrounds.forEach(i=>{const s=document.getElementById(i);s&&(t===i?s.classList.remove(e):s.classList.add(e))})}playmatSetup(){let t=!1;const e=S.options.playmat,i=document.getElementById("playmat");if(i?i.dataset.pic!==e&&(t=!0,i.remove()):t=!0,t){const s=new Image(S.gameWidth,S.gameHeight);s.id="playmat",s.classList.add("hide",this.scaleCSS(S.options.scale)),s.dataset.pic=e,s.src=S.imgRoot+`background/playfield-${e}.jpg`,document.getElementById("mainmenu").before(s)}}scaleCSS(t){return`uiSize${t}`}changeScale(t){this.clearAll();let e=S.options.scale;e===t&&(e="100");const i=t==="100"?1:.90625;tt.updateScale(i);const s=this.scaleCSS(e),h=this.scaleCSS(t);this.allCanvases.forEach(A=>{st.get(A).dom.classList.replace(s,h)}),this.allBackgrounds.forEach(A=>{const C=document.getElementById(A);C&&C.classList.replace(s,h)}),document.getElementById("solforge").classList.replace(`gameSize${e}`,`gameSize${t}`),document.getElementById("log").classList.replace(`logSize${e}`,`logSize${t}`),S.options.scale=t,S.writeStorage("scale",t)}clearAll(){this.allCanvases.forEach(t=>{st.get(t).clear()})}allCanvases=["game-ui","field","player","hand","effects","decklist","card"];allBackgrounds=["playmat","blueface","mainmenu"]}const yt=new Is;class Ls{positionChange(t){g.creatByTarget().forEach(e=>{e.enforceEffects("PS",t)}),k.enforceEffects(t)}defenderChange(t){g.qActiveCreats().forEach(i=>{i.effects.filter(s=>s.watch==="DF").filter(s=>s.area==="C"&&i.owner===t||s.area==="A").forEach(s=>L.getCard(s.logicCode).enforceEffect(s,i))})}playerHealthChange(){g.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){g.qActiveCreats().forEach(e=>{e.enforceEffects("AT"),e.enforceEffects("AR"),e.enforceEffects("CH"),e.enforceEffects("DF",e.owner)})}}const ae=new Ls;class Gs{getC(t){return g.jr5(t)}creature(t,e){return{code:t,creatId:e.id}}creatHeal(t,e){return{code:"CHL",creatId:t.id,healAmt:e}}damage(t,e,i,s,h,f,m){let A;return f instanceof Be?A=f.id:A=f,{code:"DMG",battle:t,dmg:e,life:i,isCreatSrc:s,isCreatTarg:h,target:A,srcId:m?.id}}enterField(t){return{code:"ENT",creatId:t.id,forged:!1}}playCard(t,e){return{code:"PLC",playerA:e,cardCode:t}}player(t,e){return{code:t,playerA:e}}playerHeal(t,e){return{code:"PHL",playerA:t,healAmt:e}}replaced(t,e){return{code:"RPL",creatId:t.id,replCreatId:e.id}}toCreature(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId)}}toDamage(t){const e=t;let i,s,h;return e.isCreatTarg?h=this.getC(e.target):s=k.toPlayer(e.target),e.isCreatSrc&&(i=this.getC(e.srcId)),{code:e.code,battle:e.battle,dmg:e.dmg,life:e.life,isCreatSrc:e.isCreatSrc,srcId:e.srcId,target:e.target,isCreatTarg:e.isCreatTarg,srcCreat:i,hurtCreat:h,hurtPlayer:s}}toEnterField(t){const e=t;return{code:e.code,creatId:e.creatId,forged:e.forged,creature:this.getC(e.creatId)}}toReplaced(t){const e=t;return{code:e.code,creatId:e.creatId,creature:this.getC(e.creatId),replCreatId:e.replCreatId,replCreat:this.getC(e.replCreatId)}}}const $=new Gs;class $s{field=[];birthOrder=[];laneIdx=[1,2,3,4,5];reset(){this.field=[],this.birthOrder=[]}purge(){this.field=this.field.filter(t=>t.status==="A"),this.birthOrder=[]}getState(){const t={field:this.field.map(e=>e.getState()),bO:this.birthOrder};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.field=e.field.map(i=>new Be(i)),this.birthOrder=e.bO}jr5(t){const e=this.searchById(t);if(e)return e;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByLane(t,e){const i=this.searchByLane(t,e);if(i)return i;throw console.error("naughty creature lane ",t,e),new Error("Could not find creature by lane")}ddf6(t){const e=this.searchByFSA(t);if(e)return e;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return this.field.find(e=>e.id===t)}searchByLane(t,e){return this.field.find(i=>i.lane===t&&i.owner===e&&i.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let e=this.field;if(t){if(t.player!=="X"){const i=k.toBool(t.player);e=e.filter(s=>s.owner===i)}if(t.creatStatus!=="A"){const i=this.creatStatusTargetToCS(t.creatStatus);e=e.filter(s=>s.status===i)}if(!S.isUn(t.lanes)){const i=D.lanesToArr(t.lanes);e=e.filter(s=>i.includes(s.lane))}if(S.isUn(t.maxAttack)||(e=e.filter(i=>i.attack<=t.maxAttack)),t.notMe&&(e=e.filter(i=>i.id!==t.notMe)),t.victims){const i=S.deTil(t.victims);e=e.filter(s=>i.includes(s.id))}if(t.tribe!=="AN"&&(e=e.filter(i=>i.isTribe(t.tribe))),t.canLevel&&(e=e.filter(i=>L.getCard(i.code).canLevel())),t.level!=="LA"){const i=D.levelTargetToLevel(t.level);e=e.filter(s=>i.includes(s.level))}t.cardCode&&(e=e.filter(i=>L.getCard(i.code).cardCode()===t.cardCode)),t.canDefender&&(e=e.filter(i=>!i.negateDefender)),t.hasDefender&&(e=e.filter(i=>i.defender)),t.canArmor&&(e=e.filter(i=>!i.negateArmor)),t.hasArmor&&(e=e.filter(i=>i.armor>0)),t.canMove&&(e=e.filter(i=>!i.negateMobility)),t.hasMobility&&(e=e.filter(i=>i.mobility>0)),t.hasPoison&&(e=e.filter(i=>i.poison>0)),t.canRegen&&(e=e.filter(i=>!i.negateRegen)),t.hasRegen&&(e=e.filter(i=>i.regen>0)),t.faction!=="X"&&(e=e.filter(i=>i.faction===t.faction))}return e}cst2cs={["A"]:()=>{throw new Error("goof passed any to field state target mapper")},["V"]:()=>"A",["D"]:()=>"D",["R"]:()=>"R"};creatStatusTargetToCS(t){return this.cst2cs[t]()}emptyLanes(t){return this.laneIdx.filter(e=>!this.field.find(s=>s.owner===t&&s.lane===e&&s.status==="A"))}oppositeLane(t){return 6-t}adjacentPositions(t){return[[2],[1,3],[2,4],[3,5],[4]][t-1]}canMove(t){return t.mobility>0&&t.mobilityAvailable&&(!t.sleeping||t.aggressive)?this.emptyLanes(t.owner).filter(e=>Math.abs(t.lane-e)<=t.mobility):[]}birth(t,e,i,s=0,h=void 0){if(e==="S"){const C=this.emptyLanes(i);if(C.length===0)return;s=C[S.randInt(0,C.length)]}else if(e==="P"&&!this.emptyLanes(i).includes(s))return;const m=(typeof t=="string"?L.getCard(t):t).jr3(i,s);if(i===k.getActiveB()&&E.birthRegistrar(m.id),e==="F"||e==="R"){const C=g.searchByLane(s,i);if(C){const F=p.new().crd(C.code).txt(" was replaced");e==="R"?F.txt(" with ").crd(m.code).txt(".").go():F.txt(".").go(),C.status="R",x.addEvents($.replaced(m,C))}}this.field.push(m);const A=$.enterField(m);return A.forged=e==="F",this.birthOrder.push({creatId:m.id,time:h||R.tick()}),x.addEvents(A),m.enforceEffects("PH"),ae.positionChange(i),m}findBirthTime(t){const e=this.birthOrder.filter(i=>i.creatId===t).map(i=>i.time);if(e.length!==0)return e.length>1&&console.warn("wery curious, more than one birth record for creat "+t),e[0]}qActiveCreats(){return this.creatByTarget(y.crTarg())}qPlayerCreats(t){const e=y.crTarg();return e.player=k.toTarget(t),this.creatByTarget(e)}ddf1(){return this.creatByTarget(y.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(y.crEnemyTarg())}}const g=new $s;class Ws{creatFightState(t,e){return t?e===1||t.defender||t.sleeping&&!t.aggressive?1:e===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t,e,i,s){if(t>0){let h=0;if(e>0){const f=t===2&&i.breakthrough;h=s.hurtBattle(i.attack,i,f)}else t===2&&(h=i.attack);h>0&&k.hurtBattle(!i.owner,h,i)}}fight(t){const e=!ht.simOn;e&&p.add("FIGHT!");let i=2,s=1;t&&(E.mainBattle=!1,i=0,s=0);const h=k.getActiveB(),f=[],m=[];g.laneIdx.forEach(C=>{const F=g.searchByLane(C,h),V=g.searchByLane(6-C,!h),Y=this.creatFightState(F,i),j=this.creatFightState(V,s);(Y===2||j===2)&&(m.push([Y,j,F,V],[j,Y,V,F]),Y===2&&(E.ffs++,f.push([C,h])),j===2&&f.push([g.oppositeLane(C),!h]))}),this.barking&&f.length>0&&e&&S.dogBark();let A;e?A=yt.drawCombat(f):A=Promise.resolve(),A.then(()=>{m.forEach(C=>this.dukeItOut(...C)),ae.playerHealthChange(),W.deathCheck(),x.type="C0",T.actionDone()})}barking=!0}const ci=new Ws;class Vs{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,ci.barking=S.options.bark,k.activePlayer=S.randInt(0,2)===0,this.aiActive=!k.activePlayer&&this.aiMode,k.isLocalA=this.aiMode||k.activePlayer,T.actionHistory=[],ht.turnSims=0,ht.turnTime=0,g.reset(),W.reset(),this.ui=this.freshUI(),E.firstTurn=!0,this.winFlag=0;const i=k.nameOSaurus();k.initPlayer(!0,t,"Forgy McGhee",25),k.initPlayer(!1,e,i[0],i[1]),p.setup(),p.add("Ready...FIGHT!"),E.startTurn()}freshUI(){return{handScrollLeft:0,detailStack:[],deckContents:[],deckScroll:0,deckSummary:!1,animating:!1}}}const R=new Vs;class Us{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,i=""){const s=i.length>0?` onclick="sfapi.details('${i}')"`:"";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 Ci}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let e=!0;for(;e;){const i=t.indexOf("^c");if(i===-1)e=!1;else{const s=t.slice(i+2,i+6);if(s==="POIS")t=t.replaceAll("^c"+s,this.span("Poison","green"));else{const h=L.getCard(s);t=t.replaceAll("^c"+s,this.span(`${h.name} ${h.level}`,this.factMap[h.faction],s))}}}return t}parse(t){const i=t.guts.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),s=this.parseCards(i);this.add(s)}cardText(t){let e;if(t.type==="C"){const i=t,s=[];i.iRegen>0&&s.push("Regenerate "+i.iRegen),i.iArmor>0&&s.push("Armor "+i.iArmor),i.iMobile>0&&s.push("Mobility "+i.iMobile),i.iBT&&s.push("Breakthrough"),i.iDefend&&s.push("Defender"),i.iAggro&&s.push("Aggressive"),i.consistent&&s.push("Consistent"),s.length>0&&s.push(""),e=s.join(". ")+t.text}else e=t.text;return(t.isFree?"Free. ":"")+(t.overload?"Overload. ":"")+e}cardTextSplit(t){const e=[];if(t.isFree&&e.push("Free"),t.consistent&&e.push("Consistent"),t.overload&&e.push("Overload"),t.type==="C"){const i=t;i.iRegen>0&&e.push("Regenerate "+i.iRegen),i.iArmor>0&&e.push("Armor "+i.iArmor),i.iMobile>0&&e.push("Mobility "+i.iMobile),i.iBT&&e.push("Breakthrough"),i.iDefend&&e.push("Defender"),i.iAggro&&e.push("Aggressive")}if(t.text.length>0&&e.push(...t.text.split("~")),t.level===1){const i=t.cardCode(),s=ti.find(h=>h[0]===i);if(s){let h;const f=s[1];f.length===2&&f[0]===f[1]?h="2x "+L.getCard(`${f[0]}1`).name:h=f.map(m=>L.getCard(`${m}1`).name).join(", "),e.push("Solbind: "+h)}}return e}factionText(t){switch(t){case "A":return"Alloyin";case "N":return"Nekrium";case "T":return"Tempys";case "U":return"Uterra";case "X":return""}}cardTypeText(t){return t==="C"?"Creature":"Spell"}rarityText(t){switch(t){case "C":return"Common";case "R":return"Rare";case "H":return"Heroic";case "L":return"Legendary";case "T":return"Token"}}levelGateText(t,e=!1){const i=e?" ":"";return t===1?`level 1${i}`:t===2?`level 2 or lower${i}`:""}jr9(t,e,i=!1){return t!==0&&e!==0?`${this.bufferson(t,!0)}${i?",":" and"} ${this.bufferson(e,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(e,!1)}bufferson(t,e){return`${t>0?"+":""}${t} ${e?"attack":"health"}`}dbdtac(t=-1){return`deals battle damage to a ${t===-1?"":this.levelGateText(t,!0)}creature`}dbdtap(){return"deals battle damage to a player"}daluac(t=!1){return(t?"D":"d")+"iscard and level up a card"}forglied(t){return t==="X"?"Forge":`Allied ${this.factionText(t)}`}fastName(t){t.length===3&&(console.warn("HEY a 3 char card code was passed to fastName, why?: "+t),t=`${t}1`);const e=L.getCard(t);return e.name+" "+e.level}pName(t){return t?"A":"B"}tokName(t){return`${t.iAttack}/${t.iHealth} ${t.name}`}cardActionText(t){let e=`Card (${this.fastName(t.host)}) `;if(t.zone==="F"){const i=t,s=i.playerA?i.lane:6-i.lane,h=g.searchByFSA(i),f=h?this.fastName(h.code):"Empty";e+=`Lane ${s}${this.pName(i.playerA)} ${f}`}else if(t.zone==="H"){const i=t;e+=`Hand (${this.fastName(i.card)})`}else if(t.zone==="P"){const i=t;e+=`Player (${this.pName(i.playerA)})`}else t.zone==="R"?e+="Full Board":t.zone==="B"?e+="Button":t.zone==="N"&&(e+="Special");return e}actionText(t){switch(t.key){case "ACTV":return`Activate (${this.fastName(t.host)})`;case "CARD":return this.cardActionText(t);case "FITE":return"Fight";case "FORG":return`Forge to Lane ${6-t.lane}`;case "HDSC":return`Hand Discard (${this.fastName(t.host)})`;case "HPLY":const i=t;return`Play (${this.fastName(i.card)})`;case "MEND":return"Move End";case "MOVE":return"Move Start";case "NOTR":return"Pick None";case "ENDT":return"Donethanks";case "CANC":return"Cancel";default:return t.key}}tribeT={["AN"]:"Any",["AB"]:"Abomination",["AG"]:"Angel",["AS"]:"Asir",["BR"]:"Bear",["BE"]:"Beast",["CT"]:"Cat",["CR"]:"Chrysalis",["CY"]:"Cyborg",["DF"]:"Darkforged",["DM"]:"Demon",["DN"]:"Dinosaur",["DG"]:"Dragon",["DK"]:"Drakin",["DY"]:"Dryad",["ER"]:"Earth",["EL"]:"Elemental",["EN"]:"Energeist",["FY"]:"Fairy",["FR"]:"Fire",["FB"]:"Forgeborn",["FT"]:"Frost",["GT"]:"Giant",["GN"]:"Gnome",["GL"]:"Golem",["GG"]:"Grimgaunt",["GD"]:"Guardian",["HM"]:"Human",["HY"]:"Hydra",["IC"]:"Ice",["IN"]:"Insect",["LT"]:"Lightning",["LP"]:"Lupin",["MT"]:"Manticore",["MC"]:"Mech",["MM"]:"Metamind",["NG"]:"Naga",["OZ"]:"Ooze",["PX"]:"Phoenix",["PL"]:"Plant",["RM"]:"Ram",["RB"]:"Robot",["SY"]:"Satyr",["SE"]:"Seraph",["SH"]:"Shaman",["SS"]:"Shapeshifter",["SK"]:"Skeleton",["SN"]:"Snake",["SP"]:"Spider",["ST"]:"Spirit",["TG"]:"Tigrin",["TK"]:"Tuskin",["VP"]:"Vampire",["WD"]:"Wanderer",["WT"]:"Water",["WB"]:"Web",["WN"]:"Wind",["WF"]:"Wolf",["WR"]:"Wurm",["YT"]:"Yeti",["ZB"]:"Zombie"};tribeText(t){return this.tribeT[t]}}const p=new Us;class Os{handleMainMenuButton(t){t.param==="D"?(At.setMode("D"),S.options.wasDrafting=!0,yt.playmatSetup(),pt.initDraft()):t.param==="C"?(At.setMode("C"),S.options.wasDrafting=!1,yt.playmatSetup(),Mt.initConstructed()):t.param==="I"?(At.setMode("I"),yt.drawAll()):window.open("deckbuilder.html")}handleMenuButton(t){const e=S.deTil(t.param),i=e[0];let s=!0;if(i==="RP")s=!1,p.clearAll(),S.options.wasDrafting?pt.replay():Mt.replay();else if(i==="MM")At.setMode("M"),p.clearAll();else if(i==="CN"||i==="CP"||i==="CX"||i==="CR"||i==="CI"||i==="CV"||i==="LK")Mt.handleMenuPick(i,e[1]);else if(i==="DN"||i==="DR"||i==="DI"||i==="DV"||i==="LD"||i==="GP"||i==="OD"||i==="DT")pt.handleMenuPick(i,e[1]);else if(i==="alloyin"||i==="nekrium"||i==="tempys"||i==="uterra"||i==="vanilla")S.options.playmat=i,S.writeStorage("playmat",i);else if(i==="HH")S.toggleOption("highHealth");else if(i==="CH")S.toggleOption("cheater");else if(i==="BB")S.toggleOption("bark");else if(t.param==="BC")S.toggleOption("bigCards");else if(i==="90"){const h=S.options.scale==="90"?"100":"90";yt.changeScale(h)}else i==="RU"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/rules")):i==="FQ"?(s=!1,window.open("https://grousewood-games.github.io/solforge/docs/faq")):(s=!1,console.error("missing handler for menu button param "+t.param));s&&yt.drawAll()}handleUIButton(t){t.param==="DM"?(S.setClickMode("I"),yt.drawAll()):t.param==="TM"?(S.setClickMode("T"),yt.drawAll()):t.param==="EX"?(At.setMode("X"),T.ddf5(this.generateExitActions())):console.error("missing handler for common button param "+t.param)}generateExitActions(){const t=y.basicAction("CANC");return t.param="PM",[t,y.menuButtonAction("MM")]}}const Xe=new Os;class zs{stack=["M"];setMode(t){this.deetMode(t)||t==="X"||t==="S"?this.stack.push(t):(this.stack=[t],t==="G"?(st.get("game-ui").clear(),yt.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(st.get("game-ui").clear(),yt.setBackground("blueface")):t==="M"&&(yt.clearAll(),yt.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 At=new zs;class Zs{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const e=k.toPlayer(t),i=[],s=[];if(e.deck.forEach(h=>{L.getCard(h).consistent?i.push(h):s.push(h)}),i.length===0)this.shuffle(e.deck);else{this.shuffle(s);const h=20-i.length,f=i.concat(s.slice(0,h));this.shuffle(f),e.deck=s.slice(h).concat(f)}}shuffle(t){const e=t.length,i=(s,h)=>{const f=t[s];t[s]=t[h],t[h]=f};if(e>0){let s,h;const f=e*4;for(let m=0;mi.decks).flat(),e=S.randInt(0,t.length);return t[e]}stockDeckByName(t,e){let i;if(ye.some(s=>s.id===t?s.decks.some(h=>{h.name===e&&(i=h)}):!1),i)return i;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+e)}ripper(t,e,i){const s=[[15,8,5],[30,15,10]],h=this.getDeckCards([],[t]),f=[],m=s[i===15?0:1][e-1];for(;f.lengthV===F)||f.push(F)}const A=f.map(C=>({card:C,num:e}));return e===2&&i===15&&(A[0].num=1),A}deckify(t){const e=t.map(i=>{const s=ti.find(h=>h[0]===i);return s?s[1]:[]}).flat();return t.concat(e).map(i=>`${i}1`)}parseDeck(t){const e=t.map(i=>Array(i.num).fill(i.card)).flat();return this.deckify(e)}validDeck(t){const e={};t.forEach(C=>{e[C.card]?e[C.card]+=C.num:e[C.card]=C.num});const i=Object.entries(e).map(C=>({card:C[0],num:C[1]})),s=i.map(C=>C.num).reduce((C,F)=>C+F,0);if(s!==30)return"Deck must have 30 cards, found "+s;const h=[];let f="";if(i.some(C=>{const F=Et.findIndex(V=>V.c===C.card);return F===-1?(f=C.card,!0):(h.push(Et[F].f),!1)}))return`Invalid card code: '${f}'`;let m=0;if(i.some(C=>C.num>3?(f=C.card,m=C.num,!0):!1))return`${m} copies of '${f}' ${p.fastName(f).slice(0,-2)}`;const A=[...new Set(h)];return A.length>2?"Deck must have two or less factions, found: "+A.join():""}getDeckCards(t=[],e=[],i=[]){return t.length===0&&e.length===0&&i.length===0?Et.map(s=>s.c):t.length>0&&e.length>0&&i.length===0?Et.filter(s=>t.includes(s.r)&&e.includes(s.f)).map(s=>s.c):t.length>0&&e.length===0&&i.length===0?Et.filter(s=>t.includes(s.r)).map(s=>s.c):t.length===0&&e.length>0&&i.length===0?Et.filter(s=>e.includes(s.f)).map(s=>s.c):t.length>0&&e.length>0&&i.length>0?Et.filter(s=>t.includes(s.r)&&e.includes(s.f)&&i.includes(Math.floor(s.s))).map(s=>s.c):t.length>0&&e.length===0&&i.length>0?Et.filter(s=>t.includes(s.r)&&i.includes(Math.floor(s.s))).map(s=>s.c):t.length===0&&e.length>0&&i.length>0?Et.filter(s=>e.includes(s.f)&&i.includes(Math.floor(s.s))).map(s=>s.c):Et.filter(s=>i.includes(Math.floor(s.s))).map(s=>s.c)}getCardFaction(t){const e=Et.find(i=>i.c===t);return e?e.f:"X"}getCardRarity(t){const e=Et.find(i=>i.c===t);return e?e.r:"T"}cardStats(){xe.forEach(t=>{const e=`${p.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,i=de.map(s=>`${p.rarityText(s)}: ${this.getDeckCards([s],[t]).length}`).join("; ");console.log(e+i)})}loadPromise=new Ne;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new Ne,this.loader.click(),await this.loadPromise.getPromise(),this.fileguts==="")return"";if(this.fileguts.startsWith("!")){const s=this.fileguts.substring(1);return this.fileguts="",s}const t=JSON.parse(this.fileguts);this.fileguts="";const e=t.cards,i=this.validDeck(e);return i||t}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const e=this.loader.files;if(e&&e.length>0){const s=e[0];var i=new FileReader;i.onload=h=>{try{var f=i.result;if(f){var m=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(f)));m.cards&&Array.isArray(m.cards)&&!m.cards.some(A=>!(A&&typeof A.card=="string"&&Number.isInteger(A.num)))?(this.fileguts=JSON.stringify(m),this.loadPromise.resolveMe()):this.readError("File format is invalid.")}else this.readError("File read was empty.")}catch(A){console.error(A),this.readError("Error reading file.")}};try{i.readAsArrayBuffer(s)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}const Jt=new Zs;class Ys{phase="ST";enterMainPhase(){this.phase="MN";const t=k.getActive(),e=this.getMainPhaseActions(t);R.aiActive&&ht.hitMainPhase(),T.ddf5(e,!0)}async whatNext(t=!1){if(R.winFlag!==0){ht.simOn?(ht.simEndpoint(R.winFlag===1?"L":"W"),R.winFlag=0):(T.actionHistory=[],R.aiActive=!1,R.ui.animating=!1,await yt.drawAll());return}if(await yt.drawAll(),T.actionHistory.length>0)T.ddf5();else if(t)At.setMode("S"),yt.drawAll();else if(x.getNextTrigger())qe.resolve(x.getNextTrigger());else if(!x.deathCheck)W.deathCheck(),this.whatNext();else if(x.events.length>0)x.startBatch();else switch(g.purge(),W.purge(),this.phase){case "MN":this.enterMainPhase();break;case "ET":this.phase="PT",x.addEvents($.player("PTN",k.getActiveB())),Rt.expireMods(),this.whatNext();break;case "PT":E.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),this.phase="MN",this.whatNext();break;case "ST":ht.simOn?ht.simEndpoint("T"):(this.phase="MN",ht.cheater()?S.sleep(500).then(()=>this.whatNext()):S.sleep(100).then(()=>this.whatNext()));break}}expireatron(t,e,i,s){e.mods.forEach(h=>{h.expiry===s?h.expiry=i:h.expiry===i&&t.push([e,h])})}expireMods(){const t=g.creatByTarget(y.crTarg());t.push(k.playerA,k.playerB);let e=[];this.phase==="PT"?t.forEach(i=>{this.expireatron(e,i,"ET","EN")}):this.phase==="ST"&&t.forEach(i=>{this.expireatron(e,i,"ST","SN")}),e.length>0&&(e.forEach(i=>{const s=i[0];s instanceof Be?s.expireMod(i[1]):k.expireMod(s,i[1])}),ae.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const e=this.getHandActions(t),i=this.getFieldActions(t);let s=E.mainBattle,h="M";return s||(s=g.ddf1().some(m=>m.extraBattles>0&&m.isActive&&!m.defender),h="E"),s&&e.push({key:"FITE",zone:"B",param:h,host:""}),s||e.push({key:"ENDT",zone:"B",param:"",host:""}),[e,i].flat()}getHandActions(t){const e=[...new Set(t.hand)],i=[],s=[];e.forEach(A=>{L.getCard(A).isFree?i.push(A):s.push(A)});const h=i.map(A=>[A,"FREE"]);E.freeCards.forEach(A=>{D.cardByTarget(s,A.condition).forEach(F=>{h.push([F[0],A.id]),s.splice(s.indexOf(F[0]),1)})}),h.push(...s.map(A=>[A,""]));const f=E.regularPlays>0;let m=t.hand.map((A,C)=>[A,C]);return f||(m=m.filter(A=>!s.includes(A[0]))),m.map(A=>{const C=h.find(F=>F[0]===A[0]);return C||console.error("No cost found for card"+A[0]),y.handSelectAction("HPLY",A[0],C[1],A[1])})}getFieldActions(t){const e=g.qPlayerCreats(t.isPlayerA),i=e.filter(h=>g.canMove(h).length>0).map(h=>y.fieldSelectAction("MOVE",h.lane,h.owner)),s=e.filter(h=>h.isActive&&h.activationAvailable?L.getCard(h.code).canActivate(h):!1).map(h=>{const f=y.fieldSelectAction("ACTV",h.lane,h.owner);return f.host=h.code,f.param=h.id,f});return i.forEach(h=>{const f=s.findIndex(m=>m.lane===h.lane);f>-1&&(s.splice(f,1),h.param="ACTV")}),i.concat(s)}}const Rt=new Ys;class Ks{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,effects:t.effects}}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.effects=t.effects,e.armor=t.armor,e.armorDmg=t.armorDmg}getState(){const t={pA:this.getPlayerState(this.playerA),pB:this.getPlayerState(this.playerB),actP:this.activePlayer};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.setPlayerState(e.pA,this.playerA),this.setPlayerState(e.pB,this.playerB),this.activePlayer=e.actP}pt2pb={["X"]:()=>{throw new Error("goof passed any to player target boolean-o-fier")},["A"]:()=>!0,["B"]:()=>!1,["F"]:()=>this.getActiveB(),["E"]:()=>!this.getActiveB()};b2p(t){return t?this.playerA:this.playerB}toPlayer(t){return typeof t=="boolean"?this.b2p(t):typeof t=="string"?this.b2p(this.pt2pb[t]()):t}toBool(t){return typeof t=="boolean"?t:typeof t=="string"?this.pt2pb[t]():t.isPlayerA}toTarget(t){return typeof t=="string"?t:(typeof t=="boolean"?t:t.isPlayerA)?"A":"B"}getActive(){return this.b2p(this.activePlayer)}getActiveB(){return this.activePlayer}getLocal(){return this.b2p(this.isLocalA)}getLocalB(){return this.isLocalA}hurtPlayer(t,e){if(e<1)return 0;const i=this.totalArmor(t),s=Math.max(Math.min(e,i-t.armorDmg),0);let h=e-s;return t.armorDmg+=s,t.health-=h,h}hurtDirect(t,e,i){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(p.new().crd(i).txt(` dealt ${h} dmg to `).plr(s).txt(".").go(),x.addEvents($.damage(!1,h,s.health,!1,!1,s.isPlayerA,void 0)),ae.playerHealthChange())}hurtBattle(t,e,i){const s=this.toPlayer(t),h=this.hurtPlayer(s,e);h>0&&(p.new().crd(i.code).txt(` dealt ${h} battle dmg to `).plr(s).txt(".").go(),x.addEvents($.damage(!0,h,s.health,!0,!1,s.isPlayerA,i)))}heal(t,e){const i=this.toPlayer(t);i.health+=e,p.new().plr(i).txt(` gained ${e} health.`).go(),x.addEvents($.playerHeal(i.isPlayerA,e)),ae.playerHealthChange()}drawCard(t,e){const i=this.toPlayer(t);for(let s=0;ss.granter===e?(s.type==="AR"&&(i.armorDmg=Math.max(0,i.armorDmg-s.value)),!1):!0)}removeModSafe(t,e){const i=this.toPlayer(t);this.hasMod(i,e)&&this.removeMod(i,e)}expireMod(t,e){const i=this.toPlayer(t);i.mods.splice(y.modIdx(i.mods,e),1)}enforceEffects(t){const e=this.toPlayer(t);e.effects.forEach(i=>L.getCard(i.logicCode).enforcePlayerEffect(i,e))}newPlayer(t){return{hand:[],deck:[],discard:[],effects:[],isPlayerA:t,health:120,mods:[],name:"",nameOffset:0,triggers:[],turn:1,rank:1,armor:0,armorDmg:0,poison:0,avatar:Math.floor(Math.random()*17)}}initPlayer(t,e,i,s){const h=this.toPlayer(t);h.name=i,h.nameOffset=s,h.turn=1,h.rank=1,h.health=S.options.highHealth?360:120,h.discard=[],h.deck=Jt.parseDeck(e),h.mods=[],h.triggers=[],h.effects=[],h.poison=0,h.armor=0,h.armorDmg=0,this.ambushScan(h),Jt.shuffleDeck(h),h.hand=h.deck.splice(-5,5)}ambushScan(t){this.boosh(t,"LLD","PC"),this.boosh(t,"LLG","MV"),this.boosh(t,"LLS","EF"),this.boosh(t,"LLT","LG")}boosh(t,e,i){const s=e+"1";if(t.deck.includes(s)){const h=y.trigger(i,s);h.cardCode=s,h.customCode="AB",t.triggers.push(h)}}nameOSaurus(){const t=[["The Garmgunt",5],["Dr. Lucksack",15],["Sgt. Misplay",22],["Salty O'Teary",12],["M.V.P. Sprout",19],["Uncle Punchy",7],["Yesetherian",20],["Rubbish Asir",20],["Hogwash Druid",0],["Offal Savant",15],["Filth Knight",17],["Dirty Mystic",16],["Ether Buffoon",6],["Nexus Dimwit",12],["Hairy Poppins",11],["Al E. Gator",26],["Anita Bath",28],["Bennie Factor",9],["Chris P. Bacon",9],["Don Keigh",29],["Earl E. Bird",25],["Hugh Jass",34],["Jay Walker",28],["Barb Dwyer",22],["Robyn Banks",18],["Anna Graham",9],["Holly Graham",6],["Justin Case",26],["Sir Loins",39]],e=t[S.randInt(0,t.length)];return[e[0],e[1]+18]}}const k=new Ks;class Xs{stateStack=[];popCheck(){if(this.stateStack.length===0)throw new Error("Attempted to manipulate empty stack")}saveState(){const t={action:T.getState(),aiInPhase:ht.inPhase,batch:x.getState(),death:W.getState(),field:g.getState(),game:R.getState(),mode:JSON.stringify(At.stack),phase:Rt.phase,player:k.getState(),turn:E.getState()};this.stateStack.push(t)}restoreState(){this.popCheck();const t=this.stateStack[this.stateStack.length-1];T.setState(t.action),ht.inPhase=t.aiInPhase,x.setState(t.batch),W.setState(t.death),g.setState(t.field),R.setState(t.game.i,t.game.t),At.stack=JSON.parse(t.mode),Rt.phase=t.phase,k.setState(t.player),E.setState(t.turn)}popState(){this.popCheck(),this.stateStack.pop()}}const me=new Xs;class qs{toActions(t){return(Array.isArray(t)?t:[t]).map(i=>{const s=this.actionTargGuts(i);return s.forEach(h=>{h.host=i.host,h.param=i.param,h.hint=i.hint}),s}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(e=>y.handSelectAction(t.key,e[0],"",e[1]));if(t.target==="TF"){if(t.field==="O")return g.creatByTarget(t).map(e=>y.fieldSelectAction(t.key,e.lane,e.owner));{const e=t.player==="X"?[!0,!1]:[k.toBool(t.player)],i=S.isUn(t.lanes)?g.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return e.map(s=>i.map(h=>y.fieldSelectAction(t.key,h,s))).flat();if(t.field==="E")return e.map(s=>g.emptyLanes(s).filter(h=>i.includes(h)).map(h=>y.fieldSelectAction(t.key,h,s))).flat()}}if(t.target==="TP")return t.player==="X"?[y.playerSelectAction(t.key,!0),y.playerSelectAction(t.key,!1)]:[y.playerSelectAction(t.key,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 i=t.map((s,h)=>[s,h]);if(e){if(S.isUn(e.deckPositionSkip)||(i=i.filter(s=>s[1]!==e.deckPositionSkip)),e.faction!=="X"&&(i=i.filter(s=>L.getCard(s[0]).faction===e.faction)),e.tribe!=="AN"&&(i=i.filter(s=>{const h=L.getCard(s[0]);return h.type==="C"?h.isTribe(e.tribe):!1})),e.canLevel&&(i=i.filter(s=>L.getCard(s[0]).canLevel())),e.level!=="LA"){const s=D.levelTargetToLevel(e.level);i=i.filter(h=>{const f=parseInt(h[0].substring(3,4));return s.includes(f)})}if(e.card!=="A"){const s=e.card==="C"?"C":"S";i=i.filter(h=>L.getCard(h[0]).type===s),e.card==="C"&&!S.isUn(e.maxAttack)&&(i=i.filter(h=>L.getCard(h[0]).iAttack<=e.maxAttack))}e.cardCode&&(i=i.filter(s=>L.getCard(s[0]).cardCode()===e.cardCode))}return i}deckByTarget(t){const e=k.toPlayer(t.player);let i;if(t.target==="TH")i=e.hand;else if(t.target==="TD")i=e.discard;else if(t.target==="DK")i=e.deck;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(i,t)}buttonTarget(t,e="",i=""){return y.actionTarget("TB",t,e,i)}boardTarget(t,e){return y.actionTarget("TR",t,e,"")}ddf2(t){return t===1?"L1":t===2?"LN":"LA"}lt2l={["LA"]:()=>[1,2,3,4],["L1"]:()=>[1],["L2"]:()=>[2],["L3"]:()=>[3],["LN"]:()=>[1,2]};levelTargetToLevel(t){return this.lt2l[t]()}levelTargetTest(t,e){return this.levelTargetToLevel(t).includes(e)}levelTestCommon(t,e){return this.levelTargetTest(this.ddf2(e),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}const D=new qs;class js{ddf8(t){return t.trigger.type==="FR"?this.forgeTriggerTest(t,!1):t.trigger.type==="VN"?this.vengeanceTriggerTest(t):t.trigger.type==="FK"?this.flankTriggerTest(t):t.trigger.type==="AS"?this.forgeTriggerTest(t,!0):t.trigger.type==="UP"?this.upgradeTriggerTest(t):t.trigger.type==="DM"&&t.event.code==="DMG"||t.trigger.type==="HG"&&t.event.code==="CHL"||t.trigger.type==="EF"&&t.event.code==="ENT"||t.trigger.type==="DS"&&t.event.code==="DIE"||t.trigger.type==="PC"&&t.event.code==="PLC"||t.trigger.type==="MV"&&t.event.code==="MOV"||t.trigger.type==="RP"&&t.event.code==="RPL"||t.trigger.type==="LG"&&t.event.code==="PHL"||t.trigger.type==="TS"&&t.event.code==="TRS"||t.trigger.type==="TE"&&t.event.code==="TRE"||t.trigger.type==="PT"&&t.event.code==="PTN"||t.trigger.type==="RU"&&t.event.code==="RKU"?this.generalTriggerTest(t):!1}resolve(t){t.trigger.interactive&&(t.host==="P"?console.error("Encountered player hosted trigger that is interactive!!"):x.iaTrigLane=g.jr5(t.creatId).lane),L.getCard(t.trigger.logicCode).jr8(t)}forgeTriggerTest(t,e){if(t.event.code==="ENT"){const i=t.event;if(i.forged){const s=g.jr5(t.creatId),h=s.id===i.creatId&&s.status==="A";return e&&h?!s.opposed:h}}return!1}upgradeTriggerTest(t){if(t.event.code==="RPL"){const e=t.event,i=g.searchById(t.creatId);if(i)return i.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const e=t.event,i=g.searchById(t.creatId);if(i)return i.status==="D"&&i.id===e.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const e=t.event,i=g.jr5(t.creatId);return i.status==="A"&&i.id===e.creatId}return!1}generalTriggerTest(t){return L.getCard(t.trigger.logicCode).ddf8(t)}}const qe=new js;class Js{firstTurn=!0;mainBattle=!0;deathsA=[];deathsB=[];ffs=0;regularPlays=2;cardsPlayed=0;freeCards=[];newPre=[];newPost=[];getState(){const t={mB:this.mainBattle,dA:this.deathsA,dB:this.deathsB,cP:this.cardsPlayed,ffs:this.ffs,fC:this.freeCards,rP:this.regularPlays,n1:this.newPre,n2:this.newPost};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.mainBattle=e.mB,this.deathsA=e.dA,this.deathsB=e.dB,this.cardsPlayed=e.cP,this.ffs=e.ffs,this.freeCards=e.fC,this.regularPlays=e.rP,this.newPre=e.n1,this.newPost=e.n2}resetTurnData(){this.mainBattle=!0,this.deathsA=[],this.deathsB=[],this.ffs=0,this.regularPlays=2,this.cardsPlayed=0,this.freeCards=[],this.newPre=[],this.newPost=[],this.firstTurn&&(this.firstTurn=!1,this.regularPlays=1)}forgeCard(t,e,i,s){const h=this.cardPlayed(e,i,s),f=k.getActive();p.new().txt("Forged ").crd(h.code).txt(".").go(),g.birth(h,"F",f.isPlayerA,t.lane),T.actionDone()}levelAndDiscardA(t){return this.levelAndDiscard(t.card,t.position)}levelAndDiscard(t,e,i=!0,s="F"){const h=L.getCard(t),f=k.toPlayer(s);if(e>-1?f.hand.splice(e,1):p.debug("Bad play index: "+e+" ("+t+")"),!h.overload){const m=h.levelUpCard();f.discard.push(m),i&&m!==t&&p.new().plr(f).txt(" leveled a card.").go()}return h}cardPlayed(t,e,i,s=!1){const h=this.levelAndDiscard(t,i,s),f=k.getActive();if(e==="")this.regularPlays-=1;else if(e!=="FREE"){const m=this.freeCards.findIndex(A=>A.id===e);m>-1?this.freeCards.splice(m,1):console.error("Could not find free card rule!")}if(this.cardsPlayed+=1,!s){const m=$.playCard(t,f.isPlayerA);x.addEvents(m)}return h}passTheTurn(){if(k.activePlayer=!k.activePlayer,Rt.phase="WT",R.aiMode){if(!ht.simOn)if(R.aiActive=!R.aiActive,R.aiActive)ht.turnSims=0,ht.turnTime=0;else{const t=`🤖: ${this.calma(ht.turnSims)} pontifications in ${(ht.turnTime/1e3).toFixed(1)} seconds.`;p.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="------";ht.log&&R.aiActive&&R.aiMode&&console.log(t+" AI Turn Start "+t),ht.simOn||(p.new().txt(t).go(),p.new().plr(k.getActiveB()).txt(" starts turn.").go()),this.resetTurnData(),Rt.phase="ST",x.addEvents($.player("TRS",k.getActiveB())),Rt.expireMods(),Rt.whatNext(!R.aiMode)}endTurn(){const t=k.getActive();t.discard.push(...t.hand),t.hand=[],t.turn++;const e=t.turn>4;x.addEvents($.player("TRE",t.isPlayerA)),e&&(t.turn=1,t.rank++,p.new().plr(t).txt(" hits Rank "+t.rank+".").go(),x.addEvents($.player("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],Jt.shuffleDeck(t.isPlayerA)),g.qActiveCreats().forEach(i=>{i.extraBattles=0}),k.drawCard(t,5),Rt.phase="ET",T.actionDone()}mobility(t){const e=g.jr5(t.param);p.new().crd(e.code).txt(" moved.").go(),e.mobilityAvailable=!1,e.move(t.lane),T.actionDone()}allied(t,e){const i=e??k.getActive(),s=y.target("TH");return s.player=k.toTarget(i),s.faction=t,D.deckByTarget(s).length>0}patron(t){const e=y.target("TH");return e.player=k.toTarget(k.getActive()),e.faction=t,D.deckByTarget(e).length>2}freeCard(t){const e=y.freeCard(t);return this.freeCards.push(e),e}birthRegistrar(t){this.mainBattle?this.newPre.push(t):this.newPost.push(t)}}const E=new Js;class di{id;dom;context;width;height;constructor(t){if(this.id=t,this.dom=document.getElementById(t),!this.dom)throw new Error(`Could not find canvas id ${t}`);this.context=this.dom.getContext("2d"),this.width=this.dom.width,this.height=this.dom.height,this.context.textBaseline="top",this.context.shadowOffsetX=1,this.context.shadowOffsetY=1}show(){this.dom.hidden=!1}hide(){this.dom.hidden=!0}get visible(){return!this.dom.hidden}clear(){this.context.clearRect(0,0,this.width,this.height)}sprite(t,e,i){this.context.drawImage(t,e,i)}updateScale(t){this.context.scale(t,t)}}class Gt{getCanv(t){return t instanceof di?t:st.get(t)}async drawSprite(t,e,i,s,h={}){const f=this.getCanv(t).context,m=await S.getSprite(S.imgRoot+e);let A=1;h&&(A=h.alpha??1),A<1&&(f.globalAlpha=A),f.drawImage(m,i,s,m.naturalWidth,m.naturalHeight),A<1&&(f.globalAlpha=1)}async drawText(t,e,i,s,h={}){const f=this.getCanv(t).context,m=h.fontSize??24;S.pxRatio===2&&(s=this.retinaTextY(s,m)),f.fillStyle=h.colour||"#000000",f.font=`${m}px ${h.fontName||"cinzel"}`,f.shadowColor=h.shadow?"#000000":"#00000000",f.fillText(e,i,s),f.shadowColor="#00000000"}async spriteNumber(t,e,i,s,h,f){let m=i-this.numOffset(e,h);const A=[];e.toString().split("").forEach(C=>{A.push(this.drawSprite(t,this.numSpriteUrl(C,h,f),m,s)),m+=this.numSize(C,h)}),await Promise.all(A)}async drawHighlight(t,e,i,s,h,f="#00FF00"){const m=f.length===7?f.concat("aa"):f,A=this.getCanv(t);A.context.strokeStyle=m,A.context.beginPath(),A.context.rect(e,i,s,h),A.context.stroke()}hlColour(t){return t==="CANC"?"#FF0000":"#00FF00"}drawRarity(t,e,i,s){return this.drawSprite(t,`icons/rarity/new/${p.rarityText(e).toLowerCase()}.png`,i,s)}drawFaction(t,e,i,s){const h=e==="T"?2:0;return this.drawSprite(t,`icons/faction/${p.factionText(e).toLowerCase()}.png`,i+h,s+3)}retinaTextY(t,e){let i;return e<21?i=6:e<27?i=7:i=8,t-i}smallNumSize={"-":7,0:10,1:9,2:10,3:8,4:10,5:9,6:10,7:9,8:8,9:9};bigNumSize={"-":8,0:13,1:9,2:13,3:11,4:14,5:12,6:12,7:12,8:12,9:12};numSize(t,e){return e==="S"?this.smallNumSize[t]:this.bigNumSize[t]}numOffset(t,e){const i=t.toString().split("").reduce((s,h)=>s+this.numSize(h,e),0)-(e==="B"?2:1);return Math.floor(i/2)}numSpriteUrl(t,e,i){return`text/nums/${e}/${i}/${t}.png`}haze="#222222d8"}class pe extends Gt{async drawButton(t,e,i,s,h,f=7,m=!1,A=!0){let C,F;m?(C="ui/button/menu_on.png",F="#d7fc03"):(C="ui/button/menu_off.png",F="#00DEF7");const V=this.buttonBounds(e,i);if(await this.drawSprite(t,C,V[0],V[1]),await this.drawText(t,h,V[0]+7+f,V[1]+24,{colour:F,fontSize:30}),!m||A){const Y=new dt(s,...V,at.Both);tt.add(Y)}}async buttonMaker(t,e,i,s,h,f=7,m=!1,A=!0){const C={key:"MNBT",zone:"N",host:"",param:s};await this.drawButton(t,e,i,C,h,f,m,A)}buttonBounds(t,e){return[t-7,e-7,232,69]}}class je extends Gt{async makeIconButton(t,e,i,s){let f;f=`ui/button/ui_${s}.png`,await this.drawSprite(t,f,e,i);const m=y.basicAction("UIBT");m.param=s;const A=new dt(m,e,i,40,40,at.Both);tt.add(A)}async makeVScroller(t,e,i,s,h){const f=this.vScrollHilightBounds(e,i);await this.drawSprite(t,`ui/arrow/${s?"up":"down"}.png`,e,i);const m={zone:"N",key:h,host:"",param:s?"U":"D"},A=new dt(m,...f,at.Both);tt.add(A)}vScrollHilightBounds(t,e){return[t-3,e-3,40,27]}}class Ge extends Gt{async drawActions(t){if(At.baseMode==="G"){const e=st.get("effects"),i=t.filter(s=>s.zone==="B");if(i.length>1&&console.error("Two button actions encountered in one batch",i),i.length===0||R.aiActive||S.clickMode==="I"&&!At.isDetailMode){const s=this.buttonBounds();await this.drawSprite(e,"ui/button/off.png",s[0],s[1])}else{const s=i[0],h=this.buttonBounds();await this.drawSprite(e,"ui/button/on.png",h[0],h[1]);let f;s.key==="CARD"?f=s.param:f=s.key,await this.drawSprite(e,`text/butt/${f}.png`,h[0]+23,h[1]+18);const m=this.highlightBounds(),A=new dt(s,...m);s.key==="CNCL"&&(A.mouse=at.Both),tt.add(A)}}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),e=5,i=[-1,-1,2,2];return t.map((s,h)=>s+e*i[h])}}class Yt extends Gt{async drawCard(t,e,i,s){const h=this.getCanv(e),f=this.extractStats(t),m=f.cardClass;if(await this.drawSprite(h,m.image(!1),i+14,s+35),await this.drawSprite(h,this.frameImg(m.level,m.faction,m.type,!1),i,s),await this.drawSprite(h,`text/card/${m.cardCode()}.png`,i+12,s+16),f.isCreature){const A=s+178;await this.spriteNumber(h,f.att,i+24,A,"S","Y"),await this.spriteNumber(h,f.hlt,i+127,A,"S","Y")}if(f.sleeping&&await this.drawSprite(h,"icons/effects/defensive.png",i+5,s+40,{alpha:.7}),f.iconList.length>0){const A=i+57-17*(f.iconList.length-1);await Promise.all(f.iconList.map(async(C,F)=>this.drawIcon(h,A+F*35,s+140,C[0],C[1])))}}async drawBigCard(t,e,i,s){const h=this.extractStats(e);if(await this.drawSprite(t,e.image(!0),i+38,s+117),await this.drawSprite(t,this.frameImg(e.level,e.faction,e.type,!0),i,s),e.rarity!=="T"&&await this.drawRarity(t,e.rarity,i+309,s+394),h.isCreature){const f=s+555;await this.spriteNumber(t,h.att,i+44,f,"B","Y"),await this.spriteNumber(t,h.hlt,i+325,f,"B","Y")}}async drawIcon(t,e,i,s,h=0){const f=this.getCanv(t);if(await this.drawSprite(f,`icons/effects/${s}.png`,e,i),h>0){const m=s==="poison"?12:9;await this.spriteNumber(f,h,e+17,i+m,"S","B")}}extractStats(t){let e,i=!1,s=0,h=0,f=!1,m=0,A=!1,C=!1,F=!1,V=!1,Y=0,j=0,mt=0,z=!1,rt=!1;if(!(t instanceof Nt))i=!0,s=t.attack,h=t.health,f=t.sleeping&&!t.aggressive,m=t.regen,A=t.breakthrough,C=t.defender,F=t.aggressive,Y=t.armor,j=t.poison,mt=t.mobility,V=t.changed,e=L.getCard(t.code);else{if(t.type==="C"){i=!0;const vt=t;s=vt.iAttack,h=vt.iHealth,m=vt.iRegen,A=vt.iBT,C=vt.iDefend,F=vt.iAggro,Y=vt.iArmor,mt=vt.iMobile}z=t.overload,rt=t.consistent,e=t}const et=[];return z&&et.push(["overload",0]),rt&&et.push(["consistent",0]),m>0&&et.push(["regenerate",m]),A&&et.push(["breakthrough",0]),C&&et.push(["defender",0]),F&&et.push(["aggressive",0]),Y>0&&et.push(["armor",Y]),j>0&&et.push(["poison",j]),mt>0&&et.push(["mobility",mt]),V&&et.push(["changed",0]),{cardClass:e,isCreature:i,iconList:et,hlt:h,att:s,sleeping:f}}async drawHilight(t,e,i,s="#00FF00"){await super.drawHighlight(t,...this.highlightBounds(e,i),s)}cardBounds(t,e){return[t,e,150,205]}highlightBounds(t,e){const i=this.cardBounds(t,e),s=5,h=[-1,-1,2,2];return i.map((f,m)=>f+s*h[m])}frameImg(t,e,i,s){return`frames/${s?"big":"small"}/lvl${t}_${e}${i}.png`}levelImg(t){return`icons/frame/lvl${t}.png`}oldFrameImg(t){return`icons/frame/frame${t}.png`}factionImg(t){return`icons/faction/orb${t}.png`}}const ui=30,$e=540,fi=5;class gi extends Gt{async drawCards(t){const e=st.get("hand");e.clear();const i=new Yt,s=i.highlightBounds(0,0)[2]+fi;let h=ui;const f=this.paginatron(t);for(let m=f[0];m<=f[1];m++){const A=L.getCard(t.hand[m]);await i.drawCard(A,e,h,$e),h+=s}}async drawActions(t){const e=S.clickMode!=="I",i=st.get("effects"),s=new Yt,h=s.highlightBounds(0,0)[2]+fi,f=new Vt(0,520,1e3,250),m=new Vt(0,520,1e3,250,at.Right),A=this.paginatron(k.getActive());await Promise.all(t.filter(C=>C.zone==="H").map(async C=>{const F=C;if(F.position>=A[0]&&F.position<=A[1]){const V=ui+(F.position-A[0])*h;if(C.key==="DEET"){const Y=new dt(C,...s.highlightBounds(V,$e),at.Right);m.addChild(Y)}else if(e){const Y=new dt(C,...s.highlightBounds(V,$e));f.addChild(Y),await s.drawHilight(i,V,$e,this.hlColour(F.key))}}})),e&&tt.add(f),tt.add(m),A[0]>0&&await this.makeScroller(i,!1),A[1]0&&t.hand.length-e<5&&(e=Math.max(0,t.hand.length-5),R.ui.handScrollLeft=e),[e,Math.min(e+4,t.hand.length-1),t.hand.length-1]}scrollHilightBounds(t,e){return[t-3,e-2,27,38]}async makeScroller(t,e){const i=e?894:856,s=726,h=this.scrollHilightBounds(i,s);await this.drawSprite(t,`ui/arrow/${e?"right":"left"}.png`,i,s),await this.drawHighlight(t,...h);const f={zone:"N",key:"SCRH",host:"",param:e?"R":"L"},m=new dt(f,...h,at.Both);tt.add(m)}}class Je extends Gt{fieldBoundary=[17,62,821,443];async drawCards(t){const e=k.getLocalB(),i=st.get("field");i.clear();const s=new Yt,h=g.qActiveCreats().map(f=>{let m=0;t&&t.scrappers.some(C=>C[0]===f.lane&&C[1]===f.owner)&&(m=t.battlePhase);const A=this.coordCalc(f.lane,f.owner,e,m);return s.drawCard(f,i,...A)});if(await Promise.all(h),x.iaTrigLane>0){const f=this.coordCalc(x.iaTrigLane,k.getActiveB(),e),m=s.cardBounds(...f),A=m[1]+m[3]+11,C=m[0]+m[2]/2;await this.drawSprite(i,"icons/rewards/gold.png",C-10,A),await this.drawSprite(i,"icons/rewards/gold.png",C-35,A),await this.drawSprite(i,"icons/rewards/gold.png",C-60,A),await this.drawSprite(i,"icons/rewards/gold.png",C+15,A),await this.drawSprite(i,"icons/rewards/gold.png",C+40,A)}}async drawActions(t){const e=S.clickMode!=="I",i=k.getLocalB(),s=st.get("effects"),h=new Yt,f=new Vt(...this.fieldBoundary),m=new Vt(...this.fieldBoundary,at.Right);await Promise.all(t.filter(A=>A.zone==="F"||A.zone==="R").map(async A=>{if(A.zone==="R"&&e){const C=new dt(A,...this.fieldBoundary);tt.add(C),await this.drawHighlight(s,...this.fieldBoundary)}else{const C=A,F=this.coordCalc(C.lane,C.playerA,i);if(A.key==="DEET"){const V=new dt(A,...h.highlightBounds(...F),at.Right);m.addChild(V)}else if(e){const V=new dt(A,...h.highlightBounds(...F));f.addChild(V),await h.drawHilight(s,...F,this.hlColour(C.key))}}})),e&&f.childs.length>0&&tt.add(f),m.childs.length>0&&tt.add(m)}async drawFight(t){if(t.length>0){const e={battlePhase:1,scrappers:t},i=72;await new Ge().drawActions([]),await this.drawCards(e),await S.sleep(i),e.battlePhase=2,await this.drawCards(e),await S.sleep(i),e.battlePhase=3,await this.drawCards(e),await S.sleep(i),e.battlePhase=4,await this.drawCards(e),await S.sleep(i+70),e.battlePhase=3,await this.drawCards(e),await S.sleep(i),e.battlePhase=2,await this.drawCards(e),await S.sleep(i),e.battlePhase=1,await this.drawCards(e),await S.sleep(i)}}coordCalc(t,e,i,s=0){const h=i===e,f=166,m=5;let A,C,F;return[A,F,C]=h?[22,290,1]:[687,65,-1],[A+(t-1)*f*C,F+s*m*(-1*C)]}}class Se extends Gt{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,e,i,s){const h=this.getCanv(e);await this.drawSprite(h,`avatar/${this.avatars[t.avatar]}.jpg`,i+46,s+48),await this.drawSprite(h,"ui/player_frame.png",i,s),await this.drawSprite(h,"ui/player_health.png",i+10,s+102),await this.spriteNumber(h,t.health,i+45,s+149,"B","G"),await this.drawText(h,`Turn: ${t.turn} Rank: ${t.rank}`,i+25,s+210,{colour:"#f5f242",fontSize:20}),await this.drawText(h,t.name,i+t.nameOffset,s+185,{colour:"#42a4f5",fontSize:20});const f=k.totalPoison(t),m=k.totalArmor(t);if(f>0||m>0){const A=new Yt,C=s+9;f>0&&await A.drawIcon(h,i+15,C,"poison",f),m>0&&await A.drawIcon(h,i+150,C,"armor",m)}}async drawAllPlayers(){const t=st.get("player");t.clear();const e=!R.aiActive,i=k.getLocal(),s=k.toPlayer(!i.isPlayerA);if(await this.drawPlayer(i,t,...this.playerOrigin(!0)),await this.drawPlayer(s,t,...this.playerOrigin(!1)),i.isPlayerA===k.getActiveB()){let h=862;const f=295,m=Array(E.regularPlays).fill("blue").concat(E.freeCards.map(C=>C.sourceCard)),A=[];m.forEach(C=>{let F;if(C==="blue")F=C;else if(F="green",e){const V={key:"DEET",zone:"N",host:"",param:C},Y=new dt(V,h-1,f-1,28,41,at.Both);tt.add(Y)}A.push(this.drawSprite(t,`ui/${F}card.png`,h,f)),h+=30}),await Promise.all(A)}await this.drawDeckButton(t,i,!0,e),await this.drawDeckButton(t,i,!1,e)}async drawDeckButton(t,e,i,s){let h,f,m;if(i?(h=e.discard.length,f=935,m="T"):(h=e.deck.length,f=858,m="U"),await this.drawSprite(t,`ui/button/faction_${m}.png`,f,350),await this.spriteNumber(t,h,f+38,350+14,"S","Y"),h>0&&s){const C=y.basicAction("VWDK");C.param=i?"VD":"VR";const F=new dt(C,f,350,77,44,at.Both);tt.add(F)}}async drawActions(t){if(S.clickMode==="I")return;const e=st.get("effects"),i=k.getLocalB();await Promise.all(t.filter(s=>s.zone==="P").map(s=>{const h=s,f=this.playerOrigin(h.playerA===i),m=this.highlightBounds(...f),A=new dt(s,...m);return tt.add(A),this.drawHighlight(e,...m)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,e){return[t+18,e+18,170,170]}highlightBounds(t,e){return this.playerBounds(t,e)}async drawGameOver(){const t=st.get("field"),e=94,i=k.getLocalB(),s=R.winFlag,h=i&&s===1||!i&&s===-1;await this.drawSprite(t,`ui/you-${h?"win":"lose"}.png`,e,89),tt.removeAll();const f=new pe,m=st.get("effects");await f.drawButton(m,e+62,520,y.menuButtonAction("MM"),"Main Menu",20,!1),await f.drawButton(m,e+389,520,y.menuButtonAction("RP"),"Replay",55,!1)}async drawAiGear(t,e){const h=t%6,f=Math.floor(t/6),m=st.get("effects"),A=`icons/rewards/${e?"gold":"silver"}.png`;await this.drawSprite(m,A,862+h*24,255+f*24)}hwhipe(){st.get("effects").clear()}}const mi=15,pi=15,Qs=5;class _s extends Gt{constructor(){super();const e=new Yt().highlightBounds(0,0);this.xOffset=e[2]+Qs,this.yOffset=e[3]+25}xOffset;yOffset;async drawCards(){const t=st.get("decklist");t.clear(),t.context.fillStyle=this.haze,t.context.fillRect(0,0,849,S.gameHeight);const e=new Yt,s=wt.visibleContent().map((h,f)=>{const m=L.getCard(h.cardCode),A=this.listXY(f);return e.drawCard(m,t,...A).then(()=>{if(h.cardCount>0)return this.drawCount(t,A[0]+62,A[1]+163,h.cardCount)})});await Promise.all(s)}async drawActions(t){const e=st.get("decklist"),i=new Yt,s=new je,h=S.clickMode!=="I",f=wt.visibleContent(),m=R.ui,A=m.deckScroll,C=A+15,V=m.deckSummary?at.Both:at.Right,Y=new Vt(...this.deckBoundary()),j=new Vt(...this.deckBoundary(),V),mt=[];t.forEach(z=>{if(z.key==="DEET"){const rt=z;if(rt.position>=A&&rt.positionvt.sourceIdx===rt.position);if(et>-1){const vt=this.listXY(et-A),we=new dt(z,...i.highlightBounds(...vt));Y.addChild(we),mt.push(i.drawHilight(e,...vt,this.hlColour(z.key)))}}}),h&&Y.childs.length>0&&tt.add(Y),j.childs.length>0&&tt.add(j),wt.canPageDown&&mt.push(s.makeVScroller(e,319,723,!1,"SCRK")),wt.canPageUp&&mt.push(s.makeVScroller(e,487,723,!0,"SCRK")),await Promise.all(mt)}async drawCount(t,e,i,s){await this.drawSprite(t,"ui/dullcard.png",e,i),await this.spriteNumber(t,s,e+13,i+12,"S","Y")}listXY(t){return[mi+t%5*this.xOffset,pi+Math.floor(t/5)*this.yOffset]}deckBoundary(){return[mi,pi,this.xOffset*5,this.yOffset*3]}}class ta extends Gt{async drawDetails(t){const e=[],i=st.get("card");i.clear(),i.context.fillStyle=this.haze,i.context.fillRect(0,0,849,S.gameHeight);const s=30,h=30,f=L.getCard(jt.currentCard),m=new Yt;S.options.bigCards?e.push(m.drawBigCard(i,f,s,h)):e.push(m.drawCard(f,i,134,280));const A=435;let C=30;const F="#f5f242",V="#03fcfc",Y=33,j=23,mt=28;let z=f.name;for(;z.length>0;){C+=36;let Dt;if(z.length{for(;Dt.length>0;){let Kt;if(Dt.length1){const Dt=f.cardCode(),Kt=vt===3?[19,147,270]:vt===2?[78,216]:[0,98,196,294];et.forEach((ce,Ve)=>{e.push(this.drawLevelButton(i,Dt,ce,40+Kt[Ve],658,ce===f.level))})}const we=new pe;let De=0;const Qe=513,_e=697,yi=74;At.baseMode!=="G"&&(e.push(we.drawButton(i,Qe,_e,t,"Close",62,!1)),De++);const aa=new dt(t,s,h,377,603,at.Both);if(tt.add(aa),jt.canGoBack){const Dt=jt.goBackAction();e.push(we.drawButton(i,Qe,this.buttonY(_e,De,yi),Dt,"Back",72,!1)),De++}jt.friendos.forEach(Dt=>{const Kt=L.getCard(Dt),ce=jt.friendAction(Dt),Ve=jt.friendTxt(Kt.cardCode());e.push(we.drawButton(i,Qe,this.buttonY(_e,De,yi),ce,Ve[1]||Kt.name,Ve[0],!1)),De++}),await Promise.all(e)}buttonY(t,e,i){return t-e*i}cardSummary(t){const e=p.factionText(t.faction),i=p.rarityText(t.rarity),s=p.cardTypeText(t.type);return`${e}, ${i} ${s}`}tribeSummary(t){return t.tribe.map(e=>p.tribeText(e)).join(" ")}async drawLevelButton(t,e,i,s,h,f){if(await this.drawSprite(t,`icons/frame/level${i}.png`,s,h),!f){const F=jt.levelAction(i),V=new dt(F,s-15,h-5,88,112,at.Both);tt.add(V)}const A=L.getCard(`${e}${i}`).levelSpice(),C=[[-16,55],[41,55],[11,79]];await Promise.all(A.map((F,V)=>{const Y=s+C[V][0],j=h+C[V][1];if(F.icon==="A"||F.icon==="H"){let mt,z;return F.icon==="A"?(mt="icons/frame/attack.png",z=Y+17):(mt="icons/frame/health.png",z=Y+16),this.drawSprite(t,mt,Y-1,j-1).then(()=>this.spriteNumber(t,F.num,z,j+10,"S","Y"))}else{let mt=this.spiceIcon(F.icon);if(F.icon==="U"||F.icon==="D"||F.icon==="L"||F.icon==="N"){const z=`icons/effects/${mt}.png`;return this.drawSprite(t,z,Y-1,j-1).then(()=>this.spriteNumber(t,F.num,Y+16,j+10,"S","B"))}else return new Yt().drawIcon(t,Y,j,mt,F.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 ea extends Gt{packLeft=22;packTop=190;packBoundary=[this.packLeft-5,this.packTop-10,537,480];async drawPack(t,e){const i=new Yt,s=S.clickMode!=="I",h=[],f=new Vt(...this.packBoundary),m=new Vt(...this.packBoundary,at.Right);t.filter(C=>C.pack).forEach(C=>{const F=this.coordCalcPack(C.index);if(C.key==="DRFT"){const V=L.getCard(C.param+"1");if(h.push(i.drawCard(V,e,...F).then(()=>this.drawRarity(e,V.rarity,F[0]+112,F[1]+4))),s){const Y=new dt(C,...i.highlightBounds(...F));f.addChild(Y)}}else{const V=new dt(C,...i.highlightBounds(...F),at.Right);m.addChild(V)}}),s&&f.childs.length>0&&tt.add(f),m.childs.length>0&&tt.add(m),await Promise.all(h)}async drawList(t,e){let i=170;const s=570,h=[],f=pt.picksAsDeck,m=new Vt(s,i,600,600,at.Both),A=t,C=15,F=pt.scrollIdx;pt.canPageDown&&await this.makeScroller(e,!1),pt.canPageUp&&await this.makeScroller(e,!0),A.filter(V=>!V.pack).forEach(V=>{if(V.index>=F&&V.index{const f=e.getFactTotal(h);if(f[2]===0)return[Promise.resolve()];{i+=75;const m=this.threeLine(t,i,s,f),A=this.drawFaction(t,h,i-8,s-39);return[m,A]}}).flat())}async threeLine(t,e,i,s){const h={colour:"#ffd865",fontSize:18,fontName:"serif"},f=30;await Promise.all(s.map((m,A)=>this.drawText(t,m.toString(),e,i+f*A,h)))}async drawDraftMenu(t){const e=new pe,i=new Ce,s=240,h=80,f=45,m=34;let A=50,C=s;await i.headerText(A+28,C,"Opponent",t),C+=f,await e.buttonMaker(t,A,C,"DI","DUMB BOT",27,pt.vsAI,!1),C+=h,await e.buttonMaker(t,A,C,"DV","HUMAN",47,!pt.vsAI,!1),C+=h+16,await i.headerText(A+17,C,"Rarity Filter",t),C+=h-m-6,await this.rarityButton(t,A+20,C,"L",pt.getRarity("L")),await this.rarityButton(t,A+125,C,"H",pt.getRarity("H")),C+=h,await this.rarityButton(t,A+20,C,"R",pt.getRarity("R")),await this.rarityButton(t,A+125,C,"C",pt.getRarity("C")),C=s+f+h*5,await e.buttonMaker(t,A,C,"MM","MAIN MENU",16),A=404,C=s,await i.headerText(A+5,C,"Draft Modes",t),C+=f,await e.buttonMaker(t,A,C,"GP","GOOD PACKS",9,pt.fatPacks),C+=h,await e.buttonMaker(t,A,C,"LD","LEGENDARY",17,pt.legDraft),C+=h,await e.buttonMaker(t,A,C,"OD","OVERDRAFT",17,pt.overdraft),A=757,C=s,await i.headerText(A+76,C,"Sets",t),C+=f,await this.chestButton(t,A+3,C,1,pt.getSet(1)),await this.chestButton(t,A+124,C,2,pt.getSet(2)),C+=88,await this.chestButton(t,A+3,C,3,pt.getSet(3)),await this.chestButton(t,A+124,C,4,pt.getSet(4)),C+=88,await this.chestButton(t,A+3,C,5,pt.getSet(5)),await this.chestButton(t,A+124,C,6,pt.getSet(6)),C=s+f+h*5,await e.buttonMaker(t,A,C,"DN","NEXT",68)}async rarityButton(t,e,i,s,h){const f={key:"MNBT",zone:"N",host:"",param:S.enTil("DR",s)},m=`ui/button/rarity_${s}${h?"y":"n"}.png`;await this.drawSprite(t,m,e,i);const A=new dt(f,e,i,75,65,at.Both);tt.add(A)}async chestButton(t,e,i,s,h){const f={key:"MNBT",zone:"N",host:"",param:S.enTil("DT",s)},m=`icons/sets/Chest_Set${s}${h?"y":"n"}.png`;await this.drawSprite(t,m,e,i);const A=new dt(f,e,i,90,74,at.Both);tt.add(A)}}class We extends Gt{async drawSets(t,e){let i=200;const s=100,h=[],f=new Vt(s,i,400,600);t.filter(m=>m.key==="DSET").forEach(m=>{const A=ye[parseInt(m.param)];h.push(this.drawText(e,A.name,s,i,{colour:"#f5f242"}),this.drawSprite(e,"icons/chest_small.png",s-48,i-5));const C=new dt(m,s,i-2,400,35,at.Both);f.addChild(C),i+=45}),tt.add(f),await Promise.all(h)}async drawList(t,e){let i=170;const s=570,h=[],f=new Vt(s,i,600,600);t.filter(m=>m.key==="DECK").forEach(m=>{const A=S.deTil(m.param),C=Jt.stockDeckByName(A[0],A[1]);h.push(this.drawFaction(e,C.factions[0],s,i),this.drawText(e,C.name,s+65,i+7,{colour:"#f5f242"})),C.factions.length===2&&h.push(this.drawFaction(e,C.factions[1],s+28,i));const F=new dt(m,s,i-2,600,35,at.Both);f.addChild(F),i+=35}),await Promise.all(h),tt.add(f)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,h=Math.floor(t/3);return[22+s*176,200+h*235]}iAmError(t){const e=st.get("game-ui");this.drawText(e,t,295,655,{colour:"#f5142e",fontSize:26})}async drawConstrMenu(t){const e=new pe,i=new Ce,s=240,h=80,f=45;let m=50,A=s;await i.headerText(m+28,A,"Opponent",t),A+=f,await e.buttonMaker(t,m,A,"CI","DUMB BOT",27,Mt.vsAI,!1),A+=h,await e.buttonMaker(t,m,A,"CV","HUMAN",47,!Mt.vsAI,!1),A+=h*4,await e.buttonMaker(t,m,A,"MM","MAIN MENU",16),m=404,A=s,await i.headerText(m+46,A,"Player 1",t);const C=Mt.p1.mode;A+=f,await e.buttonMaker(t,m,A,S.enTil("CP","A"),"PRE-CON",39,C==="CP",!1),A+=h,await e.buttonMaker(t,m,A,S.enTil("CR","A"),"RANDOM",36,C==="CR",!1),A+=h,await e.buttonMaker(t,m,A,S.enTil("CX","A"),"SCRAMBLE",30,C==="CX",!1),A+=h,await e.buttonMaker(t,m,A,S.enTil("LK","A"),"LOAD FILE",32,C==="LK"),C==="LK"&&await this.drawFileDeck(t,m,A,Mt.p1.deck),m=757,A=s,await i.headerText(m+44,A,"Player 2",t);const F=Mt.p2.mode;A+=f,await e.buttonMaker(t,m,A,S.enTil("CP","B"),"PRE-CON",39,F==="CP",!1),A+=h,await e.buttonMaker(t,m,A,S.enTil("CR","B"),"RANDOM",36,F==="CR",!1),A+=h,await e.buttonMaker(t,m,A,S.enTil("CX","B"),"SCRAMBLE",30,F==="CX",!1),A+=h,await e.buttonMaker(t,m,A,S.enTil("LK","B"),"LOAD FILE",32,F==="LK"),F==="LK"&&await this.drawFileDeck(t,m,A,Mt.p2.deck),A+=h*2,await e.buttonMaker(t,m,A,"CN","NEXT",68)}async drawFileDeck(t,e,i,s){const h=i+89;await this.drawText(t,s.name.slice(0,20),e,i+70,{colour:"#f5f242",fontSize:18}),s.factions.length===1?await this.drawFaction(t,s.factions[0],e+96,h):(await this.drawFaction(t,s.factions[0],e+78,h),await this.drawFaction(t,s.factions[1],e+113,h))}}class Ce extends Gt{async drawExtrasMenu(t){const e=new pe,i=240,s=80,h=45,f=34;let m=50,A=i;await this.headerText(m+28,A,"More Info",t),A+=h,await e.buttonMaker(t,m,A,"RU","RULES",66),A+=s,await e.buttonMaker(t,m,A,"FQ","INFO & FAQ",20),A+=s*4,await e.buttonMaker(t,m,A,"MM","MAIN MENU",16),m=404,A=i,await this.headerText(m+37,A,"UI Modes",t),A+=h,await e.buttonMaker(t,m,A,"90","90% SIZE",47,S.options.scale==="90"),A+=s,await e.buttonMaker(t,m,A,"BC","BIG CARDS",29,S.options.bigCards),A+=s+f,await this.headerText(m+12,A,"Game Modes",t),A+=s-f,await e.buttonMaker(t,m,A,"HH","BIG HEALTH",20,S.options.highHealth),A+=s,await e.buttonMaker(t,m,A,"CH","CHEATER",39,S.options.cheater),A+=s,await e.buttonMaker(t,m,A,"BB","BATTLE BARK",13,S.options.bark),m=757,A=i,await this.headerText(m+43,A,"Playmat",t),A+=h;const C=S.options.playmat==="vanilla";await e.buttonMaker(t,m,A,"vanilla","VANILLA",43,C,!C),A+=s;const F=S.options.playmat==="alloyin";await e.buttonMaker(t,m,A,"alloyin","ALLOYIN",43,F,!F),A+=s;const V=S.options.playmat==="nekrium";await e.buttonMaker(t,m,A,"nekrium","NEKRIUM",38,V,!V),A+=s;const Y=S.options.playmat==="tempys";await e.buttonMaker(t,m,A,"tempys","TEMPYS",51,Y,!Y),A+=s;const j=S.options.playmat==="uterra";await e.buttonMaker(t,m,A,"uterra","UTERRA",52,j,!j),await this.drawText(t,"v0.8.0",890,46,{fontSize:16,colour:"#7b68ee"})}async headerText(t,e,i,s){await this.drawText(s,i,t,e,{colour:"#f5f242",fontSize:30})}async drawPickerPlayer(t,e,i){let s;e?s="Player 1":i?s="Dumb Bot":s="Player 2",await this.headerText(54,75,s,t)}}class ia extends Gt{async drawMenu(t){let i=22;await this.drawSprite(t,"ui/button/constructed.png",778,i);const s=new dt(this.makeAction("C"),...this.buttHilightBounds(778,i),at.Both);tt.add(s),i=148,await this.drawSprite(t,"ui/button/draft.png",778,i);const h=new dt(this.makeAction("D"),...this.buttHilightBounds(778,i),at.Both);tt.add(h),i=508,await this.drawSprite(t,"ui/button/deck.png",778,i);const f=new dt(this.makeAction("B"),...this.buttHilightBounds(778,i),at.Both);tt.add(f),i=634,await this.drawSprite(t,"ui/button/info.png",778,i);const m=new dt(this.makeAction("I"),...this.buttHilightBounds(778,i),at.Both);tt.add(m);const A=y.basicAction("DBUG"),C=new dt(A,757,349,74,70,at.Right);tt.add(C),await this.drawSprite(t,"gwg/gwg_red.png",58,0)}buttBounds(t,e){return[t,e,242,113]}buttHilightBounds(t,e){const s=[-3,-3,6,6];return this.buttBounds(t,e).map((h,f)=>h+s[f])}makeAction(t){return{zone:"N",key:"MENU",host:"",param:t}}}class ra{gameWidth;gameHeight;spriteCache;dogAudio;_clickMode;pxRatio=1;options;imgRoot;constructor(){this.spriteCache={},this.imgRoot="./img/",this.gameWidth=1024,this.gameHeight=768,this.dogAudio=document.getElementById("dogbark"),this._clickMode="M",this.options={bark:!0,bigCards:!0,highHealth:!1,cheater:!1,playmat:"uterra",wasDrafting:!1,scale:"100",debug:!1}}randInt(t,e){return Math.floor(Math.random()*(e-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async getSprite(t){return this.spriteCache[t]||(this.spriteCache[t]=this.imageLoader(t)),this.spriteCache[t]}async bulkLoadSprite(t){await Promise.all(t.map(e=>this.getSprite(`${this.imgRoot}${e}`)))}dogBark(){this.dogAudio.volume=.2,this.dogAudio.play()}toggleDebug(){const t=!this.options.debug;this.options.debug=t,new We().iAmError("Debug mode "+(t?"ON":"OFF"))}enTil(...t){return t.join("~")}deTil(t){return t.split("~")}imageLoader(t){return new Promise(e=>{const i=new Image;i.onload=()=>{e(i)},i.src=t})}writeStorage(t,e){localStorage.setItem(t,e)}readStorage(t){return localStorage.getItem(t)}readStringStorage(t,e){const i=this.readStorage(t);return i===null?e:i}readBoolStorage(t,e){const i=this.readStorage(t);return i===null?e:i==="Y"}writeBoolStorage(t,e){this.writeStorage(t,e?"Y":"N")}restoreOptions(){const t=this.options;t.bark=this.readBoolStorage("bark",!1),t.bigCards=this.readBoolStorage("bigCards",!0),t.cheater=this.readBoolStorage("cheater",!1),t.highHealth=this.readBoolStorage("highHealth",!1),t.playmat=this.readStringStorage("playmat","uterra"),t.scale=this.readStringStorage("scale","100")}toggleOption(t){S.options[t]=!S.options[t],this.writeBoolStorage(t,S.options[t])}setClickMode(t){this._clickMode=t}get clickMode(){return this._clickMode}}const S=new ra;class sa{log=!1;file=!1;makeReport(){if(!this.file&&!this.log)return;const t=[[],[],[]];Et.forEach(s=>{let h=0;s.s>6.5?h=2:s.s>5.5&&(h=1),t[h].push(s.c)}),t[0].push("NDR","RSC","CGF","IZL","IZR","FUN","FWG","FWC","DZA"),t[1].push("CYP","SLG");const e=t.map(s=>s.map(h=>{const f=L.getCard(h+"1");return f.type==="C"?f.name+" "+this.cardGuts(f):""}).filter(Boolean).sort()).flat().join(` -`);if(this.file){var i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),i.setAttribute("download","guts.txt"),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}}cardGuts(t){const e=t.jr3(!0,3);e.sleeping=!1;const i=e.bonusTotal(),s=ht.levelBonusFormula(t,!1,!1)+ht.hintAdjuster(t);let h=lt.creatValueFormula(e),f=lt.threatFormula(e,[]),m=i.pHealth,A=i.bonus+s,C=1+i.count,F=h+i.value,V=f+i.attack,j=lt.ddp9Nugget(C,F,V,m,A).map(mt=>mt.toFixed(1)).join(" ");if(this.log&&(console.group("---- "+t.name+" "+t.level+" ----"),console.log("Attack: "+e.attack+"; Health: "+e.health),console.log("Creat Value Weight: "+h+"; Creat Threat Weight: "+f),console.log("Creat Value Bonus: "+i.value+"; Creat Threat Bonus: "+i.attack),console.log("Level Bonus: "+s+"; Raw Bonus: "+i.bonus),console.log("Player Bonus: "+i.pHealth+"; Count Bonus: "+i.count),console.log("Formula: Total, Count, Value, Threat, Player, Bonus"),console.log(j),console.groupEnd()),t.level{await document.fonts.ready;let n=[];document.fonts.forEach(z=>{z.load(),n.push(z.loaded)}),await Promise.all(n),["game-ui","field","player","hand","effects","decklist","card"].forEach(z=>{st.register(z)});const e=st.get("effects");e.context.lineWidth=2,S.pxRatio=window.devicePixelRatio;let i;(z=>{z.Neutral="N",z.Cancel="C",z.Down="D"})(i||(i={}));let s=!0,h=800,f="N",m;try{document.createEvent("TouchEvent"),S.setClickMode("T"),s=!1}catch{}const A=()=>{m&&(clearTimeout(m),m=void 0)},C=(z,rt,et)=>{const vt=tt.hitTest(z,rt,et);vt&&T.handleAction(vt)},F=z=>{C(z.pageX,z.pageY,z.button)},V=z=>{z.touches.length>1?(f="C",A()):f==="N"&&(f="D",m=setTimeout(()=>{f="C";const rt=z.touches[0];C(rt.pageX,rt.pageY,at.ForceRight),m=void 0},h))},Y=z=>{if(f==="D"){if(A(),f="N",z.changedTouches.length>0){const rt=z.changedTouches[0];C(rt.pageX,rt.pageY,at.Left)}}else z.touches.length===0&&(f="N")},j=document.getElementById("solforge");s?(j.addEventListener("click",F),j.addEventListener("contextmenu",z=>(z.preventDefault(),F(z),!1))):(j.addEventListener("touchstart",V),j.addEventListener("touchend",Y)),window.sfapi={details:z=>{jt.init(z)},setLog:z=>{ht.setLog(z)},peekAll:()=>{ht.peekAllCards()},peekDeck:()=>{ht.peekDecks()},peekField:()=>{console.log(g.field)},dumb:()=>{console.log("Am I dumb? "+ht.dumb)},debug:()=>{S.toggleDebug()}},S.restoreOptions(),S.options.scale!=="100"&&yt.changeScale(S.options.scale),yt.drawAll(),new sa().makeReport()}})(); +(function(){"use strict";const xe=["A","N","T","U"];const de=["C","R","H","L"];const Et=[{c:"AAK",f:"T",r:"L",s:1,t:"C",ds:["AH"]},{c:"ABB",f:"N",r:"R",s:4,t:"C",dp:["SL"],ds:["RG","ZB"]},{c:"ABM",f:"N",r:"C",s:5,t:"C",dp:["AB"]},{c:"AGC",f:"A",r:"C",s:1,t:"C",ds:["AR"]},{c:"AGK",f:"A",r:"L",s:2.1,t:"C",dp:["AR"]},{c:"AGP",f:"A",r:"C",s:1.1,t:"S",ds:["AR"]},{c:"AGW",f:"A",r:"R",s:4,t:"S",dp:["AH"],ds:["AR","MV"]},{c:"ASG",f:"T",r:"R",s:1,t:"S",ds:["MV","SP","LV"]},{c:"AMS",f:"A",r:"H",s:5,t:"C",dp:["MM"],ds:["MV"]},{c:"AFO",f:"A",r:"C",s:2.1,t:"C",dp:["LV"],ds:["SP"]},{c:"ATG",f:"A",r:"C",s:2,t:"C",dp:["SP"],ds:["AR","RB"]},{c:"ATP",f:"U",r:"H",s:3,t:"C",dn:["SP","CD"]},{c:"ART",f:"U",r:"H",s:2.1,t:"C",dp:["MU","SP","PL"]},{c:"ATS",f:"T",r:"C",s:6,t:"C",ds:["SP","MV"]},{c:"AGM",f:"T",r:"L",s:2.2,t:"C",dp:["XA"],ds:["RG","AR","MV"]},{c:"ALG",f:"A",r:"R",s:1,t:"C",ds:["AH"]},{c:"AHL",f:"A",r:"H",s:1,t:"C",dp:["HL"],ds:["RB"]},{c:"ALS",f:"A",r:"H",s:2,t:"C",ds:["AH","MV"]},{c:"ASB",f:"A",r:"L",s:6,t:"C",dp:["MS","SB"]},{c:"AAA",f:"A",r:"L",s:5.1,t:"C",dp:["HL"],dn:["FC","AG","BN"]},{c:"ABE",f:"A",r:"H",s:5.1,t:"S",ds:["HL","TD"],dn:["GW"]},{c:"ATZ",f:"A",r:"C",s:4,t:"S",ds:["FR","AL","SP"]},{c:"AEC",f:"U",r:"L",s:5,t:"S",ds:["GW"]},{c:"ARB",f:"A",r:"H",s:4,t:"C",ds:["AR","RB"],dn:["TK","LZ"]},{c:"AEN",f:"A",r:"C",s:2,t:"C",dp:[],ds:["RB","AR"],dn:[]},{c:"APM",f:"A",r:"H",s:2,t:"C",dp:["MA","LV"],ds:["SP"]},{c:"AQE",f:"T",r:"C",s:1,t:"S",ds:["HR"]},{c:"AGD",f:"U",r:"L",s:1,t:"C",dp:["LG"],ds:["DR"]},{c:"AFS",f:"A",r:"L",s:1,t:"C",dp:["RB"],ds:["FR","VT"]},{c:"AWU",f:"T",r:"R",s:6,t:"C",dp:["MV"],ds:["BN"]},{c:"ASQ",f:"N",r:"L",s:6,t:"C",ds:["RV"]},{c:"AMD",f:"T",r:"H",s:5,t:"C",dp:["FC"],ds:["AG"]},{c:"ABR",f:"T",r:"C",s:2,t:"C",dp:["FC"]},{c:"AFR",f:"T",r:"H",s:3.1,t:"C",dp:["MT","SP"],ds:["CS"]},{c:"AMY",f:"T",r:"C",s:1,t:"C",dp:["FC"]},{c:"ABL",f:"T",r:"R",s:1,t:"S",ds:["FC"]},{c:"ATT",f:"T",r:"L",s:4.1,t:"C",ds:["FC","AG","AS"]},{c:"AGU",f:"T",r:"R",s:2.1,t:"C",ds:["WL","MV"]},{c:"AIV",f:"T",r:"H",s:1,t:"C",dp:["MT"],ds:["RK"]},{c:"BRS",f:"A",r:"C",s:5,t:"C",dn:["FC","AG","BN"]},{c:"BTB",f:"A",r:"R",s:5,t:"C",dp:["AR"],ds:["RB","DI"]},{c:"BTH",f:"U",r:"R",s:3,t:"C",ds:["DI","CS"]},{c:"BTI",f:"A",r:"C",s:4,t:"C",ds:["MM","AL"]},{c:"BTN",f:"A",r:"H",s:1,t:"C",ds:["NX","AH"]},{c:"BBB",f:"U",r:"H",s:4,t:"C",ds:["CS","UD"]},{c:"BLH",f:"T",r:"L",s:2,t:"C",dp:["SP"],ds:["AG","TK","GW","SF"]},{c:"BFT",f:"N",r:"C",s:5,t:"S",dp:["UD"]},{c:"BSP",f:"N",r:"C",s:2.2,t:"C",ds:["RK"]},{c:"BWK",f:"N",r:"R",s:1,t:"C",ds:["RV","ZB"]},{c:"BLW",f:"N",r:"R",s:3,t:"C",ds:["ZB","CS"]},{c:"BZS",f:"T",r:"C",s:5,t:"C",ds:["MV","FC"]},{c:"BBR",f:"A",r:"C",s:6,t:"S",ds:["AR","SV"]},{c:"BBD",f:"N",r:"C",s:6,t:"S",ds:["SV"]},{c:"BBL",f:"T",r:"C",s:6,t:"S",ds:["SV"]},{c:"BBN",f:"U",r:"C",s:6,t:"S",ds:["SV"]},{c:"BSR",f:"N",r:"R",s:1,t:"C",ds:["AB","RV"]},{c:"BMY",f:"T",r:"H",s:2.1,t:"C",ds:["MV"]},{c:"BSW",f:"T",r:"C",s:3,t:"C",ds:["MS"]},{c:"BWW",f:"T",r:"H",s:4,t:"C",ds:["MV"]},{c:"BTM",f:"U",r:"H",s:1,t:"S",ds:["PL","RV","RP"]},{c:"BAW",f:"U",r:"R",s:2,t:"C",ds:["FC"]},{c:"BWG",f:"U",r:"C",s:1,t:"C",ds:["PL"]},{c:"BTR",f:"U",r:"H",s:3.1,t:"C",dp:["MU"],ds:["CS","FR"]},{c:"BWD",f:"U",r:"C",s:2,t:"C",ds:["PL","GW","SF","TK"]},{c:"BSG",f:"A",r:"L",s:1,t:"C",ds:["RB","MV","AR"]},{c:"BSS",f:"A",r:"L",s:1,t:"C",dp:["RB"],ds:["AR"]},{c:"BTS",f:"U",r:"C",s:1.1,t:"C",ds:["PL","TK","GW"]},{c:"BST",f:"T",r:"L",s:4,t:"C",dp:["RP"],ds:["MS"]},{c:"BWT",f:"U",r:"L",s:4.2,t:"C",dp:["DI"],ds:["RP","HR"]},{c:"BRH",f:"N",r:"R",s:5,t:"C",ds:["AB"]},{c:"BWH",f:"A",r:"R",s:1,t:"S",dp:["AR"]},{c:"BRN",f:"T",r:"R",s:3,t:"S",ds:["BN","TD"]},{c:"BZD",f:"N",r:"R",s:2,t:"C",dp:["QT"],ds:["DR","RG","MV"]},{c:"BFM",f:"N",r:"H",s:2.3,t:"C",dp:["QT"],ds:["MV","AL"]},{c:"BSM",f:"T",r:"H",s:2,t:"C",dp:["QN"],ds:["RV","AG"]},{c:"CKB",f:"N",r:"H",s:5,t:"C",ds:["RV"]},{c:"CDT",f:"U",r:"R",s:1,t:"C",ds:["PL","PS"]},{c:"CMF",f:"N",r:"R",s:4,t:"C",ds:["AS"]},{c:"CTL",f:"T",r:"L",s:1,t:"S",ds:["XA"]},{c:"CCS",f:"N",r:"C",s:3,t:"C",ds:["RG"]},{c:"CHY",f:"U",r:"C",s:1,t:"C",ds:["RG"]},{c:"CSR",f:"U",r:"C",s:5,t:"C",ds:["PS"]},{c:"CSL",f:"N",r:"C",s:6,t:"C",ds:["RG"]},{c:"CHV",f:"N",r:"L",s:2,t:"C",ds:["MV","RV"]},{c:"CRS",f:"A",r:"R",s:3,t:"C",dp:["MM"],ds:["LV"],dn:[]},{c:"COD",f:"T",r:"R",s:4,t:"S",dp:["UD"],dn:["GW"]},{c:"CTI",f:"N",r:"C",s:1.1,t:"C",dp:["AL"],ds:["AB"]},{c:"CHA",f:"U",r:"R",s:2.1,t:"C",dn:["MV"]},{c:"CHH",f:"U",r:"C",s:2,t:"C",dp:["GW"]},{c:"CHR",f:"U",r:"L",s:1,t:"C",ds:["PL","MS","LV","RG"]},{c:"CBB",f:"T",r:"C",s:3,t:"C",dp:["UD"]},{c:"CDC",f:"T",r:"C",s:2,t:"C",ds:["WL"]},{c:"CFB",f:"T",r:"H",s:1,t:"C",ds:["FC"]},{c:"CNM",f:"T",r:"C",s:2,t:"C"},{c:"CSW",f:"T",r:"L",s:2.3,t:"C",ds:["DR","MV"]},{c:"CTG",f:"A",r:"C",s:3,t:"C",ds:["RB","WL"]},{c:"CCT",f:"T",r:"R",s:2,t:"C",ds:["MV","FC"]},{c:"CFG",f:"T",r:"C",s:2,t:"S"},{c:"CGL",f:"N",r:"H",s:3,t:"C",dp:["AB"],ds:["FR"]},{c:"CSU",f:"N",r:"R",s:1,t:"S",ds:["FR"]},{c:"CCR",f:"N",r:"C",s:1,t:"C",dp:["SF"],ds:["AB","LZ"]},{c:"CSB",f:"N",r:"C",s:2,t:"C",ds:["ZB","TK","VG"]},{c:"CNT",f:"A",r:"R",s:5,t:"S",ds:["AL","AH"]},{c:"CWK",f:"T",r:"C",s:3,t:"C",ds:["DI","MV"]},{c:"CRC",f:"A",r:"R",s:2,t:"C",ds:["RB","RK","WL"]},{c:"CYC",f:"N",r:"H",s:2,t:"C",dp:["MN","SP"],ds:["BN","LG"]},{c:"CYS",f:"N",r:"C",s:4,t:"C",ds:["TK","VG"]},{c:"CTW",f:"N",r:"C",s:1,t:"S",dp:["AL"],ds:["RV"]},{c:"CTV",f:"U",r:"H",s:1,t:"S",dp:["PL"],ds:["RP"]},{c:"CAG",f:"A",r:"R",s:1,t:"S",ds:["NX","FR","LV"]},{c:"CBS",f:"A",r:"C",s:2.1,t:"S",dp:["MA"],ds:["AH","AR"]},{c:"CIN",f:"A",r:"R",s:1.1,t:"C",dp:["AH"]},{c:"CSH",f:"A",r:"C",s:3,t:"C",ds:["AR"]},{c:"CSG",f:"A",r:"C",s:2,t:"S",ds:["AR"]},{c:"DFR",f:"N",r:"H",s:2,t:"C",dp:["AL"]},{c:"DHC",f:"N",r:"H",s:6,t:"C",ds:["SP","RG"]},{c:"DHW",f:"N",r:"R",s:1,t:"C",dp:["SP"],ds:["RG"]},{c:"DRS",f:"U",r:"C",s:6,t:"C",dp:["DF"],ds:["PL"]},{c:"DSS",f:"N",r:"R",s:1,t:"C",dp:["MN"],ds:["ZB"]},{c:"DSW",f:"N",r:"C",s:6,t:"C",dp:["DF"],ds:["LG","BN"]},{c:"DSE",f:"A",r:"C",s:6,t:"C",dp:["DF"],ds:["RB","AH"]},{c:"DSA",f:"T",r:"C",s:6,t:"C",dp:["DF"]},{c:"DCR",f:"N",r:"R",s:2,t:"S",ds:["RV"]},{c:"DSK",f:"N",r:"C",s:1,t:"C",ds:["TK","SF","VG"]},{c:"DBA",f:"U",r:"H",s:1,t:"C",dp:["GW"]},{c:"DBP",f:"U",r:"C",s:1,t:"C",ds:["UD"]},{c:"DMR",f:"U",r:"C",s:2,t:"C",ds:["DI"]},{c:"DBR",f:"U",r:"C",s:1,t:"C"},{c:"DCS",f:"A",r:"L",s:2,t:"C",ds:["LV"]},{c:"DWW",f:"N",r:"C",s:6,t:"C",dn:["AG"]},{c:"DDF",f:"U",r:"R",s:5,t:"S",ds:["RP","UD","TD"]},{c:"DGZ",f:"A",r:"R",s:2,t:"S",ds:["AL"],dn:["GW"]},{c:"DBN",f:"N",r:"C",s:4,t:"C",ds:["AL"]},{c:"DDS",f:"A",r:"H",s:4.2,t:"S",dp:["QN"],ds:["AL"]},{c:"DIS",f:"T",r:"R",s:1,t:"S",ds:["BN"]},{c:"DSV",f:"U",r:"R",s:2,t:"S",dp:["PS"],ds:["FR"]},{c:"DDD",f:"N",r:"L",s:1,t:"C",ds:["MV","RV","DR"]},{c:"DPB",f:"A",r:"L",s:5.2,t:"C",ds:["RB","RP"]},{c:"DZD",f:"U",r:"L",s:3,t:"C",dp:["MS"],ds:["AG"]},{c:"DRE",f:"T",r:"L",s:5,t:"S",ds:["BN"]},{c:"DGS",f:"U",r:"H",s:6,t:"C",ds:["RV"],dn:["DR"]},{c:"DGW",f:"T",r:"L",s:5.2,t:"S",dp:["DR"],ds:["AG","TK"]},{c:"DBT",f:"N",r:"H",s:1,t:"S",ds:["RV"]},{c:"DTR",f:"U",r:"L",s:6,t:"C",dp:["MS","SQ"],ds:["FR","RG","PL"]},{c:"DFB",f:"N",r:"R",s:1,t:"C",dp:["AB"],ds:["BN","SF","LZ","SV"]},{c:"DMW",f:"A",r:"L",s:1.1,t:"C",dp:["MM","CD"],ds:["AH"]},{c:"DCH",f:"U",r:"C",s:1,t:"S",ds:["LG"]},{c:"DTD",f:"N",r:"L",s:4.2,t:"C",dp:["DR"],ds:["MV"]},{c:"DHM",f:"U",r:"R",s:6,t:"C",dp:["DF"],ds:["SB"]},{c:"DSZ",f:"N",r:"C",s:2,t:"C",ds:["ZB","RG"]},{c:"DYB",f:"U",r:"R",s:2,t:"S",dp:["GW","TK"]},{c:"DBQ",f:"N",r:"H",s:3,t:"C",dp:["QU"],ds:["TK","RV","PS"]},{c:"DYS",f:"N",r:"R",s:3,t:"S",dp:["QU"]},{c:"DYL",f:"U",r:"L",s:3,t:"C",dp:["QN","LG"],ds:["TK"]},{c:"EBW",f:"N",r:"C",s:3,t:"C",dp:["UD"]},{c:"ESK",f:"N",r:"H",s:2,t:"C",dp:["RK"],ds:["UD"]},{c:"EHW",f:"U",r:"L",s:1,t:"C",ds:["GW","TK"]},{c:"ETN",f:"A",r:"C",s:1,t:"S",ds:["AL"]},{c:"EWE",f:"T",r:"H",s:2,t:"C",dp:["MV"]},{c:"EVT",f:"U",r:"L",s:6.1,t:"S",dp:["MU"],ds:["TD"]},{c:"ENP",f:"A",r:"H",s:1,t:"S",ds:["FR","WL"]},{c:"ESU",f:"A",r:"R",s:1,t:"S",ds:["CD","TD","FR"]},{c:"ENR",f:"U",r:"C",s:1,t:"S"},{c:"EPD",f:"N",r:"H",s:1,t:"S",dn:["GW"]},{c:"EPH",f:"A",r:"L",s:4.2,t:"C",dp:["CD"],ds:["TK"]},{c:"ESG",f:"A",r:"H",s:4.1,t:"C",dp:["QU","LV"],ds:["TK","GW"]},{c:"ESC",f:"A",r:"H",s:2,t:"C",dp:["QU"],ds:["RB","TK","GW","AR"]},{c:"ESP",f:"U",r:"H",s:2.3,t:"C",dp:["QA"],ds:["AR","HR"]},{c:"EWT",f:"U",r:"R",s:2,t:"C",dp:["QA"],ds:["AR"]},{c:"EHN",f:"U",r:"C",s:1,t:"C",ds:["TK","GW"]},{c:"EFA",f:"T",r:"R",s:5,t:"S",ds:["MV"]},{c:"EFM",f:"T",r:"L",s:2.1,t:"C",dp:["FC","SP"],ds:["FR"]},{c:"EFP",f:"T",r:"L",s:1,t:"C",dp:["RK"],ds:["MV","TK","VG"]},{c:"EFE",f:"U",r:"L",s:5.2,t:"C",ds:["PL","TK","GW","UD"]},{c:"EXD",f:"N",r:"H",s:1,t:"S",ds:["LG","BN","SF"]},{c:"FWB",f:"U",r:"C",s:2.3,t:"C"},{c:"FWR",f:"U",r:"C",s:1,t:"C"},{c:"FFG",f:"U",r:"C",s:4,t:"C",ds:["DI"]},{c:"FST",f:"N",r:"R",s:4,t:"C",ds:["ZB","TK","VG"]},{c:"FWK",f:"N",r:"C",s:1,t:"C",ds:["ZB","TK","VG"]},{c:"FIN",f:"U",r:"C",s:1,t:"S",ds:["FC"]},{c:"FRR",f:"U",r:"H",s:1,t:"S",dp:["GW"]},{c:"FVA",f:"T",r:"H",s:1,t:"S",ds:["MV"]},{c:"FFU",f:"T",r:"H",s:1,t:"C",ds:["YT"]},{c:"FLH",f:"T",r:"C",s:4,t:"C",ds:["AS"]},{c:"FMS",f:"T",r:"C",s:2,t:"C",ds:["MV"]},{c:"FSM",f:"T",r:"H",s:1,t:"S",ds:["MS"],dn:["GW"]},{c:"FBC",f:"T",r:"L",s:1,t:"C",dp:["FC"],dn:["GW"]},{c:"FBI",f:"T",r:"H",s:2.2,t:"C",dp:["MT","SP"]},{c:"FFS",f:"T",r:"R",s:2,t:"C",ds:["AH"]},{c:"FJT",f:"T",r:"C",s:5,t:"S",dp:["UD"]},{c:"FLN",f:"T",r:"R",s:2,t:"S",ds:["BN"]},{c:"FRI",f:"T",r:"C",s:3,t:"C",dp:["WL"]},{c:"FSS",f:"T",r:"R",s:1,t:"C",dp:["MT"],ds:["BN"]},{c:"FLS",f:"T",r:"C",s:1,t:"C",dp:["SP"],ds:["BN"]},{c:"FSH",f:"T",r:"R",s:1,t:"C",ds:["AG","FC"]},{c:"FFD",f:"N",r:"H",s:1,t:"C",ds:["AB","TK","VG"]},{c:"FRV",f:"N",r:"H",s:3,t:"C",ds:["AB","RV","CS"]},{c:"FSC",f:"A",r:"C",s:6,t:"C",dp:["RB"],ds:["VG","AR"]},{c:"FSP",f:"A",r:"L",s:1,t:"C",ds:["UD"]},{c:"FPR",f:"T",r:"C",s:2.1,t:"C"},{c:"FFL",f:"A",r:"C",s:1,t:"S",ds:["AR"]},{c:"FGA",f:"A",r:"C",s:1,t:"C",ds:["RB","WL","VT"]},{c:"FGB",f:"A",r:"R",s:1,t:"C",ds:["RB","VT"]},{c:"FGD",f:"A",r:"H",s:3,t:"C",dp:["VT"],ds:["RB"]},{c:"FGG",f:"A",r:"H",s:1,t:"C",dp:["VT"],ds:["RB","TK"]},{c:"FOL",f:"A",r:"H",s:3.1,t:"C",dp:["MA"],ds:["CS"]},{c:"FPM",f:"A",r:"R",s:3,t:"C",ds:["RB","AR","CS"]},{c:"FPS",f:"A",r:"C",s:1,t:"C",ds:["RB","AR"]},{c:"FWS",f:"A",r:"H",s:6,t:"C",ds:["RB","AR"]},{c:"FFM",f:"T",r:"H",s:3,t:"C",dp:["MV"]},{c:"FMD",f:"T",r:"L",s:3,t:"C",dp:["RK"],ds:["TK","GW","MV","DR"]},{c:"FSK",f:"T",r:"C",s:2.3,t:"S",ds:["AH"]},{c:"FKS",f:"T",r:"H",s:6,t:"C",dp:["SQ"],ds:["YT","BN"]},{c:"FWT",f:"U",r:"H",s:1,t:"C",ds:["UD","FR","GW"]},{c:"FZS",f:"T",r:"R",s:1,t:"S",ds:["RV"]},{c:"GOS",f:"A",r:"L",s:4,t:"S",dp:["AR"]},{c:"GHS",f:"U",r:"C",s:2.2,t:"C",dp:["GW"],ds:["PL","SQ","LG"]},{c:"GHB",f:"U",r:"R",s:1,t:"C",ds:["DI","RV"]},{c:"GHR",f:"U",r:"H",s:4.2,t:"C",dp:["QT"],ds:["FC","LG","MV","DI"]},{c:"GRN",f:"N",r:"C",s:2,t:"S",ds:["RG"]},{c:"GTH",f:"N",r:"C",s:1,t:"S"},{c:"GSC",f:"U",r:"C",s:1,t:"C",ds:["PS"]},{c:"GMP",f:"A",r:"L",s:1,t:"C",ds:["MM","CD"]},{c:"GTT",f:"T",r:"L",s:2,t:"C",dp:["RK"],ds:["RV"]},{c:"GCL",f:"T",r:"C",s:1,t:"C",ds:["WL"]},{c:"GCR",f:"T",r:"C",s:2,t:"S",ds:["FR","BN"],dn:["WL","SQ"]},{c:"GLF",f:"N",r:"C",s:2,t:"C",ds:["AB"]},{c:"GRW",f:"N",r:"C",s:1,t:"C",dp:["AL"],ds:["RV"]},{c:"GSW",f:"N",r:"C",s:2,t:"C"},{c:"GVS",f:"U",r:"C",s:2,t:"C",ds:["VG","LG"]},{c:"GSS",f:"U",r:"C",s:1,t:"C",ds:["LG"]},{c:"GPV",f:"U",r:"C",s:6,t:"C",ds:["PL"],dn:["MV"]},{c:"GBG",f:"N",r:"C",s:1,t:"C",ds:["AB","VG","BN"]},{c:"GGE",f:"N",r:"C",s:2,t:"C"},{c:"GGH",f:"N",r:"C",s:1,t:"C",ds:["ZB","RG"]},{c:"GRP",f:"N",r:"R",s:1,t:"S",dp:["SF"],ds:["RV","FR"]},{c:"GGB",f:"N",r:"H",s:6,t:"C",dp:["DF"]},{c:"GGD",f:"N",r:"L",s:1,t:"C",dp:["SV","SB"]},{c:"GGR",f:"N",r:"L",s:3,t:"C",ds:["SF","MV","SV"]},{c:"GGP",f:"N",r:"H",s:1,t:"C",dp:["RV"],ds:["MV","SV"]},{c:"GGS",f:"N",r:"C",s:1,t:"C",ds:["MV"]},{c:"GGW",f:"N",r:"H",s:6.1,t:"C",dp:["SV"]},{c:"GRM",f:"N",r:"R",s:2,t:"S",ds:["GW"],dn:["GW"]},{c:"GHT",f:"U",r:"C",s:1,t:"C"},{c:"GMR",f:"U",r:"C",s:1,t:"C",ds:["TK","VG","PL"]},{c:"HMF",f:"T",r:"H",s:3,t:"C",ds:["YT","MV"]},{c:"HTR",f:"U",r:"L",s:1,t:"C",ds:["RG","SQ","PL"]},{c:"HAR",f:"A",r:"C",s:1,t:"C",ds:["AH"]},{c:"HFA",f:"N",r:"H",s:1,t:"C",dp:["MN"],ds:["AB","RG"]},{c:"HOD",f:"T",r:"R",s:3,t:"C",ds:["BN"],dn:["TK","LZ"]},{c:"HRM",f:"A",r:"H",s:6,t:"C",ds:["RB","AR"]},{c:"HWM",f:"A",r:"L",s:1,t:"C",dp:["AH"],ds:["MV","RG","AR"]},{c:"HOX",f:"N",r:"R",s:4,t:"S",dp:["UD"],ds:["BN","LG"]},{c:"HGS",f:"N",r:"R",s:1,t:"S",ds:["AH","AL"]},{c:"HTP",f:"U",r:"C",s:1,t:"C",ds:["TK","GW"]},{c:"IBF",f:"T",r:"R",s:1,t:"S",ds:["HR","GW"]},{c:"IGR",f:"T",r:"L",s:6.1,t:"S",ds:["TD","BN"]},{c:"ITO",f:"T",r:"R",s:2,t:"S",dp:["MT","SP"],ds:["FR","BN"]},{c:"IKA",f:"T",r:"L",s:6,t:"C",dp:["FB"],ds:["BN"]},{c:"IME",f:"N",r:"L",s:5,t:"S",ds:["TK","GW"]},{c:"IRT",f:"N",r:"L",s:6.1,t:"S",dp:["MN"],ds:["TD","RG","SL"]},{c:"IVS",f:"N",r:"C",s:4,t:"S",ds:["RG","SL"]},{c:"ICD",f:"N",r:"L",s:5,t:"C",dp:["RG"],ds:["VG","SV","MV"]},{c:"IWC",f:"A",r:"C",s:1,t:"C",ds:["RB","MV"]},{c:"IHA",f:"A",r:"L",s:2,t:"C",ds:["AR","AL"]},{c:"IBR",f:"A",r:"C",s:3,t:"C",dp:["UD"],ds:["AH"]},{c:"IMD",f:"A",r:"L",s:3,t:"C",ds:["RB","BN","MS"]},{c:"IMA",f:"A",r:"L",s:2.3,t:"C",dp:["CD"],ds:["FR"]},{c:"IZK",f:"T",r:"L",s:3,t:"C",ds:["FC","RP","BN"]},{c:"JPK",f:"A",r:"C",s:1,t:"S",dp:["UD"],ds:["AH","MV","FC"]},{c:"KDC",f:"T",r:"C",s:3,t:"C"},{c:"KSB",f:"T",r:"C",s:6,t:"C",ds:["DI"]},{c:"KAW",f:"T",r:"L",s:1.1,t:"C",dp:["SP"],ds:["XA"]},{c:"KOD",f:"N",r:"L",s:1,t:"C",dp:["LZ"],ds:["ZB"]},{c:"KBE",f:"U",r:"H",s:5,t:"C",ds:["PS","MV"]},{c:"KIW",f:"A",r:"L",s:3,t:"C",dp:["LV"]},{c:"KTS",f:"U",r:"H",s:4,t:"C",dp:["RP"],ds:["TK"]},{c:"KKK",f:"T",r:"L",s:2,t:"C",ds:["AG","FC"]},{c:"LOD",f:"U",r:"L",s:4,t:"S",ds:["PS"]},{c:"LFA",f:"T",r:"H",s:4,t:"C",ds:["FC","AH"]},{c:"LKP",f:"U",r:"L",s:1,t:"C",ds:["PL","TK"]},{c:"LGT",f:"N",r:"R",s:2.3,t:"C",dp:["SL"],ds:["ZB","RG"]},{c:"LLD",f:"N",r:"H",s:5,t:"C",dn:["FR"]},{c:"LLG",f:"U",r:"H",s:5,t:"C",dn:["MV"]},{c:"LLS",f:"A",r:"H",s:5,t:"C",ds:["RB"],dn:["TK","LZ"]},{c:"LLT",f:"T",r:"H",s:5,t:"C",dn:["LG"]},{c:"LBD",f:"U",r:"H",s:1,t:"C",dp:["GW"]},{c:"LSS",f:"U",r:"R",s:1,t:"C",dp:["MU"],ds:["UD"]},{c:"LBL",f:"U",r:"R",s:1,t:"C",ds:["LG"]},{c:"LBR",f:"T",r:"C",s:1,t:"S",dp:["FC"],ds:["AG"]},{c:"LSK",f:"T",r:"C",s:1,t:"S",ds:["BN"]},{c:"LWY",f:"T",r:"C",s:1,t:"C",ds:["AG"]},{c:"LSP",f:"A",r:"C",s:1,t:"C",dp:["AH"],ds:["AR"]},{c:"LCE",f:"A",r:"L",s:5,t:"S",ds:["CD"]},{c:"LUC",f:"T",r:"L",s:4.2,t:"C",dp:["MV"],ds:["XA","YT"]},{c:"LMV",f:"N",r:"L",s:1,t:"C",ds:["TK","LZ","GW"]},{c:"LHY",f:"U",r:"C",s:2,t:"C",ds:["RG"]},{c:"LYR",f:"U",r:"C",s:4,t:"S",ds:["LG","HR"]},{c:"LYS",f:"U",r:"R",s:3,t:"S",ds:["TD"]},{c:"MMH",f:"T",r:"C",s:1,t:"C"},{c:"MHR",f:"U",r:"L",s:5.1,t:"C",dp:["PS"],ds:["YT"]},{c:"MRF",f:"N",r:"C",s:1,t:"C"},{c:"MMG",f:"A",r:"L",s:6,t:"C",dp:["RB"],ds:["TK","AR"]},{c:"MOE",f:"T",r:"H",s:1,t:"C",dp:["SP"],ds:["FR"]},{c:"MXW",f:"A",r:"C",s:1,t:"C",ds:["RB","AH"]},{c:"MSP",f:"U",r:"R",s:2,t:"S",ds:["LG"]},{c:"MMA",f:"A",r:"C",s:1,t:"C",ds:["CD","MM"]},{c:"MMR",f:"A",r:"C",s:5,t:"C",dp:["MM"],ds:["CD"]},{c:"MMX",f:"A",r:"C",s:2,t:"C",ds:["MM","CD","VG"]},{c:"MMI",f:"A",r:"C",s:4,t:"C",ds:["MM"]},{c:"MMO",f:"A",r:"C",s:2,t:"C",ds:["MM"]},{c:"MMV",f:"A",r:"C",s:2.2,t:"C",ds:["MM","CD","RK"]},{c:"MPH",f:"U",r:"H",s:3,t:"S",ds:["RK","DR","RV","RP","TK","MV"]},{c:"MSC",f:"A",r:"H",s:1,t:"S",ds:["NT","FR"]},{c:"MTS",f:"A",r:"C",s:1.1,t:"S",ds:["LV","FR"]},{c:"MTT",f:"A",r:"C",s:2,t:"S",ds:["LV","AL"]},{c:"MML",f:"U",r:"H",s:2,t:"C",ds:["TK","GW","PL"]},{c:"MMW",f:"U",r:"L",s:2.2,t:"C",ds:["TK","GW"]},{c:"MBR",f:"A",r:"R",s:6,t:"C",dp:["MM"],ds:["CD"]},{c:"MDE",f:"N",r:"C",s:4,t:"C",ds:["AS","LG","BN"]},{c:"MBP",f:"U",r:"H",s:1,t:"C",ds:["HR","PL"]},{c:"MTD",f:"U",r:"R",s:6,t:"C",dp:["DI"]},{c:"MND",f:"A",r:"R",s:1,t:"C",ds:["RB","SQ","AH"]},{c:"NNS",f:"A",r:"R",s:3,t:"S",ds:["NT","AL"]},{c:"NGB",f:"T",r:"C",s:1,t:"C",ds:["HR"]},{c:"NGW",f:"T",r:"C",s:4,t:"C"},{c:"NSL",f:"U",r:"R",s:1,t:"S",dp:["GW"],ds:["RV"]},{c:"NCF",f:"N",r:"C",s:4,t:"S",ds:["FR"]},{c:"NCM",f:"N",r:"H",s:5,t:"C",ds:["MS","TK","RG","GW"]},{c:"NCS",f:"N",r:"R",s:1,t:"C"},{c:"NCW",f:"N",r:"C",s:1,t:"C"},{c:"NCV",f:"N",r:"C",s:1,t:"S",ds:["RG"]},{c:"NSW",f:"N",r:"L",s:3,t:"C",dp:["SF"],ds:["SQ","TK","GW"]},{c:"NDY",f:"N",r:"R",s:6,t:"S",dn:["SV"]},{c:"NEM",f:"N",r:"C",s:1,t:"S",ds:["LG","BN"]},{c:"NSH",f:"N",r:"L",s:2.3,t:"S",ds:["DR","RV","MV"],dn:["GW"]},{c:"NXA",f:"A",r:"L",s:3.1,t:"C",ds:["NX","AH","AR","MV"]},{c:"NXB",f:"A",r:"L",s:6.1,t:"S",dp:["MA"],ds:["NX","AR","TD"]},{c:"NXC",f:"A",r:"C",s:1,t:"C",ds:["RB","WL"]},{c:"NXG",f:"A",r:"H",s:3,t:"C",dp:["NX"],ds:["AH"]},{c:"NXO",f:"A",r:"C",s:5,t:"C",dp:["NX"],ds:["LV"]},{c:"NXP",f:"A",r:"C",s:1,t:"C",dp:["NX"]},{c:"NXT",f:"A",r:"H",s:2,t:"C",dp:["NX"],ds:["AR"]},{c:"NGT",f:"N",r:"R",s:2,t:"C",ds:["RG","SV"]},{c:"NGQ",f:"U",r:"L",s:4.1,t:"C",dp:["RP"],ds:["TK","GW","PL"]},{c:"NCL",f:"U",r:"R",s:1.1,t:"S",ds:["PS"],dn:["GW"]},{c:"NFF",f:"U",r:"L",s:2,t:"C",dp:["PL"],ds:["RP","SQ","TK"]},{c:"NAM",f:"N",r:"C",s:3,t:"C"},{c:"NOZ",f:"N",r:"R",s:2,t:"C",ds:["TK","VG"]},{c:"NSY",f:"N",r:"C",s:2.1,t:"C",ds:["RG"]},{c:"ONN",f:"N",r:"H",s:1.1,t:"S",dp:["ZB"]},{c:"OXA",f:"A",r:"H",s:2.3,t:"C",dp:["QN"],ds:["LV","SQ","RG"]},{c:"OXM",f:"A",r:"R",s:2,t:"C",dp:["QN"],ds:["RG","AR"]},{c:"OXP",f:"N",r:"H",s:2,t:"C",dp:["QA"],ds:["RG","AL","SQ"]},{c:"OBB",f:"T",r:"R",s:3,t:"S",dp:["QA"],ds:["LV"]},{c:"OEX",f:"A",r:"H",s:3,t:"S",dp:["QT"],ds:["FC","AH"],dn:["GW"]},{c:"OWH",f:"T",r:"H",s:3,t:"C",dp:["QA"],ds:["FC","MV","LV"]},{c:"OBD",f:"A",r:"H",s:1,t:"C",ds:["AR","RB"]},{c:"OFM",f:"A",r:"R",s:2.1,t:"C",ds:["AH"]},{c:"OJC",f:"A",r:"H",s:1.1,t:"C",ds:["AL"],dn:["TK","LZ"]},{c:"OPK",f:"A",r:"R",s:2,t:"C",ds:["RB","AR"]},{c:"OSV",f:"A",r:"H",s:4,t:"C",dp:["RP"],ds:["AR","RB"]},{c:"OSS",f:"A",r:"C",s:5,t:"S",dp:["UD"],ds:["AR"]},{c:"OWW",f:"A",r:"L",s:1,t:"C",ds:["RB"]},{c:"OHV",f:"N",r:"R",s:2,t:"C",ds:["AB","RV"]},{c:"ODC",f:"U",r:"L",s:2,t:"C",ds:["LG"]},{c:"OSP",f:"N",r:"R",s:2,t:"C",ds:["RG"]},{c:"OAP",f:"U",r:"L",s:6,t:"C",dp:["RK"],ds:["PS"]},{c:"OSL",f:"U",r:"C",s:3,t:"C",ds:["PL"]},{c:"OWF",f:"A",r:"H",s:2,t:"S",ds:["AH","GW"]},{c:"OXS",f:"U",r:"R",s:1,t:"C",ds:["DI"],dn:["AR"]},{c:"PHM",f:"A",r:"R",s:2,t:"C",ds:["AL"],dn:["GW"]},{c:"PPM",f:"A",r:"R",s:1,t:"C",ds:["AL","SQ"]},{c:"PSM",f:"A",r:"L",s:2.2,t:"C",dp:["NX"],ds:["MV","TK"]},{c:"PLW",f:"A",r:"R",s:4,t:"S",dp:["UD"],ds:["AL"],dn:["GW"]},{c:"POA",f:"A",r:"H",s:6.1,t:"C",dp:["MA"],ds:["AH"]},{c:"POD",f:"U",r:"H",s:6.1,t:"C",dp:["MU"],ds:["GW","TK"]},{c:"POK",f:"T",r:"H",s:6.1,t:"C",dp:["MT"],ds:["AH"]},{c:"POT",f:"N",r:"H",s:6.1,t:"C",dp:["MN"],dn:["GW"]},{c:"PRG",f:"N",r:"C",s:4,t:"C"},{c:"PRI",f:"A",r:"R",s:3,t:"S",dp:["LV"],ds:["TD"]},{c:"PHS",f:"A",r:"R",s:2.2,t:"C",dp:["AR"]},{c:"PHC",f:"T",r:"L",s:6.2,t:"S",ds:["MV","TK","BN"]},{c:"PTB",f:"U",r:"H",s:1,t:"S",ds:["PL","TK","GW"]},{c:"PLI",f:"N",r:"R",s:6,t:"C"},{c:"PSC",f:"U",r:"R",s:2,t:"C",ds:["PS","SQ"]},{c:"PSH",f:"N",r:"H",s:4,t:"C",ds:["RK","LZ","TK"]},{c:"PTR",f:"A",r:"R",s:2,t:"S",ds:["AH","FR"]},{c:"PSG",f:"U",r:"R",s:1,t:"S",ds:["FR"]},{c:"PMI",f:"T",r:"H",s:5.1,t:"C",ds:["BN"]},{c:"PMS",f:"T",r:"C",s:1,t:"S",ds:["AH"]},{c:"POX",f:"N",r:"H",s:4.2,t:"C",dp:["UD"],ds:["TK","VG","AB"]},{c:"PMP",f:"A",r:"R",s:6,t:"S",dp:["HL"],ds:["AR","AH"]},{c:"PYG",f:"T",r:"H",s:1,t:"C",dp:["FC"],ds:["AG"]},{c:"PYM",f:"T",r:"R",s:6,t:"C",dn:["LG"],ds:["BN"]},{c:"PYS",f:"T",r:"C",s:1.1,t:"S",dp:["GW"],dn:["GW"]},{c:"RBH",f:"T",r:"L",s:1,t:"C",dp:["FC"]},{c:"ROK",f:"T",r:"L",s:3.1,t:"S",dp:["MT"],ds:["TD"]},{c:"RHY",f:"U",r:"C",s:3,t:"C",ds:["RG"]},{c:"RTS",f:"T",r:"C",s:2.2,t:"C",ds:["MV","FC","DI"]},{c:"RLW",f:"U",r:"H",s:1,t:"C",dp:["WD"]},{c:"RHU",f:"A",r:"L",s:4.1,t:"C",ds:["RP","WL"]},{c:"RMB",f:"N",r:"L",s:6.2,t:"S",dp:["TD"],ds:["TK"]},{c:"RFL",f:"T",r:"R",s:1,t:"C",dp:["FC"]},{c:"RHC",f:"T",r:"C",s:1,t:"C",ds:["MV"]},{c:"ROG",f:"N",r:"H",s:1,t:"S",ds:["SV"]},{c:"RWC",f:"U",r:"C",s:4,t:"C",ds:["DI","TK","GW"]},{c:"RFA",f:"U",r:"H",s:1,t:"C",dp:["MU"]},{c:"RWD",f:"N",r:"C",s:5,t:"C",dp:["AL"],ds:["ZB"]},{c:"RSD",f:"U",r:"L",s:6.2,t:"C",ds:["SQ","GW","LG","DR"]},{c:"RSE",f:"T",r:"H",s:4.1,t:"C",dp:["FC"],ds:["AG"]},{c:"RBG",f:"U",r:"H",s:2,t:"C",dp:["LG"]},{c:"RGG",f:"U",r:"H",s:1,t:"C",dp:["RK"],ds:["PL"]},{c:"RSZ",f:"N",r:"R",s:1.1,t:"C",ds:["ZB","VG","SP"]},{c:"RSP",f:"T",r:"R",s:3,t:"C",ds:["CS","AG"]},{c:"RHW",f:"N",r:"C",s:3,t:"C",dp:["WD"]},{c:"SBF",f:"T",r:"H",s:4,t:"C",ds:["AG","XA"]},{c:"SAP",f:"A",r:"C",s:2,t:"S",ds:["AL"]},{c:"SVO",f:"U",r:"C",s:2.1,t:"S",dp:["MU"]},{c:"SSE",f:"U",r:"L",s:2.1,t:"C",ds:["PL","TK","GW"]},{c:"STS",f:"U",r:"C",s:3,t:"S",ds:["PL","TK","GW"]},{c:"SCS",f:"N",r:"C",s:1,t:"C",ds:["AB","RG"]},{c:"SMD",f:"T",r:"L",s:1,t:"C",ds:["DR","MV"]},{c:"SFS",f:"N",r:"L",s:1,t:"C",ds:["ZB","SF","RV"]},{c:"SHY",f:"N",r:"C",s:5,t:"C",ds:["MS"]},{c:"SCD",f:"A",r:"H",s:1,t:"C",ds:["RB","FR"]},{c:"SFT",f:"A",r:"H",s:1,t:"C",ds:["AR","RB"]},{c:"SOC",f:"N",r:"L",s:4,t:"S",ds:["AL"]},{c:"SOA",f:"A",r:"C",s:3,t:"S",dp:["CS"],ds:["AH"]},{c:"SOD",f:"U",r:"C",s:3,t:"S",dp:["CS"]},{c:"SOK",f:"T",r:"C",s:3,t:"S",dp:["CS"]},{c:"SOT",f:"N",r:"C",s:3,t:"S",dp:["CS"],ds:["BN"]},{c:"SAD",f:"T",r:"H",s:1,t:"C",ds:["FC"]},{c:"SCZ",f:"N",r:"R",s:6,t:"C",dp:["DF"],ds:["RG","ZB"]},{c:"SFE",f:"T",r:"H",s:6,t:"C",dp:["DF"],ds:["AG"]},{c:"SWS",f:"A",r:"H",s:6,t:"C",dp:["DF"],ds:["LV"]},{c:"SHA",f:"A",r:"R",s:6,t:"C",dp:["DF"],ds:["AR"]},{c:"SHG",f:"N",r:"L",s:2,t:"S",dp:["LZ"]},{c:"SBI",f:"U",r:"C",s:3,t:"C",dp:["UD"]},{c:"SCC",f:"U",r:"C",s:4,t:"C",dp:["RP"]},{c:"SPB",f:"U",r:"L",s:5,t:"C",dp:["HR"]},{c:"SPD",f:"U",r:"R",s:1,t:"C",dp:["SB"],ds:["DI"]},{c:"SPG",f:"U",r:"R",s:6.2,t:"S",ds:["SB"]},{c:"SPM",f:"U",r:"L",s:1,t:"C",dp:["UD"]},{c:"STD",f:"A",r:"H",s:2.2,t:"C",ds:["MM"],dn:["RG"]},{c:"STB",f:"T",r:"C",s:5,t:"S",ds:["BN"],dn:["AR"]},{c:"SHS",f:"U",r:"R",s:2.2,t:"C",dp:["AH"],ds:["PS"]},{c:"SSP",f:"U",r:"H",s:6,t:"C",dp:["DF"],ds:["PL","TK","GW"]},{c:"SGF",f:"N",r:"H",s:2.2,t:"C",dp:["SQ","SF"],ds:["AB","LG","BN"]},{c:"SKG",f:"A",r:"C",s:2,t:"C",ds:["NX","MV"]},{c:"SSD",f:"T",r:"L",s:5,t:"C",dp:["SQ"],ds:["DR"],dn:["GW"]},{c:"SDA",f:"U",r:"H",s:5,t:"C",ds:["TK","GW"]},{c:"SSR",f:"U",r:"L",s:2,t:"C",dp:["RK"],ds:["GW","FC"]},{c:"SNB",f:"A",r:"C",s:2.3,t:"S",ds:["AL"]},{c:"SNP",f:"A",r:"H",s:1,t:"S",ds:["AL"],dn:["GW"]},{c:"SRD",f:"U",r:"C",s:1,t:"S",ds:["HR","GW"]},{c:"SSH",f:"U",r:"H",s:4,t:"C"},{c:"SRM",f:"N",r:"H",s:4,t:"C",dp:["AL"],ds:["RV"]},{c:"SRH",f:"N",r:"C",s:2.3,t:"C",dp:["AB"],ds:["CD"]},{c:"SDN",f:"N",r:"L",s:1,t:"C",ds:["AL","MV"]},{c:"SHV",f:"N",r:"H",s:1,t:"S",dp:["SF"],ds:["FR"]},{c:"SRP",f:"N",r:"L",s:4,t:"S",dp:["AL"],ds:["RV","TK"]},{c:"SGG",f:"N",r:"H",s:4,t:"C",dp:["SV"]},{c:"SBA",f:"A",r:"C",s:1,t:"C"},{c:"SKB",f:"A",r:"C",s:1,t:"C",ds:["RB"]},{c:"SBR",f:"T",r:"C",s:2,t:"C",ds:["AG"]},{c:"SKS",f:"T",r:"C",s:4,t:"C",ds:["RP","AG"]},{c:"SEL",f:"T",r:"R",s:5,t:"C",ds:["WL"],dn:["SQ"]},{c:"STM",f:"T",r:"R",s:4,t:"C",ds:["MV","AG"]},{c:"SWA",f:"T",r:"H",s:6,t:"C",dp:["SP","MT"],ds:["MV","AH"]},{c:"SFG",f:"A",r:"L",s:6.2,t:"C",dp:["VT"],ds:["TK","RB"]},{c:"SBD",f:"U",r:"C",s:2.1,t:"C",ds:["LG"]},{c:"SCV",f:"N",r:"R",s:3,t:"S",ds:["RV"]},{c:"SFM",f:"T",r:"H",s:1,t:"C",ds:["VG","MS"]},{c:"SSN",f:"A",r:"C",s:2.2,t:"C",ds:["AR","RB"]},{c:"SSM",f:"T",r:"C",s:2.2,t:"C",ds:["RK","BN"]},{c:"SLH",f:"N",r:"C",s:2,t:"S",dp:["SF"]},{c:"SRV",f:"N",r:"R",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"SSI",f:"A",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SND",f:"U",r:"R",s:4,t:"C",dp:["RP"],ds:["TK","GW"]},{c:"SNT",f:"N",r:"L",s:5.1,t:"C",dp:[],ds:[],dn:[]},{c:"STR",f:"N",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SPH",f:"N",r:"H",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"SSA",f:"N",r:"H",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"STO",f:"U",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SDR",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SOL",f:"U",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SOV",f:"T",r:"L",s:4,t:"S",dp:[],ds:["DR"],dn:[]},{c:"SHK",f:"T",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SWR",f:"A",r:"R",s:1,t:"C",dp:[],ds:["MM"],dn:[]},{c:"SMN",f:"T",r:"C",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SER",f:"A",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"SES",f:"A",r:"L",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"SFA",f:"A",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STG",f:"A",r:"L",s:2,t:"C",dp:[],ds:["DR","RB"],dn:[]},{c:"SSS",f:"A",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SSK",f:"A",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"SWG",f:"A",r:"C",s:4,t:"C",dp:[],ds:["RB"],dn:[]},{c:"SWM",f:"A",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"SIV",f:"U",r:"H",s:5.1,t:"S",dp:[],ds:[],dn:[]},{c:"STN",f:"T",r:"R",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"SGI",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SBG",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SCL",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"SGA",f:"T",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"STP",f:"T",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"SSG",f:"U",r:"C",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SVH",f:"U",r:"C",s:2.3,t:"C",dp:[],ds:[],dn:[]},{c:"SIN",f:"U",r:"C",s:1.1,t:"S",dp:[],ds:[],dn:[]},{c:"SYL",f:"U",r:"H",s:2.2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"SEV",f:"N",r:"L",s:3.1,t:"C",dp:[],ds:[],dn:[]},{c:"SMA",f:"U",r:"C",s:5,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SML",f:"U",r:"C",s:1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"SYO",f:"A",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TST",f:"T",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"TBA",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TGL",f:"U",r:"R",s:3,t:"S",dp:[],ds:[],dn:[]},{c:"TGS",f:"U",r:"C",s:2,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TPT",f:"N",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"TDW",f:"N",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"TNL",f:"N",r:"L",s:4.1,t:"C",dp:[],ds:[],dn:[]},{c:"TEX",f:"A",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TGN",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TSM",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"TUP",f:"A",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TAB",f:"T",r:"C",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TGI",f:"T",r:"R",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TDS",f:"U",r:"L",s:1.1,t:"C",dp:[],ds:["DI"],dn:[]},{c:"TSP",f:"T",r:"H",s:4.2,t:"S",dp:["DI"],ds:[],dn:[]},{c:"TPG",f:"N",r:"H",s:3.1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"TMG",f:"U",r:"R",s:3,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TMM",f:"U",r:"C",s:5,t:"C",dp:[],ds:["PL"],dn:[]},{c:"TRA",f:"A",r:"R",s:5,t:"C",dp:[],ds:["MM"],dn:[]},{c:"TRS",f:"U",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TRV",f:"T",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TRW",f:"N",r:"R",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"TBB",f:"T",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TOB",f:"N",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TWS",f:"A",r:"C",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"TVG",f:"A",r:"R",s:1.1,t:"C",dp:[],ds:["RB"],dn:[]},{c:"TXB",f:"U",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"TXS",f:"U",r:"C",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"TCG",f:"T",r:"C",s:2.1,t:"S",dp:[],ds:[],dn:[]},{c:"TMS",f:"U",r:"H",s:6,t:"C",dp:["SB"],dn:["BN"]},{c:"TBC",f:"T",r:"H",s:6.2,t:"S",ds:["AH","MS"]},{c:"TWT",f:"A",r:"C",s:3,t:"C",dp:[],ds:["RB"],dn:[]},{c:"TRN",f:"T",r:"H",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"TGK",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"TSL",f:"U",r:"H",s:3,t:"C",dp:["PL"],ds:["TK","GW"]},{c:"TWG",f:"U",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"UGM",f:"U",r:"C",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"USY",f:"T",r:"R",s:6,t:"C",dp:["DF"],ds:["YT","MV"]},{c:"UGL",f:"T",r:"R",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UIC",f:"T",r:"H",s:2.3,t:"C",dp:[],ds:["DI"],dn:[]},{c:"ULR",f:"U",r:"H",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"URD",f:"N",r:"H",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"UBL",f:"T",r:"R",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"UCM",f:"T",r:"R",s:1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UEM",f:"T",r:"C",s:4,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UHS",f:"T",r:"H",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UIM",f:"T",r:"C",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"UWL",f:"T",r:"H",s:2,t:"C",dp:["YT"],ds:[],dn:[]},{c:"UWS",f:"T",r:"R",s:2.3,t:"C",dp:["YT"],ds:[],dn:[]},{c:"UIW",f:"A",r:"L",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"URS",f:"U",r:"C",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"UTM",f:"U",r:"C",s:2,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UTR",f:"U",r:"H",s:2,t:"C",dp:["DI"],ds:[],dn:[]},{c:"URB",f:"U",r:"L",s:2.3,t:"C",dp:[],ds:["DI"],dn:[]},{c:"UPM",f:"U",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VIC",f:"T",r:"L",s:6,t:"C",ds:["MV","FR"],dn:["TD"]},{c:"VIK",f:"N",r:"L",s:5.2,t:"C",dp:[],ds:[],dn:[]},{c:"VRP",f:"N",r:"L",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"VBK",f:"A",r:"R",s:2,t:"C",dp:[],ds:["RB"],dn:[]},{c:"VIN",f:"A",r:"C",s:6,t:"C",ds:["RB"]},{c:"VTC",f:"A",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VTW",f:"A",r:"R",s:4,t:"C",dp:[],ds:["RB"],dn:[]},{c:"VGN",f:"N",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VND",f:"U",r:"R",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"VNF",f:"U",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"VNS",f:"U",r:"H",s:2,t:"C",dp:[],ds:[],dn:[]},{c:"VSK",f:"U",r:"C",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"VCH",f:"U",r:"H",s:4.1,t:"S",dp:[],ds:[],dn:[]},{c:"VGR",f:"U",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"VSP",f:"U",r:"C",s:6,t:"S",ds:["LG"]},{c:"VGL",f:"N",r:"R",s:5,t:"S",dp:[],ds:[],dn:[]},{c:"VGW",f:"U",r:"R",s:6,t:"C",dp:["HR"],ds:["GW"]},{c:"VOB",f:"T",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"VCG",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"VES",f:"N",r:"L",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"VYE",f:"N",r:"C",s:2,t:"S",dp:[],ds:[],dn:[]},{c:"WBY",f:"T",r:"R",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"WBU",f:"T",r:"C",s:1.1,t:"C",dp:[],ds:["YT"],dn:[]},{c:"WMC",f:"A",r:"H",s:5,t:"C",dp:[],ds:["RB"],dn:[]},{c:"WMR",f:"A",r:"H",s:2.1,t:"C",dp:[],ds:[],dn:[]},{c:"WTK",f:"A",r:"H",s:4,t:"C",dp:[],ds:[],dn:[]},{c:"WMM",f:"A",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WTW",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WTA",f:"U",r:"L",s:4,t:"C",dp:[],ds:["PL"],dn:[]},{c:"WWP",f:"U",r:"H",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WWR",f:"U",r:"C",s:3,t:"C",dp:[],ds:[],dn:[]},{c:"WOD",f:"U",r:"R",s:4,t:"S",dp:[],ds:[],dn:[]},{c:"WFM",f:"T",r:"H",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WWS",f:"U",r:"R",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WBH",f:"T",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WCS",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WPD",f:"T",r:"C",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WSE",f:"T",r:"L",s:5.1,t:"C",dp:[],ds:[],dn:[]},{c:"WPC",f:"A",r:"H",s:6.2,t:"S",ds:["TD"],dp:["NT"]},{c:"WFB",f:"N",r:"C",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"WFS",f:"N",r:"H",s:1,t:"C",dp:[],ds:[],dn:[]},{c:"WBG",f:"N",r:"L",s:1.1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XTE",f:"N",r:"L",s:6,t:"C",dp:["MN"],ds:["TK","LZ"]},{c:"XCR",f:"N",r:"C",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XDH",f:"N",r:"R",s:3,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XHS",f:"N",r:"C",s:2.2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XHU",f:"N",r:"C",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XRF",f:"N",r:"C",s:2,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XSH",f:"N",r:"L",s:1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XTR",f:"N",r:"H",s:5.1,t:"C",dp:[],ds:["AB"],dn:[]},{c:"XDV",f:"N",r:"H",s:1,t:"C",dp:["ZB"],ds:[],dn:[]},{c:"XRW",f:"N",r:"H",s:2,t:"S",dp:["ZB"],ds:[],dn:[]},{c:"YWC",f:"T",r:"C",s:2,t:"C",dp:[],ds:["YT"],dn:[]},{c:"YNS",f:"N",r:"L",s:2.2,t:"C",dp:[],ds:[],dn:[]},{c:"ZXR",f:"T",r:"H",s:5,t:"C",dp:[],ds:[],dn:[]},{c:"ZPM",f:"T",r:"R",s:1.1,t:"C",dp:[],ds:[],dn:[]},{c:"ZTU",f:"N",r:"L",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZDK",f:"N",r:"H",s:6,t:"C",dp:["RG"],ds:["ZB"]},{c:"ZIN",f:"N",r:"C",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZMT",f:"N",r:"C",s:3,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"ZSH",f:"T",r:"L",s:1,t:"C",dp:[],ds:[],dn:[]}],ti=[["ASQ",["SLG","SLG"]],["CGL",["CGF"]],["DHC",["DYF"]],["DTD",["TOT"]],["FGD",["FGA","FGB","FGG"]],["IBA",["AVB"]],["IZK",["IFL","IFR"]],["RHU",["RSC"]],["SLS",["MMY"]],["TSL",["FUN"]],["WHR",["WHC"]]];class ei{raw={["C"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0},["S"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0}};addStat(t,e){this.raw[t][e]++}g(t,e){return this.raw[t][e]}typeSum(t){return xe.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 o=(n,t)=>({card:n,num:t}),bi={name:"Official 1 - 3",id:"SBE1",decks:[{name:"Alloyin Starter",factions:["A"],cards:[o("SYO",1),o("BSS",1),o("SFT",2),o("SNP",2),o("TSM",2),o("SSS",2),o("ALG",2),o("MXW",3),o("TUP",3),o("FPS",3),o("MND",3),o("IWC",3),o("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[o("SFS",1),o("GGD",1),o("FFD",3),o("EPD",2),o("CCR",2),o("HGS",2),o("DSS",2),o("BWK",2),o("GBG",3),o("DSK",3),o("GRP",3),o("VGN",3),o("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[o("FBC",1),o("RBH",1),o("CFB",3),o("FSM",2),o("FSH",2),o("FSS",2),o("PMS",2),o("RFL",2),o("UBL",3),o("WPD",3),o("SGI",3),o("AMY",3),o("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[o("UPM",1),o("EHW",1),o("FRR",3),o("SPD",2),o("HTP",2),o("LSS",2),o("SDR",2),o("SRD",2),o("FWR",3),o("DBP",3),o("GHT",3),o("GSS",3),o("TXS",3)]},{name:"Cruel Corrosion",factions:["A","N"],cards:[o("IHA",1),o("WBG",1),o("OXP",1),o("DFR",1),o("APM",1),o("SNP",1),o("GRM",2),o("ETN",2),o("DHW",2),o("OXM",2),o("AEN",2),o("ATG",2),o("CTI",2),o("CTW",2),o("FPS",2),o("GRW",2),o("MTT",2),o("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[o("ZTU",1),o("VRP",1),o("GGP",1),o("EPD",1),o("DBT",1),o("BSM",1),o("TDW",2),o("NGT",2),o("UBL",2),o("FWK",2),o("BZD",2),o("CSB",2),o("SLH",2),o("MMH",2),o("LSK",2),o("GBG",2),o("CFG",2),o("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[o("TDS",1),o("SSR",1),o("FRR",1),o("ULR",1),o("UTR",1),o("BTM",1),o("UGL",2),o("EHN",2),o("SPD",2),o("GHB",2),o("FLN",2),o("SML",2),o("RFL",2),o("OXS",2),o("UTM",2),o("TWG",2),o("ENR",2),o("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[o("CSW",1),o("SMD",1),o("FRR",1),o("UIC",1),o("CFB",1),o("UGL",2),o("FSH",2),o("FLN",2),o("WPD",1),o("TWG",2),o("TCG",2),o("TGS",2),o("SML",2),o("SVH",1),o("SCL",2),o("RTS",1),o("FWB",2),o("ENR",2),o("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[o("IMA",1),o("GMP",1),o("OXA",1),o("EPD",1),o("OJC",1),o("ESU",2),o("OXM",2),o("MMA",2),o("SAP",1),o("AFO",2),o("GBG",2),o("CTW",2),o("SRH",1),o("TSM",2),o("SLH",1),o("MTT",1),o("DCR",1),o("DFB",1),o("BSR",1),o("LGT",1),o("XRF",2),o("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[o("SBG",1),o("NSH",1),o("FFU",1),o("EWE",1),o("BFM",1),o("WBH",1),o("UWS",1),o("TGI",2),o("RFL",2),o("GRM",1),o("ASG",1),o("YWC",2),o("XRF",2),o("WPD",2),o("WCS",2),o("WBU",2),o("TCG",1),o("FSK",1),o("SLH",2),o("CFG",1),o("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[o("URB",1),o("AGK",1),o("ESP",1),o("FRR",1),o("NXT",1),o("ALG",1),o("FGB",1),o("PHS",2),o("TUP",1),o("EWT",2),o("PTR",1),o("VBK",1),o("AGC",1),o("AEN",2),o("ETN",1),o("FPS",2),o("MXW",2),o("GHT",1),o("TWG",2),o("SNB",1),o("SML",1),o("JPK",1),o("ENR",1),o("IWC",1)]},{name:"Spare Parts",factions:["N"],cards:[o("SEV",1),o("SHG",1),o("TPG",1),o("CGL",1),o("FRV",1),o("HFA",2),o("XDH",1),o("GRM",1),o("SCV",1),o("DFB",2),o("EBW",2),o("GBG",2),o("GLF",2),o("XHS",2),o("SOT",1),o("XRF",2),o("SCS",1),o("ZMT",1),o("SLH",1),o("VYE",1),o("XCR",2),o("XHU",1)]},{name:"Future Forged",factions:["A"],cards:[o("NXA",1),o("IMD",1),o("FOL",1),o("SFA",2),o("SFT",1),o("SCD",1),o("CAG",1),o("ESU",1),o("NNS",1),o("FPM",1),o("PRI",1),o("SSS",1),o("CTG",1),o("TSM",2),o("IWC",1),o("MMA",2),o("TGN",2),o("MTT",1),o("SKG",1),o("AFO",1),o("MMV",1),o("TWS",1),o("SBA",2),o("SSK",1),o("JPK",1)]},{name:"Burning Rage",factions:["T"],cards:[o("ROK",1),o("KKK",1),o("MOE",1),o("AFR",1),o("FBI",1),o("FSS",2),o("FLN",2),o("CCT",2),o("BRN",2),o("WPD",2),o("SSM",2),o("SOK",1),o("RTS",2),o("FSK",2),o("CWK",2),o("CFG",2),o("BSW",2),o("FMS",2)]},{name:"Awakened Fury",factions:["U"],cards:[o("DZD",1),o("SSE",1),o("BTR",1),o("TSL",1),o("MPH",1),o("CDT",1),o("DYB",1),o("BTH",2),o("TMG",2),o("BWD",2),o("RHY",2),o("SBD",2),o("GMR",2),o("STS",1),o("OSL",2),o("SBI",2),o("LYS",2),o("TGS",2),o("SOD",2)]}]},Ai={name:"Official 4 - 6",id:"SBE2",decks:[{name:"Titan's Assault",factions:["N","T"],cards:[o("ATT",1),o("TNL",1),o("RSE",1),o("SPH",1),o("SCV",2),o("ABB",2),o("TBB",2),o("BRN",2),o("FLN",2),o("CMF",2),o("XDH",2),o("FST",2),o("TAB",2),o("MDE",2),o("FSK",2),o("FLH",2),o("CBB",2)]},{name:"Verdant Fortress",factions:["A","U"],cards:[o("NGQ",1),o("RHU",1),o("VCH",1),o("ESG",1),o("PLW",2),o("NNS",2),o("SND",2),o("WOD",2),o("IBR",2),o("BWD",2),o("SBI",2),o("RWC",2),o("TEX",2),o("SER",2),o("SWG",2),o("SCC",2),o("DYB",2)]},{name:"Umbruk Uprising",factions:["T","U"],cards:[o("LUC",1),o("BWT",1),o("GHR",1),o("TSP",1),o("WBH",1),o("COD",1),o("SDR",1),o("ZPM",1),o("OXS",1),o("WOD",1),o("RWC",2),o("SSG",2),o("VGR",2),o("CFG",2),o("UEM",2),o("FFG",2),o("UGL",2),o("DMR",2),o("RTS",2),o("CWK",2)]},{name:"Onyxium Twilight",factions:["A","N"],cards:[o("EPH",1),o("DTD",1),o("POX",1),o("DDS",1),o("OHV",1),o("PHS",1),o("DFB",1),o("TDW",1),o("CAG",1),o("ALG",1),o("TUP",2),o("CTW",2),o("XCR",2),o("SSK",2),o("SRH",2),o("ATG",2),o("MTT",2),o("SLH",2),o("GLF",2),o("AFO",2)]},{name:"Blistering Chaos",factions:["T","U"],cards:[o("WSE",1),o("MHR",1),o("PMI",1),o("SIV",1),o("BRN",1),o("HOD",1),o("CHA",1),o("LYS",1),o("TRS",2),o("PSC",2),o("FLN",2),o("EFA",2),o("SHS",2),o("TXB",2),o("VNF",2),o("CFG",2),o("FSK",2),o("CBB",2),o("VND",2)]},{name:"Dark Retribution",factions:["A","N"],cards:[o("AAA",1),o("SNT",1),o("ABE",1),o("XTR",1),o("CNT",1),o("HOX",1),o("PLW",1),o("AGW",1),o("OHV",2),o("OXM",2),o("XDH",2),o("VGL",2),o("ETN",2),o("MTT",2),o("VYE",2),o("DSK",2),o("BFT",2),o("ATZ",2),o("IBR",2)]},{name:"Iron Tide",factions:["A","U"],cards:[o("EFE",1),o("DPB",1),o("HWM",1),o("HTR",1),o("OJC",1),o("RBG",1),o("EWT",1),o("CIN",1),o("TGK",2),o("CAG",2),o("TGN",3),o("SCC",3),o("URS",3),o("LSP",3),o("TSM",3),o("TMM",3)]},{name:"Dragon Forge",factions:["N","T"],cards:[o("DGW",1),o("VIK",1),o("DDD",1),o("SMD",1),o("FFM",1),o("SHV",1),o("GRP",1),o("TGI",1),o("SLH",1),o("WBH",2),o("BZD",2),o("EFA",2),o("WFB",3),o("BZS",3),o("CCR",3),o("DSK",3),o("RHC",3)]},{name:"Call of Deepwood",factions:["U"],cards:[o("EVT",1),o("POD",1),o("RFA",1),o("TMS",1),o("LSS",1),o("DYB",1),o("TRS",1),o("VGW",1),o("UTM",2),o("RHY",2),o("SMA",2),o("TMM",2),o("BBN",2),o("GHS",2),o("SBI",2),o("BTS",2),o("STS",2),o("SVO",2),o("GMR",2)]},{name:"Kadras' Fury",factions:["T"],cards:[o("IGR",1),o("POK",1),o("SWA",1),o("SGA",1),o("FLN",1),o("TRV",1),o("FSS",1),o("AWU",1),o("STB",2),o("CFG",2),o("BBL",2),o("KSB",2),o("NGW",2),o("ATS",2),o("ABR",2),o("BSW",2),o("TCG",2),o("CBB",2),o("WPD",2)]},{name:"Tarsus Unleashed",factions:["N"],cards:[o("IRT",1),o("POT",1),o("ZDK",1),o("HFA",1),o("GRM",1),o("DSS",1),o("TRW",1),o("ABB",1),o("XCR",2),o("CSB",2),o("SHY",2),o("BBD",2),o("EBW",2),o("NSY",2),o("TPT",2),o("XRF",2),o("GGS",2),o("ZMT",2),o("IVS",2)]},{name:"Might of Anvillon",factions:["A"],cards:[o("NXB",1),o("FWS",1),o("POA",1),o("SFA",1),o("SSS",1),o("TRA",1),o("BTB",1),o("BWH",1),o("TWT",2),o("TEX",2),o("IBR",2),o("VIN",2),o("BBR",2),o("NXP",2),o("CBS",2),o("FPS",2),o("ATG",2),o("SNB",2),o("SSK",2)]},{name:"Nature's Defenses",factions:["T","U"],cards:[o("RSD",1),o("PHC",1),o("SPG",1),o("TBC",1),o("GHR",1),o("NGB",1),o("DDF",1),o("VGW",3),o("UEM",3),o("FSK",2),o("TMM",2),o("VSP",2),o("BZS",2),o("SPD",3),o("RTS",3),o("TGK",3)]},{name:"Unlikely Alliance",factions:["A","N"],cards:[o("RMB",1),o("SFG",1),o("GGW",1),o("WPC",1),o("SBA",2),o("IBR",1),o("BSR",1),o("MMV",1),o("CRC",1),o("BSP",1),o("NNS",1),o("XDH",2),o("EBW",2),o("SLH",2),o("CTG",3),o("XRF",3),o("OHV",3),o("TSM",3)]}]},ki={name:"Set 1 & 2 Tournies",id:"T1309",decks:[{name:"Axel: Lifegain",factions:["T","U"],cards:[o("AGD",3),o("EHW",3),o("FRR",3),o("FIN",1),o("UPM",1),o("LKP",2),o("BTM",2),o("LBL",3),o("GSS",3),o("RFA",3),o("GHB",3),o("EFP",3)]},{name:"Derk: Metaminds",factions:["A"],cards:[o("OJC",3),o("DMW",3),o("MMV",3),o("JPK",3),o("MMO",3),o("GMP",3),o("ALS",3),o("MMA",3),o("SFA",3),o("BTN",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[o("DBP",3),o("EHW",2),o("FRR",3),o("FWT",3),o("UPM",3),o("LKP",2),o("BTM",3),o("HTR",2),o("LBD",2),o("RFA",3),o("GHB",2),o("SDR",2)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[o("ALS",3),o("TDS",3),o("FRR",3),o("WWP",3),o("SML",2),o("BSG",3),o("JPK",2),o("ODC",3),o("NXT",2),o("WMM",3),o("GHB",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[o("SCS",3),o("ROG",1),o("GGP",1),o("GGD",3),o("WFS",1),o("DSS",3),o("ZTU",1),o("GBG",3),o("HFA",3),o("EXD",1),o("EPD",1),o("BSR",1),o("MRF",2),o("HGS",3),o("GTH",3)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[o("SHK",3),o("MOE",3),o("FRR",3),o("LSK",3),o("FFU",3),o("UBL",3),o("WWS",3),o("FSS",3),o("ENR",3),o("MMH",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[o("DBP",2),o("EHW",2),o("FRR",3),o("HTP",2),o("UPM",3),o("LKP",2),o("GHT",3),o("GGP",2),o("LBD",1),o("EPD",2),o("DBT",2),o("SPD",3),o("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[o("IWC",3),o("FSS",3),o("ETN",1),o("WPD",2),o("FSM",1),o("AHL",1),o("UBL",3),o("SMD",2),o("BTN",3),o("LSK",1),o("MMH",3),o("FFU",1),o("TSM",3),o("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[o("DSS",3),o("FSS",3),o("EPD",2),o("GTH",3),o("FSM",1),o("MOE",1),o("UBL",3),o("GGP",3),o("GBG",1),o("LSK",3),o("HGS",1),o("CTW",1),o("SHK",3),o("GGD",1),o("DBT",1)]}]},vi={name:"The Forge",id:"TG10",decks:[{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[o("BWK",3),o("TDS",2),o("FRR",3),o("WWP",3),o("GGP",3),o("GGD",3),o("DBT",1),o("WFS",3),o("CTW",3),o("EPD",3),o("GHB",3)]},{name:"ErrorAsh: Burn",factions:["N","T"],cards:[o("UBL",2),o("EFM",2),o("FBI",3),o("ESK",3),o("FLN",3),o("EFP",3),o("MOE",3),o("FSS",3),o("SHK",3),o("EPD",3),o("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[o("WWS",3),o("DYB",3),o("FRR",3),o("SYL",3),o("EPD",3),o("SSE",2),o("NSH",2),o("TDW",3),o("NFF",2),o("CHR",2),o("LKP",2),o("EXD",2)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[o("NSH",2),o("SMD",2),o("DDD",3),o("TDW",3),o("VRP",3),o("WCS",3),o("BSM",3),o("SHG",2),o("TGI",2),o("EPD",3),o("FVA",2),o("DBT",1),o("TRN",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[o("UWL",3),o("FFU",3),o("WBY",3),o("UIM",3),o("WBU",3),o("SSR",1),o("TRN",1),o("GTT",1),o("GCR",3),o("FRR",3),o("UBL",3),o("WWP",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[o("DDD",3),o("DBT",3),o("EPD",3),o("EFP",3),o("GGP",3),o("LSK",3),o("SHK",3),o("UBL",3),o("WCS",3),o("ZTU",3)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[o("XSH",3),o("SPM",3),o("FRR",3),o("ODC",3),o("SSE",3),o("ESK",3),o("TGS",3),o("XRF",3),o("VRP",3),o("URB",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[o("RBH",3),o("TDS",3),o("FRR",3),o("WWP",3),o("EFP",3),o("AMY",2),o("FVA",2),o("ENR",3),o("ZSH",3),o("EHW",3),o("GHB",2)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[o("BWK",2),o("KOD",2),o("CYC",3),o("GRM",3),o("VYE",3),o("XRW",3),o("MOE",2),o("ZTU",3),o("BSM",3),o("EPD",3),o("DSS",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[o("AGM",3),o("TDS",2),o("FRR",3),o("WWP",3),o("CSW",3),o("FLN",3),o("EFP",2),o("UWL",3),o("WBY",2),o("WCS",2),o("EHW",2),o("SHS",2)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[o("UHS",2),o("FLN",3),o("STG",3),o("CRC",3),o("SHK",3),o("EFP",2),o("WMR",2),o("WMM",3),o("JPK",3),o("SMD",3),o("FVA",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[o("LSK",2),o("WBG",3),o("EPD",3),o("DDD",3),o("SHK",3),o("EFP",3),o("ZTU",2),o("GGD",2),o("GGP",3),o("CTW",3),o("DBT",3)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[o("DMW",3),o("GMP",3),o("MMA",3),o("MMV",2),o("TDW",3),o("VRP",3),o("EPD",3),o("SHG",2),o("OJC",2),o("ESK",2),o("CHV",2),o("CTW",2)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[o("CTW",1),o("GCR",1),o("CFG",1),o("FZS",1),o("FBI",3),o("MOE",3),o("EFP",3),o("LSK",3),o("FLN",3),o("SHK",3),o("RTS",3),o("GGP",3),o("UBL",2)]}]},Ti={name:"Team A1",id:"A1FU",decks:[{name:"Phytogaunt",factions:["N","U"],cards:[o("DTD",3),o("EPD",2),o("XTE",3),o("GGD",3),o("GGP",3),o("GGR",3),o("ROG",1),o("ESK",3),o("GGW",3),o("POT",3),o("PTB",3)]},{name:"ANfinity",factions:["A","N"],cards:[o("IMA",3),o("AAA",2),o("MMA",3),o("KIW",3),o("ESU",3),o("ABE",3),o("AFO",1),o("XDH",2),o("GBG",1),o("SHV",2),o("SCV",2),o("LCE",2),o("MTS",1),o("PRI",1),o("WPC",1)]},{name:"Icefinity",factions:["A","T"],cards:[o("IMA",3),o("AAA",1),o("MMA",2),o("MOE",3),o("ESU",3),o("ABE",3),o("NNS",1),o("IGR",2),o("SHK",1),o("OBB",2),o("LCE",2),o("ITO",1),o("PRI",3),o("BRN",3)]},{name:"Drain Tank",factions:["A","N"],cards:[o("DTD",3),o("SRP",2),o("LLS",3),o("ESK",3),o("CYC",3),o("BRS",3),o("PLI",1),o("SOC",2),o("EPD",2),o("ABE",2),o("HOX",2),o("DCR",2),o("VYE",2)]},{name:"Big Animals",factions:["N","U"],cards:[o("DTD",3),o("MHR",2),o("DZD",3),o("SPB",3),o("SHY",3),o("URB",3),o("VIK",1),o("ESK",3),o("DYS",3),o("LYS",3),o("IME",3)]},{name:"Explosive Dragon Rage",factions:["A","T"],cards:[o("FMD",3),o("SGA",2),o("AFR",3),o("FBI",3),o("POK",3),o("SHK",3),o("ROK",3),o("IGR",1),o("OEX",3),o("BWW",2),o("STB",2),o("BRN",2)]},{name:"Angry Tree",factions:["N","U"],cards:[o("DTD",3),o("EPD",2),o("CYC",3),o("SPB",3),o("IME",3),o("SOC",3),o("ODC",2),o("ESK",2),o("WTA",3),o("VYE",3),o("HOX",3)]}]},Si={name:"Fandom Wiki",id:"FDWK",decks:[{name:"Castles",factions:["A","U"],cards:[o("TDS",3),o("TMS",3),o("DTR",3),o("HTR",3),o("RSD",3),o("SPB",3),o("MHR",3),o("RHU",3),o("AEC",3),o("FRR",3)]},{name:"Runebark's Revenge",factions:["U"],cards:[o("RBG",3),o("EVT",3),o("EFE",3),o("SBI",3),o("RSD",3),o("SPB",3),o("ODC",3),o("GSS",3),o("BTR",3),o("POD",3)]},{name:"Don't Wake Boris",factions:["T","U"],cards:[o("AGD",3),o("EVT",3),o("EFE",3),o("DGW",3),o("LYS",3),o("SBD",3),o("ODC",3),o("GSS",3),o("BRN",3),o("POD",3)]},{name:"Shrink n Squat",factions:["A","N"],cards:[o("DDS",3),o("ESK",3),o("EPD",3),o("GRW",3),o("GGP",3),o("HRM",3),o("PPM",3),o("SRM",3),o("MMG",3),o("WFS",3)]},{name:"Healthy Mystic",factions:["T","U"],cards:[o("LYR",3),o("PYM",3),o("EFE",3),o("TGS",3),o("LYS",3),o("SBD",3),o("TMG",3),o("TMM",3),o("SSH",3),o("SSE",3)]},{name:"Varna Control",factions:["A","N"],cards:[o("VIK",3),o("KIW",3),o("LCE",3),o("ABE",3),o("ZTU",3),o("SES",3),o("DCR",3),o("SCV",3),o("ESU",3),o("BRS",2),o("HOX",1)]},{name:"Barry's Buddies",factions:["A","T"],cards:[o("AAA",3),o("BRS",3),o("SMD",3),o("GOS",3),o("PMP",3),o("AGW",3),o("NNS",3),o("PLW",3),o("OBB",3),o("ABE",3)]},{name:"Heraldbomb",factions:["T","U"],cards:[o("UWL",3),o("HOD",3),o("PTB",3),o("BTM",3),o("LYS",3),o("DDF",3),o("MHR",3),o("WSE",3),o("SPB",3),o("WWP",3)]},{name:"Heartseeker",factions:["A","T"],cards:[o("UWL",3),o("FFU",3),o("FKS",3),o("OEX",3),o("POK",3),o("ROK",3),o("UHS",3),o("WBU",3),o("UCM",2),o("WSE",2),o("KKK",2)]},{name:"Punchy",factions:["A","U"],cards:[o("ODC",3),o("DBP",3),o("URB",3),o("RHU",3),o("EWT",3),o("GOS",3),o("LYS",3),o("PMP",3),o("WMM",3),o("ABE",3)]},{name:"Sea of Sludge",factions:["N","U"],cards:[o("ODC",3),o("WTA",3),o("GSS",3),o("DYL",3),o("AGD",3),o("GGW",3),o("CYC",3),o("VYE",3),o("DCR",3),o("SCV",3)]},{name:"Poison Control",factions:["A","U"],cards:[o("MHR",3),o("LOD",3),o("VNS",3),o("ESG",3),o("LCE",3),o("ESU",3),o("IMA",3),o("DSV",3),o("GSS",2),o("CSR",1),o("ABE",3)]},{name:"Original Fangsters",factions:["A","N"],cards:[o("VES",3),o("XTE",3),o("GGP",3),o("RHU",3),o("WBG",3),o("ABE",3),o("DDS",3),o("SOC",3),o("JPK",3),o("EPD",3)]},{name:"Hatorade",factions:["A","U"],cards:[o("MHR",3),o("ARB",3),o("DDF",3),o("IHA",3),o("LLG",3),o("NXA",3),o("OJC",3),o("RHU",3),o("SPB",3),o("LYS",3)]},{name:"Wegu Control",factions:["A","U"],cards:[o("MHR",3),o("CHR",3),o("KIW",3),o("ESG",3),o("WTA",3),o("ODC",3),o("GSS",3),o("OAP",2),o("NGQ",1),o("DDF",2),o("WPC",1),o("ABE",3)]}]},Ci={name:"Battlebranded",id:"BTLB",decks:[{name:"Bucket of Spite",factions:["N","T"],cards:[o("SMD",2),o("SPH",3),o("BSM",3),o("EBW",3),o("UWL",3),o("BSW",2),o("BWW",1),o("FMD",3),o("BST",3),o("EPD",3),o("GGD",2),o("HOX",1),o("SOC",1)]},{name:"Overoverloaded",factions:["A","N"],cards:[o("XDH",3),o("RMB",3),o("ABE",3),o("IMA",3),o("EPD",3),o("TPG",3),o("ESU",3),o("KIW",2),o("LCE",2),o("ESK",2),o("STR",1),o("CYC",1),o("PRI",1)]},{name:"Dysian Forest",factions:["N","U"],cards:[o("POX",3),o("DBQ",3),o("TDS",3),o("NGQ",3),o("WWP",3),o("DTD",3),o("LBD",3),o("SSH",2),o("LYS",3),o("DYS",2),o("FRR",1),o("HOX",1)]},{name:"Statis Shenanigans",factions:["A","T"],cards:[o("OBB",3),o("SHK",3),o("ABE",3),o("IMA",3),o("SWR",3),o("GCR",2),o("ESU",3),o("NNS",2),o("LCE",3),o("OJC",2),o("BRS",1),o("VIC",1),o("PRI",1)]},{name:"Masochist Zoo",factions:["N","U"],cards:[o("DZD",3),o("TDW",3),o("LLD",3),o("LLG",3),o("RWC",3),o("BWT",3),o("DYS",2),o("SPB",3),o("SHY",3),o("IME",2),o("TDS",2)]},{name:"Pummelled by Gauntlets",factions:["A","N"],cards:[o("AGK",3),o("FWS",3),o("LLD",3),o("LLS",3),o("NXA",3),o("RHU",3),o("ARB",2),o("GOS",2),o("OJC",2),o("ESK",2),o("PMP",2),o("SOC",2)]},{name:"Nuada's Greenhouse",factions:["T","U"],cards:[o("NFF",3),o("NGQ",3),o("LKP",3),o("SYL",3),o("ATT",3),o("BWW",3),o("GMR",2),o("FRR",2),o("SSH",1),o("URB",2),o("BRN",2),o("SSE",3)]},{name:"Abominable Slaughter",factions:["N","T"],cards:[o("CGL",3),o("XDH",3),o("LLD",3),o("POX",3),o("ABM",3),o("ZXR",3),o("BWW",3),o("FMD",3),o("BST",2),o("ROK",3),o("HOX",1)]},{name:"Outraged Ingir",factions:["A","T"],cards:[o("OBB",3),o("FMD",3),o("IKA",3),o("BST",3),o("NXA",3),o("KKK",2),o("RHU",3),o("ROK",3),o("BWW",3),o("WSE",1),o("OEX",3)]},{name:"Lord of the Necros",factions:["N","T"],cards:[o("TPG",3),o("BSM",3),o("EBW",3),o("FST",3),o("TNL",3),o("BWW",3),o("XRW",3),o("CSB",3),o("GGD",3),o("SOC",3)]},{name:"Thar' Be Omegas",factions:["A","U"],cards:[o("AFS",3),o("BSS",3),o("ARB",3),o("FGA",3),o("FGB",3),o("FGG",3),o("FGD",3),o("TBA",3),o("SSH",3),o("NNS",3)]},{name:"Skillshriek",factions:["N","U"],cards:[o("POX",3),o("SEV",3),o("LLD",3),o("SPB",3),o("NSH",3),o("TDW",3),o("XDH",2),o("SBI",2),o("ATP",2),o("FRR",2),o("AEC",2),o("IME",2)]},{name:"Kitfinity",factions:["A","N"],cards:[o("XDH",3),o("MMX",3),o("GMP",2),o("IMA",3),o("VRP",3),o("SEV",3),o("ESU",3),o("KIW",3),o("SHG",2),o("SHV",2),o("SCV",1),o("CYC",1),o("AFO",1)]},{name:"There Can Be Only One",factions:["A","U"],cards:[o("AHL",3),o("WMM",3),o("ESU",3),o("PRI",3),o("JPK",3),o("MPH",3),o("LYS",3),o("BTM",2),o("FIN",1),o("SOD",3),o("VGR",3)]}]},wi={name:"Fundecks",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[o("DFB",3),o("BSR",3),o("HGS",3),o("HFA",3),o("FFD",3),o("XSH",3),o("XHU",3),o("WBG",3),o("GBG",3),o("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[o("TBA",3),o("SVH",3),o("MBP",2),o("FSH",3),o("RBH",3),o("FBC",3),o("LBR",2),o("CFB",3),o("AAK",3),o("KKK",2),o("FRR",1),o("FIN",1),o("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[o("MMA",3),o("DMW",3),o("GMP",3),o("SYO",3),o("KAW",3),o("SHK",3),o("CTL",2),o("CAG",2),o("MSC",2),o("MTS",2),o("ASG",2),o("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[o("CTV",3),o("TDW",3),o("BTS",3),o("CHR",3),o("GMR",3),o("KOD",2),o("LKP",2),o("SHV",2),o("DBA",2),o("CCR",2),o("PTB",2),o("FIN",1),o("DBT",2)]},{name:"Voltron",factions:["A"],cards:[o("FGA",3),o("FGB",3),o("FGD",3),o("FGG",3),o("AFS",3),o("BSS",3),o("PRI",3),o("TUP",2),o("JPK",2),o("BWH",2),o("SFT",3)]},{name:"Do Fear The Reaper",factions:["A","N"],cards:[o("CTI",3),o("DFR",3),o("GRW",3),o("LGT",3),o("OXM",3),o("OXP",3),o("PHM",3),o("CTW",2),o("NNS",2),o("OXA",2),o("SDN",3)]},{name:"Muadib",factions:["N","U"],cards:[o("DBA",3),o("DYL",3),o("GSW",3),o("LBD",3),o("MMW",3),o("NCW",3),o("SRV",3),o("LBL",2),o("MSP",2),o("VYE",2),o("SBD",3)]},{name:"Triassic Park",factions:["T","U"],cards:[o("URB",3),o("UTR",3),o("UTM",3),o("ULR",3),o("UIC",3),o("UGL",3),o("RTS",3),o("BRN",2),o("LBR",2),o("IBF",2),o("GHB",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[o("DDD",3),o("WBH",3),o("HMF",3),o("WCS",3),o("GGP",3),o("SAD",3),o("SDN",3),o("EWE",3),o("SBG",3),o("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[o("WWP",3),o("EHN",2),o("SDR",2),o("HTR",2),o("MML",2),o("HTP",2),o("SHS",3),o("MND",2),o("NXC",2),o("CDT",2),o("PTB",2),o("SVO",2),o("MPH",2),o("SYO",2)]},{name:"Braaiins",factions:["N"],cards:[o("XDV",3),o("XRW",3),o("ONN",2),o("SLH",2),o("FWK",2),o("BWK",2),o("URD",2),o("TPG",2),o("DSS",2),o("KOD",2),o("ZMT",2),o("RSZ",2),o("BLW",2),o("CSB",2)]},{name:"Wanderin",factions:["N","U"],cards:[o("LYS",3),o("STR",2),o("MBP",2),o("OSL",2),o("RLW",3),o("SSR",1),o("SVO",2),o("SSE",2),o("RHW",3),o("SYL",2),o("TGS",2),o("TMG",3),o("XDH",3)]},{name:"Walls",factions:["A","T"],cards:[o("CDC",3),o("CTG",3),o("CRC",3),o("DCS",3),o("FRI",3),o("FGA",2),o("OBB",3),o("FVA",2),o("TGN",2),o("OWH",3),o("STN",3)]},{name:"Snakes In A Lane",factions:["A","U"],cards:[o("AFO",3),o("DSV",3),o("PSC",3),o("SHS",3),o("STO",3),o("NCL",2),o("VNF",3),o("LYS",2),o("SVO",1),o("VNS",3),o("TXS",2),o("ART",2)]},{name:"Benny & Izzy",factions:["A","T"],cards:[o("BRN",3),o("EFM",2),o("IZK",3),o("JPK",1),o("MTT",1),o("NNS",1),o("OBB",2),o("OWF",2),o("OEX",3),o("PRI",2),o("PTR",1),o("TST",1),o("FLS",2),o("BLH",3),o("SHK",3)]}]},ue=[bi,Ai,ki,vi,Ti,Ci,Si,wi];ue.forEach(n=>{n.decks.forEach(t=>{t.cards.map(e=>e.num).reduce((e,r)=>e+r,0)!==30&&console.warn("Pre-con deck with not 30 cards: "+n.name+" -- "+t.name)})});class Be{state;constructor(t){this.state=t}getState(){return this.state}get adjacent(){return g.adjacentPositions(this.lane)}get attack(){return this.state.attack+this.modSum("AT")}get activationAvailable(){return this.state.negateActivate?!1:this.state.activationAvailable}set activationAvailable(t){this.state.activationAvailable=t}get aggressive(){return this.state.aggressive||this.modBool("AG")}set aggressive(t){this.state.aggressive=t}get armor(){return this.negateArmor?0:this.state.armor+this.modSum("AR")}get armorDmg(){return this.state.armorDmg}set armorDmg(t){this.state.armorDmg=t}get breakthrough(){return this.state.breakthrough||this.modBool("BT")}set breakthrough(t){this.state.breakthrough=t}get changed(){return this.state.changed||this.negateDefender||this.negateArmor||this.negateActivate||this.negateMobility||this.negateRegen||this.state.triggers.some(t=>t.changes)}set changed(t){this.state.changed=t}get code(){return this.state.code}get defender(){return this.negateDefender?!1:this.state.defender||this.modBool("DF")}set defender(t){this.negateDefender||(this.state.defender=t,this.enforceEffects("DF"))}get effects(){return this.state.effects}get extraBattles(){return this.state.extraBattles}set extraBattles(t){this.state.extraBattles=t}get faction(){return G.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 G.getCard(this.code).isTribe(t)}get lane(){return this.state.lane}get level(){return G.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}set negateRegen(t){this.state.negateRegen=t}get opposed(){const t=y.crTarg();return t.player=k.toTarget(!this.owner),t.lanes=g.oppositeLane(this.lane),g.creatByTarget(t)[0]}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get rank(){return 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"),V.deathProdder(this,r),e>0&&x.addEvents($.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($.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,l=this.health-s;this.state.armorDmg+=r;let f=0;return e&&l<0&&(f=s-this.health,s=this.health),s>0&&(this.state.health-=s,this.enforceEffects("CH")),[s,f]}hurtBattle(t,e,r=!1){const s=this.hurt(t,r);return s[0]>0&&x.addEvents($.damage(!0,s[0],this.health,!0,!0,this,e)),s[1]}hurtDirect(t,e,r=void 0){const s=this.hurt(t,!1);return s[0]>0&&(p.new().crd(e).txt(` dealt ${t} dmg to `).crd(this.code).txt(".").go(),x.addEvents($.damage(!1,s[0],this.health,!1,!0,this,void 0)),V.deathProdder(this,r)),s[0]}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),V.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF")}modSum(t){return y.modSum(this.mods,t)}modBool(t){return y.modBool(this.mods,t)}hasMod(t){return y.hasModG(this.mods,t)}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){y.hasMod(this.mods,t)||this.addMod(t)}removeMod(t){const e=this.state.mods.filter(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(y.modIdx(this.state.mods,t),1)}bonusTotal(){let t=lt.sumNuggets(this.triggers);return this.state.actvBonus&&(t=lt.addNuggets(t,this.state.actvBonus)),t}endActivation(){this.modBool("EA")?this.removeMod(this.id):this.state.activationAvailable=!1,V.deathCheck(),T.actionDone()}move(t){this.state.lane=t,ae.positionChange(this.owner),x.addEvents($.creature("MOV",this))}addEffect(t,e){const r=y.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=>G.getCard(r.logicCode).enforceEffect(r,this))}jr4(t,e=""){e===""&&(e=this.code);const r=y.trigger(t,e);return r.cardCode=this.code,r.creatId=this.id,this.triggers.push(r),r}removeTrigger(t){const e=y.trigIdx(this.triggers,t);e>-1?this.triggers.splice(e,1):console.error("Wery curious, could not find trigger to remove",t)}wipeAll(){this.preWipe(),this.state.hints=[],this.state.armor=0,this.state.mobility=0,this.state.poison=0,this.state.regen=0,this.state.aggressive=!1,this.state.defender=!1,this.state.breakthrough=!1,this.state.defender=!1,this.state.negateDefender=!1,this.state.negateArmor=!1,this.state.actvBonus=void 0,this.state.changed=!0,this.state.negateActivate=!0,g.creatByTarget(y.crTarg()).forEach(t=>{t.removeMod(this.id),t.enforceEffects("PS",this.owner)}),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),ae.defenderChange(this.owner)}preWipe(){this.state.mods=[],this.state.triggers=[],this.state.effects=[]}get hints(){return this.state.hints}aiHints(){return this.hints}}class y{static creatureState(t,e){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,actvBonus:void 0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:e,maxHealth:0,mobility:0,mobilityAvailable:!0,mods:[],negateActivate:!1,negateArmor:!1,negateDefender:!1,negateMobility:!1,negateRegen:!1,owner:t,poison:0,regen:0,sleeping:!0,status:"A",triggers:[]}}static effect(t,e){return{area:"A",watch:t,logicCode:e}}static freeCard(t){return{id:R.genId(),condition:y.target("TH"),sourceCard:t}}static mod(t,e,r=""){return{type:t,value:typeof e=="boolean"?e?1:0:e,granter:r,expiry:"NN"}}static trigger(t,e){return{id:R.genId(),type:t,logicCode:e,cardCode:"",creatId:"",customCode:"",interactive:!1,changes:!1,bonus:void 0}}static triggerReaction(t,e,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 menuButtonAction(t){return{zone:"N",key:"MNBT",host:"",param:t}}static actionifier(t,e,r,s){const l=t;return l.key=e,l.host=r,l.param=s,l}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 y.actionifier(y.target(t),e,r,s)}static crTarg(){const t=y.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,e,r){return y.actionifier(y.crTarg(),t,e,r)}static crNotMeTarg(t){const e=y.target("TF");return e.field="O",e.creatStatus="V",e.notMe=t,e}static crNotMeActTarg(t,e,r,s){return y.actionifier(y.crNotMeTarg(e),t,r,s)}static crFriendTarg(){const t=y.crTarg();return t.player="F",t}static crFriendActTarg(t,e,r){return y.actionifier(y.crFriendTarg(),t,e,r)}static crFriendNotMeTarg(t){const e=y.crNotMeTarg(t);return e.player="F",e}static crFriendNotMeActTarg(t,e,r,s){return y.actionifier(y.crFriendNotMeTarg(e),t,r,s)}static crEnemyTarg(){const t=y.crTarg();return t.player="E",t}static crEnemyActTarg(t,e,r){return y.actionifier(y.crEnemyTarg(),t,e,r)}static playerTarg(t){const e=y.target("TP");return e.player=k.toTarget(t),e}static playerActTarg(t,e,r,s){return y.actionifier(y.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=y.target("TF");return t.field="E",t}static emptyActTarg(t,e,r){return y.actionifier(y.emptyTarg(),t,e,r)}static emptyPlayerTarg(t){const e=y.emptyTarg();return e.player=k.toTarget(t),e}static emptyPlayerActTarg(t,e,r,s){return y.actionifier(y.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 y.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 Nt{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return Nt.extractCardCode(this.code)}image(t){return this.type==="S"?this.fixedImage(t):this.leveledImage(t)}leveledImage(t){return this.rawImage(this.code,t)}fixedImage(t){return this.rawImage(this.cardCode(),t)}rawImage(t,e){return`card/${e?"b":"s"}/${this.faction}/${t}.jpg`}isFree=!1;level;maxLevel=3;minLevel=1;name="";overload=!1;rarity="T";spice;text="";get type(){return "C"}hints;addSp(t,e){}aiHints(){return this.hints??[]}canLevel(){return this.level{l+=s[m]*r[0][m],f+=s[m]*r[1][m]}),[l,f]}rawNug(t,e,r,s,l=0){return lt.rawNugget(t,e,r,s,l)}buffNug(t,e){return this.rawNug(0,e+t,t,0,0)}playerNug(t){return this.rawNug(0,0,0,t,0)}spawnNug(t){const e=lt.cardCreatValueFormula(t);return this.rawNug(1,e,t.iAttack,0,0)}statSpawnNug(t,e){const r=this.buffNug(t,e);return r.count=1,r}avgSpawnNug(t){const e=this.avgCreatureStats(t);return this.statSpawnNug(e[0],e[1])}regnNug(t){return this.rawNug(0,lt.calcCreatValueFormula(0,0,0,0,t,!1,0),0,0,0)}multNug(t,e){return t.attack*=e,t.value*=e,t.count*=e,t.pHealth*=e,t}static extractCardCode(t){return t.substring(0,3)}get boof123n(){return this.level*-1}get boof124(){return this.lValN([1,2,4])}get boof135(){return this.lValN([1,3,5])}get boof137(){return this.lValN([1,3,7])}get boof147(){return this.lValN([1,4,7])}get boof234(){return this.level+1}get boof235(){return this.lValN([2,3,5])}get boof236(){return this.lValN([2,3,6])}get boof246(){return this.level*2}get boof246n(){return this.level*-2}get boof247(){return this.lValN([2,4,7])}get boof247n(){return this.lValN([-2,-4,-7])}get boof248(){return this.lValN([2,4,8])}get boof258(){return this.lValN([2,5,8])}get boof2510(){return this.lValN([2,5,10])}get boof2612(){return this.lValN([2,6,12])}get boof357(){return this.lValN([3,5,7])}get boof358(){return this.lValN([3,5,8])}get boof359(){return this.lValN([3,5,9])}get boof3510(){return this.lValN([3,5,10])}get boof3612(){return this.lValN([3,6,12])}get boof369(){return this.level*3}get boof369n(){return this.level*-3}get boof3610(){return this.lValN([3,6,10])}get boof3711(){return this.lValN([3,7,11])}get boof3712(){return this.lValN([3,7,12])}get boof3713(){return this.lValN([3,7,13])}get boof3714(){return this.lValN([3,7,14])}get boof3814(){return this.lValN([3,8,14])}get boof3915(){return this.lValN([3,9,15])}get boof468(){return this.lValN([4,6,8])}get boof469(){return this.lValN([4,6,9])}get boof4610(){return this.lValN([4,6,10])}get boof4612(){return this.lValN([4,6,12])}get boof4710(){return this.lValN([4,7,10])}get boof4711(){return this.lValN([4,7,11])}get boof4712(){return this.lValN([4,7,12])}get boof4713(){return this.lValN([4,7,13])}get boof4714(){return this.lValN([4,7,14])}get boof4812(){return this.level*4}get boof4812n(){return this.level*-4}get boof4813(){return this.lValN([4,8,13])}get boof4814(){return this.lValN([4,8,14])}get boof4815(){return this.lValN([4,8,15])}get boof4816(){return this.lValN([4,8,16])}get boof4914(){return this.lValN([4,9,14])}get boof4915(){return this.lValN([4,9,15])}get boof579(){return this.lValN([5,7,9])}get boof5711(){return this.lValN([5,7,11])}get boof5714(){return this.lValN([5,7,14])}get boof5812(){return this.lValN([5,8,12])}get boof5813(){return this.lValN([5,8,13])}get boof5814(){return this.lValN([5,8,14])}get boof5815(){return this.lValN([5,8,15])}get boof5914(){return this.lValN([5,9,14])}get boof5915(){return this.lValN([5,9,15])}get boof5916(){return this.lValN([5,9,16])}get boof5917(){return this.lValN([5,9,17])}get boof51014(){return this.lValN([5,10,14])}get boof51015(){return this.level*5}get boof51020(){return this.lValN([5,10,20])}get boof6812(){return this.lValN([6,8,12])}get boof6814(){return this.lValN([6,8,14])}get boof6912(){return this.lValN([6,9,12])}get boof6914(){return this.lValN([6,9,14])}get boof6915(){return this.lValN([6,9,15])}get boof6916(){return this.lValN([6,9,16])}get boof61014(){return this.lValN([6,10,14])}get boof61015(){return this.lValN([6,10,15])}get boof61016(){return this.lValN([6,10,16])}get boof61017(){return this.lValN([6,10,17])}get boof61018(){return this.lValN([6,10,18])}get boof61117(){return this.lValN([6,11,17])}get boof61218(){return this.lValN([6,12,18])}get boof61224(){return this.lValN([6,12,24])}get boof7911(){return this.lValN([7,9,11])}get boof7914(){return this.lValN([7,9,14])}get boof71013(){return this.lValN([7,10,13])}get boof71014(){return this.lValN([7,10,14])}get boof71015(){return this.lValN([7,10,15])}get boof71116(){return this.lValN([7,11,16])}get boof71117(){return this.lValN([7,11,17])}get boof71118(){return this.lValN([7,11,18])}get boof81116(){return this.lValN([8,11,16])}get boof81117(){return this.lValN([8,11,17])}get boof81217(){return this.lValN([8,12,17])}get boof81220(){return this.lValN([8,12,20])}get boof81318(){return this.lValN([8,13,18])}get boof91420(){return this.lValN([9,14,20])}get boof91421(){return this.lValN([9,14,21])}get boof101520(){return this.lValN([10,15,20])}get boof255080(){return this.lValN([25,50,80])}}class P extends Nt{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=y.creatureState(t,e);return r.id=R.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.actvBonus=this.bonus?.activ8,new Be(r)}playTargets(){const t=super.playTargets(),e=y.actionTarget("TF","FORG",this.code,"");return e.player="F",t.push(e),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}addExtraActivate(t){const e=y.mod("EA",!0,t.id);e.expiry="ET",t.addMod(e)}}class kt extends Nt{constructor(t){super(t)}get type(){return "S"}logSpell(t=void 0,e=void 0){let r=p.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 te{paStats;pbStats;constructor(t,e){this.paStats=t,this.pbStats=e}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const e=this.playerStats(t),r=this.playerStats(!t);return te.deltafier(e,r)}static deltafier(t,e){const r=te.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.bonus=t.bonus-e.bonus,r}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0,bonus:0}}}class lt{static dcWeight=.4;fromState(){const t=g.qActiveCreats(),r=[!0,!1].map(s=>{const l=te.blankStats(s),f=k.toPlayer(s);l.playerHealth=lt.playerFormula(f.health,k.totalArmor(f),k.totalPoison(f),f.effects.length);const m=lt.sumNuggets(f.triggers);return l.playerHealth+=m.pHealth,l.creatCount=m.count,l.creatValue=m.value,l.threatValue=m.attack,l.bonus=m.bonus,t.filter(A=>A.owner===s).forEach(A=>{const C=A.bonusTotal();l.playerHealth+=C.pHealth,l.bonus+=C.bonus,l.creatCount+=1+C.count,l.creatValue+=lt.creatValueFormula(A)+C.value,l.threatValue+=lt.threatFormula(A,t)+C.attack}),l});return new te(r[0],r[1])}static ddp9(t,e,r,s,l=0){return lt.ddp9Nugget(t,e,r,s,l)[0]}static ddp9Nugget(t,e,r,s,l=0){const f=t/4,m=e/10,A=r/12,C=s/8;return[f+m+A+C+l,f,m,A,C,l]}static creatValueFormula(t){return lt.calcCreatValueFormula(t.attack,t.health,t.armor,t.mobility,t.regen,t.breakthrough,t.poison)}static cardCreatValueFormula(t){return lt.calcCreatValueFormula(t.iAttack,t.iHealth,t.iArmor,t.iMobile,t.iRegen,t.iBT,0)}static calcCreatValueFormula(t,e,r,s,l,f,m){const A=f?1:0;return e+Math.max(0,t)+(r+Math.min(s,3)+A+l-m)*1.5}static playerFormula(t,e,r,s){return t+(e-r)*2+s*4}static threatFormula(t,e){let r=0,s=0;if(t.defender)r=t.attack;else{const l=e.find(f=>f.owner!==t.owner&&f.lane===6-t.lane);l?(t.breakthrough&&(s=Math.max(t.attack-l.health,0)),r=t.attack-s):s=t.attack,s>0&&(s+=lt.scalingBonus(s))}return Math.max(r,0)+Math.max(s,0)}static rawNugget(t,e,r,s,l=0){return{count:t,value:e,attack:r,pHealth:s,bonus:l}}static addNuggets(t,e){return lt.rawNugget(t.count+e.count,t.value+e.value,t.attack+e.attack,t.pHealth+e.pHealth,t.bonus+e.bonus)}static sumNuggets(t){let e=lt.rawNugget(0,0,0,0,0);return t.forEach(r=>{r.bonus&&(e=lt.addNuggets(e,r.bonus))}),e}static scalingBonus(t){let e=7;if(t<=e)return 0;let r=!0,s=0,l=1;const f=7;for(;r;)t>e+f?(s+=l*f,e+=f,l++):(s+=l*(t-e),r=!1);return s}weighState(t,e,r){const s=t.deltaStats(r),l=e.deltaStats(r),f=te.deltafier(l,s),m=f.playerHealth<0?-1:1,A=lt.scalingBonus(f.playerHealth*m)*m+f.playerHealth;return lt.ddp9Nugget(f.creatCount,f.creatValue,f.threatValue,A,f.bonus)[0]}}class Di{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),g.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 l=g.emptyLanes(this.aiPlayer);if(s===0||l.length===0)return!1;p.new().plr(this.aiPlayer).txt(" is a cheaty cheaterton.").go();let f=0;if(s===1){if(E.regularPlays-=1,f=S.randInt(0,13),f===0)this.jr6(this.jr7("HTR"),l);else if(f===1)this.jr6(this.jr7("AGM"),l).addRegen(8);else if(f===2){const m=this.jr6(this.jr7("YNS"),l);m.buff(0,15),m.addRegen(4)}else if(f===3)this.jr6(this.jr7("TBA"),l);else if(f===4)this.jr6(this.jr7("DCS"),l);else if(f===5)this.jr6(this.jr7("GGP"),l).addRegen(8);else if(f===6){const m=this.jr6(this.jr7("WFM"),l);m.aggressive=!0}else if(f===7){const m=this.jr6(this.jr7("FFU"),l);m.aggressive=!0}else if(f===8){const m=this.jr6(this.jr7("URB"),l);m.aggressive=!0}else if(f===9){const m=this.jr6(this.jr7("KOD"),l);m.aggressive=!0,m.addRegen(6)}else if(f===10)this.jr6(this.jr7("AGK"),l).addArmor(3);else if(f===11){const m=this.jr6(this.jr7("PSC"),l);m.aggressive=!0}else if(f===12){const m=this.jr6(this.jr7("SAD"),l);m.aggressive=!0}}else if(s===2)if(E.regularPlays-=1,f=S.randInt(0,17),f===0){const m=this.jr6(this.jr7("NDR"),l);m.aggressive=!0}else if(f===1){const m=this.jr6(this.jr7("CSW"),l);m.aggressive=!0}else if(f===2)this.jr6(this.jr7("GGD"),l).addRegen(6);else if(f===3)this.jr6(this.jr7("EFP"),l);else if(f===4)this.jr6(this.jr7("ZTU"),l);else if(f===5){const m=this.jr6(this.jr7("DDD"),l);m.aggressive=!0}else if(f===6)this.jr6(this.jr7("RBH"),l).addRegen(8);else if(f===7)this.jr6(this.jr7("SFT"),l);else if(f===8)this.jr6(this.jr7("GTT"),l);else if(f===9)this.jr6(this.jr7("SMD"),l);else if(l.length===5)this.jr6(this.jr7("DFB"),l),[1,2,3,4].forEach(m=>this.jr6(this.jr7("XHS"),l));else if(l.length===4)this.jr6(this.jr7("LMV"),l);else if(l.length===3)this.jr6(this.jr7("LHY"),l),this.jr6(this.jr7("SVH"),l),this.jr6(this.jr7("DBA"),l);else if(l.length===2)this.jr6(this.jr7("UTR"),l),this.jr6(this.jr7("TDS"),l);else if(t.turn===4)this.jr6(this.jr7("SSR"),l);else if(t.turn===1)this.jr6(this.jr7("ESK"),l);else{const m=this.jr6(this.jr7("XSH"),l);m.aggressive=!0}else if(s===3)if(f=S.randInt(0,20),f===0){const m=this.jr6(this.jr7("IHA",4),l);m.aggressive=!0}else if(f===1)this.jr6(this.jr7("CHR"),l);else if(f===2)this.jr6(this.jr7("FGO",1),l);else if(f===3)this.jr6(this.jr7("CHV",4),l);else if(f===4)this.jr6(this.jr7("KKK",4),l);else if(t.health<20){const m=this.jr6(this.jr7("ODC",4),l);m.aggressive=!0}else if(l.length===5){const m=S.randInt(0,4);if(m===0)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("UWL",2),l));else if(m===1)[1,2].forEach(A=>this.jr6(this.jr7("DFB"),l)),[1,2,3].forEach(A=>this.jr6(this.jr7("FFD"),l));else if(m===2)[1,2,3,4,5].forEach(A=>this.jr6(this.jr7("BWK"),l));else if(m===3){this.jr6(this.jr7("SBG"),l),this.jr6(this.jr7("EWE"),l);const A=this.jr6(this.jr7("BMY"),l);A.defender=!0,A.aggressive=!0}}else if(e.health>350)t.health<180&&k.heal(t,180-t.health),this.jr6(this.jr7("AGD"),l);else if(e.health>250)this.jr6(this.jr7("FGO"),l);else if(l.length===4){const m=S.randInt(0,3);m===0?(this.jr6(this.jr7("AGK"),l),[1,2,3].forEach(A=>this.jr6(this.jr7("VBK"),l))):m===1?(this.jr6(this.jr7("TDS"),l),this.jr6(this.jr7("TDS"),l),this.jr6(this.jr7("UTR"),l)):m===2&&[1,2,3,4].forEach(A=>this.jr6(this.jr7("CDC"),l))}else if(l.length===3)if(S.randInt(0,2)){this.jr6(this.jr7("SDR"),l),this.jr6(this.jr7("SDR"),l);const m=this.jr6(this.jr7("UPM"),l);m.aggressive=!0}else{this.jr6(this.jr7("SDL"),l);const m=this.jr6(this.jr7("NFF"),l);m.aggressive=!0}else if(l.length===2)this.jr6(this.jr7("SPM"),l),this.jr6(this.jr7("SPM"),l);else{const m=this.jr6(this.jr7("NXC"),l);m.buff(10,0),m.aggressive=!0,m.addMobility(2),m.addRegen(5)}return t.health<30&&k.heal(t,50-t.health),!0}}var st=(n=>(n[n.Left=0]="Left",n[n.Both=1]="Both",n[n.Right=2]="Right",n[n.ForceRight=3]="ForceRight",n))(st||{});class Ue{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 l,f=0;const m=t.length;for(;l===void 0&&f=t&&this.originY<=e&&this.endY>=e?this.action:void 0}}class Vt extends ct{constructor(t,e,r,s,l=0){super({zone:"N",key:"BNDL",host:"",param:""},t,e,r,s,l)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,e,r){if(super.hitTest(t,e,r))return Ue.arrayHit(this.childs,t,e,r)}}class xi{guts="";txt(t){return ht.simOn||(this.guts+=t),this}plr(t){if(!ht.simOn){const e=k.toBool(t);this.guts+="^p"+(e?"a":"b")}return this}crd(t){return ht.simOn||(this.guts+="^c"+t),this}go(){ht.simOn||p.parse(this)}}class Ne{realPromise;resolveMe(t){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,e)=>{this.resolveMe=t,this.rejectMe=e})}}const Oe=25,ii=9999,Bi=-9999,Hi=-999999,Ni=["CANC","DEET","SCRH"],Fi=["HPLY","ACTV","MOVE"];class Pi{log=!1;simOn=!1;dumb=!1;inPhase=!0;promStack=[];peekStack=[];peeking=!1;slowpoke=0;endCount=0;aiPlayer=!1;brdEval;rootBoardStats;turnSims=0;turnTime=0;kickOut=!1;kickTimer=0;constructor(){this.brdEval=new lt,this.rootBoardStats=new te(te.blankStats(!0),te.blankStats(!1))}setLog(t){this.log=t}lNum(t){return t<-899999?"NUNS":t<-8999?"LOSS":t>8888?"KILL":t.toFixed(1)}popProm(t){this.promStack.pop().resolveMe(t)}popPeeker(t){this.peekStack.pop().resolveMe(t)}hitMainPhase(){this.dumb&&this.simOn&&this.inPhase&&E.mainBattle&&(this.inPhase=!1)}simEndpoint(t){if(this.endCount++,this.promStack.length===0)p.debug("Tried to end a sim, but no promise to unlock."),console.trace();else{let e;if(t==="T"){const r=this.brdEval.fromState();e=this.brdEval.weighState(this.rootBoardStats,r,this.aiPlayer)}else t==="W"?e=ii:t==="L"?e=Bi:e=Hi;this.popProm(e)}}async processAction(t,e,r=!1){const s=!this.simOn;let l=0,f,m=this.actionPruner(t);if(m=this.noHandDoubles(m),this.peeking){this.popPeeker(m);return}if(s&&this.dumb&&e&&(this.dumb=!1,p.debug("Smart Again.",!1)),this.dumb&&!this.inPhase){let F=m.filter(W=>W.key==="FITE"||W.key==="ENDT");F.length>0&&(m=F)}if(s){f=new Se,f.hwhipe();const F=m.map((et,vt)=>f.drawAiGear(vt,!1));await Promise.all(F),await new Le().drawActions([]),await S.sleep(Oe),this.kickOut=!1,this.simOn=!0,this.slowpoke=Date.now(),this.rootBoardStats=this.brdEval.fromState(),this.endCount=0;const Y=await this.peeker(m),j=[];let mt=0,z=0,rt=[];Y.forEach(et=>{mt+=et.peek.length,et.free&&(et.free==="FREE"?z++:rt.includes(et.free)||(z++,rt.push(et.free))),et.wasPeek&&et.peek.some(vt=>this.hasHint(vt,"DF"))&&j.push(et.root)}),j.length>0?(m=j,this.dumb=!0,p.debug("Do firsts; dumb mode. Action count "+m.length,!1)):r?(this.dumb=!0,p.debug("Forced dumb mode.",!1)):E.regularPlays+z>3?(this.dumb=!0,p.debug("4+ plays; dumb mode. Peek was "+mt,!1)):k.getActive().hand.length>7?(this.dumb=!0,p.debug("8+ in hand; dumb mode. Peek was "+mt,!1)):mt>29&&S.options.debug&&this.peekerReport(Y)}if(m.length===0){s&&(console.error("Root eval set consisted of 0 valid actions"),p.debug("!! Zero Action Root !!")),this.simEndpoint("D");return}let A=-99999;const C=[];if(m.length===1&&s)C.push({a:m[0],weight:99});else{pe.saveState();for(let F=0;F4e4&&(this.kickOut=!0),j+=this.hintWeight(W),j>A&&(A=j),pe.restoreState(),s&&(C.push({a:W,weight:j}),await f.drawAiGear(F,!0),l++,await S.sleep(Oe))}pe.popState()}if(s)if(this.simOn=!1,this.kickOut){const F="🤖: High complexity encountered. Recombobulating.";p.new().txt(F).go(),this.processAction(t,e,!0)}else{const F=A-.4;let W=C.filter(rt=>rt.weight>F);W.length>1&&W.findIndex(rt=>rt.a.key==="ENDT")>-1&&(W=W.filter(rt=>rt.a.key!=="ENDT"));let Y;if(F>ii-100){const rt=W.find(et=>et.a.key==="FITE");rt?Y=rt.a:Y=W[S.randInt(0,W.length)].a}else Y=W[S.randInt(0,W.length)].a;const j=Date.now()-this.slowpoke,mt=Math.max(1,350-j),z=j-Oe*l;this.turnSims+=this.endCount,this.turnTime+=z,S.options.debug&&Y.key==="HPLY"&&(p.debug("▪"),p.debug("🧠 Hand Choices 🧠"),C.filter(rt=>rt.a.key==="HPLY").sort((rt,et)=>et.weight-rt.weight).forEach(rt=>{let et="";rt.a===Y?et=" 🏆":rt.weight>F&&(et=" 🌻"),p.new().crd(rt.a.card).txt(" : "+this.lNum(rt.weight)+et).go()}),p.debug("🧠 ~~~~~~~~~~~~ 🧠"),p.debug("▪")),S.sleep(mt).then(()=>{T.handleAction(Y)})}else this.popProm(A)}actionPruner(t){let e=t.filter(r=>Ni.indexOf(r.key)===-1);return E.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,l=g.ddf6(s);if(l.owner===this.aiPlayer){const f=l.aiHints();return f.includes("MC")||f.includes("LZ")}else return!0}}else return!0}),e=e.filter(r=>{if(this.hasHint(r,"KL")){const s=r,l=g.ddf6(s);if(l.owner===this.aiPlayer){const f=l.aiHints();return f.includes("ST")||f.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,l=g.ddf6(s);return l.owner===this.aiPlayer?l.aiHints().includes("MC"):!0}}else return!0}),e=e.filter(r=>{const s=r.key==="FORG";if(s||this.hasHint(r,"FL")){const l=r,f=g.searchByFSA(l);return f&&(E.mainBattle?E.newPre:E.newPost).includes(f.id)?f.aiHints().includes("RT")?!0:s?G.getCard(l.host).aiHints().includes("RD"):!1:!0}else return!0}),e}noHandDoubles(t){const e=[],r=[],s=[];return t.forEach(l=>{l.key==="HPLY"?e.push(l):r.push(l)}),e.forEach(l=>{const f=l.card;s.includes(f)||(s.push(f),r.push(l))}),r}async peeker(t){this.peeking=!0;const e=[],r=[];t.forEach(s=>{Fi.includes(s.key)?r.push(s):e.push({root:s,peek:[s],wasPeek:!1,free:""})}),pe.saveState();for(let s=0;s0){let A="";if(l.key==="HPLY"){const C=l;C.cost!==""&&(A=C.cost)}e.push({root:l,peek:m,wasPeek:!0,free:A})}pe.restoreState()}return pe.popState(),this.peeking=!1,e}peekerReport(t){let e=0,r=0,s=0,l=[],f=[];t.forEach(m=>{const A=m.peek.length;if(A>0){const C=m.root.key;if(C==="HPLY")if(m.peek[0].key==="FORG")r+=A;else{const F=p.fastName(m.root.card)+": "+A;l.push(F)}else if(C==="MOVE")s+=A;else if(C==="ACTV"){const F=p.fastName(m.root.host)+": "+A;f.push(F)}else e+=A}}),p.debug("High complexity hit: Root: "+t.length),r>0&&p.debug("Forges: "+r),s>0&&p.debug("Mobility: "+s),l.forEach(m=>p.debug(m)),f.forEach(m=>p.debug(m)),e>0&&p.debug("Other: "+e)}hintWeight(t){let e=!1,r=!1,s="",l=0;if(t.key==="HDSC"?(s=t.host,r=!0):this.hasHint(t,"CD")?s=t.card:t.key==="HPLY"&&(s=t.card,e=!0),s){const f=G.getCard(s);l+=this.levelBonusFormula(f,!e,r),e&&(l+=this.hintAdjuster(f))}return l}levelBonusFormula(t,e,r){let s=0;const l=t.aiHints();return l.includes("LG")?(s+=1,l.includes("LM")&&(s+=.8)):l.includes("LB")?s-=1.3:e&&(s+=.4),r&&s>0&&(s=s/2.5),s}hintAdjuster(t){let e=0;const s=t.aiHints().find(l=>l.startsWith("ZZ"));return s&&(e=.5*parseInt(s.slice(2))),e}hasHint(t,e){return!t.hint||t.hint.length===0?!1:t.hint.includes(e)}logStats(t,e){const s=["Crt Cnt","Crt Val","Threat","P Health"].map((l,f)=>`${l}: ${this.numNum(e[f])}`).join(", ");console.log(t+s)}numNum(t){return t.length>6?t.charAt(0)==="-"?"NUNS":"KILL":t.padEnd(4)}cheater(){return R.aiMode&&R.aiActive&&S.options.cheater?new Di(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=>p.fastName(r)).join(` +`))}peekDecks(){const t=k.toPlayer(!1),e=t.deck.map(f=>p.fastName(f)).sort(),r=t.hand.map(f=>p.fastName(f)).sort(),s=t.discard.map(f=>p.fastName(f)).sort(),l=["-- Deck --"].concat(e,"-- Hand --",r,"-- Discard --",s);console.log(l.join(` +`))}}const ht=new Pi;class Mi{getState(){const t={cCrd:this.currPlayCard,cCst:this.currPlayCost,cPos:this.currPlayPos,aa:this.actionHistory};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.currPlayCard=e.cCrd,this.currPlayCost=e.cCst,this.currPlayPos=e.cPos,this.actionHistory=e.aa}handleAction(t){if(t.key==="DEET"){jt.init(t.param);return}if(t.key==="HPLY"){this.playCardSelect(t);return}if(t.key==="FORG"){E.forgeCard(t,this.currPlayCard,this.currPlayCost,this.currPlayPos);return}if(t.key==="FITE"){ci.fight(t.param==="M");return}if(t.key==="ENDT"){E.endTurn();return}if(t.key==="MOVE"){this.mobilitySelect(t);return}if(t.key==="MEND"){E.mobility(t);return}if(t.key==="HDSC"){this.currPlayCost="",E.cardPlayed(this.currPlayCard,this.currPlayCost,this.currPlayPos,!0),this.actionDone();return}if(t.key==="ACTV"){const e=g.jr5(t.param);G.getCard(e.code).startActivation(e);return}if(t.key==="NOTR"){t.param==="PM"&&At.popMode(),this.actionDone(!0);return}if(t.key==="CARD"){G.getCard(t.host).handleAction(t);return}if(t.key==="CANC"||t.key==="CNCL"){t.param==="PM"&&At.popMode(),this.actionHistory.pop(),this.ddf5();return}if(t.key==="USWP"){At.popMode(),Rt.whatNext();return}if(t.key==="DTUP"){jt.updateDetails(t),yt.drawAll();return}if(t.key==="VWDK"){Dt.handleShowDeck(t);return}if(t.key==="SCRK"){Dt.handleDeckScroll(t);return}if(t.key==="SCRH"){t.param==="R"?R.ui.handScrollLeft+=1:R.ui.handScrollLeft-=1,yt.drawAll();return}if(t.key==="DRFT"){pt.resumeDraft(t.param);return}if(t.key==="SCRD"){pt.paginate(t.param==="D"),yt.drawAll();return}if(t.key==="UIBT"){Xe.handleUIButton(t);return}if(t.key==="MENU"){Xe.handleMainMenuButton(t);return}if(t.key==="MNBT"){Xe.handleMenuButton(t);return}if(t.key==="DSET"){this.ddf5(Mt.generateDeckPickerActions(parseInt(t.param)));return}if(t.key==="DECK"){Mt.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];R.aiActive?ht.processAction(r,e):yt.drawAll()}currPlayCard="";currPlayCost="";currPlayPos=-1;shiftPlayCard(t){t0&&e.canLevel()&&r.push(D.buttonTarget("HDSC",t.card));const s=D.toActions(r);return s.push(y.handSelectAction("CANC",t.card,"",t.position)),s}mobilitySelect(t){const e=this.getMoveCardActions(t);this.ddf5(e)}getMoveCardActions(t){if(t.key!=="MOVE")throw new Error("Unexpected action passed to getMoveCardActions: "+t.key);const e=g.ddf6(t);let r=[];if(t.param==="ACTV"){const s=y.actionTarget("TB","ACTV",e.code,e.id);r=D.toActions(s)}return r.push(y.fieldSelectAction("CANC",t.lane,t.playerA)),g.canMove(e).map(s=>{const l=y.fieldSelectAction("MEND",s,t.playerA);return l.param=e.id,l}).concat(r)}noneEndTrigger(){return D.toActions(D.buttonTarget("NOTR"))[0]}cancelAction(){return D.toActions(D.buttonTarget("CANC"))[0]}emptyAdjacents(t,e){const r=e||t.id,s=y.emptyPlayerActTarg("F","CARD",t.code,r);return s.lanes=t.adjacent,D.toActions(s)}generateDetailActions(){const t=At.mode;if(R.aiActive)return[];if(t==="G"){const e=k.getLocal().hand.map((s,l)=>{const f=y.handSelectAction("DEET",s,"",l);return f.param=s,f}),r=g.qActiveCreats().map(s=>{const l=y.fieldSelectAction("DEET",s.lane,s.owner);return l.param=s.code,l});return e.concat(r)}else if(t==="D"){const e=pt.currentPack.map((s,l)=>{const f=y.draftSelectAction("DEET",l,!0);return f.param=`${s}1`,f}),r=pt.picksAsDeck.map((s,l)=>{const f=y.draftSelectAction("DEET",l,!1);return f.param=`${s.card}1`,f});return e.concat(r)}return[]}}const T=new Mi;class Ri{type="N0";events=[];triggerActions=[];deathCheck=!0;iaTrigLane=0;getState(){const t={type:this.type,events:this.events,tA:this.triggerActions,dC:this.deathCheck,tL:this.iaTrigLane};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.type=e.type,this.events=e.events,this.triggerActions=e.tA,this.deathCheck=e.dC,this.iaTrigLane=e.tL}startBatch(){this.deathCheck=!1,this.type==="C0"?this.type="C1":this.type==="C1"?this.type="C2":this.type==="C2"&&(this.type="N0");const t=this.type;let e;if(t==="N0")e=this.events.slice(),this.events=[];else{const s=this.events.filter(f=>f.code==="DIE"),l=this.events.filter(f=>f.code!=="DIE");t==="C1"?(e=l,this.events=s):(e=s,this.events=l)}const r=this.generateTriggers(e);this.triggerActions=this.sortTriggers(r),Rt.whatNext()}generateTriggers(t){let e;const r=t.map(s=>{s.code==="TRS"&&(e=s);const l=g.field.map(m=>m.triggers.map(A=>{const C=y.triggerReaction(s,A,m.owner,"C");return C.creatId=m.id,C.cardCode=m.code,C}).filter(A=>qe.ddf8(A))).flat(),f=[!0,!1].map(m=>k.toPlayer(m).triggers.map(C=>y.triggerReaction(s,C,m,"P")).filter(C=>qe.ddf8(C))).flat();return l.concat(f)}).flat();return e&&this.handleTurnStart(e),r}sortTriggers(t){const e=k.getActiveB(),r=t.filter(f=>!f.trigger.interactive&&f.owner===e),s=t.filter(f=>!f.trigger.interactive&&f.owner!==e);return t.filter(f=>f.trigger.interactive&&f.owner===e).concat(s,r)}handleTurnStart(t){const e=k.getActiveB();g.qPlayerCreats(e).filter(s=>s.sleeping).forEach(s=>{s.sleeping=!1});const r=R.tick();g.qActiveCreats().forEach(s=>{s.owner===t.playerA&&(s.activationAvailable=!0,s.mobilityAvailable=!0,s.sleeping=!1),s.armorDmg=0,s.poison>0&&s.hurtDirect(s.poison,"POIS",r),s.regen>0&&s.heal(s.regen),V.deathProdder(s,r)}),[k.playerA,k.playerB].forEach(s=>{s.armorDmg=0;const l=k.totalPoison(s);l>0&&k.hurtDirect(s,l,"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),Rt.whatNext()}addEvents(...t){this.events.push(...t)}}const x=new Ri;class Ei{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new di(t)}get(t){return this.registry[t]}}const at=new Ei;class Ii 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.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}targ(t){const e=y.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(e.lanes=t.adjacent),e}canActivate(t){return g.creatByTarget(this.targ(t)).length>0}startActivation(t){let e;this.level===1?e=this.targ(t):(e=D.boardTarget("CARD",this.code),e.param=t.id),e.hint=["BB"],T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){const e=g.jr5(t.param);if(t.zone==="F"){const r=g.ddf6(t);this.logAct(!0,r),this.applyMod(r)}else{this.logAct(!0);const r=this.targ(e);g.creatByTarget(r).forEach(s=>{this.applyMod(s)})}e.endActivation()}applyMod(t){const e=y.mod("AT",t.attack);e.expiry="ET",t.addMod(e)}}class Gi 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 ${p.jr9(this.level,this.level,!0)} and Regenerate ${this.level}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("EF");s.bonus=this.buffNug(this.level,this.level);const l=r.jr4("MV");return l.bonus=this.regnNug(this.level),r}ddf8(t){const e=$.toCreature(t.event);return(e.creature.lane===1||e.creature.lane===5)&&e.creature.owner===t.owner}jr8(t){const e=$.toCreature(t.event);e.creature.buff(this.level,this.level),e.creature.addRegen(this.level),x.triggerDone()}}class Li 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=y.crNotMeTarg(e.id);s.player=k.toTarget(e.owner);const l=g.creatByTarget(s);if(r&&l.length===0){const f=y.mod("AR",this.boof101520,e.id);k.addModSafe(e.owner,f);const m=y.mod("AR",this.level+1,e.id),A=y.mod("MB",1,e.id);e.addModSafe(m),e.addModSafe(A)}else k.removeModSafe(e.owner,e.id),e.removeModSafe(e.id)}}class Fe 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!ht.simOn&&this.testAmbush(this.cardCode(),t)}jr8(t){const e=this.cardCode(),r=k.toPlayer(t.owner),s=r.hand.length;for(let l=s-1;l>-1;l--){const f=r.hand[l];f.startsWith(e)&&(p.new().crd(f).txt(" Ambushed.").go(),g.birth(f,"S",r.isPlayerA),E.levelAndDiscard(f,l,!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){return t.event.code==="PLC"?t.owner!==t.event.playerA&&E.cardsPlayed===3:!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=$.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=$.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){return t.event.code==="PHL"?t.owner!==t.event.playerA&&k.getActiveB()===t.event.playerA:!1}}class $i 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");return s.bonus=this.rawNug(0,0,0,0,.5),s.interactive=!0,r}handleAction(t){E.levelAndDiscardA(t),T.actionDone(!0)}ddf8(t){if(t.event.playerA===t.owner){const e=G.getCard(t.event.cardCode);if(e.type==="S"&&e.faction==="A")return!0}return!1}jr8(t){const e=y.lvlHandActTarg(this.code,t.creatId),r=D.toActions([e,D.buttonTarget("NOTR")]);r.length>1?T.ddf5(r):x.triggerDone()}}class Wi 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 ${p.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(y.mod("HL",s,e.id)),e.addModSafe(y.mod("MH",s,e.id)),e.addModSafe(y.mod("AT",s,e.id))}else e.removeModSafe(e.id)}get boof(){return this.lValN([4,8,80])}}class Vi 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 ${p.dbdtap()}, it gets ${p.jr9(this.level,this.level)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),r}ddf8(t){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}jr8(t){const e=$.toDamage(t.event);this.logAct(!1,e.srcCreat),e.srcCreat.buff(this.level,this.level),x.triggerDone()}}class Pe 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 ${p.jr9(this.level,this.level)} for each ${p.factionText(this.faction)} card in your hand.`}hell(){this.faction="N",this.name="Hellforged Avatar",this.iRegen=this.level,this.tribe.push("AB")}root(){this.faction="U",this.name="Rootforged Avatar",this.iBT=!0,this.tribe.push("HM")}steel(){this.faction="A",this.name="Steelforged Avatar",this.iArmor=this.level,this.tribe.push("CY")}storm(){this.faction="T",this.name="Stormforged Avatar",this.iMobile=this.level,this.tribe.push("MT")}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),r}jr8(t){const e=$.toEnterField(t.event),r=k.toPlayer(t.owner).hand.filter(s=>G.getCard(s).faction===this.faction).length;if(r>0){const s=r*this.level;e.creature.buff(s,s)}x.triggerDone()}}class Z extends P{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["COZ"]:()=>this.cooze(),["DFM"]:()=>this.dfmimic(),["DZA"]:()=>this.dozer(),["FWG"]:()=>this.feywing(),["FUN"]:()=>this.funguy(),["POZ"]:()=>this.purpz(),["NSD"]:()=>this.fixedSeedling(1),["OOZ"]:()=>this.nooze(),["RPT"]:()=>this.raptor(),["SPL"]:()=>this.minion(),["SXP"]:()=>this.fixedSapling(5),["SXD"]:()=>this.fixedSeedling(3),["SXT"]:()=>this.fixedTreefolk(7),["SDL"]:()=>this.minion(),["SPN"]:()=>this.nekSpirit(),["SPU"]:()=>this.uspirit(),["XYR"]:()=>this.yuruSpirit(),["TFK"]:()=>this.minion(),["TFD"]:()=>this.fixedTreefolk(this.boof5714),["TFF"]:()=>this.tfFight(),["TTF"]:()=>this.fixedTreefolk(3),["ZTR"]:()=>this.zimus(),["ZBS"]:()=>this.threeZomb(),["ZST"]:()=>this.strideZomb(),["ZMB"]:()=>this.commonZomb()}[t]}constructor(t){super(t),this.rarity="T";const e=this.cardCode();this.imgKey=e,this.minLevel=this.level,this.maxLevel=this.level,this.lookup(e)()}image(t){return this.rawImage(this.imgKey,t)}static fgoc(t){return "FGO"+t}fixedNekSpirit(t){this.faction="N",this.rarity="T",this.name="Spirit",this.tribe.push("ST"),this.iAttack=t,this.iHealth=t,this.imgKey=`${"SPN"}${this.level}`}nekSpirit(){this.fixedNekSpirit(this.boof51015)}yuruSpirit(){this.fixedNekSpirit(this.boof5814)}static purpOzC(t){return "POZ"+t}oozer(t){this.faction="N",this.rarity="T",this.name="Oozeling",this.tribe.push("OZ"),this.iHealth=this.iAttack,this.imgKey=t?"POZ":"OOZ"}purpz(){this.iAttack=this.boof135,this.oozer(!0)}nooze(){this.iAttack=this.boof4711,this.oozer(!1)}cooze(){this.iAttack=1,this.oozer(!1),this.hints=["RT"]}minion(){this.iAttack=Z.minionBuff(this.level),this.plont(),this.name=Z.minionName(this.level),this.hints=["RT"]}static tffc(t){return "TFF"+t}static minionCode(t){return(t===1?"SDL":t===2?"SPL":"TFK")+t}static minionName(t){return t===1?"Seedling":t===2?"Sapling":"Treefolk"}static minionBuff(t){return t===1?1:t===2?3:5}plont(){this.faction="U",this.iHealth=this.iAttack,this.tribe.push("PL")}fixedSapling(t){this.iAttack=t,this.plont(),this.name=Z.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.iAttack=t,this.plont(),this.name=Z.minionName(1),this.imgKey="SDL",this.hints=["RT"]}fixedTreefolk(t){this.iAttack=t,this.plont(),this.name=Z.minionName(3),this.imgKey="TFK"}tfFight(){this.iAttack=this.boof91421,this.plont(),this.name=Z.minionName(3),this.imgKey="TFK"}dfmimic(){this.faction="U",this.rarity="T",this.name="Darkforged Mimic",this.tribe.push("DF","PL"),this.iHealth=this.boof3711,this.iAttack=this.iHealth-1,this.imgKey="SSP"+this.level}dozer(){this.faction="U",this.name="Dozer, the Awakened",this.iAttack=this.level*3+6,this.iHealth=this.iAttack,this.iAggro=!0,this.iBT=!0,this.tribe.push("BR"),this.imgKey=this.code,this.text=`${this.name} enters play with health equal to the Dozer, the Dormant it replaced.`}feywing(){this.faction="U",this.name="Feywing",this.iAttack=9,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("DG")}funguy(){this.name="Funguy",this.iAttack=this.lValN([6,12,14]),this.plont(),this.minLevel=1,this.maxLevel=3,this.level===1?this.hints=["ZZ-1"]:this.level===2&&(this.hints=["LB"])}raptor(){this.faction="U",this.name="Raptor",this.iAttack=1,this.iHealth=1,this.tribe.push("DN"),this.hints=["RT"]}uspirit(){this.faction="U",this.name="Spirit",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("ST")}static zomc(t){return "ZMB"+t}zimus(){this.faction="N",this.rarity="T",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 ut extends kt{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ()},["ABE"]:{c:()=>this.edicC(),z:()=>this.edicZ()},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ()},["COD"]:{c:()=>this.chontC(),z:()=>this.chontZ()},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ()},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ()},["DGW"]:{c:()=>this.drwkC(),z:()=>this.drwkZ()},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ()},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ()},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ()},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ()},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ()},["IVS"]:{c:()=>this.infvC(),z:()=>this.infvZ()},["LOD"]:{c:()=>this.lashC(),z:()=>this.lashZ()},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ()},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ()},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ()},["PLW"]:{c:()=>this.palwC(),z:()=>this.palwZ()},["PHC"]:{c:()=>this.pcallC(),z:()=>this.pcallZ()},["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()},["WPC"]:{c:()=>this.wipeC(),z:()=>this.wipeZ()}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){const e=this.cardCode();return e==="NSH"||e==="PHC"?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=D.boardTarget("CARD",this.code);return t.push(e),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),T.spellCast()}ddf8(t){return Nt.extractCardCode(t.trigger.logicCode)==="DGW"}jr8(t){if(Nt.extractCardCode(t.trigger.logicCode)==="DGW"){const r=g.jr5(t.trigger.creatId);r.status==="A"&&V.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;g.ddf1().forEach(e=>{e.addArmor(t)})}aeSides(){return[g.qPlayerCreats(!0),g.qPlayerCreats(!1)]}edicC(){this.faction="A",this.rarity="H",this.name="Ambriel's Edict",this.maxLevel=1,this.overload=!0,this.text="If each player has at least one creature in play, destroy all but the highest attack creature that each player controls.~Then discard you hand."}edicZ(){const t=this.aeSides(),e=R.tick();let r=[];t.forEach(m=>{if(m.length>1){let A=[],C=-999999;m.forEach(F=>{F.attack>C?(C=F.attack,r.push(...A),A=[F]):F.attack===C?A.push(F):r.push(F)}),A.length>1&&(A.splice(S.randInt(0,A.length),1),r.push(...A))}}),r.forEach(m=>V.destroy(m,this.code,e));const s=k.getActive(),l=T.playPosition(),f=s.hand.length;for(let m=f-1;m>-1;m--)m!==l&&(s.discard.push(s.hand[m]),s.hand.splice(m,1),T.shiftPlayCard(m))}get ctlboof(){return(this.level-1)*2}ctlC(){this.faction="T",this.rarity="L",this.name="Call the Lightning";const t=this.level>1?` gets ${p.jr9(this.ctlboof,0)} this turn. Those creatures`:"";this.text=`Each friendly creature${t} battles an additional time this turn.`}ctlZ(){const t=this.ctlboof;g.ddf1().forEach(e=>{const r=y.mod("AT",t);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=R.tick();g.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=R.tick();V.destroy(t[r],this.code,s),this.level===3&&e>1&&(t.splice(r,1),V.destroy(t[S.randInt(0,e-1)],this.code,s))}}dCurrHunter(){const t=y.crEnemyTarg();return t.level=D.ddf2(this.level+1),g.creatByTarget(t)}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${p.jr9(this.boof4812n,0)}.`}digiZ(){const t=this.boof4812n;g.qEnemyCreats().forEach(e=>{e.buff(t,0)})}drwkC(){this.faction="T",this.rarity="L",this.name="Dragonwake",this.text=`Search your deck for a ${p.levelGateText(this.level+1,!0)}Dragon and Spawn a copy of it. It gets Aggressive${this.level===3?".":' and "At the end of your turn, destroy this.'}`}drwkZ(){const t=y.target("DK");t.tribe="DG",t.level=D.ddf2(this.level+1),t.player="F";const e=D.deckByTarget(t),r=e.length;if(r>0){const s=g.birth(e[S.randInt(0,r)][0],"S",k.getActiveB());if(s&&(s.aggressive=!0,this.level<3)){const l=s.jr4("TE",this.code);l.creatId=s.id,l.changes=!0}}}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${p.jr9(t,t)}.`}epiZ(){const t=this.boof246n,e=y.crEnemyTarg();g.creatByTarget(e).forEach(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 ${p.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;g.ddf1().forEach(e=>{e.buff(t,t),this.level===3&&(e.breakthrough=!0)})}get fszap(){return this.level+4}fstormC(){this.faction="T",this.rarity="H",this.name="Firestorm",this.text=`Deal ${this.fszap} damage to each creature.`}fstormZ(){const t=this.fszap,e=R.tick();g.qActiveCreats().forEach(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 ${p.jr9(-1*t,0)}. Each friendly creature gets ${p.jr9(t,0)}.`}mealZ(){const t=this.boof234,e=k.getActiveB();g.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 ${p.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,e=y.crFriendTarg();g.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 ${p.jr9(t,t,!0)} and Regenerate ${this.level}.`}infvZ(){const t=this.boof246,e=y.crFriendTarg();e.lanes=[1,5],g.creatByTarget(e).forEach(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;g.qEnemyCreats().forEach(e=>{e.addPoison(t)})}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=G.getCard(this.ndc());this.text=`Spawn a ${p.tokName(t)}.`}shriekZ(){g.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;g.qEnemyCreats().forEach(e=>{e.addPoison(t)})}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${p.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)g.ddf1().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;g.ddf1().forEach(e=>{e.buff(t,0)})}}palwC(){this.faction="A",this.rarity="R",this.name="Palladium Wave",this.maxLevel=1,this.text=`Each enemy creature gets ${p.jr9(-1,0).replaceAll("1","X")}, where X is two times your rank.`}palwZ(){const t=-2*k.getActive().rank;g.qEnemyCreats().forEach(e=>{e.buff(t,0)})}pcallC(){this.faction="T",this.rarity="L",this.name="Phoenix Call";const t=G.getCard(this.cpc());this.text=`Spawn a ${p.tokName(t)}.`}pcallZ(){g.birth(this.cpc(),"S",k.getActiveB())}cpc(){return "CYP"+this.level}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=G.getCard(Z.minionCode(this.level));this.text=`Put a ${p.tokName(t)} into each players available lanes.`}phyZ(){const t=Z.minionCode(this.level),e=R.tick();[!0,!1].forEach(r=>{g.emptyLanes(r).forEach(s=>{g.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=R.tick(),r=g.qEnemyCreats();g.ddf1().forEach(s=>{r.forEach(l=>{l.hurtDirect(t,s.code,e)})})}rokC(){this.faction="T",this.rarity="L",this.name="Rage of Kadras",this.overload=!0,this.maxLevel=1,this.text="Each friendly Tempys creature gets +1 attack and deals damage equal to its attack to the creature opposing it."}rokZ(){const t=R.tick(),e=y.crFriendTarg();e.faction="T",g.creatByTarget(e).forEach(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=G.getCard(Z.minionCode(this.level));this.text=`Spawn three ${p.tokName(t)}s.`}stsZ(){const t=Z.minionCode(this.level),e=R.tick();[1,2,3].forEach(r=>{g.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 ${p.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;g.qEnemyCreats().forEach(e=>{e.buff(t,0)})}sradC(){this.faction="U",this.rarity="C",this.name="Soothing Radiance",this.text=`Heal ${this.boof61224} damage from each friendly creature.`}sradZ(){const t=this.boof61224;g.ddf1().forEach(e=>{e.heal(t)})}beec(){return "KBE"+this.level}beesC(){this.faction="U",this.rarity="H",this.name="Stinging Invocation";const t=G.getCard(this.beec());this.text=`Spawn one to three ${p.tokName(t)}s.`}beesZ(){const t=this.beec(),e=R.tick(),r=S.randInt(2,5);[1,2,3].forEach(s=>{s{const r=y.mod("AT",t);r.expiry="ET",e.addMod(r)})}talinTarg(){const t=y.crFriendTarg();return t.faction="T",g.creatByTarget(t)}turnbC(){this.faction="T",this.rarity="H",this.name="Turnabout",this.isFree=this.level===3;const t=this.boof235;this.text=`Each creature gets ${p.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,e=-1*t;g.qActiveCreats().forEach(r=>{const s=y.mod("AT",t),l=y.mod("HL",e),f=y.mod("MH",e);s.expiry="ET",l.expiry="ET",f.expiry="ET",r.addMod(s),r.addMod(l),r.addMod(f)})}verdC(){this.faction="U",this.rarity="H",this.name="Verdant Charge";const t=this.verdb;this.text=`Each friendly creature gets ${p.jr9(t,t,!0)} and Regenerate ${t}.`}verdZ(){const t=this.verdb;g.ddf1().forEach(e=>{e.buff(t,t),e.addRegen(t)})}get verdb(){return this.lValN([1,3,6])}wdenC(){this.faction="U",this.rarity="R",this.name="Whispers of Dendris",this.maxLevel=1,this.text=`Each friendly creature gets ${p.jr9(1,1).replaceAll("1","X")}, where X is your rank.`}wdenZ(){const t=k.getActive().rank;g.ddf1().forEach(e=>{e.buff(t,t)})}wipeC(){this.faction="A",this.rarity="H",this.name="Wipe Clean",this.overload=!0,this.maxLevel=1,this.text="Remove all abilities from each creature and player."}wipeZ(){[!0,!1].forEach(e=>{const r=k.toPlayer(e);r.effects=[],r.mods=[],r.triggers=r.triggers.filter(s=>s.customCode==="AB"),r.poison=0,r.armor=0});const t=g.qActiveCreats();t.forEach(e=>{e.preWipe()}),t.forEach(e=>{e.wipeAll()})}}class Ui 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}.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=g.ddf6(t),s=g.jr5(e[1]),l=this.emptySloots(s,r.id);l.push(T.cancelAction()),T.ddf5(l)}else{const r=g.jr5(e[1]),s=g.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),r.endActivation()}}emptySloots(t,e=""){return T.emptyAdjacents(t,S.enTil("P2",t.id,e))}buddies(t){return D.toActions(y.crFriendNotMeActTarg("CARD",t,this.code,S.enTil("P1",t)))}}class Oi 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.text=`Upgrade Dinosaur: Replace Bron with a level ${this.level} Dino Knight.~When this ${p.dbdtap()}, heal ${e} damage from each other friendly creature.`}jr3(t,e){const r=super.jr3(t,e);r.jr4("UP");const s=r.jr4("DM");return s.bonus=this.buffNug(0,this.boof357),r}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){if(t.trigger.type==="UP"){const r=$.toReplaced(t.event).replCreat;r.isTribe("DN")&&g.birth("DNK"+this.level,"R",r.owner,r.lane)}else if(t.trigger.type==="DM"){const e=this.boof357,r=y.crNotMeTarg(t.creatId);r.player=k.toTarget(t.owner),g.creatByTarget(r).forEach(l=>l.heal(e))}x.triggerDone()}}class zi 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"),r}ddf8(t){return t.event.playerA===t.owner}jr8(t){const e=y.mod("AR",this.boof2510),r=y.mod("DF",!0);e.expiry="ET",r.expiry="ET";const s=g.jr5(t.creatId);s.addMod(e),s.addMod(r),x.triggerDone()}}class Zi extends kt{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Bullwark Bash",this.text=`Deal damage equal to ${this.level>1?this.level+"x ":""}the Armor on a friendly creature to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");e.hasArmor=!0,t.push(e)}return t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=g.ddf6(t),s=this.enemyTargActions(r.id);s.push(T.cancelAction()),T.ddf5(s)}else{const r=g.ddf6(t),s=g.jr5(e[1]);this.logSpell(s),r.hurtDirect(s.armor*this.level,this.code),T.spellCast()}}enemyTargActions(t=""){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(e)}}class Yi 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} ${p.dbdtac(this.level)}, destroy it.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),r}ddf8(t){const e=$.toDamage(t.event);return e.battle&&e.isCreatSrc&&e.isCreatTarg&&e.srcId===t.creatId&&D.levelTestCommon(e.hurtCreat.level,this.level)}jr8(t){if(t.trigger.type==="FR"&&E.allied("N")){const e=g.jr5(t.creatId),r=e.jr4("DM");r.bonus=this.avgSpawnNug(),e.changed=!0}else if(t.trigger.type==="DM"){const r=$.toDamage(t.event).hurtCreat;r.status==="A"&&V.destroy(r,this.code)}x.triggerDone()}}class Ki 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.hints=["ZZ-2"],this.iMobile=1,this.maxLevel=4;const e=this.level===4?`When ${this.name} ${p.dbdtap()}, deal damamge to that player equal to their health.~`:"";this.text=e+`When ${this.name} ${p.dbdtac(this.level)}, destroy that creature.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM");return this.level===4?s.bonus=this.rawNug(0,0,0,0,10):s.bonus=this.avgSpawnNug(),r}ddf8(t){const e=$.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 D.levelTestCommon(r.level,this.level)}}return!1}jr8(t){const e=$.toDamage(t.event);if(e.isCreatTarg){const r=e.hurtCreat;r.status==="A"&&V.destroy(r,this.code)}else k.hurtDirect(e.hurtPlayer,e.hurtPlayer.health,this.code);x.triggerDone()}}class ft extends P{lookup(t){return{["ASQ"]:{c:()=>this.asqC(),a:(r,s)=>this.asqA(r,s),t:r=>this.asqT(r)},["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)},["SFG"]:{c:()=>this.sfgdC(),a:(r,s)=>this.sfgdA(r,s),t:r=>this.sfgdT(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.addExtraActivate(r)),r}canActivate(t){return D.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){const e=D.toActions([this.actTargets(this.cardCode(),t),D.buttonTarget("CANC")]);T.ddf5(e)}handleAction(t){const e=g.ddf6(t),r=g.jr5(t.param);this.logAct(!0,this.xl?e:void 0),this.targAction(this.cardCode(),e,r),r.endActivation()}makeCreatTarg(t){return y.crActTarg("CARD",this.code,t.id)}makeOtherCreatTarg(t){const e=this.makeCreatTarg(t);return e.notMe=t.id,e}doubleActivator(){return this.code==="CGL"+"3"||this.code==="XSH"+"3"}ddf8(t){return Nt.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=g.jr5(e.creatId);g.birth(r.code,"S",t.owner),x.triggerDone()}else if(t.trigger.type==="PT"){const e=t.trigger.customCode,r=g.jr5(t.creatId);r.triggers.filter(l=>l.customCode===e).forEach(l=>r.removeTrigger(l)),x.triggerDone()}else if(t.trigger.type==="TS"){const e=g.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}asqC(){this.faction="N",this.rarity="L",this.name="Ariadne, Spider Queen",this.iAttack=this.boof3712,this.iHealth=this.lValN([8,12,19]),this.tribe.push("SP"),this.xl=!1,this.text="Activate, destroy a Web: Ariadne gets +attack and +health equal to the destroyed Web.";const t=this.avgCreatureStats();this.bonus={activ8:this.multNug(this.buffNug(t[0],t[1]),.7)}}asqT(t){const e=this.makeCreatTarg(t);return e.tribe="WB",e}asqA(t,e){e.buff(t.attack,t.health),V.destroy(t,this.code)}bswC(){this.faction="T",this.rarity="C",this.name="Borean Stormweaver",this.iAttack=this.boof4816,this.iHealth=this.lValN([6,10,20]),this.tribe.push("GT"),this.xl=!1;const t=this.boof234;this.text=`Activate: Deal ${t} damage to a creature.`,this.bonus={activ8:this.buffNug(0,t)}}bswT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}bswA(t,e){t.hurtDirect(this.boof234,this.code)}ccsC(){this.faction="N",this.rarity="C",this.name="Catacomb Spider",this.iAttack=this.boof4815,this.iHealth=this.lValN([5,10,16]),this.tribe.push("SP");const t=this.boof246;this.text=`Activate: Give another creature Regenerate ${t}.`,this.bonus={activ8:this.regnNug(t)}}ccsT(t){const e=this.makeOtherCreatTarg(t);return e.canRegen=!0,e.hint=["BF"],e}ccsA(t,e){t.addRegen(this.boof246)}clordC(){this.faction="N",this.rarity="H",this.name="Contagion Lord",this.iAttack=this.boof4914,this.iHealth=this.iAttack+3,this.tribe.push("AB"),this.xl=!1,this.text="Activate, destroy a friendly Abomination: You may play an additional card this turn.",this.level===3&&(this.text+="~You may use this ability twice per turn."),this.bonus={activ8:this.multNug(this.avgSpawnNug(),.3)}}clordT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="AB",e}clordA(t,e){V.destroy(t,this.code),E.regularPlays+=1}cswC(){this.faction="A",this.rarity="C",this.name="Cypien Shieldwarden",this.iAttack=this.boof4610,this.iHealth=this.boof61016,this.tribe.push("HM");const t=this.boof246;this.text=`Activate: Give a creature Armor ${t} this turn.`,this.bonus={activ8:this.regnNug(t)}}cswT(t){const e=this.makeCreatTarg(t);return e.canArmor=!0,e.hint=["BF"],e}cswA(t,e){const r=y.mod("AR",this.boof246);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.`,this.bonus={activ8:this.buffNug(0,this.iAttack)}}ffuT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],t.attack<1&&(e.victims="???"),e}ffuA(t,e){t.hurtDirect(e.attack,this.code)}ffsC(){this.faction="T",this.rarity="R",this.name="Flamefury Shaman",this.iAttack=this.boof369,this.iHealth=this.boof81116,this.tribe.push("HM"),this.text=`Activate: Grant another creature ${p.jr9(this.iAttack,0)} this turn.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}ffsT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}ffsA(t,e){const r=y.mod("AT",this.iAttack);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 ${p.levelGateText(this.level,!0)}creature Aggressive.`,this.bonus={activ8:this.regnNug(1)}}fssT(t){const e=this.makeCreatTarg(t);return e.level=D.ddf2(this.level),e.lanes=t.adjacent,e.player="F",e}fssA(t,e){t.aggressive=!0}kodC(){this.faction="N",this.rarity="L",this.name="Keeper of the Damned",this.iAttack=this.boof5815,this.iHealth=this.boof61017,this.tribe.push("ZB"),this.text=`Activate: another friendly ${p.levelGateText(this.level,!0)}creature gets "Vengeance: Spawn this" this turn.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}kodT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.player="F",e}kodA(t,e){const r=t.jr4("VN");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.",this.bonus={activ8:this.rawNug(0,0,0,0,.1)}}lashT(t){const e=this.makeCreatTarg(t);return e.player="E",e.hasPoison=!0,e.canDefender=!0,e}lashA(t,e){t.defender=!0}mbpC(){this.faction="U",this.rarity="H",this.name="Mossbeard Patriarch",this.iAttack=this.boof137,this.iHealth=this.boof81220,this.tribe.push("PL");const t=this.boof468;this.text=`Activate: Give another creature ${p.jr9(0,t)}.`,this.bonus={activ8:this.buffNug(0,t)}}mbpT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mbpA(t,e){t.buff(0,this.boof468)}mndC(){this.faction="A",this.rarity="R",this.name="Munitions Drone",this.iAttack=this.boof137,this.iHealth=this.boof6814,this.tribe.push("RB");const t=this.boof357;this.text=`Activate: Give another creature ${p.jr9(t,0)}.`,this.bonus={activ8:this.buffNug(t,0)}}mndT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}mndA(t,e){t.buff(this.boof357,0)}ncsC(){this.faction="N",this.rarity="R",this.name="Necroslime",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.xl=!1;const t=this.boof248;this.text=`Activate, deal 3 damage to another friendly creature: ${this.name} gets ${p.jr9(t,t)}.`,this.bonus={activ8:this.buffNug(t,t-3)}}ncsT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}ncsA(t,e){const 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 ${p.jr9(this.iAttack,0)}. Use this ability only if ${this.name} is in the center lane.`,this.bonus={activ8:this.buffNug(this.iAttack/2,0)}}nxgT(t){const e=this.makeCreatTarg(t);return t.lane!==3?e.victims="???":e.hint=["BF","BB"],e}nxgA(t,e){t.buff(this.iAttack,0)}nffC(){this.faction="U",this.rarity="L",this.name="Nuada, Faith's Flourish",this.iAttack=this.boof246,this.iHealth=this.lValN([10,17,25]),this.iDefend=!0,this.tribe.push("TK"),this.xl=!1,this.hints=[this.lValH(["ZZ-1","ZZ-2","ZZ-2"])];const t=G.getCard(Z.tffc(this.level));this.text=`Activate: Replace a friendly Plant with a ${p.tokName(t)}.`,this.bonus={activ8:this.multNug(this.spawnNug(t),.5)}}nffT(t){const e=this.makeCreatTarg(t);return e.player="F",e.tribe="PL",e}nffA(t,e){g.birth(Z.tffc(this.level),"R",e.owner,t.lane)}orghC(){this.faction="N",this.rarity="R",this.name="Organ Harvester",this.iAttack=this.lValN([2,6,9]),this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1,this.text=`Activate, destroy ${this.name}: Destroy a ${p.levelGateText(this.level,!0)}creature.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.4)}}orghT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.hint=["KL"],e}orghA(t,e){const r=R.tick();V.destroy(t,this.code,r),V.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 ${p.jr9(this.boof4812n,0)} this turn.`,this.bonus={activ8:this.buffNug(this.boof246,0)}}ppmT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}ppmA(t,e){const r=y.mod("AT",this.boof4812n);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");const t=this.boof135;this.text=`Activate: Give another creature Poison ${t}.`,this.bonus={activ8:this.regnNug(t)}}pcoilT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["PN","DF"],e}pcoilA(t,e){t.addPoison(this.boof135)}siggyC(){this.faction="N",this.rarity="H",this.name="Sigmund Fraud",this.iAttack=this.boof357,this.iHealth=this.lValN([9,14,19]),this.iDefend=!0,this.tribe.push("AB"),this.xl=!1;const t=this.boof4812;this.text=`Activate, destroy another friendly creature: Deal ${t} damage to the enemy player and you gain ${t} health.`,this.bonus={activ8:this.playerNug(t)}}siggyT(t){const e=this.makeOtherCreatTarg(t);return e.player="F",e}siggyA(t,e){V.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.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.4)}}srmdT(t){const e=this.makeCreatTarg(t);return e.player="E",e.maxAttack=this.iAttack,e}srmdA(t,e){V.destroy(t,this.code)}sfgdC(){this.faction="A",this.rarity="L",this.name="Sparky, Forge Guard Dog",this.iAttack=this.lValN([4,10,14]),this.iHealth=this.lValN([5,11,16]),this.tribe.push("RB","GD"),this.xl=!1;const t=this.lValS(["level 2 Sparky","level 3 Sparky","25/25 Forge Guardian Omega"]);this.text=`Activate, destroy Sparky and another friendly ${this.level===3?"level 3 ":""}Sparky: Spawn a ${t}.`,this.bonus={activ8:this.playerNug(5)}}sfgdT(t){const e=this.makeOtherCreatTarg(t);return e.cardCode="SFG",this.level===3&&(e.level="L3"),e}sfgdA(t,e){const r=R.tick();V.destroy(t,this.code,r),V.destroy(e,this.code,r);const s=this.lValS(["SFG"+"2","SFG"+"3","FGO"+"1"]);g.birth(s,"S",e.owner)}ssaC(){this.faction="N",this.rarity="H",this.name="Spitesower Acolyte",this.iAttack=this.boof234,this.iHealth=this.lValN([8,14,22]),this.tribe.push("HM");const t=this.boof246n;this.text=`Activate, deal ${-t} damage to ${this.name}: Give a creature ${p.jr9(t,t)}.`,this.bonus={activ8:this.buffNug(-t,0)}}ssaT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","BB"],e}ssaA(t,e){const r=this.boof246n,s=R.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}.`,this.bonus={activ8:this.regnNug(this.level)}}swmT(t){const e=this.makeOtherCreatTarg(t);return e.canArmor=!0,e.hint=["BF","BB"],e}swmA(t,e){t.addArmor(this.level)}ucmC(){this.faction="T",this.rarity="R",this.name="Uranti Cryomancer",this.iAttack=this.boof247,this.iHealth=this.lValN([8,13,17]),this.tribe.push("IC","YT"),this.xl=!1;const t=this.boof135;this.text=`Activate: Deal ${t} damage to a creature.`,this.bonus={activ8:this.buffNug(0,t)}}ucmT(t){const e=this.makeCreatTarg(t);return e.hint=["HR"],e}ucmA(t,e){t.hurtDirect(this.boof135,this.code)}uimC(){this.faction="T",this.rarity="C",this.name="Uranti Icemage",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.lValN([8,13,20]),this.tribe.push("IC","YT"),this.text="Activate: Negate Defender this turn.",this.bonus={activ8:this.regnNug(1)}}uimT(t){const e=this.makeCreatTarg(t);return e.hint=["BB"],e}uimA(t,e){const r=y.mod("ND",!0);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");const t=this.level===3?this.iAttack:0;this.text=`Activate: Give a creature in a center lane ${p.jr9(this.iAttack,t)}.`,this.bonus={activ8:this.multNug(this.buffNug(this.iAttack,t),.5)}}warmT(t){const e=this.makeCreatTarg(t);return e.lanes=3,e.hint=["BF","BB"],e}warmA(t,e){t.buff(this.iAttack,this.level===3?this.iAttack:0)}wwrC(){this.faction="U",this.rarity="C",this.name="Weirwood Ranger",this.iAttack=this.boof51015,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.text=`Activate: Give another creature ${p.jr9(this.level,this.level)}.`,this.bonus={activ8:this.buffNug(this.level,this.level)}}wwrT(t){const e=this.makeOtherCreatTarg(t);return e.hint=["BF"],e}wwrA(t,e){t.buff(this.level,this.level)}wfsC(){this.faction="N",this.rarity="H",this.name="Witherfrost Succubus",this.iAttack=this.boof147,this.iHealth=this.boof61018,this.tribe.push("DM");const t=this.boof357;this.text=`Activate: Give a creature ${p.jr9(-t,-t)} this turn.`,this.bonus={activ8:this.buffNug(t,t)}}wfsT(t){const e=this.makeCreatTarg(t);return e.hint=["DB","DF"],e}wfsA(t,e){const r=-this.boof357,s=y.mod("AT",r);s.expiry="ET",t.addMod(s);const l=y.mod("HL",r);l.expiry="ET",t.addMod(l);const f=y.mod("MH",r);f.expiry="ET",t.addMod(f)}shambC(){this.faction="N",this.rarity="L",this.name="Xithian Shambler",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.xl=!1;let t="";this.level===3&&(t="~You may use this ability twice per turn."),this.text=`Activate, destroy an adjacent creature: ${this.name} moves into that creature's lane, then gets +attack and +health equal to that creature's attack and health.${t}`,this.bonus={activ8:this.rawNug(0,0,0,0,this.lValN([.6,1.2,2.2]))}}shambT(t){const e=y.crFriendActTarg("CARD",this.code,t.id);return e.lanes=t.adjacent,e}shambA(t,e){const r=t.attack,s=t.health;V.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 ${p.levelGateText(this.level,!0)}creature Mobility ${this.level}.`,this.bonus={activ8:this.regnNug(this.level)}}zpmT(t){const e=this.makeOtherCreatTarg(t);return e.level=D.ddf2(this.level),e.canMove=!0,e.hint=["BF","BB"],e}zpmA(t,e){t.addMobility(this.level)}}class ze 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=y.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");return s.interactive=!0,r}handleAction(t){const e=g.ddf6(t),r=g.jr5(t.param);this.targAction(this.cardCode(),e,r),T.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const e=D.toActions(this.playTarg);e.length>0?(e.forEach(r=>{r.param=t.creatId}),this.optional&&e.push(T.noneEndTrigger()),T.ddf5(e)):x.triggerDone()}aconC(){this.faction="N",this.rarity="R",this.name="Calamity Fiend",this.iAttack=this.boof4814,this.iHealth=this.lValN([5,10,16]),this.tribe.push("DM");const t=-this.boof234;this.addSp("U",t),this.playTarg.player="E",this.ftext=`Give an enemy creature ${p.jr9(t,t)}.`}aconF(t,e){this.logAct(!1,t);const 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=D.ddf2(this.level),this.optional=!0,this.ftext=`You may move an enemy ${p.levelGateText(this.level,!0)}creature to the space opposing ${this.name}.`}tbbF(t,e){e.opposed||(this.logAct(!1,t),t.move(g.oppositeLane(e.lane)))}}class 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)},["DRS"]:{c:()=>this.drsC(),f:(r,s)=>this.drsF(r,s)},["DSE"]:{c:()=>this.dseC(),f:(r,s)=>this.dseF(r,s)},["DSA"]:{c:()=>this.dsaC(),f:(r,s)=>this.dsaF(r,s)},["DGS"]:{c:()=>this.drslC(),f:(r,s)=>this.drslF(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)},["POA"]:{c:()=>this.poaC(),f:(r,s)=>this.poaF(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=y.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");s.interactive=!0}return r}ddf8(t){return Nt.extractCardCode(t.trigger.logicCode)==="CKB"}handleAction(t){const e=g.ddf6(t),r=g.jr5(t.param);this.targAction(this.cardCode(),e,r),T.actionDone(!0)}jr8(t){const e=this.cardCode();if(t.trigger.type==="TS"&&e==="CKB"){this.logAct(!1),E.regularPlays+=1;const s=t.event,l=k.toPlayer(s.playerA),f=y.trigIdx(l.triggers,t.trigger);f>-1&&l.triggers.splice(f,1),x.triggerDone();return}if(e==="ABM"){const s=y.crFriendNotMeTarg(t.creatId);if(s.tribe="AB",g.creatByTarget(s).length===0){x.triggerDone();return}}if(e==="POA"&&!E.patron("A")){x.triggerDone();return}if((e==="DRS"||e==="DSE"||e==="DSA")&&this.dfbuff(t.creatId)===0){x.triggerDone();return}this.notme&&(this.playTarg.notMe=t.creatId);const r=D.toActions(this.playTarg);r.length>0?(r.forEach(s=>{s.param=t.creatId}),this.optional&&r.push(T.noneEndTrigger()),T.ddf5(r)):x.triggerDone()}dfbuff(t){const e=y.crFriendNotMeTarg(t);return e.tribe="DF",this.boof234*g.creatByTarget(e).length}mawC(){this.faction="N",this.rarity="C",this.name="Abyssal Maw",this.iAttack=this.boof4610,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=-this.boof359;this.ftext=`If there is another friendly Abomination, give an enemy creature ${p.jr9(t,t)}.`}mawF(t,e){this.logAct(!1,t);const 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 ${p.jr9(-this.iAttack,0)}.`}binvF(t,e){this.logAct(!1,t),t.buff(-this.iAttack,0)}bsrC(){if(this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.iAttack=this.boof5813,this.iHealth=this.boof3712,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.playTarg.level=D.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy an enemy ${p.levelGateText(t,!0)}creature.`,this.optional=!0}else this.hints=["LG"]}bsrF(t,e){V.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=y.mod("BT",!0);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=D.ddf2(this.level),this.playTarg.player="E",this.ftext=`Destroy an enemy ${p.levelGateText(this.level,!0)}creature. If you do, the enemy player may play an additional card next turn.`,this.optional=!0}cacF(t,e){V.destroy(t,this.code);const r=k.toPlayer(t.owner),s=y.trigger("TS",this.code);s.bonus=this.avgSpawnNug(),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.hints=[this.lValH(["ZZ-1","ZZ-2","ZZ-5"])],this.playTarg.player="F",this.ftext="Destroy a friendly creature."}ccF(t,e){V.destroy(t,this.code)}drsC(){this.faction="U",this.rarity="C",this.name="Darkroot Shambler",this.iHealth=this.lValN([2,6,7]),this.iAttack=this.iHealth*2,this.tribe.push("DF","PL"),this.level===2&&(this.hints=["LB"]),this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature ${p.jr9(0,t)} for each other friendly Darkforged.`}drsF(t,e){this.logAct(!1,t),t.buff(0,this.dfbuff(e.id))}dseC(){this.faction="A",this.rarity="C",this.name="Darksteel Enforcer",this.iAttack=this.boof468,this.iHealth=this.iAttack+2,this.tribe.push("DF","RB"),this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature ${p.jr9(t,0)} for each other friendly Darkforged.`}dseF(t,e){this.logAct(!1,t),t.buff(this.dfbuff(e.id),0)}dsaC(){this.faction="T",this.rarity="C",this.name="Darkstone Asir",this.iAttack=this.lValN([2,4,10]),this.iHealth=this.iAttack*2,this.tribe.push("DF","AS"),this.playTarg.player="E";const t=this.boof234;this.ftext=`Deal ${t} damage to an enemy creature for each other friendly Darkforged.`}dsaF(t,e){t.hurtDirect(this.dfbuff(e.id),this.code)}drslC(){this.faction="U",this.rarity="H",this.name="Dragon Slayer",this.iAttack=this.boof81220,this.iHealth=this.boof4610,this.tribe.push("HM"),this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level),this.playTarg.tribe="DG",this.ftext=`Destroy an enemy ${p.levelGateText(this.level,!0)}Dragon.`}drslF(t,e){V.destroy(t,this.code)}friC(){this.faction="T",this.rarity="C",this.name="Flamerift Instigator",this.iAttack=this.lValN([7,12,17]),this.iHealth=this.iAttack-5,this.tribe.push("GT"),this.ftext="Negate Defender from a creature."}friF(t,e){this.logAct(!1,t),t.negateDefender=!0}freavC(){if(this.faction="N",this.rarity="H",this.name="Fleshreaver",this.iAttack=this.boof6915,this.iHealth=this.boof235,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.consistent=!0,this.playTarg.level=D.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy a ${p.levelGateText(t)} enemy creature.`,this.optional=!0}else this.hints=["LG"]}freavF(t,e){V.destroy(t,this.code)}get fiendBof(){return this.lValN([-1,-2,-5])}gfiendC(){this.faction="N",this.rarity="C",this.name="Gloomfiend",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.playTarg.player="E";const t=this.fiendBof;this.ftext=`You may give an enemy creature ${p.jr9(t,t)}.`,this.optional=!0}gfiendF(t,e){this.logAct(!1,t);const 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){V.destroy(t,this.code)}grhC(){this.faction="U",this.rarity="C",this.name="Grove Huntress",this.iAttack=this.boof4711,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.playTarg.player="F";const t=this.boof135;this.ftext=`Give a friendly creature ${p.jr9(t,t)}.`}grhF(t,e){this.logAct(!1,t);const 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 ${p.jr9(t,0)}.`}mtxF(t,e){this.logAct(!1,t),t.buff(this.boof3510,0)}ngbC(){this.faction="T",this.rarity="C",this.name="Nargath Bruiser",this.iAttack=this.boof5814,this.iHealth=this.iAttack-1,this.tribe.push("ER","AS");const t=this.boof248;this.playTarg.player="F",this.ftext=`Give a friendly creature ${p.jr9(0,t)}.`}ngbF(t,e){this.logAct(!1,t),t.buff(0,this.boof248)}poaC(){this.faction="A",this.rarity="H",this.name="Patron of Anvillon",this.iAttack=this.boof369,this.iHealth=this.boof71117,this.tribe.push("CY"),this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["BF"],this.ftext=`If you have three or more Alloyin cards in your hand, give a ${p.levelGateText(this.level,!0)}creature 2x attack.`}poaF(t,e){this.logAct(!1,t),t.buff(t.attack,0)}phxsC(){this.faction="A",this.rarity="R",this.name="Phalanx Squadron",this.iAttack=this.boof3714,this.iHealth=this.boof61117,this.tribe.push("HM"),this.playTarg.hasArmor=!0,this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature with Armor ${p.jr9(t,t)}.`}phxsF(t,e){this.logAct(!1,t);const 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){V.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=D.ddf2(this.level),this.notme=!0,this.ftext=`You may destroy another friendly ${p.levelGateText(this.level,!0)}creature. If you do, spawn a copy of it.`}surzF(t,e){const r=R.tick();V.destroy(t,this.code,r),g.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=D.ddf2(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${p.levelGateText(this.level,!0)}enemy creature with Defender.`,this.optional=!0}wbyF(t,e){V.destroy(t,this.code)}wbuC(){this.faction="T",this.rarity="C",this.name="Warbringer Uranti",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("LT","YT");const t=this.boof4812;this.notme=!0,this.playTarg.player="F",this.addSp("A",t),this.ftext=`Give another friendly creature ${p.jr9(t,0)} this turn.`}wbuF(t,e){this.logAct(!1,t);const r=y.mod("AT",this.boof4812);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 ${p.jr9(-4,-4)}.`}dogsF(t,e){this.logAct(!1,t),t.buff(-4,-4)}}class L extends kt{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)},["BBR"]:{c:()=>this.bbrC(),z:r=>this.bbrZ(r)},["BBD"]:{c:()=>this.bbdC(),z:r=>this.bbdZ(r)},["BBL"]:{c:()=>this.bblC(),z:r=>this.bblZ(r)},["BBN"]:{c:()=>this.bbnC(),z:r=>this.bbnZ(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)},["DYF"]:{c:()=>this.dyinC(),z:r=>this.dyinZ(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)},["NDY"]:{c:()=>this.ntdcC(),z:r=>this.ntdcZ(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)},["PMP"]:{c:()=>this.pummC(),z:r=>this.pummZ(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)},["SPG"]:{c:()=>this.spgrC(),z:r=>this.spgrZ(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)},["VSP"]:{c:()=>this.vrdsC(),z:r=>this.vrdsZ(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=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.cardCode()==="NSL"&&g.creatByTarget(y.crFriendTarg()).length<5||t.push(this.playTarg),t}handleAction(t){const e=g.ddf6(t);this.logSpell(this.xl?e:void 0),this.cardCast(this.cardCode(),e),T.spellCast()}ddf8(t){const e=Nt.extractCardCode(t.trigger.logicCode);if(e==="TOB"&&t.trigger.type==="DM"){const r=$.toDamage(t.event);if(r.battle&&r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId)return this.level===3?!0:G.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=$.toEnterField(t.event);return t.trigger.creatId!==r.creature.id&&r.creature.owner===t.owner}else{if(e==="SPG"&&t.trigger.type==="TS")return t.event.playerA===t.owner;if(e==="FVA"&&t.trigger.type==="FK"||(e==="ROG"||e==="NDY")&&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=Nt.extractCardCode(t.trigger.logicCode);if(e==="TOB"){const r=t.event,s=g.jr5(r.target);s.status==="A"&&V.destroy(s,this.code)}else if(e==="FVA"){const r=g.jr5(t.creatId),s=g.searchByLane(g.oppositeLane(r.lane),!r.owner);s&&s.hurtDirect(this.boof3612,r.code)}else if(e==="FZS"||e==="IFR"&&t.trigger.type==="DM"){const r=g.jr5(t.creatId);r.status==="A"&&V.destroy(r,this.code)}else if(e==="ROG"||e==="DYB"||e==="ABL"){const r=g.jr5(t.creatId);this.logAct(!1,r),r.buff(this.level,this.level)}else if(e==="SHG"){if(t.trigger.type==="VN"){const r=t.event,s=g.jr5(r.creatId);g.birth(s.code,"S",t.owner)}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,s=g.jr5(t.creatId);s.triggers.filter(f=>f.customCode===r).forEach(f=>s.removeTrigger(f))}}else if(e==="IFR"&&t.trigger.type==="PT"){const r=S.deTil(t.trigger.customCode),s=r[1],l=g.jr5(t.creatId);if(r[0]==="P2"){const f=y.trigIdx(l.triggers,t.trigger);l.triggers[f].customCode=S.enTil("P1",s)}else{const f=l.triggers.find(m=>m.customCode===s);f&&l.removeTrigger(f),l.removeTrigger(t.trigger)}}else if(e==="OEX"){if(t.trigger.type==="DM"){const r=t.event,s=g.qEnemyCreats(),l=s.length,f=R.tick();let m;l>0&&(this.level===1?m=[s[S.randInt(0,l)]]:this.level===2?(m=s.splice(S.randInt(0,l),1),s.length>0&&m.push(s[S.randInt(0,l-1)])):m=s,m.forEach(A=>A.hurtDirect(r.dmg,this.code,f)))}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,s=g.jr5(t.creatId);s.triggers.filter(f=>f.customCode===r).forEach(f=>s.removeTrigger(f))}}else if(e==="VOB"){const r=$.toDamage(t.event);r.srcCreat.hurtDirect(r.dmg,this.code)}else if(e==="NDY"){const r=g.jr5(t.creatId);if(r.status==="A"){const s=this.ndcbuf;this.logAct(!1,r),r.buff(s,s)}}else if(e==="SPG"){const r=g.jr5(t.creatId),s=this.boof246;this.logAct(!1,r),r.buff(s,s)}else super.jr8(t);x.triggerDone()}rankT(){return`If you are rank ${this.level+1} or higher`}awingC(){this.faction="A",this.rarity="R",this.name="Aegis Wings",this.text=`Give a creature ${p.jr9(this.boof369,0)}. Then if that creature has the highest attack, it also gets Mobility 1 and Armor ${this.boof246}.`,this.playTarg.hint=["BF"]}awingZ(t){t.buff(this.boof369,0);const e=t.attack;g.qActiveCreats().every(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=["LG"]),this.playTarg.canMove=!0,this.playTarg.hint=["BF"],this.text=`Give a creature Mobility ${this.level}.`}asurgeZ(t){t.addMobility(this.level)}anatC(){this.faction="A",this.rarity="C",this.name="Anatomize",this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(-this.boof4816,0)}.~You may play an additional ${this.name} this turn.`}anatZ(t){t.buff(-this.boof4816,0);const e=E.freeCard(this.code);e.condition.cardCode="ATZ"}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${p.jr9(0,this.boof51015)}.`,this.playTarg.hint=["BF"]}aqatZ(t){t.buff(0,this.boof51015)}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${p.dbdtap()}, it gets ${p.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}ablZ(t){t.changed=!0;const e=t.jr4("DM",this.code);e.bonus=this.buffNug(this.level,this.level)}bftC(){this.faction="N",this.rarity="C",this.name="Bitterfrost Totem";const t=this.boof4812n;this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(t,t)}. ${this.rankT()}, it gets an additional ${p.jr9(-2,-2)}.`}bftZ(t){const e=this.boof4812n-(k.getActive().rank>this.level?2:0);t.buff(e,e)}blod(){return E.deathsA.length>0||E.deathsB.length>0}bbrC(){this.faction="A",this.rarity="C",this.name="Blood Barrier";const t=this.boof234;this.text=`Give a creature Armor ${t}.~If a creature was destroyed this turn, it gets an additional Armor ${t}.`,this.playTarg.hint=["BF"],this.playTarg.canArmor=!0}bbrZ(t){const e=this.boof234;t.addArmor(e),this.blod()&&t.addArmor(e)}bbdC(){this.faction="N",this.rarity="C",this.name="Blood Bindings";const t=this.boof369n,e=p.jr9(t,t);this.text=`Give a creature ${e}.~If a creature was destroyed this turn, it gets an additional ${e}.`,this.playTarg.hint=["DB"]}bbdZ(t){const e=this.boof369n;t.buff(e,e),this.blod()&&t.buff(e,e)}bblC(){this.faction="T",this.rarity="C",this.name="Blood Boil";const t=this.lValN([5,6,10]);this.text=`Deal ${t} damage to a creature.~If a creature was destroyed this turn, deal an additional ${t} damage to that creature.`,this.playTarg.hint=["HR"]}bblZ(t){const e=this.lValN([5,6,10]),r=R.tick();t.hurtDirect(e,this.code,r),this.blod()&&t.hurtDirect(e,this.code,r)}bbnC(){this.faction="U",this.rarity="C",this.name="Blood Boon";const t=this.lValN([3,4,7]),e=p.jr9(t,t);this.text=`Give a creature ${e}.~If a creature was destroyed this turn, it gets an additional ${e}.`,this.playTarg.hint=["BF"]}bbnZ(t){const e=this.lValN([3,4,7]);t.buff(e,e),this.blod()&&t.buff(e,e)}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.xl=!1,this.text=`Replace an enemy ${p.levelGateText(this.level,!0)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level)}botZ(t){g.birth(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof123n;this.text=`Give a creature ${p.jr9(t,t)}.`,this.playTarg.hint=["DB"]}csurgeZ(t){const e=this.boof123n;t.buff(e,e)}ctmsC(){this.faction="A",this.rarity="R",this.name="Countermeasure";const t=this.boof4816;this.text=`Give an enemy creature ${p.jr9(-t,0)}, or give a friendly creature ${p.jr9(t,0)}.`}ctmsZ(t){const e=this.boof4816;t.owner===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){V.destroy(t,this.code)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate",this.xl=!1;const t=G.getCard(Z.tffc(this.level));this.text=`Replace a friendly Plant with a ${p.tokName(t)}.`,this.playTarg.player="F",this.playTarg.tribe="PL"}cultZ(t){g.birth(Z.tffc(this.level),"R",t.owner,t.lane)}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof246;this.text=`Give a creature in a center lane ${p.jr9(t,t)}.`,this.playTarg.lanes=3,this.playTarg.hint=["BF"]}cypaZ(t){const e=this.boof246;t.buff(e,e)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${p.jr9(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.hint=["BF"],this.playTarg.faction="A"}cypbZ(t){t.buff(this.boof51015,0),t.addArmor(this.boof124)}dendC(){this.faction="U",this.rarity="R",this.name="Dendrify",this.xl=!1,this.level===3&&(this.isFree=!0,this.overload=!0),this.text=`Replace a ${p.levelGateText(this.level+1,!0)}creature with a 7/7 Treefolk.`,this.playTarg.level=D.ddf2(this.level+1)}dendZ(t){g.birth(`${"SXT"}${this.level}`,"R",t.owner,t.lane)}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.xl=!1,this.hints=["LG"],this.text=`Destroy a ${p.levelGateText(this.level,!0)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"]}dreadZ(t){V.destroy(t,this.code)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${p.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${p.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}drybZ(t){t.buff(this.level,this.level),t.changed=!0;const e=t.jr4("EF",this.code);e.bonus=this.buffNug(this.level,this.level)}dyinC(){this.faction="U",this.rarity="T",this.name="Dysian Infusion",this.playTarg.hint=["BF"];const t=this.boof135,e=this.boof4710;this.text=`Give a creature ${p.jr9(e,e)} and Regenerate ${t}.`}dyinZ(t){const e=this.boof4710;t.buff(e,e),t.addRegen(this.boof135)}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.isFree=this.level===3,this.text=`Give a ${p.levelGateText(this.level,!0)}creature Defender.`,this.playTarg.canDefender=!0,this.playTarg.level=D.ddf2(this.level)}enpZ(t){t.defender=!0}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${p.jr9(-this.boof51015,0)}.`,this.playTarg.hint=["DB"]}elnZ(t){t.buff(-this.boof51015,0)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${p.jr9(t,t)}.`,this.playTarg.hint=["BF"]}rageZ(t){const e=this.boof3612;t.buff(e,e)}efauC(){this.faction="T",this.rarity="R",this.name="Everflame Aura",this.text=`Deal ${this.level+6} damage to an enemy creature, or give a friendly creature Mobility ${this.level}.`}efauZ(t){t.owner===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 ${p.levelGateText(this.level+1,!0)}creature.~Deal damage equal to its attack to the enemy player.${this.level===3?"~You gain that much health.":""}`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F"}expdmZ(t){const e=t.attack;V.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 ${p.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"]}feralZ(t){const e=this.fiboof;t.breakthrough=!0,t.buff(e,e)}fervassC(){this.faction="T",this.rarity="H",this.name="Fervent Assault",this.playTarg.player="F",this.text=`Give a friendly creature Mobility ${this.level} and "Flank: Deal ${this.boof3612} damage to the opposing creature.`}fervassZ(t){t.changed=!0,t.addMobility(this.level);const e=t.jr4("FK",this.code);e.bonus=this.buffNug(this.boof3612,0)}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=y.mod("AR",this.boof51020);e.expiry="ET",t.addMod(e)}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"],this.text=`Give a ${p.levelGateText(this.level,!0)}creature "When this is dealt damage, destroy it".`}frozZ(t){t.changed=!0;const e=t.jr4("DM",this.code);e.bonus=this.avgSpawnNug()}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${p.jr9(t,t)}.`,this.playTarg.hint=["DB"]}ghastZ(t){const e=-this.boof3612;t.buff(e,e)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.xl=!1,this.isFree=this.level>1,this.isFree||(this.hints=["LG"]),this.playTarg.player="E",this.playTarg.hasDefender=!0,this.text=`Destroy an enemy creature with Defender.${this.level===3?" Deal damage equal to its health to the enemy player.":""}`}crushZ(t){const e=t.health;V.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 ${p.jr9(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}izftC(){this.faction="T",this.rarity="T",this.name="Iztek's Frost",this.isFree=this.level===3,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hint=["KL"],this.text=`Until the end of the next turn, give a ${p.levelGateText(this.level+1,!0)}creature "When this is dealt damage, destroy it".`}izftZ(t){const e=R.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=e,r.bonus=this.avgSpawnNug();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 ${p.jr9(this.boof369,0)} and Mobility 1.`}jpZ(t){t.buff(this.boof369,0),t.addMobility(1)}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hint=["BF"],this.text=`Give a ${p.levelGateText(this.level+1)}creature ${p.jr9(this.boof124,0)} and Aggressive this turn.`}lbrandZ(t){const e=y.mod("AT",this.boof124),r=y.mod("AG",!0);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 ${p.jr9(6,6)}.`}shartZ(t){t.buff(6,6)}morphC(){this.faction="U",this.rarity="H",this.name="Metamorphosis",this.xl=!1,this.text=`Replace a ${p.levelGateText(this.level,!0)}creature with a 0/3 Feywing Chrysalis.`,this.playTarg.level=D.ddf2(this.level)}morphZ(t){g.birth(`${"FWC"}1`,"R",t.owner,t.lane)}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.level===3?this.isFree=!0:this.hints=["LG"],this.playTarg.level=D.ddf2(this.level+1),this.text=`Remove all abilities from a ${p.levelGateText(this.level+1,!0)}creature.`,this.playTarg.hint=["DB"]}sculptZ(t){t.wipeAll()}nanoC(){this.faction="A",this.rarity="R",this.name="Nanoswarm",this.playTarg.level=D.ddf2(this.level),this.text=`Give a ${p.levelGateText(this.level,!0)}creature ${p.jr9(-this.boof51015,0)} and remove all abilities from it.`,this.playTarg.hint=["DB"]}nanoZ(t){t.buff(-this.boof51015,0),t.wipeAll()}natselC(){this.faction="U",this.rarity="R",this.name="Natural Selection",this.xl=!1,this.text=`If there is a friendly creature in each lane, destroy a ${p.levelGateText(this.level,!0)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"]}natselZ(t){V.destroy(t,this.code)}nflayC(){this.faction="N",this.rarity="C",this.name="Necroflay";const t=-this.boof3711;this.text=`Give a creature ${p.jr9(t,t)}.~You may play an additional ${this.name} this turn.`,this.playTarg.hint=["DB"]}nflayZ(t){const e=-this.boof3711;t.buff(e,e);const r=E.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)}ntdcC(){this.faction="N",this.rarity="R",this.name="Nether Decay";const t=this.ndcbuf;this.text=`Give a creature "When a creature is destroyed, this gets ${p.jr9(t,t)}."`,this.playTarg.hint=["DB"]}ntdcZ(t){t.changed=!0;const e=t.jr4("DS",this.code),r=this.ndcbuf;e.bonus=this.buffNug(r,r)}get ndcbuf(){return-4-this.level}oexpC(){this.faction="A",this.rarity="H",this.name="Oratek Explosives",this.playTarg.player="F";const t=this.lValS(["an enemy creature at random","up to two enemy creatures at random","each enemy creature"]);this.text=`Give a friendly creature ${p.jr9(5,0)}.~Allied Tempys: This turn, when that creature ${p.dbdtap()}, deal that much damage to ${t}.`}oexpZ(t){if(t.buff(5,0),E.allied("T")){const e=R.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=e;const s=t.jr4("PT",this.code);s.customCode=e}}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=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.level,this.level)}.`}psurgeZ(t){t.buff(this.level,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.boof71116,0)} this turn.`}pslamZ(t){const e=y.mod("AT",this.boof71116);e.expiry="ET",t.addMod(e)}pummC(){this.faction="A",this.rarity="R",this.name="Pummel Pack";const t=this.boof236,e=`${p.jr9(t,0)} and Armor ${t}.`;this.text=`Give a friendly creature ${e}~If it is the only friendly creature, it gets an additional ${e}`,this.playTarg.player="F"}pummZ(t){const e=this.boof236;t.buff(e,0),t.addArmor(e),g.ddf1().length===1&&(t.buff(e,0),t.addArmor(e))}rotgC(){this.faction="N",this.rarity="H",this.name="Rite of the Grimgaunt",this.playTarg.hint=["BF"],this.text=`Give a creature "When a creature is destroyed, this gets ${p.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0;const e=t.jr4("DS",this.code);e.bonus=this.buffNug(this.level,this.level)}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=D.ddf2(this.level),this.text=`Reduce a ${p.levelGateText(this.level,!0)}creature's attack to 0.`,this.playTarg.hint=["DB"]}sapZ(t){t.buff(-t.attack,0)}soathC(){this.faction="U",this.rarity="C",this.name="Savage Oath",this.level===1&&(this.hints=["LG"]);const t=this.saboof;this.text=`Give an Uterra creature ${p.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"],this.playTarg.faction="U"}soathZ(t){const e=this.saboof;t.buff(e,e),t.breakthrough=!0}get saboof(){return this.lValN([2,6,15])}scythC(){this.faction="N",this.rarity="L",this.name="Scythe of Chiron";const t=this.boof246;this.playTarg.player="F",this.text=`Each enemy creature gets ${p.jr9(-t,0)}. Give a friendly creature ${p.jr9(t,0)} for each enemy creature.`}scythZ(t){const e=-this.boof246,r=g.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=["LG"]:this.consistent=!0,this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.ubzap,0)}.`}soaZ(t){t.buff(this.ubzap,0)}sodC(){this.faction="U",this.rarity="C",this.name="Seal of Deepwood",this.level===1?this.hints=["LG"]:this.consistent=!0;const t=this.derpboof;this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(t,t)}.`}sodZ(t){const e=this.derpboof;t.buff(e,e)}get derpboof(){return this.lValN([1,6,12])}sotC(){this.faction="N",this.rarity="C",this.name="Seal of Tarsus",this.level===1?this.hints=["LG"]:this.consistent=!0;const t=this.tars;this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(t,t)}.`}sotZ(t){const e=this.tars;t.buff(e,e)}get tars(){return this.lValN([-2,-8,-16])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.isFree=this.level===3,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F",this.text=`Give a ${p.levelGateText(this.level+1,!0)}friendly creature "Vengeance: Spawn this" this turn.`}shgrZ(t){const e=R.genId(),r=t.jr4("VN",this.code);r.customCode=e,r.changes=!0;const s=t.jr4("PT",this.code);s.customCode=e}spgrC(){this.faction="U",this.rarity="R",this.name="Shardplate Graft";const t=this.boof246;this.text=`Give a creature ${p.jr9(t,t,!0)}, and "At the start of your turn, this gets ${p.jr9(t,t)}."`,this.playTarg.hint=["BF"]}spgrZ(t){const e=this.boof246;t.buff(e,e),t.changed=!0;const r=t.jr4("TS",this.code);r.bonus=this.buffNug(e,e)}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){const e=this.level*g.ddf1().length;t.buff(e,e)}get snbboof(){return-1*(this.level+7)}snbC(){this.faction="A",this.rarity="C",this.name="Sonic Burst",this.playTarg.hint=["DB"],this.text=`Give a creature ${p.jr9(this.snbboof,0)}.`}snbZ(t){t.buff(this.snbboof,0)}sharvC(){this.faction="N",this.rarity="H",this.name="Soul Harvest",this.xl=!1;const t=this.lValS(["an additional level 1 card","an additional card","two additional cards"]);this.text=`Destroy a friendly creature. You may play ${t} this turn.`,this.playTarg.player="F"}sharvZ(t){if(V.destroy(t,this.code),this.level===1){const e=E.freeCard(this.code);e.condition.level=D.ddf2(1)}else E.regularPlays+=this.level-1}sreapC(){this.faction="N",this.rarity="L",this.name="Soulreap",this.xl=!1;const t=this.boof248;this.text=`Destroy an enemy creature with ${t} or less attack. Then Spawn a copy of it.`,this.playTarg.player="E",this.playTarg.maxAttack=t}sreapZ(t){V.destroy(t,this.code),g.birth(t.code,"S",!t.owner)}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.text=`Give a creature Regenerate ${this.boof234}.`,this.playTarg.hint=["BF"],this.playTarg.canRegen=!0}sttorZ(t){t.addRegen(this.boof234)}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.text=`Give a creature Poison ${this.boof234}.`,this.playTarg.hint=["PN"]}sptorZ(t){t.addPoison(this.boof234)}sovC(){this.faction="T",this.rarity="L",this.name="Staff of Vaerus",this.text=`Give a friendly ${p.levelGateText(this.level+1,!0)}creature Mobility ${this.level}. That creature battles an additional time this turn.`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F"}sovZ(t){t.extraBattles+=1,t.addMobility(this.level)}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${p.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hint=["BF"],this.playTarg.hasDefender=!0}stbrnZ(t){const e=this.boof579;t.buff(e,e),t.negateDefender=!0}ssperC(){this.faction="T",this.rarity="C",this.name="Stormspear",this.xl=!1,this.playTarg.hint=["HR"],this.text=`Deal ${this.sspb} to a creature.~You may play an additional ${this.name} this turn.`}ssperZ(t){t.hurtDirect(this.sspb,this.code);const e=E.freeCard(this.code);e.condition.cardCode="STP"}get sspb(){return this.lValN([3,8,12])}tanglC(){this.faction="U",this.rarity="R",this.name="Tangle",this.xl=!1;let t="";this.level===3?t=" You gain health equal to that creature's attack.":this.playTarg.hint=["KL"],this.text=`Destroy a ${p.levelGateText(this.level+1,!0)}creature with Mobility.${t}`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hasMobility=!0}tanglZ(t){V.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 ${p.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.hint=["BF"],this.playTarg.faction="N"}tpactZ(t){const e=this.boof235;t.buff(e,e),t.addRegen(e)}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.playTarg.hint=["BF"],this.text=`Give a Robot ${p.jr9(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),t.buff(this.boof4612,0)}totsC(){this.faction="N",this.rarity="T",this.name="Tendrils Of Twilight",this.isFree=!0;const t=-this.boof7911;this.text=`Give an enemy creature ${p.jr9(-1,-1)}.~If that creature is opposing a friendly Duskmaw, give that creature ${p.jr9(t,t)} instead.`,this.playTarg.player="E"}totsZ(t){const e=this.duskBof(t);t.buff(e,e)}duskBof(t){const e=t.opposed;let r=!1;return e&&(r=Nt.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 ${p.dbdtac(this.level)}, destroy that creature."`,this.playTarg.hint=["BF"]}blightZ(t){t.changed=!0;const e=t.jr4("DM",this.code);e.bonus=this.avgSpawnNug()}txbnC(){this.faction="U",this.rarity="R",this.name="Toxic Boon";const t=this.boof357;this.text=`Give an enemy creature Poison ${t}, or give a friendly creature ${p.jr9(t,t)}.`}txbnZ(t){const e=this.boof357;t.owner===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 ${p.jr9(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T",this.playTarg.hint=["BF"]}tremcZ(t){t.buff(0,this.boof4812),t.addMobility(this.level)}uboltC(){this.faction="T",this.rarity="R",this.name="Uranti Bolt",this.xl=!1,this.text=`Deal ${this.ubzap} damage to a creature.~It gets Defender until the end of the next turn.`}uboltZ(t){t.hurtDirect(this.ubzap,this.code);const e=y.mod("DF",!0);e.expiry="EN",t.addMod(e)}get ubzap(){return this.lValN([3,10,20])}urstC(){this.faction="U",this.rarity="C",this.name="Ursine Strength";const t=this.boof3711;this.playTarg.hint=["BF"],this.text=`Give a creature ${p.jr9(t,t)}. ${this.rankT()}, it gets an additional ${p.jr9(2,2)}.`}urstZ(t){const e=this.boof3711+(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=E.freeCard(this.code);e.condition.cardCode="VSK"}vgraC(){this.faction="U",this.rarity="C",this.name="Verdant Grace",this.playTarg.player="F",this.text=`Heal ${this.boof101520} damage from a friendly creature and ${this.boof246} health from each other friendly creature.`}vgraZ(t){t.heal(this.boof101520);const e=this.boof246;g.creatByTarget(y.crFriendNotMeTarg(t.id)).forEach(r=>{r.heal(e)})}vrdsC(){this.faction="U",this.rarity="C",this.name="Verdant Sphere";const t=this.boof5812;this.text=`Give a creature ${p.jr9(0,t)} and you gain ${t} health.`,this.playTarg.hint=["BF"]}vrdsZ(t){const e=this.boof5812;t.buff(0,e),k.heal(k.getActive(),e)}vglchC(){this.faction="N",this.rarity="R",this.name="Vigor Leech";const t=this.boof369n;this.text=`Give an enemy creature ${p.jr9(t,t)}, or give a friendly creature Regenerate ${-t}.`}vglchZ(t){const e=this.boof369n;t.owner===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=["LG"],this.text=`Give a ${p.levelGateText(this.level+1,!0)}creature Aggressive and, "When this creature ${p.dbdtap()}, it also deals that much damage to itself."`}vobZ(t){t.aggressive=!0,t.changed=!0,t.jr4("DM",this.code)}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace",this.playTarg.hint=["DB"];const t=this.boof468,e=-t;this.text=`Give a creature ${p.jr9(e,e)}.~You gain ${t} health.`}vembZ(t){const e=this.boof468,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 ${p.levelGateText(e,!0)}creature ${t}x attack.`}warZ(t){const e=this.level===3?2:1;t.buff(t.attack*e,0)}xwillC(){this.faction="N",this.rarity="H",this.name="Xrath's Will",this.xl=!1;const t=this.boof3612;this.text=`Destroy an enemy creature with ${t} or less attack.~You may play an additional Zombie this turn.`,this.playTarg.player="E",this.playTarg.maxAttack=t}xwillZ(t){V.destroy(t,this.code);const e=E.freeCard(this.code);e.condition.tribe="ZB"}}class Xi extends P{constructor(t){super(t),this.faction="T",this.rarity="T",this.name="Cryophoenix",this.iAttack=this.boof3711,this.iHealth=this.iAttack+3,this.iMobile=this.lValN([0,0,1]),this.tribe.push("PX"),this.text=`When ${this.name} enters play or moves, deal damage equal to its attack to the opposing creature.~If there is no opposing creature, deal that damage to the enemy player instead.`}image(t){return this.rawImage(`${"PHC"}${this.level}`,t)}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FK");return s.bonus=this.playerNug(this.iAttack),r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const r=$.toCreature(t.event).creature,s=r.opposed;s?s.hurtDirect(r.attack,this.code):k.hurtDirect(!r.owner,r.attack,this.code),x.triggerDone()}}class fe extends P{lookup(t){return{["ATP"]:{c:()=>this.phagC(),t:()=>this.phagT(),f:(r,s)=>this.hdiscardF(r,s)},["PLI"]:{c:()=>this.pimpC(),t:()=>this.pimpT(),f:(r,s)=>this.hdiscardF(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)},["VIN"]:{c:()=>this.vintC(),t:()=>this.vintT(),f:(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");return s.interactive=!0,r}handleAction(t){const e=g.jr5(t.param);this.forgAction(this.cardCode(),t.position,e),At.popMode(),T.actionDone(!0)}jr8(t){const e=this.cardCode()==="VIN";if(e&&R.aiActive)x.triggerDone();else{const r=this.forgTargets(this.cardCode());if(r.length>0){let s;if(e?s=[]:s=r.map(l=>{const f=y.deckSelectAction("CARD",l.cardCode,l.sourceIdx);return f.param=t.creatId,f.host=this.code,f}),this.optional){const l=T.noneEndTrigger();l.param="PM",s.push(l)}Dt.showCustomDeck(r,s)}else x.triggerDone()}}hdiscardF(t,e){const r=k.toPlayer(!e.owner),s=r.hand[t];r.hand.splice(t,1),r.discard.push(s)}phagC(){this.faction="U",this.rarity="H",this.name="Aetherphage",this.iAttack=this.lValN([7,10,16]),this.iHealth=this.boof3612,this.tribe.push("IN"),this.ftext=`Look at the ${p.levelGateText(this.level,!0)}spells in the enemy player's hand and choose one. The enemy player discards the chosen spell.`}phagT(){const t=k.toPlayer(!k.getActiveB()),e=y.target("TH");return e.player=k.toTarget(t),e.level=D.ddf2(this.level),e.card="S",Dt.generateContent(t.hand,!1,e)}pimpC(){this.faction="N",this.rarity="R",this.name="Plunder Imp",this.iAttack=this.boof61016,this.iHealth=this.iAttack-1,this.tribe.push("DM");const t=this.boof369;this.ftext=`Look at the creatures with ${t} or less attack in the enemy player's hand and choose one. The enemy player discards the chosen creature.`}pimpT(){const t=k.toPlayer(!k.getActiveB()),e=y.target("TH");return e.player=k.toTarget(t),e.maxAttack=this.boof369,e.card="C",Dt.generateContent(t.hand,!1,e)}sshmC(){this.faction="U",this.rarity="H",this.name="Soothsayer Hermit",this.iAttack=this.boof61016,this.iHealth=this.iAttack-1,this.tribe.push("LP");let t="";this.level===3?t="level 3 or lower":t=p.levelGateText(this.level),this.ftext=`You may put a ${t} creature from your discard pile into your hand.`}sshmT(){const t=k.getActive(),e=y.target("TD");return e.player=k.toTarget(t),e.card="C",this.level===3?e.level="HR":e.level=D.ddf2(this.level),Dt.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=y.target("TD");return e.player=k.toTarget(t),e.faction="N",Dt.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 ${p.jr9(t,t)}.`}grootT(){const t=k.getActive(),e=y.target("TD");return e.player=k.toTarget(t),e.tribe="PL",Dt.generateContent(t.discard,!1,e)}grootF(t,e){k.toPlayer(e.owner).discard.splice(t,1);const s=this.boof358;e.buff(s,s)}vintC(){this.faction="A",this.rarity="C",this.name="Vault Intruder",this.iAttack=this.lValN([7,12,18]),this.iHealth=this.boof5914,this.tribe.push("RB"),this.ftext="Look at the enemy player's hand."}vintT(){const t=k.toPlayer(!k.getActiveB()),e=y.target("TH");return e.player=k.toTarget(t),Dt.generateContent(t.hand,!1,e)}}class qi extends P{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Darkheart Conjurer",this.iAttack=this.boof4813,this.iHealth=this.boof71116,this.tribe.push("HM"),this.text=`When you play a spell, give a friendly creature Regenerate ${this.boof135}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC");return s.interactive=!0,s.bonus=this.regnNug(this.boof135),r}handleAction(t){const e=g.ddf6(t);this.logAct(!1,e),e.addRegen(this.boof135),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&G.getCard(t.event.cardCode).type==="S"}jr8(t){const e=y.crFriendActTarg("CARD",this.code,"");e.canRegen=!0;const r=D.toActions(e);r.length===0?x.triggerDone():(r.push(T.noneEndTrigger()),T.ddf5(r))}}class ji extends ft{jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),r}jr8(t){g.qEnemyCreats().forEach(e=>{e.addPoison(6)}),x.triggerDone()}}class Ji extends P{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Demonweb Watcher",this.iAttack=this.boof4714,this.iHealth=this.lValN([7,12,18]),this.tribe.push("SP");const e=this.boof246n;this.text=`When an enemy creature with Aggressive deals battle damage, it gets ${p.jr9(e,e)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),r}ddf8(t){const e=$.toDamage(t.event);return e.battle&&e.isCreatSrc&&e.srcCreat.owner!==t.owner&&e.srcCreat.aggressive}jr8(t){const e=$.toDamage(t.event);this.logAct(!1,e.srcCreat);const r=this.boof246n;e.srcCreat.buff(r,r),x.triggerDone()}}class Qi 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 ${p.dbdtap()}, heal ${e} damage from each other friendly creature.~Vengeance: Put a level ${this.level} Bron, Wild Tamer into this lane.`}image(t){return this.fixedImage(t)}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("VN");s.bonus=this.buffNug(this.iAttack,this.iHealth);const l=r.jr4("DM");return l.bonus=this.buffNug(0,this.boof357),r}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){if(t.trigger.type==="VN"){const e=g.jr5(t.creatId);g.birth("BWT"+this.level,"P",e.owner,e.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const e=this.boof357,r=y.crNotMeTarg(t.creatId);r.player=k.toTarget(t.owner),g.creatByTarget(r).forEach(l=>l.heal(e)),x.triggerDone()}}}class _i extends kt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Discordant Strike";const e=-this.boof4610;this.text=`Give an enemy creature ${p.jr9(e,0)}.~Allied Nekrium: Give an enemy creature ${p.jr9(0,e)}.`}playTargets(){const t=super.playTargets(),e=y.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=S.deTil(t.param),r=-this.boof4610,s=g.ddf6(t);e[0]==="P1"?(this.logSpell(s),s.buff(r,0),E.allied("N")?T.ddf5(D.toActions(y.crEnemyActTarg("CARD",this.code,"P2"))):T.spellCast()):(this.logSpell(s),s.buff(0,r),T.spellCast())}}class tr extends kt{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.isFree=this.level===3,this.level<3&&(this.hints=["LG"]),this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}playTargets(){const t=super.playTargets(),e=this.poisTarg();return this.level===1?t.push(e):g.creatByTarget(e).length>0&&t.push(D.boardTarget("CARD",this.code)),t}handleAction(t){if(this.level===1){const e=g.ddf6(t);this.logSpell(e),e.addPoison(e.poison)}else this.logSpell(),g.creatByTarget(this.poisTarg()).forEach(r=>{r.addPoison(r.poison)});T.spellCast()}poisTarg(){const t=y.crEnemyActTarg("CARD",this.code,"");return t.hasPoison=!0,t}}class er 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="";const r=this.lValN([0,5,10]);this.level>1&&(e=`, then give it ${p.jr9(r,0)}`),this.text=`Activate: Look at the creatures in the enemy player's hand and choose one. Replace ${this.name} with the chosen creature${e}.`;const s=this.avgCreatureStats();this.bonus={activ8:this.buffNug(r+s[0]-this.iAttack,s[1])}}canActivate(t){return k.toPlayer(!t.owner).hand.some(r=>G.getCard(r).type==="C")}startActivation(t){let e;if(ht.simOn)e=[{cardCode:"VND"+this.level,sourceIdx:0,cardCount:0}];else{const s=k.toPlayer(!k.getActiveB()),l=y.target("TH");l.player=k.toTarget(s),l.card="C",e=Dt.generateContent(s.hand,!1,l)}const r=e.map(s=>{const l=y.deckSelectAction("CARD",s.cardCode,s.sourceIdx);return l.param=t.id,l.host=this.code,l});Dt.showCustomDeck(e,r)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),r=g.birth(t.card,"R",e.owner,e.lane);this.level>1&&r?.buff(this.level===3?10:5,0),At.popMode(),e.endActivation()}}class ir 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=G.getCard(this.bfc()),r=`Destroy an enemy ${p.levelGateText(this.level,!0)}creature.`;this.text=`Activate, destroy another friendly creature: ${r}~Allied Uterra: Put a ${p.tokName(e)} into an available lane.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.5)}}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR");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(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[1]==="P1"){const r=g.ddf6(t),s=this.enemies(e[0],r.id);s.push(T.cancelAction()),T.ddf5(s)}else if(e[1]==="P2"){this.logAct(!0);const r=g.jr5(e[0]),s=R.tick(),l=g.jr5(e[2]),f=g.ddf6(t);V.destroy(l,this.code,s),V.destroy(f,this.code,s),r.endActivation()}else g.birth(this.bfc(),"P",t.playerA,t.lane),T.actionDone(!0)}jr8(t){if(E.allied("U")){const e=y.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId),r=D.toActions(e);r.length>0?T.ddf5(r):x.triggerDone()}else x.triggerDone()}friends(t){const e=y.crFriendNotMeActTarg("CARD",t,this.code,S.enTil(t,"P1"));return D.toActions(e)}enemies(t,e=""){const r=y.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",e));return r.level=D.ddf2(this.level),D.toActions(r)}bfc(){return "BRF"+this.level}}class rr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Dysian Siphon";const e=this.boof357;this.text=`Give an enemy creature ${p.jr9(-e,-e)}.~Allied Uterra: Give a friendly creature ${p.jr9(e,e)}. `}playTargets(){const t=super.playTargets(),e=y.crEnemyActTarg("CARD",this.code,"P1");return t.push(e),t}handleAction(t){const e=S.deTil(t.param),r=this.boof357,s=g.ddf6(t);if(e[0]==="P1"){const l=y.crFriendActTarg("CARD",this.code,S.enTil("P2",s.id)),f=D.toActions(l);E.allied("U")&&f.length>0?(f.push(T.cancelAction()),T.ddf5(f)):(this.logSpell(s),s.buff(-r,-r),T.spellCast())}else{const l=g.jr5(e[1]);this.logSpell(l,s),l.buff(-r,-r),s.buff(r,r),T.spellCast()}}}class sr 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 ${p.jr9(e,e)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR");return s.interactive=!0,s.customCode=r.id,r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const e=$.toEnterField(t.event);if(e.forged&&e.creature.id===t.trigger.customCode)if(k.getActive().health>120){const r=y.actionTarget("TF","CARD",this.code,"");r.player="F",r.hint=["FL"],r.lanes=g.laneIdx.filter(l=>l!==e.creature.lane);const s=D.toActions(r);s.push(T.noneEndTrigger()),T.ddf5(s)}else x.triggerDone();else{const r=e.creature.opposed;if(r&&E.allied("N",e.creature.owner)){const s=-this.boof135;r.buff(s,s)}x.triggerDone()}}handleAction(t){g.birth(this.code,"R",t.playerA,t.lane),T.actionDone(!0)}}class ar 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");return s.interactive=this.level<3,r}jr8(t){if(this.level<3){const e=g.jr5(t.trigger.creatId),r=y.actionTarget("TF","CARD",this.code,"");r.player="F",r.lanes=e.adjacent,r.hint=["FL"];const s=D.toActions(r);s.push(T.noneEndTrigger()),T.ddf5(s)}else{const e=y.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId);let r=D.toActions(e);if(r.length>0){const s=R.tick();r.forEach(l=>g.birth(this.code,"P",l.playerA,l.lane,s))}x.triggerDone()}}handleAction(t){g.birth(this.code,"P",t.playerA,t.lane),T.actionDone(!0)}}class ri 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[y.mod("AT",t.armor,t.id)]}tvgC(){this.faction="A",this.rarity="R",this.name="Tower Vanguard",this.iAttack=this.lValN([3,6,11]),this.iHealth=this.lValN([7,13,21]),this.tribe.push("RB");const t=this.boof247;this.text=`While ${this.name} has Armor, it gets ${p.jr9(t,0)}.`}tvgM(t){return[y.mod("AT",this.boof247,t.id)]}}class be 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[y.mod("BT",!0,t.id)]}hlwmC(){this.faction="A",this.rarity="L",this.name="Hinterland Watchman",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.lValN([7,10,20]),this.tribe.push("MC"),this.attThreshold=this.boof51020;const t=this.lValS(["Mobility 3","Armor 5 and Mobility 3","Armor 5, Breakthrough, Aggressive, Mobility 3, and Regenerate 5"]);this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets ${t}.`}hlwmM(t){const e=[y.mod("MB",3,t.id)];return this.level>1&&e.push(y.mod("AR",5,t.id)),this.level===3&&(e.push(y.mod("BT",!0,t.id)),e.push(y.mod("AG",!0,t.id)),e.push(y.mod("RG",5,t.id))),e}lspC(){this.faction="A",this.rarity="C",this.name="Lightshield Patrol",this.iAttack=this.lValN([4,7,15]),this.iHealth=this.boof51020,this.tribe.push("HM"),this.attThreshold=this.iHealth,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Armor ${this.boof234}.`}lspM(t){return[y.mod("AR",this.boof234,t.id)]}ssinC(){this.faction="A",this.rarity="R",this.name="Spiritsteel Infiltrator",this.iAttack=this.boof4815,this.iHealth=this.iAttack+3,this.tribe.push("EN"),this.attThreshold=this.boof51020,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Mobility ${this.level} and Armor ${this.boof246}.`}ssinM(t){return[y.mod("MB",this.level,t.id),y.mod("AR",this.boof246,t.id)]}weguC(){this.faction="U",this.rarity="L",this.name="Wegu, the Ancient",this.iAttack=0,this.iHealth=1,this.tribe.push("PL"),this.iDefend=!0,this.attThreshold=this.lValN([10,25,100]);const t=this.boof124,e=this.level===3?"it gets Breakthrough and ":"";this.text=`When you gain health, Wegu gets ${p.jr9(t,t)} for each health you gained.~While Wegu has ${this.attThreshold} or more attack, ${e}Negate Defender from it.`}weguM(t){const e=[y.mod("ND",!0,t.id)];return this.level===3&&e.push(y.mod("BT",!0,t.id)),e}}class si extends P{friendNotMe(t){const e=y.crNotMeTarg(t.id);return e.player=k.toTarget(t.owner),e}friendNone(t){const e=y.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),l=g.creatByTarget(s),f=g.creatByTarget(r);l.forEach(m=>{f.includes(m)?m.addModSafe(e):m.removeModSafe(t.id)})}}class Ae extends si{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)},["SFE"]:{c:()=>this.sfeC(),m:r=>this.sfeM(r),t:r=>this.sfeT(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),l=this.enforcementActive(e)?this.effTargs(r,e):this.friendNone(e);this.applyEffect(e,s,l)}bwwC(){this.faction="T",this.rarity="H",this.name="Borean Windweaver",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.iMobile=this.level,this.tribe.push("WN","AS"),this.text=`Each other friendly creature gets Mobility ${this.level}.`}bwwM(t){return y.mod("MB",this.level,t.id)}bwwT(t){return this.friendNotMe(t)}hrtC(){this.faction="U",this.rarity="L",this.name="Heart Tree",this.iAttack=0,this.iHealth=this.lValN([10,15,30]),this.iRegen=this.boof246,this.iDefend=!0,this.tribe.push("PL"),this.text=`Each other friendly creature gets Regenerate ${this.iRegen}.`}hrtM(t){return y.mod("RG",this.iRegen,t.id)}hrtT(t){return this.friendNotMe(t)}kkkC(){if(this.faction="T",this.rarity="L",this.name="Korok, Khan of Kadras",this.iAttack=this.lValN([4,7,12,18]),this.iHealth=this.lValN([7,12,18,26]),this.iAggro=!0,this.tribe.push("FB"),this.maxLevel=4,this.level>1){const t=this.lValS(["","friendly level 1","friendly level 2 or lower","other friendly"]);this.text=`Each ${t} creature gets Aggressive.`}}kkkM(t){return y.mod("AG",!0,t.id)}kkkT(t){const e=this.friendNotMe(t);return this.level===1?e.lanes=[]:e.level=D.ddf2(this.level-1),e}sfeC(){this.faction="T",this.rarity="H",this.name="Shadowflame Elemental",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.iAggro=!0,this.tribe.push("DF","EL"),this.text="Each other friendly Darkforged gets Aggressive."}sfeM(t){return y.mod("AG",!0,t.id)}sfeT(t){const e=this.friendNotMe(t);return e.tribe="DF",e}xdvC(){this.faction="N",this.rarity="H",this.name="Xrath, Dreadnight Of Varna",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.boof248,this.tribe.push("ZB"),this.text=`Each other friendly Zombie gets Regenerate ${this.iRegen}`}xdvM(t){return y.mod("RG",this.iRegen,t.id)}xdvT(t){const e=this.friendNotMe(t);return e.tribe="ZB",e}}class nr 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=y.crNotMeTarg(e.id);r.player=k.toTarget(e.owner),g.creatByTarget(r).length===0?this.createMods(this.cardCode(),e).forEach(l=>{e.addModSafe(l)}):e.removeModSafe(e.id)}ahlC(){this.faction="A",this.rarity="H",this.name="Alloyin Highlander",this.iAttack=this.lValN([5,7,10]),this.iHealth=this.boof6914,this.tribe.push("HM"),this.text=`While ${this.name} is your only friendly creature, it gets ${p.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}ahlM(t){return[y.mod("AT",this.boof4812,t.id),y.mod("AR",this.boof248,t.id)]}}class ai extends 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 ${p.jr9(this.iAttack,this.iHealth)}.`}nxpM(t){return[y.mod("AT",this.iAttack,t.id),y.mod("HL",this.iHealth,t.id),y.mod("MH",this.iHealth,t.id)]}skgC(){this.faction="A",this.rarity="C",this.name="Skyknight Glider",this.iAttack=this.boof5916,this.iHealth=this.iAttack+1,this.tribe.push("HM"),this.text=`While ${this.name} is in the center lane, it gets Mobility 2.`}skgM(t){return[y.mod("MB",2,t.id)]}}class Ze 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 ${p.jr9(t,0)}.`}cctM(t){return[y.mod("AT",this.boof246,t.id)]}ghbC(){this.faction="U",this.rarity="R",this.name="Gemhide Basher",this.iAttack=this.lValN([5,10,16]),this.iHealth=this.lValN([3,7,10]),this.tribe.push("DN"),this.likesOpposed=!0,this.text=`While ${this.name} is opposed, it gets Aggressive.`}ghbM(t){return[y.mod("AG",!0,t.id)]}pygC(){this.faction="T",this.rarity="H",this.name="Pyre Giant",this.iAttack=this.boof468,this.iHealth=this.boof234,this.tribe.push("FR","GT"),this.iAggro=!0,this.text=`While ${this.name} is unopposed, it gets ${p.jr9(this.iAttack,0)}.`}pygM(t){return[y.mod("AT",this.iAttack,t.id)]}}class ni extends 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 l=this.createMod(this.cardCode(),e);k.addModSafe(s,l)}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.hints=[this.lValH(["ZZ-1","ZZ-3","ZZ-5"])],this.text=`You get Armor ${this.iHealth}.`}barryM(t){return y.mod("AR",this.iHealth,t.id)}cvsC(){this.faction="U",this.rarity="C",this.name="Cavern Serpent",this.iAttack=this.boof4914,this.iHealth=this.iAttack,this.tribe.push("SN"),this.mPlayer=-1,this.text=`The enemy player has Poison ${this.boof246}.`}cvsM(t){return y.mod("PN",this.boof246,t.id)}}class ke extends si{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 l;this.enforcementActive(e)?(l=this.friendNotMe(e),this.nexus?l.lanes=[1,2,4,5]:l.lanes=e.adjacent):l=this.friendNone(e),this.applyEffect(e,s,l)}algnC(){this.faction="A",this.rarity="R",this.name="Alloyin General",this.iAttack=this.boof246,this.iHealth=this.boof81318,this.tribe.push("HM"),this.text=`Adjacent creatures gets ${p.jr9(this.iAttack,0)}.`}algnM(t){return y.mod("AT",this.iAttack,t.id)}alstC(){this.faction="A",this.rarity="H",this.name="Alloyin Strategist",this.iAttack=this.boof4814,this.iHealth=this.iAttack+1,this.iMobile=this.level,this.tribe.push("HM");const t=this.boof246;this.text=`Adjacent creatures gets ${p.jr9(t,0)}.`}alstM(t){return y.mod("AT",this.boof246,t.id)}btcC(){this.faction="A",this.rarity="H",this.name="Battle Techtician",this.iAttack=this.boof3714,this.iHealth=this.boof71117,this.tribe.push("HM"),this.nexus=!0;const t=this.boof248;this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${p.jr9(t,0)}.`}btcM(t){return y.mod("AT",this.boof248,t.id)}aeroC(){this.faction="A",this.rarity="L",this.name="Nexus Aeronaut",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.iMobile=1;const t=this.boof236;this.nexus=!0,this.text=`While ${this.name} is in the center lane, each other friendly creature gets ${p.jr9(t,0)}. Otherwise this gets Armor ${t}.`}aeroM(t){return y.mod("AT",this.boof236,t.id)}ntcC(){this.faction="A",this.rarity="H",this.name="Nexus Techtician",this.iHealth=this.boof6916,this.iAttack=this.iHealth-3,this.tribe.push("HM"),this.nexus=!0;const t=this.boof235;this.text=`While ${this.name} is in the center lane, each other friendly creature gets Armor ${t}.`}ntcM(t){return y.mod("AR",this.boof235,t.id)}}class ge extends P{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC(),["POD"]:()=>this.podC(),["RWC"]:()=>this.roamC()})[t]()}targAction(t){g.birth(this.spawnCode,"R",t.playerA,t.lane)}adjacent=!1;optional=!1;needsEmpty=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const e=p.forglied(this.allied);this.text=e+": "+this.ftext}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR");return s.interactive=!0,r}jr8(t){if(this.cardCode()==="POD"&&!E.patron("U")){x.triggerDone();return}if(this.allied==="X"||E.allied(this.allied)){const e=g.jr5(t.creatId),r=y.emptyPlayerActTarg("F","CARD",this.code,t.creatId);this.needsEmpty||(r.field="A",r.hint=["FL"],r.lanes=g.laneIdx.filter(l=>l!==e.lane)),this.adjacent&&(r.lanes=e.adjacent);const s=D.toActions(r);s.length>0?(this.optional&&s.push(T.noneEndTrigger()),T.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){this.targAction(t),T.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=G.getCard(this.spawnCode);this.ftext=`You may put a ${p.tokName(t)} into another lane.`}btsC(){this.faction="U",this.rarity="C",this.name="Brighttusk Sower",this.iAttack=this.lValN([6,8,10]),this.iHealth=this.iAttack,this.tribe.push("TK"),this.level===1&&(this.hints=["ZZ-1"]),this.spawnCode=Z.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=G.getCard(this.spawnCode);this.ftext=`You may put a ${p.tokName(t)} into an adjacent lane.`}escarC(){this.faction="A",this.rarity="H",this.name="Esperian Scarab",this.iAttack=this.lValN([3,4,7]),this.iHealth=this.boof5711,this.iArmor=this.boof135,this.tribe.push("RB"),this.allied="U",this.spawnCode=this.code,this.optional=!0,this.ftext=`You may but a copy of ${this.name} into another lane.`}ethhC(){this.faction="U",this.rarity="C",this.name="Ether Hounds",this.iAttack=this.boof369,this.iHealth=this.iAttack,this.tribe.push("ST"),this.needsEmpty=!0,this.spawnCode=this.code,this.ftext="Put a copy of this into an available lane."}podC(){this.faction="U",this.rarity="H",this.name="Patron of Deepwood",this.iHealth=this.boof4713,this.iAttack=this.iHealth+3,this.tribe.push("ST"),this.spawnCode=this.code,this.optional=!0,this.adjacent=!0,this.ftext=`If you have three or more Uterra cards in your hand, you may put a copy of ${this.name} into an adjacent 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 or 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=G.getCard(this.soldier);this.addSp("N",e.iAttack),this.text=`While you have 6 or more cards in hand, this gets "Activate: Put a ${p.tokName(e)} into an available lane."`,this.bonus={activ8:this.multNug(this.spawnNug(e),.3)}}canActivate(t){return k.toPlayer(t.owner).hand.length>5&&g.emptyLanes(t.owner).length>0}startActivation(t){const e=y.emptyPlayerActTarg(t.owner,"CARD",this.code,t.id),r=D.toActions(e);r.push(T.cancelAction()),T.ddf5(r)}handleAction(t){const e=g.jr5(t.param);this.logAct(!0),g.birth(this.soldier,"P",t.playerA,t.lane),e.endActivation()}ddf8(t){return!0}jr8(t){const e=k.toPlayer(t.owner);k.drawCard(e,1);const r=y.trigIdx(e.triggers,t.trigger);r>-1&&e.triggers.splice(r,1),x.triggerDone()}get soldier(){return "EPS"+this.level}}class hr 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");s.interactive=!0;const l=r.jr4("EF");return l.interactive=!0,r}handleAction(t){if(t.zone==="H")E.levelAndDiscardA(t);else{const e=t;g.birth(this.code,"R",e.playerA,e.lane)}T.actionDone(!0)}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(t.trigger.type==="FR")if(E.allied("U")){const e=g.jr5(t.creatId),r=y.actionTarget("TF","CARD",this.code,t.creatId);r.player="F",r.lanes=g.laneIdx.filter(l=>l!==e.lane),r.hint=["FL"];const s=D.toActions(r);s.push(T.noneEndTrigger()),T.ddf5(s)}else x.triggerDone();else{const e=y.lvlHandActTarg(this.code,t.creatId),r=D.toActions(e);r.length>0?T.ddf5(r):x.triggerDone()}}}class lr 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}.`,this.bonus={activ8:this.buffNug(0,e)}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),r}canActivate(t){const e=y.crFriendNotMeTarg(t.id);return g.creatByTarget(e).length>0}startActivation(t){const e=D.boardTarget("CARD",this.code);e.param=t.id,T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),r=this.boof358,s=y.crFriendNotMeTarg(e.id);g.creatByTarget(s).forEach(l=>{l.heal(r)}),e.endActivation()}jr8(t){E.allied("A")&&g.jr5(t.creatId).addArmor(this.boof247),x.triggerDone()}}class cr 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","LG"]):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this lane.`,this.hints=["ZZ-3"])}jr3(t,e){const r=super.jr3(t,e);if(this.level===2){const s=r.jr4("RU");s.bonus=this.buffNug(10,9)}else if(this.level===3){const s=r.jr4("VN");s.bonus=this.statSpawnNug(0,1)}return r}ddf8(t){return t.event.playerA===t.owner}jr8(t){if(t.trigger.type==="RU"){const e=g.jr5(t.creatId);g.birth(`${"EFP"}3`,"R",e.owner,e.lane)}else if(t.trigger.type==="VN"){const r=$.toCreature(t.event).creature;g.birth(`${"EFP"}2`,"P",r.owner,r.lane)}x.triggerDone()}}class dr 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),s=r.jr4("HG");return s.bonus=this.playerNug(this.iHealth/2),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const e=this.level===3?2:1;k.heal(t.owner,t.event.healAmt*e),x.triggerDone()}}class ur 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"),r}handleAction(t){g.birth(`${"FME"}${this.level}`,"P",t.playerA,t.lane),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner}jr8(t){const e=g.jr5(t.creatId);if(t.event.code==="ENT"){const r=e.jr4("TS");r.interactive=!0,r.changes=!0,r.bonus=this.rawNug(1,0,6,0),x.triggerDone()}else if(t.event.code==="TRS"){const r=y.trigIdx(e.triggers,t.trigger);r>-1&&e.removeTrigger(e.triggers[r]);const s=y.emptyPlayerActTarg("F","CARD",this.code,""),l=D.toActions(s);l.length===0?x.triggerDone():(l.push(T.noneEndTrigger()),T.ddf5(l))}}}class fr extends kt{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const e=this.boof4711;this.text=`Deal ${e} damage to an enemy creature.~Give a friendly creature ${p.jr9(e,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(y.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const e=S.deTil(t.param),r=g.ddf6(t);if(e[0]==="P1"){const s=this.friends(r.id);s.push(T.cancelAction()),T.ddf5(s)}else{this.logSpell(r);const s=g.jr5(e[1]),l=this.boof4711;s.hurtDirect(l,this.code);const f=y.mod("AT",l);f.expiry="ET",r.addMod(f),T.spellCast()}}friends(t=""){const e=y.crFriendActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(e)}}class gr extends P{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Frostspeaker Shaman",this.iAttack=this.boof248,this.iHealth=this.boof71116,this.iDefend=!0,this.tribe.push("IC","YT"),this.addSp("D",this.iAttack),this.text=`Activate: Deal ${this.iAttack} damage to an enemy creature or player.`,this.bonus={activ8:this.buffNug(this.iAttack,0)}}canActivate(t){return!0}startActivation(t){const e=y.crEnemyActTarg("CARD",this.code,t.id),r=y.playerActTarg("E","CARD",this.code,t.id),s=D.toActions([e,r]);s.push(T.cancelAction()),T.ddf5(s)}handleAction(t){if(t.zone==="F"){const r=g.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)}g.jr5(t.param).endActivation()}}class mr extends kt{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Gauntlets of Sulgrim";const e=this.boof2510;this.text=`Give a friendly creature Armor ${e}, then deal damage equal to its Armor to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.baddies().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");e.canArmor=!0,t.push(e)}return t}handleAction(t){const e=S.deTil(t.param),r=g.ddf6(t);if(e[0]==="P1"){const s=T.cancelAction(),l=this.baddies(r.id);l.push(s),T.ddf5(l)}else{const s=g.jr5(e[1]);this.logSpell(s);const l=this.boof2510;s.addArmor(l),r.hurtDirect(s.armor,this.code),T.spellCast()}}baddies(t=""){return D.toActions(y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t)))}}class pr 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.text=`When ${this.name} ${p.dbdtap()}, you gain that much health.~Allied Tempys: Mobility ${this.level}.`}jr3(t,e){const r=super.jr3(t,e);r.jr4("FR");const s=r.jr4("DM");return s.bonus=this.playerNug(this.iAttack),r}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){if(t.trigger.type==="FR")E.allied("T")&&g.jr5(t.creatId).addMobility(this.level),x.triggerDone();else if(t.trigger.type==="DM"){const e=t.event;k.heal(t.owner,e.dmg),x.triggerDone()}}}class yr 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 ${p.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),s=r.jr4("RU");if(s.bonus=this.statSpawnNug(0,0),this.level===3){const l=r.jr4("TS");l.bonus=this.buffNug(3,0)}return 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=y.crEnemyTarg();e.level=D.ddf2(this.level),g.creatByTarget(e).forEach(r=>{const s=r.jr4("DM");s.bonus=this.rawNug(0,0,0,0,-2),s.changes=!0})}else if(t.trigger.type==="TS"){const e=R.tick();g.qEnemyCreats().forEach(r=>{r.hurtDirect(1,this.code,e)})}else if(t.trigger.type==="DM"){const e=g.jr5(t.creatId);e.status==="A"&&V.destroy(e,this.code)}x.triggerDone()}}class br extends P{constructor(t){super(t),this.faction="U",this.rarity="C",this.name="Grapplevine",this.iAttack=this.boof357,this.iHealth=this.lValN([9,12,18]),this.tribe.push("PL"),this.text="Negate Mobility from each creature.",this.level===3&&(this.hints=["ZZ+2"])}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=g.qActiveCreats();e.status==="A"?r.forEach(s=>{s.addModSafe(y.mod("NM",!0,e.id))}):r.forEach(s=>{s.removeModSafe(e.id)})}}class Ar extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Grave Pact",this.isFree=this.level===3,this.text=`Destroy a friendly creature.~Destroy an ${p.levelGateText(this.level+1,!0)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=S.deTil(t.param),r=g.ddf6(t);if(e[0]==="P1"){const s=this.enemyTargActions(r.id);s.push(T.cancelAction()),T.ddf5(s)}else{this.logSpell();const s=g.jr5(e[1]),l=R.tick();V.destroy(s,this.code,l),V.destroy(r,this.code,l),T.spellCast()}}enemyTargActions(t=""){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return e.level=D.ddf2(this.level+1),D.toActions(e)}}class kr extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="H.E.R.M.E.S.",this.iAttack=this.boof6915,this.iHealth=this.iAttack,this.tribe.push("RB"),this.text=`At the end of your turn, each other friendly creature gets Defender and Armor ${this.boof124} until the end of the next turn.`}jr3(t,e){const r=super.jr3(t,e);r.jr4("TE",this.code);const s=r.addEffect("PS",this.code);return s.area="C",r}ddf8(t){return!0}jr8(t){const e=g.jr5(t.creatId),r=y.effect("PS",this.code);this.enforceEffect(r,e),x.triggerDone()}enforceEffect(t,e){const r=this.boof124,s=y.crNotMeTarg(e.id);s.player=k.toTarget(e.owner);const l=g.creatByTarget(s),f=e.status==="A",m=k.activePlayer===e.owner,A=Rt.phase==="ET"||Rt.phase==="PT";f&&(m&&A||!m&&!A)?l.forEach(C=>{C.addModSafe(y.mod("AR",r,e.id)),C.addModSafe(y.mod("DF",!0,e.id))}):l.forEach(C=>{C.removeModSafe(e.id)})}}class vr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const e=this.boof359;this.text=`Give a friendly creature +${e} attack.~Give an enemy creature -${e} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");t.push(e)}return t}handleAction(t){const e=S.deTil(t.param),r=g.ddf6(t);if(e[0]==="P1"){const s=this.enemyTargActions(r.id);s.push(T.cancelAction()),T.ddf5(s)}else{const s=g.jr5(e[1]);this.logSpell(s,r);const l=this.boof359;s.buff(l,0),r.buff(-l,0),T.spellCast()}}enemyTargActions(t=""){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(e)}}class Tr 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");return s.interactive=!0,r}handleAction(t){g.birth(this.code,"P",t.playerA,t.lane),T.actionDone(!0)}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(S.randInt(0,ht.simOn?4:2)===1){const r=y.emptyPlayerActTarg("F","CARD",this.code,""),s=y.actionTarget("TB","NOTR",this.code,""),l=D.toActions([r,s]);l.length===1?x.triggerDone():T.ddf5(l)}else x.triggerDone()}}class Sr 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,this.hints=["ZZ-5"]);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);if(this.level===3){const s=r.jr4("HG");s.bonus=this.playerNug(4);const l=r.jr4("VN");l.bonus=this.buffNug(0,3)}else{const s=r.jr4("DS");s.bonus=this.regnNug(2);const l=r.jr4("TE"),f=G.getCard(this.levelUpCard());l.bonus=this.multNug(this.buffNug(f.iAttack,f.iHealth),.4)}return 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=g.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")g.birth("ICD"+"1","P",e.owner,e.lane);else if(t.trigger.type==="DS")e.addRegen(1);else if(t.trigger.type==="TE"){const r=this.level===1?4:9;e.regen>r&&g.birth(this.levelUpCard(),"R",e.owner,e.lane)}x.triggerDone()}}class Cr 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 ${p.dbdtap()}, deal that much damage to that player again.~When you play Iztek's Frost, replace this with a level ${this.level} Iztek, Avatar of Frost.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC");s.bonus=this.buffNug(0,this.iAttack);const l=r.jr4("DM");return l.bonus=this.buffNug(this.iAttack,0),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 G.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=g.jr5(t.trigger.creatId);g.birth(`${"IZR"}${this.level}`,"R",e.owner,e.lane)}x.triggerDone()}}class wr 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.`,this.bonus={activ8:this.buffNug(e,0)}}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC");return s.bonus=this.buffNug(0,this.iAttack),r}canActivate(t){return!0}startActivation(t){const e=y.crActTarg("CARD",this.code,t.id);e.hint=["HR"];const r=D.toActions([e,D.buttonTarget("CANC")]);T.ddf5(r)}handleAction(t){const e=g.ddf6(t),r=g.jr5(t.param);this.logAct(!0),e.hurtDirect(this.boof2510,this.code),r.endActivation()}ddf8(t){return t.event.playerA===t.owner&&t.event.cardCode.slice(0,3)==="IFL"}jr8(t){const e=g.jr5(t.trigger.creatId);g.birth(`${"IZL"}${this.level}`,"R",e.owner,e.lane),x.triggerDone()}}class Dr 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",this.lValH(["ZZ+2","ZZ+2","ZZ+3"])];const e=this.lValS(["Poison 1","Poison 3","that much Poison"]);this.text=`When ${this.name} deals battle damage to a creature or player, they get ${e}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM");return s.bonus=this.regnNug(this.iAttack),s.bonus.pHealth=this.iAttack,r}ddf8(t){return t.event.battle&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){const e=$.toDamage(t.event),r=this.lValN([1,3,e.dmg]);e.isCreatTarg?e.hurtCreat.addPoison(r):e.hurtPlayer.poison+=r,x.triggerDone()}}class xr 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 ${p.levelGateText(this.level)} card in your`:this.level===3?e="a card in your hand and":e="each card in your hand, deck, and",this.text=`Forge: Level up ${e} discard pile.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR");return s.interactive=this.level<4,r}handleAction(t){const e=k.getActive();if(t.zone==="N"){const r=G.getCard(e.discard[t.position]);e.discard[t.position]=r.levelUpCard(),At.popMode(),T.actionDone(!0)}else{const r=G.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=D.toActions(y.lvlHandActTarg(this.code,""));e.length>0?T.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=y.target("TD");r.player=k.toTarget(e),r.level=D.ddf2(this.level),r.canLevel=!0;const s=Dt.generateContent(e.discard,!1,r);if(s.length>0){const l=s.map(f=>{const m=y.deckSelectAction("CARD",f.cardCode,f.sourceIdx);return m.host=this.code,m.hint=["CD"],m});Dt.showCustomDeck(s,l)}else t?T.actionDone(!0):x.triggerDone()}levelDeck(t){t.map(r=>{const s=G.getCard(r);return s.canLevel()?s.levelUpCard():r}).forEach((r,s)=>t[s]=r)}}class Br 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 ${p.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=y.crTarg(),s=e.status!=="A";r.player=k.toTarget(e.owner);const l=g.creatByTarget(r),f=y.mod("AT",this.iAttack,e.id);l.forEach(m=>{m.opposed||s?m.removeModSafe(e.id):m.addModSafe(f)})}}class Hr extends P{constructor(t){if(super(t),this.faction="U",this.rarity="L",this.name="Leafkin Progenitor",this.iAttack=this.boof3711,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level===3)this.text=`Activate: Put a level 1 ${this.name} into an adjacent available lane.`,this.bonus={activ8:this.statSpawnNug(3,3)};else{this.text=`Activate: Replace this with a level ${this.level+1} ${this.name}.`;const e=3*this.level;this.bonus={activ8:this.buffNug(e,e)}}}canActivate(t){return this.level===3?T.emptyAdjacents(t,"").length>0:!0}startActivation(t){let e;if(this.level===3)e=T.emptyAdjacents(t,"");else{const r=y.fieldSelectAction("CARD",t.lane,t.owner);r.param=t.id,r.host=this.code,e=[r]}e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);this.level===3?g.birth(this.leafCode(1),"P",t.playerA,t.lane):g.birth(this.leafCode(this.level+1),"R",e.owner,e.lane),e.endActivation()}leafCode(t){return`${"LKP"}${t}`}}class me 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"]:(l,f)=>this.doNossing(l,f),["CRS"]:(l,f)=>this.doNossing(l,f),["FOL"]:(l,f)=>this.doNossing(l,f),["NXO"]:(l,f)=>this.doNossing(l,f),["TEX"]:(l,f)=>this.doNossing(l,f),["TSM"]:(l,f)=>this.doNossing(l,f)})[t](e,r)}playTarg;optional=!1;ftext="";forgeLevels=[1,2,3,4];constructor(t){super(t),this.playTarg=y.lvlHandActTarg(this.code,""),this.cardConstruct(this.cardCode()),this.forgeLevels.includes(this.level)&&(this.text="Forge: "+this.ftext)}jr3(t,e){const r=super.jr3(t,e);if(this.forgeLevels.includes(this.level)){const s=r.jr4("FR");s.interactive=!0}return r}handleAction(t){E.levelAndDiscardA(t);const e=g.jr5(t.param);this.targAction(this.cardCode(),t,e),T.actionDone(!0)}jr8(t){if(this.cardCode()==="NXO"&&g.jr5(t.creatId).lane!==3){x.triggerDone();return}const e=D.toActions(this.playTarg);e.length>0?(e.forEach(r=>{r.param=t.creatId}),this.optional&&e.push(T.noneEndTrigger()),T.ddf5(e)):x.triggerDone()}doNossing(t,e){}aetorC(){this.faction="A",this.rarity="C",this.name="Aetherforge Oracle",this.iAttack=this.boof61218,this.iHealth=this.boof246,this.tribe.push("HM"),this.optional=!0,this.playTarg.card="S",this.ftext="You may discard and level up a spell."}scootC(){this.faction="A",this.rarity="R",this.name="Cerebral Scout",this.iAttack=this.boof51015,this.iHealth=this.boof3712,this.tribe.push("MM"),this.optional=!0,this.playTarg.tribe="MM",this.ftext="You may discard and level up a Metamind."}forcC(){this.faction="A",this.rarity="H",this.name="Forge Oracle",this.iAttack=this.lValN([1,10,20]),this.iHealth=this.iAttack,this.tribe.push("ST"),this.playTarg.faction="A",this.optional=!0,this.ftext="You may discard an Alloyin card and level it.",this.level===1?this.hints=["LG","RT"]:(this.consistent=!0,this.addSp("C",0),this.level===3&&(this.hints=["ZZ-2"]))}nexoC(){this.faction="A",this.rarity="C",this.name="Nexus Overwatch",this.iHealth=this.boof71014,this.iAttack=this.iHealth-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`If ${this.name} is in the center lane, you may ${p.daluac()}.`}texC(){this.faction="A",this.rarity="C",this.name="Tech Explorer",this.iAttack=this.lValN([1,8,18]),this.iHealth=this.iAttack+2,this.tribe.push("GN"),this.level===1&&(this.hints=["LG","RT"]),this.optional=!0,this.playTarg.card="C",this.ftext="You may discard and level up a creature."}tsmithC(){this.faction="A",this.rarity="C",this.name="Technosmith",this.iAttack=this.boof5915,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.ftext=`You may ${p.daluac()}.`}}class Ft extends P{lookup(t){return{["DFB"]:{c:()=>this.dfbC(),d:(r,s)=>this.dfbD(r,s)},["GGB"]:{c:()=>this.ggbC(),d:(r,s)=>this.ggbD(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)},["GGW"]:{c:()=>this.ggwC(),d:(r,s)=>this.ggwD(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]}trigB;creatDied(t,e){this.lookup(t).d(e,$.toCreature(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DS");return s.bonus=this.trigB,r}ddf8(t){return!0}jr8(t){this.creatDied(this.cardCode(),t),x.triggerDone()}dfbC(){this.faction="N",this.rarity="R",this.name="Dr. Frankenbaum",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("AB");const t=this.boof234;this.text=`When a friendly Abomination is destroyed, deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t*2)}dfbD(t,e){const r=g.jr5(t.creatId),s=e.creature;(r.id===s.id||s.owner===r.owner&&s.isTribe("AB")&&Ft.itDiedFirst(s.id,r.id))&&k.hurtDirect(!r.owner,this.boof234,this.code)}ggbC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Betrayer",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("DF","GG");const t=-this.level;this.text=`When a friendly Darkforged is destroyed, the creature opposing it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(this.level,this.level)}ggbD(t,e){const r=g.jr5(t.creatId),s=e.creature;if(r.id===s.id||s.owner===r.owner&&s.isTribe("DF")&&Ft.itDiedFirst(s.id,r.id)){const l=s.opposed;if(l){const f=-this.level;l.buff(f,f),this.logAct(!1,l)}}}ggdC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Devourer",this.iAttack=this.boof579,this.iHealth=this.iAttack-2,this.tribe.push("GG"),this.hints=["OL"],this.text=`When a creature is destroyed, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),2)}ggdD(t,e){g.jr5(t.creatId).buff(this.level,this.level)}get doomb(){return this.lValN([1,1,2])}ggdrC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Doomrider",this.iAttack=this.boof4712,this.iHealth=this.iAttack+2,this.tribe.push("GG");const t=this.doomb;this.text=`When a friendly creature is destroyed, ${this.name} moves to that creatures lane and gets ${p.jr9(t,t)}. Then give the opposing creature ${p.jr9(-t,-t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}ggdrD(t,e){const r=g.jr5(t.creatId),s=e.creature;if(s.owner===r.owner&&r.id!==s.id&&Ft.itDiedFirst(s.id,r.id)&&!g.searchByLane(s.lane,s.owner)){const f=this.doomb;r.move(s.lane),r.buff(f,f);const m=r.opposed;m&&(this.logAct(!1,m),m.buff(-f,-f))}}ggpC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Predator",this.iAttack=this.boof5914,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("GG"),this.hints=["OP"];const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}ggpD(t,e){if(e.creature.owner!==t.owner){const r=g.jr5(t.creatId),s=g.oppositeLane(r.lane);if(e.creature.lane===s){const l=this.boof246;r.buff(l,l),this.logAct(!1)}}}ggwC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Warrior",this.iAttack=this.boof4710,this.iHealth=this.iAttack+1,this.tribe.push("GG");const t=this.boof234;this.text=`When an adjacent creature is destroyed, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}ggwD(t,e){if(e.creature.owner===t.owner){const r=g.jr5(t.creatId);if(r.adjacent.includes(e.creature.lane)){const s=this.boof234;r.buff(s,s),this.logAct(!1)}}}mhermC(){this.faction="U",this.rarity="L",this.name="Malice Hermit",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("YT");const t=this.boof124;this.text=`Forge: Each other creature gets Poison ${t}.~When a creature with Poison is destroyed, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}mhermD(t,e){if(e.creature.poison>0){const r=g.jr5(t.creatId);if(r.status==="A"){const s=this.boof124;this.logAct(!1,e.creature),r.buff(s,s)}}}ngauntC(){this.faction="N",this.rarity="R",this.name="Nightgaunt",this.iAttack=this.boof4815,this.iHealth=this.iAttack+1,this.tribe.push("GG"),this.text=`When a creature is destroyed, ${this.name} gets Regenerate 1.`,this.trigB=this.regnNug(2)}ngauntD(t,e){g.jr5(t.creatId).addRegen(1)}sharvC(){this.faction="N",this.rarity="C",this.name="Sorrow Harvester",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("AB"),this.text="When a friendly Abomination is destroyed on your turn, draw a card.",this.trigB=this.rawNug(0,0,0,0,lt.dcWeight)}sharvD(t,e){const r=e.creature;r.owner===t.owner&&r.isTribe("AB")&&k.getActiveB()===t.owner&&Ft.itDiedFirst(r.id,t.creatId)&&(this.logAct(!1),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"),this.level===1&&(this.hints=["ZZ-1"]);const t=G.getCard(this.syc());this.text=`When an adjacent non-Spirit creature is destroyed, put a ${p.tokName(t)} into that lane.`,this.trigB=this.spawnNug(t)}yuruD(t,e){const r=g.jr5(t.creatId),s=e.creature;s.owner===r.owner&&r.adjacent.includes(s.lane)&&!s.isTribe("ST")&&Ft.itDiedFirst(s.id,r.id)&&g.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=V.findDeathTime(e);if(S.isUn(s))r=!0;else{const l=V.findDeathTime(t);(S.isUn(l)||l<=s)&&(r=!0)}return r}}class Nr extends Ft{jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),r}jr8(t){if(t.trigger.type==="FR"){const e=g.creatByTarget(y.crNotMeTarg(t.creatId)),r=this.boof124;e.forEach(s=>s.addPoison(r)),x.triggerDone()}else super.jr8(t)}}class Fr extends kt{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metatransfer",this.text=`Give a creature ${p.jr9(-this.boof579,0)}.~Discard and level up a card.`}playTargets(){const t=super.playTargets(),e=y.crActTarg("CARD",this.code,"P1");return e.hint=["DB"],t.push(e),t}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=g.ddf6(t),s=y.lvlHandActTarg(this.code,S.enTil("P2",r.id));s.deckPositionSkip=T.playPosition();const l=D.toActions(s);l.length===0?(this.logSpell(r),r.buff(-this.boof579,0),T.spellCast()):(l.push(T.cancelAction()),T.ddf5(l))}else{const r=g.jr5(e[1]);this.logSpell(r),r.buff(-this.boof579,0);const s=t;T.shiftPlayCard(s.position),E.levelAndDiscardA(s),T.spellCast()}}}class Pr 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.`,this.bonus={activ8:this.statSpawnNug(this.iAttack,this.iHealth)}}canActivate(t){return T.emptyAdjacents(t,"").length>0}startActivation(t){const e=T.emptyAdjacents(t,"");e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);g.birth(e.code,"P",t.playerA,t.lane),e.endActivation()}}class Mr 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");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);T.ddf5(s)}else this.wurmsign(1,t),T.actionDone(!0);else this.wurmsign(1,t),T.actionDone(!0)}jr8(t){const e=$.toCreature(t.event);T.ddf5(this.fieldActions("P1",[e.creature.lane]))}fieldActions(t,e){const r=y.actionTarget("TF","CARD",this.code,S.enTil(t,e[0]));r.player="F",r.hint=["FL"],r.lanes=g.laneIdx.filter(l=>!e.includes(l));const s=D.toActions(r);return s.push(T.noneEndTrigger()),s}wurmsign(t,e){g.birth(this.wurmCode(t),"R",e.playerA,e.lane)}wurmCode(t){return`${"MMW"}${t}`}}class oe extends kt{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=y.crActTarg("CARD",this.code,"");r.hint=e;const s=y.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=g.ddf6(t),this.logSpell(this.hurts?void 0:r),e=!0),this.cardCast(this.cardCode(),r,e),T.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=["LG"]),this.consistent=this.level>1;const t=this.sealzap;this.addSp("D",t),this.consistent&&this.addSp("C",0),this.text=this.burnText(t)}get sealzap(){return this.lValN([1,2,25])}shatC(){this.faction="T",this.rarity="C",this.name="Shatterbolt";const t=this.boof5914;this.addSp("D",t),this.text=`Negate Armor from a creature or player this turn, then deal ${t} damage to that creature or player.`}shatZ(t,e){const r=this.boof5914,s=y.mod("NA",!0);if(s.expiry="ET",e){const l=t;l.addMod(s),l.hurtDirect(r,this.code)}else{const l=k.toPlayer(t);k.addMod(l,s),k.hurtDirect(l,r,this.code)}}shkC(){this.faction="T",this.rarity="H",this.name="Static Shock";const t=this.boof124;this.addSp("D",t),this.hints=["ZZ+1"],this.text=`${this.burnText(t)} You may play an additional ${p.levelGateText(this.level,!0)}spell this turn.`}shkZ(t,e){this.burner(t,e,this.boof124);const r=E.freeCard(this.code);r.condition.level=D.ddf2(this.level),r.condition.card="S"}}class Rr 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"),this.hints=["ZZ-2"];const e=G.getCard(this.spc());this.text=`Activate: Put a ${p.tokName(e)} into an available lane.~Forge: Destroy a friendly creature.`,this.bonus={activ8:this.spawnNug(e)}}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR");return s.interactive=!0,r}canActivate(t){return this.empties(t).length>0}startActivation(t){const e=this.empties(t);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){this.logAct(!0);const r=g.jr5(e[1]);g.birth(this.spc(),"P",t.playerA,t.lane),r.endActivation()}else{const r=g.ddf6(t);V.destroy(r,this.code),T.actionDone(!0)}}jr8(t){const e=y.crFriendActTarg("CARD",this.code,""),r=D.toActions(e);T.ddf5(r)}spc(){return "SPN"+this.level}empties(t){const e=y.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P1",t.id));return D.toActions(e)}}class Er 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 ${p.levelGateText(this.level,!0)}creature.`}image(t){return this.rawImage(`${"NSH"}${this.level}`,t)}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FK");return s.bonus=this.multNug(this.avgSpawnNug(),.5),r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const r=$.toCreature(t.event).creature.opposed;r&&D.levelTestCommon(r.level,this.level)&&V.destroy(r,this.code),x.triggerDone()}}class Ir extends ke{enforceEffect(t,e){e.lane===3?e.removeModSafe(e.id):e.addModSafe(y.mod("AR",this.boof236,e.id)),super.enforceEffect(t,e)}}class Gr 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 ${p.jr9(e,e)}.`}get nbuf(){return this.lValN([1,3,5,10])}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR");this.level===1&&(s.interactive=!0);const l=r.jr4("RP"),f=this.nbuf;return l.bonus=this.buffNug(f,f),r}ddf8(t){const e=$.toReplaced(t.event);return t.creatId!==e.replCreatId&&t.owner===e.replCreat.owner}jr8(t){const e=g.jr5(t.creatId);if(t.event.code==="RPL"){const r=this.nbuf;e.buff(r,r),x.triggerDone()}else{const r=g.emptyLanes(t.owner);if(this.level>1){const s=this.level===2?e.adjacent.filter(f=>r.includes(f)):r,l=R.tick();s.forEach(f=>{g.birth(this.seed,"P",e.owner,f,l)}),x.triggerDone()}else{const s=e.adjacent.filter(l=>r.includes(l));if(s.length===0)x.triggerDone();else if(s.length===1)g.birth(this.seed,"P",e.owner,s[0]),x.triggerDone();else{const l=T.emptyAdjacents(e,"");T.ddf5(l)}}}}handleAction(t){g.birth(this.seed,"P",t.playerA,t.lane),T.actionDone(!0)}get seed(){return "NSD"+this.level}}class Lr extends kt{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 ${p.jr9(e,e,!0)}, and Regenerate ${e}.~Then give an enemy non-Zombie ${p.jr9(r,r)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const e=y.crFriendActTarg("CARD",this.code,"P1");e.tribe="ZB",t.push(e)}return t}handleAction(t){const e=S.deTil(t.param),r=g.ddf6(t);if(e[0]==="P1"){const s=T.cancelAction(),l=this.nonZombies(r.id);l.push(s),T.ddf5(l)}else{const s=g.jr5(e[1]);this.logSpell(s,r);const l=this.boof246;s.buff(l,l),s.addRegen(l),r.buff(-l,-l),T.spellCast()}}nonZombies(t=""){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(e).filter(r=>{const s=r;return!g.ddf6(s).isTribe("ZB")})}}class $r 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={activ8:this.rawNug(0,0,0,0,.5)}}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),r}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>G.getCard(r).canLevel())}startActivation(t){const e=y.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);E.levelAndDiscardA(t),e.endActivation()}jr8(t){E.allied("N")&&g.jr5(t.creatId).addRegen(this.boof358),x.triggerDone()}}class Wr 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 ${p.jr9(e,0)}`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),r}canActivate(t){return t.hasMod(t.id)}startActivation(t){const e=y.crActTarg("CARD",this.code,t.id);e.hint=["DF","DB"];const r=D.toActions(e);r.push(T.cancelAction()),T.ddf5(r)}handleAction(t){const e=g.jr5(t.param),r=g.ddf6(t);this.logAct(!0,r),r.buff(this.boof4812n,0),e.endActivation()}jr8(t){if(E.allied("A")){const e=g.jr5(t.creatId);e.addMod(y.mod("AL",!0,e.id)),e.changed=!0;const r=e.jr4("PT");r.bonus=this.buffNug(this.boof4812,0)}x.triggerDone()}}class Vr extends kt{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Oratek Battlebrand";const e=this.boof71013;this.addSp("D",e),this.text=`Deal ${e} damage to a creature.~Allied Alloyin: You may discard a card and level it.`}playTargets(){const t=super.playTargets(),e=y.crActTarg("CARD",this.code,"");return e.hint=["HR"],t.push(e),t}handleAction(t){if(t.zone==="F"){const e=t,r=g.ddf6(e);if(this.logSpell(),r.hurtDirect(this.boof71013,this.code),E.allied("A")){const s=this.levelActs();s.length===1?T.spellCast():T.ddf5(s)}else T.spellCast()}else if(t.zone==="H"){const e=t;T.shiftPlayCard(e.position),E.levelAndDiscardA(e),T.spellCast()}else t.zone==="B"&&t.param==="NOTR"?T.spellCast():super.handleAction(t)}levelActs(){const t=y.actionTarget("TB","CARD",this.code,"NOTR"),e=y.lvlHandActTarg(this.code,"");return e.deckPositionSkip=T.playPosition(),D.toActions([e,t])}}class Ur 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} ${p.dbdtap()} on your turn, you may discard and level up a card.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR");return s.bonus=this.rawNug(0,0,0,0,.5),r}handleAction(t){E.levelAndDiscardA(t),T.actionDone(!0)}ddf8(t){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}jr8(t){if(t.trigger.type==="FR"){if(E.allied("A")){const e=g.jr5(t.creatId),r=e.jr4("DM");r.interactive=!0,e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=D.toActions(y.lvlHandActTarg(this.code,""));e.length>0?(e.push(T.noneEndTrigger()),T.ddf5(e)):x.triggerDone()}}}class Ye extends P{hitCreature;constructor(t,e){super(t),this.hitCreature=e}trigB;jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM");return s.bonus=this.trigB,r}ddf8(t){return t.event.battle&&t.event.isCreatTarg===this.hitCreature&&t.event.isCreatSrc&&t.event.srcId===t.creatId}}class Or extends Ye{constructor(t){super(t,!1),this.faction="U",this.rarity="L",this.name="Oros, Deepwood's Chosen",this.iAttack=this.lValN([7,11,16,0]),this.iHealth=this.iAttack,this.iBT=!0,this.maxLevel=4,this.tribe.push("FB"),this.hints=["OL"];const e=`When Oros ${p.dbdtap()}, you gain that much health.`,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(y.mod("HL",r,e.id)),e.addModSafe(y.mod("MH",r,e.id)),e.addModSafe(y.mod("AT",r,e.id)))}}class zr extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Othra, Apex Predator",this.iAttack=this.lValN([8,0,10]),this.iHealth=this.lValN([6,12,50]),this.tribe.push("IN"),this.level===3?(this.iMobile=1,this.text="When Othra deals battle damage to a creature or player, they get Poison 10.",this.hints=["ZZ-5"]):(this.text=`Gain Rank: Replace this with a level ${this.level+1} Othra.`,this.hints=["TL"],this.level===2?this.iDefend=!0:this.hints.push("ZZ-1"))}jr3(t,e){const r=super.jr3(t,e);if(this.level===3){const s=r.jr4("DM");s.bonus=this.regnNug(10)}else{const s=r.jr4("RU");s.bonus=this.regnNug(this.level)}return r}ddf8(t){if(t.trigger.type==="DM"){const e=t.event;return e.battle&&e.isCreatSrc&&e.srcId===t.creatId}return t.trigger.type==="RU"?t.event.playerA===t.owner:!1}jr8(t){if(t.trigger.type==="RU"){const e=g.jr5(t.creatId);g.birth(this.levelUpCard(),"R",e.owner,e.lane)}else if(t.trigger.type==="DM"){const e=$.toDamage(t.event);e.isCreatTarg?e.hurtCreat.addPoison(10):e.hurtPlayer.poison+=10}x.triggerDone()}}class Zr 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");return s.interactive=!this.l3,r}jr8(t){if(this.l3)g.creatByTarget(y.crEnemyTarg()).forEach(e=>{e.negateArmor=!0}),x.triggerDone();else{const e=y.crEnemyActTarg("CARD",this.code,""),r=D.toActions(e);r.length>0?T.ddf5(r):x.triggerDone()}}handleAction(t){const e=g.ddf6(t);this.logAct(!1,e),e.negateArmor=!0,T.actionDone(!0)}}class ee 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)},["MMG"]:{c:()=>this.mmgC(),a:r=>this.mmgA(r),t:r=>this.mmgT(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)},["XTE"]:{c:()=>this.xerxC(),a:r=>this.xerxA(r),t:r=>this.xerxT(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=D.boardTarget("CARD",this.code);e.param=t.id,this.preFight&&(e.hint=["BB"]),this.prePlay&&(e.hint=["DF"]),T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);this.runAct(this.cardCode(),e),e.endActivation()}afsC(){this.faction="A",this.rarity="L",this.name="Arcflight Squadron",this.iAttack=this.boof4710,this.iHealth=this.iAttack+2,this.tribe.push("RB"),this.hints=["OL",this.level===1?"ZZ-3":"ZZ-2"],this.prePlay=!0,this.text=`Activate: You may play an additional ${p.levelGateText(this.level,!0)}Robot this turn.`,this.bonus={activ8:this.avgSpawnNug()}}afsT(t){return!0}afsA(t){const e=E.freeCard(this.code);e.condition.tribe="RB",e.condition.level=D.ddf2(this.level)}drixC(){this.faction="A",this.rarity="L",this.name="Drix, the Mindwelder",this.iAttack=this.boof3612,this.iHealth=this.lValN([6,12,21]),this.tribe.push("MM"),this.preFight=!0,this.addSp("A",this.level),this.text=`Activate, discard your hand: Each friendly Metamind gets ${p.jr9(this.level,0)} for each card discarded this way.`,this.bonus={activ8:this.buffNug(3*this.level,0)}}drixT(t){return 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=y.crFriendTarg();s.tribe="MM",g.creatByTarget(s).forEach(l=>{l.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=G.getCard(Z.fgoc(this.level));this.addSp("N",t.iAttack),this.text=`Activate, destroy five friendly Robot Guardians: Put a ${p.tokName(t)} into this lane.`,this.bonus={activ8:this.rawNug(0,0,0,0,1)}}fggT(t){return g.creatByTarget(this.fggTarg()).length===5}fggA(t){const e=t.lane,r=t.owner,s=R.tick();g.creatByTarget(this.fggTarg()).forEach(l=>V.destroy(l,this.code,s)),g.birth(Z.fgoc(this.level),"P",r,e)}fggTarg(){const t=y.crFriendTarg();return t.tribe="GD",t}mvpC(){this.faction="U",this.rarity="C",this.name="Gemheart Sprout",this.iAttack=this.boof357,this.iHealth=this.iAttack+this.level,this.iDefend=!0,this.tribe.push("PL"),this.preFight=!0,this.addSp("L",this.level),this.text=`Activate: You gain health equal to ${this.level}x the number of friendly creatures.`,this.bonus={activ8:this.playerNug(this.level*3)}}mvpT(t){return!0}mvpA(t){const e=g.ddf1().length;k.heal(t.owner,e*this.level)}mmgC(){this.faction="A",this.rarity="L",this.name="Marty McGear",this.iAttack=this.boof3612,this.iHealth=this.boof71117,this.tribe.push("GN"),this.hints=[this.lValH(["ZZ-2","ZZ-2","ZZ-5"])],this.addSp("A",this.level),this.addSp("M",this.level),this.text=`Activate: Spawn a copy of a random ${p.levelGateText(this.level,!0)}Robot from your deck. That Robot gets ${p.jr9(this.level,0)} and Armor ${this.level}.`,this.bonus={activ8:this.avgSpawnNug()}}mmgT(t){return g.ddf1().length<5&&this.mmgBots().length>0}mmgA(t){const e=this.mmgBots(),r=e[S.randInt(0,e.length)],s=g.birth(r,"S",t.owner);s&&(s.addArmor(this.level),s.buff(this.level,0))}mmgBots(){const t=y.target("DK");return t.player="F",t.tribe="RB",t.level=D.ddf2(this.level),D.deckByTarget(t).map(r=>r[0])}owwC(){this.faction="A",this.rarity="L",this.name="Oreian Warwalker",this.iAttack=this.boof359,this.iHealth=this.boof61018,this.tribe.push("RB"),this.preFight=!0;const t=this.owwbuff+1;this.addSp("A",t),this.text=`Activate: ${this.name} gets ${t}x attack.`,this.bonus={activ8:this.buffNug(2*this.iAttack,0)}}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}upakC(){this.faction="U",this.rarity="L",this.name="Uterra Packmaster",this.iAttack=this.boof6914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.preFight=!0;const t=this.boof124;this.addSp("U",t),this.text=`Activate: Each other friendly Uterra creature gets ${p.jr9(t,t)}.`,this.bonus={activ8:this.multNug(this.buffNug(t,t),1.5)}}upakT(t){return g.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const e=this.boof124;g.creatByTarget(this.upakTarg(t.id)).forEach(r=>{r.buff(e,e)})}upakTarg(t){const e=y.crFriendNotMeTarg(t);return e.faction="U",e}wfmC(){this.faction="T",this.rarity="H",this.name="Wildfire Maiden",this.iAttack=this.boof4610,this.iHealth=this.boof5814,this.tribe.push("FR","AS"),this.text=`Activate, destroy ${this.name}: Deal damage equal to its attack to each enemy creature.`,this.bonus={activ8:this.rawNug(0,0,0,0,.5)}}wfmT(t){return!0}wfmA(t){const e=R.tick();g.creatByTarget(y.crEnemyTarg()).forEach(r=>{r.hurtDirect(t.attack,this.code,e)}),V.destroy(t,this.code)}xerxC(){this.faction="N",this.rarity="L",this.name="Xerxes, the Executioner",this.iAttack=this.boof5915,this.iHealth=this.iAttack+2,this.tribe.push("GG");const t=-this.boof135;this.addSp("U",t),this.text=`Activate: Each non-Nekrium creature gets ${p.jr9(t,t)}.~If any enemy creatures are destroyed this way, Spawn one of them at random.`,this.bonus={activ8:this.buffNug(-t,-t)}}xerxT(t){return this.xerxTargs().length>0}xerxA(t){const e=-this.boof135,r=[],s=R.tick();this.xerxTargs().forEach(f=>{f.buff(e,e,s),f.owner!==t.owner&&f.health<1&&r.push(f)});const l=r.length;l>0&&g.birth(r[S.randInt(0,l)].code,"S",t.owner)}xerxTargs(){return g.qActiveCreats().filter(t=>t.faction!=="N")}}class oi 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"),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 ${p.jr9(t,t)}.`}thraF(t){const e=this.boof234;g.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)},["DHM"]:{c:()=>this.dhamC(),t:(r,s)=>this.donkforgeT(r,s),b:(r,s)=>this.donkforgeB(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)},["SCZ"]:{c:()=>this.sczC(),t:(r,s)=>this.donkforgeT(r,s),b:(r,s)=>this.donkforgeB(r,s)},["SHA"]:{c:()=>this.smaC(),t:(r,s)=>this.donkforgeT(r,s),b:(r,s)=>this.donkforgeB(r,s)},["SSP"]:{c:()=>this.shspC(),t:(r,s)=>this.shspT(r,s),b:(r,s)=>this.shspB(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)},["USY"]:{c:()=>this.usyC(),t:(r,s)=>this.donkforgeT(r,s),b:(r,s)=>this.donkforgeB(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,$.toEnterField(e.event))}actBirth(t,e){this.lookup(t).b(e,$.toEnterField(e.event))}iTrigger=!0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);if(this.iTrigger){const s=r.jr4("EF");s.bonus=this.trigB}return r}ddf8(t){return this.testBirth(this.cardCode(),t)}jr8(t){this.actBirth(this.cardCode(),t),x.triggerDone()}donkforgeT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("DF")}donkforgeB(t,e){const r=g.jr5(t.trigger.creatId);this.logAct(!1),r.buff(this.level,this.level)}dftxt(){this.text=`When another friendly Darkforged enters play, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),.5)}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 other friendly ${p.levelGateText(this.level,!0)}creature gets Assault: Aggressive.`,this.trigB=this.rawNug(0,0,0,0,.5)}atorT(t,e){const r=e.creature;return e.forged&&t.trigger.creatId!==r.id&&r.owner===t.owner&&D.levelTargetTest(D.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 ${p.jr9(this.level,this.level)}. Then ${this.name} gets ${p.jr9(-this.level,-this.level)}.`}brhrT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}brhrB(t,e){bt.itBirthedFirst(e.creature.id,t.creatId)&&(this.logAct(!1,e.creature),e.creature.buff(this.level,this.level),g.jr5(t.creatId).buff(-this.level,-this.level))}dhamC(){this.faction="U",this.rarity="R",this.name="Dusk Hammer",this.iAttack=this.boof51015,this.iHealth=this.boof4812,this.iBT=!0,this.tribe.push("DF","TK"),this.dftxt()}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=G.getCard(Z.fgoc(this.level));this.text=`When ${this.name} enters play, if there is a friendly Alpha Beta, and Gamma, put a ${p.tokName(t)} in your discard pile.`}fgdT(t,e){return e.creature.id===t.creatId}fgdB(t,e){const r=y.crTarg();r.player=k.toTarget(t.owner);const s=g.creatByTarget(r).map(l=>l.code.slice(0,3));if(s.includes("FGA")&&s.includes("FGB")&&s.includes("FGG")){const l=k.toPlayer(t.owner);l.discard.push(Z.fgoc(this.level));const f=y.trigger("NT",this.code);f.bonus=this.rawNug(0,0,0,0,10),l.triggers.push(f)}}fspC(){if(this.faction="A",this.rarity="L",this.name="Flowsteel Prototype",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.lValN([8,15,20]),this.tribe.push("SS"),this.iTrigger=this.level>1,this.iTrigger){const t=p.levelGateText(this.level-1);this.text=`When you Forge a ${t} creature, ${this.name} gets +attack equal to that creature's attack.`;const e=this.avgCreatureStats(this.level-1);this.trigB=this.buffNug(e[0],0)}}fspT(t,e){return!!(e.forged&&e.creature.owner===t.owner&&G.getCard(e.creature.code).level0&&g.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.`,this.trigB=this.playerNug(this.iAttack*.5)}haroldB(t,e){if(bt.itBirthedFirst(e.creature.id,t.creatId)){const r=g.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 ${p.jr9(t,0)}.`,this.trigB=this.buffNug(-.5*t,0)}ocarT(t,e){return e.creature.owner!==t.owner&&!e.forged}ocarB(t,e){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 ${p.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),.5)}restwandT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("WD")}restwandB(t,e){const r=g.jr5(t.trigger.creatId),s=this.boof369;this.logAct(!1),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,e=-t;this.text=`When another friendly Spirit Wanderer enters play, the creature opposing this gets ${p.jr9(e,e)}.`,this.trigB=this.multNug(this.buffNug(t,t),.5)}ruthwandB(t,e){const s=g.jr5(t.trigger.creatId).opposed;if(s){const l=-this.boof369;this.logAct(!1,s),s.buff(l,l)}}sczC(){this.faction="N",this.rarity="R",this.name="Shadeclaw Zombie",this.iAttack=this.boof4812,this.iHealth=this.iAttack+this.level,this.iRegen=this.level,this.tribe.push("DF","ZB"),this.dftxt()}smaC(){this.faction="A",this.rarity="R",this.name="Shadowmist Angel",this.iHealth=this.boof369,this.iAttack=this.iHealth*2,this.iArmor=this.level,this.tribe.push("DF","AG"),this.dftxt()}shspC(){this.faction="U",this.rarity="H",this.name="Shroudthorn Splicer",this.iHealth=this.boof3711,this.iAttack=this.iHealth-1,this.tribe.push("DF","PL"),this.text=`When another friendly Darkforged enters play, if it was Forged, Spawn a ${this.iAttack}/${this.iHealth} Darkforged Mimic.`,this.trigB=this.statSpawnNug(this.iAttack,this.iHealth)}shspT(t,e){return t.creatId!==e.creatId&&e.forged&&e.creature.owner===t.owner&&e.creature.isTribe("DF")}shspB(t,e){bt.itBirthedFirst(e.creature.id,t.creatId)&&g.birth("DFM"+this.level,"S",t.owner)}spdryC(){this.faction="U",this.rarity="R",this.name="Spring Dryad",this.iAttack=this.boof469,this.iHealth=this.iAttack,this.tribe.push("DY"),this.text=`When a friendly creature enters play, ${this.name} gets ${p.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level),1.5)}spdryT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner}spdryB(t,e){g.jr5(t.trigger.creatId).buff(this.level,this.level)}tdwC(){this.faction="N",this.rarity="R",this.name="Tarsus Deathweaver",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("HM");const t=this.boof246;this.text=`When a friendly creature enters play, if it wasn't Forged, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}tdwT(t,e){return e.creature.owner===t.owner&&!e.forged}tdwB(t,e){if(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=G.getCard(Z.zomc(this.level));this.text=`Forge: Spawn a ${p.tokName(e)} for each friendly creature that was destroyed this turn.~When a friendly Zombie enters play, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}tnlT(t,e){return e.creature.owner===t.owner?e.creature.isTribe("ZB"):!1}tnlB(t,e){const r=g.jr5(t.trigger.creatId),s=this.boof124;r.buff(s,s)}usyC(){this.faction="T",this.rarity="R",this.name="Umbraskin Yeti",this.iAttack=this.boof369,this.iHealth=this.iAttack*2,this.iMobile=this.level,this.tribe.push("DF","YT"),this.dftxt()}urexC(){this.faction="U",this.rarity="H",this.name="Uterradon Rex",this.iAttack=this.boof4813,this.iHealth=this.boof71118,this.tribe.push("DN");const t=this.boof124;this.text=`When another friendly Dinosaur enters play, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}urexT(t,e){return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.owner&&e.creature.isTribe("DN")}urexB(t,e){if(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=V.findDeathTime(e);if(S.isUn(s))r=!0;else{const l=g.findBirthTime(t);(S.isUn(l)||l<=s)&&(r=!0)}return r}}class he extends Ye{lookup(t){return{["AGM"]:{c:()=>this.agamC(),h:(r,s,l,f)=>this.agamH(r,s,l,f)},["BWK"]:{c:()=>this.blwalkC(),h:(r,s,l,f)=>this.blwalkH(r,s,l,f)},["BRF"]:{c:()=>this.bfangC(),h:(r,s,l,f)=>this.bfangH(r,s,l,f)},["CDT"]:{c:()=>this.cadtC(),h:(r,s,l,f)=>this.cadtH(r,s,l,f)},["GSC"]:{c:()=>this.gcobC(),h:(r,s,l,f)=>this.gcobH(r,s,l,f)},["IHA"]:{c:()=>this.ibhaC(),h:(r,s,l,f)=>this.ibhaH(r,s,l,f)},["SHS"]:{c:()=>this.shimfC(),h:(r,s,l,f)=>this.shimfH(r,s,l,f)}}[t]}image(t){return this.rarity==="T"?this.fixedImage(t):this.leveledImage(t)}cardConstruct(t){this.hints=["OP"],this.lookup(t).c()}creatHit(t,e,r,s,l){this.lookup(t).h(e,r,s,l)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const e=$.toDamage(t.event);this.creatHit(this.cardCode(),t,e,e.srcCreat,e.hurtCreat),x.triggerDone()}agamC(){this.faction="T",this.rarity="L",this.name="Agamemnon",this.iAttack=this.boof4814,this.iHealth=this.lValN([8,12,18]),this.level>1&&(this.iMobile=1,this.iAggro=this.level===3),this.tribe.push("GT"),this.text=`When ${this.name} ${p.dbdtac()} on your turn, this battles again.`,this.trigB=this.buffNug(this.iAttack/2,0)}agamH(t,e,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} ${p.dbdtac(this.level)}, destroy that creature.`,this.trigB=this.avgSpawnNug()}blwalkH(t,e,r,s){s.status==="A"&&D.levelTestCommon(s.level,this.level)&&V.destroy(s,this.code)}bfangC(){this.faction="U",this.rarity="T",this.name="Broodfang",this.iAttack=this.level,this.iHealth=this.level,this.maxLevel=this.level,this.minLevel=this.level,this.tribe.push("SN"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}bfangH(t,e,r,s){s.addPoison(this.iAttack)}poisonText(t){return`When ${this.name} ${p.dbdtac()}, give that creature gets Poison ${t}.`}cadtC(){this.faction="U",this.rarity="R",this.name="Cadaverous Thicket",this.iAttack=this.boof135,this.iHealth=this.lValN([7,12,22]),this.tribe.push("PL"),this.text=this.poisonText(this.iAttack),this.trigB=this.regnNug(this.iAttack)}cadtH(t,e,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),this.trigB=this.regnNug(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 ${p.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${p.dbdtac()}, that creature${t}, and moves to an available enemy lane at random.`,this.trigB=this.buffNug(this.lValN([2,4,6,16]),0)}ibhaH(t,e,r,s){if(s.status==="A"){const l=this.level===4?s.attack*-1:this.boof246n;s.buff(l,0);const f=g.emptyLanes(s.owner),m=f.length;m>0&&(this.logAct(!1,s),s.move(f[S.randInt(0,m)]))}}shimfC(){this.faction="U",this.rarity="R",this.name="Shimmerfang Serpent",this.iAttack=this.boof357,this.iHealth=this.boof61016,this.tribe.push("SN"),this.text=`When ${this.name} ${p.dbdtac()}, that creatures gets that much Poison.`,this.trigB=this.regnNug(this.iAttack)}shimfH(t,e,r,s){s.addPoison(e.dmg)}}class Ut extends Ye{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(r,s,l)=>this.ashyH(r,s,l)},["AMY"]:{c:()=>this.ashmC(),h:(r,s,l)=>this.ashyH(r,s,l)},["CFB"]:{c:()=>this.cfbC(),h:(r,s,l)=>this.cfbH(r,s,l)},["EPS"]:{c:()=>this.epsdC(),h:(r,s,l)=>this.epsdH(r,s,l)},["EFM"]:{c:()=>this.efmC(),h:(r,s,l)=>this.efmH(r,s,l)},["FBC"]:{c:()=>this.fbcC(),h:(r,s,l)=>this.fbcH(r,s,l)},["RTS"]:{c:()=>this.rzstC(),h:(r,s,l)=>this.rzstH(r,s,l)},["RSE"]:{c:()=>this.rselC(),h:(r,s,l)=>this.rselH(r,s,l)},["SVH"]:{c:()=>this.strhyC(),h:(r,s,l)=>this.strhyH(r,s,l)},["URB"]:{c:()=>this.uridC(),h:(r,s,l)=>this.uridH(r,s,l)},["VES"]:{c:()=>this.veskC(),h:(r,s,l)=>this.veskH(r,s,l)}}[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=$.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} ${p.dbdtap()}, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(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} ${p.dbdtap()}, deal that much damage to that player again.`,this.trigB=this.playerNug(this.iAttack/2)}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} ${p.dbdtap()} on your turn, draw a card at the end of the turn.`,this.trigB=this.rawNug(0,0,0,0,.2)}epsdH(t,e,r){const s=y.trigger("TE","EPH"+this.level);s.changes=!0,s.bonus=this.rawNug(0,0,0,0,lt.dcWeight),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} ${p.dbdtap()} on your turn, you may play ${this.lValS(["one","two","three"])} spells this turn.`,this.trigB=this.rawNug(0,0,0,0,this.level*.5)}efmH(t,e,r){if(k.getActiveB()===r.owner)for(let s=0;sl.hurtDirect(e.dmg,this.code,s))}rzstC(){this.faction="T",this.rarity="C",this.name="Razortooth Stalker",this.iAttack=this.boof4812,this.iHealth=this.iAttack+1,this.iMobile=1,this.tribe.push("DN");const t=this.boof235;this.text=`When ${this.name} ${p.dbdtap()}, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}rzstH(t,e,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} ${p.dbdtap()}, deal that much damage to itself as well.~Assault: Spawn a copy of ${this.name}. Then repeat this for each copy.`,this.trigB=this.rawNug(0,0,0,0,-.1)}rselH(t,e,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} ${p.dbdtap()}, it gets Regenerate ${this.level}.`,this.trigB=this.regnNug(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} ${p.dbdtap()} on your turn, each friendly creature gets ${p.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`,this.trigB=this.buffNug(t,t)}uridH(t,e,r){const s=this.boof124,l=this.level===3;g.ddf1().forEach(f=>{f.buff(s,s),l&&(f.breakthrough=!0)})}veskC(){this.faction="N",this.rarity="L",this.name="Vyric Ebonskull",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("VP");let t="",e=.5;this.level===3&&(t=" Then Spawn a copy of that creature."),this.text=`When Vyric ${p.dbdtap()}, destroy an enemy ${p.levelGateText(this.level,!0)} creature at random.`+t,this.trigB=this.multNug(this.avgSpawnNug(),e)}veskH(t,e,r){const s=y.crTarg();s.player=k.toTarget(e.hurtPlayer),s.level=D.ddf2(this.level);const l=g.creatByTarget(s);if(l.length>0){const f=R.tick(),m=l[S.randInt(0,l.length)];V.destroy(m,this.code,f),this.level===3&&g.birth(m.code,"S",r.owner,void 0,f)}}}class se extends P{lookup(t){return{["ASB"]:{c:()=>this.asbC(),d:(r,s,l)=>this.asbD(r,s,l)},["CHR"]:{c:()=>this.crgC(),d:(r,s,l)=>this.crgD(r,s,l)},["DZD"]:{c:()=>this.dozC(),d:(r,s,l)=>this.dozD(r,s,l)},["DTR"]:{c:()=>this.dtrC(),d:(r,s,l)=>this.dtrD(r,s,l)},["FWS"]:{c:()=>this.fwsC(),d:(r,s,l)=>this.fwsD(r,s,l)},["IMD"]:{c:()=>this.eddieC(),d:(r,s,l)=>this.eddieD(r,s,l)},["NCM"]:{c:()=>this.ncmbC(),d:(r,s,l)=>this.ncmbD(r,s,l)},["TDS"]:{c:()=>this.tsrC(),d:(r,s,l)=>this.tsrD(r,s,l)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}cares=!0;trigB;cardDamaged(t,e){const r=$.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);if(this.cares){const s=r.jr4("DM");s.bonus=this.trigB}return r}ddf8(t){return t.event.isCreatTarg&&t.event.target===t.creatId}jr8(t){this.cardDamaged(this.cardCode(),t),x.triggerDone()}asbC(){this.faction="A",this.rarity="L",this.name="Alyssa, Strifeborn",this.iAttack=this.lValN([2,4,10]),this.iHealth=this.lValN([12,16,24]),this.tribe.push("HM"),this.hints=["MC"],this.trigB=this.buffNug(this.iAttack,0),this.text=`When ${this.name} is dealt non-battle damage and survives, it gets ${p.jr9(this.level,1)} for each damage dealt.`}asbD(t,e,r){!r.battle&&r.life>0&&e.buff(r.dmg*this.level,r.dmg)}crgC(){this.faction="U",this.rarity="L",this.name="Chrogias",this.iAttack=this.lValN([1,0,40]),this.iHealth=this.lValN([1,15,40]),this.tribe.push("PL"),this.level>1&&(this.hints=["MC"],this.text="When Chrogias is dealt damage, you gain that much health."),this.level===1?(this.hints=["LG","LM","RT"],this.cares=!1):this.level===2?(this.iRegen=2,this.iDefend=!0,this.trigB=this.playerNug(10),this.hints?.push("LG")):this.level===3&&(this.iBT=!0,this.iRegen=5,this.trigB=this.playerNug(20))}crgD(t,e,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"],this.level===1&&this.hints.push("ZZ-2"),this.trigB=this.buffNug(this.iHealth,0),this.trigB.bonus=.3;const t=G.getCard(this.dz());this.text=`When ${this.name} is dealt damage and survives, replace it with a ${p.tokName(t)}.`}dozD(t,e,r){if(e.health>0&&e.status==="A"){const s=g.birth(this.dz(),"R",e.owner,e.lane);s&&s.setHealth(e.health)}}dz(){return "DZA"+this.level}dtrC(){this.faction="U",this.rarity="L",this.name="Dream Tree",this.iAttack=0,this.iHealth=this.lValN([7,11,20]),this.iDefend=!0,this.tribe.push("PL"),this.level===3&&(this.iRegen=5),this.hints=["MC"],this.trigB=this.avgSpawnNug(),this.text=`When ${this.name} is dealt damage and survives, if it is your turn, you may play an additional card this turn.`}dtrD(t,e,r){e.owner===k.activePlayer&&r.life>0&&(this.logAct(!1),E.regularPlays++)}fwsC(){this.faction="A",this.rarity="H",this.name="Forgewatch Sentry",this.iAttack=this.boof6912,this.iHealth=this.iAttack,this.iArmor=this.iAttack,this.tribe.push("RB"),this.trigB=this.rawNug(0,0,0,0,-1),this.text=`When ${this.name} is dealt damage, destroy it.`}fwsD(t,e,r){V.destroy(e,this.code)}eddieC(){this.faction="A",this.rarity="L",this.name="Iron Maiden",this.iAttack=this.lValN([1,3,30]),this.iHealth=this.iAttack,this.tribe.push("RB"),this.consistent=this.level>1,this.level===3?(this.iBT=!0,this.hints=["MC"],this.text="When Iron Maiden is dealt damage, deal that much damage to the enemy player.",this.trigB=this.playerNug(16)):(this.cares=!1,this.hints=["LG","LM","RT"])}eddieD(t,e,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"],this.level===1&&this.hints.push("ZZ-1");const t=G.getCard(Z.purpOzC(this.level));this.text=`When ${this.name} is dealt damage, Spawn a ${p.tokName(t)}.`,this.trigB=this.spawnNug(t)}ncmbD(t,e,r){this.logAct(!1),g.birth(Z.purpOzC(this.level),"S",t.owner)}tsrC(){this.faction="U",this.rarity="L",this.name="Thundersaur",this.iAttack=0,this.iHealth=this.level*12,this.tribe.push("DN"),this.iBT=!0,this.hints=["MC",this.level===2?"ZZ-3":"ZZ-1"],this.trigB=this.buffNug(this.iHealth/2,0),this.text=`When ${this.name} is dealt damage, it gets +1 attack for each damage dealt.`}tsrD(t,e,r){e.buff(r.dmg,0)}}class O 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)},["DSW"]:{c:()=>this.dswC(),f:r=>this.dswF(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)},["KSB"]:{c:()=>this.ksbC(),f:r=>this.ksbF(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)},["MBR"]:{c:()=>this.mbrC(),f:r=>this.mbrF(r)},["MTD"]:{c:()=>this.mossC(),f:r=>this.mossF(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)},["POK"]:{c:()=>this.pokC(),f:r=>this.pokF(r)},["POT"]:{c:()=>this.potC(),f:r=>this.potF(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)},["SLG"]:{c:()=>this.splgC(),f:r=>this.splgF(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)},["VIC"]:{c:()=>this.vlfxC(),f:r=>this.vlfxF(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)},["ZDK"]:{c:()=>this.zdkC(),f:r=>this.zdkF(r)}}[t]}cardForge(t,e){this.lookup(t).f(e)}ftext="";forges=!0;flanks;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let e="";this.flanks&&(e="Flank"),this.forges&&(e?e="Forge/"+e:e=p.forglied(this.allied)),e&&(this.text=e+": "+this.ftext),this.ftext=""}image(t){return this.rarity==="T"?super.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e);if(this.forges&&r.jr4("FR"),this.flanks){const s=r.jr4("FK");s.bonus=this.flanks}return r}ddf8(t){return Nt.extractCardCode(t.trigger.logicCode)==="MMR"}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 l=y.trigIdx(s.triggers,t.trigger);l>-1&&s.triggers.splice(l,1)}else this.cardForge(this.cardCode(),t);x.triggerDone()}agknitC(){this.faction="A",this.rarity="L",this.name="Aegis Knight",this.iAttack=this.boof5814,this.iHealth=this.iAttack,this.tribe.push("HM"),this.iArmor=this.lValN([1,2,5]),this.ftext="Each friendly creature deals damage equal to its Armor to the opposing creature"}agknitF(t){const e=y.crFriendTarg();e.hasArmor=!0;const r=R.tick();g.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=y.target("TH");r.player=k.toTarget(e),r.tribe="MM";const s=D.deckByTarget(r),l=s.length;if(l>0){const f=s[S.randInt(0,l)];e.deck.splice(f[1],1),e.hand.push(f[0])}}afsC(){this.faction="T",this.rarity="H",this.name="Ashurian Flamesculptor",this.iAttack=this.boof5915,this.iHealth=this.boof3610,this.tribe.push("FR","AS"),this.forges=this.level>1,this.consistent=this.forges,this.ftext=`You may play an additional ${p.levelGateText(this.level-1)} Tempys spell this turn.`,this.forges&&this.addSp("C",0)}afsF(t){const e=E.freeCard(this.code);e.condition.card="S",e.condition.level=D.ddf2(this.level-1),e.condition.faction="T"}bzshC(){this.faction="T",this.rarity="C",this.name="Blizzard Shaman",this.iAttack=this.boof61014,this.iHealth=this.iAttack+1,this.tribe.push("WN","AS"),this.ftext="Move another friendly creature at random to another available lane at random."}bzshF(t){const e=g.creatByTarget(y.crFriendNotMeTarg(t.creatId)),r=e.length;if(r<4&&r>0){const s=e[S.randInt(0,r)],l=g.emptyLanes(s.owner);this.logAct(!1,s),s.move(l[S.randInt(0,l.length)])}}bwtC(){if(this.faction="U",this.rarity="H",this.name="Bramblewood Tracker",this.iAttack=this.boof3712,this.iHealth=this.iAttack+3,this.tribe.push("HM"),this.forges=this.level>1,this.forges){const t=this.level-1;this.ftext=`You may play an additional ${p.levelGateText(t)} Uterra creature this turn.`,this.consistent=!0,this.addSp("C",0)}else this.hints=["LG"]}bwtF(t){const e=E.freeCard(this.code);e.condition.card="C",e.condition.faction="U",e.condition.level=D.ddf2(this.level-1)}bssC(){this.faction="A",this.rarity="L",this.name="Brightsteel Sentinal",this.iHealth=this.boof51015,this.iAttack=this.iHealth-1,this.tribe.push("RB"),this.addSp("M",this.iHealth),this.ftext=`Each friendly Robot gets Armor ${this.iHealth} this turn.`}bssF(t){const e=this.boof51015,r=y.crFriendTarg();r.tribe="RB",r.canArmor=!0,g.creatByTarget(r).forEach(l=>{const f=y.mod("AR",e);f.expiry="ET",l.addMod(f)})}bzdrC(){this.faction="N",this.rarity="R",this.name="Byzerak Drake",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.iRegen=this.level,this.allied="T",this.tribe.push("DG"),this.addSp("R",this.level),this.ftext=`Mobility ${this.level}.`}bzdrF(t){E.allied(this.allied)&&g.jr5(t.creatId).addMobility(this.level)}bfmC(){this.faction="N",this.rarity="H",this.name="Byzerak Frostmaiden",this.iAttack=this.boof135,this.iHealth=this.boof91420,this.tribe.push("HM");const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${p.jr9(-1*t,0)} and this gets ${p.jr9(t,0)}.~Allied Tempys: Mobility ${this.level}.`}bfmF(t){const r=$.toEnterField(t.event).creature;t.trigger.type==="FR"&&E.allied("T")&&r.addMobility(this.level);const s=r.opposed;if(s){const l=this.boof246;s.buff(-1*l,0),r.buff(l,0)}}charnC(){this.faction="N",this.rarity="C",this.name="Charnel Titan",this.iAttack=this.boof359,this.iHealth=this.boof5814,this.tribe.push("AB");const t=this.boof357;this.ftext=`If there is an enemy creature with ${t} or less attack, ${this.name} gets ${p.jr9(t,t)}.`}charnF(t){const e=this.boof357,r=y.crEnemyTarg();r.maxAttack=e,g.creatByTarget(r).length>0&&g.jr5(t.creatId).buff(e,e)}chihC(){this.faction="U",this.rarity="C",this.name="Chistlehearth Hunter",this.iAttack=this.lValN([2,6,11]),this.iHealth=this.boof81217,this.tribe.push("HM"),this.ftext=`${this.name} gets ${p.jr9(1,0)} for each other friendly creature.`}chihF(t){const e=g.ddf1().length;e>1&&g.jr5(t.creatId).buff(e-1,0)}chickenC(){this.faction="T",this.rarity="L",this.name="Cindersmoke Wyvern",this.iAttack=this.boof3610,this.iHealth=this.lValN([7,12,17]),this.tribe.push("DG"),this.iMobile=this.boof124,this.forges=!1,this.flanks=this.buffNug(this.iAttack,0),this.ftext="Deal damage equal to its attack to the opposing creature. If there is no opposing creature, deal that damage to the enemy player instead."}chickenF(t){const e=$.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=y.crTarg();e.maxAttack=1;const r=g.creatByTarget(e),s=R.tick();r.forEach(l=>{V.destroy(l,this.code,s)})}dswC(){this.faction="N",this.rarity="C",this.name="Darkshard Witch",this.iAttack=this.boof51015,this.iHealth=this.iAttack-1,this.tribe.push("DF","HM");const t=this.boof234;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health for each other friendly Darkforged.`}dswF(t){const e=y.crFriendNotMeTarg(t.creatId);e.tribe="DF";const r=this.boof234*g.creatByTarget(e).length;r>0&&(k.heal(t.owner,r),k.hurtDirect(!t.owner,r,this.code))}dbaC(){this.faction="U",this.rarity="H",this.name="Deepbranch Ancient",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("HY"),this.ftext=`If there is a friendly creature in each lane, ${this.name} gets ${p.jr9(this.iAttack,this.iHealth)}.`}dbaF(t){g.ddf1().length===5&&g.jr5(t.creatId).buff(this.iAttack,this.iHealth)}drbC(){this.faction="N",this.rarity="C",this.name="Dirge Banshee",this.iAttack=this.boof248,this.iHealth=this.boof61016,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${p.jr9(-t,0)} and this gets ${p.jr9(t,0)}.`}drbF(t){const e=$.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.level>1&&(this.hints=[this.level===2?"ZZ-2":"ZZ-5"]),this.forges=!1,this.flanks=this.multNug(this.avgSpawnNug(),.5),this.ftext=`Destroy the opposing ${p.levelGateText(this.level,!0)}creature.`}dddF(t){const r=$.toEnterField(t.event).creature.opposed;r&&D.levelTestCommon(r.level,this.level)&&V.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){E.allied(this.allied)&&g.jr5(t.creatId).addArmor(this.boof124)}fwtC(){this.faction="U",this.rarity="H",this.name="Frostwild Tracker",this.iAttack=this.boof4712,this.iHealth=this.boof248,this.tribe.push("TG"),this.forges=this.level>1;const t=this.level-1;this.ftext=`You may play an additional ${p.levelGateText(t)} creature this turn.`,this.level===1&&(this.hints=["LG"])}fwtF(t){const e=E.freeCard(this.code);e.condition.card="C",e.condition.level=D.ddf2(this.level-1)}gwurmC(){this.faction="N",this.rarity="C",this.name="Gloomspire Wurm",this.iAttack=this.boof4813,this.iHealth=this.iAttack,this.tribe.push("WR"),this.ftext=`If there are no enemy creatures, ${this.name} gets ${p.jr9(4,4)}.`}gwurmF(t){g.qEnemyCreats().length===0&&g.jr5(t.creatId).buff(4,4)}gsC(){this.faction="U",this.rarity="C",this.name="Glowstride Stag",this.iAttack=this.boof5812,this.iHealth=this.iAttack+this.level,this.tribe.push("ST");const t=this.boof51015;this.ftext=`You gain ${t} health.`}gsF(t){const e=this.boof51015;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&&(E.regularPlays+=1)}ksbC(){this.faction="T",this.rarity="C",this.name="Kadrasian Stoneback",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("DN"),this.iMobile=1,this.iDefend=!0,this.forges=!1,this.flanks=this.regnNug(1),this.ftext=`Negate Defender from ${this.name} this turn.`}ksbF(t){const e=$.toEnterField(t.event),r=y.mod("ND",!0,e.creatId);r.expiry="ET",e.creature.addModSafe(r)}legtitC(){this.faction="N",this.rarity="R",this.name="Legion Titan",this.iAttack=this.boof4812,this.iHealth=this.iAttack,this.tribe.push("ZB"),this.ftext=`${this.name} gets ${p.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`}legtitF(t){const e=y.crEnemyTarg();e.maxAttack=this.boof357;const r=g.creatByTarget(e);if(r.length>0){const s=this.level*r.length;g.jr5(t.creatId).buff(s,s)}}lbdC(){this.faction="U",this.rarity="H",this.name="Lifeblood Dryad",this.iAttack=this.lValN([4,7,9]),this.iHealth=this.iAttack,this.tribe.push("DY");const t=this.boof236;this.ftext=`If there is a friendly creature in each lane, each other friendly creature gets ${p.jr9(t,t)}.`}lbdF(t){const e=g.creatByTarget(y.crFriendNotMeTarg(t.creatId));if(e.length===4){const 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=["LG"])}lyrF(t){if(this.level===2){const e=V.gravedigger();e&&g.birth(e,"S",t.owner)}else if(this.level===3){const e=g.emptyLanes(t.owner),r=e.map(s=>V.gravedigger());if(e.length>0&&r[0]){const s=R.tick();e.forEach((l,f)=>{g.birth(r[f],"P",t.owner,l,s)})}}}moeC(){this.faction="T",this.rarity="H",this.name="Master of Elements",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=`You may play an additional ${p.levelGateText(this.level-1)} spell this turn.`}moeF(t){const e=E.freeCard(this.code);e.condition.card="S",e.condition.level=D.ddf2(this.level-1)}mmaC(){this.faction="A",this.rarity="C",this.name="Metamind Adept",this.iAttack=this.boof5915,this.iHealth=this.boof4813,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`Draw ${this.level} card${t}.`}mmaF(t){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=y.crFriendNotMeTarg(t.creatId);if(e.tribe="MM",g.creatByTarget(e).length>0){const r=y.trigger("TE",this.code);r.changes=!0,r.bonus=this.rawNug(0,0,0,0,this.level*lt.dcWeight),k.toPlayer(t.owner).triggers.push(r)}}mbrC(){this.faction="A",this.rarity="R",this.name="Mind Breaker",this.iAttack=this.boof248,this.iHealth=this.lValN([8,14,20]),this.tribe.push("MM"),this.ftext="Draw a card for each friendly Metamind."}mbrF(t){const e=y.crFriendTarg();e.tribe="MM",k.drawCard(t.owner,g.creatByTarget(e).length)}mossC(){this.faction="U",this.rarity="R",this.name="Mosstodon",this.iAttack=this.boof71117,this.iHealth=this.boof4713,this.tribe.push("DN"),this.ftext=`Each other friendly Dinosaur gets ${p.jr9(0,this.boof357)}.`}mossF(t){const e=y.crFriendNotMeTarg(t.creatId);e.tribe="DN";const r=this.boof357;g.creatByTarget(e).forEach(s=>s.buff(0,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=$.toEnterField(t.event);e.creature.opposed&&e.creature.addRegen(this.boof246)}ofmC(){this.faction="A",this.rarity="R",this.name="Oreian Fieldmarshal",this.iAttack=this.boof5914,this.iHealth=this.iAttack-2,this.tribe.push("HM");const t=this.boof135;this.ftext=`Each other friendly creature gets ${p.jr9(t,0)}.`}ofmF(t){const e=this.boof135;g.creatByTarget(y.crFriendNotMeTarg(t.creatId)).forEach(s=>{s.buff(e,0)})}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.tribe.push("RB"),this.hints=["OP"],this.ftext=`${this.name} gets Armor ${this.iAttack} this turn.`}orpF(t){const e=g.jr5(t.creatId),r=y.mod("AR",this.iAttack);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){E.allied(this.allied)&&g.jr5(t.creatId).addRegen(this.level)}phmC(){this.faction="A",this.rarity="R",this.name="Palladium Hindermind",this.iAttack=this.boof2612,this.iHealth=this.boof61016,this.tribe.push("HM"),this.ftext=`Each enemy creature gets ${p.jr9(this.boof123n,0)}.`}phmF(t){const e=this.boof123n;g.qEnemyCreats().forEach(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=this.multNug(this.statSpawnNug(this.iAttack,this.iHealth),.5),this.ftext=`If ${this.name} is in the center lane, Spawn a copy.`}palsF(t){$.toEnterField(t.event).creature.lane===3&&g.birth(this.code,"S",t.owner)}pokC(){this.faction="T",this.rarity="H",this.name="Patron of Kadras",this.iAttack=this.boof4812,this.iHealth=this.iAttack+2,this.tribe.push("ER","EL"),this.ftext=`If you have three or more Tempys cards in your hand, each friendly creature gets ${p.jr9(this.iAttack,0)} this turn.`}pokF(t){E.patron("T")&&g.ddf1().forEach(e=>{const r=y.mod("AT",this.iAttack);r.expiry="ET",e.addMod(r)})}potC(){this.faction="N",this.rarity="H",this.name="Patron of Tarsus",this.iAttack=this.boof5914,this.iHealth=this.boof4712,this.tribe.push("DM");const t=this.potbuf;this.ftext=`If you have three or more Nekrium cards in your hand, each enemy creature gets ${p.jr9(t,t)}.`}potF(t){if(E.patron("N")){const e=g.qEnemyCreats();if(e.length>0){const r=this.potbuf;this.logAct(!1),e.forEach(s=>{s.buff(r,r)})}}}get potbuf(){return this.lValN([-1,-3,-6])}prinvC(){this.faction="T",this.rarity="H",this.name="Primordial Invoker",this.iAttack=this.boof61016,this.iHealth=this.boof468,this.tribe.push("HM"),this.ftext=`Deal ${this.iHealth} damage divided at random between enemy creatures and the the enemy player.`}prinvF(t){const e=g.creatByTarget(y.crEnemyTarg()),r=e.length;if(r===0)k.hurtDirect(!t.owner,this.iHealth,this.code);else{const s=R.tick(),l=r+1,f=Array(l).fill(0);for(let m=0;m{f[A]>0&&m.hurtDirect(f[A],this.code,s)}),f[r]>0&&k.hurtDirect(!t.owner,f[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=["LG","LM"])}scorchF(t){const e=$.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=R.tick();g.qPlayerCreats(r).forEach(l=>l.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 ${p.jr9(-6,0)} and ${this.name} gets ${p.jr9(6,0)} for each enemy creature.`}scythF(t){const e=g.qEnemyCreats();e.forEach(r=>{r.buff(-6,0)}),e.length>0&&g.jr5(t.creatId).buff(6*e.length,0)}souldrC(){if(this.faction="N",this.rarity="L",this.name="Soul Drinker",this.iAttack=1,this.iHealth=this.boof4814,this.iMobile=this.level===3?1:0,this.tribe.push("VP"),this.hints=["OP"],this.level===3){const t=this.avgCreatureStats();this.flanks=this.buffNug(t[0]*2,0)}this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`}souldrF(t){const e=$.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 ${p.jr9(this.iAttack,this.iHealth)} for each creature that was destroyed this turn.`}ssggF(t){const e=this.iAttack*(E.deathsA.length+E.deathsB.length);e>0&&g.jr5(t.creatId).buff(e,e)}splgC(){this.faction="N",this.rarity="T",this.name="Spiderling",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("SP"),this.hints=["OP"],this.ftext=`Replace the opposing ${p.levelGateText(this.level,!0)}creature with a Web.`}splgF(t){const e=$.toEnterField(t.event);if(e.creature.opposed){const r=e.creature.opposed;D.levelTestCommon(r.level,this.level)&&g.birth("WEB"+this.level,"R",r.owner,r.lane)}}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=g.searchByLane(3,t.owner);e&&e.id!==t.creatId&&!e.negateArmor&&e.addArmor(this.boof124)}lotusC(){this.faction="U",this.rarity="H",this.name="Stygian Lotus",this.iAttack=this.boof468,this.iHealth=this.iAttack-1,this.tribe.push("PL"),this.hints=["ZZ-1"],this.ftext=`If ${this.name} is opposed, spawn a copy of it. Then repeat this for each copy.`}lotusF(t){if($.toEnterField(t.event).creature.opposed){let r=!0;for(;r;){const s=g.emptyLanes(t.owner),l=s.length;if(l===0)r=!1;else{const f=s[S.randInt(0,l)];g.birth(this.code,"P",t.owner,f).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=g.jr5(t.creatId),r=e.lane,s=e.owner,l=[];if(r>2){const f=g.searchByLane(r-1,s);f&&(g.searchByLane(r-2,s)||(l.push(f),f.move(r-2)))}if(r<4){const f=g.searchByLane(r+1,s);f&&(g.searchByLane(r+2,s)||(l.push(f),f.move(r+2)))}l.length>0&&this.logAct(!1,...l)}tortex(t){return`Put a level ${this.level} ${t} into your hand.`}handhoss(t,e){const r=k.toPlayer(e),s=t+this.level;r.hand.push(s)}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.handhoss("PTR",t.owner)}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.handhoss("STO",t.owner)}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.handhoss("ITO",t.owner)}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.handhoss("STR",t.owner)}umglidC(){this.faction="T",this.rarity="R",this.name="Umbruk Glider",this.iAttack=this.boof71117,this.iHealth=this.iAttack-4,this.iMobile=this.level,this.allied="U",this.tribe.push("DN"),this.ftext="Breakthrough."}umglidF(t){if(E.allied(this.allied)){const e=g.jr5(t.creatId);e.breakthrough=!0}}uwarC(){this.faction="T",this.rarity="H",this.name="Uranti Warlord",this.iAttack=this.boof3713,this.iHealth=this.boof71117,this.tribe.push("FR","YT"),this.hints=["OP"],this.ftext=`Each friendly Yeti deals ${this.iAttack} damage to the opposing creature.`}uwarF(t){const e=y.crFriendTarg();e.tribe="YT";const r=R.tick();g.creatByTarget(e).forEach(s=>{const l=s.opposed;l&&l.hurtDirect(this.iAttack,s.code,r)})}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 gets ${p.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const e=y.crFriendNotMeTarg(t.creatId);e.tribe="YT";const r=this.stokeboof;g.creatByTarget(e).forEach(s=>{const l=y.mod("AT",r);l.expiry="ET",s.addMod(l)})}get stokeboof(){return this.lValN([3,4,6])}uiwC(){this.faction="A",this.rarity="L",this.name="Uriel Ironwing",this.iAttack=this.lValN([6,8,13]),this.iHealth=this.boof81117,this.iMobile=this.level,this.tribe.push("AG"),this.hints=["ZZ-1"];const t=this.boof246n;this.flanks=this.buffNug(-t,0);let e="";this.level===3&&(e=" If that creature has 0 or less attack, destroy it.",this.flanks.count=1),this.ftext=`The opposing creature gets ${p.jr9(t,0)}.${e}`}uiwF(t){const s=$.toEnterField(t.event).creature.opposed;s&&(s.buff(this.boof246n,0),this.level===3&&s.attack<1&&V.destroy(s,this.code))}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${p.jr9(t,t)}.`}umaulF(t){const e=$.toEnterField(t.event);if(e.creature.opposed){const r=this.boof246;e.creature.buff(r,r)}}vlfxC(){this.faction="T",this.rarity="L",this.name="Valifrax, Iztek's Champion",this.iAttack=this.boof4816,this.iHealth=this.iAttack+4,this.iMobile=1,this.tribe.push("FR","IC","DG"),this.forges=!1,this.flanks=this.rawNug(0,0,0,0,.5);const t=(e,r)=>`If there is ${r?"an":"no"} opposing creature, put a level ${this.level} Iztek's ${e} into your hand.`;this.ftext=`${t("Frost",!0)} ${t("Flame",!1)}`}vlfxF(t){const e=$.toCreature(t.event);this.handhoss(e.creature.opposed?"IFR":"IFL",t.owner)}vikC(){this.faction="N",this.rarity="L",this.name="Varna, Immortal King",this.maxLevel=4,this.iAttack=this.lValN([4,6,12,18]),this.iHealth=this.lValN([8,13,22,30]),this.tribe.push("FB");let t="";this.level===4&&(t="Destroy each other creature. Then "),this.ftext=t+"Spawn a random friendly creature that was destroyed this turn."}vikF(t){if(this.level===4){const s=g.creatByTarget(y.crNotMeTarg(t.creatId));if(s.length>0){const l=R.tick();s.forEach(f=>V.destroy(f,this.code,l))}}const e=t.owner?E.deathsA:E.deathsB,r=e.length;e.length>0&&g.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 ${p.jr9(1,1).replaceAll("1","X")}, where X is the total amount of Poison on each enemy creature.`}vdrkF(t){const e=g.qEnemyCreats();let r=0;e.forEach(s=>{r+=s.poison}),r>0&&g.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=y.crEnemyTarg();if(e.hasPoison=!0,g.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 ${p.jr9(3,0)}.`}warF(t){const e=y.crFriendNotMeTarg(t.creatId);g.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 ${p.jr9(t,t)}.`}wwpF(t){const e=this.boof235,r=y.crFriendTarg();r.maxAttack=this.boof357,g.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"];const t=this.boof247n;this.flanks=this.buffNug(-t,-t),this.ftext=`The opposing creature gets ${p.jr9(t,t)}.`}wfbF(t){const r=$.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=g.creatByTarget(y.crFriendNotMeTarg(t.creatId));if(e.length>0){const r=R.tick();e.forEach(s=>V.destroy(s,this.code,r))}}zdkC(){this.faction="N",this.rarity="H",this.name="Zombie Dreadknight",this.iAttack=this.boof5814,this.iHealth=this.iAttack-2,this.tribe.push("ZB");const t=this.boof246;this.ftext=`Each friendly creature with Regenerate gets ${p.jr9(t,t)}.`}zdkF(t){const e=this.boof246,r=y.crFriendTarg();r.hasRegen=!0,g.creatByTarget(r).forEach(s=>s.buff(e,e))}}class Me extends P{lookup(t){return{["PYM"]:{c:()=>this.pymC(),g:(r,s)=>this.pymG(r,s)},["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;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("LG",this.code);return s.bonus=this.trigB,r}ddf8(t){return this.validPlayer(t)}jr8(t){this.onGain(this.cardCode(),t),x.triggerDone()}validPlayer(t){return this.hPlayer===0?!0:this.hPlayer===1?t.owner===t.event.playerA:t.owner!==t.event.playerA}pymC(){this.faction="T",this.rarity="R",this.name="Pyre Mystic",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("FR","AS"),this.hPlayer=-1;const t=this.lValS(["","2x ","3x "]);this.text=`When an enemy player gains health, deal ${t}that much damage to the enemy player.`,this.trigB=this.playerNug(this.boof369)}pymG(t,e){k.hurtDirect(e.playerA,e.healAmt*this.level,this.code)}rbgC(){this.faction="U",this.rarity="H",this.name="Runebark Guardian",this.iAttack=this.boof5916,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hPlayer=1;const t=this.boof135;this.text=`When you gain health, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}rbgG(t,e){const r=g.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 ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t),this.hints=["ZZ-1"]}sprvG(t,e){const r=g.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 ${Z.minionName(this.level)}.`,this.trigB=this.rawNug(.5,3,3,0)}tgkG(t,e){const r=this.lValS(["SXD","SPL","TTF"])+this.level;g.birth(r,"S",t.owner)}}class ve extends P{lookup(t){return{["AWU"]:{c:()=>this.awuC(),m:(r,s)=>this.awuM(r,s)},["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,$.toCreature(e.event))}mPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("MV");return s.bonus=this.trigB,r}ddf8(t){return this.validPlayer(t)}jr8(t){this.onMove(this.cardCode(),t),x.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const e=$.toCreature(t.event);return this.mPlayer===1?t.owner===e.creature.owner:t.owner!==e.creature.owner}awuC(){this.faction="T",this.rarity="R",this.name="Arc Wurm",this.iAttack=this.boof4813,this.iHealth=this.iAttack+3,this.tribe.push("LT","EL"),this.iMobile=1,this.mPlayer=1;const t=this.boof234;this.text=`When a friendly creature moves, deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t)}awuM(t,e){k.hurtDirect(!e.creature.owner,this.boof234,this.code)}eweC(){this.faction="T",this.rarity="H",this.name="Emberwind Evoker",this.iAttack=this.boof4914,this.iHealth=this.iAttack+2,this.tribe.push("HM"),this.mPlayer=1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${p.jr9(t,t)}.`,this.trigB=this.buffNug(t,t)}eweM(t,e){const 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.trigB=this.buffNug(t,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.trigB=this.buffNug(this.iAttack,0)}lugM(t,e){if(t.owner===k.getActiveB()){const r=g.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 ${p.jr9(this.level,this.level)}.`,this.trigB=this.buffNug(this.level,this.level)}wbhM(t,e){g.jr5(t.creatId).buff(this.level,this.level)}}class $t 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),p:(r,s)=>this.arootP(r,s)},["ATS"]:{c:()=>this.atrapC(),t:(r,s)=>this.spellMyTurn(r,s),p:(r,s)=>this.atrapP(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),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),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)},["SWA"]:{c:()=>this.swaC(),t:(r,s)=>this.factionSpellMyTurn(r,s),p:(r,s)=>this.swaP(r,s)}}[t]}testPlay(t,e){return this.lookup(t).t(e,e.event)}actPlay(t,e){this.lookup(t).p(e,e.event)}trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e);return this.trigB&&r.jr4("PC"),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=g.jr5(t.creatId);V.destroy(e,this.code)}x.triggerDone()}spellMyTurn(t,e){return e.playerA===t.owner&&G.getCard(e.cardCode).type==="S"}factionSpellMyTurn(t,e){if(e.playerA===t.owner){const r=G.getCard(e.cardCode);if(r.type==="S"&&r.faction===this.faction)return!0}return!1}enemyPlayed(t,e){return e.playerA!==t.owner}ownerAlive(t){return g.jr5(t).status==="A"}agrdC(){this.faction="A",this.rarity="C",this.name="Aetherguard",this.iAttack=this.boof6814,this.iHealth=this.iAttack-1,this.tribe.push("RB"),this.trigB=this.rawNug(0,lt.calcCreatValueFormula(0,0,this.level,0,0,!1,0),0,0),this.text=`When you play a spell, ${this.name} gets Armor ${this.level}.`}agrdP(t,e){g.jr5(t.trigger.creatId).addArmor(this.level)}arootC(){this.faction="U",this.rarity="H",this.name="Aether Root",this.iAttack=this.boof3610,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=[this.lValH(["ZZ+1","ZZ+2","ZZ+3"])];const t=this.boof234;this.text=`When you play an Uterra spell, ${this.name} gets ${p.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t),2)}arootP(t,e){const r=g.jr5(t.trigger.creatId),s=this.boof234;r.buff(s,s)}atrapC(){this.faction="T",this.rarity="C",this.name="Aethertap Shaman",this.iAttack=this.lValN([7,9,16]),this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.trigB=this.rawNug(0,lt.calcCreatValueFormula(0,0,0,0,1,!1,0),0,0),this.text=`When you play a spell, ${this.name} gets Mobility 1 this turn.`}atrapP(t,e){const r=g.jr5(t.trigger.creatId),s=y.mod("MB",1);s.expiry="ET",r.addMod(s)}arbysC(){this.faction="A",this.rarity="H",this.name="Anvillon Arbiter",this.iAttack=this.boof3714,this.iHealth=this.iAttack+3,this.iArmor=1,this.tribe.push("RB"),this.text="When the enemy player plays their second card in a turn, that player discards their hand.",this.trigB=this.rawNug(0,0,0,0,1)}arbysP(t,e){if(E.cardsPlayed>1&&this.ownerAlive(t.creatId)){const 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=G.getCard(this.lwy());this.text=`When you play a spell, Spawn a ${p.tokName(t)}. At the end of your turn, destroy it.`,this.trigB=this.spawnNug(t)}bblhP(t,e){if(this.ownerAlive(t.creatId)){const r=g.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.trigB=this.playerNug(2*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}.`,this.trigB=this.regnNug(t)}dhwP(t,e){g.jr5(t.trigger.creatId).addRegen(this.boof124)}fbiC(){this.faction="T",this.rarity="H",this.name="Flamebreak Invoker",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("FR","GT"),this.text=`When you play a Tempys spell, deal ${this.level} damage to each enemy creature.`,this.trigB=this.buffNug(0,this.level*2)}fbiP(t,e){if(this.ownerAlive(t.creatId)){const r=R.tick();g.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.trigB=this.playerNug(t)}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.`,this.trigB=this.rawNug(0,0,0,0,.5)}izzyT(t,e){if(e.playerA===t.owner){const s=G.getCard(e.cardCode).cardCode();if(s==="IFL"||s==="IFR")return!0}return!1}izzyP(t,e){const r=g.jr5(t.trigger.creatId),l=G.getCard(e.cardCode).cardCode()==="IFL"?"IZL":"IZR";g.birth(`${l}${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.trigB=this.buffNug(this.iAttack,0)}kasP(t,e){const r=g.jr5(t.trigger.creatId);r.extraBattles+=1}swaC(){this.faction="T",this.rarity="H",this.name="Sparkweaver Acolyte",this.iAttack=this.boof4610,this.iHealth=this.boof61218,this.tribe.push("LT","AS"),this.text=`When you play a Tempys spell, ${this.name} gets ${p.jr9(this.iAttack,0)} this turn.`,this.trigB=this.multNug(this.buffNug(this.iAttack,0),.5)}swaP(t,e){const r=g.jr5(t.trigger.creatId),s=y.mod("AT",this.iAttack);s.expiry="ET",r.addMod(s)}}class Re 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]}trigB;actReplace(t,e){this.lookup(t).r(e,$.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("RP");return s.bonus=this.trigB,r}ddf8(t){return t.creatId===t.event.replCreatId}jr8(t){this.actReplace(this.cardCode(),t),x.triggerDone()}kitC(){this.faction="U",this.rarity="H",this.name="Kitaru Sprite",this.iAttack=this.boof358,this.iHealth=this.boof71117,this.tribe.push("FY"),this.hints=["RT"],this.text=`When this is replaced, Spawn a ${this.name}.`,this.trigB=this.buffNug(0,this.iHealth)}kitR(t,e){g.birth(this.code,"S",t.owner)}scootC(){this.faction="A",this.rarity="T",this.name="Relic Scout",this.iAttack=this.level,this.iHealth=this.level,this.iArmor=this.level,this.isFree=!0,this.tribe.push("RB"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${p.jr9(this.level,this.level,!0)} and Armor ${this.level}.`,this.trigB=this.buffNug(this.level,lt.calcCreatValueFormula(this.level,this.level,this.level,0,0,!1,0))}scootR(t,e){e.creature.buff(this.level,this.level),e.creature.addArmor(this.level)}shcrC(){this.faction="U",this.rarity="C",this.name="Shardclaw Crusher",this.iAttack=this.boof5812,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${p.jr9(this.iAttack,this.iAttack)}.`,this.trigB=this.multNug(this.buffNug(this.iAttack,this.iAttack),.5)}shcrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}ssdC(){this.faction="U",this.rarity="R",this.name="Spiritstone Druid",this.iAttack=this.boof4610,this.iHealth=this.lValN([3,4,6]),this.tribe.push("TG"),this.hints=["RT"],this.text=`When ${this.name} is replaced, put a ${this.iAttack}/${this.iHealth} Spirit into each adjacent available lane.`,this.trigB=this.buffNug(this.iAttack,this.iHealth),this.trigB.count=1}ssdR(t,e){const r=e.replCreat.adjacent,s=g.emptyLanes(t.owner),l=R.tick();r.forEach(f=>{s.includes(f)&&g.birth("SPU"+this.level,"P",t.owner,f,l)})}}class le 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)},["WEB"]:{c:()=>this.webC(),u:(r,s)=>this.webR(r,s)}}[t]}actUpgrade(t,e){this.lookup(t).u(e,$.toReplaced(e.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){return this.rarity==="T"?super.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e);return r.jr4("UP"),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=R.tick(),s=this.boof468;g.creatByTarget(y.crNotMeTarg(t.creatId)).forEach(l=>l.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 ${p.jr9(this.iAttack,this.iAttack)}.`}stgrR(t,e){e.creature.buff(this.iAttack,this.iAttack)}weldC(){this.faction="A",this.rarity="R",this.name="Vault Welder",this.iAttack=this.boof71118,this.iHealth=this.lValN([9,14,22]),this.iDefend=!0,this.tribe.push("RB"),this.hints=["RD"],this.text=`Upgrade: Negate Defender from ${this.name}.`}weldR(t,e){e.creature.negateDefender=!0}webC(){this.faction="N",this.rarity="T",this.name="Web",this.iAttack=0,this.iHealth=1,this.iDefend=!0,this.tribe.push("WB"),this.text=`Upgrade: ${this.name} attack and health become equal to the creature it replaced.`}webR(t,e){e.creature.buff(e.replCreat.attack,e.replCreat.health-1)}}class St 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)},["FSC"]:{c:()=>this.flwcC(),v:(r,s)=>this.flwcV(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,$.toCreature(e.event))}vtext="";trigB;fixedImgCreat=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.trigB&&(this.text="Vengeance: "+this.vtext),this.vtext=""}image(t){return this.fixedImgCreat?this.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e);if(this.trigB){const s=r.jr4("VN");s.bonus=this.trigB}return 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 ${p.jr9(t,t)}.`;const e=this.boof246;this.trigB=this.buffNug(e,e)}cfiendV(t,e){const r=-this.level,s=R.tick(),l=y.crTarg();l.player=k.toTarget(!t.owner),g.creatByTarget(l).forEach(f=>f.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.trigB=this.buffNug(3,3)}corpsV(t,e){const r=`${"ZBS"}${this.level}`;g.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.trigB=this.buffNug(1,1)}cslmV(t,e){const r=`${"COZ"}${this.level}`;g.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.trigB=this.buffNug(t,t)}dskV(t,e){const r=`${"SPN"}${this.level}`;g.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=G.getCard(this.fsz());this.vtext=`Spawn a ${p.tokName(t)}.`,this.trigB=this.multNug(this.buffNug(t.iAttack,t.iHealth),.5)}fstrV(t,e){g.birth(this.fsz(),"S",e.creature.owner)}fsz(){return "ZST"+this.level}fwlkC(){this.faction="N",this.rarity="C",this.name="Fell Walker",this.iAttack=this.boof359,this.iHealth=this.iAttack,this.tribe.push("ZB");const t=G.getCard(Z.zomc(this.level));this.vtext=`Put a ${p.tokName(t)} into this lane.`,this.trigB=this.buffNug(t.iAttack,t.iHealth)}fwlkV(t,e){g.birth(Z.zomc(this.level),"P",e.creature.owner,e.creature.lane)}ffC(){this.faction="N",this.rarity="H",this.name="Fleshfiend",this.iAttack=this.boof6812,this.iHealth=this.iAttack,this.tribe.push("AB"),this.vtext=`Put a level ${this.level-1} ${this.name} into this lane.`,this.level>1&&(this.trigB=this.buffNug(0,this.lValN([0,6,15])))}ffV(t,e){const r=`${"FFD"}${this.level-1}`;g.birth(r,"P",e.creature.owner,e.creature.lane)}flwcC(){this.faction="A",this.rarity="C",this.name="Flowsteel Carrier",this.iAttack=this.boof5915,this.iHealth=this.boof358,this.tribe.push("RB"),this.vtext=`Give a friendly Robot at random Armor ${this.iHealth}.`,this.trigB=this.regnNug(this.iHealth)}flwcV(t,e){const r=y.crTarg();r.player=k.toTarget(t.owner),r.tribe="RB";const s=g.creatByTarget(r);if(s.length>0){const l=s[S.randInt(0,s.length)];l.addArmor(this.iHealth),this.logAct(!1,l)}}ghsC(){this.faction="U",this.rarity="C",this.name="Glowhive Siren",this.iAttack=this.boof3814,this.iHealth=this.boof61117,this.tribe.push("IN"),this.vtext=`You gain ${this.boof124} to ${this.gghigh-1} health.`,this.trigB=this.playerNug(this.boof258)}ghsV(t,e){const 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.trigB=this.playerNug(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=Z.minionBuff(this.level),e=Z.minionName(this.level);this.vtext=`Put a ${t}/${t} ${e} into this lane.`,this.trigB=this.buffNug(t,t)}gromV(t,e){const r=Z.minionCode(this.level);g.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.`,this.trigB=this.rawNug(0,0,0,0,this.level*lt.dcWeight)}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.trigB=this.buffNug(t,t)}nyozV(t,e){const r=`${"OOZ"}${this.level}`;g.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=["LB"],this.vtext=`Spawn a level ${this.level+1} ${this.name}.`,this.level<3){const t=this.lValN([10,6,0]);this.trigB=this.buffNug(t,t)}}poxV(t,e){const r=`${"POX"}${this.level+1}`;g.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 ${p.levelGateText(this.level,!0)}spell at random from your discard pile into your hand.`,this.trigB=this.rawNug(0,0,0,0,.5)}rszV(t,e){const r=k.toPlayer(t.owner),s=y.target("TD");s.player=k.toTarget(r),s.card="S",s.level=D.ddf2(this.level);const l=D.deckByTarget(s);if(l.length>0){const f=l[S.randInt(0,l.length)];r.discard.splice(f[1],1),r.hand.push(f[0])}}spirmC(){this.faction="T",this.rarity="H",this.name="Spiritflame Mystic",this.iAttack=this.boof6912,this.iHealth=this.iAttack-3,this.tribe.push("HM"),this.vtext=`Deal ${this.boof246} damage to each creature.`,this.trigB=this.rawNug(0,0,0,0,.2)}spirmV(t,e){const r=this.boof246,s=R.tick();g.qActiveCreats().forEach(l=>l.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"],this.trigB=this.buffNug(this.iAttack,this.iAttack)}sssV(t,e){(e.creature.lane===1||e.creature.lane===5)&&g.birth(e.creature.code,"S",t.owner)}vgfsC(){this.faction="N",this.rarity="C",this.name="Vengeful Spirit",this.iAttack=this.boof357,this.iHealth=this.iAttack-2,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof369n;this.vtext=`Give the opposing creature ${p.jr9(t,t)}.`,this.trigB=this.buffNug(-t,-t)}vgfsV(t,e){const 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.trigB=this.playerNug(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.vtext=`Spawn a Zimus, the ${this.level===2?"Returned":"Undying"}.`,this.level<3?(this.hints=["LG"],this.level===2?(this.trigB=this.buffNug(this.iAttack,this.iHealth),this.hints.push("ZZ-5")):this.hints.push("ZZ-1")):(this.hints=["ST","ZZ-5"],this.trigB=this.buffNug(this.iAttack,this.iHealth),this.trigB.bonus=1)}zimusV(t,e){let r;this.level===2?r=`${"ZTR"}2`:r=`${"ZTU"}3`,g.birth(r,"S",t.owner)}}class hi extends kt{lookup(t){return{["IRT"]:{c:()=>this.infrC(),m:r=>this.infrM(r)},["NXB"]:{c:()=>this.nexbC(),m:r=>this.nexbM(r)}}[t]}createMod(t,e){return this.lookup(t).m(e)}constructor(t){super(t),this.overload=!0,this.maxLevel=1,this.lookup(this.cardCode()).c()}nexus=!1;playTargets(){const t=super.playTargets();return t.push(y.playerActTarg("F","CARD",this.code,"")),t}handleAction(t){this.logSpell();const e=k.toPlayer(t.playerA),r={effId:R.genId(),logicCode:this.code};e.effects.push(r),this.enforcePlayerEffect(r,e),T.spellCast()}enforcePlayerEffect(t,e){const r=this.cardCode(),s=this.createMod(r,t.effId),l=this.nexus?[3]:[1,5];g.qPlayerCreats(e.isPlayerA).forEach(f=>{f.faction===this.faction&&l.includes(f.lane)?f.addModSafe(s):f.removeModSafe(t.effId)})}infrC(){this.faction="N",this.rarity="L",this.name="Infernal Ritual",this.text='You get "Each friendly Nekrium creature in the side lanes get Regenerate 2".'}infrM(t){return y.mod("RG",2,t)}nexbC(){this.faction="A",this.rarity="L",this.name="Nexus Bubble",this.nexus=!0,this.text='You get "Friendly Alloyin creatures in the center lane get Armor 3".'}nexbM(t){return y.mod("AR",3,t)}}class It extends kt{lookup(t){return{["AEC"]:{c:()=>this.anceC(),p:r=>this.aeZ(r)},["DIS"]:{c:()=>this.disnC(),p:r=>this.disnZ(r)},["DRE"]:{c:()=>this.dracC(),p:r=>this.deZ(r)},["DCH"]:{c:()=>this.dchantC(),p:r=>this.dchantZ(r)},["EVT"]:{c:()=>this.endvC(),p:r=>this.endvZ(r)},["ESU"]:{c:()=>this.esrgC(),p:r=>this.esrgZ(r)},["HOX"]:{c:()=>this.howlC(),p:r=>this.howlZ(r)},["IGR"]:{c:()=>this.icegC(),p:r=>this.icegZ(r)},["ITO"]:{c:()=>this.itorC(),p:r=>this.itorZ(r)},["IME"]:{c:()=>this.imecC(),p:r=>this.ieZ(r)},["LCE"]:{c:()=>this.lucidC(),p:r=>this.leZ(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(y.playerActTarg(this.playTarg,"CARD",this.code,"")),t}handleAction(t){this.logSpell();const e=k.toPlayer(t.playerA);this.cardCast(this.cardCode(),e),T.spellCast()}ddf8(t){if(t.trigger.type==="TE")return t.event.playerA===t.owner;if(t.trigger.type==="PC"){const e=t.event,r=G.getCard(e.cardCode);return r.type==="S"&&r.faction==="T"&&e.playerA===t.owner}else if(t.trigger.type==="EF"){const e=$.toEnterField(t.event);return e.creature.faction==="U"&&e.creature.owner===t.owner}else return!1}jr8(t){const e=Nt.extractCardCode(t.trigger.logicCode),r=t.event;let s=!1;if(e==="LCE"){s=!0;const l=k.toPlayer(r.playerA),f=this.level===1?1:2;this.logAct(!1),k.drawCard(l,f)}else if(e==="IME"){s=!0;const l=V.gravedigger(k.toTarget(t.owner),D.ddf2(this.level+1));l&&g.birth(l,"S",r.playerA)}else if(e==="DRE"){s=!0;const l=this.level===1?11:21;k.hurtDirect(!r.playerA,S.randInt(1,l),this.code)}else if(e==="IGR")k.hurtDirect(!r.playerA,2,this.code);else if(e==="EVT"){const l=$.toEnterField(t.event);l.creature.buff(1,1),this.logAct(!1,l.creature)}else if(e==="AEC"){s=!0;const l=g.qPlayerCreats(t.owner);if(l.length>0){const f=this.level===1?[1,2]:[2,4];l.forEach(m=>{this.logAct(!1,m),m.buff(f[0],f[1])})}}else super.jr8(t);if(s&&this.level<3){const l=k.toPlayer(r.playerA),f=y.trigIdx(l.triggers,t.trigger);f>-1?t.trigger.customCode==="P2"?l.triggers[f].customCode="P1":l.triggers.splice(f,1):console.error("Wery curious, could not find player trigger ",t.trigger)}x.triggerDone()}echTxt(){return"At the end of "+(this.level===3?"each of your turns":"this turn and your next turn")+", "}echoZ(t){const e=y.trigger("TE",this.code);return this.level<3&&(e.customCode="P2"),e.changes=!0,t.triggers.push(e),e}anceC(){this.faction="U",this.rarity="L",this.name="Ancestral Echoes",this.playTarg="F";const t=this.level===1?[1,2]:[2,4];this.text=`${this.echTxt()}each friendly creature gets ${p.jr9(t[0],t[1])}.`}aeZ(t){const e=this.echoZ(t),r=this.boof248;e.bonus=this.buffNug(r,r*2)}disnC(){this.faction="T",this.rarity="R",this.name="Disintigrate",this.playTarg="E",this.text=`Deal 1 to ${this.dshigh-1} damage to the enemy player.`}disnZ(t){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.`}deZ(t){const e=this.echoZ(t),r=this.lValN([4,9,25]);e.bonus=this.playerNug(r)}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){k.heal(t,this.boof81220)}endvC(){this.faction="U",this.rarity="L",this.name="Enduring Vitality",this.overload=!0,this.maxLevel=1,this.playTarg="F",this.text=`You get "When a friendly Uterra creature enters play, it gets ${p.jr9(1,1)}".`}endvZ(t){const e=y.trigger("EF",this.code);e.changes=!0,t.triggers.push(e),e.bonus=this.buffNug(4,4)}esrgC(){this.faction="A",this.rarity="R",this.name="Energy Surge",this.isFree=this.level>1,this.overload=this.level===3,this.level===1&&(this.hints=["LG"]),this.playTarg="F",this.text=`Draw ${this.level} card${this.level>1?"s":""}.`}esrgZ(t){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)}icegC(){this.faction="T",this.rarity="L",this.name="Ice Grasp",this.overload=!0,this.maxLevel=1,this.playTarg="F",this.text='You get "When you play a Tempys spell, deal 2 damage to the enemy player".'}icegZ(t){const e=y.trigger("PC",this.code);e.changes=!0,t.triggers.push(e),e.bonus=this.playerNug(6)}itorC(){this.faction="T",this.rarity="R",this.name="Ice Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg="E",this.text=`Deal ${this.boof234} damage to the enemy player.`}itorZ(t){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 ${p.levelGateText(this.level+1,!0)}creature that was destroyed this game`;this.text=`${this.echTxt()}${t}.`}ieZ(t){const e=this.echoZ(t),r=this.lValN([1,1,3]);e.bonus=this.multNug(this.avgSpawnNug(),r)}lucidC(){this.faction="A",this.rarity="L",this.name="Lucid Echoes",this.playTarg="F";const t=this.level===1?"draw 1 card":"draw 2 cards";this.text=`${this.echTxt()}${t}.`}leZ(t){const e=this.echoZ(t),r=this.boof124*lt.dcWeight;e.bonus=this.rawNug(0,0,0,0,r)}mendC(){this.faction="U",this.rarity="R",this.name="Mending Spring",this.playTarg="F",this.text=`You gain 1 to ${this.mendboof} Health.`}mendZ(t){ht.simOn?this.boof61224:this.mendboof+1,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 Yr 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 ${p.dbdtap()}, ${this.name} gets ${p.jr9(this.level,this.level)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM"),l=this.boof246;return s.bonus=this.buffNug(l,l),r}ddf8(t){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcCreat.owner===t.owner}jr8(t){g.jr5(t.creatId).buff(this.level,this.level),x.triggerDone()}}class Gt 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="";trigB;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Gain Rank: "+this.rtext,this.rtext=""}image(t){return this.rarity==="T"?this.cardCode()==="FWC"?this.rawImage("MPH",t):super.fixedImage(t):super.image(t)}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("RU");return s.bonus=this.trigB,r}ddf8(t){return t.event.playerA===t.owner}jr8(t){this.lookup(this.cardCode()).r(t),x.triggerDone()}avinvC(){this.faction="T",this.rarity="H",this.name="Avalanche Invoker",this.iAttack=this.boof6914,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS"),this.hints=["TL"];const t=this.boof3612;this.trigB=this.buffNug(t,0),this.rtext=`Deal ${t} damage to each non-Tempys creature.`}avinvR(t){const e=this.boof3612,r=R.tick();g.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.trigB=this.buffNug(0,-t),this.rtext=`The opposing creature gets ${p.jr9(t,t)}.`}bskphR(t){const r=g.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.trigB=this.rawNug(0,0,0,0,.2),this.rtext=`Negate Defender from ${this.name}.`}crucR(t){const e=g.jr5(t.creatId);e.negateDefender=!0}ebknC(){this.faction="N",this.rarity="H",this.name="Ebonskull Knight",this.iAttack=this.lValN([9,13,18]),this.iHealth=this.iAttack-2,this.tribe.push("VP"),this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,-1),this.rtext=`Destroy ${this.name}.`}ebknR(t){const e=g.jr5(t.creatId);V.destroy(e,this.code)}fwcC(){this.faction="U",this.rarity="T",this.maxLevel=1,this.name="Feywing Chrysalis",this.iAttack=0,this.iHealth=3,this.tribe.push("CR"),this.iDefend=!0,this.trigB=this.buffNug(5,5),this.rtext=`Replace ${this.name} with a 9/9 Feywing.`}fwcR(t){const e=g.jr5(t.creatId);g.birth(`${"FWG"}1`,"R",e.owner,e.lane)}feggC(){this.faction="T",this.rarity="T",this.minLevel=this.level,this.maxLevel=this.level,this.name="Frostmane Egg",this.iAttack=0,this.iHealth=6,this.tribe.push("DG"),this.iDefend=!0;const t=this.lValN([6,9,13]);this.trigB=this.buffNug(t,t),this.rtext=`Replace ${this.name} with a level ${this.level} Frostmane Dragon.`}feggR(t){const e=g.jr5(t.creatId);g.birth(`${"FMD"}${this.level}`,"R",e.owner,e.lane)}mmovC(){this.faction="A",this.rarity="C",this.name="Metamind Overseer",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("MM"),this.hints=["TL"],this.trigB=this.rawNug(0,0,0,0,lt.dcWeight*.6),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.trigB=this.multNug(this.avgSpawnNug(),.4),this.rtext="Spawn a random creature that was destroyed this game."}porshR(t){const e=V.gravedigger();e&&g.birth(e,"S",t.owner)}runegC(){this.faction="U",this.rarity="H",this.name="Runegrove Guardian",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("PL"),this.hints=["TL"],this.trigB=this.buffNug(0,this.iAttack),this.rtext=`${this.name} gets ${p.jr9(this.iAttack,this.iAttack)}.`}runegR(t){g.jr5(t.creatId).buff(this.iAttack,this.iAttack)}solrevC(){this.faction="U",this.rarity="L",this.name="Solstice Reveler",this.iAttack=this.boof4816,this.iHealth=this.iAttack,this.tribe.push("HM"),this.hints=["TL"];const t=this.boof248;this.trigB=this.buffNug(t,t);const e=this.level===3;let r="";e&&(r=", and Breakthrough"),this.rtext=`Each friendly creature gets ${p.jr9(t,t,e)}${r}.`}solrevR(t){const e=this.boof248;g.ddf1().forEach(r=>{r.buff(e,e),this.level===3&&(r.breakthrough=!0)})}spshamC(){this.faction="T",this.rarity="C",this.name="Spiritfrost Shaman",this.iAttack=this.boof71117,this.iHealth=this.boof4610,this.tribe.push("HM"),this.hints=["TL"];const t=this.boof579;this.rtext=`Deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t)}spshamR(t){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}.`,this.trigB=this.buffNug(0,this.iHealth)}snoutR(t){g.jr5(t.creatId).heal(this.snoutbof)}get snoutbof(){return this.level*10}mantisC(){this.faction="U",this.rarity="C",this.name="Umbraglim Mantis",this.iAttack=this.boof6914,this.iHealth=this.iAttack-1,this.tribe.push("IN"),this.hints=["TL"];const t=this.mantbof;this.rtext=`You gain ${t} health.`,this.trigB=this.playerNug(t/3)}mantisR(t){k.heal(t.owner,this.mantbof)}get mantbof(){return this.lValN([8,10,12])}}class Kr extends kt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Remembrance",this.text=`Banish a ${p.levelGateText(this.level,!0)}creature from your discard pile, then Spawn a copy of it.`}playTargets(){const t=super.playTargets();if(this.remCrds().length===0)return t;const e=D.boardTarget("CARD",this.code);return e.param="P1",t.push(e),t}remCrds(){const t=k.getActive(),e=y.target("TD");return e.player=k.toTarget(t),e.card="C",e.level=D.ddf2(this.level),Dt.generateContent(t.discard,!1,e)}handleAction(t){if(t.param==="P1"){const e=this.remCrds(),r=e.map(l=>{const f=y.deckSelectAction("CARD",l.cardCode,l.sourceIdx);return f.host=this.code,f}),s=T.cancelAction();s.param="PM",r.push(s),Dt.showCustomDeck(e,r)}else{const e=t,r=k.getActive();r.discard.splice(e.position,1);const s=g.birth(e.card,"S",r.isPlayerA);this.logSpell(s),At.popMode(),T.spellCast()}}}class Xr 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} ${p.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM");return s.interactive=!0,s.bonus=this.buffNug(this.iAttack,0),r}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId&&t.owner===k.getActiveB()}jr8(t){const e=D.toActions(y.crEnemyActTarg("CARD",this.code,S.enTil(t.creatId,t.event.dmg)));e.length>0?(e.push(T.noneEndTrigger()),T.ddf5(e)):x.triggerDone()}handleAction(t){const e=S.deTil(t.param);g.ddf6(t).hurtDirect(parseInt(e[1]),this.code),T.actionDone(!0)}}class qr extends Ut{jr3(t,e){const r=super.jr3(t,e);return r.jr4("AS"),r}jr8(t){if(t.trigger.type==="AS"){let e=!0;for(;e;){const r=g.birth(this.code,"S",t.owner);r?r.opposed&&(e=!1):e=!1}x.triggerDone()}else super.jr8(t)}}class jr 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");let e=": ",r=1;this.level<3&&(e=", destroy another friendly creature: ",r=.5);const s=`Destroy an enemy ${p.levelGateText(this.level+1,!0)}creature.`;this.text=`Activate${e}${s}`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),r)}}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){let e;this.level===3?e=this.enemies(t):e=this.friends(t),e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param),r=g.jr5(e[0]),s=g.ddf6(t);if(e[1]==="P1"){const l=this.enemies(r,s.id);l.push(T.cancelAction()),T.ddf5(l)}else{this.logAct(!0);const l=R.tick();if(this.level<3){const f=g.jr5(e[2]);V.destroy(f,this.code,l)}V.destroy(s,this.code,l),r.endActivation()}}friends(t){const e=y.crFriendNotMeActTarg("CARD",t.id,this.code,S.enTil(t.id,"P1"));return D.toActions(e)}enemies(t,e=""){const r=y.crEnemyActTarg("CARD",this.code,S.enTil(t.id,"P2",e));return r.level=D.ddf2(this.level+1),D.toActions(r)}}class Jr 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={activ8:this.rawNug(0,0,0,0,this.level*.5)}}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){const e=this.enemies(t);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param),r=g.jr5(e[1]);if(e[0]==="P1"){const s=g.ddf6(t),l=this.empties(r,s.id);l.push(T.cancelAction()),T.ddf5(l)}else{const s=g.jr5(e[2]);this.logAct(!0,s),s.move(t.lane),r.endActivation()}}empties(t,e=""){const r=y.emptyPlayerActTarg("E","CARD",this.code,S.enTil("P2",t.id,e));return D.toActions(r)}enemies(t){const e=y.crEnemyActTarg("CARD",this.code,S.enTil("P1",t.id));return D.toActions(e)}}class Qr extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Shadowsmith",this.iAttack=this.boof3612,this.iHealth=this.boof6915,this.tribe.push("DF","HM"),this.text=`When ${this.name} or another friendly Darkforged enters play on your turn, you may discard and level up a card.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("EF");return s.bonus=this.rawNug(0,0,0,0,.5),s.interactive=!0,r}handleAction(t){E.levelAndDiscardA(t),T.actionDone(!0)}ddf8(t){const e=$.toCreature(t.event);return e.creature.owner===t.owner&&t.owner===k.activePlayer&&e.creature.isTribe("DF")}jr8(t){const e=y.lvlHandActTarg(this.code,t.creatId),r=D.toActions([e,D.buttonTarget("NOTR")]);r.length>1?T.ddf5(r):x.triggerDone()}}class Ee 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=p.levelGateText(this.level-1);this.text=`When you play a ${r} ${p.factionText(this.faction)} card, you may ${this.tuxt}.`}else this.hints=["LG"];this.tuxt=""}tuxt="";dark(){this.faction="N",this.name="Darkshaper Savant",this.tribe.push("ZB");const t=-this.boof135;this.tuxt=`give an enemy creature ${p.jr9(t,t)}`}life(){this.faction="U",this.name="Lifeshaper Savant",this.tribe.push("SE");const t=this.boof135;this.tuxt=`give another friendly creature ${p.jr9(t,t)}`}steel(){this.faction="A",this.name="Steelshaper Savant",this.tribe.push("HM"),this.tuxt=`give another friendly creature Armor ${this.boof124}`}flame(){this.faction="T",this.name="Flameshaper Savant",this.tribe.push("HM"),this.tuxt=`deal ${this.boof147} damage to target creature or player`}jr3(t,e){const r=super.jr3(t,e);if(this.level>1){const s=r.jr4("PC");s.interactive=!0,s.bonus=this.rawNug(0,0,0,0,this.level*.5)}return r}ddf8(t){if(t.event.playerA===t.owner){const e=G.getCard(t.event.cardCode);if(e.level0}startActivation(t){const e=this.empties(t);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){this.logAct(!0);const e=g.jr5(t.param);g.birth(`${this.hc()}`,"P",t.playerA,t.lane),e.endActivation()}empties(t){const e=y.emptyPlayerActTarg("F","CARD",this.code,t.id);return D.toActions(e)}}class es 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=y.mod("ND",!0,e.id);g.qActiveCreats().forEach(l=>l.addModSafe(s))}else g.qActiveCreats().forEach(s=>s.removeModSafe(e.id))}}class is extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Spiritcleave",this.text=`Destroy a ${p.levelGateText(this.level+1,!0)}creature with the highest health among all creatures.${this.level===3?"~You gain health equal to that creature's health.":""}`}playTargets(){const t=super.playTargets();let e=-1;const r=g.qActiveCreats();r.forEach(f=>{f.health>e&&(e=f.health)});const s=r.filter(f=>f.health===e).map(f=>f.id),l=y.crActTarg("CARD",this.code,"");return l.level=D.ddf2(this.level+1),l.victims=S.enTil(...s),this.level<3&&(l.hint=["KL"]),t.push(l),t}handleAction(t){this.logSpell();const e=g.ddf6(t);V.destroy(e,this.code),this.level===3&&k.heal(k.getActiveB(),e.health),T.spellCast()}}class rs extends kt{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Spiritleash";const e=this.boof5814;this.text=`Destroy a friendly creature.~Give a creature ${p.jr9(e,e)}.`}playTargets(){const t=super.playTargets(),e=y.crFriendActTarg("CARD",this.code,"P1");return g.creatByTarget(e).length>0&&g.qActiveCreats().length>1&&t.push(e),t}handleAction(t){const e=S.deTil(t.param),r=g.ddf6(t);if(e[0]==="P1"){const s=y.crNotMeActTarg("CARD",r.id,this.code,S.enTil("P2",r.id));s.hint=["BF"];const l=D.toActions(s);l.push(T.cancelAction()),T.ddf5(l)}else{this.logSpell(r);const s=g.jr5(e[1]),l=this.boof5814;V.destroy(s,this.code),r.buff(l,l),T.spellCast()}}}class ss 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} ${p.dbdtac()}, this gets ${p.jr9(this.level,this.level)}.~Allied Tempys: Activate: Deal ${this.level} damage to another creature. This gets ${p.jr9(this.level,this.level)}.`}jr3(t,e){const r=super.jr3(t,e);r.jr4("FR");const s=r.jr4("DM");return s.bonus=this.buffNug(this.level,this.level),r}zapTargs(t){const e=y.crNotMeActTarg("CARD",t,this.code,t);return e.hint=["HR"],D.toActions([e,D.buttonTarget("CANC")])}canActivate(t){return this.zapTargs(t.id).length>1&&t.hasMod(t.id)}startActivation(t){T.ddf5(this.zapTargs(t.id))}ddf8(t){return t.event.battle&&t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}handleAction(t){const e=g.ddf6(t),r=g.jr5(t.param);this.logAct(!0),e.hurtDirect(this.level,this.code),r.buff(this.level,this.level),r.endActivation()}jr8(t){const e=g.jr5(t.creatId);if(t.trigger.type==="FR"){if(E.allied("T")){e.addMod(y.mod("AL",!0,e.id)),e.changed=!0;const r=e.jr4("NT");r.bonus=this.buffNug(this.boof246,this.level)}}else t.trigger.type==="DM"&&e.buff(this.level,this.level);x.triggerDone()}}class as 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");return s.interactive=!0,s.bonus=this.rawNug(0,0,0,0,.5),r}handleAction(t){const e=g.ddf6(t);this.logAct(!1,e);const r=y.mod("DF",!0);r.expiry="EN",e.addMod(r),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&G.getCard(t.event.cardCode).type==="S"}jr8(t){const e=y.crFriendActTarg("CARD",this.code,t.creatId);e.canDefender=!0;const r=D.toActions(e);r.length===0?x.triggerDone():(r.push(T.noneEndTrigger()),T.ddf5(r))}}class ns 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.text=`Upgrade: You may ${p.daluac()}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("UP");return s.interactive=!0,r}handleAction(t){E.levelAndDiscardA(t),T.actionDone(!0)}jr8(t){const e=y.lvlHandActTarg(this.code,t.creatId),r=D.toActions(e);r.length>0?(r.push(T.noneEndTrigger()),T.ddf5(r)):x.triggerDone()}}class os 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"],this.level===3?this.text="Activate: Level up a card in your hand. You may use this ability twice each turn.":this.text="Activate: Level a card in your hand, then discard it if its level is higher than your Rank.",this.bonus={activ8:this.rawNug(0,0,0,0,this.lValN([.8,1.7,3]))}}jr3(t,e){const r=super.jr3(t,e);return this.level===3&&(r.jr4("TS"),this.addExtraActivate(r)),r}jr8(t){if(t.trigger.type==="TS"){const e=g.jr5(t.creatId);this.addExtraActivate(e),x.triggerDone()}}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>G.getCard(r).canLevel())}startActivation(t){const e=y.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),r=k.toPlayer(e.owner);this.level===3||r.rank>parseInt(t.card.slice(3))?r.hand[t.position]=G.getCard(t.card).levelUpCard():E.levelAndDiscardA(t),e.endActivation()}}class hs 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 ${p.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 l=r.addEffect("PS",this.code);return l.area="C",r}enforceEffect(t,e){const r=y.crNotMeTarg(e.id);if(r.player=k.toTarget(e.owner),g.creatByTarget(r).some(l=>!l.defender))e.removeModSafe(e.id);else{const l=y.mod("AT",this.iAttack,e.id),f=y.mod("AR",this.boof246,e.id),m=y.mod("BT",!0,e.id);e.addModSafe(l),e.addModSafe(f),e.addModSafe(m)}}}class ls 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.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=this.boof246,s=super.jr3(t,e),l=s.jr4("TS");l.bonus=this.rawNug(0,0,r,0,.2);const f=s.jr4("FK");return f.bonus=this.buffNug(r,0),s}ddf8(t){return!0}jr8(t){if(t.trigger.type==="TS"){const e=g.emptyLanes(t.owner);e.length>0&&g.jr5(t.creatId).move(e[S.randInt(0,e.length)]),x.triggerDone()}else if(t.trigger.type==="FK"){const r=$.toCreature(t.event).creature.opposed;r&&r.hurtDirect(this.boof246,this.code),x.triggerDone()}else super.jr8(t)}}class cs 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.bonus={activ8:this.buffNug(6,0)},this.text="Activate: Deal damage equal to a friendly creature's Armor to an enemy creature.~Forge: Each friendly creature gets Armor 6."}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),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(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param),r=g.ddf6(t);if(e[1]==="P1"){const s=this.enemies(e[0],r.id);s.push(T.cancelAction()),T.ddf5(s)}else if(e[1]==="P2"){const s=g.jr5(e[0]),l=g.jr5(e[2]);this.logAct(!0,l),r.hurtDirect(l.armor,this.code),s.endActivation()}}jr8(t){g.ddf1().forEach(e=>e.addArmor(6)),x.triggerDone()}friends(t){const e=y.crFriendActTarg("CARD",this.code,S.enTil(t,"P1"));return e.hasArmor=!0,D.toActions(e)}enemies(t,e=""){const r=y.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",e));return D.toActions(r)}}class ds 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: ${p.daluac(!0)}.`,e=.5),this.bonus={activ8:this.rawNug(0,0,0,0,e)}}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>G.getCard(r).canLevel())}startActivation(t){const e=y.lvlHandActTarg(this.code,t.id);e.hint?.push("DF"),T.ddf5(D.toActions([e,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const e=g.jr5(t.param),r=k.toPlayer(e.owner);this.level===3?r.hand[t.position]=G.getCard(t.card).levelUpCard():E.levelAndDiscardA(t),e.endActivation()}}class us extends bt{jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),r}jr8(t){if(t.trigger.type==="FR"){const e=t.owner?E.deathsA.length:E.deathsB.length;if(e>0){const r=R.tick();for(let s=0;s0}}class gs 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 ${p.jr9(0,this.iHealth)}.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("FR");return s.interactive=!0,r}jr8(t){const e=y.crActTarg("CARD",this.code,"");e.hint=["BF"];const r=y.actionTarget("TP","CARD",this.code,"");r.hint=["BF"];const s=[e,r,D.buttonTarget("NOTR")],l=D.toActions(s);T.ddf5(l)}handleAction(t){if(t.zone==="P")k.heal(t.playerA,this.iHealth);else{const e=g.ddf6(t);this.logAct(!1,e),e.buff(0,this.iHealth)}T.actionDone(!0)}}class ms extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Tremorsaur",this.iAttack=0,this.iHealth=this.lValN([8,16,24]),this.tribe.push("DN"),this.text=`When you are dealt damage, ${this.name} gets +attack equal to ${this.level===3?"2x ":""}the damage dealt.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("DM");return s.bonus=this.buffNug(this.boof3610,0),r}ddf8(t){return!t.event.isCreatTarg&&t.event.target===t.owner}jr8(t){const e=this.level===3?2:1;g.jr5(t.creatId).buff(t.event.dmg*e,0),x.triggerDone()}}class ps extends kt{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Trial by Combat";const e=this.boof369;this.text=`Give a friendly creature ${p.jr9(e,0)} this turn. Then it and an enemy creature deal damage equal to their attacks to each other.`}playTargets(){const t=super.playTargets();return this.baddies().length>0&&t.push(y.crFriendActTarg("CARD",this.code,"P1")),t}handleAction(t){const e=S.deTil(t.param),r=g.ddf6(t);if(e[0]==="P1"){const s=T.cancelAction(),l=this.baddies(r.id);l.push(s),T.ddf5(l)}else{const s=g.jr5(e[1]),l=y.mod("AT",this.boof369);s.addMod(l);const f=R.tick();r.hurtDirect(s.attack,this.code,f),s.hurtDirect(r.attack,this.code,f),T.spellCast()}}baddies(t=""){return D.toActions(y.crEnemyActTarg("CARD",this.code,S.enTil("P2",t)))}}class Te extends P{lookup(t){return{["IKA"]:{c:()=>this.ikaC(),t:r=>this.ikaT(r)},["RSD"]:{c:()=>this.rsdC(),t:r=>this.rsdT(r)},["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;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("TE");return s.bonus=this.trigB,r}ddf8(t){return 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}ikaC(){this.faction="T",this.rarity="L",this.name="Ignir, Khan of Ashur",this.iAttack=this.lValN([4,8,14,24]),this.iHealth=this.iAttack,this.tribe.push("FB"),this.maxLevel=4;let t;this.level<3?(this.hints=["LG","ZZ-2"],t="an enemy creature or player at random."):this.level===3?t="an enemy creature at random and the enemy player.":t="each enemy creature and player.",this.mPlayer=1,this.trigB=this.buffNug(0,this.iAttack),this.text=`At the end of your turn, deal ${this.iAttack} damage to `+t}ikaT(t){const e=g.qEnemyCreats(),r=e.length>0;let s=this.level>2,l=-1;if(this.level===4&&r){const f=R.tick();e.forEach(m=>m.hurtDirect(this.iAttack,this.code,f))}if(this.level===3&&r&&(l=S.randInt(0,e.length)),this.level<3){const f=S.randInt(0,e.length+1);f===e.length?s=!0:l=f}l>-1&&e[l].hurtDirect(this.iAttack,this.code),s&&k.hurtDirect("E",this.iAttack,this.code)}rsdC(){this.faction="U",this.rarity="L",this.name="Rubyscale Dragon",this.iAttack=this.lValN([2,8,18]),this.iHealth=this.lValN([7,11,24]),this.tribe.push("DG"),this.level===1?(this.iDefend=!0,this.hints=["LG"]):(this.iMobile=1,this.level===3&&(this.hints=["ZZ-5"])),this.mPlayer=1;const t=this.lValN([1,2,5]);this.trigB=this.playerNug(t),this.text=`At the end of your turn, you and each other friendly creature gets ${p.jr9(0,t)}.`}rsdT(t){const e=this.lValN([1,2,5]);g.creatByTarget(y.crFriendNotMeTarg(t.creatId)).forEach(s=>s.buff(0,e)),k.heal(t.owner,e)}ssdC(){this.faction="T",this.rarity="L",this.name="Smolderscale Dragon",this.iAttack=this.lValN([0,3,15]),this.iHealth=this.lValN([6,13,30]),this.tribe.push("DG"),this.level===3?this.iMobile=2:(this.hints=["LG"],this.iDefend=!0),this.mPlayer=1;const t=this.boof135;this.trigB=this.buffNug(t*2,0),this.text=`At the end of your turn, deal ${t} damage to each enemy creature.`}ssdT(t){const e=g.qEnemyCreats();if(e.length>0){const r=R.tick(),s=this.boof135;e.forEach(l=>l.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.trigB=this.playerNug(t),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.trigB=this.avgSpawnNug(),this.text=`At the end of the enemy player's turn, replace ${this.name} with a copy of a random Robot from your deck.`}tinkT(t){const e=y.target("DK");e.player=k.toTarget(t.owner),e.tribe="RB";const r=D.deckByTarget(e),s=r.length;if(s>0){const l=r[S.randInt(0,s)][0],f=g.jr5(t.creatId);g.birth(l,"R",f.owner,f.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;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("TS");s.bonus=this.trigB;const l=Nt.extractCardCode(this.code);return(l==="ZSH"||l==="SBF")&&(r.extraBattles=1),r}ddf8(t){return this.bothTurns||t.event.playerA===t.owner}jr8(t){this.lookup(this.cardCode()).t(t),x.triggerDone()}delphC(){this.faction="A",this.rarity="L",this.name="Delpha, Chronosculptor",this.iAttack=this.boof7914,this.iHealth=this.iAttack,this.tribe.push("HM"),this.level>1&&(this.hints=["OL"],this.trigB=this.buffNug(5,4),this.text=`At the start of your turn, level a ${this.level===2?"level 1 ":""}card in your hand at random.`)}delphT(t){if(this.level>1){const e=k.toPlayer(t.owner),r=e.hand.map((l,f)=>{const m=G.getCard(l);return{idx:f,lvl:m.level,nxt:m.canLevel()?m.levelUpCard():""}}).filter(l=>l.nxt&&(this.level===3||l.lvl===1)),s=r.length;if(s>0){const l=r[S.randInt(0,s)];e.hand[l.idx]=l.nxt}}}gmpC(){this.faction="A",this.rarity="L",this.name="Ghox, Metamind Paragon",this.iAttack=this.boof4814,this.iHealth=this.boof61218,this.tribe.push("MM"),this.hints=["OL"];const t=this.level===1?"":"s";this.trigB=this.rawNug(0,0,0,0,this.level*lt.dcWeight),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.trigB=this.playerNug(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.trigB=this.buffNug(this.iAttack,0),this.text=`${this.name} battles an additional time on your turn.`}sfangT(t){const e=g.jr5(t.creatId);e.extraBattles+=1}sseC(){this.faction="U",this.rarity="L",this.name="Scatterspore Eidolon",this.iAttack=8,this.iHealth=this.iAttack,this.tribe.push("PL"),this.level<3&&(this.hints=["LB"]);const t=this.boof357,e=Z.minionName(this.level);this.trigB=this.statSpawnNug(t,t),this.text=`At the start of your turn, Spawn a ${t}/${t} ${e}.`}sseT(t){const e=this.lValS(["SXD","SXP","SXT"])+this.level.toString();g.birth(e,"S",t.owner)}spdC(){this.faction="U",this.rarity="R",this.name="Shardplate Delver",this.iAttack=this.boof4612,this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=["OL"];const t=this.boof246;this.trigB=this.buffNug(t,t),this.text=`At the start of your turn, ${this.name} gets ${p.jr9(t,t)}.`}spdT(t){const e=this.boof246;g.jr5(t.creatId).buff(e,e)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.iAttack=this.boof91421,this.iHealth=this.iAttack,this.tribe.push("IN"),this.hints=["OP"],this.trigB=this.rawNug(0,0,0,0,this.lValN([-1.5,-2.1,-3])),this.text="At the start of your turn, randomly discard down to two cards in your hand."}spmT(t){const e=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.trigB=this.multNug(this.avgSpawnNug(),.5):this.hints.push("LG","ZZ-3"),this.text=`At the start of ${this.bothTurns?"each player's":"your"} turn, ${this.bothTurns?"that player":"you"} may play an additional card.`}tbaT(t){E.regularPlays+=1}vgC(){this.faction="T",this.rarity="C",this.name="Volcanic Giant",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("ER","GT"),this.hints=["OL"],this.trigB=this.playerNug(this.boof3610),this.text=`At the start of your turn, deals ${this.boof137} to ${this.boof5914-1} damage to the enemy player.`}vgT(t){const e=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=y.crTarg();this.level===3&&(e.player=k.toTarget(!t.owner));const r=g.creatByTarget(e);let s=99999,l=[];r.forEach(m=>{m.attack===s?l.push(m):m.attack0){const m=l[S.randInt(0,f)];V.destroy(m,this.code)}}zyxC(){this.faction="T",this.rarity="L",this.name="Zyx, Storm Herald",this.iAttack=this.boof4712,this.iHealth=this.lValN([6,9,20]),this.iMobile=1,this.tribe.push("LT","AS"),this.text="Zyx battles an additional time on your turn.",this.trigB=this.buffNug(this.iAttack,0)}zyxT(t){const e=g.jr5(t.creatId);e.extraBattles+=1}}class ys 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 ${p.levelGateText(this.level,!0)}Plant into an available lane.`,this.bonus={activ8:this.multNug(this.avgSpawnNug(),.5)}}canActivate(t){return this.emptySloots(t.id).length>0&&this.buddies(t.id).length>0}startActivation(t){const e=this.buddies(t.id);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=g.ddf6(t),s=this.emptySloots(e[1],r.code);s.push(T.cancelAction()),T.ddf5(s)}else{const r=g.jr5(e[1]),s=g.birth(e[2],"P",r.owner,t.lane);this.logAct(!0,s),r.endActivation()}}emptySloots(t,e=""){const r=y.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P2",t,e));return D.toActions(r)}buddies(t){const e=y.crFriendActTarg("CARD",this.code,S.enTil("P1",t));return e.tribe="PL",e.level=D.ddf2(this.level),D.toActions(e)}}class li extends kt{constructor(t){super(t),this.faction="A",t==="PRI"+"1"?(this.rarity="R",this.name="Perilous Insight",this.maxLevel=1,this.overload=!0):(this.rarity="C",this.name="Metasight",this.maxLevel=2,this.isFree=this.level===2),this.text="Discard and level up two cards."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(T.shiftPlayCard(t.position),t.param==="P1"){this.logSpell(),E.levelAndDiscardA(t);const e=this.targParty("P2"),r=D.toActions(e);r.length===0?T.spellCast():T.ddf5(r)}else E.levelAndDiscardA(t),T.spellCast()}targParty(t){const e=y.lvlHandActTarg(this.code,t);return e.deckPositionSkip=T.playPosition(),e}}class Ie extends kt{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=y.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",g.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const e=S.deTil(t.param),r=g.ddf6(t);if(e[0]==="P1"){this.playTarg.notMe=r.id,this.playTarg.param=S.enTil("P2",r.id);const s=D.toActions([this.playTarg,D.buttonTarget("CANC")]);T.ddf5(s)}else{const s=g.jr5(e[1]);this.xl?this.logSpell(s,r):this.logSpell(),this.cardCast(this.cardCode(),s,r),T.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=R.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 ${p.jr9(t,t)}.`,this.playTarg.player="F"}twstrZ(t,e){const r=this.tsboof;t.buff(r,r),e.buff(r,r)}}class bs 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.text=`When ${this.name} ${p.dbdtap()}, deal that much damage to that player.~Allied Uterra: This gets ${p.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,e){const r=super.jr3(t,e);r.jr4("FR");const s=r.jr4("DM");return s.bonus=this.playerNug(this.boof357),r}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){if(t.trigger.type==="FR"){if(E.allied("U")){const e=g.jr5(t.creatId);e.breakthrough=!0,e.buff(2,2)}}else t.trigger.type==="DM"&&k.hurtDirect(t.event.target,t.event.dmg,this.code);x.triggerDone()}}class As 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} ${p.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,e){const r=super.jr3(t,e);return r.jr4("FR"),r}handleAction(t){g.ddf6(t).hurtDirect(parseInt(t.param),this.code),T.actionDone(!0)}ddf8(t){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}jr8(t){if(t.trigger.type==="FR"){if(E.allied("T")){const e=g.jr5(t.creatId),r=e.jr4("DM");r.interactive=!0,r.bonus=this.buffNug(this.iAttack,0),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,r=D.toActions(y.crEnemyActTarg("CARD",this.code,e.dmg.toString()));r.length>0?(r.push(T.noneEndTrigger()),T.ddf5(r)):x.triggerDone()}}}class Ge 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");return s.interactive=!0,r}handleAction(t){const e=g.ddf6(t);this.targAction(this.cardCode(),e),T.actionDone(!0)}jr8(t){if(g.jr5(t.creatId).rank>this.level){const r=y.crActTarg("CARD",this.code,t.creatId);this.enemy?r.player="E":r.hint=["BF"];const s=D.toActions(r);s.length>0?T.ddf5(s):x.triggerDone()}else x.triggerDone()}ebwC(){this.faction="N",this.rarity="C",this.name="Ebonbound Warlord",this.iAttack=this.boof3714,this.iHealth=this.iAttack+4,this.tribe.push("VP"),this.enemy=!0;const t=this.boof369n;this.ftext=`give an enemy creature ${p.jr9(t,t)}.`}ebwF(t){this.logAct(!1,t);const e=this.boof369n;t.buff(e,e)}sbiC(){this.faction="U",this.rarity="C",this.name="Shardbound Invoker",this.iAttack=this.boof4714,this.iHealth=this.iAttack+1,this.tribe.push("TK");const t=this.boof359;this.ftext=`give a creature ${p.jr9(t,t)}.`}sbiF(t){this.logAct(!1,t);const e=this.boof359;t.buff(e,e)}cindC(){this.faction="T",this.rarity="C",this.name="Cinderbound Barbarian",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("FR","AS");const t=this.boof6912;this.enemy=!0,this.ftext=`deal ${t} damage to an enemy creature.`}cindF(t){t.hurtDirect(this.boof6912,this.code)}ibrfC(){this.faction="A",this.rarity="C",this.name="Ironbound Reinforcements",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.iAttack*2,this.tribe.push("GN");const t=this.boof5812;this.ftext=`give a creature ${p.jr9(t,0)}.`}ibrfF(t){this.logAct(!1,t),t.buff(this.boof5812,0)}}class ks 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");return s.interactive=!0,r}jr8(t){const e=g.jr5(t.creatId);if(this.emptySloots(e).length>0){const r=y.crFriendNotMeActTarg("CARD",e.id,this.code,S.enTil("P1",e.id)),s=D.toActions(r);s.length>0?(s.push(T.noneEndTrigger()),T.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=g.ddf6(t),s=g.jr5(e[1]),l=this.emptySloots(s,r.id);l.push(T.cancelAction()),T.ddf5(l)}else{const r=g.jr5(e[1]);this.logAct(!1,r),r.move(t.lane),T.actionDone(!0)}}emptySloots(t,e=""){return T.emptyAdjacents(t,S.enTil("P2",e))}}class vs 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.`,this.bonus={activ8:this.buffNug(this.iAttack/2,0)}}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){const e=this.findVictims(t.id);e.push(T.cancelAction()),T.ddf5(e)}handleAction(t){if(t.zone==="F"){const r=g.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)}g.jr5(t.param).endActivation()}findVictims(t){const e=this.iAttack,r=y.crEnemyTarg(),l=g.creatByTarget(r).filter(m=>m.health===e).map(m=>y.fieldSelectAction("CARD",m.lane,m.owner)),f=k.toPlayer("E");return f.health===e&&l.push(y.playerSelectAction("CARD",f.isPlayerA)),l.forEach(m=>{m.host=this.code,m.param=t}),l}}class Ts 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."}jr3(t,e){const r=super.jr3(t,e);r.jr4("EF");const s=r.jr4("TS");return s.bonus=this.buffNug(20,0),r}ddf8(t){if(t.event.code==="ENT"){const e=$.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(y.mod("TK",!0,e)))}jr8(t){if(t.event.code==="ENT"){const e=$.toCreature(t.event);e.creature.id===t.creatId?g.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"&&g.ddf1().forEach(e=>{e.extraBattles+=1,e.hasMod(t.creatId)||e.addMod(y.mod("TK",!0,t.creatId))});x.triggerDone()}}class U 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(),["CSL"]:()=>this.cslime(),["CDC"]:()=>this.cindcol(),["CNM"]:()=>this.cindmy(),["CTG"]:()=>this.citg(),["CWK"]:()=>this.crag(),["DBP"]:()=>this.prowler(),["DMR"]:()=>this.raptor(),["DBR"]:()=>this.bearride(),["DTD"]:()=>this.dmaw(),["DSZ"]:()=>this.duskzomb(),["FWB"]:()=>this.fangbear(),["FWR"]:()=>this.ravager(),["FFG"]:()=>this.ffang(),["FMS"]:()=>this.firemane(),["FPR"]:()=>this.flop(),["FGA"]:()=>this.falpha(),["FGB"]:()=>this.fbeta(),["FGO"]:()=>this.fomega(),["FPM"]:()=>this.minot(),["FPS"]:()=>this.forgeplate(),["GGE"]:()=>this.geist(),["GGH"]:()=>this.ghast(),["GGS"]:()=>this.ggs(),["GCL"]:()=>this.glacial(),["IWC"]:()=>this.warcharger(),["LWY"]:()=>this.lwyrm(),["LHY"]:()=>this.lyshyd(),["KDC"]:()=>this.kadc(),["MRF"]:()=>this.marrow(),["MMI"]:()=>this.mmin(),["MMO"]:()=>this.mmop(),["NGW"]:()=>this.narg(),["NCW"]:()=>this.necrotic(),["NXC"]:()=>this.nexcore(),["NAM"]:()=>this.nyam(),["OBD"]:()=>this.battledroid(),["OSP"]:()=>this.oss(),["OSL"]:()=>this.ogsl(),["PRG"]:()=>this.perd(),["RHY"]:()=>this.ravh(),["RHC"]:()=>this.rime(),["RSP"]:()=>this.runprim(),["SCS"]:()=>this.scorp(),["SCD"]:()=>this.scout(),["SFT"]:()=>this.scrap(),["SBA"]:()=>this.sparkblade(),["SKB"]:()=>this.sparkbot(),["SBR"]:()=>this.sparkass(),["STM"]:()=>this.sparkman(),["SSN"]:()=>this.sfsent(),["SMN"]:()=>this.steam(),["SGI"]:()=>this.stonefist(),["SCL"]:()=>this.stormcall(),["SMA"]:()=>this.ancient(),["SML"]:()=>this.lurker(),["TGS"]:()=>this.tsprout(),["TGN"]:()=>this.tgnome(),["TWS"]:()=>this.tscout(),["TWT"]:()=>this.tund(),["URD"]:()=>this.unrelenting(),["VBK"]:()=>this.vblock(),["VTC"]:()=>this.vtech(),["WTW"]:()=>this.waterwalk(),["WPD"]:()=>this.windprime(),["XCR"]:()=>this.xithcrush(),["XHU"]:()=>this.hulk(),["YWC"]:()=>this.yetiwar(),["ZIN"]:()=>this.zombinf()})[t]()}sist(){this.rarity="R",this.level===1?this.hints=["LG"]:this.consistent=!0}ancient(){this.faction="U",this.rarity="C",this.name="Swampmoss Ancient",this.iAttack=this.lValN([7,12]),this.iHealth=this.iAttack,this.tribe.push("DN"),this.hints=[this.level===1?"ZZ-1":"ZZ-2"],this.maxLevel=2}anvenf(){this.faction="A",this.rarity="C",this.name="Anvillon Enforcer",this.iAttack=this.boof5711,this.iHealth=this.iAttack-1,this.iArmor=this.boof246,this.tribe.push("RB")}avguard(){this.faction="T",this.rarity="R",this.name="Avalanche Guardian",this.iAttack=this.boof5915,this.iHealth=this.lValN([8,15,23]),this.iMobile=1,this.iDefend=!0,this.tribe.push("IC","EL")}bart(){this.faction="U",this.rarity="H",this.name="Big Bad Bartok",this.iAttack=this.level+8,this.iHealth=this.iAttack,this.consistent=!0,this.level<3&&(this.hints=["LB"]),this.tribe.push("TG")}batthid(){this.faction="U",this.name="Batterhide",this.iAttack=this.boof3814,this.iHealth=this.iAttack+3,this.sist(),this.iBT=!0,this.tribe.push("DN")}battledroid(){this.faction="A",this.rarity="H",this.name="Oreian Battledroid",this.iAttack=this.lValN([5,7,17]),this.iHealth=1,this.iArmor=this.iAttack,this.tribe.push("RB")}bearride(){this.faction="U",this.rarity="C",this.name="Deepwood Bear Rider",this.iAttack=this.lValN([5,16,18]),this.iHealth=this.lValN([2,8,10]),this.tribe.push("LP"),this.level===2&&(this.hints=["LB"])}blitwi(){this.faction="N",this.name="Blight Witch",this.iAttack=this.lValN([2,5,9]),this.iHealth=this.boof71117,this.sist(),this.iRegen=this.boof234,this.tribe.push("ZB")}brambleguard(){this.faction="U",this.rarity="C",this.name="Bramblewood Guardian",this.iAttack=this.boof2612,this.iHealth=this.lValN([9,14,24]),this.tribe.push("PL")}cavernhyd(){this.faction="U",this.rarity="C",this.name="Cavern Hydra",this.iAttack=this.boof4711,this.iHealth=this.boof71015,this.iRegen=this.boof135,this.tribe.push("HY")}cslime(){this.faction="N",this.rarity="C",this.name="Cavern Slime",this.iAttack=this.boof61218,this.iHealth=this.boof246,this.iRegen=this.iAttack,this.tribe.push("OZ"),this.hints=[this.lValH(["ZZ-2","ZZ-3","ZZ-5"])]}cindcol(){this.faction="T",this.rarity="C",this.name="Cinder Colossus",this.iAttack=this.lValN([3,13,24]),this.iHealth=this.lValN([4,14,27]),this.iDefend=!0,this.level===1&&(this.hints=["LG"]),this.tribe.push("ER","EL")}cindmy(){this.faction="T",this.rarity="C",this.name="Cinder Mystic",this.iAttack=this.lValN([4,11,21]),this.iHealth=this.boof3714,this.tribe.push("FR","AS")}citg(){this.faction="A",this.rarity="C",this.name="Citadel Guard",this.iAttack=this.lValN([8,12,25]),this.iHealth=this.lValN([9,13,30]),this.iDefend=!0,this.hints=[this.level===3?"ZZ-5":"ZZ-1"],this.tribe.push("RB")}crag(){this.faction="T",this.rarity="C",this.name="Crag Walker",this.iAttack=this.lValN([7,12,18]),this.iHealth=this.boof246,this.iMobile=1,this.tribe.push("DN")}dmaw(){this.faction="N",this.rarity="L",this.name="Duskmaw, Twilight Drake",this.iAttack=this.boof61017,this.iHealth=this.boof5915,this.iMobile=1,this.tribe.push("ST","DG")}duskzomb(){this.faction="N",this.rarity="C",this.name="Duskspire Zombie",this.iAttack=this.lValN([2,5,16]),this.iHealth=this.lValN([5,8,19]),this.iRegen=4,this.tribe.push("ZB")}falpha(){this.faction="A",this.rarity="C",this.name="Forge Guardian Alpha",this.iAttack=this.lValN([4,8,20]),this.iHealth=this.lValN([8,14,26]),this.iDefend=!0,this.tribe.push("RB","GD")}fangbear(){this.faction="U",this.rarity="C",this.name="Fangwood Bear",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("BR")}fbeta(){this.faction="A",this.rarity="R",this.name="Forge Guardian Beta",this.iAttack=this.lValN([5,8,20]),this.iHealth=this.lValN([3,6,18]),this.iArmor=this.boof124,this.tribe.push("RB","GD"),this.level===3&&(this.hints=["ZZ-3"])}ffang(){this.faction="U",this.rarity="C",this.name="Featherfang",this.iAttack=this.boof61218,this.iHealth=this.boof4812,this.tribe.push("DN")}firemane(){this.faction="T",this.rarity="C",this.name="Firemane Steed",this.iAttack=this.lValN([3,6,16]),this.iHealth=this.lValN([6,9,19]),this.iMobile=2,this.tribe.push("FR","EL")}flop(){this.faction="T",this.rarity="C",this.name="Flowstone Primordial",this.iAttack=this.lValN([6,7,15]),this.iHealth=this.iAttack+1,this.tribe.push("FR","EL")}fomega(){this.faction="A",this.rarity="L",this.name="Forge Guardian Omega",this.iAttack=this.boof255080,this.iHealth=this.iAttack,this.iMobile=this.boof124,this.iArmor=this.iMobile*10,this.iBT=!0,this.iAggro=!0,this.consistent=!0,this.tribe.push("RB","GD")}forgeplate(){this.faction="A",this.rarity="C",this.name="Forgeplate Sentry",this.iAttack=this.boof4915,this.iHealth=this.iAttack,this.iArmor=this.boof135,this.tribe.push("RB")}ggs(){this.faction="N",this.rarity="C",this.name="Grimgaunt Spectre",this.iAttack=this.lValN([3,11,14]),this.iHealth=this.iAttack,this.iMobile=1,this.level===1?this.hints=["LG"]:this.level===2&&(this.hints=["LB"]),this.tribe.push("GG")}geist(){this.faction="N",this.rarity="C",this.name="Grave Geist",this.iAttack=this.boof71118,this.iHealth=this.boof4711,this.tribe.push("ST")}ghast(){this.faction="N",this.rarity="C",this.name="Grave Ghast",this.iHealth=this.boof71013,this.iAttack=this.iHealth-2,this.iRegen=this.boof246,this.tribe.push("ZB")}glacial(){this.faction="T",this.rarity="C",this.name="Glacial Colossus",this.iAttack=this.boof61016,this.iHealth=this.lValN([8,13,19]),this.tribe.push("IC","EL"),this.iDefend=!0}hulk(){this.faction="N",this.rarity="C",this.name="Xithian Hulk",this.iAttack=this.boof4814,this.iHealth=this.iAttack+3,this.tribe.push("AB")}kadc(){this.faction="T",this.rarity="C",this.name="Kadras Colossus",this.iAttack=this.lValN([6,11,13]),this.iHealth=this.iAttack,this.tribe.push("GT"),this.level<3&&(this.hints=["LB"],this.level===1&&this.hints.push("ZZ+1"))}lurker(){this.faction="U",this.rarity="C",this.name="Swampmoss Lurker",this.iAttack=this.lValN([8,13,22]),this.iHealth=this.lValN([4,6,15]),this.tribe.push("DN"),this.level===3?this.hints=["ZZ-5"]:this.hints=["ZZ-1"]}lwyrm(){this.faction="T",this.rarity="C",this.name="Lightning Wyrm",this.iAttack=this.boof4711,this.iHealth=this.boof258,this.tribe.push("LT","EL"),this.iAggro=!0}lyshyd(){this.faction="U",this.rarity="C",this.name="Lysian Hydra",this.iAttack=this.boof5914,this.iHealth=this.iAttack+1,this.iRegen=this.level,this.tribe.push("HY")}marrow(){this.faction="N",this.rarity="C",this.name="Marrow Fiend",this.iAttack=this.boof81117,this.iHealth=this.lValN([1,5,13]),this.tribe.push("SK")}minot(){this.faction="A",this.name="Forgeplate Minotaur",this.iAttack=this.lValN([2,8,16]),this.iHealth=this.lValN([4,9,17]),this.sist(),this.iArmor=this.level,this.tribe.push("RB")}mmin(){this.faction="A",this.rarity="C",this.name="Metamind Infiltrator",this.iAttack=this.boof5917,this.iHealth=this.iAttack-1,this.tribe.push("MM")}mmop(){this.faction="A",this.rarity="C",this.name="Metamind Operator",this.iAttack=this.boof4610,this.iHealth=this.lValN([10,14,18]),this.tribe.push("MM")}narg(){this.faction="T",this.rarity="C",this.name="Nargath Warrior",this.iAttack=this.boof51014,this.iHealth=this.iAttack+1,this.tribe.push("ER","AS")}necrotic(){this.faction="N",this.rarity="C",this.name="Necrotic Wurm",this.iAttack=this.lValN([4,7,18]),this.iHealth=this.lValN([5,8,19]),this.tribe.push("WR")}nexcore(){this.faction="A",this.rarity="C",this.name="Nexus Core",this.iAttack=0,this.iHealth=this.lValN([15,25,40]),this.tribe.push("RB"),this.iDefend=!0}nyam(){this.faction="N",this.rarity="C",this.name="Nyrali Ambusher",this.iAttack=this.boof71117,this.iHealth=this.lValN([3,6,13]),this.tribe.push("OZ")}ogsl(){this.faction="U",this.rarity="C",this.name="Overgrown Spineleaf",this.iAttack=this.lValN([6,12,16]),this.iHealth=this.boof4812,this.tribe.push("PL")}oss(){this.faction="N",this.rarity="R",this.name="Ossuary Spirit",this.iAttack=this.lValN([1,3,6]),this.iHealth=this.boof91420,this.iRegen=this.iAttack+2,this.tribe.push("ST")}perd(){this.faction="N",this.rarity="C",this.name="Perdition Guard",this.iAttack=this.lValN([3,12,15]),this.iHealth=this.iAttack-1,this.tribe.push("NG"),this.level===1?this.hints=["LG","ZZ-1"]:this.level===2&&(this.hints=["LB"])}prowler(){this.faction="U",this.rarity="C",this.name="Deepbranch Prowler",this.iAttack=this.lValN([8,9,10]),this.iHealth=this.iAttack,this.tribe.push("CT"),this.level<3&&(this.hints=["LB"]),this.iBT=!0}raptor(){this.faction="U",this.rarity="C",this.name="Deepmoss Raptor",this.iAttack=this.lValN([2,13,16]),this.iHealth=this.iAttack,this.level===1?this.hints=["LG","RT"]:this.level===2&&(this.hints=["LB"]),this.tribe.push("DN")}ravager(){this.faction="U",this.rarity="C",this.name="Fangwood Ravager",this.iAttack=this.boof5917,this.iHealth=this.iAttack,this.tribe.push("BE")}ravh(){this.faction="U",this.rarity="C",this.name="Ravenous Hydra",this.iAttack=this.boof5813,this.iHealth=this.iAttack+this.level,this.iRegen=this.level,this.iBT=!0,this.tribe.push("HY")}rime(){this.faction="T",this.rarity="C",this.name="Rimehorn Charger",this.iAttack=this.lValN([5,8,10]),this.iHealth=this.iAttack+3,this.iMobile=1,this.level<3&&(this.hints=["LB"]),this.tribe.push("RM")}runprim(){this.faction="T",this.name="Runestorm Primordial",this.iAttack=this.boof3714,this.iHealth=this.iAttack-1,this.sist(),this.iAggro=!0,this.tribe.push("LT","EL")}scorp(){this.faction="N",this.rarity="C",this.name="Scavenger Scorpion",this.iAttack=this.lValN([6,9,11]),this.iHealth=this.iAttack,this.iRegen=this.level,this.level<3&&(this.hints=["LB"]),this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.isFree=this.level>1,this.level<3&&(this.hints=[this.level===1?"LG":"LB"]),this.tribe.push("RB")}scrap(){this.faction="A",this.rarity="H",this.name="Scrapforge Titan",this.iAttack=this.lValN([1,5,20]),this.iHealth=this.iAttack,this.iArmor=this.lValN([1,5,10]),this.level===1&&(this.hints=["LG","LM","RT"]),this.tribe.push("RB")}sfsent(){this.faction="A",this.rarity="C",this.name="Spiritforge Sentinel",this.iAttack=this.lValN([3,6,9]),this.iHealth=this.iAttack*2,this.iArmor=this.lValN([1,2,6]),this.tribe.push("RB")}sparkbot(){this.faction="A",this.rarity="C",this.name="Spark Bot",this.iAttack=this.boof5914,this.iHealth=this.lValN([6,11,16]),this.tribe.push("RB")}sparkblade(){this.faction="A",this.rarity="C",this.name="Sparkblade Assassin",this.iAttack=this.lValN([4,12,14]),this.iHealth=this.lValN([5,13,15]),this.tribe.push("HM")}sparkass(){this.faction="T",this.rarity="C",this.name="Sparkbrand Asir",this.iAttack=this.lValN([2,7,9]),this.iHealth=this.lValN([6,11,13]),this.iAggro=!0,this.tribe.push("LT","AS")}sparkman(){this.faction="T",this.rarity="R",this.name="Sparktail Manticore",this.iAttack=this.boof369,this.iHealth=this.boof71116,this.iAggro=!0,this.iMobile=1,this.tribe.push("MT")}steam(){this.faction="T",this.rarity="C",this.name="Steam Sentinel",this.iAttack=this.lValN([8,14,20]),this.iHealth=this.boof61016,this.iDefend=!0,this.tribe.push("WT","EL")}stonefist(){this.faction="T",this.rarity="C",this.name="Stonefist Giant",this.iAttack=this.lValN([3,7,16]),this.iHealth=this.lValN([6,10,24]),this.tribe.push("ER","EL")}stormcall(){this.faction="T",this.rarity="C",this.name="Storm Caller",this.iAttack=this.lValN([8,11,14]),this.iHealth=this.iAttack-2,this.tribe.push("WN","AS")}tgnome(){this.faction="A",this.rarity="C",this.name="Technognome",this.iAttack=this.lValN([3,9,19]),this.iHealth=this.iAttack,this.level===1&&(this.hints=["LG"]),this.tribe.push("GN")}tscout(){this.faction="A",this.rarity="C",this.name="Tower Scout",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.iMobile=1,this.tribe.push("HM")}tund(){this.faction="A",this.rarity="C",this.name="Tundra Watcher",this.iAttack=this.lValN([5,10,12]),this.iHealth=this.lValN([8,11,13]),this.level<3&&(this.hints=["LB"]),this.tribe.push("RB")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.iAttack=this.boof7911,this.iHealth=this.iAttack+1,this.level<3&&(this.hints=["LB"]),this.tribe.push("PL")}unrelenting(){this.faction="N",this.rarity="H",this.name="Unrelenting Dead",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.iRegen=this.iAttack,this.tribe.push("ZB")}vblock(){this.faction="A",this.rarity="R",this.name="Vault Blockade",this.iAttack=0,this.iHealth=this.boof135,this.iArmor=this.boof101520,this.iDefend=!0,this.tribe.push("RB")}vtech(){this.faction="A",this.rarity="C",this.name="Vault Technician",this.iAttack=this.boof61218,this.iHealth=this.boof3915,this.tribe.push("HM")}warcharger(){this.faction="A",this.rarity="C",this.name="Ionic Warcharger",this.iAttack=this.boof4915,this.iHealth=this.lValN([7,12,18]),this.iMobile=1,this.tribe.push("RB")}waterwalk(){this.faction="T",this.rarity="C",this.name="Water Walker",this.iAttack=this.lValN([5,12,14]),this.iHealth=this.lValN([2,9,11]),this.tribe.push("WT","AS")}windprime(){this.faction="T",this.rarity="C",this.name="Wind Primordial",this.iHealth=this.boof4814,this.iAttack=this.iHealth+2,this.iMobile=this.level,this.tribe.push("WN","EL")}xithcrush(){this.faction="N",this.rarity="C",this.name="Xithian Crusher",this.iAttack=this.lValN([4,10,16]),this.iHealth=this.iAttack+2,this.tribe.push("AB")}yetiwar(){this.faction="T",this.rarity="C",this.name="Yeti Warcaller",this.iAttack=this.boof248,this.iHealth=this.lValN([10,15,23]),this.tribe.push("YT")}zombinf(){this.faction="N",this.rarity="C",this.name="Zombie Infantry",this.iAttack=this.boof61015,this.iHealth=this.iAttack-1,this.tribe.push("ZB")}}class Ss extends kt{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]);T.ddf5(D.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);T.ddf5(D.toActions(s))}}else this.endSpell([t.lane,parseInt(e[1]),parseInt(e[2])],t.playerA)}endSpell(t,e){this.logSpell();const r=R.tick();t.forEach(s=>{const l=V.gravedigger();l&&g.birth(l,"R",e,s,r)}),T.spellCast()}fieldTarget(t,e){const r=y.actionTarget("TF","CARD",this.code,S.enTil(t,...e));return r.player="F",r.hint=["FL"],r.lanes=g.laneIdx.filter(s=>!e.includes(s)),r}}class Cs extends P{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Vigorwisp",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("ST"),this.text=`When ${this.name} gains health, heal that much damage from each other friendly creature.`}jr3(t,e){const r=super.jr3(t,e),s=r.jr4("HG");return s.bonus=this.buffNug(0,this.boof369),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const e=y.crNotMeTarg(t.creatId);e.player=k.toTarget(t.owner),g.creatByTarget(e).forEach(r=>r.heal(t.event.healAmt)),x.triggerDone()}}class ws extends be{jr3(t,e){const r=super.jr3(t,e),s=r.jr4("LG",this.code),l=this.boof124*5;return s.bonus=this.buffNug(l,l),r}ddf8(t){return t.owner===t.event.playerA}jr8(t){const e=this.boof124*t.event.healAmt;g.jr5(t.creatId).buff(e,e),x.triggerDone()}}class Ds 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=G.getCard(Z.minionCode(this.level));this.text=`When you play a spell, you may put a ${p.tokName(e)} into an available lane.`,this.spB=this.spawnNug(e)}spB;jr3(t,e){const r=super.jr3(t,e),s=r.jr4("PC");return s.interactive=!0,s.bonus=this.spB,r}handleAction(t){g.birth(Z.minionCode(this.level),"P",t.playerA,t.lane),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&G.getCard(t.event.cardCode).type==="S"}jr8(t){const e=y.emptyPlayerActTarg("F","CARD",this.code,""),r=D.toActions(e);r.length===0?x.triggerDone():(r.push(T.noneEndTrigger()),T.ddf5(r))}}class xs 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 ${p.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");return s.interactive=!0,r}jr8(t){const e=g.jr5(t.creatId);if(this.emptySloots(e).length>0){const r=y.crFriendNotMeActTarg("CARD",e.id,this.code,S.enTil("P1",e.id));r.level=D.ddf2(this.level);const s=D.toActions(r);s.length>0?(s.push(T.noneEndTrigger()),T.ddf5(s)):x.triggerDone()}else x.triggerDone()}handleAction(t){const e=S.deTil(t.param);if(e[0]==="P1"){const r=g.ddf6(t),s=g.jr5(e[1]),l=this.emptySloots(s,r.id);l.push(T.cancelAction()),T.ddf5(l)}else{const r=g.jr5(e[1]);this.logAct(!1,r),r.move(t.lane),T.actionDone(!0)}}emptySloots(t,e=""){return T.emptyAdjacents(t,S.enTil("P2",e))}}class Bs 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),s=r.jr4("DM");return s.bonus=this.playerNug(this.boof246),r}ddf8(t){const e=$.toDamage(t.event);return!e.battle&&e.isCreatTarg&&e.hurtCreat.owner!==t.owner}jr8(t){k.hurtDirect(!t.owner,this.boof246,this.code),x.triggerDone()}}class Hs 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 ${p.jr9(e,e)}.`}jr3(t,e){const r=super.jr3(t,e);r.jr4("EF");const s=r.jr4("MV"),l=-this.boof135;return s.bonus=this.buffNug(l,l),r}ddf8(t){const e=$.toCreature(t.event);return t.trigger.creatId===e.creature.id&&t.trigger.type==="MV"||e.creature.owner!==t.owner}jr8(t){let e=!1;const r=g.jr5(t.creatId),s=$.toCreature(t.event);if((r.id===s.creature.id&&r.opposed||s.creature.lane===g.oppositeLane(r.lane))&&(e=!0),e){const l=-this.boof135;r.buff(l,l)}x.triggerDone()}}class Ns 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 ${p.dbdtap()} on your turn, you may deal that much damage to an enemy creature.~Allied Nekrium: When a creature is destroyed, Zarox gets ${p.jr9(this.boof124,0)}.`}jr3(t,e){const r=super.jr3(t,e);r.jr4("FR");const s=r.jr4("DM");return s.interactive=!0,s.bonus=this.buffNug(this.lValN([3,6,14]),0),r}handleAction(t){g.ddf6(t).hurtDirect(parseInt(t.param),this.code),T.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const e=$.toDamage(t.event);return e.battle&&!e.isCreatTarg&&e.isCreatSrc&&e.srcId===t.creatId&&e.srcCreat.owner===k.getActiveB()}else return!0}jr8(t){if(t.trigger.type==="FR"){if(E.allied("N")){const e=g.jr5(t.creatId),r=e.jr4("DS");r.bonus=this.buffNug(this.boof124,0),e.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const e=t.event,r=D.toActions(y.crEnemyActTarg("CARD",this.code,e.dmg.toString()));r.length>0?(r.push(T.noneEndTrigger()),T.ddf5(r)):x.triggerDone()}else if(t.trigger.type==="DS"){const e=g.jr5(t.creatId);this.logAct(!1),e.buff(this.boof124,0),x.triggerDone()}}}class Fs 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 ${p.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;[y.mod("AT",r,e.id),y.mod("HL",r,e.id),y.mod("MH",r,e.id),y.mod("RG",this.level,e.id)].forEach(l=>{e.addModSafe(l)})}else e.removeModSafe(e.id)}}class Ps{cardCache=new Map;mapper={["AAK"]:Ii,["ABB"]:Gi,["ABM"]:gt,["AGC"]:gt,["AGK"]:O,["AGP"]:ut,["AGW"]:L,["ASG"]:L,["AMS"]:O,["AFO"]:me,["ATG"]:$t,["ATP"]:fe,["ART"]:$t,["ATS"]:$t,["AGM"]:he,["ALG"]:ke,["AHL"]:nr,["ALS"]:ke,["ASB"]:se,["AAA"]:Li,["ABE"]:ut,["ATZ"]:L,["AEC"]:It,["ARB"]:$t,["AEN"]:U,["APM"]:$i,["AQE"]:L,["AGD"]:Wi,["AFS"]:ee,["AWU"]:ve,["ASQ"]:ft,["AMD"]:Vi,["ABR"]:Ut,["AFR"]:O,["AMY"]:Ut,["ABL"]:L,["ATT"]:bt,["AGU"]:U,["AIV"]:Gt,["BRS"]:ni,["BTB"]:ri,["BTH"]:U,["BTI"]:gt,["BTN"]:ke,["BBB"]:U,["BLH"]:$t,["BFT"]:L,["BSP"]:Gt,["BWK"]:he,["BLW"]:U,["BZS"]:O,["BBR"]:L,["BBD"]:L,["BBL"]:L,["BBN"]:L,["BSR"]:gt,["BMY"]:Ui,["BSW"]:ft,["BWW"]:Ae,["BTM"]:L,["BOS"]:Z,["BAW"]:gt,["BWG"]:U,["BTR"]:O,["BWD"]:ge,["BSG"]:zi,["BSS"]:O,["BTS"]:ge,["BST"]:le,["BWT"]:Oi,["BRF"]:he,["BRH"]:bt,["BWH"]:Zi,["BRN"]:oe,["BZD"]:O,["BFM"]:O,["BSM"]:Yi,["CKB"]:gt,["CDT"]:he,["CMF"]:ze,["CTL"]:ut,["CCS"]:ft,["CHY"]:U,["CSR"]:ni,["CSL"]:U,["CHV"]:Ki,["CRS"]:me,["COD"]:ut,["CTI"]:O,["CHA"]:gt,["CHH"]:O,["CHR"]:se,["CBB"]:Ge,["CDC"]:U,["CFB"]:Ut,["CNM"]:U,["CSW"]:O,["CTG"]:U,["CCT"]:Ze,["CFG"]:Ie,["CGF"]:St,["CGL"]:ft,["CSU"]:L,["CCR"]:gt,["CSB"]:St,["CNT"]:L,["CWK"]:U,["CRC"]:Gt,["CYP"]:Xi,["CYC"]:$t,["COZ"]:Z,["CYS"]:St,["CTW"]:L,["CTV"]:L,["CAG"]:L,["CBS"]:L,["CIN"]:be,["CSH"]:ft,["CSG"]:Ie,["DFM"]:Z,["DFR"]:O,["DHC"]:qi,["DHW"]:$t,["DRS"]:gt,["DSS"]:Ee,["DSW"]:O,["DSE"]:gt,["DSA"]:gt,["DCR"]:ut,["DSK"]:St,["DBA"]:O,["DBP"]:U,["DMR"]:U,["DBR"]:U,["DCS"]:Ot,["DWW"]:Ji,["DDF"]:L,["DGZ"]:ut,["DNK"]:Qi,["DBN"]:O,["DDS"]:_i,["DIS"]:It,["DSV"]:tr,["DDD"]:O,["DPB"]:er,["DZA"]:Z,["DZD"]:se,["DRE"]:It,["DGS"]:gt,["DGW"]:ut,["DBT"]:L,["DTR"]:se,["DFB"]:Ft,["DMW"]:ee,["DCH"]:It,["DTD"]:U,["DHM"]:bt,["DSZ"]:U,["DYB"]:L,["DBQ"]:ir,["DYF"]:L,["DYS"]:rr,["DYL"]:sr,["EBW"]:Ge,["ESK"]:Gt,["EHW"]:ar,["ETN"]:L,["EWE"]:ve,["EVT"]:It,["ENP"]:L,["ESU"]:It,["ENR"]:L,["EPD"]:ut,["EPH"]:or,["EPS"]:Ut,["ESG"]:hr,["ESC"]:ge,["ESP"]:lr,["EWT"]:O,["EHN"]:ge,["EFA"]:L,["EFM"]:Ut,["EFP"]:cr,["EFE"]:dr,["EXD"]:L,["FWB"]:U,["FWR"]:U,["FFG"]:U,["FST"]:St,["FWK"]:St,["FIN"]:L,["FRR"]:ut,["FVA"]:L,["FWG"]:Z,["FWC"]:Gt,["FFU"]:ft,["FLH"]:ze,["FMS"]:U,["FSM"]:ut,["FBC"]:Ut,["FBI"]:$t,["FFS"]:ft,["FLN"]:L,["FJT"]:L,["FRI"]:gt,["FSS"]:Ee,["FLS"]:$t,["FSH"]:ft,["FFD"]:St,["FRV"]:gt,["FSC"]:St,["FSP"]:bt,["FPR"]:U,["FFL"]:L,["FGA"]:U,["FGB"]:U,["FGD"]:bt,["FGG"]:ee,["FGO"]:U,["FOL"]:me,["FPM"]:U,["FPS"]:U,["FWS"]:se,["FFM"]:ve,["FMD"]:ur,["FME"]:Gt,["FSK"]:fr,["FKS"]:gr,["FWT"]:O,["FZS"]:L,["FUN"]:Z,["GOS"]:mr,["GHS"]:ee,["GHB"]:Ze,["GHR"]:pr,["GRN"]:Ie,["GTH"]:L,["GSC"]:he,["GMP"]:Ot,["GTT"]:yr,["GCL"]:U,["GCR"]:L,["GLF"]:gt,["GRW"]:gt,["GSW"]:O,["GVS"]:St,["GSS"]:O,["GPV"]:br,["GBG"]:St,["GGE"]:U,["GGH"]:U,["GRP"]:Ar,["GGB"]:Ft,["GGD"]:Ft,["GGR"]:Ft,["GGP"]:Ft,["GGS"]:U,["GGW"]:Ft,["GRM"]:ut,["GHT"]:gt,["GMR"]:St,["HMF"]:bt,["HTR"]:Ae,["HAR"]:L,["HFA"]:Pe,["HOD"]:bt,["HRM"]:kr,["HWM"]:be,["HOX"]:It,["HGS"]:vr,["HTP"]:Tr,["IBF"]:ut,["IGR"]:It,["ITO"]:It,["IKA"]:Te,["IME"]:It,["IRT"]:hi,["IVS"]:ut,["ICD"]:Sr,["IWC"]:U,["IHA"]:he,["IBR"]:Ge,["IMD"]:se,["IMA"]:O,["IZL"]:Cr,["IZR"]:wr,["IZK"]:$t,["IFL"]:oe,["IFR"]:L,["JPK"]:L,["KDC"]:U,["KSB"]:O,["KAW"]:$t,["KOD"]:ft,["KBE"]:Dr,["KIW"]:xr,["KTS"]:Re,["KKK"]:Ae,["LOD"]:ut,["LFA"]:Br,["LKP"]:Hr,["LGT"]:O,["LLD"]:Fe,["LLG"]:Fe,["LLS"]:Fe,["LLT"]:Fe,["LBR"]:L,["LSK"]:oe,["LWY"]:U,["LBD"]:O,["LSS"]:Ee,["LBL"]:Ot,["LSP"]:be,["LCE"]:It,["LUC"]:ve,["LMV"]:O,["LHY"]:U,["LYR"]:oe,["LYS"]:L,["MMH"]:gt,["MHR"]:Nr,["MRF"]:U,["MMG"]:ee,["MOE"]:O,["MXW"]:gt,["MSP"]:It,["MMA"]:O,["MMR"]:O,["MMX"]:St,["MMI"]:U,["MMO"]:U,["MMV"]:Gt,["MPH"]:L,["MSC"]:L,["MTS"]:li,["MTT"]:Fr,["MML"]:Pr,["MMW"]:Mr,["MBR"]:O,["MDE"]:oi,["MBP"]:ft,["MTD"]:O,["MND"]:ft,["NNS"]:L,["NGB"]:gt,["NGW"]:U,["NSL"]:L,["NCF"]:L,["NCM"]:se,["POZ"]:Z,["NCS"]:ft,["NCW"]:U,["NCV"]:L,["NSW"]:Rr,["NDY"]:L,["NDR"]:Er,["NEM"]:It,["NSH"]:ut,["NXA"]:Ir,["NXB"]:hi,["NXC"]:U,["NXG"]:ft,["NXO"]:me,["NXP"]:ai,["NXT"]:ke,["NGT"]:Ft,["NGQ"]:Gr,["NSD"]:Z,["NCL"]:ut,["NFF"]:ft,["NAM"]:U,["NOZ"]:St,["NSY"]:O,["ONN"]:Lr,["OXA"]:$r,["OXM"]:O,["OXP"]:Wr,["OOZ"]:Z,["OBB"]:Vr,["OEX"]:L,["OWH"]:Ur,["OBD"]:U,["OFM"]:O,["OJC"]:bt,["OPK"]:O,["OSV"]:le,["OSS"]:L,["OWW"]:ee,["OHV"]:ft,["ODC"]:Or,["OSP"]:U,["OAP"]:zr,["OSL"]:U,["OWF"]:ut,["OXS"]:Zr,["PHM"]:O,["PPM"]:ft,["PSM"]:O,["PLW"]:ut,["POA"]:gt,["POD"]:ge,["POK"]:O,["POT"]:O,["PRG"]:U,["PRI"]:li,["PHS"]:gt,["PHC"]:ut,["PTB"]:ut,["PLI"]:fe,["PSC"]:ft,["PSH"]:Gt,["PTR"]:L,["PSG"]:L,["PMI"]:O,["PMS"]:L,["POX"]:St,["PMP"]:L,["PYG"]:Ze,["PYM"]:Me,["PYS"]:ut,["RBH"]:Yr,["ROK"]:ut,["RPT"]:Z,["RHY"]:U,["RTS"]:Ut,["RHU"]:le,["RSC"]:Re,["RMB"]:Kr,["RLW"]:bt,["RFL"]:Xr,["RHC"]:U,["ROG"]:L,["RWC"]:ge,["RFA"]:Pe,["RWD"]:gt,["RSD"]:Te,["RSE"]:qr,["RBG"]:Me,["RGG"]:Gt,["RSZ"]:St,["RSP"]:U,["RHW"]:bt,["SBF"]:Ot,["SAP"]:L,["SPL"]:Z,["SVO"]:L,["SSE"]:Ot,["SXP"]:Z,["SXD"]:Z,["SXT"]:Z,["STS"]:ut,["SCS"]:U,["SMD"]:O,["SFS"]:jr,["SHY"]:gt,["SCD"]:U,["SFT"]:U,["SOC"]:L,["SOA"]:L,["SOD"]:L,["SOK"]:oe,["SOT"]:L,["SDL"]:Z,["SAD"]:Jr,["SCZ"]:bt,["SFE"]:Ae,["SWS"]:Qr,["SHA"]:bt,["SHG"]:L,["SBI"]:Ge,["SCC"]:Re,["SPB"]:_r,["SPD"]:Ot,["SPG"]:L,["SPM"]:Ot,["STD"]:gt,["STB"]:oe,["SHS"]:he,["SSP"]:bt,["SGF"]:ft,["SKG"]:ai,["SSD"]:Te,["SDA"]:ts,["SSR"]:Gt,["SNB"]:L,["SNP"]:ut,["SRD"]:ut,["SSH"]:fe,["SRM"]:ft,["SRH"]:Ft,["SDN"]:O,["SHV"]:L,["SRP"]:L,["SGG"]:O,["SBA"]:U,["SKB"]:U,["SBR"]:U,["SKS"]:le,["SEL"]:es,["STM"]:U,["SWA"]:$t,["SFG"]:ft,["SLG"]:O,["SBD"]:O,["SCV"]:is,["SFM"]:St,["SSN"]:U,["SSM"]:Gt,["SLH"]:rs,["SPN"]:Z,["SSI"]:be,["SND"]:Re,["SNT"]:St,["SRV"]:Me,["STR"]:L,["SPU"]:Z,["XYR"]:Z,["SPH"]:ss,["SSA"]:ft,["STO"]:L,["SDR"]:bt,["SOL"]:Te,["SOV"]:L,["SHK"]:oe,["SWR"]:as,["SMN"]:U,["SER"]:ns,["SES"]:os,["SFA"]:Pe,["STG"]:hs,["SSS"]:Ee,["SSK"]:O,["SWG"]:le,["SWM"]:ft,["SIV"]:ut,["STN"]:L,["SGI"]:U,["SBG"]:ls,["SCL"]:U,["SGA"]:Pe,["STP"]:L,["SSG"]:Gt,["SVH"]:Ut,["SIN"]:L,["SYL"]:O,["SEV"]:gt,["SMA"]:U,["SML"]:U,["SYO"]:ds,["TST"]:ut,["TBA"]:Ot,["TGL"]:L,["TGS"]:U,["TPT"]:L,["TDW"]:bt,["TNL"]:us,["TEX"]:me,["TGN"]:U,["TSM"]:me,["TUP"]:L,["TOT"]:L,["TAB"]:oi,["TGI"]:O,["TDS"]:se,["TSP"]:fs,["TPG"]:fe,["TMG"]:fe,["TMM"]:gs,["TRA"]:O,["TRS"]:O,["TRV"]:O,["TRW"]:O,["TBB"]:ze,["TOB"]:L,["TWS"]:U,["TVG"]:ri,["TXB"]:L,["TXS"]:L,["TFK"]:Z,["TFD"]:Z,["TFF"]:Z,["TCG"]:L,["TMS"]:ms,["TBC"]:ps,["TWT"]:U,["TRN"]:ut,["TGK"]:Me,["TSL"]:ys,["TTF"]:Z,["TWG"]:Ie,["UGM"]:Gt,["USY"]:bt,["UGL"]:O,["UIC"]:bs,["ULR"]:As,["URD"]:U,["UBL"]:L,["UCM"]:ft,["UEM"]:ks,["UHS"]:vs,["UIM"]:ft,["UWL"]:O,["UWS"]:O,["UIW"]:O,["URS"]:L,["UTM"]:O,["UTR"]:bt,["URB"]:Ut,["UPM"]:ee,["VIC"]:O,["VIK"]:O,["VRP"]:Ss,["VBK"]:U,["VIN"]:fe,["VTC"]:U,["VTW"]:le,["VGN"]:St,["VND"]:O,["VNF"]:gt,["VNS"]:O,["VSK"]:L,["VCH"]:ut,["VGR"]:L,["VSP"]:L,["VGL"]:L,["VGW"]:Cs,["VOB"]:L,["VCG"]:Ot,["VES"]:Ut,["VYE"]:L,["WBY"]:gt,["WBU"]:gt,["WMC"]:O,["WMR"]:ft,["WMM"]:L,["WTK"]:Te,["WTW"]:U,["WEB"]:le,["WTA"]:ws,["WWP"]:O,["WWR"]:ft,["WOD"]:ut,["WFM"]:ee,["WWS"]:Ds,["WBH"]:ve,["WCS"]:xs,["WPD"]:U,["WSE"]:Bs,["WPC"]:ut,["WFB"]:O,["WFS"]:ft,["WBG"]:Ot,["XTE"]:ee,["XCR"]:U,["XDH"]:gt,["XHS"]:St,["XHU"]:U,["XRF"]:Hs,["XSH"]:ft,["XTR"]:O,["XDV"]:Ae,["XRW"]:L,["YWC"]:U,["YNS"]:Ft,["ZXR"]:Ns,["ZPM"]:ft,["ZTR"]:Z,["ZTU"]:St,["ZIN"]:U,["ZDK"]:O,["ZBS"]:Z,["ZST"]:Z,["ZMT"]:Fs,["ZMB"]:Z,["ZSH"]:Ot};makeCard(t){try{let e;if(t==="SOV3"?e=new Ts(t):t==="SOC3"?e=new O(t):t==="LOD3"?e=new ji(t):t==="GOS3"?e=new cs(t):e=new this.mapper[Nt.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 G=new Ps;class Ms{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(R.ui.animating)return;let s,l;this.scaleFactor===1?(s=t,l=e):(s=Math.round(t*this.scaleFactor),l=Math.round(e*this.scaleFactor));let f,m=S.clickMode;return m==="M"?f=r:r===st.ForceRight?f=st.Right:m==="T"?f=st.Left:f=st.Right,Ue.arrayHit(this.registry,s,l,f)}updateScale(t){t===1?this.scaleFactor=1:this.scaleFactor=1/t}scaleFactor=1}const tt=new Ms;class Rs{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)),yt.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",T.ddf5(this.generateDeckPickerActions())):(this.step="A",T.ddf5(this.generateDeckPickerActions()));else{const r=e==="A"?this.p1:this.p2;t==="LK"?Jt.loadFromFile().then(s=>{typeof s=="string"?new We().iAmError(s):(r.deck=s,r.mode=t,S.writeStorage("cMode"+e,t),yt.drawAll())}):(r.mode=t,S.writeStorage("cMode"+e,t))}yt.drawAll()}ezDeck(t){return t.mode==="CP"?!1:(t.mode==="CR"?t.deck=Jt.randomStockDeck():t.mode==="CX"&&(t.deck=Jt.treatsAbound(!0)),!0)}handleDeckPick(t){const e=S.deTil(t.param),r=Jt.stockDeckByName(e[0],e[1]);this.step==="A"?(this.p1.deck=r,this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",T.ddf5(this.generateDeckPickerActions()))):(this.p2.deck=r,this.launchConstructed())}generateDeckPickerActions(t=-1){const e=ue.map((r,s)=>{const l=y.basicAction("DSET");return l.param=s.toString(),l});if(t>-1){const r=ue[t],s=r.decks.map(l=>{const f=y.basicAction("DECK");return f.param=S.enTil(r.id,l.name),f});return e.concat(s)}return e}launchConstructed(){R.aiMode=this.vsAI,At.setMode("G"),R.newGame(this.p1.deck.cards,this.p2.deck.cards)}replay(){R.newGame(this.p1.deck.cards,this.p2.deck.cards)}dud(){return{mode:"CP",deck:{cards:[],name:"",factions:[]}}}}const Mt=new Rs;class Es{deathOrder=[];graveyard=[];reset(){this.graveyard=[],this.deathOrder=[]}purge(){this.deathOrder=[]}getState(){const t={dO:this.deathOrder,gY:this.graveyard};return JSON.stringify(t)}setState(t){const e=JSON.parse(t);this.deathOrder=e.dO,this.graveyard=e.gY}deathCheck(){const t=R.tick();g.qActiveCreats().forEach(s=>{s.health<1&&(p.new().crd(s.code).txt(" died.").go(),this.smite(s,t))});const e=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"?(p.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(f=>f.owner===r);e!=="LA"&&(s=s.filter(f=>D.levelTargetTest(e,parseInt(f.cardCode.slice(3)))));const l=s.length;return l===0?"":s[S.randInt(0,l)].cardCode}}smite(t,e=void 0){t.status="D",this.deathOrder.push({creatId:t.id,time:e||R.tick()}),this.graveyard.push({cardCode:t.code,owner:t.owner}),x.addEvents($.creature("DIE",t)),ae.positionChange(t.owner),t.owner?E.deathsA.push(t.code):E.deathsB.push(t.code)}}const V=new Es;class Is{get youi(){return R.ui}initDeck(t,e){this.youi.deckContents=t,this.youi.deckScroll=0,this.youi.deckSummary=e,At.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=D.cardByTarget(t,r);if(s.sort((l,f)=>{const m=l[0],A=f[0];return A===m?0:m>A?1:-1}),e){const l=s.length;let f=0,m="",A=0;const C=[];for(;f0&&C.push({cardCode:m,sourceIdx:-1,cardCount:A}),m=s[f][0],A=1),f++;return l>0&&C.push({cardCode:m,sourceIdx:-1,cardCount:A}),C}else return s.map(l=>({cardCode:l[0],sourceIdx:l[1],cardCount:0}))}handleShowDeck(t){let e;const r=S.deTil(t.param);if(r[0]==="VE")e=k.activeCardItems(S.txt2bool(r[1]));else{const s=k.getActive();e=t.param==="VR"?s.deck:s.discard}this.showDeck(e)}handleDeckScroll(t){this.paginate(t.param==="D"),yt.drawAll()}showCustomDeck(t,e){this.initDeck(t,!1);const r=this.rightClickers(),s=e.concat(r);return T.ddf5(s),s}showDeck(t){this.initDeck(this.generateContent(t,!0),!0);const e=T.cancelAction();e.key="CNCL",e.param="PM";const r=this.rightClickers();r.push(e),T.ddf5(r)}rightClickers(){return R.aiActive?[]:this.youi.deckContents.map((t,e)=>{const r=y.deckSelectAction("DEET",t.cardCode,e);return r.param=t.cardCode,r})}}const Dt=new Is;class Gs{friends;friendText;get browseStack(){return R.ui.detailStack}n(t,e){return`${t}${e}`}friendo(t,e){const r=Array.isArray(e)?e:[e];[1,2,3].forEach(s=>{this.friends[this.n(t,s)]=r.map(l=>this.n(l,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("ASQ",1)]:[this.n("SLG",1),this.n("WEB",1)],[this.n("ASQ",2)]:[this.n("WEB",2)],[this.n("ASQ",3)]:[this.n("WEB",3)],[this.n("CGL",1)]:[this.n("CGF",1)],[this.n("DHC",1)]:[this.n("DYF",1)],[this.n("DTD",1)]:[this.n("TOT",1)],[t]:[this.n("FWG",1)],[this.n("MPH",1)]:[t],[this.n("MPH",2)]:[t],[this.n("MPH",3)]:[t],[this.n("NGQ",4)]:[this.n("NSD",4)],[this.n("RHU",1)]:[this.n("RSC",1)],[this.n("SSE",1)]:[this.n("SXD",1)],[this.n("SSE",2)]:[this.n("SXP",2)],[this.n("SSE",3)]:[this.n("SXT",3)],[this.n("TRA",2)]:[this.n("PTR",2)],[this.n("TRA",3)]:[this.n("PTR",3)],[this.n("TRS",2)]:[this.n("STO",2)],[this.n("TRS",3)]:[this.n("STO",3)],[this.n("TRV",2)]:[this.n("ITO",2)],[this.n("TRV",3)]:[this.n("ITO",3)],[this.n("TRW",2)]:[this.n("STR",2)],[this.n("TRW",3)]:[this.n("STR",3)],[this.n("TGK",1)]:[this.n("SXD",1)],[this.n("TGK",2)]:[this.n("SPL",2)],[this.n("TGK",3)]:[this.n("TTF",3)],[this.n("TSL",1)]:[this.n("FUN",1)],[this.n("ZTU",2)]:[this.n("ZTR",2)]},this.friendo("BLH","LWY"),this.friendo("BTM","BOS"),this.friendo("BWD","TFD"),this.plont("BTS"),this.friendo("BWT","DNK"),this.friendo("CSB","ZBS"),this.friendo("CYS","COZ"),this.friendo("DSK","SPN"),this.friendo("DDF","SXT"),this.friendo("DNK","BWT"),this.friendo("DZD","DZA"),this.friendo("DBQ","BRF"),this.friendo("EPH","EPS"),this.friendo("FST","ZST"),this.friendo("FWK","ZMB"),this.friendo("FGD",["FGA","FGB","FGG","FGO"]),this.friendo("FGG","FGO"),this.friendo("FMD","FME"),this.plont("GMR"),this.friendo("IZL",["IFL","IFR","IZR"]),this.friendo("IZR",["IFL","IFR","IZL"]),this.friendo("IZK",["IFL","IFR","IZL","IZR"]),this.friendo("NCM","POZ"),this.friendo("NSW","SPN"),this.friendo("NSH","NDR"),this.friendo("NGQ","NSD"),this.friendo("NFF","TFF"),this.friendo("NOZ","OOZ"),this.friendo("PHC","CYP"),this.plont("PTB"),this.friendo("RWC","RPT"),this.plont("STS"),this.friendo("SSP","DFM"),this.friendo("SDA","HTP"),this.friendo("SLG","WEB"),this.friendo("SND","SPU"),this.friendo("SIV","KBE"),this.friendo("TNL","ZMB"),this.friendo("VIC",["IFL","IFR"]),this.plont("WWS"),this.friendo("YNS","XYR");const e=42,r=31,s=40,l=51,f=38,m=52,A=66;this.friendText={["BOS"]:[l,""],["BWT"]:[68,"Bron"],["BRF"]:[18,""],["CGF"]:[65,"Fiend"],["CYP"]:[4,""],["COZ"]:[r,""],["DFM"]:[33,"Mimic"],["DNK"]:[8,""],["DZA"]:[59,"Dozer"],["DYF"]:[38,"Infusion"],["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"]:[l,""],["SXP"]:[l,""],["SXD"]:[s,""],["SXT"]:[f,""],["SDL"]:[s,""],["SLG"]:[25,""],["SPN"]:[A,""],["STR"]:[e,"Torrent"],["SPU"]:[A,""],["XYR"]:[A,""],["STO"]:[e,"Torrent"],["TOT"]:[40,"Tendrils"],["TFK"]:[f,""],["TFD"]:[f,""],["TFF"]:[f,""],["TTF"]:[f,""],["WEB"]:[78,""],["ZTR"]:[32,"Returned"],["ZBS"]:[m,""],["ZST"]:[m,""],["ZMB"]:[m,""]}}get currentCard(){const t=this.browseStack;return t[t.length-1]}get friendos(){return this.friends[this.currentCard]??[]}get canGoBack(){return this.browseStack.length>1}init(t){if(!R.aiActive)if(R.ui.detailStack=[t],At.mode!=="R"){At.setMode("R");const e=y.basicAction("CNCL");e.zone=At.baseMode==="G"?"B":"N",e.param="PM",T.ddf5([e])}else yt.drawAll()}changeLevel(t){const e=this.browseStack,r=e.length-1,s=e[r];e[r]=this.n(Nt.extractCardCode(s),t)}goBack(){this.browseStack.pop()}goToFriend(t){this.browseStack.push(t)}friendTxt(t){const e=this.friendText[t];return e||[3,"I am error"]}goBackAction(){const t=y.basicAction("DTUP");return t.param="DB",t}levelAction(t){const e=y.basicAction("DTUP");return e.param=S.enTil("DL",t),e}friendAction(t){const e=y.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 jt=new Gs,Ke=[1,2,3,4,5,6].map(n=>n.toString());class Ls{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(de.map(t=>[t,!0])),this.setFilters=new Map(Ke.map(t=>[t,!0])),this.stats=new ei}getRarity(t){return this.rarityFilters.get(t)??!0}toggleRarity(t){const e=!this.rarityFilters.get(t);return this.rarityFilters.set(t,e),e}getSet(t){return this.setFilters.get(t.toString())??!0}toggleSet(t){const e=t.toString(),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),Ke.forEach(t=>{this.setFilters.set(t,S.readBoolStorage("dSet"+t,!0))}),de.forEach(t=>{this.rarityFilters.set(t,S.readBoolStorage("dRare"+t,!0))})),yt.drawAll()}setFArr(){let t=Ke.filter(e=>this.setFilters.get(e)).map(e=>parseInt(e));return t.length===6&&(t=[]),t}validRarities(){return de.filter(t=>this.rarityFilters.get(t))}startDraftPicks(){const t=this.setFArr();de.forEach(e=>{this.getRarity(e)?this.rarityCache[e]=Jt.getDeckCards([e],[],t):this.rarityCache[e]=[]}),de.every(e=>this.rarityCache[e].length===0)&&(this.rarityCache["C"]=this.fun()),this.packOdds=this.fatPacks?[9,31,40]:[5,25,40],this.faction1="X",this.faction2="X",this.factionLock=!1,this.picks=[],this.picksAsDeck=[],this.scrollIdx=0,this.stats=new ei,this.resumeDraft("")}resumeDraft(t){if(t){this.picks.push(t),this.picksAsDeck=this.picksToDeck();const s=this.overdraft?60:30;if(this.picks.length===s){this.step==="A"?(this.pAdeck=this.picksAsDeck.slice(),this.step="B",this.startDraftPicks()):(this.pBdeck=this.picksAsDeck.slice(),this.launchDraft());return}const l=G.getCard(t);if(this.aiPicking||this.stats.addStat(l.type,l.faction),!this.factionLock){const f=l.faction;if(this.faction1==="X")this.faction1=f;else if(f!==this.faction1){this.faction2=f,this.factionLock=!0;const m=this.setFArr();this.validRarities().forEach(A=>{this.rarityCache[A]=Jt.getDeckCards([A],[this.faction1,this.faction2],m)})}}}const e=this.generatePack().slice(-1*(6-this.picks.length%5)),r=this.fillPack(e);if(this.aiPicking)this.resumeDraft(r[r.length-1]);else{this.currentPack=r;const s=r.map((l,f)=>{const m=y.draftSelectAction("DRFT",f,!0);return m.param=l,m});T.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=G.getCard(e.card+"1"),l=G.getCard(r.card+"1");return s.name.toLowerCase(){const s=this.rarityCache[r].length;let l=!0,f=0;for(;l&&f<100;){const m=this.rarityCache[r][S.randInt(0,s)];e.includes(m)?f++:(e.push(m),l=!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));yt.drawAll()}launchDraft(){R.aiMode=this.vsAI,At.setMode("G"),R.newGame(this.pAdeck,this.pBdeck)}fun(){return[["ART","SVO","MPH","VSK","MSP","LYS"],["CAG","ATG","WMM","ESU","BWH","CBS"],["DHW","NCF","ROG","EXD","TPT","HOX"],["FLS","STP","BRN","TCG","AQE","VOB"]][S.randInt(0,4)]}}const pt=new Ls;class $s{async drawAll(){if(ht.simOn)return;const t=At.mode;tt.removeAll(),this.clearDetails(),t==="G"?(this.clearDeck(),await Promise.all([this.drawHand(k.getLocal()),this.drawPlayers(),this.drawField(),this.drawActions(T.activeActions)]),R.winFlag!==0?await this.drawGameOver():await this.drawCommonButtons(!0,!0,!0)):t==="R"?await this.drawDetails(T.activeActions):t==="T"?R.aiActive||await this.drawDeck(T.activeActions):t==="D"?await this.drawDraft(T.activeActions):t==="C"?await this.drawConstructed():t==="I"?await this.drawInfoMenu():t==="X"?await this.drawExit(T.activeActions):t==="S"?await this.drawSwap():await this.drawMenu()}async drawGameOver(){await new Se().drawGameOver()}async drawHand(t){await new gi().drawCards(t)}async drawField(){await new Je().drawCards()}async drawPlayers(){await new Se().drawAllPlayers()}async drawDeck(t){const e=t.find(f=>f.zone==="B"),r=[];e&&r.push(e),await new Le().drawActions(r);const l=new ia;await l.drawCards(),await l.drawActions(t),await this.drawCommonButtons(!0,!0,!1)}async drawActions(t){if(ht.simOn)return;const e=new Le;if(R.aiActive)await e.drawActions([]);else{at.get("effects").clear();const s=new gi,l=new Je,f=new Se;await Promise.all([s.drawActions(t),l.drawActions(t),e.drawActions(t),f.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;R.ui.animating=!0,at.get("effects").clear(),await new Je().drawFight(t),R.ui.animating=!1}async drawDraft(t){at.get("effects").clear();const r=new sa,s=at.get("game-ui");s.clear(),tt.removeAll(),pt.step==="O"?await r.drawDraftMenu(s):(await new Ce().drawPickerPlayer(s,pt.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 aa,e=at.get("game-ui");e.clear(),tt.removeAll(),await t.drawMenu(e)}async drawInfoMenu(){const t=new Ce,e=at.get("game-ui");e.clear(),tt.removeAll(),await t.drawExtrasMenu(e)}async drawConstructed(){if(Mt.step==="O"){const t=new We,e=at.get("game-ui");e.clear(),tt.removeAll(),await t.drawConstrMenu(e)}else await this.drawDeckPick(T.activeActions)}async drawDeckPick(t){const e=new We,r=new Ce,s=at.get("game-ui");s.clear(),tt.removeAll(),await r.drawPickerPlayer(s,Mt.step==="A",Mt.vsAI),await e.drawSets(t,s),await e.drawList(t,s)}clearDetails(){at.get("card").clear()}clearDeck(){at.get("decklist").clear()}async drawDetails(t){await this.drawActions(t),await this.drawCommonButtons(!0,!0,!1),at.get("card").clear();const r=new ra,s=t.find(l=>l.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 l=723,f=new je,m=at.get("game-ui");if(r&&m.clear(),t&&(await f.makeIconButton(m,s,l,"EX"),s-=50),e){const A=S.clickMode;A!=="M"&&await f.makeIconButton(m,s,l,A==="I"?"TM":"DM")}}async drawExit(t){at.get("decklist").clear();const r=at.get("effects"),s=new ye;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=at.get("decklist");t.clear(),t.context.fillStyle="#000000",t.context.fillRect(0,0,S.gameWidth,S.gameHeight);const e=new Se,r=k.getActive(),s="#AAF0C1",l=y.basicAction("USWP");l.param="PM",await e.drawPlayer(r,t,200,300);const f={fontSize:22,colour:s};await e.drawText(t,"Player "+(r.isPlayerA?"1":"2"),480,360,f),await e.drawText(t,"Click to start turn",480,420,f);const m=new ct(l,0,0,S.gameWidth,S.gameHeight,st.Both);tt.add(m)}setBackground(t){const e="hide";this.allBackgrounds.forEach(r=>{const s=document.getElementById(r);s&&(t===r?s.classList.remove(e):s.classList.add(e))})}playmatSetup(){let t=!1;const e=S.options.playmat,r=document.getElementById("playmat");if(r?r.dataset.pic!==e&&(t=!0,r.remove()):t=!0,t){const s=new Image(S.gameWidth,S.gameHeight);s.id="playmat",s.classList.add("hide",this.scaleCSS(S.options.scale)),s.dataset.pic=e,s.src=S.imgRoot+`background/playfield-${e}.jpg`,document.getElementById("mainmenu").before(s)}}scaleCSS(t){return`uiSize${t}`}changeScale(t){this.clearAll();let e=S.options.scale;e===t&&(e="100");const r=t==="100"?1:.90625;tt.updateScale(r);const s=this.scaleCSS(e),l=this.scaleCSS(t);this.allCanvases.forEach(A=>{at.get(A).dom.classList.replace(s,l)}),this.allBackgrounds.forEach(A=>{const C=document.getElementById(A);C&&C.classList.replace(s,l)}),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=>{at.get(t).clear()})}allCanvases=["game-ui","field","player","hand","effects","decklist","card"];allBackgrounds=["playmat","blueface","mainmenu"]}const yt=new $s;class Ws{positionChange(t){g.creatByTarget().forEach(e=>{e.enforceEffects("PS",t)}),k.enforceEffects(t)}defenderChange(t){g.qActiveCreats().forEach(r=>{r.effects.filter(s=>s.watch==="DF").filter(s=>s.area==="C"&&r.owner===t||s.area==="A").forEach(s=>G.getCard(s.logicCode).enforceEffect(s,r))})}playerHealthChange(){g.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){g.qActiveCreats().forEach(e=>{e.enforceEffects("AT"),e.enforceEffects("AR"),e.enforceEffects("CH"),e.enforceEffects("DF",e.owner)})}}const ae=new Ws;class Vs{getC(t){return g.jr5(t)}creature(t,e){return{code:t,creatId:e.id}}creatHeal(t,e){return{code:"CHL",creatId:t.id,healAmt:e}}damage(t,e,r,s,l,f,m){let A;return f instanceof Be?A=f.id:A=f,{code:"DMG",battle:t,dmg:e,life:r,isCreatSrc:s,isCreatTarg:l,target:A,srcId:m?.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,l;return e.isCreatTarg?l=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,life:e.life,isCreatSrc:e.isCreatSrc,srcId:e.srcId,target:e.target,isCreatTarg:e.isCreatTarg,srcCreat:r,hurtCreat:l,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 $=new Vs;class Us{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 Be(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=D.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=>G.getCard(r.code).canLevel())),t.level!=="LA"){const r=D.levelTargetToLevel(t.level);e=e.filter(s=>r.includes(s.level))}t.cardCode&&(e=e.filter(r=>G.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,l=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 m=(typeof t=="string"?G.getCard(t):t).jr3(r,s);if(r===k.getActiveB()&&E.birthRegistrar(m.id),e==="F"||e==="R"){const C=g.searchByLane(s,r);if(C){const F=p.new().crd(C.code).txt(" was replaced");e==="R"?F.txt(" with ").crd(m.code).txt(".").go():F.txt(".").go(),C.status="R",x.addEvents($.replaced(m,C))}}this.field.push(m);const A=$.enterField(m);return A.forged=e==="F",this.birthOrder.push({creatId:m.id,time:l||R.tick()}),x.addEvents(A),m.enforceEffects("PH"),ae.positionChange(r),m}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(y.crTarg())}qPlayerCreats(t){const e=y.crTarg();return e.player=k.toTarget(t),this.creatByTarget(e)}ddf1(){return this.creatByTarget(y.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(y.crEnemyTarg())}}const g=new Us;class Os{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 l=0;if(e>0){const f=t===2&&r.breakthrough;l=s.hurtBattle(r.attack,r,f)}else t===2&&(l=r.attack);l>0&&k.hurtBattle(!r.owner,l,r)}}fight(t){const e=!ht.simOn;e&&p.add("FIGHT!");let r=2,s=1;t&&(E.mainBattle=!1,r=0,s=0);const l=k.getActiveB(),f=[],m=[];g.laneIdx.forEach(C=>{const F=g.searchByLane(C,l),W=g.searchByLane(6-C,!l),Y=this.creatFightState(F,r),j=this.creatFightState(W,s);(Y===2||j===2)&&(m.push([Y,j,F,W],[j,Y,W,F]),Y===2&&(E.ffs++,f.push([C,l])),j===2&&f.push([g.oppositeLane(C),!l]))}),this.barking&&f.length>0&&e&&S.dogBark();let A;e?A=yt.drawCombat(f):A=Promise.resolve(),A.then(()=>{m.forEach(C=>this.dukeItOut(...C)),ae.playerHealthChange(),V.deathCheck(),x.type="C0",T.actionDone()})}barking=!0}const ci=new Os;class zs{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,ci.barking=S.options.bark,k.activePlayer=S.randInt(0,2)===0,this.aiActive=!k.activePlayer&&this.aiMode,k.isLocalA=this.aiMode||k.activePlayer,T.actionHistory=[],ht.turnSims=0,ht.turnTime=0,g.reset(),V.reset(),this.ui=this.freshUI(),E.firstTurn=!0,this.winFlag=0;const r=k.nameOSaurus();k.initPlayer(!0,t,"Forgy McGhee",25),k.initPlayer(!1,e,r[0],r[1]),p.setup(),p.add("Ready...FIGHT!"),E.startTurn()}freshUI(){return{handScrollLeft:0,detailStack:[],deckContents:[],deckScroll:0,deckSummary:!1,animating:!1}}}const R=new zs;class Zs{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 xi}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 l=G.getCard(s);t=t.replaceAll("^c"+s,this.span(`${l.name} ${l.level}`,this.factMap[l.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=ti.find(l=>l[0]===r);if(s){let l;const f=s[1];f.length===2&&f[0]===f[1]?l="2x "+G.getCard(`${f[0]}1`).name:l=f.map(m=>G.getCard(`${m}1`).name).join(", "),e.push("Solbind: "+l)}}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=G.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,l=g.searchByFSA(r),f=l?this.fastName(l.code):"Empty";e+=`Lane ${s}${this.pName(r.playerA)} ${f}`}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",["WB"]:"Web",["WN"]:"Wind",["WF"]:"Wolf",["WR"]:"Wurm",["YT"]:"Yeti",["ZB"]:"Zombie"};tribeText(t){return this.tribeT[t]}}const p=new Zs;class Ys{handleMainMenuButton(t){t.param==="D"?(At.setMode("D"),S.options.wasDrafting=!0,yt.playmatSetup(),pt.initDraft()):t.param==="C"?(At.setMode("C"),S.options.wasDrafting=!1,yt.playmatSetup(),Mt.initConstructed()):t.param==="I"?(At.setMode("I"),yt.drawAll()):window.open("deckbuilder.html")}handleMenuButton(t){const e=S.deTil(t.param),r=e[0];let s=!0;if(r==="RP")s=!1,p.clearAll(),S.options.wasDrafting?pt.replay():Mt.replay();else if(r==="MM")At.setMode("M"),p.clearAll();else if(r==="CN"||r==="CP"||r==="CX"||r==="CR"||r==="CI"||r==="CV"||r==="LK")Mt.handleMenuPick(r,e[1]);else if(r==="DN"||r==="DR"||r==="DI"||r==="DV"||r==="LD"||r==="GP"||r==="OD"||r==="DT")pt.handleMenuPick(r,e[1]);else if(r==="alloyin"||r==="nekrium"||r==="tempys"||r==="uterra"||r==="vanilla")S.options.playmat=r,S.writeStorage("playmat",r);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 l=S.options.scale==="90"?"100":"90";yt.changeScale(l)}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&&yt.drawAll()}handleUIButton(t){t.param==="DM"?(S.setClickMode("I"),yt.drawAll()):t.param==="TM"?(S.setClickMode("T"),yt.drawAll()):t.param==="EX"?(At.setMode("X"),T.ddf5(this.generateExitActions())):console.error("missing handler for common button param "+t.param)}generateExitActions(){const t=y.basicAction("CANC");return t.param="PM",[t,y.menuButtonAction("MM")]}}const Xe=new Ys;class Ks{stack=["M"];setMode(t){this.deetMode(t)||t==="X"||t==="S"?this.stack.push(t):(this.stack=[t],t==="G"?(at.get("game-ui").clear(),yt.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(at.get("game-ui").clear(),yt.setBackground("blueface")):t==="M"&&(yt.clearAll(),yt.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 At=new Ks;class Xs{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(l=>{G.getCard(l).consistent?r.push(l):s.push(l)}),r.length===0)this.shuffle(e.deck);else{this.shuffle(s);const l=20-r.length,f=r.concat(s.slice(0,l));this.shuffle(f),e.deck=s.slice(l).concat(f)}}shuffle(t){const e=t.length,r=(s,l)=>{const f=t[s];t[s]=t[l],t[l]=f};if(e>0){let s,l;const f=e*4;for(let m=0;mr.decks).flat(),e=S.randInt(0,t.length);return t[e]}stockDeckByName(t,e){let r;if(ue.some(s=>s.id===t?s.decks.some(l=>{l.name===e&&(r=l)}):!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]],l=this.getDeckCards([],[t]),f=[],m=s[r===15?0:1][e-1];for(;f.lengthW===F)||f.push(F)}const A=f.map(C=>({card:C,num:e}));return e===2&&r===15&&(A[0].num=1),A}deckify(t){const e=t.map(r=>{const s=ti.find(l=>l[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,F)=>C+F,0);if(s!==30)return"Deck must have 30 cards, found "+s;const l=[];let f="";if(r.some(C=>{const F=Et.findIndex(W=>W.c===C.card);return F===-1?(f=C.card,!0):(l.push(Et[F].f),!1)}))return`Invalid card code: '${f}'`;let m=0;if(r.some(C=>C.num>3?(f=C.card,m=C.num,!0):!1))return`${m} copies of '${f}' ${p.fastName(f).slice(0,-2)}`;const A=[...new Set(l)];return A.length>2?"Deck must have two or less factions, found: "+A.join():""}getDeckCards(t=[],e=[],r=[]){return t.length===0&&e.length===0&&r.length===0?Et.map(s=>s.c):t.length>0&&e.length>0&&r.length===0?Et.filter(s=>t.includes(s.r)&&e.includes(s.f)).map(s=>s.c):t.length>0&&e.length===0&&r.length===0?Et.filter(s=>t.includes(s.r)).map(s=>s.c):t.length===0&&e.length>0&&r.length===0?Et.filter(s=>e.includes(s.f)).map(s=>s.c):t.length>0&&e.length>0&&r.length>0?Et.filter(s=>t.includes(s.r)&&e.includes(s.f)&&r.includes(Math.floor(s.s))).map(s=>s.c):t.length>0&&e.length===0&&r.length>0?Et.filter(s=>t.includes(s.r)&&r.includes(Math.floor(s.s))).map(s=>s.c):t.length===0&&e.length>0&&r.length>0?Et.filter(s=>e.includes(s.f)&&r.includes(Math.floor(s.s))).map(s=>s.c):Et.filter(s=>r.includes(Math.floor(s.s))).map(s=>s.c)}getCardFaction(t){const e=Et.find(r=>r.c===t);return e?e.f:"X"}getCardRarity(t){const e=Et.find(r=>r.c===t);return e?e.r:"T"}cardStats(){xe.forEach(t=>{const e=`${p.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,r=de.map(s=>`${p.rarityText(s)}: ${this.getDeckCards([s],[t]).length}`).join("; ");console.log(e+r)})}loadPromise=new Ne;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new Ne,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=l=>{try{var f=r.result;if(f){var m=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(f)));m.cards&&Array.isArray(m.cards)&&!m.cards.some(A=>!(A&&typeof A.card=="string"&&Number.isInteger(A.num)))?(this.fileguts=JSON.stringify(m),this.loadPromise.resolveMe()):this.readError("File format is invalid.")}else this.readError("File read was empty.")}catch(A){console.error(A),this.readError("Error reading file.")}};try{r.readAsArrayBuffer(s)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}const Jt=new Xs;class qs{phase="ST";enterMainPhase(){this.phase="MN";const t=k.getActive(),e=this.getMainPhaseActions(t);R.aiActive&&ht.hitMainPhase(),T.ddf5(e,!0)}async whatNext(t=!1){if(R.winFlag!==0){ht.simOn?(ht.simEndpoint(R.winFlag===1?"L":"W"),R.winFlag=0):(T.actionHistory=[],R.aiActive=!1,R.ui.animating=!1,await yt.drawAll());return}if(await yt.drawAll(),T.actionHistory.length>0)T.ddf5();else if(t)At.setMode("S"),yt.drawAll();else if(x.getNextTrigger())qe.resolve(x.getNextTrigger());else if(!x.deathCheck)V.deathCheck(),this.whatNext();else if(x.events.length>0)x.startBatch();else switch(g.purge(),V.purge(),this.phase){case "MN":this.enterMainPhase();break;case "ET":this.phase="PT",x.addEvents($.player("PTN",k.getActiveB())),Rt.expireMods(),this.whatNext();break;case "PT":E.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),this.phase="MN",this.whatNext();break;case "ST":ht.simOn?ht.simEndpoint("T"):(this.phase="MN",ht.cheater()?S.sleep(500).then(()=>this.whatNext()):S.sleep(100).then(()=>this.whatNext()));break}}expireatron(t,e,r,s){e.mods.forEach(l=>{l.expiry===s?l.expiry=r:l.expiry===r&&t.push([e,l])})}expireMods(){const t=g.creatByTarget(y.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 Be?s.expireMod(r[1]):k.expireMod(s,r[1])}),ae.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const e=this.getHandActions(t),r=this.getFieldActions(t);let s=E.mainBattle,l="M";return s||(s=g.ddf1().some(m=>m.extraBattles>0&&m.isActive&&!m.defender),l="E"),s&&e.push({key:"FITE",zone:"B",param:l,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(A=>{G.getCard(A).isFree?r.push(A):s.push(A)});const l=r.map(A=>[A,"FREE"]);E.freeCards.forEach(A=>{D.cardByTarget(s,A.condition).forEach(F=>{l.push([F[0],A.id]),s.splice(s.indexOf(F[0]),1)})}),l.push(...s.map(A=>[A,""]));const f=E.regularPlays>0;let m=t.hand.map((A,C)=>[A,C]);return f||(m=m.filter(A=>!s.includes(A[0]))),m.map(A=>{const C=l.find(F=>F[0]===A[0]);return C||console.error("No cost found for card"+A[0]),y.handSelectAction("HPLY",A[0],C[1],A[1])})}getFieldActions(t){const e=g.qPlayerCreats(t.isPlayerA),r=e.filter(l=>g.canMove(l).length>0).map(l=>y.fieldSelectAction("MOVE",l.lane,l.owner)),s=e.filter(l=>l.isActive&&l.activationAvailable?G.getCard(l.code).canActivate(l):!1).map(l=>{const f=y.fieldSelectAction("ACTV",l.lane,l.owner);return f.host=l.code,f.param=l.id,f});return r.forEach(l=>{const f=s.findIndex(m=>m.lane===l.lane);f>-1&&(s.splice(f,1),l.param="ACTV")}),r.concat(s)}}const Rt=new qs;class js{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,effects:t.effects}}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.effects=t.effects,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 l=e-s;return t.armorDmg+=s,t.health-=l,l}hurtDirect(t,e,r){const s=this.toPlayer(t),l=this.hurtPlayer(s,e);l>0&&(p.new().crd(r).txt(` dealt ${l} dmg to `).plr(s).txt(".").go(),x.addEvents($.damage(!1,l,s.health,!1,!1,s.isPlayerA,void 0)),ae.playerHealthChange())}hurtBattle(t,e,r){const s=this.toPlayer(t),l=this.hurtPlayer(s,e);l>0&&(p.new().crd(r.code).txt(` dealt ${l} battle dmg to `).plr(s).txt(".").go(),x.addEvents($.damage(!0,l,s.health,!0,!1,s.isPlayerA,r)))}heal(t,e){const r=this.toPlayer(t);r.health+=e,p.new().plr(r).txt(` gained ${e} health.`).go(),x.addEvents($.playerHeal(r.isPlayerA,e)),ae.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(y.modIdx(r.mods,e),1)}enforceEffects(t){const e=this.toPlayer(t);e.effects.forEach(r=>G.getCard(r.logicCode).enforcePlayerEffect(r,e))}activeCardItems(t){const e=this.toPlayer(t),r=e.triggers.filter(l=>l.customCode!=="AB").map(l=>l.logicCode.startsWith("EPH")?"EPS"+l.logicCode.slice(3,4):l.logicCode),s=e.effects.map(l=>l.logicCode);return r.concat(s)}newPlayer(t){return{hand:[],deck:[],discard:[],effects:[],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 l=this.toPlayer(t);l.name=r,l.nameOffset=s,l.turn=1,l.rank=1,l.health=S.options.highHealth?360:120,l.discard=[],l.deck=Jt.parseDeck(e),l.mods=[],l.triggers=[],l.effects=[],l.poison=0,l.armor=0,l.armorDmg=0,this.ambushScan(l),Jt.shuffleDeck(l),l.hand=l.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 l=y.trigger(r,s);l.cardCode=s,l.customCode="AB",t.triggers.push(l)}}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 js;class Js{stateStack=[];popCheck(){if(this.stateStack.length===0)throw new Error("Attempted to manipulate empty stack")}saveState(){const t={action:T.getState(),aiInPhase:ht.inPhase,batch:x.getState(),death:V.getState(),field:g.getState(),game:R.getState(),mode:JSON.stringify(At.stack),phase:Rt.phase,player:k.getState(),turn:E.getState()};this.stateStack.push(t)}restoreState(){this.popCheck();const t=this.stateStack[this.stateStack.length-1];T.setState(t.action),ht.inPhase=t.aiInPhase,x.setState(t.batch),V.setState(t.death),g.setState(t.field),R.setState(t.game.i,t.game.t),At.stack=JSON.parse(t.mode),Rt.phase=t.phase,k.setState(t.player),E.setState(t.turn)}popState(){this.popCheck(),this.stateStack.pop()}}const pe=new Js;class Qs{toActions(t){return(Array.isArray(t)?t:[t]).map(r=>{const s=this.actionTargGuts(r);return s.forEach(l=>{l.host=r.host,l.param=r.param,l.hint=r.hint}),s}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(e=>y.handSelectAction(t.key,e[0],"",e[1]));if(t.target==="TF"){if(t.field==="O")return g.creatByTarget(t).map(e=>y.fieldSelectAction(t.key,e.lane,e.owner));{const e=t.player==="X"?[!0,!1]:[k.toBool(t.player)],r=S.isUn(t.lanes)?g.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return e.map(s=>r.map(l=>y.fieldSelectAction(t.key,l,s))).flat();if(t.field==="E")return e.map(s=>g.emptyLanes(s).filter(l=>r.includes(l)).map(l=>y.fieldSelectAction(t.key,l,s))).flat()}}if(t.target==="TP")return t.player==="X"?[y.playerSelectAction(t.key,!0),y.playerSelectAction(t.key,!1)]:[y.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,l)=>[s,l]);if(e){if(S.isUn(e.deckPositionSkip)||(r=r.filter(s=>s[1]!==e.deckPositionSkip)),e.faction!=="X"&&(r=r.filter(s=>G.getCard(s[0]).faction===e.faction)),e.tribe!=="AN"&&(r=r.filter(s=>{const l=G.getCard(s[0]);return l.type==="C"?l.isTribe(e.tribe):!1})),e.canLevel&&(r=r.filter(s=>G.getCard(s[0]).canLevel())),e.level!=="LA"){const s=D.levelTargetToLevel(e.level);r=r.filter(l=>{const f=parseInt(l[0].substring(3,4));return s.includes(f)})}if(e.card!=="A"){const s=e.card==="C"?"C":"S";r=r.filter(l=>G.getCard(l[0]).type===s),e.card==="C"&&!S.isUn(e.maxAttack)&&(r=r.filter(l=>G.getCard(l[0]).iAttack<=e.maxAttack))}e.cardCode&&(r=r.filter(s=>G.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 y.actionTarget("TB",t,e,r)}boardTarget(t,e){return y.actionTarget("TR",t,e,"")}ddf2(t){return t===1?"L1":t===2?"LN":"LA"}lt2l={["LA"]:()=>[1,2,3,4],["HR"]:()=>[1,2,3],["L1"]:()=>[1],["L2"]:()=>[2],["L3"]:()=>[3],["LN"]:()=>[1,2]};levelTargetToLevel(t){return this.lt2l[t]()}levelTargetTest(t,e){return this.levelTargetToLevel(t).includes(e)}levelTestCommon(t,e){return this.levelTargetTest(this.ddf2(e),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}const D=new Qs;class _s{ddf8(t){return t.trigger.type==="FR"?this.forgeTriggerTest(t,!1):t.trigger.type==="VN"?this.vengeanceTriggerTest(t):t.trigger.type==="FK"?this.flankTriggerTest(t):t.trigger.type==="AS"?this.forgeTriggerTest(t,!0):t.trigger.type==="UP"?this.upgradeTriggerTest(t):t.trigger.type==="DM"&&t.event.code==="DMG"||t.trigger.type==="HG"&&t.event.code==="CHL"||t.trigger.type==="EF"&&t.event.code==="ENT"||t.trigger.type==="DS"&&t.event.code==="DIE"||t.trigger.type==="PC"&&t.event.code==="PLC"||t.trigger.type==="MV"&&t.event.code==="MOV"||t.trigger.type==="RP"&&t.event.code==="RPL"||t.trigger.type==="LG"&&t.event.code==="PHL"||t.trigger.type==="TS"&&t.event.code==="TRS"||t.trigger.type==="TE"&&t.event.code==="TRE"||t.trigger.type==="PT"&&t.event.code==="PTN"||t.trigger.type==="RU"&&t.event.code==="RKU"?this.generalTriggerTest(t):!1}resolve(t){t.trigger.interactive&&(t.host==="P"?console.error("Encountered player hosted trigger that is interactive!!"):x.iaTrigLane=g.jr5(t.creatId).lane),G.getCard(t.trigger.logicCode).jr8(t)}forgeTriggerTest(t,e){if(t.event.code==="ENT"){const r=t.event;if(r.forged){const s=g.jr5(t.creatId),l=s.id===r.creatId&&s.status==="A";return e&&l?!s.opposed:l}}return!1}upgradeTriggerTest(t){if(t.event.code==="RPL"){const e=t.event,r=g.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=g.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=g.jr5(t.creatId);return r.status==="A"&&r.id===e.creatId}return!1}generalTriggerTest(t){return G.getCard(t.trigger.logicCode).ddf8(t)}}const qe=new _s;class ta{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 l=this.cardPlayed(e,r,s),f=k.getActive();p.new().txt("Forged ").crd(l.code).txt(".").go(),g.birth(l,"F",f.isPlayerA,t.lane),T.actionDone()}levelAndDiscardA(t){return this.levelAndDiscard(t.card,t.position)}levelAndDiscard(t,e,r=!0,s="F"){const l=G.getCard(t),f=k.toPlayer(s);if(e>-1?f.hand.splice(e,1):p.debug("Bad play index: "+e+" ("+t+")"),!l.overload){const m=l.levelUpCard();f.discard.push(m),r&&m!==t&&p.new().plr(f).txt(" leveled a card.").go()}return l}cardPlayed(t,e,r,s=!1){const l=this.levelAndDiscard(t,r,s),f=k.getActive();if(e==="")this.regularPlays-=1;else if(e!=="FREE"){const m=this.freeCards.findIndex(A=>A.id===e);m>-1?this.freeCards.splice(m,1):console.error("Could not find free card rule!")}if(this.cardsPlayed+=1,!s){const m=$.playCard(t,f.isPlayerA);x.addEvents(m)}return l}passTheTurn(){if(k.activePlayer=!k.activePlayer,Rt.phase="WT",R.aiMode){if(!ht.simOn)if(R.aiActive=!R.aiActive,R.aiActive)ht.turnSims=0,ht.turnTime=0;else{const t=`🤖: ${this.calma(ht.turnSims)} pontifications in ${(ht.turnTime/1e3).toFixed(1)} seconds.`;p.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="------";ht.log&&R.aiActive&&R.aiMode&&console.log(t+" AI Turn Start "+t),ht.simOn||(p.new().txt(t).go(),p.new().plr(k.getActiveB()).txt(" starts turn.").go()),this.resetTurnData(),Rt.phase="ST",x.addEvents($.player("TRS",k.getActiveB())),Rt.expireMods(),Rt.whatNext(!R.aiMode)}endTurn(){const t=k.getActive();t.discard.push(...t.hand),t.hand=[],t.turn++;const e=t.turn>4;x.addEvents($.player("TRE",t.isPlayerA)),e&&(t.turn=1,t.rank++,p.new().plr(t).txt(" hits Rank "+t.rank+".").go(),x.addEvents($.player("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],Jt.shuffleDeck(t.isPlayerA)),g.qActiveCreats().forEach(r=>{r.extraBattles=0}),k.drawCard(t,5),Rt.phase="ET",T.actionDone()}mobility(t){const e=g.jr5(t.param);p.new().crd(e.code).txt(" moved.").go(),e.mobilityAvailable=!1,e.move(t.lane),T.actionDone()}allied(t,e){const r=e??k.getActive(),s=y.target("TH");return s.player=k.toTarget(r),s.faction=t,D.deckByTarget(s).length>0}patron(t){const e=y.target("TH");return e.player=k.toTarget(k.getActive()),e.faction=t,D.deckByTarget(e).length>2}freeCard(t){const e=y.freeCard(t);return this.freeCards.push(e),e}birthRegistrar(t){this.mainBattle?this.newPre.push(t):this.newPost.push(t)}}const E=new ta;class di{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 Lt{getCanv(t){return t instanceof di?t:at.get(t)}async drawSprite(t,e,r,s,l={}){const f=this.getCanv(t).context,m=await S.getSprite(S.imgRoot+e);let A=1;l&&(A=l.alpha??1),A<1&&(f.globalAlpha=A),f.drawImage(m,r,s,m.naturalWidth,m.naturalHeight),A<1&&(f.globalAlpha=1)}async drawText(t,e,r,s,l={}){const f=this.getCanv(t).context,m=l.fontSize??24;S.pxRatio===2&&(s=this.retinaTextY(s,m)),f.fillStyle=l.colour||"#000000",f.font=`${m}px ${l.fontName||"cinzel"}`,f.shadowColor=l.shadow?"#000000":"#00000000",f.fillText(e,r,s),f.shadowColor="#00000000"}async spriteNumber(t,e,r,s,l,f){let m=r-this.numOffset(e,l);const A=[];e.toString().split("").forEach(C=>{A.push(this.drawSprite(t,this.numSpriteUrl(C,l,f),m,s)),m+=this.numSize(C,l)}),await Promise.all(A)}async drawHighlight(t,e,r,s,l,f="#00FF00"){const m=f.length===7?f.concat("aa"):f,A=this.getCanv(t);A.context.strokeStyle=m,A.context.beginPath(),A.context.rect(e,r,s,l),A.context.stroke()}hlColour(t){return t==="CANC"?"#FF0000":"#00FF00"}drawRarity(t,e,r,s){return this.drawSprite(t,`icons/rarity/new/${p.rarityText(e).toLowerCase()}.png`,r,s)}drawFaction(t,e,r,s){const l=e==="T"?2:0;return this.drawSprite(t,`icons/faction/${p.factionText(e).toLowerCase()}.png`,r+l,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,l)=>s+this.numSize(l,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 ye extends Lt{async drawButton(t,e,r,s,l,f=7,m=!1,A=!0){let C,F;m?(C="ui/button/menu_on.png",F="#d7fc03"):(C="ui/button/menu_off.png",F="#00DEF7");const W=this.buttonBounds(e,r);if(await this.drawSprite(t,C,W[0],W[1]),await this.drawText(t,l,W[0]+7+f,W[1]+24,{colour:F,fontSize:30}),!m||A){const Y=new ct(s,...W,st.Both);tt.add(Y)}}async buttonMaker(t,e,r,s,l,f=7,m=!1,A=!0){const C={key:"MNBT",zone:"N",host:"",param:s};await this.drawButton(t,e,r,C,l,f,m,A)}buttonBounds(t,e){return[t-7,e-7,232,69]}}class je extends Lt{async makeIconButton(t,e,r,s){let f;f=`ui/button/ui_${s}.png`,await this.drawSprite(t,f,e,r);const m=y.basicAction("UIBT");m.param=s;const A=new ct(m,e,r,40,40,st.Both);tt.add(A)}async makeVScroller(t,e,r,s,l){const f=this.vScrollHilightBounds(e,r);await this.drawSprite(t,`ui/arrow/${s?"up":"down"}.png`,e,r);const m={zone:"N",key:l,host:"",param:s?"U":"D"},A=new ct(m,...f,st.Both);tt.add(A)}vScrollHilightBounds(t,e){return[t-3,e-3,40,27]}}class Le extends Lt{async drawActions(t){if(At.baseMode==="G"){const e=at.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||R.aiActive||S.clickMode==="I"&&!At.isDetailMode){const s=this.buttonBounds();await this.drawSprite(e,"ui/button/off.png",s[0],s[1])}else{const s=r[0],l=this.buttonBounds();await this.drawSprite(e,"ui/button/on.png",l[0],l[1]);let f;s.key==="CARD"?f=s.param:f=s.key,await this.drawSprite(e,`text/butt/${f}.png`,l[0]+23,l[1]+18);const m=this.highlightBounds(),A=new ct(s,...m);s.key==="CNCL"&&(A.mouse=st.Both),tt.add(A)}}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),e=5,r=[-1,-1,2,2];return t.map((s,l)=>s+e*r[l])}}class Yt extends Lt{async drawCard(t,e,r,s){const l=this.getCanv(e),f=this.extractStats(t),m=f.cardClass;if(await this.drawSprite(l,m.image(!1),r+14,s+35),await this.drawSprite(l,this.frameImg(m.level,m.faction,m.type,!1),r,s),await this.drawSprite(l,`text/card/${m.cardCode()}.png`,r+12,s+16),f.isCreature){const A=s+178;await this.spriteNumber(l,f.att,r+24,A,"S","Y"),await this.spriteNumber(l,f.hlt,r+127,A,"S","Y")}if(f.sleeping&&await this.drawSprite(l,"icons/effects/defensive.png",r+5,s+40,{alpha:.7}),f.iconList.length>0){const A=r+57-17*(f.iconList.length-1);await Promise.all(f.iconList.map(async(C,F)=>this.drawIcon(l,A+F*35,s+140,C[0],C[1])))}}async drawBigCard(t,e,r,s){const l=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),l.isCreature){const f=s+555;await this.spriteNumber(t,l.att,r+44,f,"B","Y"),await this.spriteNumber(t,l.hlt,r+325,f,"B","Y")}}async drawIcon(t,e,r,s,l=0){const f=this.getCanv(t);if(await this.drawSprite(f,`icons/effects/${s}.png`,e,r),l>0){const m=s==="poison"?12:9;await this.spriteNumber(f,l,e+17,r+m,"S","B")}}extractStats(t){let e,r=!1,s=0,l=0,f=!1,m=0,A=!1,C=!1,F=!1,W=!1,Y=0,j=0,mt=0,z=!1,rt=!1;if(!(t instanceof Nt))r=!0,s=t.attack,l=t.health,f=t.sleeping&&!t.aggressive,m=t.regen,A=t.breakthrough,C=t.defender,F=t.aggressive,Y=t.armor,j=t.poison,mt=t.mobility,W=t.changed,e=G.getCard(t.code);else{if(t.type==="C"){r=!0;const vt=t;s=vt.iAttack,l=vt.iHealth,m=vt.iRegen,A=vt.iBT,C=vt.iDefend,F=vt.iAggro,Y=vt.iArmor,mt=vt.iMobile}z=t.overload,rt=t.consistent,e=t}const et=[];return z&&et.push(["overload",0]),rt&&et.push(["consistent",0]),m>0&&et.push(["regenerate",m]),A&&et.push(["breakthrough",0]),C&&et.push(["defender",0]),F&&et.push(["aggressive",0]),Y>0&&et.push(["armor",Y]),j>0&&et.push(["poison",j]),mt>0&&et.push(["mobility",mt]),W&&et.push(["changed",0]),{cardClass:e,isCreature:r,iconList:et,hlt:l,att:s,sleeping:f}}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,l=[-1,-1,2,2];return r.map((f,m)=>f+s*l[m])}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 ui=30,$e=540,fi=5;class gi extends Lt{async drawCards(t){const e=at.get("hand");e.clear();const r=new Yt,s=r.highlightBounds(0,0)[2]+fi;let l=ui;const f=this.paginatron(t);for(let m=f[0];m<=f[1];m++){const A=G.getCard(t.hand[m]);await r.drawCard(A,e,l,$e),l+=s}}async drawActions(t){const e=S.clickMode!=="I",r=at.get("effects"),s=new Yt,l=s.highlightBounds(0,0)[2]+fi,f=new Vt(0,520,1e3,250),m=new Vt(0,520,1e3,250,st.Right),A=this.paginatron(k.getActive());await Promise.all(t.filter(C=>C.zone==="H").map(async C=>{const F=C;if(F.position>=A[0]&&F.position<=A[1]){const W=ui+(F.position-A[0])*l;if(C.key==="DEET"){const Y=new ct(C,...s.highlightBounds(W,$e),st.Right);m.addChild(Y)}else if(e){const Y=new ct(C,...s.highlightBounds(W,$e));f.addChild(Y),await s.drawHilight(r,W,$e,this.hlColour(F.key))}}})),e&&tt.add(f),tt.add(m),A[0]>0&&await this.makeScroller(r,!1),A[1]0&&t.hand.length-e<5&&(e=Math.max(0,t.hand.length-5),R.ui.handScrollLeft=e),[e,Math.min(e+4,t.hand.length-1),t.hand.length-1]}scrollHilightBounds(t,e){return[t-3,e-2,27,38]}async makeScroller(t,e){const r=e?894:856,s=726,l=this.scrollHilightBounds(r,s);await this.drawSprite(t,`ui/arrow/${e?"right":"left"}.png`,r,s),await this.drawHighlight(t,...l);const f={zone:"N",key:"SCRH",host:"",param:e?"R":"L"},m=new ct(f,...l,st.Both);tt.add(m)}}class Je extends Lt{fieldBoundary=[17,62,821,443];async drawCards(t){const e=k.getLocalB(),r=at.get("field");r.clear();const s=new Yt,l=g.qActiveCreats().map(f=>{let m=0;t&&t.scrappers.some(C=>C[0]===f.lane&&C[1]===f.owner)&&(m=t.battlePhase);const A=this.coordCalc(f.lane,f.owner,e,m);return s.drawCard(f,r,...A)});if(await Promise.all(l),x.iaTrigLane>0){const f=this.coordCalc(x.iaTrigLane,k.getActiveB(),e),m=s.cardBounds(...f),A=m[1]+m[3]+11,C=m[0]+m[2]/2;await this.drawSprite(r,"icons/rewards/gold.png",C-10,A),await this.drawSprite(r,"icons/rewards/gold.png",C-35,A),await this.drawSprite(r,"icons/rewards/gold.png",C-60,A),await this.drawSprite(r,"icons/rewards/gold.png",C+15,A),await this.drawSprite(r,"icons/rewards/gold.png",C+40,A)}}async drawActions(t){const e=S.clickMode!=="I",r=k.getLocalB(),s=at.get("effects"),l=new Yt,f=new Vt(...this.fieldBoundary),m=new Vt(...this.fieldBoundary,st.Right);await Promise.all(t.filter(A=>A.zone==="F"||A.zone==="R").map(async A=>{if(A.zone==="R"&&e){const C=new ct(A,...this.fieldBoundary);tt.add(C),await this.drawHighlight(s,...this.fieldBoundary)}else{const C=A,F=this.coordCalc(C.lane,C.playerA,r);if(A.key==="DEET"){const W=new ct(A,...l.highlightBounds(...F),st.Right);m.addChild(W)}else if(e){const W=new ct(A,...l.highlightBounds(...F));f.addChild(W),await l.drawHilight(s,...F,this.hlColour(C.key))}}})),e&&f.childs.length>0&&tt.add(f),m.childs.length>0&&tt.add(m)}async drawFight(t){if(t.length>0){const e={battlePhase:1,scrappers:t},r=72;await new Le().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 l=r===e,f=166,m=5;let A,C,F;return[A,F,C]=l?[22,290,1]:[687,65,-1],[A+(t-1)*f*C,F+s*m*(-1*C)]}}class Se extends Lt{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 l=this.getCanv(e);await this.drawSprite(l,`avatar/${this.avatars[t.avatar]}.jpg`,r+46,s+48),await this.drawSprite(l,"ui/player_frame.png",r,s),await this.drawSprite(l,"ui/player_health.png",r+10,s+102),await this.spriteNumber(l,t.health,r+45,s+149,"B","G"),await this.drawText(l,`Turn: ${t.turn} Rank: ${t.rank}`,r+25,s+210,{colour:"#f5f242",fontSize:20}),await this.drawText(l,t.name,r+t.nameOffset,s+185,{colour:"#42a4f5",fontSize:20});const f=k.totalPoison(t),m=k.totalArmor(t),A=k.activeCardItems(t);if(f>0||m>0||A.length>0){const C=new Yt,F=s+9;if(f>0&&await C.drawIcon(l,r+15,F,"poison",f),m>0&&await C.drawIcon(l,r+150,F,"armor",m),A.length>0){await C.drawIcon(l,r+156,s+147,"changed");const W=y.basicAction("VWDK");W.param=S.enTil("VE",S.bool2txt(t.isPlayerA));const Y=new ct(W,r+155,s+147,36,36,st.Both);tt.add(Y)}}}async drawAllPlayers(){const t=at.get("player");t.clear();const e=!R.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 l=862;const f=295,m=Array(E.regularPlays).fill("blue").concat(E.freeCards.map(C=>C.sourceCard)),A=[];m.forEach(C=>{let F;if(C==="blue")F=C;else if(F="green",e){const W={key:"DEET",zone:"N",host:"",param:C},Y=new ct(W,l-1,f-1,28,41,st.Both);tt.add(Y)}A.push(this.drawSprite(t,`ui/${F}card.png`,l,f)),l+=30}),await Promise.all(A)}await this.drawDeckButton(t,r,!0,e),await this.drawDeckButton(t,r,!1,e)}async drawDeckButton(t,e,r,s){let l,f,m;if(r?(l=e.discard.length,f=935,m="T"):(l=e.deck.length,f=858,m="U"),await this.drawSprite(t,`ui/button/faction_${m}.png`,f,350),await this.spriteNumber(t,l,f+38,350+14,"S","Y"),l>0&&s){const C=y.basicAction("VWDK");C.param=r?"VD":"VR";const F=new ct(C,f,350,77,44,st.Both);tt.add(F)}}async drawActions(t){if(S.clickMode==="I")return;const e=at.get("effects"),r=k.getLocalB();await Promise.all(t.filter(s=>s.zone==="P").map(s=>{const l=s,f=this.playerOrigin(l.playerA===r),m=this.highlightBounds(...f),A=new ct(s,...m);return tt.add(A),this.drawHighlight(e,...m)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,e){return[t+18,e+18,170,170]}highlightBounds(t,e){return this.playerBounds(t,e)}async drawGameOver(){const t=at.get("field"),e=94,r=k.getLocalB(),s=R.winFlag,l=r&&s===1||!r&&s===-1;await this.drawSprite(t,`ui/you-${l?"win":"lose"}.png`,e,89),tt.removeAll();const f=new ye,m=at.get("effects");await f.drawButton(m,e+62,520,y.menuButtonAction("MM"),"Main Menu",20,!1),await f.drawButton(m,e+389,520,y.menuButtonAction("RP"),"Replay",55,!1)}async drawAiGear(t,e){const l=t%6,f=Math.floor(t/6),m=at.get("effects"),A=`icons/rewards/${e?"gold":"silver"}.png`;await this.drawSprite(m,A,862+l*24,255+f*24)}hwhipe(){at.get("effects").clear()}}const mi=15,pi=15,ea=5;class ia extends Lt{constructor(){super();const e=new Yt().highlightBounds(0,0);this.xOffset=e[2]+ea,this.yOffset=e[3]+25}xOffset;yOffset;async drawCards(){const t=at.get("decklist");t.clear(),t.context.fillStyle=this.haze,t.context.fillRect(0,0,849,S.gameHeight);const e=new Yt,s=Dt.visibleContent().map((l,f)=>{const m=G.getCard(l.cardCode),A=this.listXY(f);return e.drawCard(m,t,...A).then(()=>{if(l.cardCount>0)return this.drawCount(t,A[0]+61,A[1]+163,l.cardCount)})});await Promise.all(s)}async drawActions(t){const e=at.get("decklist"),r=new Yt,s=new je,l=S.clickMode!=="I",f=Dt.visibleContent(),m=R.ui,A=m.deckScroll,C=A+15,W=m.deckSummary?st.Both:st.Right,Y=new Vt(...this.deckBoundary()),j=new Vt(...this.deckBoundary(),W),mt=[];t.forEach(z=>{if(z.key==="DEET"){const rt=z;if(rt.position>=A&&rt.positionvt.sourceIdx===rt.position);if(et>-1){const vt=this.listXY(et-A),we=new ct(z,...r.highlightBounds(...vt));Y.addChild(we),mt.push(r.drawHilight(e,...vt,this.hlColour(z.key)))}}}),l&&Y.childs.length>0&&tt.add(Y),j.childs.length>0&&tt.add(j),Dt.canPageDown&&mt.push(s.makeVScroller(e,319,723,!1,"SCRK")),Dt.canPageUp&&mt.push(s.makeVScroller(e,487,723,!0,"SCRK")),await Promise.all(mt)}async drawCount(t,e,r,s){await this.drawSprite(t,"ui/dullcard.png",e,r),await this.spriteNumber(t,s,e+13,r+12,"S","Y")}listXY(t){return[mi+t%5*this.xOffset,pi+Math.floor(t/5)*this.yOffset]}deckBoundary(){return[mi,pi,this.xOffset*5,this.yOffset*3]}}class ra extends Lt{async drawDetails(t){const e=[],r=at.get("card");r.clear(),r.context.fillStyle=this.haze,r.context.fillRect(0,0,849,S.gameHeight);const s=30,l=30,f=G.getCard(jt.currentCard),m=new Yt;S.options.bigCards?e.push(m.drawBigCard(r,f,s,l)):e.push(m.drawCard(f,r,134,280));const A=435;let C=30;const F="#f5f242",W="#03fcfc",Y=33,j=23,mt=28;let z=f.name;for(;z.length>0;){C+=36;let xt;if(z.length{for(;xt.length>0;){let Kt;if(xt.length1){const xt=f.cardCode(),Kt=vt===3?[19,147,270]:vt===2?[78,216]:[0,98,196,294];et.forEach((ce,Ve)=>{e.push(this.drawLevelButton(r,xt,ce,40+Kt[Ve],658,ce===f.level))})}const we=new ye;let De=0;const Qe=513,_e=697,yi=74;At.baseMode!=="G"&&(e.push(we.drawButton(r,Qe,_e,t,"Close",62,!1)),De++);const ha=new ct(t,s,l,377,603,st.Both);if(tt.add(ha),jt.canGoBack){const xt=jt.goBackAction();e.push(we.drawButton(r,Qe,this.buttonY(_e,De,yi),xt,"Back",72,!1)),De++}jt.friendos.forEach(xt=>{const Kt=G.getCard(xt),ce=jt.friendAction(xt),Ve=jt.friendTxt(Kt.cardCode());e.push(we.drawButton(r,Qe,this.buttonY(_e,De,yi),ce,Ve[1]||Kt.name,Ve[0],!1)),De++}),await Promise.all(e)}buttonY(t,e,r){return t-e*r}cardSummary(t){const e=p.factionText(t.faction),r=p.rarityText(t.rarity),s=p.cardTypeText(t.type);return`${e}, ${r} ${s}`}tribeSummary(t){return t.tribe.map(e=>p.tribeText(e)).join(" ")}async drawLevelButton(t,e,r,s,l,f){if(await this.drawSprite(t,`icons/frame/level${r}.png`,s,l),!f){const F=jt.levelAction(r),W=new ct(F,s-15,l-5,88,112,st.Both);tt.add(W)}const A=G.getCard(`${e}${r}`).levelSpice(),C=[[-16,55],[41,55],[11,79]];await Promise.all(A.map((F,W)=>{const Y=s+C[W][0],j=l+C[W][1];if(F.icon==="A"||F.icon==="H"){let mt,z;return F.icon==="A"?(mt="icons/frame/attack.png",z=Y+17):(mt="icons/frame/health.png",z=Y+16),this.drawSprite(t,mt,Y-1,j-1).then(()=>this.spriteNumber(t,F.num,z,j+10,"S","Y"))}else{let mt=this.spiceIcon(F.icon);if(F.icon==="U"||F.icon==="D"||F.icon==="L"||F.icon==="N"){const z=`icons/effects/${mt}.png`;return this.drawSprite(t,z,Y-1,j-1).then(()=>this.spriteNumber(t,F.num,Y+16,j+10,"S","B"))}else return new Yt().drawIcon(t,Y,j,mt,F.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 sa extends Lt{packLeft=22;packTop=190;packBoundary=[this.packLeft-5,this.packTop-10,537,480];async drawPack(t,e){const r=new Yt,s=S.clickMode!=="I",l=[],f=new Vt(...this.packBoundary),m=new Vt(...this.packBoundary,st.Right);t.filter(C=>C.pack).forEach(C=>{const F=this.coordCalcPack(C.index);if(C.key==="DRFT"){const W=G.getCard(C.param+"1");if(l.push(r.drawCard(W,e,...F).then(()=>this.drawRarity(e,W.rarity,F[0]+112,F[1]+4))),s){const Y=new ct(C,...r.highlightBounds(...F));f.addChild(Y)}}else{const W=new ct(C,...r.highlightBounds(...F),st.Right);m.addChild(W)}}),s&&f.childs.length>0&&tt.add(f),m.childs.length>0&&tt.add(m),await Promise.all(l)}async drawList(t,e){let r=170;const s=570,l=[],f=pt.picksAsDeck,m=new Vt(s,r,600,600,st.Both),A=t,C=15,F=pt.scrollIdx;pt.canPageDown&&await this.makeScroller(e,!1),pt.canPageUp&&await this.makeScroller(e,!0),A.filter(W=>!W.pack).forEach(W=>{if(W.index>=F&&W.index{const f=e.getFactTotal(l);if(f[2]===0)return[Promise.resolve()];{r+=75;const m=this.threeLine(t,r,s,f),A=this.drawFaction(t,l,r-8,s-39);return[m,A]}}).flat())}async threeLine(t,e,r,s){const l={colour:"#ffd865",fontSize:18,fontName:"serif"},f=30;await Promise.all(s.map((m,A)=>this.drawText(t,m.toString(),e,r+f*A,l)))}async drawDraftMenu(t){const e=new ye,r=new Ce,s=240,l=80,f=45,m=34;let A=50,C=s;await r.headerText(A+28,C,"Opponent",t),C+=f,await e.buttonMaker(t,A,C,"DI","DUMB BOT",27,pt.vsAI,!1),C+=l,await e.buttonMaker(t,A,C,"DV","HUMAN",47,!pt.vsAI,!1),C+=l+16,await r.headerText(A+17,C,"Rarity Filter",t),C+=l-m-6,await this.rarityButton(t,A+20,C,"L",pt.getRarity("L")),await this.rarityButton(t,A+125,C,"H",pt.getRarity("H")),C+=l,await this.rarityButton(t,A+20,C,"R",pt.getRarity("R")),await this.rarityButton(t,A+125,C,"C",pt.getRarity("C")),C=s+f+l*5,await e.buttonMaker(t,A,C,"MM","MAIN MENU",16),A=404,C=s,await r.headerText(A+5,C,"Draft Modes",t),C+=f,await e.buttonMaker(t,A,C,"GP","GOOD PACKS",9,pt.fatPacks),C+=l,await e.buttonMaker(t,A,C,"LD","LEGENDARY",17,pt.legDraft),C+=l,await e.buttonMaker(t,A,C,"OD","OVERDRAFT",17,pt.overdraft),A=757,C=s,await r.headerText(A+76,C,"Sets",t),C+=f,await this.chestButton(t,A+3,C,1,pt.getSet(1)),await this.chestButton(t,A+124,C,2,pt.getSet(2)),C+=88,await this.chestButton(t,A+3,C,3,pt.getSet(3)),await this.chestButton(t,A+124,C,4,pt.getSet(4)),C+=88,await this.chestButton(t,A+3,C,5,pt.getSet(5)),await this.chestButton(t,A+124,C,6,pt.getSet(6)),C=s+f+l*5,await e.buttonMaker(t,A,C,"DN","NEXT",68)}async rarityButton(t,e,r,s,l){const f={key:"MNBT",zone:"N",host:"",param:S.enTil("DR",s)},m=`ui/button/rarity_${s}${l?"y":"n"}.png`;await this.drawSprite(t,m,e,r);const A=new ct(f,e,r,75,65,st.Both);tt.add(A)}async chestButton(t,e,r,s,l){const f={key:"MNBT",zone:"N",host:"",param:S.enTil("DT",s)},m=`icons/sets/Chest_Set${s}${l?"y":"n"}.png`;await this.drawSprite(t,m,e,r);const A=new ct(f,e,r,90,74,st.Both);tt.add(A)}}class We extends Lt{async drawSets(t,e){let r=200;const s=100,l=[],f=new Vt(s,r,400,600);t.filter(m=>m.key==="DSET").forEach(m=>{const A=ue[parseInt(m.param)];l.push(this.drawText(e,A.name,s,r,{colour:"#f5f242"}),this.drawSprite(e,"icons/chest_small.png",s-48,r-5));const C=new ct(m,s,r-2,400,35,st.Both);f.addChild(C),r+=45}),tt.add(f),await Promise.all(l)}async drawList(t,e){let r=170;const s=570,l=[],f=new Vt(s,r,600,600);t.filter(m=>m.key==="DECK").forEach(m=>{const A=S.deTil(m.param),C=Jt.stockDeckByName(A[0],A[1]);l.push(this.drawFaction(e,C.factions[0],s,r),this.drawText(e,C.name,s+65,r+7,{colour:"#f5f242"})),C.factions.length===2&&l.push(this.drawFaction(e,C.factions[1],s+28,r));const F=new ct(m,s,r-2,600,35,st.Both);f.addChild(F),r+=35}),await Promise.all(l),tt.add(f)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,l=Math.floor(t/3);return[22+s*176,200+l*235]}iAmError(t){const e=at.get("game-ui");this.drawText(e,t,295,655,{colour:"#f5142e",fontSize:26})}async drawConstrMenu(t){const e=new ye,r=new Ce,s=240,l=80,f=45;let m=50,A=s;await r.headerText(m+28,A,"Opponent",t),A+=f,await e.buttonMaker(t,m,A,"CI","DUMB BOT",27,Mt.vsAI,!1),A+=l,await e.buttonMaker(t,m,A,"CV","HUMAN",47,!Mt.vsAI,!1),A+=l*4,await e.buttonMaker(t,m,A,"MM","MAIN MENU",16),m=404,A=s,await r.headerText(m+46,A,"Player 1",t);const C=Mt.p1.mode;A+=f,await e.buttonMaker(t,m,A,S.enTil("CP","A"),"PRE-CON",39,C==="CP",!1),A+=l,await e.buttonMaker(t,m,A,S.enTil("CR","A"),"RANDOM",36,C==="CR",!1),A+=l,await e.buttonMaker(t,m,A,S.enTil("CX","A"),"SCRAMBLE",30,C==="CX",!1),A+=l,await e.buttonMaker(t,m,A,S.enTil("LK","A"),"LOAD FILE",32,C==="LK"),C==="LK"&&await this.drawFileDeck(t,m,A,Mt.p1.deck),m=757,A=s,await r.headerText(m+44,A,"Player 2",t);const F=Mt.p2.mode;A+=f,await e.buttonMaker(t,m,A,S.enTil("CP","B"),"PRE-CON",39,F==="CP",!1),A+=l,await e.buttonMaker(t,m,A,S.enTil("CR","B"),"RANDOM",36,F==="CR",!1),A+=l,await e.buttonMaker(t,m,A,S.enTil("CX","B"),"SCRAMBLE",30,F==="CX",!1),A+=l,await e.buttonMaker(t,m,A,S.enTil("LK","B"),"LOAD FILE",32,F==="LK"),F==="LK"&&await this.drawFileDeck(t,m,A,Mt.p2.deck),A+=l*2,await e.buttonMaker(t,m,A,"CN","NEXT",68)}async drawFileDeck(t,e,r,s){const l=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,l):(await this.drawFaction(t,s.factions[0],e+78,l),await this.drawFaction(t,s.factions[1],e+113,l))}}class Ce extends Lt{async drawExtrasMenu(t){const e=new ye,r=240,s=80,l=45,f=34;let m=50,A=r;await this.headerText(m+28,A,"More Info",t),A+=l,await e.buttonMaker(t,m,A,"RU","RULES",66),A+=s,await e.buttonMaker(t,m,A,"FQ","INFO & FAQ",20),A+=s*4,await e.buttonMaker(t,m,A,"MM","MAIN MENU",16),m=404,A=r,await this.headerText(m+37,A,"UI Modes",t),A+=l,await e.buttonMaker(t,m,A,"90","90% SIZE",47,S.options.scale==="90"),A+=s,await e.buttonMaker(t,m,A,"BC","BIG CARDS",29,S.options.bigCards),A+=s+f,await this.headerText(m+12,A,"Game Modes",t),A+=s-f,await e.buttonMaker(t,m,A,"HH","BIG HEALTH",20,S.options.highHealth),A+=s,await e.buttonMaker(t,m,A,"CH","CHEATER",39,S.options.cheater),A+=s,await e.buttonMaker(t,m,A,"BB","BATTLE BARK",13,S.options.bark),m=757,A=r,await this.headerText(m+43,A,"Playmat",t),A+=l;const C=S.options.playmat==="vanilla";await e.buttonMaker(t,m,A,"vanilla","VANILLA",43,C,!C),A+=s;const F=S.options.playmat==="alloyin";await e.buttonMaker(t,m,A,"alloyin","ALLOYIN",43,F,!F),A+=s;const W=S.options.playmat==="nekrium";await e.buttonMaker(t,m,A,"nekrium","NEKRIUM",38,W,!W),A+=s;const Y=S.options.playmat==="tempys";await e.buttonMaker(t,m,A,"tempys","TEMPYS",51,Y,!Y),A+=s;const j=S.options.playmat==="uterra";await e.buttonMaker(t,m,A,"uterra","UTERRA",52,j,!j),await this.drawText(t,"v0.8.1",890,46,{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 aa extends Lt{async drawMenu(t){let r=22;await this.drawSprite(t,"ui/button/constructed.png",778,r);const s=new ct(this.makeAction("C"),...this.buttHilightBounds(778,r),st.Both);tt.add(s),r=148,await this.drawSprite(t,"ui/button/draft.png",778,r);const l=new ct(this.makeAction("D"),...this.buttHilightBounds(778,r),st.Both);tt.add(l),r=508,await this.drawSprite(t,"ui/button/deck.png",778,r);const f=new ct(this.makeAction("B"),...this.buttHilightBounds(778,r),st.Both);tt.add(f),r=634,await this.drawSprite(t,"ui/button/info.png",778,r);const m=new ct(this.makeAction("I"),...this.buttHilightBounds(778,r),st.Both);tt.add(m);const A=y.basicAction("DBUG"),C=new ct(A,757,349,74,70,st.Right);tt.add(C),await this.drawSprite(t,"gwg/gwg_red.png",58,0)}buttBounds(t,e){return[t,e,242,113]}buttHilightBounds(t,e){const s=[-3,-3,6,6];return this.buttBounds(t,e).map((l,f)=>l+s[f])}makeAction(t){return{zone:"N",key:"MENU",host:"",param:t}}}class na{gameWidth;gameHeight;spriteCache;dogAudio;_clickMode;pxRatio=1;options;imgRoot;constructor(){this.spriteCache={},this.imgRoot="./img/",this.gameWidth=1024,this.gameHeight=768,this.dogAudio=document.getElementById("dogbark"),this._clickMode="M",this.options={bark:!0,bigCards:!0,highHealth:!1,cheater:!1,playmat:"uterra",wasDrafting:!1,scale:"100",debug:!1}}randInt(t,e){return Math.floor(Math.random()*(e-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async getSprite(t){return this.spriteCache[t]||(this.spriteCache[t]=this.imageLoader(t)),this.spriteCache[t]}async bulkLoadSprite(t){await Promise.all(t.map(e=>this.getSprite(`${this.imgRoot}${e}`)))}dogBark(){this.dogAudio.volume=.2,this.dogAudio.play()}toggleDebug(){const t=!this.options.debug;this.options.debug=t,new We().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:this.txt2bool(r)}writeBoolStorage(t,e){this.writeStorage(t,this.bool2txt(e))}bool2txt(t){return t?"Y":"N"}txt2bool(t){return t==="Y"}restoreOptions(){const t=this.options;t.bark=this.readBoolStorage("bark",!1),t.bigCards=this.readBoolStorage("bigCards",!0),t.cheater=this.readBoolStorage("cheater",!1),t.highHealth=this.readBoolStorage("highHealth",!1),t.playmat=this.readStringStorage("playmat","uterra"),t.scale=this.readStringStorage("scale","100")}toggleOption(t){S.options[t]=!S.options[t],this.writeBoolStorage(t,S.options[t])}setClickMode(t){this._clickMode=t}get clickMode(){return this._clickMode}}const S=new na;class oa{log=!1;file=!1;makeReport(){if(!this.file&&!this.log)return;const t=[[],[],[]];Et.forEach(s=>{let l=0;s.s>6.5?l=2:s.s>5.5&&(l=1),t[l].push(s.c)}),t[0].push("NDR","RSC","CGF","IZL","IZR","FUN","FWG","FWC","DZA"),t[1].push("CYP","SLG");const e=t.map(s=>s.map(l=>{const f=G.getCard(l+"1");return f.type==="C"?f.name+" "+this.cardGuts(f):""}).filter(Boolean).sort()).flat().join(` +`);if(this.file){var r=document.createElement("a");r.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),r.setAttribute("download","guts.txt"),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}}cardGuts(t){const e=t.jr3(!0,3);e.sleeping=!1;const r=e.bonusTotal(),s=ht.levelBonusFormula(t,!1,!1)+ht.hintAdjuster(t);let l=lt.creatValueFormula(e),f=lt.threatFormula(e,[]),m=r.pHealth,A=r.bonus+s,C=1+r.count,F=l+r.value,W=f+r.attack,j=lt.ddp9Nugget(C,F,W,m,A).map(mt=>mt.toFixed(1)).join(" ");if(this.log&&(console.group("---- "+t.name+" "+t.level+" ----"),console.log("Attack: "+e.attack+"; Health: "+e.health),console.log("Creat Value Weight: "+l+"; Creat Threat Weight: "+f),console.log("Creat Value Bonus: "+r.value+"; Creat Threat Bonus: "+r.attack),console.log("Level Bonus: "+s+"; Raw Bonus: "+r.bonus),console.log("Player Bonus: "+r.pHealth+"; Count Bonus: "+r.count),console.log("Formula: Total, Count, Value, Threat, Player, Bonus"),console.log(j),console.groupEnd()),t.level{await document.fonts.ready;let n=[];document.fonts.forEach(z=>{z.load(),n.push(z.loaded)}),await Promise.all(n),["game-ui","field","player","hand","effects","decklist","card"].forEach(z=>{at.register(z)});const e=at.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,l=800,f="N",m;try{document.createEvent("TouchEvent"),S.setClickMode("T"),s=!1}catch{}const A=()=>{m&&(clearTimeout(m),m=void 0)},C=(z,rt,et)=>{const vt=tt.hitTest(z,rt,et);vt&&T.handleAction(vt)},F=z=>{C(z.pageX,z.pageY,z.button)},W=z=>{z.touches.length>1?(f="C",A()):f==="N"&&(f="D",m=setTimeout(()=>{f="C";const rt=z.touches[0];C(rt.pageX,rt.pageY,st.ForceRight),m=void 0},l))},Y=z=>{if(f==="D"){if(A(),f="N",z.changedTouches.length>0){const rt=z.changedTouches[0];C(rt.pageX,rt.pageY,st.Left)}}else z.touches.length===0&&(f="N")},j=document.getElementById("solforge");s?(j.addEventListener("click",F),j.addEventListener("contextmenu",z=>(z.preventDefault(),F(z),!1))):(j.addEventListener("touchstart",W),j.addEventListener("touchend",Y)),window.sfapi={details:z=>{jt.init(z)},setLog:z=>{ht.setLog(z)},peekAll:()=>{ht.peekAllCards()},peekDeck:()=>{ht.peekDecks()},peekField:()=>{console.log(g.field)},dumb:()=>{console.log("Am I dumb? "+ht.dumb)},debug:()=>{S.toggleDebug()}},S.restoreOptions(),S.options.scale!=="100"&&yt.changeScale(S.options.scale),yt.drawAll(),new oa().makeReport()}})();