From 94b91e3adf30ba8be5e4410e6ee7c6e5a97c1b68 Mon Sep 17 00:00:00 2001 From: james-rae Date: Mon, 29 Jan 2024 21:34:43 -0500 Subject: [PATCH] :package: beta build v0.10.0 --- README.md | 33 ++++++++++++++++++++++++++------- docs/faq.md | 15 ++++++++++++--- docs/rules.md | 3 ++- play/dist/solforge.js | 6 +++--- play/index.html | 10 +++++++--- 5 files changed, 50 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3f3a005..c513e0d 100644 --- a/README.md +++ b/README.md @@ -16,17 +16,36 @@ A homebrew attempt at recreating classic [Solforge](https://en.wikipedia.org/wik - :wrestling: Local head-to-head battle. - :clown_face: Fun bonus modes. - :crocodile: Unfriendly deckbuilder. -- :desktop_computer: Best played on a desktop monitor with standard resolution (1080p non-retina) and a pointer device. -- :iphone: Tablet / retina _works_ but has some issues at the moment. - - Tablet screen dimensions can be a poor fit for the layout. - - Touch controls to view card details are sub-par. - - Feel free to log issues with your bad experiences; I'm limited with what devices I can test on. ### Data Footprint -The core application (game logic, backgrounds, UI elements) will weigh in around 12mb. Each card level will draw around 70kb. If an enthusiastic player views every level of every card, the total download will be around 142mb. +The core application (game logic, backgrounds, UI elements) will weigh in around 16mb. Each card level will draw around 70kb. If an enthusiastic player views every level of every card, the total download will be around 146mb. -Turning off the `Big Cards` option will shave 7mb off the core app, and 93mb from all the cards (an average of 50kb per card level). You won't see the art in full glory, but it will be respectful to your data plan. +Turning off the `Big Cards` option will shave 7mb off the core app, and 93mb from all the cards (an average of 50kb per card level). You won't see the art in full glory, but it will be respectful to your data plan. Turning off the `Animations` option will save 3.5mb. + +## Supported Platforms + +Feel free to log issues with your bad experiences; I'm limited with what devices I can test on. + +### Browser + +The drawing engine now leverages the [OffscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas) Web API. Browsers from before March 2023 may fail to run the app. + +For those who want older browser support, you can fork this repo and roll back to [v9.3.0](https://github.com/grousewood-games/solforge/tree/v0.9.3). But you'll be stuck with that version and the bugs / inefficiencies it has. + +### Desktop + +- Should work fine on a desktop monitor with standard resolution (1080p non-retina) and a pointer device. +- Smaller screens may crop. +- 4K resolution is untested. I expect either the game takes up 1/4 of the screen, or everything is upscaled and looks fuzzy. +- Screen refresh rates of 60hz (or multiples of 60) should animate at 60fps. Other rates (e.g. 75hz) are untested. I expect they should work but with mild animation stutter (e.g. every fourth screen paint will look the same as the one before it). + +### Mobile + +- Touch controls work, are not the best. Use the :computer_mouse: icon or long-presses to mimic right-clicks. +- Certain screen sizes or aspect ratios may cut off parts of the game or the log. + - This may be improved in the future. +- Phone screens are likely to be horrendously disappointing. ## Parental Guide diff --git a/docs/faq.md b/docs/faq.md index 9c21e83..af54e79 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -10,12 +10,13 @@ ## Credits -### Assets +### Assets & Concepts - All game rules, card art, card names & text, dog bark battle sound, and the vast majority of the UI art assets is the creation and intellectual property of [Stoneblade Entertainment](https://stoneblade.com/). - The fancy font, `Cinzel`, was created by [Natanael Gama](https://fonts.adobe.com/designers/natanael-gama). - The green arrows were made by `AngryMeteor`. -- The rank orb is by [Cethiel](https://opengameart.org/content/orbs-collection) +- The rank orb and animations for card leveling, overload, battle damage, rankup are by [Cethiel](https://opengameart.org/users/cethiel). +- The player damge animation is by [Sinestesia](https://opengameart.org/users/sinestesia). - Square icons generated on [Game-Icons](https://game-icons.net). - Enhanced versions of the large card frames are courtesty of [Spruce](https://reddit.com/user/SolSpruce/). @@ -159,6 +160,14 @@ Rules around extra battles are slightly different. The new general rule is the f Regarding `Vaerus, Herald of Fury`, a creature receives the extra battle as one would expect (start of turn, Vaerus enters field, or new creature enters field). However, if Vaerus dies prior to the battle being used, the creature retains the extra battle. +### Surviving Damage Effects + +`Alyssa, Strifeborn` and `Dozer, the Dormant` will not function perfectly when hit with a barrage of damage that lowers their health to zero. These scenarios are rare but possible. As an example, `Pyre Song` can deal cumulative damage from each creature. In theory, Alyssa should survive and boost off each hit, and Dozer should replace on the first damage. The trigger that reacts to the damage will not activate until the following batch, so if the health is below 1, the creature will be death-checked before that batch can begin. + +Other culprits can include arrangements of `Flamebreak Invokers`, `Cauldron Mystics`, `Ignurs`, or `Nug, Fury Fists`. + +`Dream Tree` works as expected since the effect does not influence the creature (so it's irrelevant if later damage killed it). + ### Ator, Thunder Titan I cannot find what the original behavior was, but `Ator, Thunder Titan` will not apply the `Assault` effect retroactively. Only creatures forged after Ator is on the field will receive his blessings. @@ -210,7 +219,7 @@ The original game had a left-to-right rule precedence. From Ximane's advanced ru > If a `Shardplate Behemoth` is to the left of an `Alloyin General`, its ability first makes its attack equal to its health, then the General's ability boosts its attack, which gives it 2 more attack than health. If the Behemoth is on the right of the General, the General boosts its attack, and then its attack is set to its health, effectively negating the General's ability. -In this edition, Behemoth's card rule trumps all. The attack will always equal the health. However, if attack buffs are applied to the Behemoth, and then it has abilities removed (e.g., `Wipe Clean` is cast), the buff will remain. So if `Lysian Shard` is cast on a Behemoth, then it is wiped, the resulting dino will have 6 attack, not 0. +In this edition, Behemoth's card rule trumps all. The attack will always equal the health. However, if permanent attack buffs are applied to the Behemoth, and then it has abilities removed (e.g., `Wipe Clean` is cast), the buff will remain. So if `Lysian Shard` is cast on a Behemoth, then it is wiped, the resulting dino will have 6 attack, not 0. ### Voltaic Prophet diff --git a/docs/rules.md b/docs/rules.md index 4ae12f0..5acbfb3 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -119,7 +119,8 @@ The following game modes are available to enhance your fun: - `Cheater`: If you play too good, the AI will cheat. - `Battle Bark`: Lets you turn on or off the battle sound. - `90% Size`: Will shrink the UI by 10%. Useful to make the app fit on tablets with `4:3` aspect ratio. -- `Big Cards`: Shows larger card images when viewing the card details. Turning off will reduce the amount of data requested by the game. +- `Big Cards`: Shows larger card images when viewing the card details. Turning off will reduce the amount of data requested by the game. +- `Animations`: Turning off will stop the animations. Things will run faster, it may be tricky to figure out what is happening. You can also select a different game playmat here. The classic 5 are provided, but the game colour schemes tend to work best with the default `Uterra` background. diff --git a/play/dist/solforge.js b/play/dist/solforge.js index ccd9d65..3f43b74 100644 --- a/play/dist/solforge.js +++ b/play/dist/solforge.js @@ -1,3 +1,3 @@ -(function(){"use strict";const Ee=["A","N","T","U"];const ke=["C","R","H","L"];const Ut=[{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:"AOP",f:"A",r:"R",s:7,t:"S",ds:["AH"]},{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:"AMP",f:"A",r:"H",s:7,t:"C",ds:["RB","AR"]},{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:"ATI",f:"T",r:"L",s:7.2,t:"C",dp:["SP"],ds:["FR","MV","DR"]},{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:"BZH",f:"T",r:"H",s:7.2,t:"S",ds:["BN"],dn:["MN"]},{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:"BTD",f:"T",r:"L",s:7,t:"C",ds:["MV","AG","DR","BN"]},{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:"BLP",f:"U",r:"H",s:7.2,t:"S",ds:["PS"],dn:["MT"]},{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:"BOF",f:"N",r:"C",s:7,t:"C",dp:["AB"],ds:["LG","SV"]},{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:"BWN",f:"A",r:"H",s:7,t:"C",ds:["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:"CDM",f:"T",r:"H",s:7,t:"C",ds:["YT","BN"]},{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:"CGG",f:"N",r:"H",s:7.1,t:"C",dp:["HL"],ds:["TK","LZ"]},{c:"CHV",f:"N",r:"L",s:2,t:"C",dp:["FB"],ds:["MV","RV"]},{c:"CCC",f:"N",r:"H",s:7.3,t:"S",dp:["ZB"],ds:["SV","TK","FR"]},{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:"CHT",f:"T",r:"R",s:7,t:"S",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:"CMR",f:"A",r:"L",s:7.1,t:"C",dp:["RP"],ds:["MM","AR","AL"]},{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:"CYW",f:"N",r:"R",s:7,t:"S",ds:["LG","BN"]},{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:"CYR",f:"T",r:"H",s:7.1,t:"C",dn:["FC"],ds:["MV"]},{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:"CEX",f:"A",r:"H",s:7.1,t:"S",ds:["AH","AR","HL"]},{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:"CTM",f:"N",r:"L",s:7.3,t:"C",dp:["AL"],ds:["SV"]},{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:"DPO",f:"N",r:"H",s:7.2,t:"S",dp:["AL"],ds:["TK","RV"],dn:["MA"]},{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:"DFS",f:"A",r:"C",s:7,t:"S",ds:["AR","TD"]},{c:"DCS",f:"A",r:"L",s:2,t:"C",ds:["LV"]},{c:"DPG",f:"U",r:"H",s:7,t:"C",ds:["PS"]},{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:"DOV",f:"N",r:"R",s:7,t:"C",ds:["LG","BN"]},{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:"DKS",f:"T",r:"R",s:7,t:"C",dn:["GW"]},{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:"DRD",f:"N",r:"L",s:7,t:"C",dp:["LZ"],ds:["TK","AB"]},{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:"ESD",f:"N",r:"L",s:7,t:"C",ds:["FR"]},{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:"EWV",f:"U",r:"C",s:7,t:"S",ds:["TD","TK"]},{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:"FSL",f:"N",r:"C",s:7,t:"C"},{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:"FOR",f:"T",r:"C",s:7,t:"S",ds:["TD","AH"]},{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:"FLC",f:"A",r:"L",s:7.2,t:"C",ds:["AR"],dn:["SQ"]},{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:"GSF",f:"A",r:"H",s:7.3,t:"C",dp:["MM"],ds:["AR"]},{c:"GAS",f:"A",r:"H",s:7,t:"S",dp:["VT"],ds:["FR","TK","NX"]},{c:"HMF",f:"T",r:"H",s:3,t:"C",ds:["YT","MV"]},{c:"HOS",f:"U",r:"R",s:7,t:"C",dp:["TK","SB"]},{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:"HMO",f:"U",r:"C",s:7,t:"C",ds:["DI"]},{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:"HVE",f:"U",r:"R",s:7,t:"C",ds:["PS"]},{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:"ISB",f:"T",r:"C",s:7,t:"C"},{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:"IDF",f:"N",r:"H",s:7,t:"C",dp:["UD","LZ"],ds:["TK","ZB"]},{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:"IBA",f:"A",r:"L",s:7,t:"C",dp:["FB"],ds:["AR","AL"],dn:["TD"]},{c:"IHA",f:"A",r:"L",s:2,t:"C",dp:["FB"],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","FB"]},{c:"KTS",f:"U",r:"H",s:4,t:"C",dp:["RP"],ds:["TK"]},{c:"KKK",f:"T",r:"L",s:2,t:"C",dp:["FB"],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",ds:["TK"],dn:["FR"]},{c:"LLG",f:"U",r:"H",s:5,t:"C",ds:["TK"],dn:["MV"]},{c:"LLS",f:"A",r:"H",s:5,t:"C",ds:["RB","TK"],dn:["TK","LZ"]},{c:"LLT",f:"T",r:"H",s:5,t:"C",ds:["TK"],dn:["LG"]},{c:"LLV",f:"U",r:"H",s:7.1,t:"C",dp:["PS"],ds:["TK"]},{c:"LMD",f:"N",r:"L",s:7.1,t:"C",ds:["DR","TK","MV"]},{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:"LBC",f:"U",r:"H",s:7,t:"C",dp:["FC","MU"],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:"LTM",f:"T",r:"C",s:7,t:"C",ds:["AG"]},{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:"LVH",f:"U",r:"L",s:7,t:"C",dp:["MS","PS","SQ"],ds:["TK","GW"]},{c:"LTU",f:"U",r:"L",s:7,t:"C",ds:["TK","GW"]},{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:"MDR",f:"A",r:"R",s:7,t:"C",ds:["NT","MM"]},{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:"MNM",f:"N",r:"L",s:7.2,t:"C",ds:["TK","GW"]},{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:"NCP",f:"N",r:"H",s:7,t:"C",dn:["CD"]},{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","FB"],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:"NUG",f:"T",r:"L",s:7.1,t:"C",ds:["YT"]},{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:"ORC",f:"A",r:"C",s:7,t:"C",ds:["AH"]},{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",dp:["FB"],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:"PVA",f:"U",r:"L",s:7.2,t:"C",ds:["TK","GW","LG","DI"]},{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:"QSW",f:"T",r:"L",s:7.3,t:"C",dp:["DI"],ds:["BN"]},{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:"REW",f:"U",r:"L",s:7.3,t:"C",ds:["TK","GW"]},{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:"RTW",f:"U",r:"H",s:7,t:"C",ds:["WD","TK"]},{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:"RPR",f:"A",r:"H",s:7.2,t:"S",ds:["AL","NT"],dn:["MU"]},{c:"RLW",f:"U",r:"H",s:1,t:"C",dp:["WD"]},{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:"ROU",f:"N",r:"C",s:7,t:"S",ds:["RG","GW"]},{c:"ROE",f:"T",r:"H",s:7.3,t:"S",ds:["TK","AG","AH"]},{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:"SST",f:"U",r:"C",s:7,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:"SKN",f:"N",r:"C",s:7,t:"C",ds:["ZB"]},{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:"SPT",f:"U",r:"L",s:7.1,t:"C",ds:["PS"]},{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:"SLS",f:"T",r:"L",s:7,t:"C",dp:["SQ"],ds:["SP","WL"],dn:["TD"]},{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:"S01",f:"A",r:"L",s:7.3,t:"C",dp:["MS"],ds:["AR","AH"]},{c:"SPR",f:"N",r:"R",s:7,t:"C",ds:["SV","SB"]},{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:["XA"],ds:["DR","MV"]},{c:"SMS",f:"T",r:"C",s:7,t:"C",ds:["DI","BN"]},{c:"SHK",f:"T",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SIX",f:"A",r:"R",s:7,t:"C",ds:["MM","SP","WL"]},{c:"SWR",f:"A",r:"R",s:1,t:"C",ds:["MM","SP","WL"]},{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:"SNK",f:"A",r:"C",s:7,t:"C",dp:["LV"],ds:["WL"]},{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:"TNM",f:"U",r:"C",s:7,t:"C"},{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:"TCN",f:"A",r:"C",s:7,t:"C",dp:["WL"],ds:["RB"]},{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:"ULG",f:"N",r:"H",s:7,t:"S",dp:["LZ"],ds:["TK","TD"]},{c:"URD",f:"N",r:"H",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"USA",f:"T",r:"H",s:7,t:"C",ds:["WL","VG","FC"]},{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:"USS",f:"T",r:"H",s:7,t:"C",dp:["SQ"],ds:["TK","YT"]},{c:"UWL",f:"T",r:"H",s:2,t:"C",dp:["YT"]},{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:["FB"],ds:["TK","SV"]},{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:"VTR",f:"U",r:"R",s:7,t:"S"},{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:"VPR",f:"A",r:"L",s:7,t:"C",ds:["LV"]},{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:"WHR",f:"T",r:"R",s:7,t:"C",ds:["AG"],dn:["TD"]},{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:"WGE",f:"U",r:"H",s:7.3,t:"S",ds:["FC","LG"]},{c:"WTA",f:"U",r:"L",s:4,t:"C",dp:["LG","SB"],ds:["PL"]},{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:[]}],ai=[["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 ni{raw={["C"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0},["S"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0}};addStat(t,i){this.raw[t][i]++}g(t,i){return this.raw[t][i]}typeSum(t){return Ee.map(i=>this.g(t,i)).reduce((i,r)=>i+r,0)}getTotal(){const t=this.typeSum("C"),i=this.typeSum("S");return[t,i,t+i]}getFactTotal(t){const i=this.g("C",t),r=this.g("S",t);return[i,r,i+r]}}const s=(o,t)=>({card:o,num:t}),Si={name:"Official 2 - 3",id:"SBE1",decks:[{name:"Cruel Corrosion",factions:["A","N"],cards:[s("IHA",1),s("WBG",1),s("OXP",1),s("DFR",1),s("APM",1),s("SNP",1),s("GRM",2),s("ETN",2),s("DHW",2),s("OXM",2),s("AEN",2),s("ATG",2),s("CTI",2),s("CTW",2),s("FPS",2),s("GRW",2),s("MTT",2),s("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[s("ZTU",1),s("VRP",1),s("GGP",1),s("EPD",1),s("DBT",1),s("BSM",1),s("TDW",2),s("NGT",2),s("UBL",2),s("FWK",2),s("BZD",2),s("CSB",2),s("SLH",2),s("MMH",2),s("LSK",2),s("GBG",2),s("CFG",2),s("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[s("TDS",1),s("SSR",1),s("FRR",1),s("ULR",1),s("UTR",1),s("BTM",1),s("UGL",2),s("EHN",2),s("SPD",2),s("GHB",2),s("FLN",2),s("SML",2),s("RFL",2),s("OXS",2),s("UTM",2),s("TWG",2),s("ENR",2),s("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[s("CSW",1),s("SMD",1),s("FRR",1),s("UIC",1),s("CFB",1),s("UGL",2),s("FSH",2),s("FLN",2),s("WPD",1),s("TWG",2),s("TCG",2),s("TGS",2),s("SML",2),s("SVH",1),s("SCL",2),s("RTS",1),s("FWB",2),s("ENR",2),s("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[s("IMA",1),s("GMP",1),s("OXA",1),s("EPD",1),s("OJC",1),s("ESU",2),s("OXM",2),s("MMA",2),s("SAP",1),s("AFO",2),s("GBG",2),s("CTW",2),s("SRH",1),s("TSM",2),s("SLH",1),s("MTT",1),s("DCR",1),s("DFB",1),s("BSR",1),s("LGT",1),s("XRF",2),s("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[s("SBG",1),s("NSH",1),s("FFU",1),s("EWE",1),s("BFM",1),s("WBH",1),s("UWS",1),s("TGI",2),s("RFL",2),s("GRM",1),s("ASG",1),s("YWC",2),s("XRF",2),s("WPD",2),s("WCS",2),s("WBU",2),s("TCG",1),s("FSK",1),s("SLH",2),s("CFG",1),s("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[s("URB",1),s("AGK",1),s("ESP",1),s("FRR",1),s("NXT",1),s("ALG",1),s("FGB",1),s("PHS",2),s("TUP",1),s("EWT",2),s("PTR",1),s("VBK",1),s("AGC",1),s("AEN",2),s("ETN",1),s("FPS",2),s("MXW",2),s("GHT",1),s("TWG",2),s("SNB",1),s("SML",1),s("JPK",1),s("ENR",1),s("IWC",1)]},{name:"Spare Parts",factions:["N"],cards:[s("SEV",1),s("SHG",1),s("TPG",1),s("CGL",1),s("FRV",1),s("HFA",2),s("XDH",1),s("GRM",1),s("SCV",1),s("DFB",2),s("EBW",2),s("GBG",2),s("GLF",2),s("XHS",2),s("SOT",1),s("XRF",2),s("SCS",1),s("ZMT",1),s("SLH",1),s("VYE",1),s("XCR",2),s("XHU",1)]},{name:"Future Forged",factions:["A"],cards:[s("NXA",1),s("IMD",1),s("FOL",1),s("SFA",2),s("SFT",1),s("SCD",1),s("CAG",1),s("ESU",1),s("NNS",1),s("FPM",1),s("PRI",1),s("SSS",1),s("CTG",1),s("TSM",2),s("IWC",1),s("MMA",2),s("TGN",2),s("MTT",1),s("SKG",1),s("AFO",1),s("MMV",1),s("TWS",1),s("SBA",2),s("SSK",1),s("JPK",1)]},{name:"Burning Rage",factions:["T"],cards:[s("ROK",1),s("KKK",1),s("MOE",1),s("AFR",1),s("FBI",1),s("FSS",2),s("FLN",2),s("CCT",2),s("BRN",2),s("WPD",2),s("SSM",2),s("SOK",1),s("RTS",2),s("FSK",2),s("CWK",2),s("CFG",2),s("BSW",2),s("FMS",2)]},{name:"Awakened Fury",factions:["U"],cards:[s("DZD",1),s("SSE",1),s("BTR",1),s("TSL",1),s("MPH",1),s("CDT",1),s("DYB",1),s("BTH",2),s("TMG",2),s("BWD",2),s("RHY",2),s("SBD",2),s("GMR",2),s("STS",1),s("OSL",2),s("SBI",2),s("LYS",2),s("TGS",2),s("SOD",2)]},{name:"Titan's Assault",factions:["N","T"],cards:[s("ATT",1),s("TNL",1),s("RSE",1),s("SPH",1),s("SCV",2),s("ABB",2),s("TBB",2),s("BRN",2),s("FLN",2),s("CMF",2),s("XDH",2),s("FST",2),s("TAB",2),s("MDE",2),s("FSK",2),s("FLH",2),s("CBB",2)]},{name:"Verdant Fortress",factions:["A","U"],cards:[s("NGQ",1),s("RHU",1),s("VCH",1),s("ESG",1),s("PLW",2),s("NNS",2),s("SND",2),s("WOD",2),s("IBR",2),s("BWD",2),s("SBI",2),s("RWC",2),s("TEX",2),s("SER",2),s("SWG",2),s("SCC",2),s("DYB",2)]},{name:"Umbruk Uprising",factions:["T","U"],cards:[s("LUC",1),s("BWT",1),s("GHR",1),s("TSP",1),s("WBH",1),s("COD",1),s("SDR",1),s("ZPM",1),s("OXS",1),s("WOD",1),s("RWC",2),s("SSG",2),s("VGR",2),s("CFG",2),s("UEM",2),s("FFG",2),s("UGL",2),s("DMR",2),s("RTS",2),s("CWK",2)]},{name:"Onyxium Twilight",factions:["A","N"],cards:[s("EPH",1),s("DTD",1),s("POX",1),s("DDS",1),s("OHV",1),s("PHS",1),s("DFB",1),s("TDW",1),s("CAG",1),s("ALG",1),s("TUP",2),s("CTW",2),s("XCR",2),s("SSK",2),s("SRH",2),s("ATG",2),s("MTT",2),s("SLH",2),s("GLF",2),s("AFO",2)]}]},Ci={name:"Official 5 - 7",id:"SBE2",decks:[{name:"Blistering Chaos",factions:["T","U"],cards:[s("WSE",1),s("MHR",1),s("PMI",1),s("SIV",1),s("BRN",1),s("HOD",1),s("CHA",1),s("LYS",1),s("TRS",2),s("PSC",2),s("FLN",2),s("EFA",2),s("SHS",2),s("TXB",2),s("VNF",2),s("CFG",2),s("FSK",2),s("CBB",2),s("VND",2)]},{name:"Dark Retribution",factions:["A","N"],cards:[s("AAA",1),s("SNT",1),s("ABE",1),s("XTR",1),s("CNT",1),s("HOX",1),s("PLW",1),s("AGW",1),s("OHV",2),s("OXM",2),s("XDH",2),s("VGL",2),s("ETN",2),s("MTT",2),s("VYE",2),s("DSK",2),s("BFT",2),s("ATZ",2),s("IBR",2)]},{name:"Iron Tide",factions:["A","U"],cards:[s("EFE",1),s("DPB",1),s("HWM",1),s("HTR",1),s("OJC",1),s("RBG",1),s("EWT",1),s("CIN",1),s("TGK",2),s("CAG",2),s("TGN",3),s("SCC",3),s("URS",3),s("LSP",3),s("TSM",3),s("TMM",3)]},{name:"Dragon Forge",factions:["N","T"],cards:[s("DGW",1),s("VIK",1),s("DDD",1),s("SMD",1),s("FFM",1),s("SHV",1),s("GRP",1),s("TGI",1),s("SLH",1),s("WBH",2),s("BZD",2),s("EFA",2),s("WFB",3),s("BZS",3),s("CCR",3),s("DSK",3),s("RHC",3)]},{name:"Call of Deepwood",factions:["U"],cards:[s("EVT",1),s("POD",1),s("RFA",1),s("TMS",1),s("LSS",1),s("DYB",1),s("TRS",1),s("VGW",1),s("UTM",2),s("RHY",2),s("SMA",2),s("TMM",2),s("BBN",2),s("GHS",2),s("SBI",2),s("BTS",2),s("STS",2),s("SVO",2),s("GMR",2)]},{name:"Kadras' Fury",factions:["T"],cards:[s("IGR",1),s("POK",1),s("SWA",1),s("SGA",1),s("FLN",1),s("TRV",1),s("FSS",1),s("AWU",1),s("STB",2),s("CFG",2),s("BBL",2),s("KSB",2),s("NGW",2),s("ATS",2),s("ABR",2),s("BSW",2),s("TCG",2),s("CBB",2),s("WPD",2)]},{name:"Tarsus Unleashed",factions:["N"],cards:[s("IRT",1),s("POT",1),s("ZDK",1),s("HFA",1),s("GRM",1),s("DSS",1),s("TRW",1),s("ABB",1),s("XCR",2),s("CSB",2),s("SHY",2),s("BBD",2),s("EBW",2),s("NSY",2),s("TPT",2),s("XRF",2),s("GGS",2),s("ZMT",2),s("IVS",2)]},{name:"Might of Anvillon",factions:["A"],cards:[s("NXB",1),s("FWS",1),s("POA",1),s("SFA",1),s("SSS",1),s("TRA",1),s("BTB",1),s("BWH",1),s("TWT",2),s("TEX",2),s("IBR",2),s("VIN",2),s("BBR",2),s("NXP",2),s("CBS",2),s("FPS",2),s("ATG",2),s("SNB",2),s("SSK",2)]},{name:"Nature's Defenses",factions:["T","U"],cards:[s("RSD",1),s("PHC",1),s("SPG",1),s("TBC",1),s("GHR",1),s("NGB",1),s("DDF",1),s("VGW",3),s("UEM",3),s("FSK",2),s("TMM",2),s("VSP",2),s("BZS",2),s("SPD",3),s("RTS",3),s("TGK",3)]},{name:"Unlikely Alliance",factions:["A","N"],cards:[s("RMB",1),s("SFG",1),s("GGW",1),s("WPC",1),s("SBA",2),s("IBR",1),s("BSR",1),s("MMV",1),s("CRC",1),s("BSP",1),s("NNS",1),s("XDH",2),s("EBW",2),s("SLH",2),s("CTG",3),s("XRF",3),s("OHV",3),s("TSM",3)]},{name:"Toxic Shards",factions:["U"],cards:[s("SPT",1),s("MHR",1),s("KBE",1),s("DPG",1),s("LLV",1),s("HVE",2),s("PSC",2),s("VND",2),s("DSV",2),s("TXB",2),s("CSR",3),s("GSC",3),s("GVS",3),s("LHY",3),s("TGS",3)]},{name:"Winds of Fury",factions:["T"],cards:[s("NUG",1),s("FMD",1),s("CYR",1),s("FFM",1),s("AIV",1),s("WBH",2),s("UBL",2),s("FZS",2),s("EFA",2),s("WBY",2),s("KSB",3),s("SCL",3),s("TCG",3),s("CWK",3),s("ISB",3)]},{name:"Ghastly Echoes",factions:["N"],cards:[s("LMD",1),s("XTE",1),s("CGG",1),s("EPD",1),s("NCP",1),s("NOZ",2),s("OSP",2),s("PLI",2),s("GRP",2),s("DOV",2),s("CYS",3),s("IVS",3),s("MRF",3),s("GRW",3),s("FSL",3)]},{name:"Cypien Technology",factions:["A"],cards:[s("CMR",1),s("RHU",1),s("CEX",1),s("FOL",1),s("AHL",1),s("SSI",2),s("CAG",2),s("CIN",2),s("CNT",2),s("PHS",2),s("MXW",3),s("LSP",3),s("SSN",3),s("TWT",3),s("CSH",3)]}]},wi={name:"Starters & Early Tournies",id:"T1309",decks:[{name:"Alloyin Starter",factions:["A"],cards:[s("SYO",1),s("BSS",1),s("SFT",2),s("SNP",2),s("TSM",2),s("SSS",2),s("ALG",2),s("MXW",3),s("TUP",3),s("FPS",3),s("MND",3),s("IWC",3),s("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[s("SFS",1),s("GGD",1),s("FFD",3),s("EPD",2),s("CCR",2),s("HGS",2),s("DSS",2),s("BWK",2),s("GBG",3),s("DSK",3),s("GRP",3),s("VGN",3),s("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[s("FBC",1),s("RBH",1),s("CFB",3),s("FSM",2),s("FSH",2),s("FSS",2),s("PMS",2),s("RFL",2),s("UBL",3),s("WPD",3),s("SGI",3),s("AMY",3),s("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[s("UPM",1),s("EHW",1),s("FRR",3),s("SPD",2),s("HTP",2),s("LSS",2),s("SDR",2),s("SRD",2),s("FWR",3),s("DBP",3),s("GHT",3),s("GSS",3),s("TXS",3)]},{name:"Axel: Lifegain",factions:["T","U"],cards:[s("AGD",3),s("EHW",3),s("FRR",3),s("FIN",1),s("UPM",1),s("LKP",2),s("BTM",2),s("LBL",3),s("GSS",3),s("RFA",3),s("GHB",3),s("EFP",3)]},{name:"Bryan: Knightbots",factions:["A","U"],cards:[s("AGK",3),s("AFS",3),s("BSG",2),s("BSS",3),s("JPK",3),s("VBK",2),s("FRR",3),s("TDS",3),s("WWP",3),s("MXW",2),s("OJC",3)]},{name:"Derk: Metaminds",factions:["A"],cards:[s("OJC",3),s("DMW",3),s("MMV",3),s("JPK",3),s("MMO",3),s("GMP",3),s("ALS",3),s("MMA",3),s("SFA",3),s("BTN",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[s("DBP",3),s("EHW",2),s("FRR",3),s("FWT",3),s("UPM",3),s("LKP",2),s("BTM",3),s("HTR",2),s("LBD",2),s("RFA",3),s("GHB",2),s("SDR",2)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[s("ALS",3),s("TDS",3),s("FRR",3),s("WWP",3),s("SML",2),s("BSG",3),s("JPK",2),s("ODC",3),s("NXT",2),s("WMM",3),s("GHB",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[s("SCS",3),s("ROG",1),s("GGP",1),s("GGD",3),s("WFS",1),s("DSS",3),s("ZTU",1),s("GBG",3),s("HFA",3),s("EXD",1),s("EPD",1),s("BSR",1),s("MRF",2),s("HGS",3),s("GTH",3)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[s("SHK",3),s("MOE",3),s("FRR",3),s("LSK",3),s("FFU",3),s("UBL",3),s("WWS",3),s("FSS",3),s("ENR",3),s("MMH",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[s("DBP",2),s("EHW",2),s("FRR",3),s("HTP",2),s("UPM",3),s("LKP",2),s("GHT",3),s("GGP",2),s("LBD",1),s("EPD",2),s("DBT",2),s("SPD",3),s("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[s("IWC",3),s("FSS",3),s("ETN",1),s("WPD",2),s("FSM",1),s("AHL",1),s("UBL",3),s("SMD",2),s("BTN",3),s("LSK",1),s("MMH",3),s("FFU",1),s("TSM",3),s("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[s("DSS",3),s("FSS",3),s("EPD",2),s("GTH",3),s("FSM",1),s("MOE",1),s("UBL",3),s("GGP",3),s("GBG",1),s("LSK",3),s("HGS",1),s("CTW",1),s("SHK",3),s("GGD",1),s("DBT",1)]}]},Di={name:"The Forge",id:"TG10",decks:[{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[s("BWK",3),s("TDS",2),s("FRR",3),s("WWP",3),s("GGP",3),s("GGD",3),s("DBT",1),s("WFS",3),s("CTW",3),s("EPD",3),s("GHB",3)]},{name:"ErrorAsh: Burn",factions:["N","T"],cards:[s("UBL",2),s("EFM",2),s("FBI",3),s("ESK",3),s("FLN",3),s("EFP",3),s("MOE",3),s("FSS",3),s("SHK",3),s("EPD",3),s("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[s("WWS",3),s("DYB",3),s("FRR",3),s("SYL",3),s("EPD",3),s("SSE",2),s("NSH",2),s("TDW",3),s("NFF",2),s("CHR",2),s("LKP",2),s("EXD",2)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[s("NSH",2),s("SMD",2),s("DDD",3),s("TDW",3),s("VRP",3),s("WCS",3),s("BSM",3),s("SHG",2),s("TGI",2),s("EPD",3),s("FVA",2),s("DBT",1),s("TRN",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[s("UWL",3),s("FFU",3),s("WBY",3),s("UIM",3),s("WBU",3),s("SSR",1),s("TRN",1),s("GTT",1),s("GCR",3),s("FRR",3),s("UBL",3),s("WWP",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[s("DDD",3),s("DBT",3),s("EPD",3),s("EFP",3),s("GGP",3),s("LSK",3),s("SHK",3),s("UBL",3),s("WCS",3),s("ZTU",3)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[s("XSH",3),s("SPM",3),s("FRR",3),s("ODC",3),s("SSE",3),s("ESK",3),s("TGS",3),s("XRF",3),s("VRP",3),s("URB",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[s("RBH",3),s("TDS",3),s("FRR",3),s("WWP",3),s("EFP",3),s("AMY",2),s("FVA",2),s("ENR",3),s("ZSH",3),s("EHW",3),s("GHB",2)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[s("BWK",2),s("KOD",2),s("CYC",3),s("GRM",3),s("VYE",3),s("XRW",3),s("MOE",2),s("ZTU",3),s("BSM",3),s("EPD",3),s("DSS",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[s("AGM",3),s("TDS",2),s("FRR",3),s("WWP",3),s("CSW",3),s("FLN",3),s("EFP",2),s("UWL",3),s("WBY",2),s("WCS",2),s("EHW",2),s("SHS",2)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[s("UHS",2),s("FLN",3),s("STG",3),s("CRC",3),s("SHK",3),s("EFP",2),s("WMR",2),s("WMM",3),s("JPK",3),s("SMD",3),s("FVA",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[s("LSK",2),s("WBG",3),s("EPD",3),s("DDD",3),s("SHK",3),s("EFP",3),s("ZTU",2),s("GGD",2),s("GGP",3),s("CTW",3),s("DBT",3)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[s("DMW",3),s("GMP",3),s("MMA",3),s("MMV",2),s("TDW",3),s("VRP",3),s("EPD",3),s("SHG",2),s("OJC",2),s("ESK",2),s("CHV",2),s("CTW",2)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[s("CTW",1),s("GCR",1),s("CFG",1),s("FZS",1),s("FBI",3),s("MOE",3),s("EFP",3),s("LSK",3),s("FLN",3),s("SHK",3),s("RTS",3),s("GGP",3),s("UBL",2)]}]},xi={name:"Team A1",id:"A1FU",decks:[{name:"Phytogaunt",factions:["N","U"],cards:[s("DTD",3),s("EPD",2),s("XTE",3),s("GGD",3),s("GGP",3),s("GGR",3),s("ROG",1),s("ESK",3),s("GGW",3),s("POT",3),s("PTB",3)]},{name:"ANfinity",factions:["A","N"],cards:[s("IMA",3),s("AAA",2),s("MMA",3),s("KIW",3),s("ESU",3),s("ABE",3),s("AFO",1),s("XDH",2),s("GBG",1),s("SHV",2),s("SCV",2),s("LCE",2),s("MTS",1),s("PRI",1),s("WPC",1)]},{name:"Icefinity",factions:["A","T"],cards:[s("IMA",3),s("AAA",1),s("MMA",2),s("MOE",3),s("ESU",3),s("ABE",3),s("NNS",1),s("IGR",2),s("SHK",1),s("OBB",2),s("LCE",2),s("ITO",1),s("PRI",3),s("BRN",3)]},{name:"Drain Tank",factions:["A","N"],cards:[s("DTD",3),s("SRP",2),s("LLS",3),s("ESK",3),s("CYC",3),s("BRS",3),s("PLI",1),s("SOC",2),s("EPD",2),s("ABE",2),s("HOX",2),s("DCR",2),s("VYE",2)]},{name:"Big Animals",factions:["N","U"],cards:[s("DTD",3),s("MHR",2),s("DZD",3),s("SPB",3),s("SHY",3),s("URB",3),s("VIK",1),s("ESK",3),s("DYS",3),s("LYS",3),s("IME",3)]},{name:"Explosive Dragon Rage",factions:["A","T"],cards:[s("FMD",3),s("SGA",2),s("AFR",3),s("FBI",3),s("POK",3),s("SHK",3),s("ROK",3),s("IGR",1),s("OEX",3),s("BWW",2),s("STB",2),s("BRN",2)]},{name:"Angry Tree",factions:["N","U"],cards:[s("DTD",3),s("EPD",2),s("CYC",3),s("SPB",3),s("IME",3),s("SOC",3),s("ODC",2),s("ESK",2),s("WTA",3),s("VYE",3),s("HOX",3)]},{name:"Commando",factions:["A","N"],cards:[s("GSF",3),s("SIX",2),s("GMP",3),s("DMW",3),s("IMA",3),s("MMA",3),s("MBR",3),s("POA",3),s("WMM",2),s("EXD",2),s("SFA",3)]},{name:"Our Robot Overlords",factions:["A","T"],cards:[s("AGK",3),s("AFS",3),s("ATT",3),s("BTB",3),s("BSS",3),s("FWS",3),s("FLC",3),s("GOS",3),s("RHU",3),s("WMC",3)]},{name:"Random Aggression",factions:["T","U"],cards:[s("SMA",3),s("EHW",3),s("KSB",3),s("FSH",3),s("RTW",3),s("SDR",3),s("LBD",3),s("KKK",3),s("FRR",3),s("SIV",3)]},{name:"The Crux of it All",factions:["A","N"],cards:[s("CMR",3),s("VPR",3),s("LLD",3),s("DCR",3),s("SCV",3),s("IBA",2),s("SRM",2),s("SRP",1),s("MMR",2),s("LCE",1),s("NXA",2),s("IMD",1),s("OJC",2),s("WPC",2)]}]},Bi={name:"Fandom Wiki",id:"FDWK",decks:[{name:"Castles",factions:["A","U"],cards:[s("TDS",3),s("TMS",3),s("DTR",3),s("HTR",3),s("RSD",3),s("SPB",3),s("MHR",3),s("RHU",3),s("AEC",3),s("FRR",3)]},{name:"Runebark's Revenge",factions:["U"],cards:[s("RBG",3),s("EVT",3),s("EFE",3),s("SBI",3),s("RSD",3),s("SPB",3),s("ODC",3),s("GSS",3),s("BTR",3),s("POD",3)]},{name:"Don't Wake Boris",factions:["T","U"],cards:[s("AGD",3),s("EVT",3),s("EFE",3),s("DGW",3),s("LYS",3),s("SBD",3),s("ODC",3),s("GSS",3),s("BRN",3),s("POD",3)]},{name:"Shrink N' Squat",factions:["A","N"],cards:[s("DDS",3),s("ESK",3),s("EPD",3),s("GRW",3),s("GGP",3),s("HRM",3),s("PPM",3),s("SRM",3),s("MMG",3),s("WFS",3)]},{name:"Healthy Mystic",factions:["T","U"],cards:[s("LYR",3),s("PYM",3),s("EFE",3),s("TGS",3),s("LYS",3),s("SBD",3),s("TMG",3),s("TMM",3),s("SSH",3),s("SSE",3)]},{name:"Varna Control",factions:["A","N"],cards:[s("VIK",3),s("KIW",3),s("LCE",3),s("ABE",3),s("ZTU",3),s("SES",3),s("DCR",3),s("SCV",3),s("ESU",3),s("BRS",2),s("HOX",1)]},{name:"Barry's Buddies",factions:["A","T"],cards:[s("AAA",3),s("BRS",3),s("SMD",3),s("GOS",3),s("PMP",3),s("AGW",3),s("NNS",3),s("PLW",3),s("OBB",3),s("ABE",3)]},{name:"Heraldbomb",factions:["T","U"],cards:[s("UWL",3),s("HOD",3),s("PTB",3),s("BTM",3),s("LYS",3),s("DDF",3),s("MHR",3),s("WSE",3),s("SPB",3),s("WWP",3)]},{name:"Heartseeker",factions:["A","T"],cards:[s("UWL",3),s("FFU",3),s("FKS",3),s("OEX",3),s("POK",3),s("ROK",3),s("UHS",3),s("WBU",3),s("UCM",2),s("WSE",2),s("KKK",2)]},{name:"Punchy",factions:["A","U"],cards:[s("ODC",3),s("DBP",3),s("URB",3),s("RHU",3),s("CEX",3),s("GOS",3),s("LYS",3),s("PMP",3),s("WMM",3),s("ABE",3)]},{name:"Sea of Sludge",factions:["N","U"],cards:[s("ODC",3),s("WTA",3),s("GSS",3),s("DYL",3),s("AGD",3),s("GGW",3),s("CYC",3),s("VYE",3),s("DCR",3),s("SCV",3)]},{name:"Poison Control",factions:["A","U"],cards:[s("MHR",3),s("LOD",3),s("VNS",3),s("ESG",3),s("LCE",3),s("ESU",3),s("IMA",3),s("DSV",3),s("GSS",2),s("CSR",1),s("ABE",3)]},{name:"Original Fangsters",factions:["A","N"],cards:[s("VES",3),s("XTE",3),s("GGP",3),s("RHU",3),s("WBG",3),s("ABE",3),s("DDS",3),s("SOC",3),s("JPK",3),s("EPD",3)]},{name:"Hatorade",factions:["A","U"],cards:[s("MHR",3),s("ARB",3),s("DDF",3),s("IHA",3),s("LLG",3),s("NXA",3),s("OJC",3),s("RHU",3),s("SPB",3),s("LYS",3)]},{name:"Wegu Control",factions:["A","U"],cards:[s("MHR",3),s("CHR",3),s("KIW",3),s("ESG",3),s("WTA",3),s("ODC",3),s("GSS",3),s("OAP",2),s("NGQ",1),s("DDF",2),s("WPC",1),s("ABE",3)]}]},Hi={name:"Battlebranded",id:"BTLB",decks:[{name:"Bucket of Spite",factions:["N","T"],cards:[s("SMD",2),s("SPH",3),s("BSM",3),s("EBW",3),s("UWL",3),s("BSW",2),s("BWW",1),s("FMD",3),s("BST",3),s("EPD",3),s("GGD",2),s("HOX",1),s("SOC",1)]},{name:"Overoverloaded",factions:["A","N"],cards:[s("XDH",3),s("RMB",3),s("ABE",3),s("IMA",3),s("EPD",3),s("TPG",3),s("ESU",3),s("KIW",2),s("LCE",2),s("ESK",2),s("STR",1),s("CYC",1),s("PRI",1)]},{name:"Dysian Forest",factions:["N","U"],cards:[s("POX",3),s("DBQ",3),s("TDS",3),s("NGQ",3),s("WWP",3),s("DTD",3),s("LBD",3),s("SSH",2),s("LYS",3),s("DYS",2),s("FRR",1),s("HOX",1)]},{name:"Statis Shenanigans",factions:["A","T"],cards:[s("OBB",3),s("SHK",3),s("ABE",3),s("IMA",3),s("SIX",3),s("GCR",2),s("ESU",3),s("NNS",2),s("LCE",3),s("OJC",2),s("BRS",1),s("VIC",1),s("PRI",1)]},{name:"Masochist Zoo",factions:["N","U"],cards:[s("DZD",3),s("TDW",3),s("LLD",3),s("LLG",3),s("RWC",3),s("BWT",3),s("DYS",2),s("SPB",3),s("SHY",3),s("IME",2),s("TDS",2)]},{name:"Pummelled by Gauntlets",factions:["A","N"],cards:[s("AGK",3),s("FWS",3),s("LLD",3),s("LLS",3),s("NXA",3),s("RHU",3),s("ARB",2),s("GOS",2),s("OJC",2),s("ESK",2),s("PMP",2),s("SOC",2)]},{name:"Nuada's Greenhouse",factions:["T","U"],cards:[s("NFF",3),s("NGQ",3),s("LKP",3),s("SYL",3),s("ATT",3),s("BWW",3),s("GMR",2),s("FRR",2),s("SSH",1),s("URB",2),s("BRN",2),s("SSE",3)]},{name:"Abominable Slaughter",factions:["N","T"],cards:[s("CGL",3),s("XDH",3),s("LLD",3),s("POX",3),s("ABM",3),s("ZXR",3),s("BWW",3),s("FMD",3),s("BST",2),s("ROK",3),s("HOX",1)]},{name:"Outraged Ingir",factions:["A","T"],cards:[s("OBB",3),s("FMD",3),s("IKA",3),s("BST",3),s("NXA",3),s("KKK",2),s("RHU",3),s("ROK",3),s("BWW",3),s("WSE",1),s("OEX",3)]},{name:"Lord of the Necros",factions:["N","T"],cards:[s("TPG",3),s("BSM",3),s("EBW",3),s("FST",3),s("TNL",3),s("BWW",3),s("XRW",3),s("CSB",3),s("GGD",3),s("SOC",3)]},{name:"Thar' Be Omegas",factions:["A","U"],cards:[s("AFS",3),s("BSS",3),s("ARB",3),s("FGA",3),s("FGB",3),s("FGG",3),s("FGD",3),s("TBA",3),s("SSH",3),s("NNS",3)]},{name:"Skillshriek",factions:["N","U"],cards:[s("POX",3),s("SEV",3),s("LLD",3),s("SPB",3),s("NSH",3),s("TDW",3),s("XDH",2),s("SBI",2),s("ATP",2),s("FRR",2),s("AEC",2),s("IME",2)]},{name:"Kitfinity",factions:["A","N"],cards:[s("XDH",3),s("MMX",3),s("GMP",2),s("IMA",3),s("VRP",3),s("SEV",3),s("ESU",3),s("KIW",3),s("SHG",2),s("SHV",2),s("SCV",1),s("CYC",1),s("AFO",1)]},{name:"There Can Be Only One",factions:["A","U"],cards:[s("AHL",3),s("WMM",3),s("ESU",3),s("PRI",3),s("JPK",3),s("MPH",3),s("LYS",3),s("BTM",2),s("FIN",1),s("SOD",3),s("VGR",3)]}]},Ni={name:"Misc. Web Decks",id:"WEB1",decks:[{name:"Steelscale Debuff",factions:["A","N"],cards:[s("STG",3),s("CTG",3),s("VTW",3),s("IME",3),s("NNS",3),s("PLW",3),s("SOC",3),s("SES",2),s("IMD",1),s("DFR",1),s("EXD",1),s("HOX",2),s("SHV",1),s("WMM",1)]},{name:"The Fun Train",factions:["T","U"],cards:[s("AMD",3),s("ATT",3),s("BWW",3),s("EFM",3),s("SPB",3),s("URB",3),s("AEC",3),s("BRN",3),s("LYS",3),s("SOV",2),s("TGL",1)]},{name:"Snouty's Sludges",factions:["N","U"],cards:[s("DYL",3),s("ODC",3),s("SOL",3),s("RSD",3),s("PVA",2),s("SFS",3),s("GRP",3),s("NCM",3),s("LBD",3),s("DYS",3),s("WGE",1)]},{name:"Metabuse",factions:["A","N"],cards:[s("POX",3),s("WMC",3),s("SEV",3),s("CKB",3),s("ARB",3),s("LLD",3),s("LLS",3),s("XDH",3),s("IME",3),s("GRM",2),s("HOX",1)]},{name:"Immortal Dino",factions:["N","U"],cards:[s("BTR",3),s("BWT",3),s("RWC",3),s("TDS",3),s("UTR",3),s("SEV",2),s("SMA",2),s("LSS",3),s("TDW",2),s("HOX",2),s("SOC",2),s("VRP",2)]},{name:"Redacted",factions:["A","U"],cards:[s("MDR",3),s("RHU",3),s("TBA",3),s("SPM",3),s("CTG",3),s("NXO",3),s("AFO",2),s("SVO",2),s("AGW",2),s("FRR",2),s("SBI",3),s("LLV",1)]},{name:"Ebonflame Thunderskull",factions:["N","T"],cards:[s("ATT",3),s("EFM",3),s("VES",3),s("ESK",3),s("BWW",3),s("SOV",3),s("NSH",3),s("DCR",2),s("SCV",2),s("DBT",2),s("IME",3)]},{name:"Binben the Math Nut",factions:["A","T"],cards:[s("BLH",3),s("KIW",3),s("GMP",3),s("SHK",3),s("OBB",3),s("BRN",3),s("STP",3),s("ESU",2),s("GOS",2),s("FLN",2),s("MTT",2),s("GCR",1)]},{name:"For Ever More the Oil's Chore",factions:["U"],cards:[s("VNS",3),s("VNF",3),s("SHS",3),s("STO",3),s("DSV",3),s("PSC",2),s("ODC",2),s("WWP",2),s("SBI",2),s("TDS",2),s("DZD",2),s("FRR",2),s("LYS",1)]},{name:"Aegis Boon",factions:["A","U"],cards:[s("AGK",3),s("ALS",3),s("BSG",3),s("IHA",3),s("NXT",3),s("OBD",3),s("FRR",3),s("DYB",2),s("WWP",3),s("SYL",2),s("TDS",2)]},{name:"Thanksgiving Dinner",factions:["N","T"],cards:[s("BTD",3),s("CSW",3),s("GBG",3),s("ICD",3),s("CDM",2),s("GGR",2),s("EFP",2),s("SOC",2),s("DCR",2),s("FSL",1),s("DRD",1),s("NCM",1),s("XSH",1),s("GRM",1),s("TBC",1),s("EXD",1),s("HGS",1)]},{name:"Warden of Ice",factions:["A","T"],cards:[s("GTT",3),s("SHK",3),s("GMP",3),s("MTT",3),s("SIX",3),s("GCR",3),s("ESU",3),s("CAG",2),s("UBL",3),s("AFO",2),s("ENP",2)]},{name:"Magmifly",factions:["T"],cards:[s("SLS",3),s("STM",3),s("LUC",3),s("POK",3),s("AWU",3),s("BTD",3),s("BMY",2),s("AGU",2),s("SWA",2),s("TST",2),s("ROK",2),s("BRN",2)]}]},Fi={name:"Fundecks 1",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[s("DFB",3),s("BSR",3),s("HGS",3),s("HFA",3),s("FFD",3),s("XSH",3),s("XHU",3),s("WBG",3),s("GBG",3),s("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[s("TBA",3),s("SVH",3),s("MBP",2),s("FSH",3),s("RBH",3),s("FBC",3),s("LBR",2),s("CFB",3),s("AAK",3),s("KKK",2),s("FRR",1),s("FIN",1),s("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[s("MMA",3),s("DMW",3),s("GMP",3),s("SYO",3),s("KAW",3),s("SHK",3),s("CTL",2),s("CAG",2),s("MSC",2),s("MTS",2),s("ASG",2),s("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[s("CTV",3),s("TDW",3),s("BTS",3),s("CHR",3),s("GMR",3),s("KOD",2),s("LKP",2),s("SHV",2),s("DBA",2),s("CCR",2),s("PTB",2),s("FIN",1),s("DBT",2)]},{name:"Voltron",factions:["A"],cards:[s("FGA",3),s("FGB",3),s("FGD",3),s("FGG",3),s("AFS",3),s("BSS",3),s("PRI",3),s("TUP",2),s("JPK",2),s("BWH",2),s("SFT",3)]},{name:"Do Fear the Reaper",factions:["A","N"],cards:[s("CTI",3),s("DFR",3),s("GRW",3),s("LGT",3),s("OXM",3),s("OXP",3),s("PHM",3),s("CTW",2),s("NNS",2),s("OXA",2),s("SDN",3)]},{name:"Muadib",factions:["N","U"],cards:[s("DBA",3),s("DYL",3),s("GSW",3),s("LBD",3),s("MMW",3),s("NCW",3),s("SRV",3),s("LBL",2),s("MSP",2),s("VYE",2),s("SBD",3)]},{name:"Triassic Park",factions:["T","U"],cards:[s("URB",3),s("UTR",3),s("UTM",3),s("ULR",3),s("UIC",3),s("UGL",3),s("RTS",3),s("BRN",2),s("LBR",2),s("IBF",2),s("GHB",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[s("DDD",3),s("WBH",3),s("HMF",3),s("WCS",3),s("GGP",3),s("SAD",3),s("SDN",3),s("EWE",3),s("SBG",3),s("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[s("WWP",3),s("EHN",2),s("SDR",2),s("HTR",2),s("MML",2),s("HTP",2),s("SHS",3),s("MND",2),s("NXC",2),s("CDT",2),s("PTB",2),s("SVO",2),s("MPH",2),s("SYO",2)]},{name:"Braaiins",factions:["N"],cards:[s("XDV",3),s("XRW",3),s("ONN",2),s("SLH",2),s("FWK",2),s("BWK",2),s("URD",2),s("TPG",2),s("DSS",2),s("KOD",2),s("ZMT",2),s("RSZ",2),s("BLW",2),s("CSB",2)]},{name:"Wanderin'",factions:["N","U"],cards:[s("LYS",3),s("STR",2),s("MBP",2),s("OSL",2),s("RLW",3),s("SSR",1),s("SVO",2),s("SSE",2),s("RHW",3),s("SYL",2),s("TGS",2),s("TMG",3),s("XDH",3)]},{name:"Walls",factions:["A","T"],cards:[s("CDC",3),s("CTG",3),s("CRC",3),s("DCS",3),s("FRI",3),s("FGA",2),s("OBB",3),s("FVA",2),s("TGN",2),s("OWH",3),s("STN",3)]},{name:"Snakes in a Lane",factions:["A","U"],cards:[s("AFO",3),s("DSV",3),s("PSC",3),s("SHS",3),s("STO",3),s("NCL",2),s("VNF",3),s("LYS",2),s("SVO",1),s("VNS",3),s("TXS",2),s("ART",2)]},{name:"Benny & Izzy",factions:["A","T"],cards:[s("BRN",3),s("EFM",2),s("IZK",3),s("JPK",1),s("MTT",1),s("NNS",1),s("OBB",2),s("OWF",2),s("OEX",3),s("PRI",2),s("PTR",1),s("TST",1),s("FLS",2),s("BLH",3),s("SHK",3)]}]},Pi={name:"Fundecks 2",id:"FUN2",decks:[{name:"Ride the Lightning",factions:["T","U"],cards:[s("HOS",3),s("BLH",3),s("USS",3),s("LSK",3),s("SHK",3),s("CTL",3),s("LWY",3),s("KAW",3),s("RSP",3),s("DYB",2),s("SVO",1)]},{name:"Caught in a Web",factions:["A","N"],cards:[s("ASQ",3),s("IRT",3),s("OXA",2),s("OXM",3),s("DFS",3),s("HRM",3),s("ESD",3),s("ULG",3),s("DDS",3),s("CCS",2),s("DWW",2)]},{name:"Rando Calrissian",factions:["T","U"],cards:[s("CDM",3),s("BZS",3),s("PMI",3),s("IKA",3),s("ROE",3),s("PHC",3),s("DIS",3),s("DRE",3),s("SIV",3),s("HTP",3)]},{name:"Beards of Glory",factions:["A","U"],cards:[s("IBA",3),s("IHA",3),s("MBP",3),s("ESC",3),s("EWT",3),s("ESG",3),s("DBA",3),s("TGN",3),s("BLP",2),s("RPR",2),s("JPK",2)]},{name:"None More Verdant",factions:["U"],cards:[s("VCH",2),s("VSP",2),s("VGR",2),s("POD",2),s("MBP",2),s("EFE",3),s("VGW",3),s("WOD",1),s("SVO",1),s("RBG",3),s("RSD",3),s("SRD",2),s("ART",2),s("LYR",2)]},{name:"Exploding Cat",factions:["A","T"],cards:[s("SBF",3),s("OEX",3),s("ATI",3),s("KAW",3),s("ZSH",3),s("RSP",3),s("WMM",2),s("OWF",2),s("DFS",2),s("CHT",2),s("OBB",2),s("ABL",2)]},{name:"No, Not the Bees!",factions:["T","U"],cards:[s("LVH",3),s("HVE",3),s("SIV",3),s("TRS",3),s("KBE",3),s("SHK",3),s("LBR",3),s("RSP",3),s("VCH",2),s("VGR",2),s("CTL",2)]},{name:"Armored Column",factions:["A","U"],cards:[s("ESP",2),s("BTB",3),s("FLC",3),s("CEX",3),s("FRR",2),s("SSN",2),s("FSC",3),s("NXB",3),s("BWH",3),s("AMP",3),s("WMC",1),s("NXT",2)]},{name:"Angered Alyssa",factions:["A","T"],cards:[s("ASB",3),s("SHK",3),s("FSM",3),s("BST",3),s("SFM",3),s("BSW",3),s("VOB",3),s("TBC",3),s("SCD",3),s("MTT",2),s("ASG",1)]},{name:"Big Dawg Iniog",factions:["N","U"],cards:[s("ICD",3),s("DHC",3),s("ZDK",3),s("CCS",2),s("NCM",3),s("VCH",2),s("HTR",2),s("IRT",3),s("NGT",3),s("ROU",2),s("TOB",2),s("SPG",2)]},{name:"Rumblestone Clown Show",factions:["A","T"],cards:[s("RSE",3),s("OWF",3),s("AGP",3),s("DFS",3),s("FSM",3),s("IBF",3),s("TST",3),s("BWN",2),s("DKS",2),s("CHT",2),s("COD",1),s("LFA",2)]},{name:"Kills Bugs Dead",factions:["T","U"],cards:[s("TSP",3),s("SMS",3),s("BTD",3),s("HMO",3),s("QSW",3),s("UTR",3),s("VTR",3),s("GHB",3),s("STM",3),s("DKS",2),s("VCH",1)]},{name:"Aeon Buzzard",factions:["A","T"],cards:[s("EPH",3),s("BWN",3),s("TBB",3),s("CDM",2),s("SAD",3),s("LCE",2),s("MBR",3),s("COD",1),s("MMR",3),s("MMX",3),s("BZH",2),s("STD",2)]},{name:"Unholy Matrimony",factions:["N"],cards:[s("DFB",3),s("BOF",3),s("CGL",3),s("SGF",2),s("POX",3),s("ULG",3),s("IME",3),s("SHG",2),s("IRT",2),s("SHV",3),s("DRD",3)]},{name:"Dance of the Dryads",factions:["T","U"],cards:[s("NGQ",2),s("HOS",3),s("SDR",3),s("LBD",3),s("KTS",3),s("MPH",3),s("SSR",3),s("PYS",2),s("SVO",2),s("SBD",2),s("DYB",2),s("SND",2)]}]},Mi={name:"Fundecks 3",id:"FUN3",decks:[{name:"Ashy Larry",factions:["A","T"],cards:[s("AMD",3),s("LFA",3),s("SSI",3),s("SAD",3),s("HMF",3),s("AMY",3),s("ABR",2),s("UEM",2),s("WFM",2),s("DCS",2),s("PHM",2),s("OBB",2)]},{name:"Wander These Lands",factions:["N","U"],cards:[s("LYS",3),s("CYW",1),s("RTW",3),s("RLW",3),s("SVO",2),s("DYS",2),s("RHW",3),s("GHB",2),s("ROU",2),s("IME",3),s("VCH",1),s("ULG",3),s("AEC",2)]},{name:"Blob Convention",factions:["A","N"],cards:[s("S01",3),s("NCM",3),s("NCS",3),s("CYS",3),s("FSL",3),s("NCP",3),s("NOZ",3),s("SLH",3),s("GRP",2),s("SHV",2),s("GRM",2)]},{name:"We Shall Not Cease",factions:["N","T"],cards:[s("CGG",3),s("FSM",3),s("EXD",3),s("GRP",3),s("SHV",3),s("HOX",2),s("SCV",1),s("VYE",3),s("COD",1),s("DCR",2),s("BRN",2),s("DBT",2),s("TOB",1),s("VOB",1)]},{name:"What Tek Iz This?",factions:["T","U"],cards:[s("IZK",3),s("VIC",3),s("IGR",3),s("SSH",3),s("DGW",3),s("BRN",3),s("LYS",3),s("ROK",3),s("DDF",3),s("EWV",3)]},{name:"Tromping Tuskins",factions:["A","U"],cards:[s("LBC",3),s("LBL",3),s("CTV",3),s("TGK",3),s("EWT",3),s("NFF",2),s("TSL",2),s("CSG",2),s("VPR",2),s("MXW",2),s("AOP",2),s("HRM",2),s("ESC",1)]},{name:"Enhanced Voltron",factions:["A"],cards:[s("FGA",3),s("FGB",3),s("FGD",3),s("FGG",3),s("SFG",3),s("GAS",3),s("WTK",3),s("MMG",3),s("HRM",3),s("LCE",2),s("PLW",1)]},{name:"Lazarus (Big Skills)",factions:["N","T"],cards:[s("TDW",3),s("NSH",3),s("PHC",3),s("PSH",3),s("IME",3),s("ULG",3),s("SHG",3),s("VIK",3),s("IDF",2),s("GRP",2),s("ASG",1),s("COD",1)]},{name:"Dogs! Dogs! Dogs!",factions:["T","U"],cards:[s("LTU",3),s("SDA",3),s("EHN",3),s("EWV",3),s("HTP",2),s("DYB",2),s("SVO",1),s("VCH",1),s("WHR",3),s("MMH",2),s("DBR",2),s("SIN",2),s("PYS",1),s("VTR",2)]},{name:"The Cackler",factions:["A","N"],cards:[s("CKB",3),s("ARB",3),s("GMP",3),s("LCE",2),s("PRI",2),s("RPR",3),s("DPO",3),s("SAP",3),s("DDS",3),s("OXP",3),s("ABE",2)]},{name:"Nugalug",factions:["N","T"],cards:[s("NUG",3),s("LUC",3),s("EWE",3),s("SBG",3),s("AWU",3),s("SPH",3),s("ROU",3),s("FFM",3),s("BZD",3),s("BFM",3)]},{name:"Blessed Shrine",factions:["A","T"],cards:[s("SLS",3),s("CTG",3),s("USS",3),s("MMG",3),s("CRC",3),s("STN",3),s("NXC",3),s("MND",2),s("SSD",2),s("USA",2),s("SES",1),s("OBB",2)]},{name:"The Dixie Pig",factions:["T","U"],cards:[s("SSD",3),s("WSE",3),s("NCL",3),s("STN",3),s("PYS",3),s("BSW",3),s("FKS",3),s("UCM",2),s("UHS",2),s("HTR",2),s("TBC",2),s("GHS",1)]},{name:"Wafer Thin Mint",factions:["N","T"],cards:[s("LFA",2),s("EXD",3),s("GBG",3),s("USA",3),s("PMS",3),s("STN",1),s("VOB",1),s("FSK",3),s("WFM",3),s("FFS",3),s("TBC",2),s("FOR",3)]},{name:"Cyrus the Virus",factions:["N","U"],cards:[s("CTM",3),s("PTB",3),s("POT",3),s("GRM",3),s("MNM",3),s("LMD",3),s("MPH",3),s("SOC",3),s("SRP",3),s("HGS",3)]}]},Ri={name:"Fundecks 4",id:"FUN4",decks:[{name:"Pain Forest",factions:["T","U"],cards:[s("TDS",3),s("TMS",3),s("DTR",3),s("HTR",3),s("EFE",3),s("SFM",3),s("SHK",3),s("VCH",2),s("BSW",2),s("UCM",2),s("MSP",1),s("VSP",1),s("IBF",1)]},{name:"Disrespect the Weak",factions:["A","N"],cards:[s("UIW",3),s("SRM",3),s("OXP",3),s("OXM",3),s("SRP",3),s("WFS",2),s("GRW",2),s("DGZ",2),s("VPR",2),s("DDS",2),s("PHM",2),s("OFM",2),s("LMV",1)]},{name:"I Love the Dead",factions:["N","U"],cards:[s("YNS",3),s("NSW",3),s("STS",2),s("SIV",2),s("SLH",3),s("CCR",3),s("GGW",3),s("REW",3),s("SST",2),s("MML",2),s("DYS",2),s("TPT",2)]},{name:"Silly Ol' Steelscale",factions:["A","T"],cards:[s("STG",3),s("DGW",3),s("FKS",3),s("FSK",3),s("USA",3),s("CEX",3),s("OBB",3),s("BWH",2),s("DRE",1),s("FVA",1),s("AGW",2),s("SOK",2),s("NNS",1)]},{name:"Poison Crush",factions:["T","U"],cards:[s("WBY",3),s("LOD",3),s("SPT",3),s("VND",3),s("DPG",3),s("FZS",3),s("GCR",3),s("UBL",2),s("MPH",3),s("FKS",2),s("STB",2)]},{name:"Dragons, Eh",factions:["N","T"],cards:[s("DGW",3),s("SMD",3),s("ATI",3),s("LMD",3),s("DDD",3),s("CSW",3),s("DTD",3),s("VIC",3),s("BTD",3),s("SOV",3)]},{name:"Hail Hydra",factions:["A","U"],cards:[s("ESG",3),s("DBA",3),s("CHY",3),s("LHY",3),s("RHY",3),s("SVH",3),s("SVO",2),s("EVT",3),s("AEC",2),s("AGW",2),s("SPG",1),s("VCH",2)]},{name:"Coral, Get to the Sides!",factions:["N"],cards:[s("IRT",3),s("IVS",3),s("ZMT",3),s("ZDK",3),s("XDV",3),s("TNL",3),s("ABB",3),s("SNT",3),s("XRW",3),s("CCC",3)]},{name:"The Bear and the Maiden Fair",factions:["T","U"],cards:[s("DZD",3),s("FWB",3),s("DBR",3),s("FFM",3),s("AMD",3),s("WFM",3),s("SHK",3),s("SIV",3),s("AIV",2),s("NCL",2),s("SOV",1),s("EFA",1)]},{name:"Bionic Darkforged",factions:["A","U"],cards:[s("SWS",3),s("DSE",3),s("DRS",3),s("SSP",3),s("DHM",3),s("SHA",3),s("ESC",3),s("LBD",3),s("AGP",2),s("CTV",2),s("SVO",1),s("NNS",1)]},{name:"Caustic Darkforged",factions:["N","T"],cards:[s("DSW",3),s("GGB",3),s("SFE",3),s("DSA",3),s("SCZ",3),s("USY",3),s("ZXR",3),s("SPH",3),s("BZH",2),s("IBF",1),s("VGL",2),s("CYW",1)]},{name:"Thralled Darkforged",factions:["A","N"],cards:[s("SWS",3),s("GGB",3),s("DSW",3),s("DSE",3),s("SCZ",3),s("SHA",3),s("PSH",3),s("STD",3),s("DDS",2),s("AOP",1),s("BFT",2),s("TPT",1)]},{name:"Roasted Darkforged",factions:["T","U"],cards:[s("DSA",3),s("DRS",3),s("SFE",3),s("SSP",3),s("DHM",3),s("USY",3),s("CDM",3),s("GHR",3),s("MPH",2),s("ENR",1),s("PYS",2),s("STB",1)]},{name:"Punchy Darkforged",factions:["A","T"],cards:[s("SWS",3),s("DSE",3),s("SFE",3),s("DSA",3),s("SHA",3),s("USY",3),s("WMR",3),s("AMD",3),s("OWF",2),s("SOA",1),s("UBL",2),s("SOK",1)]},{name:"Mouldy Darkforged",factions:["N","U"],cards:[s("DSW",3),s("GGB",3),s("DRS",3),s("SSP",3),s("DHM",3),s("SCZ",3),s("DBA",3),s("GGW",3),s("ROG",2),s("SIN",2),s("SLH",1),s("DYB",1)]}]},Ae=[wi,Si,Ci,Di,xi,Hi,Bi,Ni,Fi,Pi,Mi,Ri];Ae.forEach(o=>{o.decks.forEach(t=>{t.cards.map(i=>i.num).reduce((i,r)=>i+r,0)!==30&&console.warn("Pre-con deck with not 30 cards: "+o.name+" -- "+t.name)})});class Le{state;constructor(t){this.state=t}getState(){return this.state}get adjacent(){return m.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 this.state.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(){return m.searchByLane(m.oppositeLane(this.lane),!this.owner)}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get rank(){return A.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,i,r=void 0){t!==0&&(this.state.attack+=t,this.enforceEffects("AT")),i!==0&&(this.state.health+=i,this.state.maxHealth+=i,this.enforceEffects("CH"),V.deathProdder(this,r),i>0&&x.addEvents($.creatHeal(this,i)))}addArmor(t){if(!this.negateArmor){const i=this.state.armor+t;this.state.armor=Math.max(0,i),this.enforceEffects("AR")}}addMobility(t){if(!this.negateMobility){const i=this.state.mobility+t;this.state.mobility=Math.max(0,i)}}addPoison(t){const i=this.state.poison+t;this.state.poison=Math.max(0,i)}addRegen(t){if(!this.negateRegen){const i=this.state.regen+t;this.state.regen=Math.max(0,i)}}heal(t){if(t===0)return 0;const i=Math.min(this.health+t,this.maxHealth)-this.health;return this.state.health+=i,this.enforceEffects("CH"),x.addEvents($.creatHeal(this,i)),i}setHealth(t){this.state.health=t}hurt(t,i=!1){if(t<1)return[0,0];const r=Math.max(Math.min(t,this.armor-this.armorDmg),0);let a=t-r,c=this.health-a;this.state.armorDmg+=r;let f=0;return i&&c<0&&(f=a-this.health,a=this.health),a>0&&(this.state.health-=a,this.enforceEffects("CH")),[a,f]}hurtBattle(t,i,r=!1){const a=this.hurt(t,r);return a[0]>0&&x.addEvents($.damage(!0,a[0],this.health,!0,!0,this,i)),a[1]}hurtDirect(t,i,r=void 0){const a=this.hurt(t,!1);return a[0]>0&&(y.lawg(i,` dealt ${t} dmg to `,this.code,"."),x.addEvents($.damage(!1,a[0],this.health,!1,!0,this,void 0)),V.deathProdder(this,r)),a[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 b.modSum(this.mods,t)}modBool(t){return b.modBool(this.mods,t)}hasMod(t){return b.hasModG(this.mods,t)}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){b.hasMod(this.mods,t)||this.addMod(t)}removeMod(t,i=!0){const r=this.state.mods.filter(a=>a.granter===t);this.state.mods=this.state.mods.filter(a=>a.granter!==t),r.forEach(a=>{i&&this.modEffectPropagator(a),a.type==="AR"&&(this.state.armorDmg=Math.max(0,this.state.armorDmg-a.value))})}removeModSafe(t,i=!0){this.hasMod(t)&&this.removeMod(t,i)}expireMod(t){this.state.mods.splice(b.modIdx(this.state.mods,t),1)}bonusTotal(){let t=ut.sumNuggets(this.triggers);return this.state.bonus&&(t=ut.addNuggets(t,this.state.bonus)),t}threatTotal(){const t=this.triggers.map(i=>i.bonus?.threat).filter(Boolean);return this.state.bonus?.threat&&t.push(this.state.bonus.threat),t}endActivation(){this.modBool("EA")?this.removeMod(this.id):this.state.activationAvailable=!1,V.deathCheck(),v.actionDone()}move(t){this.state.lane=t,fe.positionChange(this.owner),x.addEvents($.creature("MOV",this))}addEffect(t,i){const r=b.effect(t,i);return this.effects.push(r),r}enforceEffects(t,i=!1){this.effects.filter(r=>r.watch===t).filter(r=>r.area==="A"||r.area==="C"&&this.owner===i).forEach(r=>G.getCard(r.logicCode).enforceEffect(this))}jr4(t,i=""){i===""&&(i=this.code);const r=b.trigger(t,i);return r.creatId=this.id,this.triggers.push(r),r}removeTrigger(t){const i=b.trigIdx(this.triggers,t);i>-1?this.triggers.splice(i,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.bonus=void 0,this.state.changed=!0,this.state.negateActivate=!0,A.removeModSafe(!0,this.state.id),A.removeModSafe(!1,this.state.id),m.creatByTarget(b.crTarg()).forEach(t=>{t.removeModSafe(this.id),t.enforceEffects("PS",this.owner)}),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),fe.defenderChange(this.owner)}preWipe(){this.state.mods=[],this.state.triggers=[],this.state.effects=[]}get hints(){return this.state.hints}aiHints(){return this.hints}}class b{static creatureState(t,i){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,bonus:void 0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:i,level:0,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,i){return{area:"A",watch:t,logicCode:i}}static freeCard(t){return{id:E.genId(),condition:b.target("TH"),sourceCard:t}}static mod(t,i,r=""){return{type:t,value:typeof i=="boolean"?i?1:0:i,granter:r,expiry:"NN"}}static modT(t,i,r=""){const a=b.mod(t,i,r);return a.expiry="ET",a}static trigger(t,i){return{id:E.genId(),type:t,logicCode:i,creatId:"",customCode:"",interactive:!1,changes:!1,bonus:void 0}}static triggerReaction(t,i,r,a){return{event:t,owner:r,creatId:"",cardCode:"",trigger:i,host:a}}static basicAction(t){return{zone:"N",key:t,host:"",param:""}}static fieldSelectAction(t,i=-1,r=!0){return{zone:"F",key:t,playerA:r,lane:i,host:"",param:""}}static deckSelectAction(t,i,r){return{zone:"N",key:t,card:i,position:r,host:"",param:""}}static handSelectAction(t,i="",r="",a=-1){return{zone:"H",key:t,card:i,cost:r,position:a,host:"",param:""}}static playerSelectAction(t,i){return{zone:"P",key:t,playerA:i,host:"",param:""}}static draftSelectAction(t,i,r){return{zone:"N",key:t,index:i,pack:r,host:"",param:""}}static menuButtonAction(t){return{zone:"N",key:"MNBT",host:"",param:t}}static actionifier(t,i,r,a){const c=t;return c.key=i,c.host=r,c.param=a,c}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,i,r,a){return b.actionifier(b.target(t),i,r,a)}static crTarg(){const t=b.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,i,r){return b.actionifier(b.crTarg(),t,i,r)}static crNotMeTarg(t){const i=b.target("TF");return i.field="O",i.creatStatus="V",i.notMe=t,i}static crNotMeActTarg(t,i,r,a){return b.actionifier(b.crNotMeTarg(i),t,r,a)}static crFriendTarg(){const t=b.crTarg();return t.player="F",t}static crFriendActTarg(t,i,r){return b.actionifier(b.crFriendTarg(),t,i,r)}static crFriendNotMeTarg(t){const i=b.crNotMeTarg(t);return i.player="F",i}static crFriendNotMeActTarg(t,i,r,a){return b.actionifier(b.crFriendNotMeTarg(i),t,r,a)}static crEnemyTarg(){const t=b.crTarg();return t.player="E",t}static crEnemyActTarg(t,i,r){return b.actionifier(b.crEnemyTarg(),t,i,r)}static playerTarg(t){const i=b.target("TP");return i.player=A.toTarget(t),i}static playerActTarg(t,i,r,a){return b.actionifier(b.playerTarg(t),i,r,a)}static lvlHandActTarg(t,i){const r=this.actionTarget("TH","CARD",t,i);return r.player="F",r.canLevel=!0,r.hint=["CD"],r}static emptyTarg(){const t=b.target("TF");return t.field="E",t}static emptyActTarg(t,i,r){return b.actionifier(b.emptyTarg(),t,i,r)}static emptyPlayerTarg(t){const i=b.emptyTarg();return i.player=A.toTarget(t),i}static emptyPlayerActTarg(t,i,r,a){return b.actionifier(b.emptyPlayerTarg(t),i,r,a)}static modSum(t,i){return t.filter(r=>r.type===i).map(r=>r.value).reduce((r,a)=>r+a,0)}static modBool(t,i){return t.some(r=>r.type===i&&r.value===1)}static hasModG(t,i){return t.findIndex(r=>r.granter===i)>-1}static hasMod(t,i){return b.modIdx(t,i)>-1}static modIdx(t,i){return t.findIndex(r=>r.granter===i.granter&&r.type===i.type)}static trigIdx(t,i){return t.findIndex(r=>r.id===i.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,i){return`card/${i?"b":"s"}/${this.faction}/${t}.jpg`}free=!1;level;maxLevel=3;minLevel=1;name="";overload=!1;rarity="T";spice;text="";get type(){return "C"}hints;addSp(t,i){}aiHints(){return this.hints??[]}canLevel(){return this.level{c+=a[p]*r[0][p],f+=a[p]*r[1][p]}),[c,f]}rawNug(t,i,r,a,c=0,f=void 0){return ut.rawNugget(t,i,r,a,c,f)}buffNug(t,i,r=void 0){return this.rawNug(0,i+t,t,0,0,r)}playerNug(t,i=void 0){return this.rawNug(0,0,0,t,0,i)}spawnNug(t,i=void 0){const r=ut.cardCreatValueFormula(t);return this.rawNug(1,r,t.iAttack,0,0,i)}statSpawnNug(t,i,r=void 0){const a=this.buffNug(t,i,r);return a.count=1,a}avgSpawnNug(t){const i=this.avgCreatureStats(t);return this.statSpawnNug(i[0],i[1])}regnNug(t,i=void 0){return this.rawNug(0,ut.calcCreatValueFormula(0,0,0,0,t,!1,0),0,0,0,i)}multNug(t,i){return t.attack*=i,t.value*=i,t.count*=i,t.pHealth*=i,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 F 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,i){const r=b.creatureState(t,i);return r.id=E.genId(),r.code=this.code,r.level=this.level,r.health=this.iHealth,r.attack=this.iAttack,r.maxHealth=r.health,r.regen=this.iRegen,r.breakthrough=this.iBT,r.defender=this.iDefend,r.aggressive=this.iAggro,r.armor=this.iArmor,r.mobility=this.iMobile,r.hints=this.aiHints(),r.bonus=this.bonus,new Le(r)}playTargets(){const t=super.playTargets(),i=b.actionTarget("TF","FORG",this.code,"");return i.player="F",t.push(i),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}get formation(){return!1}addExtraActivate(t){t.addMod(b.modT("EA",!0,t.id))}}class kt extends Nt{constructor(t){super(t)}get type(){return "S"}logSpell(t=void 0,i=void 0){if(lt.simOn)return;const r=["Casted ",this.code];t&&(r.push(" on ",t.code),i&&r.push(" and ",i.code)),r.push("."),y.lawg(...r)}}class ne{paStats;pbStats;constructor(t,i){this.paStats=t,this.pbStats=i}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const i=this.playerStats(t),r=this.playerStats(!t);return ne.deltafier(i,r)}static deltafier(t,i){const r=ne.blankStats(!0);return r.creatCount=t.creatCount-i.creatCount,r.creatValue=t.creatValue-i.creatValue,r.threatValue=t.threatValue-i.threatValue,r.playerHealth=t.playerHealth-i.playerHealth,r.bonus=t.bonus-i.bonus,r}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0,bonus:0}}}class ut{static dcWeight=.4;fromState(t=!1){const i=m.qActiveCreats(),a=[!0,!1].map(c=>{const f=ne.blankStats(c),p=A.toPlayer(c);f.playerHealth=ut.playerFormula(p.health,A.totalArmor(p),A.totalPoison(p),p.effects.length);const k=ut.sumNuggets(p.triggers);f.playerHealth+=k.pHealth,f.creatCount=k.count,f.creatValue=k.value,f.threatValue=k.attack,f.bonus=k.bonus;const w=i.filter(P=>P.owner===c);return w.forEach(P=>{const I=P.bonusTotal();f.playerHealth+=I.pHealth,f.bonus+=I.bonus,f.creatCount+=1+I.count,f.creatValue+=ut.creatValueFormula(P)+I.value,f.threatValue+=ut.threatFormula(P,i)+I.attack}),t&&c&&(w.forEach(P=>{f.bonus+=ut.threatEOT(P,p.turn,i)}),L.regularPlays>2&&(f.bonus+=(L.regularPlays-2)*(Math.min(p.rank,3)*2))),f});return new ne(a[0],a[1])}static ddp9(t,i,r,a,c=0){const f=t/4,p=i/10,k=r/12,w=a/8;return f+p+k+w+c}static creatValueFormula(t){return ut.calcCreatValueFormula(t.attack,t.health,t.armor,t.mobility,t.regen,t.breakthrough,t.poison)}static cardCreatValueFormula(t){return ut.calcCreatValueFormula(t.iAttack,t.iHealth,t.iArmor,t.iMobile,t.iRegen,t.iBT,0)}static calcCreatValueFormula(t,i,r,a,c,f,p){const k=f?1:0;return i+Math.max(0,t)+(r+Math.min(a,3)+k+c-p)*1.5}static playerFormula(t,i,r,a){return t+(i-r)*2+a*4}static threatFormula(t,i){let r=0,a=0;if(t.defender)r=t.attack;else{const c=ut.oppFinder(t,i);c?(t.breakthrough&&(a=Math.max(t.attack-c.health,0)),r=t.attack-a):a=t.attack,a>0&&(a+=ut.scalingBonus(a))}return Math.max(r,0)+Math.max(a,0)}static threatEOT(t,i,r){let a=0;return t.threatTotal().forEach(f=>{f==="TP"?t.attack>0&&S.isUn(ut.oppFinder(t,r))&&(t.defender?a+=t.level/2:a+=t.level):f==="TS"?a+=t.level*2*(t.health/(t.maxHealth||1)):f==="TX"||f==="TW"?a+=t.level*(f==="TX"?1.5:.5):f==="TH"&&i>1?a+=t.level*(i/4):f==="TL"&&i===4&&(a-=t.level)}),a}static oppFinder(t,i){const r=6-t.lane;return i.find(a=>a.owner!==t.owner&&a.lane===r)}static rawNugget(t,i,r,a,c=0,f=void 0){return{count:t,value:i,attack:r,pHealth:a,bonus:c,threat:f}}static addNuggets(t,i){return ut.rawNugget(t.count+i.count,t.value+i.value,t.attack+i.attack,t.pHealth+i.pHealth,t.bonus+i.bonus)}static sumNuggets(t){let i=ut.rawNugget(0,0,0,0,0);return t.forEach(r=>{r.bonus&&(i=ut.addNuggets(i,r.bonus))}),i}static scalingBonus(t){let i=7;if(t<=i)return 0;let r=!0,a=0,c=1;const f=7;for(;r;)t>i+f?(a+=c*f,i+=f,c++):(a+=c*(t-i),r=!1);return a}weighState(t,i,r){const a=t.deltaStats(r),c=i.deltaStats(r),f=ne.deltafier(c,a),p=f.playerHealth<0?-1:1,k=ut.scalingBonus(f.playerHealth*p)*p+f.playerHealth;return ut.ddp9(f.creatCount,f.creatValue,f.threatValue,k,f.bonus)}}class Ei{aiPlayer;constructor(t){this.aiPlayer=t}jr7(t,i=3){return`${t}${i}`}jr6(t,i){const r=S.randInt(0,i.length),a=i[r];return i.splice(r,1),m.birth(t,"F",this.aiPlayer,a)}cheatin(){const t=A.toPlayer(this.aiPlayer),i=A.toPlayer(!this.aiPlayer),r=i.health-t.health;let a=0;r>85?a=3:r>65?a=2:r>45&&(a=1);const c=m.emptyLanes(this.aiPlayer);if(a===0||c.length===0)return!1;y.lawg(this.aiPlayer," is a cheaty cheaterton.");let f=0;if(a===1){if(L.regularPlays-=1,f=S.randInt(0,13),f===0)this.jr6(this.jr7("HTR"),c);else if(f===1)this.jr6(this.jr7("AGM"),c).addRegen(8);else if(f===2){const p=this.jr6(this.jr7("YNS"),c);p.buff(0,15),p.addRegen(4)}else if(f===3)this.jr6(this.jr7("TBA"),c);else if(f===4)this.jr6(this.jr7("DCS"),c);else if(f===5)this.jr6(this.jr7("GGP"),c).addRegen(8);else if(f===6){const p=this.jr6(this.jr7("WFM"),c);p.aggressive=!0}else if(f===7){const p=this.jr6(this.jr7("FFU"),c);p.aggressive=!0}else if(f===8){const p=this.jr6(this.jr7("URB"),c);p.aggressive=!0}else if(f===9){const p=this.jr6(this.jr7("KOD"),c);p.aggressive=!0,p.addRegen(6)}else if(f===10)this.jr6(this.jr7("AGK"),c).addArmor(3);else if(f===11){const p=this.jr6(this.jr7("PSC"),c);p.aggressive=!0}else if(f===12){const p=this.jr6(this.jr7("SAD"),c);p.aggressive=!0}}else if(a===2)if(L.regularPlays-=1,f=S.randInt(0,17),f===0){const p=this.jr6(this.jr7("NDR"),c);p.aggressive=!0}else if(f===1){const p=this.jr6(this.jr7("CSW"),c);p.aggressive=!0}else if(f===2)this.jr6(this.jr7("GGD"),c).addRegen(6);else if(f===3)this.jr6(this.jr7("EFP"),c);else if(f===4)this.jr6(this.jr7("ZTU"),c);else if(f===5){const p=this.jr6(this.jr7("DDD"),c);p.aggressive=!0}else if(f===6)this.jr6(this.jr7("RBH"),c).addRegen(8);else if(f===7)this.jr6(this.jr7("SFT"),c);else if(f===8)this.jr6(this.jr7("GTT"),c);else if(f===9)this.jr6(this.jr7("SMD"),c);else if(c.length===5)this.jr6(this.jr7("DFB"),c),[1,2,3,4].forEach(p=>this.jr6(this.jr7("XHS"),c));else if(c.length===4)this.jr6(this.jr7("LMV"),c);else if(c.length===3)this.jr6(this.jr7("LHY"),c),this.jr6(this.jr7("SVH"),c),this.jr6(this.jr7("DBA"),c);else if(c.length===2)this.jr6(this.jr7("UTR"),c),this.jr6(this.jr7("TDS"),c);else if(t.turn===4)this.jr6(this.jr7("SSR"),c);else if(t.turn===1)this.jr6(this.jr7("ESK"),c);else{const p=this.jr6(this.jr7("XSH"),c);p.aggressive=!0}else if(a===3)if(f=S.randInt(0,20),f===0){const p=this.jr6(this.jr7("IHA",4),c);p.aggressive=!0}else if(f===1)this.jr6(this.jr7("CHR"),c);else if(f===2)this.jr6(this.jr7("FGO",1),c);else if(f===3)this.jr6(this.jr7("CHV",4),c);else if(f===4)this.jr6(this.jr7("KKK",4),c);else if(t.health<20){const p=this.jr6(this.jr7("ODC",4),c);p.aggressive=!0}else if(c.length===5){const p=S.randInt(0,4);if(p===0)[1,2,3,4,5].forEach(k=>this.jr6(this.jr7("UWL",2),c));else if(p===1)[1,2].forEach(k=>this.jr6(this.jr7("DFB"),c)),[1,2,3].forEach(k=>this.jr6(this.jr7("FFD"),c));else if(p===2)[1,2,3,4,5].forEach(k=>this.jr6(this.jr7("BWK"),c));else if(p===3){this.jr6(this.jr7("SBG"),c),this.jr6(this.jr7("EWE"),c);const k=this.jr6(this.jr7("BMY"),c);k.defender=!0,k.aggressive=!0}}else if(i.health>350)t.health<180&&A.heal(t,180-t.health,"POZ1"),this.jr6(this.jr7("AGD"),c);else if(i.health>250)this.jr6(this.jr7("FGO"),c);else if(c.length===4){const p=S.randInt(0,3);p===0?(this.jr6(this.jr7("AGK"),c),[1,2,3].forEach(k=>this.jr6(this.jr7("VBK"),c))):p===1?(this.jr6(this.jr7("TDS"),c),this.jr6(this.jr7("TDS"),c),this.jr6(this.jr7("UTR"),c)):p===2&&[1,2,3,4].forEach(k=>this.jr6(this.jr7("CDC"),c))}else if(c.length===3)if(S.randInt(0,2)){this.jr6(this.jr7("SDR"),c),this.jr6(this.jr7("SDR"),c);const p=this.jr6(this.jr7("UPM"),c);p.aggressive=!0}else{this.jr6(this.jr7("SDL"),c);const p=this.jr6(this.jr7("NFF"),c);p.aggressive=!0}else if(c.length===2)this.jr6(this.jr7("SPM"),c),this.jr6(this.jr7("SPM"),c);else{const p=this.jr6(this.jr7("NXC"),c);p.buff(10,0),p.aggressive=!0,p.addMobility(2),p.addRegen(5)}return t.health<30&&A.heal(t,50-t.health,"POZ1"),!0}}var st=(o=>(o[o.Left=0]="Left",o[o.Both=1]="Both",o[o.Right=2]="Right",o[o.ForceRight=3]="ForceRight",o))(st||{});class je{action;hitTest(t,i,r){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,i,r,a){let c,f=0;const p=t.length;for(;c===void 0&&f=t&&this.originY<=i&&this.endY>=i?this.action:void 0}}class Ot extends ot{constructor(t,i,r,a,c=0){super({zone:"N",key:"BNDL",host:"",param:""},t,i,r,a,c)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,i,r){if(super.hitTest(t,i,r))return je.arrayHit(this.childs,t,i,r)}}class We{realPromise;resolveMe(t){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,i)=>{this.resolveMe=t,this.rejectMe=i})}}const Je=25,oi=9999,Li=-9999,Gi=-999999,Wi=["CANC","DEET","SCRH"],Ii=["HPLY","ACTV","MOVE"];class $i{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 ut,this.rootBoardStats=new ne(ne.blankStats(!0),ne.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&&L.mainBattle&&(this.inPhase=!1)}simEndpoint(t){if(this.endCount++,this.promStack.length===0)y.debug("Tried to end a sim, but no promise to unlock."),console.trace();else{let i;if(t==="T"){const r=this.brdEval.fromState(!0);i=this.brdEval.weighState(this.rootBoardStats,r,this.aiPlayer)}else t==="W"?i=oi:t==="L"?i=Li:i=Gi;this.popProm(i)}}async processAction(t,i,r=!1){const a=!this.simOn;let c=0,f,p=this.actionPruner(t);if(p=this.noHandDoubles(p),this.peeking){this.popPeeker(p);return}if(a&&this.dumb&&i&&(this.dumb=!1,y.debug("Smart Again.",!1)),this.dumb&&!this.inPhase){let I=p.filter(U=>U.key==="FITE"||U.key==="ENDT");I.length>0&&(p=I)}if(a){f=new Me,f.hwhipe();const I=p.map((ct,$t)=>f.drawAiGear($t,!1));await Promise.all(I),await new Ke().drawActions([]),await S.sleep(Je),this.kickOut=!1,this.simOn=!0,this.slowpoke=Date.now(),this.rootBoardStats=this.brdEval.fromState(),this.endCount=0;const J=await this.peeker(p),Z=[];let et=0,Ct=0,q=[];J.forEach(ct=>{et+=ct.peek.length,ct.free&&(ct.free==="FREE"?Ct++:q.includes(ct.free)||(Ct++,q.push(ct.free))),ct.wasPeek&&ct.peek.some($t=>this.hasHint($t,"DF"))&&Z.push(ct.root)}),Z.length>0?(p=Z,this.dumb=!0,y.debug("Do firsts; dumb mode. Action count "+p.length,!1)):r?(this.dumb=!0,y.debug("Forced dumb mode.",!1)):L.regularPlays+Ct>3?(this.dumb=!0,y.debug("4+ plays; dumb mode. Peek was "+et,!1)):A.getActive().hand.length>7?(this.dumb=!0,y.debug("8+ in hand; dumb mode. Peek was "+et,!1)):et>29&&S.options.debug&&this.peekerReport(J)}if(p.length===0){a&&(console.error("Root eval set consisted of 0 valid actions"),y.debug("!! Zero Action Root !!")),this.simEndpoint("D");return}let k=-99999;const w=[];let P=!0;if(a)if(p.length===1)w.push({a:p[0],weight:99}),P=!1;else{const I=p.findIndex(U=>U.key==="HPLY"&&U.card==="ESU2"||U.card==="ESU3");I>-1&&(w.push({a:p[I],weight:99}),P=!1)}if(P){Ce.saveState();for(let I=0;I4e4&&(this.kickOut=!0),Z+=this.hintWeight(U),Z>k&&(k=Z),Ce.restoreState(),a&&(w.push({a:U,weight:Z}),await f.drawAiGear(I,!0),c++,await S.sleep(Je))}Ce.popState()}if(a)if(this.simOn=!1,this.kickOut)y.lawg("🤖: High complexity encountered. Recombobulating."),this.processAction(t,i,!0);else{const I=k-(i?.4:.2);let U=w.filter(q=>q.weight>I);U.length>1&&U.findIndex(q=>q.a.key==="ENDT")>-1&&(U=U.filter(q=>q.a.key!=="ENDT"));let J;if(I>oi-100){const q=U.find(ct=>ct.a.key==="FITE");q?J=q.a:J=U[S.randInt(0,U.length)].a}else J=U[S.randInt(0,U.length)].a;const Z=Date.now()-this.slowpoke,et=Math.max(1,350-Z),Ct=Z-Je*c;this.turnSims+=this.endCount,this.turnTime+=Ct,S.options.debug&&(i?(y.debug("▪"),y.debug("🧠 Main Choices 🧠"),w.sort((q,ct)=>ct.weight-q.weight).forEach(q=>{const ct=this.dazzler(q,J,I);let $t="",qt;const Kt=q.a.key;Kt==="HPLY"?($t=q.a.card,qt="Play "):Kt==="MOVE"||Kt==="ACTV"?($t=q.a.host,qt=Kt==="MOVE"?"Move ":"Actv "):Kt==="FITE"||Kt==="ENDT"?qt=Kt==="FITE"?"Fite ":"Done ":qt=Kt+" ??? ",y.lawg(qt,$t," : "+this.lNum(q.weight)+ct)}),y.debug("🧠 ~~~~~~~~~~~~~~ 🧠"),y.debug("▪")):J.key==="FORG"&&(y.debug("🧠 Lane Choices 🧠"),w.filter(q=>q.a.key==="FORG").sort((q,ct)=>ct.weight-q.weight).forEach(q=>{y.lawg("Lane "+q.a.lane+" : "+this.lNum(q.weight)+this.dazzler(q,J,I))}),y.debug("🧠 ~~~~~~~~~~~~~~ 🧠"),y.debug("▪"))),S.sleep(et).then(()=>{v.handleAction(J)})}else this.popProm(k)}dazzler(t,i,r){return t.a===i?" 🏆":t.weight>r?" 🌻":""}actionPruner(t){let i=t.filter(r=>Wi.indexOf(r.key)===-1);return L.mainBattle?i=i.filter(r=>r.key!=="HDSC"):i=i.filter(r=>!this.hasHint(r,"BB")),i=i.filter(r=>{if(this.hasHint(r,"HR")){if(r.zone==="P")return r.playerA!==this.aiPlayer;{const a=m.ddf6(r);return a.owner===this.aiPlayer?a.aiHints().includes("MC"):!0}}else return!0}),i=i.filter(r=>{if(this.hasHint(r,"KL")){const a=m.ddf6(r);return a.owner===this.aiPlayer?a.aiHints().includes("ST"):!0}else return!0}),i=i.filter(r=>this.hasHint(r,"BF")?r.playerA===this.aiPlayer:!0),i=i.filter(r=>this.hasHint(r,"DB")?r.playerA!==this.aiPlayer:!0),i=i.filter(r=>{if(this.hasHint(r,"PN")){if(r.zone==="P")return r.playerA!==this.aiPlayer;{const a=r,c=m.ddf6(a);return c.owner===this.aiPlayer?c.aiHints().includes("MC"):!0}}else return!0}),i=i.filter(r=>{const a=r.key==="FORG";if(a||this.hasHint(r,"FL")){const c=r,f=m.searchByFSA(c);return f&&(L.mainBattle?L.newPre:L.newPost).includes(f.id)?f.aiHints().includes("RT")?!0:a?G.getCard(c.host).aiHints().includes("RD"):!1:!0}else return!0}),i}noHandDoubles(t){const i=[],r=[],a=[];return t.forEach(c=>{c.key==="HPLY"?i.push(c):r.push(c)}),i.forEach(c=>{const f=c.card;a.includes(f)||(a.push(f),r.push(c))}),r}async peeker(t){this.peeking=!0;const i=[],r=[];t.forEach(a=>{Ii.includes(a.key)?r.push(a):i.push({root:a,peek:[a],wasPeek:!1,free:""})}),Ce.saveState();for(let a=0;a0){let k="";if(c.key==="HPLY"){const w=c;w.cost!==""&&(k=w.cost)}i.push({root:c,peek:p,wasPeek:!0,free:k})}Ce.restoreState()}return Ce.popState(),this.peeking=!1,i}peekerReport(t){let i=0,r=0,a=0,c=[],f=[];t.forEach(p=>{const k=p.peek.length;if(k>0){const w=p.root.key;if(w==="HPLY")if(p.peek[0].key==="FORG")r+=k;else{const P=y.fastName(p.root.card)+": "+k;c.push(P)}else if(w==="MOVE")a+=k;else if(w==="ACTV"){const P=y.fastName(p.root.host)+": "+k;f.push(P)}else i+=k}}),y.debug("High complexity hit: Root: "+t.length),r>0&&y.debug("Forges: "+r),a>0&&y.debug("Mobility: "+a),c.forEach(p=>y.debug(p)),f.forEach(p=>y.debug(p)),i>0&&y.debug("Other: "+i)}hintWeight(t){let i=!1,r=!1,a="",c=0;if(t.key==="HPLY"?a=t.card:t.key==="HDSC"?(r=!0,a=t.host):this.hasHint(t,"CD")&&(a=t.card,i=!0),a){const f=G.getCard(a);if(f.level0&&(r?c-=p:c+=p)}}return c}levelBonusFormula(t,i){let r=0;const a=t.aiHints();return a.includes("LG")?(r+=1,a.includes("LM")&&(r+=.8)):a.includes("LB")?r-=1.3:i&&(r+=.4),r}hintAdjuster(t){let i=0;const a=t.aiHints().find(c=>c.startsWith("ZZ"));return a&&(i=.5*parseInt(a.slice(2))),i}hasHint(t,i){return!t.hint||t.hint.length===0?!1:t.hint.includes(i)}logStats(t,i){const a=["Crt Cnt","Crt Val","Threat","P Health"].map((c,f)=>`${c}: ${this.numNum(i[f])}`).join(", ");console.log(t+a)}numNum(t){return t.length>6?t.charAt(0)==="-"?"NUNS":"KILL":t.padEnd(4)}cheater(){return E.aiMode&&E.aiActive&&S.options.cheater?new Ei(this.aiPlayer).cheatin():!1}peekAllCards(){const t=A.toPlayer(this.aiPlayer),i=t.deck.concat(t.hand,t.discard).sort();console.log(i.map(r=>y.fastName(r)).join(` -`))}peekDecks(){const t=A.toPlayer(!1),i=t.deck.map(f=>y.fastName(f)).sort(),r=t.hand.map(f=>y.fastName(f)).sort(),a=t.discard.map(f=>y.fastName(f)).sort(),c=["-- Deck --"].concat(i,"-- Hand --",r,"-- Discard --",a);console.log(c.join(` -`))}}const lt=new $i;class Ui{getState(){const t={cCrd:this.currPlayCard,cCst:this.currPlayCost,cPos:this.currPlayPos,aa:this.actionHistory};return JSON.stringify(t)}setState(t){const i=JSON.parse(t);this.currPlayCard=i.cCrd,this.currPlayCost=i.cCst,this.currPlayPos=i.cPos,this.actionHistory=i.aa}handleAction(t){if(t.key==="DEET"){ie.init(t.param);return}if(t.key==="HPLY"){this.playCardSelect(t);return}if(t.key==="FORG"){L.forgeCard(t,this.currPlayCard,this.currPlayCost,this.currPlayPos);return}if(t.key==="FITE"){mi.fight(t.param==="M");return}if(t.key==="ENDT"){L.endTurn();return}if(t.key==="MOVE"){this.mobilitySelect(t);return}if(t.key==="MEND"){L.mobility(t);return}if(t.key==="HDSC"){this.currPlayCost="",L.cardPlayed(this.currPlayCard,this.currPlayCost,this.currPlayPos,!0),this.actionDone();return}if(t.key==="ACTV"){const i=m.jr5(t.param);G.getCard(i.code).startActivation(i);return}if(t.key==="NOTR"){t.param==="PM"&&mt.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"&&mt.popMode(),this.actionHistory.pop(),this.ddf5();return}if(t.key==="USWP"){mt.popMode(),Lt.whatNext();return}if(t.key==="DTUP"){ie.updateDetails(t),bt.drawAll();return}if(t.key==="VWDK"){At.handleShowDeck(t);return}if(t.key==="SCRK"){At.handleDeckScroll(t);return}if(t.key==="SCRH"){t.param==="R"?E.ui.handScrollLeft+=1:E.ui.handScrollLeft-=1,bt.drawAll();return}if(t.key==="DRFT"){pt.resumeDraft(t.param);return}if(t.key==="SCRD"){pt.paginate(t.param==="D"),bt.drawAll();return}if(t.key==="UIBT"){ei.handleUIButton(t);return}if(t.key==="MENU"){ei.handleMainMenuButton(t);return}if(t.key==="MNBT"){ei.handleMenuButton(t);return}if(t.key==="DSET"){this.ddf5(Pt.generateDeckPickerActions(parseInt(t.param)));return}if(t.key==="DECK"){Pt.handleDeckPick(t.param);return}if(t.key==="DPVW"){Pt.previewDeckPick(t.param);return}if(t.key==="DBUG"){t.param==="AB"&&S.options.debug?y.clearAll():S.toggleDebug();return}}ddf5(t,i=!1){let r;if(t){const a=this.generateDetailActions();r=t.concat(a),this.actionHistory.push(r)}else r=this.actionHistory[this.actionHistory.length-1];E.aiActive?lt.processAction(r,i):bt.drawAll()}currPlayCard="";currPlayCost="";currPlayPos=-1;shiftPlayCard(t){t0&&i.canLevel()&&r.push(D.buttonTarget("HDSC",t.card));const a=D.toActions(r);return a.push(b.handSelectAction("CANC",t.card,"",t.position)),a}mobilitySelect(t){const i=this.getMoveCardActions(t);this.ddf5(i)}getMoveCardActions(t){const i=m.ddf6(t);let r=[];if(t.param==="ACTV"){const a=b.actionTarget("TB","ACTV",i.code,i.id);r=D.toActions(a)}return r.push(b.fieldSelectAction("CANC",t.lane,t.playerA)),m.canMove(i).map(a=>{const c=b.fieldSelectAction("MEND",a,t.playerA);return c.param=i.id,c}).concat(r)}noneEndTrigger(){return D.toActions(D.buttonTarget("NOTR"))[0]}cancelAction(){return D.toActions(D.buttonTarget("CANC"))[0]}emptyAdjacents(t,i){const r=i||t.id,a=b.emptyPlayerActTarg("F","CARD",t.code,r);return a.lanes=t.adjacent,D.toActions(a)}generateDetailActions(){const t=mt.mode;if(E.aiActive)return[];if(t==="G"){const i=A.getLocal().hand.map((a,c)=>{const f=b.handSelectAction("DEET",a,"",c);return f.param=a,f}),r=m.qActiveCreats().map(a=>{const c=b.fieldSelectAction("DEET",a.lane,a.owner);return c.param=a.code,c});return i.concat(r)}else if(t==="D"){const i=pt.currentPack.map((a,c)=>{const f=b.draftSelectAction("DEET",c,!0);return f.param=`${a}1`,f}),r=pt.picksAsDeck.map((a,c)=>{const f=b.draftSelectAction("DEET",c,!1);return f.param=`${a.card}1`,f});return i.concat(r)}return[]}}const v=new Ui;class Vi{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 i=JSON.parse(t);this.type=i.type,this.events=i.events,this.triggerActions=i.tA,this.deathCheck=i.dC,this.iaTrigLane=i.tL}reset(){this.type="N0",this.events=[],this.triggerActions=[],this.deathCheck=!0}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 i;if(t==="N0")i=this.events.slice(),this.events=[];else{const a=this.events.filter(f=>f.code==="DIE"),c=this.events.filter(f=>f.code!=="DIE");t==="C1"?(i=c,this.events=a):(i=a,this.events=c)}const r=this.generateTriggers(i);this.triggerActions=this.sortTriggers(r),Lt.whatNext()}generateTriggers(t){let i;const r=t.map(a=>{a.code==="TRS"&&(i=a);const c=m.field.map(p=>p.triggers.map(k=>{const w=b.triggerReaction(a,k,p.owner,"C");return w.creatId=p.id,w.cardCode=p.code,w}).filter(k=>ii.ddf8(k))).flat(),f=[!0,!1].map(p=>A.toPlayer(p).triggers.map(w=>b.triggerReaction(a,w,p,"P")).filter(w=>ii.ddf8(w))).flat();return c.concat(f)}).flat();return i&&this.handleTurnStart(i),r}sortTriggers(t){const i=A.getActiveB(),r=t.filter(f=>!f.trigger.interactive&&f.owner===i),a=t.filter(f=>!f.trigger.interactive&&f.owner!==i);return t.filter(f=>f.trigger.interactive&&f.owner===i).concat(a,r)}handleTurnStart(t){const i=A.getActiveB();m.qPlayerCreats(i).filter(a=>a.sleeping).forEach(a=>{a.sleeping=!1});const r=E.tick();m.qActiveCreats().forEach(a=>{a.owner===t.playerA&&(a.activationAvailable=!0,a.mobilityAvailable=!0,a.sleeping=!1),a.armorDmg=0,a.poison>0&&a.hurtDirect(a.poison,"POIS",r),a.regen>0&&a.heal(a.regen),V.deathProdder(a,r)}),[A.playerA,A.playerB].forEach(a=>{a.armorDmg=0;const c=A.totalPoison(a);c>0&&A.hurtDirect(a,c,"POIS")})}getNextTrigger(){const t=this.triggerActions;if(t.length!==0)return t[t.length-1]}triggerDone(){this.triggerActions.length===0?console.error("batch.triggerDone() was called when there is no trigger actions"):(this.triggerActions.pop(),this.iaTrigLane=0),Lt.whatNext()}addEvents(...t){this.events.push(...t)}}const x=new Vi;class Oi{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new pi(t)}get(t){return this.registry[t]}}const ht=new Oi;class zi extends F{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 i=this.lValS(["Give an adjacent creature","Each adjacent creature gets","Each other friendly creature gets"]);this.text=`Activate: ${i} 2x attack this turn.`,this.bonus=this.buffNug(this.iAttack,0,"TX")}targ(t){const i=b.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(i.lanes=t.adjacent),i}canActivate(t){return m.creatByTarget(this.targ(t)).length>0}startActivation(t){let i;this.level===1?i=this.targ(t):(i=D.boardTarget("CARD",this.code),i.param=t.id),i.hint=["BB"],v.ddf5(D.toActions([i,D.buttonTarget("CANC")]))}handleAction(t){const i=m.jr5(t.param);if(t.zone==="F"){const r=m.ddf6(t);this.logAct(!0,r),this.applyMod(r)}else{this.logAct(!0);const r=this.targ(i);m.creatByTarget(r).forEach(a=>{this.applyMod(a)})}i.endActivation()}applyMod(t){t.addMod(b.modT("AT",t.attack))}}class Zi extends F{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 ${y.jr9(this.level,this.level,!0)} and Regenerate ${this.level}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("EF");a.bonus=this.buffNug(this.level,this.level,"TW");const c=r.jr4("MV");return c.bonus=this.regnNug(this.level),r}ddf8(t){const i=$.toCreature(t.event);return(i.creature.lane===1||i.creature.lane===5)&&i.creature.owner===t.owner}jr8(t){const i=$.toCreature(t.event);i.creature.buff(this.level,this.level),i.creature.addRegen(this.level),x.triggerDone()}}class Ki extends F{constructor(t){super(t),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 ${y.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){const i=b.crNotMeTarg(t.id);i.player=A.toTarget(t.owner),m.creatByTarget(i).length===0?[b.mod("AT",this.boof4812,t.id),b.mod("AR",this.boof248,t.id)].forEach(a=>{t.addModSafe(a)}):t.removeModSafe(t.id)}}class Yi extends F{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"),this.hints=["ZZ-3"];const i=this.boof101520;this.text=`While ${this.name} is your only friendly creature, you get Armor ${i}, and this gets Armor ${this.level+1} and Mobility 1.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){const i=t.status==="A",r=b.crNotMeTarg(t.id);r.player=A.toTarget(t.owner);const a=m.creatByTarget(r);if(i&&a.length===0){const c=b.mod("AR",this.boof101520,t.id);A.addModSafe(t.owner,c);const f=b.mod("AR",this.level+1,t.id),p=b.mod("MB",1,t.id);t.addModSafe(f),t.addModSafe(p)}else A.removeModSafe(t.owner,t.id),t.removeModSafe(t.id)}}class Be extends F{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)},["LLV"]:{c:()=>this.verC(),t:r=>this.verT(r)}}[t]}testAmbush(t,i){return this.lookup(t).t(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}ddf8(t){return!lt.simOn&&this.testAmbush(this.cardCode(),t)}jr8(t){const i=this.cardCode(),r=A.toPlayer(t.owner),a=r.hand.length;for(let c=a-1;c>-1;c--){const f=r.hand[c];f.startsWith(i)&&(y.lawg(f," Ambushed."),m.birth(f,"S",r.isPlayerA),L.levelAndDiscard(f,c,!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&&L.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 i=$.toCreature(t.event);return t.owner!==i.creature.owner&&A.getActiveB()===i.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 i=$.toEnterField(t.event);return t.owner!==i.creature.owner&&A.getActiveB()===i.creature.owner&&!i.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&&A.getActiveB()===t.event.playerA:!1}verC(){this.faction="U",this.rarity="H",this.name="Leyline Vermin",this.iAttack=this.boof61218,this.iHealth=this.boof358,this.tribe.push("IN"),this.text="Ambush: When an enemy creature with Poison is destroyed on the enemy player's turn, "+this.ambT()}verT(t){if(t.event.code==="DIE"){const i=$.toCreature(t.event);return t.owner!==i.creature.owner&&A.getActiveB()===i.creature.owner&&i.creature.poison>0}else return!1}}class Xi extends F{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,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.bonus=this.rawNug(0,0,0,0,.5,"TW"),a.interactive=!0,r}handleAction(t){L.levelAndDiscardA(t),v.actionDone(!0)}ddf8(t){if(t.event.playerA===t.owner){const i=G.getCard(t.event.cardCode);if(i.type==="S"&&i.faction==="A")return!0}return!1}jr8(t){const i=b.lvlHandActTarg(this.code,t.creatId),r=D.toActions([i,D.buttonTarget("NOTR")]);r.length>1?v.ddf5(r):x.triggerDone()}}class qi extends F{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 i=this.boof;this.text=`While you have over 120 health, Arboris gets ${y.jr9(i,i)}.`}jr3(t,i){const r=super.jr3(t,i);return r.addEffect("PH",this.code),r}enforceEffect(t){if(A.toPlayer(t.owner).health>120&&t.status==="A"){const r=this.boof;t.addModSafe(b.mod("HL",r,t.id)),t.addModSafe(b.mod("MH",r,t.id)),t.addModSafe(b.mod("AT",r,t.id))}else t.removeModSafe(t.id)}get boof(){return this.lValN([4,8,80])}}class ji extends F{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 ${y.dbdtap()}, it gets ${y.jr9(this.level,this.level)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.buffNug(this.level,this.level,"TP"),r}ddf8(t){const i=$.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcCreat.owner===t.owner}jr8(t){const i=$.toDamage(t.event);this.logAct(!1,i.srcCreat),i.srcCreat.buff(this.level,this.level),x.triggerDone()}}class Ie extends F{constructor(t){super(t),this.rarity="H",this.iAttack=this.level+2,this.iHealth=this.iAttack;const i=this.cardCode();i==="SFA"?this.steel():i==="RFA"?this.root():i==="HFA"?this.hell():i==="SGA"&&this.storm(),this.text=`Forge: ${this.name} gets ${y.jr9(this.level,this.level)} for each ${y.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,i){const r=super.jr3(t,i);return r.jr4("FR"),r}jr8(t){const i=b.target("TH");i.player=A.toTarget(t.owner),i.faction=this.faction;const r=D.deckByTarget(i).length;if(r>0){const a=$.toEnterField(t.event),c=r*this.level;a.creature.buff(c,c)}x.triggerDone()}}class K extends F{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["COZ"]:()=>this.cooze(),["DFM"]:()=>this.dfmimic(),["DZA"]:()=>this.dozer(),["EWF"]:()=>this.woof(),["FWG"]:()=>this.feywing(),["FRH"]:()=>this.hulk(),["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 i=this.cardCode();this.imgKey=i,this.minLevel=this.level,this.maxLevel=this.level,this.lookup(i)()}image(t){return this.rawImage(this.imgKey,t)}static fgoc(t){return "FGO"+t}fixedNekSpirit(t){this.faction="N",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.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=K.minionBuff(this.level),this.plont(),this.name=K.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=K.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.iAttack=t,this.plont(),this.name=K.minionName(1),this.imgKey="SDL",this.hints=["RT"]}fixedTreefolk(t){this.iAttack=t,this.plont(),this.name=K.minionName(3),this.imgKey="TFK"}tfFight(){this.iAttack=this.boof91421,this.plont(),this.name=K.minionName(3),this.imgKey="TFK"}static bee(t){return "KBE"+t}dfmimic(){this.faction="U",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=9,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")}woof(){this.faction="U",this.name="Ether Wolf",this.tribe.push("ST","WF"),this.iHealth=5,this.iAttack=6,this.imgKey="EWV"}static zomc(t){return "ZMB"+t}zimus(){this.faction="N",this.name="Zimus, the Returned",this.tribe.push("ZB"),this.iAttack=10,this.iHealth=5,this.imgKey=`${"ZTU"}2`}zomb(t,i){this.faction="N",this.name="Zombie",this.tribe.push("ZB"),this.iAttack=t,this.iHealth=i,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)}hulk(){this.faction="T",this.name="Frost Hulk",this.iAttack=9,this.iHealth=9,this.tribe.push("IC","EL")}}class nt 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()},["CCC"]:{c:()=>this.ccalC(),z:()=>this.ccalZ()},["COD"]:{c:()=>this.chontC(),z:()=>this.chontZ()},["CEX"]:{c:()=>this.cypeC(),z:()=>this.cypeZ()},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ()},["DFS"]:{c:()=>this.defsC(),z:()=>this.defsZ()},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ()},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ()},["EWV"]:{c:()=>this.ewolC(),z:()=>this.ewolZ()},["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()},["ROU"]:{c:()=>this.riteC(),z:()=>this.riteZ()},["ROE"]:{c:()=>this.roteC(),z:()=>this.roteZ()},["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 i=this.cardCode();return i==="NSH"||i==="PHC"?this.leveledImage(t):this.fixedImage(t)}playTargets(){const t=super.playTargets();return this.cardCode()==="ABE"&&this.aeSides().some(i=>i.length===0)||t.push(D.boardTarget("CARD",this.code)),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),v.spellCast()}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;m.ddf1().forEach(i=>{i.addArmor(t)})}aeSides(){return[m.qPlayerCreats(!0),m.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(),i=E.tick();let r=[];t.forEach(p=>{if(p.length>1){let k=[],w=-999999;p.forEach(P=>{P.attack>w?(w=P.attack,r.push(...k),k=[P]):P.attack===w?k.push(P):r.push(P)}),k.length>1&&(k.splice(S.randInt(0,k.length),1),r.push(...k))}}),r.forEach(p=>V.destroy(p,this.code,i));const a=A.getActive(),c=v.playPosition(),f=a.hand.length;for(let p=f-1;p>-1;p--)p!==c&&(a.discard.push(a.hand[p]),a.hand.splice(p,1),v.shiftPlayCard(p))}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 ${y.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;m.ddf1().forEach(i=>{i.addMod(b.modT("AT",t)),i.extraBattles+=1})}ccalC(){this.faction="N",this.rarity="H",this.name="Cercee's Call",this.maxLevel=2,this.free=this.level===2,this.text="Spawn a copy of a friendly Zombie that was destroyed this turn."}ccalZ(){const t=A.getActiveB(),r=(t?L.deathsA:L.deathsB).filter(c=>{const f=G.getCard(c);return f.type==="C"&&f.isTribe("ZB")}),a=r.length;a>0&&m.birth(r[S.randInt(0,a)],"S",t)}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=A.getActive().rank,i=E.tick();m.qEnemyCreats().forEach(r=>{r.hurtDirect(t,this.code,i)})}get cyb(){return this.lValN([5,6,10])}cypeC(){this.faction="A",this.rarity="H",this.name="Cypien Experimentation";const t=this.cyb;this.text=`Give a random friendly creature ${y.jr9(t,0)}. Give a random friendly creature Armor ${t}`}cypeZ(){const t=m.ddf1(),i=t.length;if(i>0){const r=this.cyb,a=t[S.randInt(0,i)],c=t[S.randInt(0,i)];this.logAct(!1,a,c),a.buff(r,0),c.addArmor(r)}}dcurC(){this.faction="N",this.rarity="R",this.name="Death Current";const t=this.lValS(["a level 2 or lower","an","two"]);this.text=`Destroy ${t} enemy creature at random.`}dcurZ(){const t=b.crEnemyTarg();t.level=D.ddf2(this.level+1);const i=m.creatByTarget(t),r=i.length;if(r>0){const a=S.randInt(0,r),c=E.tick();V.destroy(i[a],this.code,c),this.level===3&&r>1&&(i.splice(a,1),V.destroy(i[S.randInt(0,r-1)],this.code,c))}}defsC(){this.faction="A",this.rarity="C",this.name="Defense Spire",this.overload=!0,this.maxLevel=1,this.text="Each friendly creature gets Armor 6 this turn."}defsZ(){m.ddf1().forEach(t=>{t.addMod(b.modT("AR",6))})}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${y.jr9(this.boof4812n,0)} this turn.`}digiZ(){const t=this.boof4812n;m.qEnemyCreats().forEach(i=>{i.addMod(b.modT("AT",t))})}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${y.jr9(t,t)}.`}epiZ(){const t=this.boof246n,i=b.crEnemyTarg();m.creatByTarget(i).forEach(r=>{r.buff(t,t)})}ewolC(){this.faction="U",this.rarity="C",this.name="Ether Wolves",this.maxLevel=1,this.overload=!0,this.hints=["ZZ-3"],this.text="Spawn two Ether Wolves."}ewolZ(){const t=E.tick(),i="EWF"+"1",r=A.getActiveB();m.birth(i,"S",r,void 0,t),m.birth(i,"S",r,void 0,t)}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${y.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;m.ddf1().forEach(i=>{i.buff(t,t),this.level===3&&(i.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,i=E.tick();m.qActiveCreats().forEach(r=>{r.hurtDirect(t,this.code,i)})}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${y.jr9(-1*t,0)}. Each friendly creature gets ${y.jr9(t,0)}.`}mealZ(){const t=this.boof234,i=A.getActiveB();m.qActiveCreats().forEach(r=>{const a=r.owner===i?t:-1*t;r.buff(a,0)})}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${y.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,i=b.crFriendTarg();m.creatByTarget(i).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 ${y.jr9(t,t,!0)} and Regenerate ${this.level}.`}infvZ(){const t=this.boof246,i=b.crFriendTarg();i.lanes=[1,5],m.creatByTarget(i).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;m.qEnemyCreats().forEach(i=>{i.addPoison(t)})}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=G.getCard(this.ndc());this.text=`Spawn a ${y.tokName(t)}.`}shriekZ(){m.birth(this.ndc(),"S",A.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;m.qEnemyCreats().forEach(i=>{i.addPoison(t)})}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${y.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)m.ddf1().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;m.ddf1().forEach(i=>{i.buff(t,0)})}}palwC(){this.faction="A",this.rarity="R",this.name="Palladium Wave",this.maxLevel=1,this.text=`Each enemy creature gets ${y.jr9(-1,0).replaceAll("1","X")}, where X is two times your rank.`}palwZ(){const t=-2*A.getActive().rank;m.qEnemyCreats().forEach(i=>{i.buff(t,0)})}pcallC(){this.faction="T",this.rarity="L",this.name="Phoenix Call";const t=G.getCard(this.cpc());this.text=`Spawn a ${y.tokName(t)}.`}pcallZ(){m.birth(this.cpc(),"S",A.getActiveB())}cpc(){return "CYP"+this.level}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=G.getCard(K.minionCode(this.level));this.text=`Put a ${y.tokName(t)} into each players available lanes.`}phyZ(){const t=K.minionCode(this.level),i=E.tick();[!0,!1].forEach(r=>{m.emptyLanes(r).forEach(a=>{m.birth(t,"P",r,a,i)})})}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,i=E.tick(),r=m.qEnemyCreats();m.ddf1().forEach(a=>{r.forEach(c=>{c.hurtDirect(t,a.code,i)})})}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=E.tick(),i=b.crFriendTarg();i.faction="T",m.creatByTarget(i).forEach(r=>{r.buff(1,0);const a=r.opposed;a&&a.hurtDirect(r.attack,r.code,t)})}riteC(){this.faction="N",this.rarity="C",this.name="Rite of Undeath",this.text=`Each friendly creature gets Regenerate ${this.boof468}.`}riteZ(){const t=this.boof468;m.ddf1().forEach(i=>{i.addRegen(t)})}roteC(){this.faction="T",this.rarity="H",this.name="Ritual of the Elements",this.maxLevel=1,this.hints=["ZZ-1"],this.text="Spawn a Lava Golem, Frost Hulk, or Lightning Titan at random."}roteZ(){const t=["FRH"+"1","LVG"+"1","LTT"+"1"];m.birth(t[S.randInt(0,3)],"S",A.getActiveB())}stsC(){this.faction="U",this.rarity="C",this.name="Scatter the Seeds";const t=G.getCard(K.minionCode(this.level));this.text=`Spawn three ${y.tokName(t)}s.`}stsZ(){const t=K.minionCode(this.level),i=E.tick();[1,2,3].forEach(r=>{m.birth(t,"S",A.getActiveB(),void 0,i)})}get spboof(){return(this.level+1)*-2}pulseC(){this.faction="A",this.rarity="H",this.name="Sonic Pulse",this.text=`Each enemy creature gets ${y.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;m.qEnemyCreats().forEach(i=>{i.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;m.ddf1().forEach(i=>{i.heal(t)})}beesC(){this.faction="U",this.rarity="H",this.name="Stinging Invocation";const t=G.getCard(K.bee(this.level));this.text=`Spawn one to three ${y.tokName(t)}s.`}beesZ(){const t=K.bee(this.level),i=E.tick(),r=S.randInt(2,5);[1,2,3].every(a=>a{r.addMod(b.modT("AT",t))})}turnbC(){this.faction="T",this.rarity="H",this.name="Turnabout",this.free=this.level===3;const t=this.boof235;this.text=`Each creature gets ${y.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,i=-1*t;m.qActiveCreats().forEach(r=>{r.addMod(b.modT("AT",t)),r.addMod(b.modT("HL",i)),r.addMod(b.modT("MH",i))})}verdC(){this.faction="U",this.rarity="H",this.name="Verdant Charge";const t=this.verdb;this.text=`Each friendly creature gets ${y.jr9(t,t,!0)} and Regenerate ${t}.`}verdZ(){const t=this.verdb;m.ddf1().forEach(i=>{i.buff(t,t),i.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 ${y.jr9(1,1).replaceAll("1","X")}, where X is your rank.`}wdenZ(){const t=A.getActive().rank;m.ddf1().forEach(i=>{i.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(i=>{const r=A.toPlayer(i);r.effects=[],r.mods=[],r.triggers=r.triggers.filter(a=>a.customCode==="AB"||a.type==="NT"),r.poison=0,r.armor=0});const t=m.qActiveCreats();t.forEach(i=>{i.preWipe()}),t.forEach(i=>{i.wipeAll()})}}class Ji extends F{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=this.rawNug(0,0,0,0,.5,"TW")}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){const i=this.buddies(t.id);i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.emptySloots(m.jr5(i[1]),m.ddf6(t).id);r.push(v.cancelAction()),v.ddf5(r)}else{const r=m.jr5(i[2]);this.logAct(!0,r),r.move(t.lane),m.jr5(i[1]).endActivation()}}emptySloots(t,i=""){return v.emptyAdjacents(t,S.enTil("P2",t.id,i))}buddies(t){return D.toActions(b.crFriendNotMeActTarg("CARD",t,this.code,S.enTil("P1",t)))}}class Qi extends F{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 i=this.boof357;this.text=`Upgrade Dinosaur: Replace Bron with a level ${this.level} Dino Knight.~When this ${y.dbdtap()}, heal ${i} damage from each other friendly creature.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("UP");const a=r.jr4("DM");return a.bonus=this.buffNug(0,this.boof357,"TP"),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")&&m.birth("DNK"+this.level,"R",r.owner,r.lane)}else if(t.trigger.type==="DM"){const i=this.boof357,r=b.crNotMeTarg(t.creatId);r.player=A.toTarget(t.owner),m.creatByTarget(r).forEach(c=>c.heal(i))}x.triggerDone()}}class _i extends F{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,i){const r=super.jr3(t,i);return r.jr4("PT"),r}ddf8(t){return t.event.playerA===t.owner}jr8(t){const i=m.creatByTr(t);i.addMod(b.modT("AR",this.boof2510)),i.addMod(b.modT("DF",!0)),x.triggerDone()}}class tr extends kt{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Bulwark 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 i=b.crFriendActTarg("CARD",this.code,"P1");i.hasArmor=!0,t.push(i)}return t}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.enemyTargActions(m.ddf6(t).id);r.push(v.cancelAction()),v.ddf5(r)}else{const r=m.jr5(i[1]);this.logSpell(r),m.ddf6(t).hurtDirect(r.armor*this.level,this.code),v.spellCast()}}enemyTargActions(t=""){const i=b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(i)}}class er extends F{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} ${y.dbdtac(this.level)}, destroy it.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}ddf8(t){const i=$.toDamage(t.event);return i.battle&&i.isCreatSrc&&i.isCreatTarg&&i.srcId===t.creatId&&D.levelTestCommon(i.hurtCreat.level,this.level)}jr8(t){if(t.trigger.type==="FR"&&L.allied("N")){const i=m.creatByTr(t),r=i.jr4("DM");r.bonus=this.avgSpawnNug(),i.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 ir extends F{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 i=this.level===4?`When ${this.name} ${y.dbdtap()}, deal damamge to that player equal to their health.~`:"";this.text=i+`When ${this.name} ${y.dbdtac(this.level)}, destroy that creature.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return this.level===4?a.bonus=this.rawNug(0,0,0,0,5,"TP"):a.bonus=this.avgSpawnNug(),r}ddf8(t){const i=$.toDamage(t.event);if(i.battle&&i.isCreatSrc&&i.srcId===t.creatId){if(this.level===4)return!0;if(i.isCreatTarg){const r=i.hurtCreat;return D.levelTestCommon(r.level,this.level)}}return!1}jr8(t){const i=$.toDamage(t.event);if(i.isCreatTarg){const r=i.hurtCreat;r.status==="A"&&V.destroy(r,this.code)}else A.hurtDirect(i.hurtPlayer,i.hurtPlayer.health,this.code);x.triggerDone()}}class oe extends kt{lookup(t){return{["ABL"]:{c:()=>this.ablC(),z:r=>this.ablZ(r)},["DYB"]:{c:()=>this.drybC(),z:r=>this.drybZ(r)},["FVA"]:{c:()=>this.fervassC(),z:r=>this.fervassZ(r)},["ROG"]:{c:()=>this.rotgC(),z:r=>this.rotgZ(r)},["SPG"]:{c:()=>this.spgrC(),z:r=>this.spgrZ(r)},["TOB"]:{c:()=>this.blightC(),z:r=>this.blightZ(r)},["ULG"]:{c:()=>this.ulegC(),z:r=>this.ulegZ(r)},["VOB"]:{c:()=>this.vobC(),z:r=>this.vobZ(r)},["WGE"]:{c:()=>this.weguC(),z:r=>this.weguZ(r)}}[t]}cardCast(t,i){this.lookup(t).z(i)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=b.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(this.playTarg),t}handleAction(t){const i=m.ddf6(t);this.logSpell(this.xl?i:void 0),this.cardCast(this.cardCode(),i),v.spellCast()}ddf8(t){const i=Nt.extractCardCode(t.trigger.logicCode);if(i==="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((i==="ABL"||i==="VOB"||i==="WGE")&&t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId}else if(i==="DYB"&&t.trigger.type==="EF"){const r=$.toEnterField(t.event);return t.trigger.creatId!==r.creature.id&&r.creature.owner===t.owner}else{if(i==="SPG"&&t.trigger.type==="TS")return t.event.playerA===t.owner;if(i==="ROG"&&t.trigger.type==="DS"||i==="WGE"&&t.trigger.type==="PT"||i==="ULG"&&t.trigger.type==="VN"||i==="FVA"&&t.trigger.type==="FK")return!0}return!1}jr8(t){const i=Nt.extractCardCode(t.trigger.logicCode);if(i==="TOB"){const r=t.event,a=m.jr5(r.target);a.status==="A"&&V.destroy(a,this.code)}else if(i==="FVA"){const r=m.creatByTr(t),a=m.searchByLane(m.oppositeLane(r.lane),!r.owner);a&&a.hurtDirect(this.boof3612,r.code)}else if(i==="ROG"||i==="DYB"||i==="ABL"){const r=m.creatByTr(t);r.status==="A"&&(this.logAct(!1,r),r.buff(this.level,this.level))}else if(i==="VOB"){const r=$.toDamage(t.event);r.srcCreat.hurtDirect(r.dmg,this.code)}else if(i==="SPG"){const r=m.creatByTr(t),a=this.boof246;this.logAct(!1,r),r.buff(a,a)}else if(i==="WGE"){if(t.trigger.type==="DM")A.heal(t.owner,t.event.dmg,this.code);else if(t.trigger.type==="PT"){const r=t.trigger.customCode,a=m.creatByTr(t);a.triggers.filter(f=>f.customCode===r).forEach(f=>a.removeTrigger(f))}}else if(i==="ULG"){const r=m.birth(m.creatByTr(t).code,"S",t.owner);r&&this.logAct(!1,r)}else super.jr8(t);x.triggerDone()}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${y.dbdtap()}, it gets ${y.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}ablZ(t){t.changed=!0;const i=t.jr4("DM",this.code);i.bonus=this.buffNug(this.level,this.level,"TP")}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${y.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${y.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}drybZ(t){t.buff(this.level,this.level),t.changed=!0;const i=t.jr4("EF",this.code);i.bonus=this.buffNug(this.level,this.level,"TS")}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 i=t.jr4("FK",this.code);i.bonus=this.buffNug(this.boof3612,0)}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 ${y.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0;const i=t.jr4("DS",this.code);i.bonus=this.buffNug(this.level,this.level,"TS")}spgrC(){this.faction="U",this.rarity="R",this.name="Shardplate Graft";const t=this.boof246;this.text=`Give a creature ${y.jr9(t,t,!0)}, and "At the start of your turn, this gets ${y.jr9(t,t)}."`,this.playTarg.hint=["BF"]}spgrZ(t){const i=this.boof246;t.buff(i,i),t.changed=!0;const r=t.jr4("TS",this.code);r.bonus=this.buffNug(i,i,"TS")}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${y.dbdtac(this.level)}, destroy that creature."`,this.playTarg.hint=["BF"],this.level<3&&(this.hints=["LG"])}blightZ(t){t.changed=!0;const i=t.jr4("DM",this.code);i.bonus=this.avgSpawnNug()}ulegC(){this.faction="N",this.rarity="H",this.name="Undying Legacy",this.text='Give a friendly creature "Vengeace: Spawn a copy of this."',this.playTarg.player="F",this.maxLevel=1,this.overload=!0}ulegZ(t){t.changed=!0;const i=t.jr4("VN",this.code),r=G.getCard(t.code);t.hints.push("ST"),i.bonus=this.spawnNug(r)}vobC(){this.faction="T",this.rarity="R",this.name="Violent Outburst",this.level===3?this.free=!0:this.hints=["LG"],this.text=`Give a ${y.levelGateText(this.level+1)}creature Aggressive and, "When this creature ${y.dbdtap()}, it also deals that much damage to itself."`}vobZ(t){t.aggressive=!0;const i=t.jr4("DM",this.code);i.changes=!0}weguC(){this.faction="U",this.rarity="H",this.name="Wegu's Embrace";const t=this.boof3510;this.text=`Give a friendly creature ${y.jr9(t,t)}, and "When this deals ${y.dbdtap()} this turn, you gain that much health."`,this.playTarg.player="F"}weguZ(t){const i=E.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=i;const a=t.jr4("PT",this.code);a.customCode=i;const c=this.boof3510;t.buff(c,c)}}class yt extends F{lookup(t){return{["ASQ"]:{c:()=>this.asqC(),a:(r,a)=>this.asqA(r,a),t:r=>this.asqT(r)},["BSW"]:{c:()=>this.bswC(),a:(r,a)=>this.bswA(r,a),t:r=>this.bswT(r)},["CCS"]:{c:()=>this.ccsC(),a:(r,a)=>this.ccsA(r,a),t:r=>this.ccsT(r)},["CGL"]:{c:()=>this.clordC(),a:(r,a)=>this.clordA(r,a),t:r=>this.clordT(r)},["CSH"]:{c:()=>this.cswC(),a:(r,a)=>this.cswA(r,a),t:r=>this.cswT(r)},["FFU"]:{c:()=>this.ffuC(),a:(r,a)=>this.ffuA(r,a),t:r=>this.ffuT(r)},["FFS"]:{c:()=>this.ffsC(),a:(r,a)=>this.ffsA(r,a),t:r=>this.ffsT(r)},["FSH"]:{c:()=>this.fssC(),a:(r,a)=>this.fssA(r,a),t:r=>this.fssT(r)},["KOD"]:{c:()=>this.kodC(),a:(r,a)=>this.kodA(r,a),t:r=>this.kodT(r)},["LOD"]:{c:()=>this.lashC(),a:(r,a)=>this.lashA(r,a),t:r=>this.lashT(r)},["MBP"]:{c:()=>this.mbpC(),a:(r,a)=>this.mbpA(r,a),t:r=>this.mbpT(r)},["MND"]:{c:()=>this.mndC(),a:(r,a)=>this.mndA(r,a),t:r=>this.mndT(r)},["NCS"]:{c:()=>this.ncsC(),a:(r,a)=>this.ncsA(r,a),t:r=>this.ncsT(r)},["NFF"]:{c:()=>this.nffC(),a:(r,a)=>this.nffA(r,a),t:r=>this.nffT(r)},["OHV"]:{c:()=>this.orghC(),a:(r,a)=>this.orghA(r,a),t:r=>this.orghT(r)},["PPM"]:{c:()=>this.ppmC(),a:(r,a)=>this.ppmA(r,a),t:r=>this.ppmT(r)},["PSC"]:{c:()=>this.pcoilC(),a:(r,a)=>this.pcoilA(r,a),t:r=>this.pcoilT(r)},["SGF"]:{c:()=>this.siggyC(),a:(r,a)=>this.siggyA(r,a),t:r=>this.siggyT(r)},["SRM"]:{c:()=>this.srmdC(),a:(r,a)=>this.srmdA(r,a),t:r=>this.srmdT(r)},["SFG"]:{c:()=>this.sfgdC(),a:(r,a)=>this.sfgdA(r,a),t:r=>this.sfgdT(r)},["SSA"]:{c:()=>this.ssaC(),a:(r,a)=>this.ssaA(r,a),t:r=>this.ssaT(r)},["SWM"]:{c:()=>this.swmC(),a:(r,a)=>this.swmA(r,a),t:r=>this.swmT(r)},["UCM"]:{c:()=>this.ucmC(),a:(r,a)=>this.ucmA(r,a),t:r=>this.ucmT(r)},["UIM"]:{c:()=>this.uimC(),a:(r,a)=>this.uimA(r,a),t:r=>this.uimT(r)},["WMR"]:{c:()=>this.warmC(),a:(r,a)=>this.warmA(r,a),t:r=>this.warmT(r)},["WWR"]:{c:()=>this.wwrC(),a:(r,a)=>this.wwrA(r,a),t:r=>this.wwrT(r)},["WFS"]:{c:()=>this.wfsC(),a:(r,a)=>this.wfsA(r,a),t:r=>this.wfsT(r)},["XSH"]:{c:()=>this.shambC(),a:(r,a)=>this.shambA(r,a),t:r=>this.shambT(r)},["ZPM"]:{c:()=>this.zpmC(),a:(r,a)=>this.zpmA(r,a),t:r=>this.zpmT(r)}}[t]}targAction(t,i,r){this.lookup(t).a(i,r)}actTargets(t,i){return this.lookup(t).t(i)}xl=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i);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 i=D.toActions([this.actTargets(this.cardCode(),t),D.buttonTarget("CANC")]);v.ddf5(i)}handleAction(t){const i=m.ddf6(t),r=m.jr5(t.param);this.logAct(!0,this.xl?i:void 0),this.targAction(this.cardCode(),i,r),r.endActivation()}makeCreatTarg(t){return b.crActTarg("CARD",this.code,t.id)}makeOtherCreatTarg(t){const i=this.makeCreatTarg(t);return i.notMe=t.id,i}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")m.birth(m.jr5(t.event.creatId).code,"S",t.owner),x.triggerDone();else if(t.trigger.type==="PT"){const i=t.trigger.customCode,r=m.creatByTr(t);r.triggers.filter(c=>c.customCode===i).forEach(c=>r.removeTrigger(c)),x.triggerDone()}else t.trigger.type==="TS"&&(this.addExtraActivate(m.creatByTr(t)),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=this.multNug(this.buffNug(t[0],t[1],"TS"),.7)}asqT(t){const i=this.makeCreatTarg(t);return i.tribe="WB",i}asqA(t,i){i.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=this.buffNug(0,t,"TX")}bswT(t){const i=this.makeCreatTarg(t);return i.hint=["HR"],i}bswA(t,i){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=this.regnNug(t,"TW")}ccsT(t){const i=this.makeOtherCreatTarg(t);return i.canRegen=!0,i.hint=["BF"],i}ccsA(t,i){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=this.multNug(this.avgSpawnNug(),.3),this.bonus.threat="TX"}clordT(t){const i=this.makeCreatTarg(t);return i.player="F",i.tribe="AB",i}clordA(t,i){V.destroy(t,this.code),L.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=this.regnNug(t,"TW")}cswT(t){const i=this.makeCreatTarg(t);return i.canArmor=!0,i.hint=["BF"],i}cswA(t,i){t.addMod(b.modT("AR",this.boof246))}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=this.buffNug(0,this.iAttack,"TX")}ffuT(t){const i=this.makeCreatTarg(t);return i.hint=["HR"],t.attack<1&&(i.victims="???"),i}ffuA(t,i){t.hurtDirect(i.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 ${y.jr9(this.iAttack,0)} this turn.`,this.bonus=this.buffNug(this.iAttack,0,"TW")}ffsT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["BF"],i}ffsA(t,i){t.addMod(b.modT("AT",this.iAttack))}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 ${y.levelGateText(this.level)}creature Aggressive.`,this.bonus=this.regnNug(1,"TX")}fssT(t){const i=this.makeCreatTarg(t);return i.level=D.ddf2(this.level),i.lanes=t.adjacent,i.player="F",i}fssA(t,i){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 ${y.levelGateText(this.level)}creature gets "Vengeance: Spawn this" this turn.`,this.bonus=this.rawNug(0,0,0,0,.5,"TX")}kodT(t){const i=this.makeOtherCreatTarg(t);return i.level=D.ddf2(this.level),i.player="F",i}kodA(t,i){const r=t.jr4("VN",this.code);r.customCode=i.id,r.changes=!0;const a=t.jr4("PT",this.code);a.customCode=i.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=this.rawNug(0,0,0,0,.1,"TW")}lashT(t){const i=this.makeCreatTarg(t);return i.player="E",i.hasPoison=!0,i.canDefender=!0,i}lashA(t,i){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 ${y.jr9(0,t)}.`,this.bonus=this.buffNug(0,t,"TW")}mbpT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["BF"],i}mbpA(t,i){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 ${y.jr9(t,0)}.`,this.bonus=this.buffNug(t,0,"TX")}mndT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["BF"],i}mndA(t,i){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 ${y.jr9(t,t)}.`,this.bonus=this.buffNug(t,t-3,"TS")}ncsT(t){const i=this.makeOtherCreatTarg(t);return i.player="F",i}ncsA(t,i){const r=this.boof248;t.hurtDirect(3,this.code),i.buff(r,r)}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(K.tffc(this.level));this.text=`Activate: Replace a friendly Plant with a ${y.tokName(t)}.`,this.bonus=this.multNug(this.spawnNug(t,"TX"),.5)}nffT(t){const i=this.makeCreatTarg(t);return i.player="F",i.tribe="PL",i}nffA(t,i){m.birth(K.tffc(this.level),"R",i.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 ${y.levelGateText(this.level)}creature.`,this.bonus=this.multNug(this.avgSpawnNug(),.4),this.bonus.threat="TX"}orghT(t){const i=this.makeOtherCreatTarg(t);return i.level=D.ddf2(this.level),i.hint=["KL"],i}orghA(t,i){const r=E.tick();V.destroy(t,this.code,r),V.destroy(i,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 ${y.jr9(this.boof4812n,0)} this turn.`,this.bonus=this.buffNug(this.boof246,0,"TW")}ppmT(t){const i=this.makeCreatTarg(t);return i.hint=["DB","DF"],i}ppmA(t,i){t.addMod(b.modT("AT",this.boof4812n))}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=this.regnNug(t,"TX")}pcoilT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["PN","DF"],i}pcoilA(t,i){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=this.playerNug(t,"TW")}siggyT(t){const i=this.makeOtherCreatTarg(t);return i.player="F",i}siggyA(t,i){V.destroy(t,this.code);const r=this.boof4812;A.hurtDirect(!i.owner,r,this.code),A.heal(i.owner,r,this.code)}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=this.multNug(this.avgSpawnNug(),.4),this.bonus.threat="TX"}srmdT(t){const i=this.makeCreatTarg(t);return i.player="E",i.maxAttack=this.iAttack,i}srmdA(t,i){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=this.playerNug(5,"TW")}sfgdT(t){const i=this.makeOtherCreatTarg(t);return i.cardCode="SFG",this.level===3&&(i.level="L3"),i}sfgdA(t,i){const r=E.tick();V.destroy(t,this.code,r),V.destroy(i,this.code,r);const a=this.lValS(["SFG"+"2","SFG"+"3","FGO"+"1"]);m.birth(a,"S",i.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 ${y.jr9(t,t)}.`,this.bonus=this.buffNug(-t,0,"TX")}ssaT(t){const i=this.makeCreatTarg(t);return i.hint=["DB","BB"],i}ssaA(t,i){const r=this.boof246n,a=E.tick();i.hurtDirect(-r,this.code,a),t.buff(r,r,a)}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=this.regnNug(this.level,"TW")}swmT(t){const i=this.makeOtherCreatTarg(t);return i.canArmor=!0,i.hint=["BF","BB"],i}swmA(t,i){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=this.buffNug(0,t,"TW")}ucmT(t){const i=this.makeCreatTarg(t);return i.hint=["HR"],i}ucmA(t,i){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 from a creature this turn.",this.bonus=this.regnNug(1,"TW")}uimT(t){const i=this.makeCreatTarg(t);return i.hasDefender=!0,i.hint=["BB"],i}uimA(t,i){t.addMod(b.modT("ND",!0))}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 ${y.jr9(this.iAttack,t)}.`,this.bonus=this.multNug(this.buffNug(this.iAttack,t,"TX"),.5)}warmT(t){const i=this.makeCreatTarg(t);return i.lanes=3,i.hint=["BF","BB"],i}warmA(t,i){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 ${y.jr9(this.level,this.level)}.`,this.bonus=this.buffNug(this.level,this.level,"TW")}wwrT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["BF"],i}wwrA(t,i){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 ${y.jr9(-t,-t)} this turn.`,this.bonus=this.buffNug(t,t,"TX")}wfsT(t){const i=this.makeCreatTarg(t);return i.hint=["DB","DF"],i}wfsA(t,i){const r=-this.boof357;t.addMod(b.modT("AT",r)),t.addMod(b.modT("HL",r)),t.addMod(b.modT("MH",r))}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=this.rawNug(0,0,0,0,this.lValN([.6,1.2,2.2]),"TS")}shambT(t){const i=b.crFriendActTarg("CARD",this.code,t.id);return i.lanes=t.adjacent,i}shambA(t,i){const r=t.attack,a=t.health;V.destroy(t,this.code),i.move(t.lane),i.buff(r,a)}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 ${y.levelGateText(this.level)}creature Mobility ${this.level}.`,this.bonus=this.regnNug(this.level,"TW")}zpmT(t){const i=this.makeOtherCreatTarg(t);return i.level=D.ddf2(this.level),i.canMove=!0,i.hint=["BF","BB"],i}zpmA(t,i){t.addMobility(this.level)}}class Qe extends F{lookup(t){return{["CMF"]:{c:()=>this.aconC(),f:(r,a)=>this.aconF(r,a)},["FLH"]:{c:()=>this.flhC(),f:(r,a)=>this.flhF(r,a)},["TBB"]:{c:()=>this.tbbC(),f:(r,a)=>this.tbbF(r,a)}}[t]}targAction(t,i,r){this.lookup(t).f(i,r)}playTarg;optional=!1;notme=!1;ftext="";constructor(t){super(t),this.playTarg=b.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("AS");return a.interactive=!0,r}handleAction(t){this.targAction(this.cardCode(),m.ddf6(t),m.jr5(t.param)),v.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const i=D.toActions(this.playTarg);i.length>0?(i.forEach(r=>{r.param=t.creatId}),this.optional&&i.push(v.noneEndTrigger()),v.ddf5(i)):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 ${y.jr9(t,t)}.`}aconF(t,i){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,i){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 ${y.levelGateText(this.level)}creature to the space opposing ${this.name}.`}tbbF(t,i){i.opposed||(this.logAct(!1,t),t.move(m.oppositeLane(i.lane)))}}class ft extends F{lookup(t){return{["ABM"]:{c:()=>this.mawC(),f:(r,a)=>this.mawF(r,a)},["AGC"]:{c:()=>this.aconC(),f:(r,a)=>this.aconF(r,a)},["BTI"]:{c:()=>this.binvC(),f:(r,a)=>this.binvF(r,a)},["BSR"]:{c:()=>this.bsrC(),f:(r,a)=>this.bsrF(r,a)},["BAW"]:{c:()=>this.bawC(),f:(r,a)=>this.bawF(r,a)},["CKB"]:{c:()=>this.cacC(),f:(r,a)=>this.cacF(r,a)},["CHA"]:{c:()=>this.chaC(),f:(r,a)=>this.chaF(r,a)},["CCR"]:{c:()=>this.ccC(),f:(r,a)=>this.ccF(r,a)},["DRS"]:{c:()=>this.drsC(),f:(r,a)=>this.drsF(r,a)},["DSE"]:{c:()=>this.dseC(),f:(r,a)=>this.dseF(r,a)},["DSA"]:{c:()=>this.dsaC(),f:(r,a)=>this.dsaF(r,a)},["DGS"]:{c:()=>this.drslC(),f:(r,a)=>this.drslF(r,a)},["FRI"]:{c:()=>this.friC(),f:(r,a)=>this.friF(r,a)},["FRV"]:{c:()=>this.freavC(),f:(r,a)=>this.freavF(r,a)},["FLC"]:{c:()=>this.flcC(),f:(r,a)=>this.flcF(r,a)},["GLF"]:{c:()=>this.gfiendC(),f:(r,a)=>this.gfiendF(r,a)},["GRW"]:{c:()=>this.grwC(),f:(r,a)=>this.grwF(r,a)},["GHT"]:{c:()=>this.grhC(),f:(r,a)=>this.grhF(r,a)},["MMH"]:{c:()=>this.houndC(),f:(r,a)=>this.houndF(r,a)},["MXW"]:{c:()=>this.mtxC(),f:(r,a)=>this.mtxF(r,a)},["NGB"]:{c:()=>this.ngbC(),f:(r,a)=>this.ngbF(r,a)},["POA"]:{c:()=>this.poaC(),f:(r,a)=>this.poaF(r,a)},["PHS"]:{c:()=>this.phxsC(),f:(r,a)=>this.phxsF(r,a)},["RWD"]:{c:()=>this.rotC(),f:(r,a)=>this.rotF(r,a)},["SHY"]:{c:()=>this.schyC(),f:(r,a)=>this.schyF(r,a)},["STD"]:{c:()=>this.stdC(),f:(r,a)=>this.stdF(r,a)},["SIX"]:{c:()=>this.sdxC(),f:(r,a)=>this.sdxF(r,a)},["SEV"]:{c:()=>this.surzC(),f:(r,a)=>this.surzF(r,a)},["VNF"]:{c:()=>this.vnfC(),f:(r,a)=>this.vnfF(r,a)},["WBY"]:{c:()=>this.wbyC(),f:(r,a)=>this.wbyF(r,a)},["WBU"]:{c:()=>this.wbuC(),f:(r,a)=>this.wbuF(r,a)},["XDH"]:{c:()=>this.dogsC(),f:(r,a)=>this.dogsF(r,a)}}[t]}targAction(t,i,r){this.lookup(t).f(i,r)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=b.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}jr3(t,i){const r=super.jr3(t,i);if(this.forges){const a=r.jr4("FR");a.interactive=!0}return r}ddf8(t){return Nt.extractCardCode(t.trigger.logicCode)==="CKB"}handleAction(t){this.targAction(this.cardCode(),m.ddf6(t),m.jr5(t.param)),v.actionDone(!0)}jr8(t){const i=this.cardCode();if(t.trigger.type==="TS"&&i==="CKB"){this.logAct(!1),L.regularPlays+=1;const a=t.event,c=A.toPlayer(a.playerA),f=b.trigIdx(c.triggers,t.trigger);f>-1&&c.triggers.splice(f,1),x.triggerDone();return}if(i==="ABM"){const a=b.crFriendNotMeTarg(t.creatId);if(a.tribe="AB",m.creatByTarget(a).length===0){x.triggerDone();return}}if(i==="POA"&&!L.patron("A")){x.triggerDone();return}if((i==="DRS"||i==="DSE"||i==="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(a=>{a.param=t.creatId}),this.optional&&r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}dfbuff(t){const i=b.crFriendNotMeTarg(t);return i.tribe="DF",this.boof234*m.creatByTarget(i).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 ${y.jr9(t,t)}.`}mawF(t,i){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,i){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 ${y.jr9(-this.iAttack,0)}.`}binvF(t,i){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 ${y.levelGateText(t)}creature.`,this.optional=!0}else this.hints=["LG"]}bsrF(t,i){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,i){this.logAct(!1,t),t.addMod(b.modT("BT",!0))}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 ${y.levelGateText(this.level)}creature. If you do, the enemy player may play an additional card next turn.`,this.optional=!0}cacF(t,i){V.destroy(t,this.code),A.toPlayer(t.owner).triggers.push(b.trigger("TS",this.code))}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,i){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,i){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 ${y.jr9(0,t)} for each other friendly Darkforged.`}drsF(t,i){this.logAct(!1,t),t.buff(0,this.dfbuff(i.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 ${y.jr9(t,0)} for each other friendly Darkforged.`}dseF(t,i){this.logAct(!1,t),t.buff(this.dfbuff(i.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,i){t.hurtDirect(this.dfbuff(i.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 ${y.levelGateText(this.level)}Dragon.`}drslF(t,i){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,i){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 ${y.levelGateText(t)}enemy creature.`,this.optional=!0}else this.hints=["LG"]}freavF(t,i){V.destroy(t,this.code)}flcC(){this.faction="A",this.rarity="L",this.name="Frontline Combatant",this.iAttack=this.boof4612,this.iHealth=this.iAttack,this.iArmor=this.iAttack,this.tribe.push("HM"),this.optional=!0,this.playTarg.player="E",this.ftext=`You may have ${this.name} deal damage equal to its Armor to an enemy creature. If you do, that creature deals damage equal to its attack back to ${this.name}.`}flcF(t,i){const r=E.tick(),a=t.attack;t.hurtDirect(i.armor,this.code,r),i.hurtDirect(a,t.code,r)}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 ${y.jr9(t,t)}.`,this.optional=!0}gfiendF(t,i){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,i){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 ${y.jr9(t,t)}.`}grhF(t,i){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,i){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 ${y.jr9(t,0)}.`}mtxF(t,i){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 ${y.jr9(0,t)}.`}ngbF(t,i){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 ${y.levelGateText(this.level)}creature 2x attack.`}poaF(t,i){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 ${y.jr9(t,t)}.`}phxsF(t,i){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,i){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,i){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,i){this.logAct(!1,t);const r=t.regen;t.negateRegen=!0,i.addRegen(r)}sdxC(){this.faction="A",this.rarity="R",this.name="Stasis Indexer",this.iAttack=this.boof369,this.iHealth=this.boof71118,this.tribe.push("MM"),this.playTarg.level=D.ddf2(this.level),this.playTarg.canDefender=!0,this.ftext=`Give a ${y.levelGateText(this.level)}creature Defender until the end of the enemy player's next turn.`}sdxF(t,i){const r=b.mod("DF",!0);r.expiry="EN",t.addMod(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 ${y.levelGateText(this.level)}creature. If you do, spawn a copy of it.`}surzF(t,i){const r=E.tick();V.destroy(t,this.code,r),m.birth(t.code,"S",i.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,i){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 ${y.levelGateText(this.level)}enemy creature with Defender.`,this.optional=!0}wbyF(t,i){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 ${y.jr9(t,0)} this turn.`}wbuF(t,i){this.logAct(!1,t),t.addMod(b.modT("AT",this.boof4812))}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 ${y.jr9(-4,-4)}.`}dogsF(t,i){this.logAct(!1,t),t.buff(-4,-4)}}class W 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)},["AVB"]:{c:()=>this.anvbC(),z:r=>this.anvbZ(r)},["AQE"]:{c:()=>this.aqatC(),z:r=>this.aqatZ(r)},["AOP"]:{c:()=>this.armoC(),z:r=>this.armoZ(r)},["BFT"]:{c:()=>this.bftC(),z:r=>this.bftZ(r)},["BZH"]:{c:()=>this.bzhC(),z:r=>this.bzhZ(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)},["BLP"]:{c:()=>this.btpC(),z:r=>this.btpZ(r)},["CHT"]:{c:()=>this.chatC(),z:r=>this.chatZ(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)},["DPO"]:{c:()=>this.dpsC(),z:r=>this.dpsZ(r)},["DDF"]:{c:()=>this.dendC(),z:r=>this.dendZ(r)},["DBT"]:{c:()=>this.dreadC(),z:r=>this.dreadZ(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)},["FOR"]:{c:()=>this.fitrC(),z:r=>this.fitrZ(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)},["MMY"]:{c:()=>this.maggyC(),z:r=>this.maggyZ(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)},["RPR"]:{c:()=>this.rpsC(),z:r=>this.rpsZ(r)},["SAP"]:{c:()=>this.sapC(),z:r=>this.sapZ(r)},["SVO"]:{c:()=>this.soathC(),z:r=>this.soathZ(r)},["SOC"]:{c:()=>this.scythC(),z:r=>this.scythZ(r)},["SOA"]:{c:()=>this.soaC(),z:r=>this.soaZ(r)},["SOD"]:{c:()=>this.sodC(),z:r=>this.sodZ(r)},["SOT"]:{c:()=>this.sotC(),z:r=>this.sotZ(r)},["SHG"]:{c:()=>this.shgrC(),z:r=>this.shgrZ(r)},["SNB"]:{c:()=>this.snbC(),z:r=>this.snbZ(r)},["SHV"]:{c:()=>this.sharvC(),z:r=>this.sharvZ(r)},["SRP"]:{c:()=>this.sreapC(),z:r=>this.sreapZ(r)},["STR"]:{c:()=>this.sttorC(),z:r=>this.sttorZ(r)},["STO"]:{c:()=>this.sptorC(),z:r=>this.sptorZ(r)},["SOV"]:{c:()=>this.sovC(),z:r=>this.sovZ(r)},["STN"]:{c:()=>this.stbrnC(),z:r=>this.stbrnZ(r)},["STP"]:{c:()=>this.ssperC(),z:r=>this.ssperZ(r)},["SIN"]:{c:()=>this.sinC(),z:r=>this.sinZ(r)},["TGL"]:{c:()=>this.tanglC(),z:r=>this.tanglZ(r)},["TPT"]:{c:()=>this.tpactC(),z:r=>this.tpactZ(r)},["TUP"]:{c:()=>this.tugC(),z:r=>this.tugZ(r)},["TOT"]:{c:()=>this.totsC(),z:r=>this.totsZ(r)},["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)},["VTR"]:{c:()=>this.vrshC(),z:r=>this.vrshZ(r)},["VGL"]:{c:()=>this.vglchC(),z:r=>this.vglchZ(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,i){this.lookup(t).z(i)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=b.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets(),i=this.cardCode();return i==="NSL"&&m.ddf1().length<5||(i==="FOR"&&(this.playTarg.lanes=m.ddf1().filter(r=>r.opposed).map(r=>r.lane)),t.push(this.playTarg)),t}handleAction(t){const i=m.ddf6(t);this.logSpell(this.xl?i:void 0),this.cardCast(this.cardCode(),i),v.spellCast()}ddf8(t){const i=Nt.extractCardCode(t.trigger.logicCode);if(i==="OEX"&&t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId}else if((i==="FZS"||i==="IFR")&&t.trigger.type==="DM"){const r=t.event;if(r.isCreatTarg&&r.target===t.creatId)return!0}else if(i==="NDY"&&t.trigger.type==="DS"||i==="SHG"&&(t.trigger.type==="PT"||t.trigger.type==="VN")||(i==="IFR"||i==="OEX")&&t.trigger.type==="PT")return!0;return!1}jr8(t){const i=Nt.extractCardCode(t.trigger.logicCode);if(i==="FZS"||i==="IFR"&&t.trigger.type==="DM"){const r=m.creatByTr(t);r.status==="A"&&V.destroy(r,this.code)}else if(i==="SHG"){if(t.trigger.type==="VN")m.birth(m.jr5(t.event.creatId).code,"S",t.owner);else if(t.trigger.type==="PT"){const r=t.trigger.customCode,a=m.creatByTr(t);a.triggers.filter(f=>f.customCode===r).forEach(f=>a.removeTrigger(f))}}else if(i==="IFR"&&t.trigger.type==="PT"){const r=S.deTil(t.trigger.customCode),a=r[1],c=m.creatByTr(t);if(r[0]==="P2"){const f=b.trigIdx(c.triggers,t.trigger);c.triggers[f].customCode=S.enTil("P1",a)}else{const f=c.triggers.find(p=>p.customCode===a);f&&c.removeTrigger(f),c.removeTrigger(t.trigger)}}else if(i==="OEX"){if(t.trigger.type==="DM"){const r=t.event,a=m.qEnemyCreats(),c=a.length,f=E.tick();let p;c>0&&(this.level===1?p=[a[S.randInt(0,c)]]:this.level===2?(p=a.splice(S.randInt(0,c),1),a.length>0&&p.push(a[S.randInt(0,c-1)])):p=a,p.forEach(k=>k.hurtDirect(r.dmg,this.code,f)))}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,a=m.creatByTr(t);a.triggers.filter(f=>f.customCode===r).forEach(f=>a.removeTrigger(f))}}else if(i==="NDY"){const r=m.creatByTr(t);if(r.status==="A"){const a=this.ndcbuf;this.logAct(!1,r),r.buff(a,a)}}else super.jr8(t);x.triggerDone()}rankT(){return`If you are rank ${this.level+1} or higher`}icaf(t){return`. If that creature is ${y.factionText(t)}, `}formFun(t){if(!(t.lane===1||t.lane===5)){const i=b.crTarg();i.player=A.toTarget(t.owner),i.lanes=t.adjacent;const r=m.creatByTarget(i);if(r.length===2)return r}return[]}awingC(){this.faction="A",this.rarity="R",this.name="Aegis Wings",this.text=`Give a creature ${y.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 i=t.attack;m.qActiveCreats().every(r=>r.attack<=i)&&(t.addMobility(1),t.addArmor(this.boof246))}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.free=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 ${y.jr9(-this.boof4816,0)}.~You may play an additional ${this.name} this turn.`}anatZ(t){t.buff(-this.boof4816,0);const i=L.freeCard(this.code);i.condition.cardCode="ATZ"}anvbC(){this.faction="A",this.rarity="T",this.name="Anvilbreaker",this.free=!0,this.maxLevel=1,this.playTarg.player="E",this.text=`Give an enemy creature ${y.jr9(-2,0)}, then move it to another available lane at random.`}anvbZ(t){t.buff(-2,0),m.fling(t)}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${y.jr9(0,this.boof51015)}.`,this.playTarg.hint=["BF"]}aqatZ(t){t.buff(0,this.boof51015)}armoC(){this.faction="A",this.rarity="R",this.name="Armory Outpost",this.playTarg.player="F";const t=y.jr9(this.boof4610,0);this.text=`Give a friendly creature ${t}. If it is in Formation, give the adjacent creatures ${t} as well.`}armoZ(t){const i=this.boof4610;this.formFun(t).concat(t).forEach(r=>r.buff(i,0))}bftC(){this.faction="N",this.rarity="C",this.name="Bitterfrost Totem";const t=this.boof4812n;this.playTarg.hint=["DB"],this.text=`Give a creature ${y.jr9(t,t)}. ${this.rankT()}, it gets an additional ${y.jr9(-2,-2)}.`}bftZ(t){const i=this.boof4812n-(A.getActive().rank>this.level?2:0);t.buff(i,i)}get bhos(){return this.lValN([6,9,20])}bzhC(){this.faction="T",this.rarity="H",this.name="Blazing Hostility";const t=this.bhos;this.playTarg.player="E",this.text=`Deal ${t} damage to an enemy creature${this.icaf("N")}deal ${t} damage to the enemy player as well.`}bzhZ(t){const i=this.bhos;t.hurtDirect(i,this.code),t.faction==="N"&&A.hurtDirect(t.owner,i,this.code)}blod(){return L.deathsA.length>0||L.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 i=this.boof234;t.addArmor(i),this.blod()&&t.addArmor(i)}bbdC(){this.faction="N",this.rarity="C",this.name="Blood Bindings";const t=this.boof369n,i=y.jr9(t,t);this.text=`Give a creature ${i}.~If a creature was destroyed this turn, it gets an additional ${i}.`,this.playTarg.hint=["DB"]}bbdZ(t){const i=this.boof369n;t.buff(i,i),this.blod()&&t.buff(i,i)}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 i=this.lValN([5,6,10]),r=E.tick();t.hurtDirect(i,this.code,r),this.blod()&&t.hurtDirect(i,this.code,r)}bbnC(){this.faction="U",this.rarity="C",this.name="Blood Boon";const t=this.lValN([3,4,7]),i=y.jr9(t,t);this.text=`Give a creature ${i}.~If a creature was destroyed this turn, it gets an additional ${i}.`,this.playTarg.hint=["BF"]}bbnZ(t){const i=this.lValN([3,4,7]);t.buff(i,i),this.blod()&&t.buff(i,i)}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.xl=!1,this.text=`Replace an enemy ${y.levelGateText(this.level)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=D.ddf2(this.level),this.level<3&&(this.hints=["LG"])}botZ(t){m.birth(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}btpC(){this.faction="U",this.rarity="H",this.name="Bottomless Puncture",this.playTarg.player="E",this.text=`Give an enemy creature Poison ${this.boof369}${this.icaf("T")}give the enemy player Poison ${this.level} as well.`}btpZ(t){t.addPoison(this.boof369),t.faction==="T"&&(A.toPlayer(t.owner).poison+=this.level)}chatC(){this.faction="T",this.rarity="R",this.name="Chaos Twister",this.playTarg.player="E";const t=`eal ${this.twist} damage to `;this.text=`D${t}an enemy creature. If it is in Formation, d${t}the adjacent creatures as well.`}chatZ(t){const i=this.twist,r=E.tick();this.formFun(t).concat(t).forEach(a=>a.hurtDirect(i,this.code,r))}get twist(){return this.lValN([6,8,10])}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.free=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof123n;this.text=`Give a creature ${y.jr9(t,t)}.`,this.playTarg.hint=["DB"]}csurgeZ(t){const i=this.boof123n;t.buff(i,i)}ctmsC(){this.faction="A",this.rarity="R",this.name="Countermeasure";const t=this.boof4816;this.text=`Give an enemy creature ${y.jr9(-t,0)}, or give a friendly creature ${y.jr9(t,0)}.`}ctmsZ(t){const i=this.boof4816;t.owner===A.getActiveB()?t.buff(i,0):t.buff(-i,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"],this.level<3&&(this.hints=["LG"])}cullZ(t){V.destroy(t,this.code)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate",this.xl=!1;const t=G.getCard(K.tffc(this.level));this.text=`Replace a friendly Plant with a ${y.tokName(t)}.`,this.playTarg.player="F",this.playTarg.tribe="PL",this.level<3&&(this.hints=["LG"])}cultZ(t){m.birth(K.tffc(this.level),"R",t.owner,t.lane)}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.free=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof246;this.text=`Give a creature in a center lane ${y.jr9(t,t)}.`,this.playTarg.lanes=3,this.playTarg.hint=["BF"]}cypaZ(t){const i=this.boof246;t.buff(i,i)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${y.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)}dpsC(){this.faction="N",this.rarity="H",this.name="Death's Possession";const t=this.boof4812;this.playTarg.maxAttack=t,this.text=`Destroy a creature with ${t} or less attack${this.icaf("A")}Spawn a copy of it.`}dpsZ(t){V.destroy(t,this.code),t.faction==="A"&&m.birth(t.code,"S",A.getActiveB())}dendC(){this.faction="U",this.rarity="R",this.name="Dendrify",this.xl=!1,this.level===3&&(this.free=!0,this.overload=!0),this.text=`Replace a ${y.levelGateText(this.level+1)}creature with a 7/7 Treefolk.`,this.playTarg.level=D.ddf2(this.level+1)}dendZ(t){m.birth(`${"SXT"}${this.level}`,"R",t.owner,t.lane)}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.xl=!1,this.level<3&&(this.hints=["LG"]),this.text=`Destroy a ${y.levelGateText(this.level)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"]}dreadZ(t){V.destroy(t,this.code)}dyinC(){this.faction="U",this.rarity="T",this.name="Dysian Infusion",this.playTarg.hint=["BF"];const t=this.boof135,i=this.boof4710;this.text=`Give a creature ${y.jr9(i,i)} and Regenerate ${t}.`}dyinZ(t){const i=this.boof4710;t.buff(i,i),t.addRegen(this.boof135)}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.free=this.level===3,this.text=`Give a ${y.levelGateText(this.level)}creature Defender.`,this.playTarg.canDefender=!0,this.playTarg.level=D.ddf2(this.level),this.level<3&&(this.hints=["LG"])}enpZ(t){t.defender=!0}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${y.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 ${y.jr9(t,t)}.`,this.playTarg.hint=["BF"]}rageZ(t){const i=this.boof3612;t.buff(i,i)}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===A.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 ${y.levelGateText(this.level+1)}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 i=t.attack;V.destroy(t,this.code),A.hurtDirect("E",i,this.code),this.level===3&&A.heal("F",i,this.code)}fitrC(){this.faction="T",this.rarity="C",this.name="Fit of Rage",this.maxLevel=1,this.overload=!0,this.playTarg.player="F",this.text="Give a friendly creature +attack equal to the creature opposing it this turn."}fitrZ(t){t.addMod(b.modT("AT",t.opposed?.attack||0))}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 ${y.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"]}feralZ(t){const i=this.fiboof;t.breakthrough=!0,t.buff(i,i)}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),A.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 i=this.boof579;t.hurtDirect(i,this.code),A.hurtDirect("E",i,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){t.addMod(b.modT("AR",this.boof51020))}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 ${y.levelGateText(this.level)}creature "When this is dealt damage, destroy it".`,this.level<3&&(this.hints=["LG"])}frozZ(t){t.changed=!0;const i=t.jr4("DM",this.code);i.bonus=this.avgSpawnNug()}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${y.jr9(t,t)}.`,this.playTarg.hint=["DB"]}ghastZ(t){const i=-this.boof3612;t.buff(i,i)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.xl=!1,this.free=this.level>1,this.free||(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 i=t.health;V.destroy(t,this.code),this.level===3&&A.hurtDirect(t.owner,i,this.code)}hartC(){this.faction="A",this.rarity="C",this.name="Heavy Artillery",this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}izftC(){this.faction="T",this.rarity="T",this.name="Iztek's Frost",this.free=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 ${y.levelGateText(this.level+1)}creature "When this is dealt damage, destroy it".`,this.level===1&&(this.hints=["LG"])}izftZ(t){const i=E.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=i,r.bonus=this.avgSpawnNug();const a=t.jr4("PT",this.code);a.customCode=S.enTil("P2",i)}jpC(){this.faction="A",this.rarity="C",this.name="Jet Pack",this.playTarg.hint=["BF"],this.text=`Give a creature ${y.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 ${y.levelGateText(this.level+1)}creature ${y.jr9(this.boof124,0)} and Aggressive this turn.`,this.level===1&&(this.hints=["LG"])}lbrandZ(t){t.addMod(b.modT("AT",this.boof124)),t.addMod(b.modT("AG",!0))}shartC(){this.faction="U",this.rarity="R",this.name="Lysian Shard",this.overload=!0,this.maxLevel=1,this.hints=["ZZ-1"],this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(6,6)}.`}shartZ(t){t.buff(6,6)}maggyC(){this.faction="T",this.rarity="T",this.name="Magmify",this.maxLevel=2,this.level===1?this.hints=["LG"]:this.free=!0,this.playTarg.player="F",this.text="Set a friendly creatures attack equal to its health."}maggyZ(t){const i=t.health-t.attack;i!==0&&t.buff(i,0)}morphC(){this.faction="U",this.rarity="H",this.name="Metamorphosis",this.xl=!1,this.text=`Replace a ${y.levelGateText(this.level)}creature with a 0/3 Feywing Chrysalis.`,this.playTarg.level=D.ddf2(this.level),this.level<3&&(this.hints=["LG"])}morphZ(t){m.birth(`${"FWC"}1`,"R",t.owner,t.lane)}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.level===3?this.free=!0:this.hints=["LG"],this.playTarg.level=D.ddf2(this.level+1),this.text=`Remove all abilities from a ${y.levelGateText(this.level+1)}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 ${y.levelGateText(this.level)}creature ${y.jr9(-this.boof51015,0)} and remove all abilities from it.`,this.playTarg.hint=["DB"],this.level<3&&(this.hints=["LG"])}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 ${y.levelGateText(this.level)}creature.`,this.playTarg.level=D.ddf2(this.level),this.playTarg.hint=["KL"],this.level<3&&(this.hints=["LG"])}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 ${y.jr9(t,t)}.~You may play an additional ${this.name} this turn.`,this.playTarg.hint=["DB"]}nflayZ(t){const i=-this.boof3711;t.buff(i,i);const r=L.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 ${y.jr9(t,t)}."`,this.playTarg.hint=["DB"]}ntdcZ(t){t.changed=!0;const i=t.jr4("DS",this.code),r=this.ndcbuf;i.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 ${y.jr9(5,0)}.~Allied Tempys: This turn, when that creature ${y.dbdtap()}, deal that much damage to ${t}.`}oexpZ(t){if(t.buff(5,0),L.allied("T")){const i=E.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=i;const a=t.jr4("PT",this.code);a.customCode=i}}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 i=A.getActive().rank>this.level?1:0;t.addArmor(this.boof246+i)}pwtorC(){this.faction="A",this.rarity="R",this.name="Power Torrent",this.free=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.free=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${y.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 ${y.jr9(this.boof71116,0)} this turn.`}pslamZ(t){t.addMod(b.modT("AT",this.boof71116))}pummC(){this.faction="A",this.rarity="R",this.name="Pummel Pack";const t=this.boof236,i=`${y.jr9(t,0)} and Armor ${t}.`;this.text=`Give a friendly creature ${i}~If it is the only friendly creature, it gets an additional ${i}`,this.playTarg.player="F"}pummZ(t){const i=this.boof236;t.buff(i,0),t.addArmor(i),m.ddf1().length===1&&(t.buff(i,0),t.addArmor(i))}get dennis(){return this.lValN([-3,-9,-25])}rpsC(){this.faction="A",this.rarity="H",this.name="Repress",this.playTarg.player="E",this.text=`Give an enemy creature ${y.jr9(this.dennis,0)}.${this.icaf("U")}remove all abilities from it.`}rpsZ(t){t.buff(this.dennis,0),t.faction==="U"&&t.wipeAll()}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=D.ddf2(this.level),this.text=`Reduce a ${y.levelGateText(this.level)}creature's attack to 0.`,this.playTarg.hint=["DB"],this.level<3&&(this.hints=["LG"])}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 ${y.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"],this.playTarg.faction="U"}soathZ(t){const i=this.saboof;t.buff(i,i),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 ${y.jr9(-t,0)}. Give a friendly creature ${y.jr9(t,0)} for each enemy creature.`}scythZ(t){const i=-this.boof246,r=m.qEnemyCreats();r.forEach(a=>{a.buff(i,0)}),r.length>0&&t.buff(-i*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 ${y.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 ${y.jr9(t,t)}.`}sodZ(t){const i=this.derpboof;t.buff(i,i)}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 ${y.jr9(t,t)}.`}sotZ(t){const i=this.tars;t.buff(i,i)}get tars(){return this.lValN([-2,-8,-16])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.free=this.level===3,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.player="F",this.text=`Give a ${y.levelGateText(this.level+1)}friendly creature "Vengeance: Spawn this" this turn.`,this.level===1&&(this.hints=["LG"])}shgrZ(t){const i=E.genId(),r=t.jr4("VN",this.code);r.customCode=i,r.changes=!0;const a=t.jr4("PT",this.code);a.customCode=i}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){const i=this.level*m.ddf1().length;t.buff(i,i)}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 ${y.jr9(this.snbboof,0)}.`,this.level<3&&(this.hints=["LB"])}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",this.level<3&&(this.hints=["LG"])}sharvZ(t){if(V.destroy(t,this.code),this.level===1){const i=L.freeCard(this.code);i.condition.level=D.ddf2(1)}else L.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,this.level<3&&(this.hints=["LG"])}sreapZ(t){V.destroy(t,this.code),m.birth(t.code,"S",!t.owner)}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.free=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.free=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 ${y.levelGateText(this.level+1)}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 ${y.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hint=["BF"],this.playTarg.hasDefender=!0}stbrnZ(t){const i=this.boof579;t.buff(i,i),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 i=L.freeCard(this.code);i.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 ${y.levelGateText(this.level+1)}creature with Mobility.${t}`,this.playTarg.level=D.ddf2(this.level+1),this.playTarg.hasMobility=!0,this.level===1&&(this.hints=["LG"])}tanglZ(t){V.destroy(t,this.code),this.level===3&&A.heal("F",t.attack,this.code)}tpactC(){this.faction="N",this.rarity="C",this.name="Tarsian Pact";const t=this.boof235;this.text=`Give a Nekrium creature ${y.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.hint=["BF"],this.playTarg.faction="N"}tpactZ(t){const i=this.boof235;t.buff(i,i),t.addRegen(i)}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.playTarg.hint=["BF"],this.text=`Give a Robot ${y.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.free=!0;const t=-this.boof7911;this.text=`Give an enemy creature ${y.jr9(-1,-1)}.~If that creature is opposing a friendly Duskmaw, give that creature ${y.jr9(t,t)} instead.`,this.playTarg.player="E"}totsZ(t){const i=this.duskBof(t);t.buff(i,i)}duskBof(t){const i=t.opposed;let r=!1;return i&&(r=Nt.extractCardCode(i.code)==="DTD"),r?-this.boof7911:-1}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 ${y.jr9(t,t)}.`}txbnZ(t){const i=this.boof357;t.owner===A.getActiveB()?t.buff(i,i):t.addPoison(i)}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 ${y.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 i=b.mod("DF",!0);i.expiry="EN",t.addMod(i)}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 ${y.jr9(t,t)}. ${this.rankT()}, it gets an additional ${y.jr9(2,2)}.`}urstZ(t){const i=this.boof3711+(A.getActive().rank>this.level?2:0);t.buff(i,i)}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 i=L.freeCard(this.code);i.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 i=this.boof246;m.creatByTarget(b.crFriendNotMeTarg(t.id)).forEach(r=>{r.heal(i)})}vrdsC(){this.faction="U",this.rarity="C",this.name="Verdant Sphere";const t=this.boof5812;this.text=`Give a creature ${y.jr9(0,t)} and you gain ${t} health.`,this.playTarg.hint=["BF"]}vrdsZ(t){const i=this.boof5812;t.buff(0,i),A.heal(A.getActive(),i,this.code)}vrshC(){this.faction="U",this.rarity="R",this.name="Victory Rush";const t=this.level+3,i=y.jr9(t,t);this.text=`Give a friendly creature ${i}. If a Raid occured this turn, give it an additional ${i}.`,this.playTarg.player="F"}vrshZ(t){const i=(this.level+3)*(L.ffs>2?2:1);t.buff(i,i)}vglchC(){this.faction="N",this.rarity="R",this.name="Vigor Leech";const t=this.boof369n;this.text=`Give an enemy creature ${y.jr9(t,t)}, or give a friendly creature Regenerate ${-t}.`}vglchZ(t){const i=this.boof369n;t.owner===A.getActiveB()?t.addRegen(-i):t.buff(i,i)}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace",this.playTarg.hint=["DB"];const t=this.boof468,i=-t;this.text=`Give a creature ${y.jr9(i,i)}.~You gain ${t} health.`}vembZ(t){const i=this.boof468,r=-i;t.buff(r,r),A.heal(A.getActive(),i,this.code)}warC(){this.faction="A",this.rarity="H",this.name="Warmonger Mod";let t=this.level,i=3;this.level===1&&(this.playTarg.level="LN",i=2,t=2),this.playTarg.hint=["BF"],this.text=`Give a ${y.levelGateText(i)}creature ${t}x attack.`}warZ(t){const i=this.level===3?2:1;t.buff(t.attack*i,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,this.level<3&&(this.hints=["LG"])}xwillZ(t){V.destroy(t,this.code);const i=L.freeCard(this.code);i.condition.tribe="ZB"}}class rr extends F{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Crux, Metamind Rogue",this.iAttack=this.lValN([7,12,17]),this.iHealth=this.boof4812,this.tribe.push("MM"),this.hints=["RD"],this.text=`Forge: If Crux is your only friendly creature, it gets Armor ${this.level+2}.~Upgrade: Give an enemy creature ${y.jr9(-this.iHealth,0)}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("UP");return a.interactive=!0,r}handleAction(t){const i=m.ddf6(t);i.buff(-this.iHealth,0),this.logAct(!1,i),v.actionDone(!0)}jr8(t){if(t.trigger.type==="UP"){const i=D.toActions(b.crEnemyActTarg("CARD",this.code,""));i.length===0?x.triggerDone():v.ddf5(i)}else if(t.trigger.type==="FR"){const i=m.creatByTarget(b.crFriendTarg());i.length===1&&i[0].addArmor(this.level+2),x.triggerDone()}}}class sr extends F{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,i){const r=super.jr3(t,i),a=r.jr4("FK");return a.bonus=this.playerNug(this.iAttack,"TX"),r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const r=$.toCreature(t.event).creature,a=r.opposed;a?a.hurtDirect(r.attack,this.code):A.hurtDirect(!r.owner,r.attack,this.code),x.triggerDone()}}class Ht extends F{lookup(t){return{["BOF"]:{c:()=>this.bofC(),d:(r,a)=>this.bofD(r,a)},["CTM"]:{c:()=>this.ctmC(),d:(r,a)=>this.ctmR(r,a)},["DFB"]:{c:()=>this.dfbC(),d:(r,a)=>this.dfbD(r,a)},["GGB"]:{c:()=>this.ggbC(),d:(r,a)=>this.ggbD(r,a)},["GGD"]:{c:()=>this.ggdC(),d:(r,a)=>this.ggdD(r,a)},["GGR"]:{c:()=>this.ggdrC(),d:(r,a)=>this.ggdrD(r,a)},["GGP"]:{c:()=>this.ggpC(),d:(r,a)=>this.ggpD(r,a)},["GGW"]:{c:()=>this.ggwC(),d:(r,a)=>this.ggwD(r,a)},["MHR"]:{c:()=>this.mhermC(),d:(r,a)=>this.mhermD(r,a)},["NGT"]:{c:()=>this.ngauntC(),d:(r,a)=>this.ngauntD(r,a)},["SRH"]:{c:()=>this.sharvC(),d:(r,a)=>this.sharvD(r,a)},["SPR"]:{c:()=>this.sprC(),d:(r,a)=>this.sprD(r,a)},["YNS"]:{c:()=>this.yuruC(),d:(r,a)=>this.yuruD(r,a)}}[t]}trigB;creatDied(t,i){this.lookup(t).d(i,$.toCreature(i.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DS");return a.bonus=this.trigB,r}ddf8(t){return!0}jr8(t){this.creatDied(this.cardCode(),t),x.triggerDone()}friendTribeTest(t,i,r){return i.id===t.id||t.owner===i.owner&&t.isTribe(r)&&Ht.itDiedFirst(t.id,i.id)}bofC(){this.faction="N",this.rarity="C",this.name="Bride of Frankenbaum",this.iAttack=this.boof5813,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.hints=["ZZ-1"];const t=this.boof234;this.text=`When a friendly Abomination is destroyed, you gain ${t} health.`,this.trigB=this.playerNug(t*2,"TW")}bofD(t,i){const r=m.creatByTr(t),a=i.creature;this.friendTribeTest(a,r,"AB")&&(this.logAct(!1,a),A.heal(r.owner,this.boof234,this.code))}ctmC(){this.faction="N",this.rarity="L",this.name="Cyrus, the Merciless",this.iAttack=this.boof359,this.iHealth=this.iAttack+1,this.tribe.push("GG"),this.text=`Formation: Destroy each other creature with ${this.boof579} or less attack.~Whenever a creature is destroyed, Cyrus gets ${y.jr9(1,1)}.`,this.trigB=this.buffNug(2,2,"TS")}ctmR(t,i){m.creatByTr(t).buff(1,1)}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,"TX")}dfbD(t,i){const r=m.creatByTr(t),a=i.creature;this.friendTribeTest(a,r,"AB")&&A.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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(this.level,this.level,"TW")}ggbD(t,i){const r=m.creatByTr(t),a=i.creature;if(this.friendTribeTest(a,r,"DF")){const c=a.opposed;if(c){const f=-this.level;c.buff(f,f),this.logAct(!1,c)}}}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.text=`When a creature is destroyed, ${this.name} gets ${y.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level,"TS"),2)}ggdD(t,i){m.creatByTr(t).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 ${y.jr9(t,t)}. Then give the opposing creature ${y.jr9(-t,-t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),2)}ggdrD(t,i){const r=m.creatByTr(t),a=i.creature;if(a.owner===r.owner&&r.id!==a.id&&Ht.itDiedFirst(a.id,r.id)&&!m.searchByLane(a.lane,a.owner)){const f=this.doomb;r.move(a.lane),r.buff(f,f);const p=r.opposed;p&&(this.logAct(!1,p),p.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");const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS")}ggpD(t,i){if(i.creature.owner!==t.owner){const r=m.creatByTr(t),a=m.oppositeLane(r.lane);if(i.creature.lane===a){const c=this.boof246;r.buff(c,c),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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS")}ggwD(t,i){if(i.creature.owner===t.owner){const r=m.creatByTr(t);if(r.adjacent.includes(i.creature.lane)){const a=this.boof234;r.buff(a,a),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 ${y.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),2)}mhermD(t,i){if(i.creature.poison>0){const r=m.creatByTr(t);if(r.status==="A"){const a=this.boof124;this.logAct(!1,i.creature),r.buff(a,a)}}}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,"TS")}ngauntD(t,i){m.creatByTr(t).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,ut.dcWeight)}sharvD(t,i){const r=i.creature;r.owner===t.owner&&r.isTribe("AB")&&A.getActiveB()===t.owner&&Ht.itDiedFirst(r.id,t.creatId)&&(this.logAct(!1),A.drawCard(t.owner,1))}sprC(){this.faction="N",this.rarity="R",this.name="Spectral Rider",this.iAttack=this.lValN([6,8,13]),this.iHealth=this.iAttack-1,this.tribe.push("GG"),this.text=`When a friendly creature is destroyed, ${this.name} gets ${y.jr9(1,1)}.`,this.trigB=this.buffNug(2,2,"TS")}sprD(t,i){t.owner===i.creature.owner&&m.creatByTr(t).buff(1,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 ${y.tokName(t)} into that lane.`,this.trigB=this.spawnNug(t,"TX")}yuruD(t,i){const r=m.creatByTr(t),a=i.creature;a.owner===r.owner&&r.adjacent.includes(a.lane)&&!a.isTribe("ST")&&Ht.itDiedFirst(a.id,r.id)&&m.birth(this.syc(),"P",r.owner,a.lane)}syc(){return "XYR"+this.level}static itDiedFirst(t,i){if(t===i)return!0;let r=!1;const a=V.findDeathTime(i);if(S.isUn(a))r=!0;else{const c=V.findDeathTime(t);(S.isUn(c)||c<=a)&&(r=!0)}return r}}class ar extends Ht{get formation(){return!0}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FM"),r}jr8(t){if(t.trigger.type==="FM"){const i=b.crNotMeTarg(t.creatId);i.maxAttack=this.boof579;const r=m.creatByTarget(i);if(r.length>0){const a=E.tick();r.forEach(c=>V.destroy(c,this.code,a))}x.triggerDone()}else super.jr8(t)}}class Te extends F{lookup(t){return{["ATP"]:{c:()=>this.phagC(),t:()=>this.phagT(),f:(r,a)=>this.hdiscardF(r,a)},["PLI"]:{c:()=>this.pimpC(),t:()=>this.pimpT(),f:(r,a)=>this.hdiscardF(r,a)},["SSH"]:{c:()=>this.sshmC(),t:()=>this.sshmT(),f:(r,a)=>this.sshmF(r,a)},["TPG"]:{c:()=>this.pillC(),t:()=>this.pillT(),f:(r,a)=>this.pillF(r,a)},["TMG"]:{c:()=>this.grootC(),t:()=>this.grootT(),f:(r,a)=>this.grootF(r,a)},["VIN"]:{c:()=>this.vintC(),t:()=>this.vintT(),f:(r,a)=>{}}}[t]}forgTargets(t){return this.lookup(t).t()}forgAction(t,i,r){this.lookup(t).f(i,r)}optional=!0;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Forge: "+this.ftext,this.ftext=""}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}handleAction(t){this.forgAction(this.cardCode(),t.position,m.jr5(t.param)),mt.popMode(),v.actionDone(!0)}jr8(t){const i=this.cardCode()==="VIN";if(i&&E.aiActive)x.triggerDone();else{const r=this.forgTargets(this.cardCode());if(r.length>0){let a;if(i?a=[]:a=r.map(c=>{const f=b.deckSelectAction("CARD",c.cardCode,c.sourceIdx);return f.param=t.creatId,f.host=this.code,f}),this.optional){const c=v.noneEndTrigger();c.param="PM",a.push(c)}At.showCustomDeck(r,a)}else x.triggerDone()}}hdiscardF(t,i){const r=A.toPlayer(!i.owner),a=r.hand[t];r.hand.splice(t,1),r.discard.push(a)}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 ${y.levelGateText(this.level)}spells in the enemy player's hand and choose one. The enemy player discards the chosen spell.`}phagT(){const t=A.getInctive(),i=b.target("TH");return i.player=A.toTarget(t),i.level=D.ddf2(this.level),i.card="S",At.generateContent(t.hand,!1,i)}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=A.getInctive(),i=b.target("TH");return i.player=A.toTarget(t),i.maxAttack=this.boof369,i.card="C",At.generateContent(t.hand,!1,i)}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=y.levelGateText(this.level),this.ftext=`You may put a ${t}creature from your discard pile into your hand.`}sshmT(){const t=A.getActive(),i=b.target("TD");return i.player=A.toTarget(t),i.card="C",this.level===3?i.level="HR":i.level=D.ddf2(this.level),At.generateContent(t.discard,!1,i)}sshmF(t,i){const r=A.toPlayer(i.owner),a=r.discard.splice(t,1);r.hand.push(a[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=A.getActive(),i=b.target("TD");return i.player=A.toTarget(t),i.faction="N",At.generateContent(t.discard,!1,i)}pillF(t,i){A.toPlayer(i.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 ${y.jr9(t,t)}.`}grootT(){const t=A.getActive(),i=b.target("TD");return i.player=A.toTarget(t),i.tribe="PL",At.generateContent(t.discard,!1,i)}grootF(t,i){A.toPlayer(i.owner).discard.splice(t,1);const a=this.boof358;i.buff(a,a)}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=A.getInctive(),i=b.target("TH");return i.player=A.toTarget(t),At.generateContent(t.hand,!1,i)}}class nr extends F{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,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.interactive=!0,a.bonus=this.regnNug(this.boof135,"TW"),r}handleAction(t){const i=m.ddf6(t);this.logAct(!1,i),i.addRegen(this.boof135),v.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&G.getCard(t.event.cardCode).type==="S"}jr8(t){const i=b.crFriendActTarg("CARD",this.code,"");i.canRegen=!0;const r=D.toActions(i);r.length===0?x.triggerDone():(r.push(v.noneEndTrigger()),v.ddf5(r))}}class or extends yt{jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}jr8(t){m.qEnemyCreats().forEach(i=>{i.addPoison(6)}),x.triggerDone()}}class hr extends F{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Demara's Pitguard",this.iAttack=this.boof6914,this.iHealth=this.iAttack+2,this.tribe.push("NG"),this.text=`The opposing creature has Poison ${this.boof248}.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){const i=t.status==="A",r=m.oppositeLane(t.lane);m.qPlayerCreats(!t.owner).forEach(a=>{a.lane===r&&i?a.addModSafe(b.mod("PN",this.boof248,t.id)):a.removeModSafe(t.id)})}}class lr extends F{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 i=this.boof246n;this.text=`When an enemy creature with Aggressive deals battle damage, it gets ${y.jr9(i,i)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.buffNug(this.level,this.level),r}ddf8(t){const i=$.toDamage(t.event);return i.battle&&i.isCreatSrc&&i.srcCreat.owner!==t.owner&&i.srcCreat.aggressive}jr8(t){const i=$.toDamage(t.event);this.logAct(!1,i.srcCreat);const r=this.boof246n;i.srcCreat.buff(r,r),x.triggerDone()}}class cr extends F{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 i=this.boof357;this.text=`When this ${y.dbdtap()}, heal ${i} 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,i){const r=super.jr3(t,i),a=r.jr4("VN");a.bonus=this.buffNug(this.iAttack,this.iHealth);const c=r.jr4("DM");return c.bonus=this.buffNug(0,this.boof357,"TP"),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 i=m.creatByTr(t);m.birth("BWT"+this.level,"P",i.owner,i.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const i=this.boof357,r=b.crNotMeTarg(t.creatId);r.player=A.toTarget(t.owner),m.creatByTarget(r).forEach(c=>c.heal(i)),x.triggerDone()}}}class ur extends kt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Discordant Strike";const i=-this.boof4610;this.text=`Give an enemy creature ${y.jr9(i,0)}.~Allied Nekrium: Give an enemy creature ${y.jr9(0,i)}.`}playTargets(){const t=super.playTargets(),i=b.crEnemyActTarg("CARD",this.code,"P1");return t.push(i),t}handleAction(t){const i=S.deTil(t.param),r=-this.boof4610,a=m.ddf6(t);i[0]==="P1"?(this.logSpell(a),a.buff(r,0),L.allied("N")?v.ddf5(D.toActions(b.crEnemyActTarg("CARD",this.code,"P2"))):v.spellCast()):(this.logSpell(a),a.buff(0,r),v.spellCast())}}class dr extends kt{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.free=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(),i=this.poisTarg();return this.level===1?t.push(i):m.creatByTarget(i).length>0&&t.push(D.boardTarget("CARD",this.code)),t}handleAction(t){if(this.level===1){const i=m.ddf6(t);this.logSpell(i),i.addPoison(i.poison)}else this.logSpell(),m.creatByTarget(this.poisTarg()).forEach(r=>{r.addPoison(r.poison)});v.spellCast()}poisTarg(){const t=b.crEnemyActTarg("CARD",this.code,"");return t.hasPoison=!0,t}}class fr extends F{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 i="";const r=this.lValN([0,5,10]);this.level>1&&(i=`, then give it ${y.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${i}.`;const a=this.avgCreatureStats();this.bonus=this.buffNug(r+a[0]-this.iAttack,a[1],"TW")}canActivate(t){return A.toPlayer(!t.owner).hand.some(r=>G.getCard(r).type==="C")}startActivation(t){let i;if(lt.simOn)i=[{cardCode:"VND"+this.level,sourceIdx:0,cardCount:0}];else{const a=A.getInctive(),c=b.target("TH");c.player=A.toTarget(a),c.card="C",i=At.generateContent(a.hand,!1,c)}const r=i.map(a=>{const c=b.deckSelectAction("CARD",a.cardCode,a.sourceIdx);return c.param=t.id,c.host=this.code,c});At.showCustomDeck(i,r)}handleAction(t){this.logAct(!0);const i=m.jr5(t.param),r=m.birth(t.card,"R",i.owner,i.lane);this.level>1&&r?.buff(this.level===3?10:5,0),mt.popMode(),i.endActivation()}}class gr extends kt{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Dragonwake",this.text=`Search your deck for a ${y.levelGateText(this.level+1)}Dragon and Spawn a copy of it. It gets Aggressive${this.level===3?".":' and "At the end of your turn, destroy this."'}`}playTargets(){const t=super.playTargets();if(this.dragoons().length===0)return t;const i=D.boardTarget("CARD",this.code);return i.param="P1",t.push(i),t}dragoons(){const t=A.getActive(),i=b.target("DK");return i.player=A.toTarget(t),i.level=D.ddf2(this.level+1),i.tribe="DG",At.generateContent(t.deck,!1,i)}handleAction(t){if(t.param==="P1"){const i=this.dragoons(),r=i.map(c=>{const f=b.deckSelectAction("CARD",c.cardCode,c.sourceIdx);return f.host=this.code,f}),a=v.cancelAction();a.param="PM",r.push(a),At.showCustomDeck(i,r)}else{const i=m.birth(t.card,"S",A.getActiveB());if(i){if(this.logSpell(i),i.aggressive=!0,this.level<3){const r=i.jr4("TE",this.code);r.creatId=i.id,r.changes=!0}}else this.logSpell();mt.popMode(),v.spellCast()}}ddf8(t){return!0}jr8(t){const i=m.creatByTr(t);i.status==="A"&&V.destroy(i,this.code),x.triggerDone()}}class mr extends F{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Dread",this.iAttack=this.boof6912,this.iHealth=this.boof234,this.tribe.push("AB"),this.text=`When ${this.name} enters play, it has a 50% chance to get the ability "Vengeance: Spawn a level ${this.level} Dread".`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(t.event.code==="ENT"){if(S.randInt(0,2)===0){const r=$.toEnterField(t.event).creature.jr4("VN");r.changes=!0,r.bonus=this.buffNug(this.iAttack,this.iHealth)}}else m.birth(this.code,"S",t.owner);x.triggerDone()}}class pr extends F{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 i=G.getCard(this.bfc()),r=`Destroy an enemy ${y.levelGateText(this.level)}creature.`;this.text=`Activate, destroy another friendly creature: ${r}~Allied Uterra: Put a ${y.tokName(i)} into an available lane.`,this.bonus=this.multNug(this.avgSpawnNug(),.5),this.bonus.threat="TX"}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const i=this.friends(t.id);i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){const i=S.deTil(t.param);if(i[1]==="P1"){const r=this.enemies(i[0],m.ddf6(t).id);r.push(v.cancelAction()),v.ddf5(r)}else if(i[1]==="P2"){this.logAct(!0);const r=E.tick();V.destroy(m.jr5(i[2]),this.code,r),V.destroy(m.ddf6(t),this.code,r),m.jr5(i[0]).endActivation()}else m.birth(this.bfc(),"P",t.playerA,t.lane),v.actionDone(!0)}jr8(t){if(L.allied("U")){const i=b.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId),r=D.toActions(i);r.length>0?v.ddf5(r):x.triggerDone()}else x.triggerDone()}friends(t){const i=b.crFriendNotMeActTarg("CARD",t,this.code,S.enTil(t,"P1"));return D.toActions(i)}enemies(t,i=""){const r=b.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",i));return r.level=D.ddf2(this.level),D.toActions(r)}bfc(){return "BRF"+this.level}}class yr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Dysian Siphon";const i=this.boof357;this.text=`Give an enemy creature ${y.jr9(-i,-i)}.~Allied Uterra: Give a friendly creature ${y.jr9(i,i)}. `}playTargets(){const t=super.playTargets(),i=b.crEnemyActTarg("CARD",this.code,"P1");return t.push(i),t}handleAction(t){const i=S.deTil(t.param),r=this.boof357,a=m.ddf6(t);if(i[0]==="P1"){const c=b.crFriendActTarg("CARD",this.code,S.enTil("P2",a.id)),f=D.toActions(c);L.allied("U")&&f.length>0?(f.push(v.cancelAction()),v.ddf5(f)):(this.logSpell(a),a.buff(-r,-r),v.spellCast())}else{const c=m.jr5(i[1]);this.logSpell(c,a),c.buff(-r,-r),a.buff(r,r),v.spellCast()}}}class br extends F{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 i=-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 ${y.jr9(i,i)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,a.customCode=r.id,r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const i=$.toEnterField(t.event);if(i.forged&&i.creature.id===t.trigger.customCode)if(A.getActive().health>120){const r=b.actionTarget("TF","CARD",this.code,"");r.player="F",r.hint=["FL"],r.lanes=m.laneIdx.filter(c=>c!==i.creature.lane);const a=D.toActions(r);a.push(v.noneEndTrigger()),v.ddf5(a)}else x.triggerDone();else{const r=i.creature.opposed;if(r&&L.allied("N",i.creature.owner)){const a=-this.boof135;r.buff(a,a)}x.triggerDone()}}handleAction(t){m.birth(this.code,"R",t.playerA,t.lane),v.actionDone(!0)}}class kr extends F{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Ebonskull Diabolist",this.iAttack=this.boof137,this.iHealth=this.boof4814,this.tribe.push("VP"),this.text=`Forge: At the start of your next turn, if ${this.name} is in play, you may play an additional card.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}ddf8(t){return t.event.playerA===t.owner}jr8(t){const i=m.creatByTr(t);if(t.trigger.type==="FR"){const r=i.jr4("TS");r.changes=!0,r.bonus=this.avgSpawnNug(),r.bonus.threat="TX",x.triggerDone()}else if(t.event.code==="TRS"){const r=b.trigIdx(i.triggers,t.trigger);r>-1&&i.removeTrigger(i.triggers[r]),L.regularPlays+=1,this.logAct(!1),x.triggerDone()}}}class Ar extends F{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,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=this.level<3,r}jr8(t){if(this.level<3){const i=b.actionTarget("TF","CARD",this.code,"");i.player="F",i.lanes=m.creatByTr(t).adjacent,i.hint=["FL"];const r=D.toActions(i);r.push(v.noneEndTrigger()),v.ddf5(r)}else{const i=b.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId);let r=D.toActions(i);if(r.length>0){const a=E.tick();r.forEach(c=>m.birth(this.code,"P",c.playerA,c.lane,a))}x.triggerDone()}}handleAction(t){m.birth(this.code,"P",t.playerA,t.lane),v.actionDone(!0)}}class hi extends F{lookup(t){return{["BTB"]:{c:()=>this.bbtC(),m:r=>this.bbtM(r)},["TVG"]:{c:()=>this.tvgC(),m:r=>this.tvgM(r)}}[t]}createMods(t,i){return this.lookup(t).m(i)}armThreshold=1;wipe=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("AR",this.code);return a.area="A",r}enforceEffect(t){this.armThreshold<=t.armor?this.createMods(this.cardCode(),t).forEach(i=>{this.wipe&&t.removeModSafe(t.id),t.addModSafe(i)}):t.removeModSafe(t.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[b.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 ${y.jr9(t,0)}.`}tvgM(t){return[b.mod("AT",this.boof247,t.id)]}}class He extends F{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,i){return this.lookup(t).m(i)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i);return r.addEffect("AT",this.code),r}enforceEffect(t){this.attThreshold<=t.attack?this.createMods(this.cardCode(),t).forEach(i=>{t.addModSafe(i)}):t.removeModSafe(t.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[b.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 i=[b.mod("MB",3,t.id)];return this.level>1&&i.push(b.mod("AR",5,t.id)),this.level===3&&(i.push(b.mod("BT",!0,t.id)),i.push(b.mod("AG",!0,t.id)),i.push(b.mod("RG",5,t.id))),i}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[b.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[b.mod("MB",this.level,t.id),b.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,i=this.level===3?"it gets Breakthrough and ":"";this.text=`When you gain health, Wegu gets ${y.jr9(t,t)} for each health you gained.~While Wegu has ${this.attThreshold} or more attack, ${i}Negate Defender from it.`}weguM(t){const i=[b.mod("ND",!0,t.id)];return this.level===3&&i.push(b.mod("BT",!0,t.id)),i}}class li extends F{friendNotMe(t){const i=b.crNotMeTarg(t.id);return i.player=A.toTarget(t.owner),i}friendNone(t){const i=b.crTarg();return i.player=A.toTarget(t.owner),i.lanes=[],i}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforcementActive(t){return t.status==="A"}applyEffect(t,i,r){const a=this.friendNotMe(t),c=m.creatByTarget(a),f=m.creatByTarget(r);c.forEach(p=>{f.includes(p)?p.addModSafe(i):p.removeModSafe(t.id)})}}class ce extends li{lookup(t){return{["BWW"]:{c:()=>this.bwwC(),m:r=>this.bwwM(r),t:r=>this.friendNotMe(r)},["HTR"]:{c:()=>this.hrtC(),m:r=>this.hrtM(r),t:r=>this.friendNotMe(r)},["KKK"]:{c:()=>this.kkkC(),m:r=>this.kkkM(r),t:r=>this.kkkT(r)},["LVG"]:{c:()=>this.lvgC(),m:r=>this.lvgM(r),t:r=>this.friendNotMe(r)},["LTT"]:{c:()=>this.lntC(),m:r=>this.lntM(r),t:r=>this.friendNotMe(r)},["SFE"]:{c:()=>this.sfeC(),m:r=>this.sfeM(r),t:r=>this.sfeT(r)},["TCN"]:{c:()=>this.tcanC(),m:r=>this.tcanM(r),t:r=>this.tcanT(r)},["XDV"]:{c:()=>this.xdvC(),m:r=>this.xdvM(r),t:r=>this.xdvT(r)}}[t]}createMod(t,i){return this.lookup(t).m(i)}effTargs(t,i){return this.lookup(t).t(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t){const i=this.cardCode(),r=this.createMod(i,t),a=this.enforcementActive(t)?this.effTargs(i,t):this.friendNone(t);this.applyEffect(t,r,a)}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 b.mod("MB",this.level,t.id)}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 b.mod("RG",this.iRegen,t.id)}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 b.mod("AG",!0,t.id)}kkkT(t){const i=this.friendNotMe(t);return this.level===1?i.lanes=[]:i.level=D.ddf2(this.level-1),i}lvgC(){this.faction="T",this.rarity="T",this.name="Lava Golem",this.iAttack=4,this.iHealth=6,this.maxLevel=1,this.tribe.push("FR","EL"),this.text=`Friendly creature have ${y.jr9(4,0)}.`}lvgM(t){return b.mod("AT",4,t.id)}lntC(){this.faction="T",this.rarity="T",this.name="Lightning Titan",this.iAttack=6,this.iHealth=4,this.maxLevel=1,this.tribe.push("LT","EL"),this.text="Friendly creature have Aggressive."}lntM(t){return b.mod("AG",!0,t.id)}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 b.mod("AG",!0,t.id)}sfeT(t){const i=this.friendNotMe(t);return i.tribe="DF",i}tcanC(){this.faction="A",this.rarity="C",this.name="Tower Cannoneer",this.iAttack=this.lValN([6,12,14]),this.iHealth=this.iAttack-2,this.tribe.push("RB"),this.level===2&&(this.hints=["LB"]),this.text=`Each friendly Defender gets ${y.jr9(this.boof369,0)}`}tcanM(t){return b.mod("AT",this.boof369,t.id)}tcanT(t){const i=this.friendNotMe(t);return i.hasDefender=!0,i}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 b.mod("RG",this.iRegen,t.id)}xdvT(t){const i=this.friendNotMe(t);return i.tribe="ZB",i}}class ci extends F{lookup(t){return{["NXP"]:{c:()=>this.nxpC(),m:r=>this.nxpM(r)},["SKG"]:{c:()=>this.skgC(),m:r=>this.skgM(r)}}[t]}createMods(t,i){return this.lookup(t).m(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){t.lane===3?this.createMods(this.cardCode(),t).forEach(i=>{t.addModSafe(i)}):t.removeModSafe(t.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 ${y.jr9(this.iAttack,this.iHealth)}.`}nxpM(t){return[b.mod("AT",this.iAttack,t.id),b.mod("HL",this.iHealth,t.id),b.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[b.mod("MB",2,t.id)]}}class $e extends F{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:r=>this.cctM(r)},["GHB"]:{c:()=>this.ghbC(),m:r=>this.ghbM(r)},["ISB"]:{c:()=>this.isbC(),m:r=>this.isbM(r)},["PYG"]:{c:()=>this.pygC(),m:r=>this.pygM(r)}}[t]}createMods(t,i){return this.lookup(t).m(i)}eOpp=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){!!t.opposed===this.eOpp?this.createMods(this.cardCode(),t).forEach(i=>{t.addModSafe(i)}):t.removeModSafe(t.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 ${y.jr9(t,0)}.`}cctM(t){return[b.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.eOpp=!0,this.text=`While ${this.name} is opposed, it gets Aggressive.`}ghbM(t){return[b.mod("AG",!0,t.id)]}isbC(){this.faction="T",this.rarity="C",this.name="Iceshard Berserker",this.iAttack=this.boof358,this.iHealth=this.boof61016,this.tribe.push("IC","AS"),this.eOpp=!0,this.text=`While ${this.name} is opposed, it gets ${y.jr9(this.iHealth,0)}.`}isbM(t){return[b.mod("AT",this.iHealth,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 ${y.jr9(this.iAttack,0)}.`}pygM(t){return[b.mod("AT",this.iAttack,t.id)]}}class ui extends F{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,i){return this.lookup(t).m(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){const i=t.status==="A",r=this.targetPlayer(t);if(i){const a=this.createMod(this.cardCode(),t);A.addModSafe(r,a)}else A.removeModSafe(r,t.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 b.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 b.mod("PN",this.boof246,t.id)}}class Ne extends li{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,i){return this.lookup(t).m(i)}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){const i=this.cardCode(),r=this.createMod(i,t);let a;this.enforcementActive(t)?(a=this.friendNotMe(t),this.nexus?a.lanes=[1,2,4,5]:a.lanes=t.adjacent):a=this.friendNone(t),this.applyEffect(t,r,a)}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 ${y.jr9(this.iAttack,0)}.`}algnM(t){return b.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 ${y.jr9(t,0)}.`}alstM(t){return b.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 ${y.jr9(t,0)}.`}btcM(t){return b.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 ${y.jr9(t,0)}. Otherwise this gets Armor ${t}.`}aeroM(t){return b.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 b.mod("AR",this.boof235,t.id)}}class ve extends F{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC(),["POD"]:()=>this.podC(),["RWC"]:()=>this.roamC()})[t]()}targAction(t){m.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 i=y.forglied(this.allied);this.text=i+": "+this.ftext}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}jr8(t){if(this.cardCode()==="POD"&&!L.patron("U")){x.triggerDone();return}if(this.allied==="X"||L.allied(this.allied)){const i=m.creatByTr(t),r=b.emptyPlayerActTarg("F","CARD",this.code,t.creatId);this.needsEmpty||(r.field="A",r.hint=["FL"],r.lanes=m.laneIdx.filter(c=>c!==i.lane)),this.adjacent&&(r.lanes=i.adjacent);const a=D.toActions(r);a.length>0?(this.optional&&a.push(v.noneEndTrigger()),v.ddf5(a)):x.triggerDone()}else x.triggerDone()}handleAction(t){this.targAction(t),v.actionDone(!0)}bwdC(){this.faction="U",this.rarity="C",this.name="Branchweaver Druid",this.iAttack=1,this.iHealth=1,this.tribe.push("HM"),this.hints=["RT"],this.spawnCode=`${"TFD"}${this.level}`,this.optional=!0;const t=G.getCard(this.spawnCode);this.ftext=`You may put a ${y.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=K.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=G.getCard(this.spawnCode);this.ftext=`You may put a ${y.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","WF"),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 Tr extends F{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 i=G.getCard(this.soldier);this.addSp("N",i.iAttack),this.text=`While you have 6 or more cards in hand, this gets "Activate: Put a ${y.tokName(i)} into an available lane."`,this.bonus=this.multNug(this.spawnNug(i,"TX"),.3)}canActivate(t){return A.toPlayer(t.owner).hand.length>5&&m.emptyLanes(t.owner).length>0}startActivation(t){const i=b.emptyPlayerActTarg(t.owner,"CARD",this.code,t.id),r=D.toActions(i);r.push(v.cancelAction()),v.ddf5(r)}handleAction(t){this.logAct(!0),m.birth(this.soldier,"P",t.playerA,t.lane),m.jr5(t.param).endActivation()}ddf8(t){return!0}jr8(t){const i=A.toPlayer(t.owner);A.drawCard(i,1);const r=b.trigIdx(i.triggers,t.trigger);r>-1&&i.triggers.splice(r,1),x.triggerDone()}get soldier(){return "EPS"+this.level}}class vr extends F{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,i){const r=super.jr3(t,i),a=r.jr4("FR");a.interactive=!0;const c=r.jr4("EF");return c.interactive=!0,r}handleAction(t){if(t.zone==="H")L.levelAndDiscardA(t);else{const i=t;m.birth(this.code,"R",i.playerA,i.lane)}v.actionDone(!0)}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(t.trigger.type==="FR")if(L.allied("U")){const i=m.creatByTr(t),r=b.actionTarget("TF","CARD",this.code,t.creatId);r.player="F",r.lanes=m.laneIdx.filter(c=>c!==i.lane),r.hint=["FL"];const a=D.toActions(r);a.push(v.noneEndTrigger()),v.ddf5(a)}else x.triggerDone();else{const i=b.lvlHandActTarg(this.code,t.creatId),r=D.toActions(i);r.length>0?v.ddf5(r):x.triggerDone()}}}class Sr extends F{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 i=this.boof358;this.addSp("H",i),this.text=`Activate: Heal ${i} damage from each other friendly creature.~Allied Alloyin: Armor ${this.boof247}.`,this.bonus=this.buffNug(0,i,"TW")}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){const i=b.crFriendNotMeTarg(t.id);return m.creatByTarget(i).length>0}startActivation(t){const i=D.boardTarget("CARD",this.code);i.param=t.id,v.ddf5(D.toActions([i,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const i=m.jr5(t.param),r=this.boof358,a=b.crFriendNotMeTarg(i.id);m.creatByTarget(a).forEach(c=>{c.heal(r)}),i.endActivation()}jr8(t){L.allied("A")&&m.creatByTr(t).addArmor(this.boof247),x.triggerDone()}}class Cr extends F{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=["LG"]):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this lane.`,this.hints=["ZZ-3"])}jr3(t,i){const r=super.jr3(t,i);if(this.level===2){const a=r.jr4("RU");a.bonus=this.buffNug(10,9,"TH")}else if(this.level===3){const a=r.jr4("VN");a.bonus=this.statSpawnNug(0,1)}return r}ddf8(t){return t.event.playerA===t.owner}jr8(t){if(t.trigger.type==="RU"){const i=m.creatByTr(t);m.birth(`${"EFP"}3`,"R",i.owner,i.lane)}else if(t.trigger.type==="VN"){const r=$.toCreature(t.event).creature;m.birth(`${"EFP"}2`,"P",r.owner,r.lane)}x.triggerDone()}}class wr extends F{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,i){const r=super.jr3(t,i),a=r.jr4("HG");return a.bonus=this.playerNug(this.iHealth/2,"TW"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const i=this.level===3?2:1;A.heal(t.owner,t.event.healAmt*i,this.code),x.triggerDone()}}class Dr extends F{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.hints=["ZZ-1"],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,i){const r=super.jr3(t,i);return r.jr4("FR"),r}handleAction(t){m.birth(`${"FME"}${this.level}`,"P",t.playerA,t.lane),v.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner}jr8(t){const i=m.creatByTr(t);if(t.event.code==="ENT"){const r=i.jr4("TS");r.interactive=!0,r.changes=!0,r.bonus=this.rawNug(1,0,6,0,0,"TX"),x.triggerDone()}else if(t.event.code==="TRS"){const r=b.trigIdx(i.triggers,t.trigger);r>-1&&i.removeTrigger(i.triggers[r]);const a=b.emptyPlayerActTarg("F","CARD",this.code,""),c=D.toActions(a);c.length===0?x.triggerDone():(c.push(v.noneEndTrigger()),v.ddf5(c))}}}class xr extends kt{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const i=this.boof4711;this.text=`Deal ${i} damage to an enemy creature.~Give a friendly creature ${y.jr9(i,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(b.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const i=S.deTil(t.param),r=m.ddf6(t);if(i[0]==="P1"){const a=this.friends(r.id);a.push(v.cancelAction()),v.ddf5(a)}else{this.logSpell(r);const a=this.boof4711;m.jr5(i[1]).hurtDirect(a,this.code),r.addMod(b.modT("AT",a)),v.spellCast()}}friends(t=""){const i=b.crFriendActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(i)}}class Br extends F{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=this.buffNug(this.iAttack,0,"TX")}canActivate(t){return!0}startActivation(t){const i=b.crEnemyActTarg("CARD",this.code,t.id),r=b.playerActTarg("E","CARD",this.code,t.id),a=D.toActions([i,r]);a.push(v.cancelAction()),v.ddf5(a)}handleAction(t){if(t.zone==="F"){const i=m.ddf6(t);this.logAct(!0,i),i.hurtDirect(this.iAttack,this.code)}else{this.logAct(!0);const i=t;A.hurtDirect(i.playerA,this.iAttack,this.code)}m.jr5(t.param).endActivation()}}class Hr extends kt{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Gauntlets of Sulgrim";const i=this.boof2510;this.text=`Give a friendly creature Armor ${i}, then deal damage equal to its Armor to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.baddies().length>0){const i=b.crFriendActTarg("CARD",this.code,"P1");i.canArmor=!0,t.push(i)}return t}handleAction(t){const i=S.deTil(t.param),r=m.ddf6(t);if(i[0]==="P1"){const a=v.cancelAction(),c=this.baddies(r.id);c.push(a),v.ddf5(c)}else{const a=m.jr5(i[1]);this.logSpell(a);const c=this.boof2510;a.addArmor(c),r.hurtDirect(a.armor,this.code),v.spellCast()}}baddies(t=""){return D.toActions(b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t)))}}class Nr extends F{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} ${y.dbdtap()}, you gain that much health.~Allied Tempys: Mobility ${this.level}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("DM");return a.bonus=this.playerNug(this.iAttack,"TP"),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")L.allied("T")&&m.creatByTr(t).addMobility(this.level),x.triggerDone();else if(t.trigger.type==="DM"){const i=t.event;A.heal(t.owner,i.dmg,this.code),x.triggerDone()}}}class Fr extends F{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");const i=`Gain Rank: each enemy ${y.levelGateText(this.level)}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+i}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("RU");if(a.bonus=this.statSpawnNug(0,0,"TH"),this.level===3){const c=r.jr4("TS");c.bonus=this.buffNug(3,0,"TW")}return r}ddf8(t){if(t.trigger.type==="DM"){const i=t.event;if(i.isCreatTarg&&i.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 i=b.crEnemyTarg();i.level=D.ddf2(this.level),m.creatByTarget(i).forEach(r=>{const a=r.jr4("DM",this.code);a.bonus=this.rawNug(0,0,0,0,-.5*this.level),a.changes=!0})}else if(t.trigger.type==="TS"){const i=E.tick();m.qEnemyCreats().forEach(r=>{r.hurtDirect(1,this.code,i)})}else if(t.trigger.type==="DM"){const i=m.creatByTr(t);i.status==="A"&&V.destroy(i,this.code)}x.triggerDone()}}class Pr extends F{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,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){const i=m.qActiveCreats();t.status==="A"?i.forEach(r=>{r.addModSafe(b.mod("NM",!0,t.id))}):i.forEach(r=>{r.removeModSafe(t.id)})}}class Mr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Grave Pact",this.free=this.level===3,this.free||(this.hints=["LG"]),this.text=`Destroy a friendly creature.~Destroy an ${y.levelGateText(this.level+1)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const i=b.crFriendActTarg("CARD",this.code,"P1");t.push(i)}return t}handleAction(t){const i=S.deTil(t.param),r=m.ddf6(t);if(i[0]==="P1"){const a=this.enemyTargActions(r.id);a.push(v.cancelAction()),v.ddf5(a)}else{this.logSpell();const a=E.tick();V.destroy(m.jr5(i[1]),this.code,a),V.destroy(r,this.code,a),v.spellCast()}}enemyTargActions(t=""){const i=b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return i.level=D.ddf2(this.level+1),D.toActions(i)}}class Rr extends F{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="G.S.F. Commando",this.iAttack=this.lValN([3,6,11]),this.iHealth=this.lValN([8,12,19]),this.iArmor=this.level,this.tribe.push("MM"),this.text=`Forge: ${this.name} gets Armor 1 for each other friendly Metamind.~Activate: Deal damage equal to ${this.level}x ${this.name}'s Armor to an enemy creature.`,this.bonus=this.buffNug(0,2*this.level,"TX")}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return t.armor>0&&m.qEnemyCreats().length>0}startActivation(t){const i=b.crEnemyActTarg("CARD",this.code,t.id);v.ddf5(D.toActions([i,D.buttonTarget("CANC")]))}handleAction(t){const i=m.jr5(t.param);m.ddf6(t).hurtDirect(i.armor*this.level,this.code),i.endActivation()}jr8(t){const i=b.crFriendNotMeTarg(t.creatId);i.tribe="MM";const r=m.creatByTarget(i).length;r>0&&m.creatByTr(t).addArmor(r),x.triggerDone()}}class Er extends kt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Guardians Assemble",this.free=this.level===3,this.free||(this.hints=["LG"]);const i=this.level===1?"Put a copy of a random Forge Guardian from your deck":"Search your deck for a Forge Guardian and put a copy";this.text=`${i} into the center lane.`}playTargets(){const t=super.playTargets();if(this.voltrons().length===0)return t;let i;return i=b.actionTarget("TF","CARD",this.code,""),i.player="F",i.lanes=3,this.level>1&&(i.param="P1"),t.push(i),t}voltrons(){const t=A.getActive(),i=b.target("DK");return i.player=A.toTarget(t),i.tribe="GD",At.generateContent(t.deck,!1,i)}tron(t){m.birth(t,"R",A.getActiveB(),3)}handleAction(t){if(this.level===1){const i=this.voltrons(),r=i[S.randInt(0,i.length)].cardCode;this.logSpell(),this.tron(r),v.spellCast()}else if(t.param==="P1"){const i=this.voltrons(),r=i.map(c=>{const f=b.deckSelectAction("CARD",c.cardCode,c.sourceIdx);return f.host=this.code,f}),a=v.cancelAction();a.param="PM",r.push(a),At.showCustomDeck(i,r)}else this.logSpell(),this.tron(t.card),mt.popMode(),v.spellCast()}}class Lr extends F{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,i){const r=super.jr3(t,i),a=r.jr4("TE",this.code);a.bonus=this.playerNug(0,"TX");const c=r.addEffect("PS",this.code);return c.area="C",r}ddf8(t){return!0}jr8(t){this.enforceEffect(m.creatByTr(t)),x.triggerDone()}enforceEffect(t){const i=this.boof124,r=b.crNotMeTarg(t.id);r.player=A.toTarget(t.owner);const a=m.creatByTarget(r),c=t.status==="A",f=A.activePlayer===t.owner,p=Lt.phase==="ET"||Lt.phase==="PT";c&&(f&&p||!f&&!p)?a.forEach(k=>{k.addModSafe(b.mod("AR",i,t.id)),k.addModSafe(b.mod("DF",!0,t.id))}):a.forEach(k=>{k.removeModSafe(t.id)})}}class Gr extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const i=this.boof359;this.text=`Give a friendly creature +${i} attack.~Give an enemy creature -${i} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const i=b.crFriendActTarg("CARD",this.code,"P1");t.push(i)}return t}handleAction(t){const i=S.deTil(t.param),r=m.ddf6(t);if(i[0]==="P1"){const a=this.enemyTargActions(r.id);a.push(v.cancelAction()),v.ddf5(a)}else{const a=m.jr5(i[1]);this.logSpell(a,r);const c=this.boof359;a.buff(c,0),r.buff(-c,0),v.spellCast()}}enemyTargActions(t=""){const i=b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(i)}}class Wr extends F{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,i){const r=super.jr3(t,i),a=r.jr4("EF");return a.interactive=!0,r}handleAction(t){m.birth(this.code,"P",t.playerA,t.lane),v.actionDone(!0)}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(S.randInt(0,lt.simOn?4:2)===1){const r=b.emptyPlayerActTarg("F","CARD",this.code,""),a=b.actionTarget("TB","NOTR",this.code,""),c=D.toActions([r,a]);c.length===1?x.triggerDone():v.ddf5(c)}else x.triggerDone()}}class Ir extends F{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 i;this.level===1?(this.iDefend=!0,i=5):(this.iMobile=1,this.iRegen=this.level===2?5:10,i=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 ${i} or higher, replace it with a level ${this.level+1} Iniog.`,this.text=r}jr3(t,i){const r=super.jr3(t,i);if(this.level===3){const a=r.jr4("HG");a.bonus=this.playerNug(4,"TX");const c=r.jr4("VN");c.bonus=this.buffNug(0,3)}else{const a=r.jr4("DS");a.bonus=this.regnNug(2);const c=r.jr4("TE"),f=G.getCard(this.levelUpCard());c.bonus=this.multNug(this.buffNug(f.iAttack,f.iHealth,"TX"),.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 i=m.creatByTr(t);if(t.trigger.type==="HG"){const r=t.event;A.hurtDirect(!t.owner,r.healAmt,this.code)}else if(t.trigger.type==="VN")m.birth("ICD"+"1","P",i.owner,i.lane);else if(t.trigger.type==="DS")i.addRegen(1);else if(t.trigger.type==="TE"){const r=this.level===1?4:9;i.regen>r&&m.birth(this.levelUpCard(),"R",i.owner,i.lane)}x.triggerDone()}}class $r extends F{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 ${y.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,i){const r=super.jr3(t,i),a=r.jr4("PC");a.bonus=this.buffNug(0,this.iAttack);const c=r.jr4("DM");return c.bonus=this.buffNug(this.iAttack,0,"TP"),r}ddf8(t){if(t.trigger.type==="DM"){const i=t.event;return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId}else if(t.trigger.type==="PC"){const i=t.event;if(i.playerA===t.owner)return G.getCard(i.cardCode).cardCode()==="IFR"}return!1}jr8(t){if(t.trigger.type==="DM"){const i=t.event;A.hurtDirect(!t.owner,i.dmg,this.code)}else if(t.trigger.type==="PC"){const i=m.creatByTr(t);m.birth(`${"IZR"}${this.level}`,"R",i.owner,i.lane)}x.triggerDone()}}class Ur extends F{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 i=this.boof2510;this.text=`When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.~Activate: Deal ${i} damage to a creature.`,this.bonus=this.buffNug(i,0,"TW")}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.bonus=this.buffNug(0,this.iAttack,"TW"),r}canActivate(t){return!0}startActivation(t){const i=b.crActTarg("CARD",this.code,t.id);i.hint=["HR"];const r=D.toActions([i,D.buttonTarget("CANC")]);v.ddf5(r)}handleAction(t){this.logAct(!0),m.ddf6(t).hurtDirect(this.boof2510,this.code),m.jr5(t.param).endActivation()}ddf8(t){return t.event.playerA===t.owner&&t.event.cardCode.slice(0,3)==="IFL"}jr8(t){const i=m.creatByTr(t);m.birth(`${"IZL"}${this.level}`,"R",i.owner,i.lane),x.triggerDone()}}class Vr extends F{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=[this.lValH(["ZZ+2","ZZ+2","ZZ+3"])];const i=this.lValS(["Poison 1","Poison 3","that much Poison"]);this.text=`When ${this.name} deals battle damage to a creature or player, they get ${i}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.regnNug(this.iAttack,"TP"),a.bonus.pHealth=this.iAttack,r}ddf8(t){return t.event.battle&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){const i=$.toDamage(t.event),r=this.lValN([1,3,i.dmg]);i.isCreatTarg?i.hurtCreat.addPoison(r):i.hurtPlayer.poison+=r,x.triggerDone()}}class Or extends F{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 i;this.level<3?i=`a ${y.levelGateText(this.level)}card in your`:this.level===3?i="a card in your hand and":i="each card in your hand, deck, and",this.text=`Forge: Level up ${i} discard pile.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=this.level<4,r}handleAction(t){const i=A.getActive();if(t.zone==="N"){const r=G.getCard(i.discard[t.position]);i.discard[t.position]=r.levelUpCard(),mt.popMode(),v.actionDone(!0)}else{const r=G.getCard(i.hand[t.position]);i.hand[t.position]=r.levelUpCard(),this.discardLevel(!0)}}jr8(t){if(this.level<3)this.discardLevel(!1);else if(this.level===3){const i=D.toActions(b.lvlHandActTarg(this.code,""));i.length>0?v.ddf5(i):this.discardLevel(!1)}else{const i=A.getActive();this.levelDeck(i.deck),this.levelDeck(i.hand),this.levelDeck(i.discard),x.triggerDone()}}discardLevel(t){const i=A.getActive(),r=b.target("TD");r.player=A.toTarget(i),r.level=D.ddf2(this.level),r.canLevel=!0;const a=At.generateContent(i.discard,!1,r);if(a.length>0){const c=a.map(f=>{const p=b.deckSelectAction("CARD",f.cardCode,f.sourceIdx);return p.host=this.code,p.hint=["CD"],p});At.showCustomDeck(a,c)}else t?v.actionDone(!0):x.triggerDone()}levelDeck(t){t.map(r=>G.getCard(r).levelUpCard()).forEach((r,a)=>t[a]=r)}}class zr extends F{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 ${y.jr9(this.iAttack,0)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){const i=t.status!=="A",r=b.mod("AT",this.iAttack,t.id);m.qPlayerCreats(t.owner).forEach(a=>{a.opposed||i?a.removeModSafe(t.id):a.addModSafe(r)})}}class Zr extends F{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=this.statSpawnNug(3,3,"TW");else{this.text=`Activate: Replace this with a level ${this.level+1} ${this.name}.`;const i=3*this.level;this.bonus=this.buffNug(i,i,"TX")}}canActivate(t){return this.level===3?v.emptyAdjacents(t,"").length>0:!0}startActivation(t){let i;if(this.level===3)i=v.emptyAdjacents(t,"");else{const r=b.fieldSelectAction("CARD",t.lane,t.owner);r.param=t.id,r.host=this.code,i=[r]}i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){this.logAct(!0);const i=m.jr5(t.param);this.level===3?m.birth(this.leafCode(1),"P",t.playerA,t.lane):m.birth(this.leafCode(this.level+1),"R",i.owner,i.lane),i.endActivation()}leafCode(t){return`${"LKP"}${t}`}}class ge extends F{cardConstruct(t){({["AFO"]:()=>this.aetorC(),["CRS"]:()=>this.scootC(),["FOL"]:()=>this.forcC(),["NXO"]:()=>this.nexoC(),["SNK"]:()=>this.tinkC(),["TEX"]:()=>this.texC(),["TSM"]:()=>this.tsmithC()})[t]()}playTarg;optional=!1;constructor(t){super(t),this.playTarg=b.lvlHandActTarg(this.code,""),this.cardConstruct(this.cardCode()),this.text="Forge: "+this.text}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}handleAction(t){L.levelAndDiscardA(t),v.actionDone(!0)}jr8(t){if(this.cardCode()==="NXO"&&m.creatByTr(t).lane!==3){x.triggerDone();return}const i=D.toActions(this.playTarg);i.length>0?(i.forEach(r=>{r.param=t.creatId}),this.optional&&i.push(v.noneEndTrigger()),v.ddf5(i)):x.triggerDone()}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.text="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.text="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.text="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.text=`If ${this.name} is in the center lane, you may ${y.daluac()}.`}tinkC(){this.faction="A",this.rarity="C",this.name="Steelspark Tinkerer",this.iAttack=this.boof147,this.iHealth=this.lValN([9,12,21]),this.iDefend=!0,this.tribe.push("HM"),this.optional=!0,this.text=`You may ${y.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.text="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.text=`You may ${y.daluac()}.`}}class Kr extends F{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Lightbringer Council",this.iAttack=this.lValN([4,8,10]),this.iHealth=this.boof71116,this.tribe.push("TK"),this.text=`When a friendly Uterra creature ${y.dbdtap()}, you gain ${this.iAttack} health.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.playerNug(this.iAttack,"TP"),r}ddf8(t){const i=$.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcCreat.owner===t.owner&&i.srcCreat.faction==="U"}jr8(t){A.heal(t.owner,this.iAttack,this.code),x.triggerDone()}}class te extends F{lookup(t){return{["ASB"]:{c:()=>this.asbC(),d:(r,a,c)=>this.asbD(r,a,c)},["CHR"]:{c:()=>this.crgC(),d:(r,a,c)=>this.crgD(r,a,c)},["DZD"]:{c:()=>this.dozC(),d:(r,a,c)=>this.dozD(r,a,c)},["DTR"]:{c:()=>this.dtrC(),d:(r,a,c)=>this.dtrD(r,a,c)},["FWS"]:{c:()=>this.fwsC(),d:(r,a,c)=>this.fwsD(r,a,c)},["IMD"]:{c:()=>this.eddieC(),d:(r,a,c)=>this.eddieD(r,a,c)},["LVH"]:{c:()=>this.hiveC(),d:(r,a,c)=>this.hiveD(r,a,c)},["NCM"]:{c:()=>this.ncmbC(),d:(r,a,c)=>this.ncmbD(r,a,c)},["S01"]:{c:()=>this.spcC(),d:(r,a,c)=>this.spcD(r,a,c)},["TDS"]:{c:()=>this.tsrC(),d:(r,a,c)=>this.tsrD(r,a,c)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}cares=!0;trigB;cardDamaged(t,i){const r=$.toDamage(i.event);this.lookup(t).d(i,r.hurtCreat,r)}image(t){return this.cardCode()==="DZD"?this.fixedImage(t):super.image(t)}jr3(t,i){const r=super.jr3(t,i);if(this.cares){const a=r.jr4("DM");a.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,"TS"),this.text=`When ${this.name} is dealt non-battle damage and survives, it gets ${y.jr9(this.level,1)} for each damage dealt.`}asbD(t,i,r){!r.battle&&r.life>0&&i.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.trigB=this.playerNug(5,"TW")),this.level===1?(this.hints=["LG","LM","RT"],this.cares=!1):this.level===2?(this.iRegen=2,this.iDefend=!0,this.hints?.push("LG")):this.level===3&&(this.iBT=!0,this.iRegen=5)}crgD(t,i,r){A.heal(t.owner,r.dmg,this.code)}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,"TW"),this.trigB.bonus=.3;const t=G.getCard(this.dz());this.text=`When ${this.name} is dealt damage and survives, replace it with a ${y.tokName(t)}.`}dozD(t,i,r){if(i.health>0&&i.status==="A"){const a=m.birth(this.dz(),"R",i.owner,i.lane);a&&a.setHealth(i.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.trigB.threat="TX",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,i,r){i.owner===A.activePlayer&&r.life>0&&(this.logAct(!1),L.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,i,r){V.destroy(i,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,"TW")):(this.cares=!1,this.hints=["LG","LM","RT"])}eddieD(t,i,r){A.hurtDirect(!t.owner,r.dmg,this.code)}hiveC(){this.faction="U",this.rarity="L",this.name="Living Hive",this.iAttack=this.lValN([0,0,10]),this.iHealth=this.lValN([8,12,15]),this.tribe.push("IN","EL"),this.iDefend=this.level<3,this.hints=["MC"];const t=G.getCard(K.bee(this.level));this.text=`When ${this.name} is dealt damage, Spawn a level ${y.tokName(t)}.`,this.iDefend||(this.iBT=!0,this.text+=`~Forge: ${this.name} gets +X attack and +X health, where X is the total amount of Poison the enemy player has.`),this.trigB=this.spawnNug(t,"TX")}hiveD(t,i,r){this.logAct(!1),m.birth(K.bee(this.level),"S",t.owner)}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(K.purpOzC(this.level));this.text=`When ${this.name} is dealt damage, Spawn a ${y.tokName(t)}.`,this.trigB=this.spawnNug(t,"TW")}ncmbD(t,i,r){this.logAct(!1),m.birth(K.purpOzC(this.level),"S",t.owner)}spcC(){this.faction="A",this.rarity="L",this.name="Specimen 001",this.iAttack=this.boof234,this.iHealth=this.lValN([12,16,22]),this.tribe.push("OZ"),this.hints=["MC"],this.trigB=this.rawNug(0,ut.calcCreatValueFormula(this.iAttack,0,this.level,0,0,!1,0),0,0,0,"TX"),this.text=`When ${this.name} is dealt non-battle damage, each other friendly creature gets ${y.jr9(this.iAttack,0)} and Armor ${this.level}.`}spcD(t,i,r){if(!r.battle){const a=b.crNotMeTarg(i.id);a.player=A.toTarget(i.owner),m.creatByTarget(a).forEach(c=>{c.buff(this.iAttack,0),c.addArmor(this.level)})}}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,"TS"),this.text=`When ${this.name} is dealt damage, it gets +1 attack for each damage dealt.`}tsrD(t,i,r){i.buff(r.dmg,0)}}class Yr extends te{jr3(t,i){const r=super.jr3(t,i);return this.level===3&&r.jr4("FR"),r}jr8(t){if(t.trigger.type==="FR"){const i=A.totalPoison(!t.owner);i>0&&m.creatByTr(t).buff(i,i),x.triggerDone()}else super.jr8(t)}}class Xr extends Ht{jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}jr8(t){if(t.trigger.type==="FR"){const i=m.creatByTarget(b.crNotMeTarg(t.creatId)),r=this.boof124;i.forEach(a=>a.addPoison(r)),x.triggerDone()}else super.jr8(t)}}class qr extends kt{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metatransfer",this.text=`Give a creature ${y.jr9(-this.boof579,0)}.~Discard and level up a card.`}playTargets(){const t=super.playTargets(),i=b.crActTarg("CARD",this.code,"P1");return i.hint=["DB"],t.push(i),t}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=m.ddf6(t),a=b.lvlHandActTarg(this.code,S.enTil("P2",r.id));a.deckPositionSkip=v.playPosition();const c=D.toActions(a);c.length===0?(this.logSpell(r),r.buff(-this.boof579,0),v.spellCast()):(c.push(v.cancelAction()),v.ddf5(c))}else{const r=m.jr5(i[1]);this.logSpell(r),r.buff(-this.boof579,0);const a=t;v.shiftPlayCard(a.position),L.levelAndDiscardA(a),v.spellCast()}}}class jr extends F{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=this.statSpawnNug(this.iAttack,this.iHealth,"TW")}canActivate(t){return v.emptyAdjacents(t,"").length>0}startActivation(t){const i=v.emptyAdjacents(t,"");i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){this.logAct(!0);const i=m.jr5(t.param);m.birth(i.code,"P",t.playerA,t.lane),i.endActivation()}}class Jr extends F{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,i){const r=super.jr3(t,i);if(this.level>1){const a=r.jr4("FR");a.interactive=!0}return r}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1")if(this.level===3){this.wurmsign(2,t);const r=[t.lane,parseInt(i[1])],a=this.fieldActions("P2",r);v.ddf5(a)}else this.wurmsign(1,t),v.actionDone(!0);else this.wurmsign(1,t),v.actionDone(!0)}jr8(t){const i=$.toCreature(t.event);v.ddf5(this.fieldActions("P1",[i.creature.lane]))}fieldActions(t,i){const r=b.actionTarget("TF","CARD",this.code,S.enTil(t,i[0]));r.player="F",r.hint=["FL"],r.lanes=m.laneIdx.filter(c=>!i.includes(c));const a=D.toActions(r);return a.push(v.noneEndTrigger()),a}wurmsign(t,i){m.birth(this.wurmCode(t),"R",i.playerA,i.lane)}wurmCode(t){return`${"MMW"}${t}`}}class me extends kt{lookup(t){return{["BRN"]:{c:()=>this.boutC(),z:(r,a)=>this.burner(r,a,8)},["IFL"]:{c:()=>this.izfmC(),z:(r,a)=>this.burner(r,a,this.boof6915)},["LSK"]:{c:()=>this.lspkC(),z:(r,a)=>this.burner(r,a,this.boof6812)},["LYR"]:{c:()=>this.rainC(),z:(r,a)=>this.rainZ(r,a)},["SOK"]:{c:()=>this.sealkC(),z:(r,a)=>this.burner(r,a,this.sealzap)},["STB"]:{c:()=>this.shatC(),z:(r,a)=>this.shatZ(r,a)},["SHK"]:{c:()=>this.shkC(),z:(r,a)=>this.shkZ(r,a)}}[t]}cardCast(t,i,r){this.lookup(t).z(i,r)}hurts=!0;burner(t,i,r){i?t.hurtDirect(r,this.code):A.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(),i=this.hurts?["HR"]:["BF"],r=b.crActTarg("CARD",this.code,"");r.hint=i;const a=b.actionTarget("TP","CARD",this.code,"");return a.hint=i,t.push(r,a),t}handleAction(t){let i,r;t.zone==="P"?(this.logSpell(),i=!1,r=t.playerA):(r=m.ddf6(t),this.logSpell(this.hurts?void 0:r),i=!0),this.cardCast(this.cardCode(),r,i),v.spellCast()}boutC(){this.faction="T",this.rarity="R",this.name="Burnout",this.overload=!0,this.maxLevel=1,this.text=this.burnText(8)}izfmC(){this.faction="T",this.rarity="T",this.name="Iztek's Flame";const t=this.boof6915;this.addSp("D",t),this.text=this.burnText(t)}lspkC(){this.faction="T",this.rarity="C",this.name="Lightning Spark";const t=this.boof6812;this.addSp("D",t),this.text=this.burnText(t)}rainC(){this.faction="U",this.rarity="C",this.name="Lysian Rain",this.hurts=!1;const t=this.boof7911;this.addSp("H",t),this.text=`Give a creature or player +${t} health.`}rainZ(t,i){const r=this.boof7911;i?(this.logAct(!1,t),t.buff(0,r)):A.heal(t,r,this.code)}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,i){const r=this.boof5914,a=b.modT("NA",!0);if(i){const c=t;c.addMod(a),c.hurtDirect(r,this.code)}else{const c=A.toPlayer(t);A.addMod(c,a),A.hurtDirect(c,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 ${y.levelGateText(this.level)}spell this turn.`}shkZ(t,i){this.burner(t,i,this.boof124);const r=L.freeCard(this.code);r.condition.level=D.ddf2(this.level),r.condition.card="S"}}class Qr extends F{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 i=G.getCard(this.spc());this.text=`Activate: Put a ${y.tokName(i)} into an available lane.~Forge: Destroy a friendly creature.`,this.bonus=this.spawnNug(i,"TX")}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}canActivate(t){return this.empties(t).length>0}startActivation(t){const i=this.empties(t);i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){const i=S.deTil(t.param);i[0]==="P1"?(this.logAct(!0),m.birth(this.spc(),"P",t.playerA,t.lane),m.jr5(i[1]).endActivation()):(V.destroy(m.ddf6(t),this.code),v.actionDone(!0))}jr8(t){const i=b.crFriendActTarg("CARD",this.code,""),r=D.toActions(i);v.ddf5(r)}spc(){return "SPN"+this.level}empties(t){const i=b.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P1",t.id));return D.toActions(i)}}class _r extends F{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 ${y.levelGateText(this.level)}creature.`}image(t){return this.rawImage(`${"NSH"}${this.level}`,t)}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FK");return a.bonus=this.multNug(this.avgSpawnNug(),.5),a.bonus.threat="TX",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 ts extends Ne{enforceEffect(t){t.lane===3?t.removeModSafe(t.id):t.addModSafe(b.mod("AR",this.boof236,t.id)),super.enforceEffect(t)}}class es extends F{constructor(t){super(t),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 ${y.jr9(this.iAttack,0)}. Use this ability only if ${this.name} is in the center lane.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return t.lane===3}startActivation(t){const i=b.crActTarg("CARD",this.code,t.id);i.hint=["BF","BB"];const r=D.toActions(i);r.push(v.cancelAction()),v.ddf5(r)}handleAction(t){const i=m.ddf6(t);this.logAct(!0,i),i.buff(this.iAttack,0),m.jr5(t.param).endActivation()}jr8(t){const i=m.creatByTr(t);if(i.lane===3){const r=i.jr4("NT");r.bonus=this.buffNug(this.iAttack/2,0,"TW")}x.triggerDone()}}class is extends F{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 i=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 ${y.jr9(i,i)}.`}get nbuf(){return this.lValN([1,3,5,10])}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");this.level===1&&(a.interactive=!0);const c=r.jr4("RP"),f=this.nbuf;return c.bonus=this.buffNug(f,f,"TS"),r}ddf8(t){const i=$.toReplaced(t.event);return t.creatId!==i.replCreatId&&t.owner===i.replCreat.owner}jr8(t){const i=m.creatByTr(t);if(t.event.code==="RPL"){const r=this.nbuf;i.buff(r,r),x.triggerDone()}else{const r=m.emptyLanes(t.owner);if(this.level>1){const a=this.level===2?i.adjacent.filter(f=>r.includes(f)):r,c=E.tick();a.forEach(f=>{m.birth(this.seed,"P",i.owner,f,c)}),x.triggerDone()}else{const a=i.adjacent.filter(c=>r.includes(c));if(a.length===0)x.triggerDone();else if(a.length===1)m.birth(this.seed,"P",i.owner,a[0]),x.triggerDone();else{const c=v.emptyAdjacents(i,"");v.ddf5(c)}}}}handleAction(t){m.birth(this.seed,"P",t.playerA,t.lane),v.actionDone(!0)}get seed(){return "NSD"+this.level}}class rs extends kt{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const i=this.boof246,r=i*-1;this.text=`Give a friendly Zombie ${y.jr9(i,i,!0)}, and Regenerate ${i}.~Then give an enemy non-Zombie ${y.jr9(r,r)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const i=b.crFriendActTarg("CARD",this.code,"P1");i.tribe="ZB",t.push(i)}return t}handleAction(t){const i=S.deTil(t.param),r=m.ddf6(t);if(i[0]==="P1"){const a=v.cancelAction(),c=this.nonZombies(r.id);c.push(a),v.ddf5(c)}else{const a=m.jr5(i[1]);this.logSpell(a,r);const c=this.boof246;a.buff(c,c),a.addRegen(c),r.buff(-c,-c),v.spellCast()}}nonZombies(t=""){const i=b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return D.toActions(i).filter(r=>!m.ddf6(r).isTribe("ZB"))}}class ss extends F{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 i=this.boof358;this.text=`Activate: Discard and level up a card.~Allied Nekrium: Regenerate ${i}.`,this.bonus=this.rawNug(0,0,0,0,.5,"TW")}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return A.toPlayer(t.owner).hand.some(r=>G.getCard(r).canLevel())}startActivation(t){const i=b.lvlHandActTarg(this.code,t.id);i.hint?.push("DF"),v.ddf5(D.toActions([i,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0),L.levelAndDiscardA(t),m.jr5(t.param).endActivation()}jr8(t){L.allied("N")&&m.creatByTr(t).addRegen(this.boof358),x.triggerDone()}}class as extends F{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 i=this.boof4812n;this.addSp("A",i),this.text=`Allied Alloyin: Activate: Give a creature ${y.jr9(i,0)}`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return t.hasMod(t.id)}startActivation(t){const i=b.crActTarg("CARD",this.code,t.id);i.hint=["DF","DB"];const r=D.toActions(i);r.push(v.cancelAction()),v.ddf5(r)}handleAction(t){const i=m.ddf6(t);this.logAct(!0,i),i.buff(this.boof4812n,0),m.jr5(t.param).endActivation()}jr8(t){if(L.allied("A")){const i=m.creatByTr(t);i.addMod(b.mod("AL",!0,i.id)),i.changed=!0;const r=i.jr4("NT");r.bonus=this.buffNug(this.boof4812,0,"TX")}x.triggerDone()}}class ns extends kt{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Oratek Battlebrand";const i=this.boof71013;this.addSp("D",i),this.text=`Deal ${i} damage to a creature.~Allied Alloyin: You may discard a card and level it.`}playTargets(){const t=super.playTargets(),i=b.crActTarg("CARD",this.code,"");return i.hint=["HR"],t.push(i),t}handleAction(t){if(t.zone==="F")if(this.logSpell(),m.ddf6(t).hurtDirect(this.boof71013,this.code),L.allied("A")){const i=this.levelActs();i.length===1?v.spellCast():v.ddf5(i)}else v.spellCast();else if(t.zone==="H"){const i=t;v.shiftPlayCard(i.position),L.levelAndDiscardA(i),v.spellCast()}else t.zone==="B"&&t.param==="NOTR"?v.spellCast():super.handleAction(t)}levelActs(){const t=b.actionTarget("TB","CARD",this.code,"NOTR"),i=b.lvlHandActTarg(this.code,"");return i.deckPositionSkip=v.playPosition(),D.toActions([i,t])}}class os extends F{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} ${y.dbdtap()} on your turn, you may discard and level up a card.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}handleAction(t){L.levelAndDiscardA(t),v.actionDone(!0)}ddf8(t){const i=$.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId&&i.srcCreat.owner===A.getActiveB()}jr8(t){if(t.trigger.type==="FR"){if(L.allied("A")){const i=m.creatByTr(t),r=i.jr4("DM");r.interactive=!0,r.bonus=this.rawNug(0,0,0,0,.5,"TP"),i.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const i=D.toActions(b.lvlHandActTarg(this.code,""));i.length>0?(i.push(v.noneEndTrigger()),v.ddf5(i)):x.triggerDone()}}}class _e extends F{hitCreature;constructor(t,i){super(t),this.hitCreature=i}trigB;jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.trigB,r}ddf8(t){return t.event.battle&&t.event.isCreatTarg===this.hitCreature&&t.event.isCreatSrc&&t.event.srcId===t.creatId}}class hs extends _e{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=["ZZ-2"];const i=`When Oros ${y.dbdtap()}, you gain that much health.`,r=this.level===4?"Oros gets +attack and +health equal to your health.~":"";this.text=r+i,this.trigB=this.playerNug(this.iAttack/2,"TP")}jr3(t,i){const r=super.jr3(t,i);return this.level===4&&r.addEffect("PH",this.code),r}jr8(t){const i=t.event;A.heal(t.owner,i.dmg,this.code),x.triggerDone()}enforceEffect(t){const i=A.toPlayer(t.owner).health;t.status==="A"&&(t.removeModSafe(t.id,!1),t.addMod(b.mod("HL",i,t.id)),t.addMod(b.mod("MH",i,t.id)),t.addMod(b.mod("AT",i,t.id)))}}class ls extends F{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.level===2?this.iDefend=!0:this.hints=["ZZ-1"])}jr3(t,i){const r=super.jr3(t,i);if(this.level===3){const a=r.jr4("DM");a.bonus=this.regnNug(10,"TP")}else{const a=r.jr4("RU");a.bonus=this.regnNug(this.level,"TH")}return r}ddf8(t){if(t.trigger.type==="DM"){const i=t.event;return i.battle&&i.isCreatSrc&&i.srcId===t.creatId}return t.trigger.type==="RU"?t.event.playerA===t.owner:!1}jr8(t){if(t.trigger.type==="RU"){const i=m.creatByTr(t);m.birth(this.levelUpCard(),"R",i.owner,i.lane)}else if(t.trigger.type==="DM"){const i=$.toDamage(t.event);i.isCreatTarg?i.hurtCreat.addPoison(10):i.hurtPlayer.poison+=10}x.triggerDone()}}class cs extends F{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,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!this.l3,r}jr8(t){if(this.l3)m.creatByTarget(b.crEnemyTarg()).forEach(i=>{i.negateArmor=!0}),x.triggerDone();else{const i=b.crEnemyActTarg("CARD",this.code,""),r=D.toActions(i);r.length>0?v.ddf5(r):x.triggerDone()}}handleAction(t){const i=m.ddf6(t);this.logAct(!1,i),i.negateArmor=!0,v.actionDone(!0)}}class ee extends F{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)},["SST"]:{c:()=>this.sstC(),a:r=>this.sstA(r),t:r=>this.sstT(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,i){this.lookup(t).a(i)}testAct(t,i){return this.lookup(t).t(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}preFight=!1;prePlay=!1;canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){const i=D.boardTarget("CARD",this.code);i.param=t.id,this.preFight&&(i.hint=["BB"]),this.prePlay&&(i.hint=["DF"]),v.ddf5(D.toActions([i,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const i=m.jr5(t.param);this.runAct(this.cardCode(),i),i.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=[this.level===1?"ZZ-3":"ZZ-2"],this.prePlay=!0,this.text=`Activate: You may play an additional ${y.levelGateText(this.level)}Robot this turn.`,this.bonus=this.avgSpawnNug(),this.bonus.threat="TX"}afsT(t){return!0}afsA(t){const i=L.freeCard(this.code);i.condition.tribe="RB",i.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 ${y.jr9(this.level,0)} for each card discarded this way.`,this.bonus=this.buffNug(3*this.level,0,"TX")}drixT(t){return A.getActive().hand.length>0}drixA(t){const i=A.toPlayer(t.owner),r=i.hand.length*this.level;i.discard.push(...i.hand),i.hand=[];const a=b.crFriendTarg();a.tribe="MM",m.creatByTarget(a).forEach(c=>{c.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(K.fgoc(this.level));this.addSp("N",t.iAttack),this.text=`Activate, destroy five friendly Robot Guardians: Put a ${y.tokName(t)} into this lane.`,this.bonus=this.rawNug(0,0,0,0,1,"TW")}fggT(t){return m.creatByTarget(this.fggTarg()).length===5}fggA(t){const i=t.lane,r=t.owner,a=E.tick();m.creatByTarget(this.fggTarg()).forEach(c=>V.destroy(c,this.code,a)),m.birth(K.fgoc(this.level),"P",r,i)}fggTarg(){const t=b.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=this.playerNug(this.level*3,"TW")}mvpT(t){return!0}mvpA(t){const i=m.ddf1().length;A.heal(t.owner,i*this.level,this.code)}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 ${y.levelGateText(this.level)}Robot from your deck. That Robot gets ${y.jr9(this.level,0)} and Armor ${this.level}.`,this.bonus=this.avgSpawnNug(),this.bonus.threat="TX"}mmgT(t){return m.ddf1().length<5&&this.mmgBots().length>0}mmgA(t){const i=this.mmgBots(),r=i[S.randInt(0,i.length)],a=m.birth(r,"S",t.owner);a&&(a.addArmor(this.level),a.buff(this.level,0))}mmgBots(){const t=b.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=this.buffNug(2*this.iAttack,0,"TX")}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}sstC(){this.faction="U",this.rarity="C",this.name="Scatterspore Tiller",this.iHealth=this.boof61014,this.iAttack=this.iHealth-1,this.tribe.push("PL");const t=G.getCard(K.minionCode(this.level));this.text=`Activate: Spawn a ${y.tokName(t)}`,this.bonus=this.spawnNug(t,"TW")}sstT(t){return m.ddf1().length<5}sstA(t){m.birth(K.minionCode(this.level),"S",t.owner)}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 ${y.jr9(t,t)}.`,this.bonus=this.multNug(this.buffNug(t,t,"TX"),1.5)}upakT(t){return m.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const i=this.boof124;m.creatByTarget(this.upakTarg(t.id)).forEach(r=>{r.buff(i,i)})}upakTarg(t){const i=b.crFriendNotMeTarg(t);return i.faction="U",i}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=this.rawNug(0,0,0,0,.5,"TW")}wfmT(t){return!0}wfmA(t){const i=E.tick();m.creatByTarget(b.crEnemyTarg()).forEach(r=>{r.hurtDirect(t.attack,this.code,i)}),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 ${y.jr9(t,t)}.~If any enemy creatures are destroyed this way, Spawn one of them at random.`,this.bonus=this.buffNug(-t,-t,"TX")}xerxT(t){return this.xerxTargs().length>0}xerxA(t){const i=-this.boof135,r=[],a=E.tick();this.xerxTargs().forEach(f=>{f.buff(i,i,a),f.owner!==t.owner&&f.health<1&&r.push(f)});const c=r.length;c>0&&m.birth(r[S.randInt(0,c)].code,"S",t.owner)}xerxTargs(){return m.qActiveCreats().filter(t=>t.faction!=="N")}}class di extends F{lookup(t){return{["MDE"]:{c:()=>this.misdC(),f:r=>this.misdF(r)},["TAB"]:{c:()=>this.thraC(),f:r=>this.thraF(r)}}[t]}cardForge(t,i){this.lookup(t).f(i)}ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,i){const r=super.jr3(t,i);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");const t=this.level+3;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health.`}misdF(t){const i=this.level+3;A.hurtDirect(!t.owner,i,this.code),A.heal(t.owner,i,this.code)}thraC(){this.faction="T",this.rarity="C",this.name="Thranik Ambusher",this.iAttack=this.boof5813,this.iHealth=this.iAttack,this.tribe.push("DK");const t=this.boof234;this.ftext=`${this.name} gets ${y.jr9(t,t)}.`}thraF(t){const i=this.boof234;m.creatByTr(t).buff(i,i)}}class dt extends F{lookup(t){return{["ATT"]:{c:()=>this.atorC(),t:(r,a)=>this.atorT(r,a),b:(r,a)=>this.atorB(r,a)},["BRH"]:{c:()=>this.brhrC(),t:(r,a)=>this.friendoT(r,a),b:(r,a)=>this.brhrB(r,a)},["BWN"]:{c:()=>this.bulbC(),t:(r,a)=>this.friendoT(r,a),b:(r,a)=>this.bulbB(r,a)},["CDM"]:{c:()=>this.cmyC(),t:(r,a)=>this.cmyT(r,a),b:(r,a)=>this.cmyB(r,a)},["CYR"]:{c:()=>this.cycrC(),t:(r,a)=>this.cycrT(r,a),b:(r,a)=>this.cycrB(r,a)},["DHM"]:{c:()=>this.dhamC(),t:(r,a)=>this.donkforgeT(r,a),b:(r,a)=>this.donkforgeB(r,a)},["FGD"]:{c:()=>this.fgdC(),t:(r,a)=>this.fgdT(r,a),b:(r,a)=>this.fgdB(r,a)},["FSP"]:{c:()=>this.fspC(),t:(r,a)=>this.fspT(r,a),b:(r,a)=>this.fspB(r,a)},["HMF"]:{c:()=>this.hamfC(),t:(r,a)=>this.hamfT(r,a),b:(r,a)=>this.hamfB(r,a)},["HOS"]:{c:()=>this.hossC(),t:(r,a)=>this.hossT(r,a),b:(r,a)=>this.hossB(r,a)},["HOD"]:{c:()=>this.haroldC(),t:(r,a)=>this.ocarT(r,a),b:(r,a)=>this.haroldB(r,a)},["IDF"]:{c:()=>this.idfC(),t:(r,a)=>this.idfT(r,a),b:(r,a)=>this.idfB(r,a)},["OJC"]:{c:()=>this.ocarC(),t:(r,a)=>this.ocarT(r,a),b:(r,a)=>this.ocarB(r,a)},["RLW"]:{c:()=>this.restwandC(),t:(r,a)=>this.restwandT(r,a),b:(r,a)=>this.restwandB(r,a)},["RHW"]:{c:()=>this.ruthwandC(),t:(r,a)=>this.restwandT(r,a),b:(r,a)=>this.ruthwandB(r,a)},["SCZ"]:{c:()=>this.sczC(),t:(r,a)=>this.donkforgeT(r,a),b:(r,a)=>this.donkforgeB(r,a)},["SHA"]:{c:()=>this.smaC(),t:(r,a)=>this.donkforgeT(r,a),b:(r,a)=>this.donkforgeB(r,a)},["SSP"]:{c:()=>this.shspC(),t:(r,a)=>this.shspT(r,a),b:(r,a)=>this.shspB(r,a)},["SDR"]:{c:()=>this.spdryC(),t:(r,a)=>this.friendoT(r,a),b:(r,a)=>this.spdryB(r,a)},["TDW"]:{c:()=>this.tdwC(),t:(r,a)=>this.tdwT(r,a),b:(r,a)=>this.tdwB(r,a)},["TNL"]:{c:()=>this.tnlC(),t:(r,a)=>this.tnlT(r,a),b:(r,a)=>this.tnlB(r,a)},["USY"]:{c:()=>this.usyC(),t:(r,a)=>this.donkforgeT(r,a),b:(r,a)=>this.donkforgeB(r,a)},["UTR"]:{c:()=>this.urexC(),t:(r,a)=>this.urexT(r,a),b:(r,a)=>this.urexB(r,a)}}[t]}testBirth(t,i){return this.lookup(t).t(i,$.toEnterField(i.event))}actBirth(t,i){this.lookup(t).b(i,$.toEnterField(i.event))}iTrigger=!0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i);if(this.iTrigger){const a=r.jr4("EF");a.bonus=this.trigB}return r}ddf8(t){return this.testBirth(this.cardCode(),t)}jr8(t){this.actBirth(this.cardCode(),t),x.triggerDone()}friendoT(t,i){return t.trigger.creatId!==i.creature.id&&i.creature.owner===t.owner}donkforgeT(t,i){return this.friendoT(t,i)&&i.creature.isTribe("DF")}donkforgeB(t,i){this.logAct(!1),m.creatByTr(t).buff(this.level,this.level)}dftxt(){this.text=`When another friendly Darkforged enters play, ${this.name} gets ${y.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level,"TS"),.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 ${y.levelGateText(this.level)}creature gets Assault: Aggressive.`,this.trigB=this.rawNug(0,0,0,0,.5,"TX")}atorT(t,i){return i.forged&&this.friendoT(t,i)&&D.levelTargetTest(D.ddf2(this.level),i.creature.level)&&!i.creature.opposed}atorB(t,i){i.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 ${y.jr9(this.level,this.level)}. Then ${this.name} gets ${y.jr9(-this.level,-this.level)}.`}brhrB(t,i){dt.itBirthedFirst(i.creature.id,t.creatId)&&(this.logAct(!1,i.creature),i.creature.buff(this.level,this.level),m.creatByTr(t).buff(-this.level,-this.level))}bulbC(){this.faction="A",this.rarity="H",this.name="Bulwark Battalion",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("GN");const t=this.boof468;this.text=`When another friendly creature enters play, it gets Armor ${t} until the end of the turn.`,this.trigB=this.regnNug(t,"TW")}bulbB(t,i){dt.itBirthedFirst(i.creature.id,t.creatId)&&(this.logAct(!1,i.creature),i.creature.addMod(b.modT("AR",this.boof468)))}cmyC(){this.faction="T",this.rarity="H",this.name="Cauldron Mystic",this.iAttack=this.boof357,this.iHealth=this.boof71015,this.tribe.push("YT"),this.text=`When a friendly creature enters play, deal ${this.boof234} damage to an enemy creature or player at random.`,this.trigB=this.buffNug(0,this.iAttack,"TX")}cmyT(t,i){return i.creature.owner===t.owner}cmyB(t,i){if(dt.itBirthedFirst(i.creature.id,t.creatId)){const r=m.qPlayerCreats(!t.owner),a=S.randInt(0,r.length+1);a===r.length?A.hurtDirect(!t.owner,this.boof234,this.code):r[a].hurtDirect(this.boof234,this.code)}}cycrC(){this.faction="T",this.rarity="H",this.name="Cyclone Rider",this.iAttack=this.lValN([8,10,16]),this.iHealth=this.iAttack/2,this.tribe.push("WN","AS"),this.level===1&&(this.hints=["ZZ-2"]),this.text=`When an enemy creature enters play, if it is unopposed, move ${this.name} to the lane opposing that creature.`,this.trigB=this.rawNug(0,0,0,0,.5)}cycrT(t,i){return i.creature.owner!==t.owner&&!i.creature.opposed}cycrB(t,i){i.creature.opposed||m.creatByTr(t).move(m.oppositeLane(i.creature.lane))}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(K.fgoc(this.level));this.text=`When ${this.name} enters play, if there is a friendly Alpha Beta, and Gamma, put a ${y.tokName(t)} in your discard pile.`}fgdT(t,i){return i.creature.id===t.creatId}fgdB(t,i){const r=m.qPlayerCreats(t.owner).map(a=>a.code.slice(0,3));if(r.includes("FGA")&&r.includes("FGB")&&r.includes("FGG")){const a=A.toPlayer(t.owner);a.discard.push(K.fgoc(this.level));const c=b.trigger("NT",this.code);c.bonus=this.rawNug(0,0,0,0,10),a.triggers.push(c)}}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){this.text=`When you Forge a ${y.levelGateText(this.level-1)}creature, ${this.name} gets +attack equal to that creature's attack.`;const t=this.avgCreatureStats(this.level-1);this.trigB=this.buffNug(t[0],0),"TS"}}fspT(t,i){return!!(i.forged&&i.creature.owner===t.owner&&G.getCard(i.creature.code).level0&&m.creatByTr(t).move(r[S.randInt(0,a)])}hossC(){this.faction="U",this.rarity="R",this.name="Harbinger of Spring",this.iAttack=this.lValN([5,8,11]),this.iHealth=this.iAttack,this.tribe.push("DY");const t=this.boof234;this.text=`When another friendly creature enters play, if it wasn't Forged, ${this.name} gets ${y.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),1.5)}hossT(t,i){return this.friendoT(t,i)&&!i.forged}hossB(t,i){const r=this.boof234;this.logAct(!1,i.creature),m.creatByTr(t).buff(r,r)}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,"TX")}haroldB(t,i){if(dt.itBirthedFirst(i.creature.id,t.creatId)){const r=m.creatByTr(t);A.hurtDirect(!r.owner,r.attack,this.code)}}idfC(){this.faction="N",this.rarity="H",this.name="Indomitable Fiend",this.iAttack=2,this.iHealth=2,this.maxLevel=1,this.tribe.push("ZB"),this.hints=["ST","ZZ+1"],this.text=`When ${this.name} enters play, if it wasn't Forged, it gets ${y.jr9(5,5)} for each player rank you are.`}idfT(t,i){return i.creature.id===t.creatId&&!i.forged}idfB(t,i){const r=5*A.toPlayer(t.owner).rank;i.creature.buff(r,r)}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 ${y.jr9(t,0)}.`,this.trigB=this.buffNug(-.5*t,0,"TX")}ocarT(t,i){return i.creature.owner!==t.owner&&!i.forged}ocarB(t,i){dt.itBirthedFirst(i.creature.id,t.creatId)&&i.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 ${y.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),.5)}restwandT(t,i){return this.friendoT(t,i)&&i.creature.isTribe("WD")}restwandB(t,i){const r=this.boof369;this.logAct(!1),m.creatByTr(t).buff(r,r)}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,i=-t;this.text=`When another friendly Spirit Wanderer enters play, the creature opposing this gets ${y.jr9(i,i)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TW"),.5)}ruthwandB(t,i){const r=m.creatByTr(t).opposed;if(r){const a=-this.boof369;this.logAct(!1,r),r.buff(a,a)}}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,"TX")}shspT(t,i){return this.friendoT(t,i)&&i.forged&&i.creature.isTribe("DF")}shspB(t,i){dt.itBirthedFirst(i.creature.id,t.creatId)&&m.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 another friendly creature enters play, ${this.name} gets ${y.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level,"TS"),1.5)}spdryB(t,i){this.logAct(!1,i.creature),m.creatByTr(t).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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TX")}tdwT(t,i){return i.creature.owner===t.owner&&!i.forged}tdwB(t,i){if(dt.itBirthedFirst(i.creature.id,t.creatId)){const r=this.boof246;i.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,i=G.getCard(K.zomc(this.level));this.text=`Forge: Spawn a ${y.tokName(i)} for each friendly creature that was destroyed this turn.~When a friendly Zombie enters play, ${this.name} gets ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS")}tnlT(t,i){return i.creature.owner===t.owner&&i.creature.isTribe("ZB")}tnlB(t,i){const r=this.boof124;m.creatByTr(t).buff(r,r)}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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TW")}urexT(t,i){return this.friendoT(t,i)&&i.creature.isTribe("DN")}urexB(t,i){if(dt.itBirthedFirst(i.creature.id,t.creatId)){const r=this.boof124;i.creature.buff(r,r)}}static itBirthedFirst(t,i){if(t===i)return!0;let r=!1;const a=V.findDeathTime(i);if(S.isUn(a))r=!0;else{const c=m.findBirthTime(t);(S.isUn(c)||c<=a)&&(r=!0)}return r}}class ue extends _e{lookup(t){return{["AGM"]:{c:()=>this.agamC(),h:(r,a,c,f)=>this.agamH(r,a,c,f)},["BWK"]:{c:()=>this.blwalkC(),h:(r,a,c,f)=>this.blwalkH(r,a,c,f)},["BRF"]:{c:()=>this.bfangC(),h:(r,a,c,f)=>this.bfangH(r,a,c,f)},["CDT"]:{c:()=>this.cadtC(),h:(r,a,c,f)=>this.cadtH(r,a,c,f)},["FSL"]:{c:()=>this.fslmC(),h:(r,a,c,f)=>this.fslmH(r,a,c,f)},["GSC"]:{c:()=>this.gcobC(),h:(r,a,c,f)=>this.gcobH(r,a,c,f)},["IHA"]:{c:()=>this.ibhaC(),h:(r,a,c,f)=>this.ibhaH(r,a,c,f)},["SHS"]:{c:()=>this.shimfC(),h:(r,a,c,f)=>this.shimfH(r,a,c,f)}}[t]}image(t){return this.rarity==="T"?this.fixedImage(t):this.leveledImage(t)}cardConstruct(t){this.lookup(t).c()}creatHit(t,i,r,a,c){this.lookup(t).h(i,r,a,c)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const i=$.toDamage(t.event);this.creatHit(this.cardCode(),t,i,i.srcCreat,i.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} ${y.dbdtac()} on your turn, this battles again.`,this.trigB=this.buffNug(this.iAttack/2,0)}agamH(t,i,r,a){t.owner===A.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} ${y.dbdtac(this.level)}, destroy that creature.`,this.trigB=this.avgSpawnNug()}blwalkH(t,i,r,a){a.status==="A"&&D.levelTestCommon(a.level,this.level)&&V.destroy(a,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,i,r,a){a.addPoison(this.iAttack)}poisonText(t){return`When ${this.name} ${y.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,i,r,a){a.addPoison(this.iAttack)}fslmC(){this.faction="N",this.rarity="C",this.name="Festering Slime",this.iAttack=this.level,this.iHealth=this.boof61218,this.tribe.push("OZ");const t=this.level+2;this.text=`When ${this.name} ${y.dbdtac()}, that creature gets ${y.jr9(-t,-t)}.`,this.trigB=this.buffNug(t,t)}fslmH(t,i,r,a){const c=this.lValN([-3,-4,-5]);a.buff(c,c)}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,i,r,a){a.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 ${y.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${y.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,i,r,a){if(a.status==="A"){const c=this.level===4?a.attack*-1:this.boof246n;a.buff(c,0),m.fling(a)}}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} ${y.dbdtac()}, that creatures gets that much Poison.`,this.trigB=this.regnNug(this.iAttack)}shimfH(t,i,r,a){a.addPoison(i.dmg)}}class Yt extends _e{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(r,a,c)=>this.ashyH(r,a,c)},["AMY"]:{c:()=>this.ashmC(),h:(r,a,c)=>this.ashyH(r,a,c)},["CFB"]:{c:()=>this.cfbC(),h:(r,a,c)=>this.cfbH(r,a,c)},["EPS"]:{c:()=>this.epsdC(),h:(r,a,c)=>this.epsdH(r,a,c)},["EFM"]:{c:()=>this.efmC(),h:(r,a,c)=>this.efmH(r,a,c)},["FBC"]:{c:()=>this.fbcC(),h:(r,a,c)=>this.fbcH(r,a,c)},["RTS"]:{c:()=>this.rzstC(),h:(r,a,c)=>this.rzstH(r,a,c)},["RSE"]:{c:()=>this.rselC(),h:(r,a,c)=>this.rselH(r,a,c)},["SVH"]:{c:()=>this.strhyC(),h:(r,a,c)=>this.strhyH(r,a,c)},["URB"]:{c:()=>this.uridC(),h:(r,a,c)=>this.uridH(r,a,c)},["VES"]:{c:()=>this.veskC(),h:(r,a,c)=>this.veskH(r,a,c)}}[t]}cardConstruct(t){this.lookup(t).c()}creatHit(t,i,r,a){this.lookup(t).h(i,r,a)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}jr8(t){const i=$.toDamage(t.event);i.srcCreat&&(this.bothTurns||i.srcCreat.owner===A.getActiveB())&&this.creatHit(this.cardCode(),t,i,i.srcCreat),x.triggerDone()}ashyC(){this.faction="T",this.rarity="C",this.tribe.push("FR","AS");const t=this.boof124;this.text=`When ${this.name} ${y.dbdtap()}, it gets ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TP")}ashyH(t,i,r){const a=this.boof124;r.buff(a,a)}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} ${y.dbdtap()}, deal that much damage to that player again.`,this.trigB=this.playerNug(this.iAttack/2,"TP")}cfbH(t,i,r){A.hurtDirect(!r.owner,i.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} ${y.dbdtap()} on your turn, draw a card at the end of the turn.`,this.trigB=this.rawNug(0,0,0,0,.2,"TP")}epsdH(t,i,r){const a=b.trigger("TE","EPH"+this.level);a.changes=!0,a.bonus=this.rawNug(0,0,0,0,ut.dcWeight),A.toPlayer(t.owner).triggers.push(a)}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} ${y.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,"TP")}efmH(t,i,r){if(A.getActiveB()===r.owner)for(let a=0;ac.hurtDirect(i.dmg,this.code,a))}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} ${y.dbdtap()}, it gets ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TP")}rzstH(t,i,r){const a=this.boof235;r.buff(a,a)}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} ${y.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,i,r){r.hurtDirect(i.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} ${y.dbdtap()}, it gets Regenerate ${this.level}.`,this.trigB=this.regnNug(this.level,"TP")}strhyH(t,i,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} ${y.dbdtap()} on your turn, each friendly creature gets ${y.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`,this.trigB=this.buffNug(t,t,"TP")}uridH(t,i,r){const a=this.boof124,c=this.level===3;m.ddf1().forEach(f=>{f.buff(a,a),c&&(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="",i=.5;this.level===3&&(t=" Then Spawn a copy of that creature."),this.text=`When Vyric ${y.dbdtap()}, destroy an enemy ${y.levelGateText(this.level)}creature at random.`+t,this.trigB=this.multNug(this.avgSpawnNug(),i),this.trigB.threat="TP"}veskH(t,i,r){const a=b.crTarg();a.player=A.toTarget(i.hurtPlayer),a.level=D.ddf2(this.level);const c=m.creatByTarget(a);if(c.length>0){const f=E.tick(),p=c[S.randInt(0,c.length)];V.destroy(p,this.code,f),this.level===3&&m.birth(p.code,"S",r.owner,void 0,f)}}}class z extends F{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)},["ATI"]:{c:()=>this.atiC(),f:r=>this.atiF(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)},["REW"]:{c:()=>this.rewC(),f:r=>this.rewF(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,i){this.lookup(t).f(i)}ftext="";forges=!0;flanks;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let i="";this.flanks&&(i="Flank"),this.forges&&(i?i="Forge/"+i:i=y.forglied(this.allied)),i&&(this.text=i+": "+this.ftext),this.ftext=""}image(t){return this.rarity==="T"?super.fixedImage(t):super.image(t)}jr3(t,i){const r=super.jr3(t,i);if(this.forges&&r.jr4("FR"),this.flanks){const a=r.jr4("FK");a.bonus=this.flanks}return r}ddf8(t){return Nt.extractCardCode(t.trigger.logicCode)==="MMR"}jr8(t){const i=this.cardCode();if(t.trigger.type==="TE"&&i==="MMR"){this.logAct(!1);const r=t.event,a=A.toPlayer(r.playerA);A.drawCard(a,this.level);const c=b.trigIdx(a.triggers,t.trigger);c>-1&&a.triggers.splice(c,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 i=b.crFriendTarg();i.hasArmor=!0;const r=E.tick();m.creatByTarget(i).forEach(a=>{a.opposed&&a.opposed.hurtDirect(a.armor,a.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 i=A.toPlayer(t.owner),r=b.target("TH");r.player=A.toTarget(i),r.tribe="MM";const a=D.deckByTarget(r),c=a.length;if(c>0){const f=a[S.randInt(0,c)];i.deck.splice(f[1],1),i.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.forges&&(this.ftext=`You may play an additional ${y.levelGateText(this.level-1)}Tempys spell this turn.`,this.addSp("C",0))}afsF(t){const i=L.freeCard(this.code);i.condition.card="S",i.condition.level=D.ddf2(this.level-1),i.condition.faction="T"}atiC(){this.faction="T",this.rarity="L",this.name="Avarice, the Insatiable",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.iMobile=1,this.tribe.push("DG");let t="";this.level<3&&(t="Discard down to one card at random. "),this.ftext=`${t}You may play an additional spell this turn.`}atiF(t){if(this.level<3){const r=A.toPlayer(t.owner);if(r.hand.length>1){let a=r.hand.slice(),c=[];for(;a.length>1;)c.push(a.splice(S.randInt(0,a.length),1)[0]);r.discard.push(...c),r.hand=a}}const i=L.freeCard(this.code);i.condition.card="S"}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 i=m.creatByTarget(b.crFriendNotMeTarg(t.creatId)),r=i.length;if(r<4&&r>0){const a=i[S.randInt(0,r)],c=m.emptyLanes(a.owner);this.logAct(!1,a),a.move(c[S.randInt(0,c.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 ${y.levelGateText(t)}Uterra creature this turn.`,this.consistent=!0,this.addSp("C",0)}else this.hints=["LG"]}bwtF(t){const i=L.freeCard(this.code);i.condition.card="C",i.condition.faction="U",i.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 i=this.boof51015,r=b.crFriendTarg();r.tribe="RB",r.canArmor=!0,m.creatByTarget(r).forEach(c=>{c.addMod(b.modT("AR",i))})}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){L.allied(this.allied)&&m.creatByTr(t).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,"TS"),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${y.jr9(-1*t,0)} and this gets ${y.jr9(t,0)}.~Allied Tempys: Mobility ${this.level}.`}bfmF(t){const r=$.toEnterField(t.event).creature;t.trigger.type==="FR"&&L.allied("T")&&r.addMobility(this.level);const a=r.opposed;if(a){const c=this.boof246;a.buff(-1*c,0),r.buff(c,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 ${y.jr9(t,t)}.`}charnF(t){const i=this.boof357,r=b.crEnemyTarg();r.maxAttack=i,m.creatByTarget(r).length>0&&m.creatByTr(t).buff(i,i)}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 ${y.jr9(1,0)} for each other friendly creature.`}chihF(t){const i=m.ddf1().length;i>1&&m.creatByTr(t).buff(i-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,"TX"),this.ftext="Deal damage equal to its attack to the opposing creature. If unopposed, deal that damage to the enemy player instead."}chickenF(t){const i=$.toEnterField(t.event),r=i.creature.attack,a=i.creature.opposed;a?a.hurtDirect(r,this.code):A.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 i=b.crTarg();i.maxAttack=1;const r=m.creatByTarget(i),a=E.tick();r.forEach(c=>{V.destroy(c,this.code,a)})}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 i=b.crFriendNotMeTarg(t.creatId);i.tribe="DF";const r=this.boof234*m.creatByTarget(i).length;r>0&&(A.hurtDirect(!t.owner,r,this.code),A.heal(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 ${y.jr9(this.iAttack,this.iHealth)}.`}dbaF(t){m.ddf1().length===5&&m.creatByTr(t).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");const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${y.jr9(-t,0)} and this gets ${y.jr9(t,0)}.`}drbF(t){const i=$.toEnterField(t.event),r=i.creature.opposed;if(r){const a=this.boof246;r.buff(-a,0),i.creature.buff(a,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.flanks.threat="TX",this.ftext=`Destroy the opposing ${y.levelGateText(this.level)}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){L.allied(this.allied)&&m.creatByTr(t).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 ${y.levelGateText(t)}creature this turn.`,this.level===1&&(this.hints=["LG"])}fwtF(t){const i=L.freeCard(this.code);i.condition.card="C",i.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 ${y.jr9(4,4)}.`}gwurmF(t){m.qEnemyCreats().length===0&&m.creatByTr(t).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 i=this.boof51015;A.heal(t.owner,i,this.code)}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){A.toPlayer(t.owner).hand.length>4&&(L.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 i=$.toEnterField(t.event);i.creature.addModSafe(b.modT("ND",!0,i.creatId))}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 ${y.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`}legtitF(t){const i=b.crEnemyTarg();i.maxAttack=this.boof357;const r=m.creatByTarget(i);if(r.length>0){const a=this.level*r.length;m.creatByTr(t).buff(a,a)}}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 ${y.jr9(t,t)}.`}lbdF(t){const i=m.creatByTarget(b.crFriendNotMeTarg(t.creatId));if(i.length===4){const r=this.boof236;i.forEach(a=>a.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 i=V.gravedigger();i&&m.birth(i,"S",t.owner)}else if(this.level===3){const i=m.emptyLanes(t.owner),r=i.map(a=>V.gravedigger());if(i.length>0&&r[0]){const a=E.tick();i.forEach((c,f)=>{m.birth(r[f],"P",t.owner,c,a)})}}}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 ${y.levelGateText(this.level-1)}spell this turn.`}moeF(t){const i=L.freeCard(this.code);i.condition.card="S",i.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){A.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 i=b.crFriendNotMeTarg(t.creatId);if(i.tribe="MM",m.creatByTarget(i).length>0){const r=b.trigger("TE",this.code);r.changes=!0,r.bonus=this.rawNug(0,0,0,0,this.level*ut.dcWeight),A.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 i=b.crFriendTarg();i.tribe="MM",A.drawCard(t.owner,m.creatByTarget(i).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 ${y.jr9(0,this.boof357)}.`}mossF(t){const i=b.crFriendNotMeTarg(t.creatId);i.tribe="DN";const r=this.boof357;m.creatByTarget(i).forEach(a=>a.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");const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`}nysymF(t){const i=$.toEnterField(t.event);i.creature.opposed&&i.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 ${y.jr9(t,0)}.`}ofmF(t){const i=this.boof135;m.creatByTarget(b.crFriendNotMeTarg(t.creatId)).forEach(a=>{a.buff(i,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.ftext=`${this.name} gets Armor ${this.iAttack} this turn.`}orpF(t){m.creatByTr(t).addMod(b.modT("AR",this.iAttack))}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){L.allied(this.allied)&&m.creatByTr(t).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 ${y.jr9(this.boof123n,0)}.`}phmF(t){const i=this.boof123n;m.qEnemyCreats().forEach(r=>{r.buff(i,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,"TW"),.5),this.ftext=`If ${this.name} is in the center lane, Spawn a copy.`}palsF(t){$.toEnterField(t.event).creature.lane===3&&m.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 ${y.jr9(this.iAttack,0)} this turn.`}pokF(t){L.patron("T")&&m.ddf1().forEach(i=>{i.addMod(b.modT("AT",this.iAttack))})}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 ${y.jr9(t,t)}.`}potF(t){if(L.patron("N")){const i=m.qEnemyCreats();if(i.length>0){const r=this.potbuf;this.logAct(!1),i.forEach(a=>{a.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 i=m.creatByTarget(b.crEnemyTarg()),r=i.length;if(r===0)A.hurtDirect(!t.owner,this.iHealth,this.code);else{const a=E.tick(),c=r+1,f=Array(c).fill(0);for(let p=0;p{f[k]>0&&p.hurtDirect(f[k],this.code,a)}),f[r]>0&&A.hurtDirect(!t.owner,f[r],this.code)}}rewC(){this.faction="U",this.rarity="L",this.name="Ramble, Eternal Witness",this.iAttack=this.boof3712,this.iHealth=this.iAttack+3+this.level,this.tribe.push("HM"),this.level===3?this.ftext="Spawn a random creature from your deck.":this.ftext=`Shuffle the level ${this.level+1} version of this from your discard pile into your deck.`}rewF(t){if(this.level===3){const i=b.target("DK");i.player="F",i.card="C";const r=D.deckByTarget(i).map(a=>a[0]);r.length>0&&m.birth(r[S.randInt(0,r.length)],"S",t.owner)}else{const i=A.getActive(),r=this.levelUpCard();i.discard.splice(i.discard.lastIndexOf(r),1),i.deck.push(r),lt.simOn||Et.shuffleDeck(i)}}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 i=$.toEnterField(t.event),r=!t.owner;if(this.level===2){const a=i.creature.opposed;a&&a.hurtDirect(5,this.code)}else if(this.level===3){const a=E.tick();m.qPlayerCreats(r).forEach(c=>c.hurtDirect(5,this.code,a)),A.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 ${y.jr9(-6,0)} and ${this.name} gets ${y.jr9(6,0)} for each enemy creature.`}scythF(t){const i=m.qEnemyCreats();i.forEach(r=>{r.buff(-6,0)}),i.length>0&&m.creatByTr(t).buff(6*i.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.level===3){const t=this.avgCreatureStats();this.flanks=this.buffNug(t[0]*2,0,"TS")}this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`}souldrF(t){const i=$.toEnterField(t.event),r=i.creature.opposed;if(r){const a=r.attack;i.creature.buff(a,0),r.buff(-1*a,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 ${y.jr9(this.iAttack,this.iHealth)} for each creature that was destroyed this turn.`}ssggF(t){const i=this.iAttack*(L.deathsA.length+L.deathsB.length);i>0&&m.creatByTr(t).buff(i,i)}splgC(){this.faction="N",this.rarity="T",this.name="Spiderling",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("SP"),this.ftext=`Replace the opposing ${y.levelGateText(this.level)}creature with a Web.`}splgF(t){const i=$.toEnterField(t.event);if(i.creature.opposed){const r=i.creature.opposed;D.levelTestCommon(r.level,this.level)&&m.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 i=this.boof468;A.heal(!0,i,this.code),A.heal(!1,i,this.code)}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 i=m.searchByLane(3,t.owner);i&&i.id!==t.creatId&&!i.negateArmor&&i.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 a=m.emptyLanes(t.owner),c=a.length;if(c===0)r=!1;else{const f=a[S.randInt(0,c)];m.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 i=m.creatByTr(t),r=i.lane,a=i.owner,c=[];if(r>2){const f=m.searchByLane(r-1,a);f&&(m.searchByLane(r-2,a)||(c.push(f),f.move(r-2)))}if(r<4){const f=m.searchByLane(r+1,a);f&&(m.searchByLane(r+2,a)||(c.push(f),f.move(r+2)))}c.length>0&&this.logAct(!1,...c)}tortex(t){return`Put a level ${this.level} ${t} into your hand.`}handhoss(t,i){const r=A.toPlayer(i),a=t+this.level;r.hand.push(a)}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){L.allied(this.allied)&&(m.creatByTr(t).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.ftext=`Each friendly Yeti deals ${this.iAttack} damage to the opposing creature.`}uwarF(t){const i=b.crFriendTarg();i.tribe="YT";const r=E.tick();m.creatByTarget(i).forEach(a=>{const c=a.opposed;c&&c.hurtDirect(this.iAttack,a.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 ${y.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const i=b.crFriendNotMeTarg(t.creatId);i.tribe="YT";const r=this.stokeboof;m.creatByTarget(i).forEach(a=>{a.addMod(b.modT("AT",r))})}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,"TX");let i="";this.level===3&&(i=" If that creature has 0 or less attack, destroy it.",this.flanks.count=1),this.ftext=`The opposing creature gets ${y.jr9(t,0)}.${i}`}uiwF(t){const a=$.toEnterField(t.event).creature.opposed;a&&(a.buff(this.boof246n,0),this.level===3&&a.attack<1&&V.destroy(a,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");const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${y.jr9(t,t)}.`}umaulF(t){const i=$.toEnterField(t.event);if(i.creature.opposed){const r=this.boof246;i.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=(i,r)=>`If there is ${r?"an":"no"} opposing creature, put a level ${this.level} Iztek's ${i} into your hand.`;this.ftext=`${t("Frost",!0)} ${t("Flame",!1)}`}vlfxF(t){const i=$.toCreature(t.event);this.handhoss(i.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 a=m.creatByTarget(b.crNotMeTarg(t.creatId));if(a.length>0){const c=E.tick();a.forEach(f=>V.destroy(f,this.code,c))}}const i=t.owner?L.deathsA:L.deathsB,r=i.length;r>0&&m.birth(i[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 ${y.jr9(1,1).replaceAll("1","X")}, where X is the total amount of Poison on each enemy creature.`}vdrkF(t){const i=m.qEnemyCreats();let r=0;i.forEach(a=>{r+=a.poison}),r>0&&m.creatByTr(t).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 i=b.crEnemyTarg();if(i.hasPoison=!0,m.creatByTarget(i).forEach(a=>{a.addPoison(a.poison)}),this.level===3){const a=A.toPlayer(!t.owner);a.poison+=A.totalPoison(a)}}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 ${y.jr9(3,0)}.`}warF(t){const i=b.crFriendNotMeTarg(t.creatId);m.creatByTarget(i).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 ${y.jr9(t,t)}.`}wwpF(t){const i=this.boof235,r=b.crFriendTarg();r.maxAttack=this.boof357,m.creatByTarget(r).forEach(a=>a.buff(i,i))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("ST");const t=this.boof247n;this.flanks=this.buffNug(-t,-t),this.ftext=`The opposing creature gets ${y.jr9(t,t)}.`}wfbF(t){const r=$.toEnterField(t.event).creature.opposed;if(r){const a=this.boof247n;r.buff(a,a)}}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 i=m.creatByTarget(b.crFriendNotMeTarg(t.creatId));if(i.length>0){const r=E.tick();i.forEach(a=>V.destroy(a,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 ${y.jr9(t,t)}.`}zdkF(t){const i=this.boof246,r=b.crFriendTarg();r.hasRegen=!0,m.creatByTarget(r).forEach(a=>a.buff(i,i))}}class Se extends F{lookup(t){return{["AMP"]:{c:()=>this.aprmC(),f:(r,a)=>this.aprmR(r,a)},["DOV"]:{c:()=>this.dovC(),f:(r,a)=>this.dovR(r,a)},["LMD"]:{c:()=>this.lmdC(),f:(r,a)=>this.lmdR(r,a)},["MDR"]:{c:()=>this.metaC(),f:(r,a)=>this.metaR(r,a)},["NCP"]:{c:()=>this.ncplC(),f:(r,a)=>this.ncplR(r,a)},["ORC"]:{c:()=>this.ordcC(),f:(r,a)=>this.ordcR(r,a)}}[t]}get formation(){return!0}actFormation(t,i){this.lookup(t).f(i,$.toEnterField(i.event))}ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Formation: "+this.ftext,this.ftext=""}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FM"),r}jr8(t){this.actFormation(this.cardCode(),t),x.triggerDone()}aprmC(){this.faction="A",this.rarity="H",this.name="Automation Prime",this.iHealth=this.boof468,this.iAttack=this.iHealth+4,this.tribe.push("RB"),this.ftext=`${this.name} gets Armor ${this.iHealth}.`}aprmR(t,i){i.creature.addArmor(this.iHealth)}dovC(){this.faction="N",this.rarity="R",this.name="Disciple of Vyric",this.iAttack=this.boof6915,this.iHealth=this.iAttack-2,this.tribe.push("VP");const t=this.boof468;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health.`}dovR(t,i){const r=this.boof468;A.hurtDirect(!t.owner,r,this.code),A.heal(t.owner,r,this.code)}lmdC(){this.faction="N",this.rarity="L",this.name="Lichmane Dragon",this.iAttack=this.boof6915,this.iHealth=this.iAttack+1,this.iMobile=1,this.tribe.push("ST","DG"),this.ftext="Spawn an enemy creature that was destroyed this game."}lmdR(t,i){const r=V.gravedigger(A.toTarget(!t.owner));if(r){const a=m.birth(r,"S",t.owner);a&&this.logAct(!1,a)}}metaC(){this.faction="A",this.rarity="R",this.name="Metadata Redactor",this.iAttack=this.boof6915,this.iHealth=this.iAttack-1,this.tribe.push("MM"),this.ftext="Remove all abilities from each friendly adjacent creature."}metaR(t,i){const r=b.crTarg();r.player=A.toTarget(t.owner),r.lanes=i.creature.adjacent,m.creatByTarget(r).forEach(a=>a.wipeAll())}ncplC(){this.faction="N",this.rarity="H",this.name="Necroplasm",this.iAttack=this.lValN([5,8,9]),this.iHealth=this.lValN([7,13,19]),this.tribe.push("OZ"),this.ftext="The enemy player discards a card at random."}ncplR(t,i){const r=A.toPlayer(!t.owner),a=r.hand.length;if(a>0){r.discard.push(r.hand.splice(S.randInt(0,a),1)[0]);const c=b.trigger("NT",this.code);c.bonus=this.rawNug(0,0,0,0,.5),A.toPlayer(t.owner).triggers.push(c)}}ordcC(){this.faction="A",this.rarity="C",this.name="Ordnance Captain",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.boof61014,this.tribe.push("HM"),this.ftext=`Each friendly creature gets ${y.jr9(this.boof235,0)}.`}ordcR(t,i){const r=this.boof235;m.qPlayerCreats(t.owner).forEach(a=>a.buff(r,0))}}class Ue extends F{lookup(t){return{["PYM"]:{c:()=>this.pymC(),g:(r,a)=>this.pymG(r,a)},["RBG"]:{c:()=>this.rbgC(),g:(r,a)=>this.rbgG(r,a)},["SRV"]:{c:()=>this.sprvC(),g:(r,a)=>this.sprvG(r,a)},["TGK"]:{c:()=>this.tgkC(),g:(r,a)=>this.tgkG(r,a)}}[t]}onGain(t,i){this.lookup(t).g(i,i.event)}hPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("LG",this.code);return a.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,"TW")}pymG(t,i){A.hurtDirect(i.playerA,i.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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS")}rbgG(t,i){const r=this.boof135;m.creatByTr(t).buff(r,r)}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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS"),this.hints=["ZZ-1"]}sprvG(t,i){const r=this.boof234;m.creatByTr(t).buff(r,r)}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 ${K.minionName(this.level)}.`,this.trigB=this.rawNug(.5,3,3,0,0,"TW")}tgkG(t,i){const r=this.lValS(["SXD","SPL","TTF"])+this.level;m.birth(r,"S",t.owner)}}class Fe extends F{lookup(t){return{["AWU"]:{c:()=>this.awuC(),m:(r,a)=>this.awuM(r,a)},["EWE"]:{c:()=>this.eweC(),m:(r,a)=>this.eweM(r,a)},["FFM"]:{c:()=>this.ffmC(),m:(r,a)=>this.ffmM(r,a)},["LUC"]:{c:()=>this.lugC(),m:(r,a)=>this.lugM(r,a)},["WBH"]:{c:()=>this.wbhC(),m:(r,a)=>this.wbhM(r,a)}}[t]}onMove(t,i){this.lookup(t).m(i,$.toCreature(i.event))}mPlayer=0;trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("MV");return a.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 i=$.toCreature(t.event);return this.mPlayer===1?t.owner===i.creature.owner:t.owner!==i.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,"TW")}awuM(t,i){A.hurtDirect(!i.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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TX")}eweM(t,i){const r=this.boof124;i.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,"TX")}ffmM(t,i){const r=i.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,"TX")}lugM(t,i){t.owner===A.getActiveB()&&(m.creatByTr(t).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 ${y.jr9(this.level,this.level)}.`,this.trigB=this.buffNug(this.level,this.level,"TS")}wbhM(t,i){m.creatByTr(t).buff(this.level,this.level)}}class Gt extends F{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.agrdP(r,a)},["ART"]:{c:()=>this.arootC(),t:(r,a)=>this.factionSpellMyTurn(r,a),p:(r,a)=>this.arootP(r,a)},["ATS"]:{c:()=>this.atrapC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.atrapP(r,a)},["ARB"]:{c:()=>this.arbysC(),t:(r,a)=>this.enemyPlayed(r,a),p:(r,a)=>this.arbysP(r,a)},["BLH"]:{c:()=>this.bblhC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.bblhP(r,a)},["CYC"]:{c:()=>this.ccC(),t:(r,a)=>this.factionSpellMyTurn(r,a),p:(r,a)=>this.ccP(r,a)},["DHW"]:{c:()=>this.dhwC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.dhwP(r,a)},["FBI"]:{c:()=>this.fbiC(),t:(r,a)=>this.factionSpellMyTurn(r,a),p:(r,a)=>this.fbiP(r,a)},["FLS"]:{c:()=>this.flspkC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.flspkP(r,a)},["IBA"]:{c:()=>this.beardC(),t:(r,a)=>this.beardT(r,a),p:(r,a)=>this.beardP(r,a)},["IZK"]:{c:()=>this.izzyC(),t:(r,a)=>this.izzyT(r,a),p:(r,a)=>this.izzyP(r,a)},["KAW"]:{c:()=>this.kasC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.kasP(r,a)},["SWA"]:{c:()=>this.swaC(),t:(r,a)=>this.factionSpellMyTurn(r,a),p:(r,a)=>this.swaP(r,a)}}[t]}testPlay(t,i){return this.lookup(t).t(i,i.event)}actPlay(t,i){this.lookup(t).p(i,i.event)}trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i);if(this.trigB){const a=r.jr4("PC");a.bonus=this.trigB}return r}ddf8(t){return t.event.code==="PLC"?this.testPlay(this.cardCode(),t):t.event.code==="TRE"&&this.cardCode()==="BLH"}jr8(t){t.event.code==="PLC"?this.actPlay(this.cardCode(),t):V.destroy(m.creatByTr(t),this.code),x.triggerDone()}spellMyTurn(t,i){return i.playerA===t.owner&&G.getCard(i.cardCode).type==="S"}factionSpellMyTurn(t,i){if(i.playerA===t.owner){const r=G.getCard(i.cardCode);if(r.type==="S"&&r.faction===this.faction)return!0}return!1}enemyPlayed(t,i){return i.playerA!==t.owner}ownerAlive(t){return m.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,ut.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,i){m.creatByTr(t).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 ${y.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),2)}arootP(t,i){const r=this.boof234;m.creatByTr(t).buff(r,r)}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.regnNug(1),this.text=`When you play a spell, ${this.name} gets Mobility 1 this turn.`}atrapP(t,i){m.creatByTr(t).addMod(b.modT("MB",1))}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,"TX")}arbysP(t,i){if(L.cardsPlayed>1&&this.ownerAlive(t.creatId)){const r=A.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 ${y.tokName(t)}. At the end of your turn, destroy it.`,this.trigB=this.spawnNug(t,"TX")}bblhP(t,i){if(this.ownerAlive(t.creatId)){const r=m.birth(this.lwy(),"S",t.owner);if(r){const a=r.jr4("TE",this.code);a.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,"TX")}ccP(t,i){this.ownerAlive(t.creatId)&&(A.hurtDirect(!t.owner,this.iAttack,t.cardCode),A.heal(t.owner,this.iAttack,this.code))}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,i){m.creatByTr(t).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,"TX")}fbiP(t,i){if(this.ownerAlive(t.creatId)){const r=E.tick();m.qEnemyCreats().forEach(a=>{a.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,"TX")}flspkP(t,i){this.ownerAlive(t.creatId)&&A.hurtDirect(!t.owner,this.boof235,t.cardCode)}beardC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Ascendant",this.iAttack=this.lValN([6,9,14,20]),this.iHealth=this.iAttack,this.iArmor=this.level,this.maxLevel=4,this.tribe.push("FB");let t="";this.level>1&&(t=" and Armor "+(this.level-1));let i=this.lValS([this.name,this.name,this.name+" and adjacent friendly creatures","friendly creatures"]);this.text=`When you play Anvilbreaker, ${i} gets ${y.jr9(this.level+1,0)}${t}.`,this.trigB=this.rawNug(0,0,0,0,this.level/2,"TX")}beardT(t,i){return i.playerA===t.owner&&i.cardCode==="AVB"+"1"}beardP(t,i){const r=this.level+1,a=this.level-1,c=m.creatByTr(t);if(c.buff(r,0),a>0&&c.addArmor(1),this.level>2){const f=b.crFriendTarg();this.level===3?f.lanes=c.adjacent.concat(c.lane):f.notMe=c.id,m.creatByTarget(f).forEach(p=>{p.buff(r,0),p.addArmor(a)})}}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,"TX")}izzyT(t,i){if(i.playerA===t.owner){const a=G.getCard(i.cardCode).cardCode();return a==="IFL"||a==="IFR"}return!1}izzyP(t,i){const r=m.creatByTr(t),c=G.getCard(i.cardCode).cardCode()==="IFL"?"IZL":"IZR";m.birth(`${c}${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.text="When you play a spell, Kas battles an additional time this turn.",this.trigB=this.buffNug(this.iAttack,0,"TX")}kasP(t,i){m.creatByTr(t).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 ${y.jr9(this.iAttack,0)} this turn.`,this.trigB=this.multNug(this.buffNug(this.iAttack,0,"TW"),.5)}swaP(t,i){m.creatByTr(t).addMod(b.modT("AT",this.iAttack))}}class Ve extends F{lookup(t){return{["KTS"]:{c:()=>this.kitC(),r:(r,a)=>this.kitR(r,a)},["RSC"]:{c:()=>this.scootC(),r:(r,a)=>this.scootR(r,a)},["SCC"]:{c:()=>this.shcrC(),r:(r,a)=>this.shcrR(r,a)},["SND"]:{c:()=>this.ssdC(),r:(r,a)=>this.ssdR(r,a)}}[t]}trigB;actReplace(t,i){this.lookup(t).r(i,$.toReplaced(i.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("RP");return a.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,"TW")}kitR(t,i){m.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.free=!0,this.tribe.push("RB"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${y.jr9(this.level,this.level,!0)} and Armor ${this.level}.`,this.trigB=this.buffNug(this.level,ut.calcCreatValueFormula(this.level,this.level,this.level,0,0,!1,0))}scootR(t,i){i.creature.buff(this.level,this.level),i.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 ${y.jr9(this.iAttack,this.iAttack)}.`,this.trigB=this.multNug(this.buffNug(this.iAttack,this.iAttack,"TX"),.5)}shcrR(t,i){i.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,"TW"),this.trigB.count=1}ssdR(t,i){const r=i.replCreat.adjacent,a=m.emptyLanes(t.owner),c=E.tick();r.forEach(f=>{a.includes(f)&&m.birth("SPU"+this.level,"P",t.owner,f,c)})}}class pe extends F{lookup(t){return{["BST"]:{c:()=>this.brimC(),u:(r,a)=>this.brimR(r,a)},["OSV"]:{c:()=>this.scavC(),u:(r,a)=>this.scavR(r,a)},["RHU"]:{c:()=>this.tiaC(),u:(r,a)=>this.tiaR(r,a)},["SKS"]:{c:()=>this.spsoC(),u:(r,a)=>this.spsoR(r,a)},["SWG"]:{c:()=>this.stgrC(),u:(r,a)=>this.stgrR(r,a)},["VTW"]:{c:()=>this.weldC(),u:(r,a)=>this.weldR(r,a)},["WEB"]:{c:()=>this.webC(),u:(r,a)=>this.webR(r,a)}}[t]}actUpgrade(t,i){this.lookup(t).u(i,$.toReplaced(i.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){return this.rarity==="T"?super.fixedImage(t):super.image(t)}jr3(t,i){const r=super.jr3(t,i);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,i){const r=E.tick(),a=this.boof468;m.creatByTarget(b.crNotMeTarg(t.creatId)).forEach(c=>c.hurtDirect(a,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,i){i.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,i){i.creature.buff(i.replCreat.attack,i.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,i){i.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 ${y.jr9(this.iAttack,this.iAttack)}.`}stgrR(t,i){i.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,i){i.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,i){i.creature.buff(i.replCreat.attack,i.replCreat.health-1)}}class Tt extends F{lookup(t){return{["CGG"]:{c:()=>this.cggC(),v:(r,a)=>this.cggV(r,a)},["CGF"]:{c:()=>this.cfiendC(),v:(r,a)=>this.cfiendV(r,a)},["CSB"]:{c:()=>this.corpsC(),v:(r,a)=>this.corpsV(r,a)},["CYS"]:{c:()=>this.cslmC(),v:(r,a)=>this.cslmV(r,a)},["DSK"]:{c:()=>this.dskC(),v:(r,a)=>this.dskV(r,a)},["FST"]:{c:()=>this.fstrC(),v:(r,a)=>this.fstrV(r,a)},["FWK"]:{c:()=>this.fwlkC(),v:(r,a)=>this.fwlkV(r,a)},["FFD"]:{c:()=>this.ffC(),v:(r,a)=>this.ffV(r,a)},["FSC"]:{c:()=>this.flwcC(),v:(r,a)=>this.flwcV(r,a)},["GVS"]:{c:()=>this.ghsC(),v:(r,a)=>this.ghsV(r,a)},["GBG"]:{c:()=>this.ggC(),v:(r,a)=>this.ggV(r,a)},["GMR"]:{c:()=>this.gromC(),v:(r,a)=>this.gromV(r,a)},["MMX"]:{c:()=>this.mmeC(),v:(r,a)=>this.mmeV(r,a)},["NOZ"]:{c:()=>this.nyozC(),v:(r,a)=>this.nyozV(r,a)},["POX"]:{c:()=>this.poxC(),v:(r,a)=>this.poxV(r,a)},["RSZ"]:{c:()=>this.rszC(),v:(r,a)=>this.rszV(r,a)},["SFM"]:{c:()=>this.spirmC(),v:(r,a)=>this.spirmV(r,a)},["SNT"]:{c:()=>this.sssC(),v:(r,a)=>this.sssV(r,a)},["USA"]:{c:()=>this.usaC(),v:(r,a)=>this.usaV(r,a)},["VGN"]:{c:()=>this.vgfsC(),v:(r,a)=>this.vgfsV(r,a)},["XHS"]:{c:()=>this.xhostC(),v:(r,a)=>this.xhostV(r,a)},["ZTU"]:{c:()=>this.zimusC(),v:(r,a)=>this.zimusV(r,a)}}[t]}cardVengeance(t,i){this.lookup(t).v(i,$.toCreature(i.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,i){const r=super.jr3(t,i);if(this.trigB){const a=r.jr4("VN");a.bonus=this.trigB}return r}jr8(t){this.cardVengeance(this.cardCode(),t),x.triggerDone()}cggC(){this.faction="N",this.rarity="H",this.name="Ceaseless Grimgaunt",this.iAttack=this.boof5813,this.iHealth=1,this.tribe.push("GG"),this.vtext=`If there are no friendly creatures in play, Spawn a level ${this.level} ${this.name}.`,this.hints=["ST"],this.trigB=this.rawNug(0,0,0,0,.5)}cggV(t,i){m.qPlayerCreats(t.owner).length===0&&(this.logAct(!1),m.birth(this.code,"S",t.owner))}cfiendC(){this.faction="N",this.rarity="T",this.name="Contagion Fiend",this.iAttack=this.boof234,this.iHealth=this.boof5812,this.tribe.push("AB"),this.hints=["ST"],this.fixedImgCreat=!0;const t=-this.level;this.vtext=`Each enemy creature gets ${y.jr9(t,t)}.`;const i=this.boof246;this.trigB=this.buffNug(i,i)}cfiendV(t,i){const r=-this.level,a=E.tick();m.qPlayerCreats(!t.owner).forEach(c=>c.buff(r,r,a))}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,i){const r=`${"ZBS"}${this.level}`;m.birth(r,"P",i.creature.owner,i.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,i){const r=`${"COZ"}${this.level}`;m.birth(r,"P",i.creature.owner,i.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,i){const r=`${"SPN"}${this.level}`;m.birth(r,"P",i.creature.owner,i.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 ${y.tokName(t)}.`,this.trigB=this.multNug(this.buffNug(t.iAttack,t.iHealth),.5)}fstrV(t,i){m.birth(this.fsz(),"S",i.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"),this.hints=["ST"];const t=G.getCard(K.zomc(this.level));this.vtext=`Put a ${y.tokName(t)} into this lane.`,this.trigB=this.buffNug(t.iAttack,t.iHealth)}fwlkV(t,i){m.birth(K.zomc(this.level),"P",i.creature.owner,i.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,i){const r=`${"FFD"}${this.level-1}`;m.birth(r,"P",i.creature.owner,i.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,i){const r=b.crTarg();r.player=A.toTarget(t.owner),r.tribe="RB";const a=m.creatByTarget(r);if(a.length>0){const c=a[S.randInt(0,a.length)];c.addArmor(this.iHealth),this.logAct(!1,c)}}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,i){const r=S.randInt(this.boof124,this.gghigh);A.heal(t.owner,r,this.code)}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,i){const r=S.randInt(this.boof124,this.gghigh);A.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=K.minionBuff(this.level),i=K.minionName(this.level);this.vtext=`Put a ${t}/${t} ${i} into this lane.`,this.trigB=this.buffNug(t,t)}gromV(t,i){const r=K.minionCode(this.level);m.birth(r,"P",i.creature.owner,i.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*ut.dcWeight)}mmeV(t,i){A.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"),this.hints=["ST"];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,i){const r=`${"OOZ"}${this.level}`;m.birth(r,"P",i.creature.owner,i.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","ST"],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,i){const r=`${"POX"}${this.level+1}`;m.birth(r,"S",i.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 ${y.levelGateText(this.level)}spell at random from your discard pile into your hand.`,this.trigB=this.rawNug(0,0,0,0,.5)}rszV(t,i){const r=A.toPlayer(t.owner),a=b.target("TD");a.player=A.toTarget(r),a.card="S",a.level=D.ddf2(this.level);const c=D.deckByTarget(a);if(c.length>0){const f=c[S.randInt(0,c.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.hints=["ST"],this.vtext=`Deal ${this.boof246} damage to each creature.`,this.trigB=this.rawNug(0,0,0,0,.2)}spirmV(t,i){const r=this.boof246,a=E.tick();m.qActiveCreats().forEach(c=>c.hurtDirect(r,this.code,a))}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,i){(i.creature.lane===1||i.creature.lane===5)&&m.birth(i.creature.code,"S",t.owner)}usaC(){this.faction="T",this.rarity="H",this.name="Unstable Asir",this.iAttack=this.boof357,this.iHealth=this.boof61016,this.iDefend=!0,this.tribe.push("FR","AS"),this.hints=["ST"],this.vtext=`Deal damage equal to ${this.name}'s attack to the enemy player.`,this.trigB=this.playerNug(this.iAttack)}usaV(t,i){i.creature.attack>0&&A.hurtDirect(!t.owner,i.creature.attack,this.code)}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=["ST"];const t=this.boof369n;this.vtext=`Give the opposing creature ${y.jr9(t,t)}.`,this.trigB=this.buffNug(-t,-t)}vgfsV(t,i){const r=i.creature.opposed;if(r){const a=this.boof369n;r.buff(a,a)}}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.iAttack=this.boof359,this.iHealth=this.boof135,this.tribe.push("AB"),this.hints=["ST"],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,i){const r=this.iAttack;A.hurtDirect(!t.owner,r,this.code),A.heal(t.owner,r,this.code)}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,i){let r;this.level===2?r=`${"ZTR"}2`:r=`${"ZTU"}3`,m.birth(r,"S",t.owner)}}class fi 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,i){return this.lookup(t).m(i)}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(b.playerActTarg("F","CARD",this.code,"")),t}handleAction(t){this.logSpell();const i=A.toPlayer(t.playerA),r={effId:E.genId(),logicCode:this.code};i.effects.push(r),this.enforcePlayerEffect(r,i),v.spellCast()}enforcePlayerEffect(t,i){const r=this.cardCode(),a=this.createMod(r,t.effId),c=this.nexus?[3]:[1,5];m.qPlayerCreats(i.isPlayerA).forEach(f=>{f.faction===this.faction&&c.includes(f.lane)?f.addModSafe(a):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 b.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 b.mod("AR",3,t)}}class Mt extends kt{lookup(t){return{["AEC"]:{c:()=>this.anceC(),p:r=>this.aeZ(r)},["CYW"]:{c:()=>this.wailC(),p:r=>this.wailZ(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,i){this.lookup(t).p(i)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(b.playerActTarg(this.playTarg,"CARD",this.code,"")),t}handleAction(t){this.logSpell();const i=A.toPlayer(t.playerA);this.cardCast(this.cardCode(),i),v.spellCast()}ddf8(t){if(t.trigger.type==="TE")return t.event.playerA===t.owner;if(t.trigger.type==="PC"){const i=t.event,r=G.getCard(i.cardCode);return r.type==="S"&&r.faction==="T"&&i.playerA===t.owner}else if(t.trigger.type==="EF"){const i=$.toEnterField(t.event);return i.creature.faction==="U"&&i.creature.owner===t.owner}else return!1}jr8(t){const i=Nt.extractCardCode(t.trigger.logicCode),r=t.event;let a=!1;if(i==="LCE"){a=!0;const c=A.toPlayer(r.playerA),f=this.level===1?1:2;this.logAct(!1),A.drawCard(c,f)}else if(i==="IME"){a=!0;const c=V.gravedigger(A.toTarget(t.owner),D.ddf2(this.level+1));c&&m.birth(c,"S",r.playerA)}else if(i==="DRE"){a=!0;const c=this.level===1?11:21;A.hurtDirect(!r.playerA,S.randInt(1,c),this.code)}else if(i==="IGR")A.hurtDirect(!r.playerA,2,this.code);else if(i==="EVT"){const c=$.toEnterField(t.event);c.creature.buff(1,1),this.logAct(!1,c.creature)}else if(i==="AEC"){a=!0;const c=m.qPlayerCreats(t.owner);if(c.length>0){const f=this.level===1?[1,2]:[2,4];c.forEach(p=>{this.logAct(!1,p),p.buff(f[0],f[1])})}}else super.jr8(t);if(a&&this.level<3){const c=A.toPlayer(r.playerA),f=b.trigIdx(c.triggers,t.trigger);f>-1?t.trigger.customCode==="P2"?c.triggers[f].customCode="P1":c.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 i=b.trigger("TE",this.code);return this.level<3&&(i.customCode="P2"),i.changes=!0,t.triggers.push(i),i}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 ${y.jr9(t[0],t[1])}.`}aeZ(t){const i=this.echoZ(t),r=this.boof248;i.bonus=this.buffNug(r,r*2)}wailC(){this.faction="N",this.rarity="R",this.name="Crypt Wail",this.playTarg="E";const t=this.boof579;this.text=`Deal ${t} damage to the enemy player and gain ${t} health. If a Raid occured this turn, deal ${t*2} damage and gain ${t*2} health instead.`}wailZ(t){const i=this.boof579*(L.ffs>2?2:1);A.hurtDirect(t,i,this.code),A.heal(!t.isPlayerA,i,this.code)}disnC(){this.faction="T",this.rarity="R",this.name="Disintigrate",this.playTarg="E",this.text=`Deal 1 to ${this.dshigh-1} damage to the enemy player.`}disnZ(t){A.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 i=this.echoZ(t);i.bonus=this.playerNug(this.lValN([4,9,25]))}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){A.heal(t,this.boof81220,this.code)}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 ${y.jr9(1,1)}".`}endvZ(t){const i=b.trigger("EF",this.code);i.changes=!0,t.triggers.push(i),i.bonus=this.buffNug(4,4)}esrgC(){this.faction="A",this.rarity="R",this.name="Energy Surge",this.overload=this.level===3,this.level===1?this.hints=["LG"]:this.free=!0,this.playTarg="F",this.text=`Draw ${this.level} card${this.free?"s":""}.`}esrgZ(t){A.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 i=A.getActive(),r=i.rank*3;A.hurtDirect(t,r,this.code),A.heal(i,r,this.code)}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 i=b.trigger("PC",this.code);i.changes=!0,t.triggers.push(i),i.bonus=this.playerNug(6)}itorC(){this.faction="T",this.rarity="R",this.name="Ice Torrent",this.free=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg="E",this.text=`Deal ${this.boof234} damage to the enemy player.`}itorZ(t){A.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 ${y.levelGateText(this.level+1)}creature that was destroyed this game`;this.text=`${this.echTxt()}${t}.`}ieZ(t){const i=this.echoZ(t),r=this.lValN([1,1,3]);i.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 i=this.echoZ(t),r=this.boof124*ut.dcWeight;i.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){lt.simOn?this.boof61224:this.mendboof+1,A.heal(t,S.randInt(1,this.mendboof+1),this.code)}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 i=this.boof4712;A.hurtDirect(t,i,this.code),A.heal(!t.isPlayerA,i,this.code)}}class us extends F{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Primeval Ancient",this.iAttack=this.boof359,this.iHealth=this.boof71117,this.tribe.push("DN"),this.text=`At the end of your turn, you gain ${this.healy} life.~Forge: If there are no enemy creatures, spawn a copy of this.`}get healy(){return this.level+2}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("TE");return a.bonus=this.playerNug(this.healy,"TW"),r}ddf8(t){return t.event.playerA===t.owner}jr8(t){t.trigger.type==="FR"?m.qEnemyCreats().length===0&&m.birth(this.code,"S",t.owner):t.event.code==="TRE"&&A.heal(t.owner,this.healy,this.code),x.triggerDone()}}class ds extends F{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.text=`When a friendly creature ${y.dbdtap()}, ${this.name} gets ${y.jr9(this.level,this.level)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM"),c=this.boof246;return a.bonus=this.buffNug(c,c,"TP"),r}ddf8(t){const i=$.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcCreat.owner===t.owner}jr8(t){m.creatByTr(t).buff(this.level,this.level),x.triggerDone()}}class de extends F{lookup(t){return{["BTD"]:{c:()=>this.btdC(),r:r=>this.btdR(r)},["DKS"]:{c:()=>this.dksC(),r:r=>this.dksR(r)},["HMO"]:{c:()=>this.hrdC(),r:r=>this.hrdR(r)},["HVE"]:{c:()=>this.hveC(),r:r=>this.hveR(r)},["LTU"]:{c:()=>this.ltuC(),r:r=>this.ltuR(r)},["QSW"]:{c:()=>this.qswC(),r:r=>this.qswR(r)},["RTW"]:{c:()=>this.rlwC(),r:r=>this.rlwR(r)},["SMS"]:{c:()=>this.smsC(),r:r=>this.smsR(r)}}[t]}trigB;rtext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Raid: "+this.rtext,this.rtext=""}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("RD");return a.bonus=this.trigB,r}jr8(t){this.lookup(this.cardCode()).r(t),x.triggerDone()}btdC(){this.faction="T",this.rarity="L",this.name="Blitzmane, the Destroyer",this.iAttack=this.lValN([5,8,10]),this.iHealth=this.iAttack-1,this.iAggro=!0,this.iMobile=1,this.tribe.push("DG"),this.trigB=this.buffNug(0,this.iAttack,"TX"),this.rtext="Deal damage equal to Blitzmane's attack to the opposing creature. If unopposed, deal the damage to the enemy player instead."}btdR(t){const i=m.creatByTr(t);if(i.attack>0){const r=i.opposed;r?r.hurtDirect(i.attack,this.code):A.hurtDirect(!i.owner,i.attack,this.code)}}dksC(){this.faction="T",this.rarity="R",this.name="Dragonkeeper Shaman",this.iAttack=this.boof61016,this.iHealth=this.boof369,this.tribe.push("HM");const t=this.level+2;this.trigB=this.buffNug(0,t,"TX"),this.rtext=`Deal ${t} damage to each enemy creature.`}dksR(t){const i=m.qEnemyCreats();if(i.length>0){const r=E.tick(),a=this.level+2;i.forEach(c=>c.hurtDirect(a,this.code,r))}}hrdC(){this.faction="U",this.rarity="C",this.name="Herd Mother",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("DN");const t=this.level+2;this.trigB=this.buffNug(this.level,this.level),"TS",this.rtext=`${this.name} gets ${y.jr9(t,t)}.`}hrdR(t){this.logAct(!1);const i=this.level+2;m.creatByTr(t).buff(i,i)}hveC(){this.faction="U",this.rarity="R",this.name="Hive Empress",this.iAttack=this.boof234,this.iHealth=this.boof61016,this.tribe.push("IN"),this.hints=[this.lValH(["ZZ+1","ZZ+2","ZZ+4"])],this.trigB=this.playerNug(this.iAttack,"TX"),this.rtext=`Give the enemy player Poison ${this.iAttack}.`}hveR(t){this.logAct(!1);const i=A.toPlayer(!t.owner);i.poison+=this.iAttack}ltuC(){this.faction="U",this.rarity="L",this.name="Lorus, the Unrivaled",this.iAttack=this.boof2612,this.iHealth=this.boof71117,this.tribe.push("LP"),this.trigB=this.buffNug(3,3,"TX"),this.level===3?this.rtext=`Each other friendly creature gets ${y.jr9(3,3)}.`:this.rtext=`Replace this with a level ${this.level+1} ${this.name}.`}ltuR(t){if(this.logAct(!1),this.level===3)m.creatByTarget(b.crFriendNotMeTarg(t.creatId)).forEach(i=>i.buff(3,3));else{const i=m.creatByTr(t);m.birth(this.levelUpCard(),"R",i.owner,i.lane)}}qswC(){this.faction="T",this.rarity="L",this.name="Quakeasaurus Wrecks",this.iAttack=this.boof5814,this.iHealth=this.iAttack+2,this.tribe.push("DN");const t=this.boof234;this.trigB=this.playerNug(t,"TX"),this.rtext=`Deal damage to a random enemy creature and to the enemy player equal to ${t}x the number of friendly Dinosaurs.`}qswR(t){const i=b.crFriendTarg();i.tribe="DN";const r=m.creatByTarget(i).length*this.boof234,a=m.qEnemyCreats();a.length>0&&a[S.randInt(0,a.length)].hurtDirect(r,this.code),A.hurtDirect(!t.owner,r,this.code)}rlwC(){this.faction="U",this.rarity="H",this.name="Relentless Wanderers",this.iAttack=this.boof51015,this.iHealth=this.iAttack-this.level,this.tribe.push("ST","WD"),this.hints=[this.lValH(["ZZ-1","ZZ-3","ZZ-3"])],this.trigB=this.multNug(this.statSpawnNug(this.iAttack,this.iHealth,"TW"),.5),this.rtext=`Spawn a ${y.tokName(this)}.`}rlwR(t){m.birth(this.code,"S",t.owner)&&this.logAct(!1)}smsC(){this.faction="T",this.rarity="C",this.name="Stampeding Mongosaur",this.iAttack=this.boof61015,this.iHealth=this.iAttack,this.tribe.push("DN");const t=this.lValN([6,8,10]);this.trigB=this.playerNug(t/2,"TW"),this.rtext=`Deal ${t} damage to the enemy player.`}smsR(t){A.hurtDirect(!t.owner,this.lValN([6,8,10]),this.code)}}class Wt extends F{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,i){const r=super.jr3(t,i),a=r.jr4("RU");return a.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");const t=this.boof3612;this.trigB=this.buffNug(t,0,"TH"),this.rtext=`Deal ${t} damage to each non-Tempys creature.`}avinvR(t){const i=this.boof3612,r=E.tick();m.qActiveCreats().filter(a=>a.faction!=="T").forEach(a=>a.hurtDirect(i,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");const t=this.boof369n;this.trigB=this.buffNug(0,-t,"TH"),this.rtext=`The opposing creature gets ${y.jr9(t,t)}.`}bskphR(t){const i=m.creatByTr(t).opposed;if(i){const r=this.boof369n;i.buff(r,r)}}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.trigB=this.rawNug(0,0,0,0,.2,"TH"),this.rtext=`Negate Defender from ${this.name}.`}crucR(t){m.creatByTr(t).negateDefender=!0,t.trigger.bonus.threat=void 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.trigB=this.rawNug(0,0,0,0,-1,"TL"),this.rtext=`Destroy ${this.name}.`}ebknR(t){V.destroy(m.creatByTr(t),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,"TH"),this.rtext=`Replace ${this.name} with a 9/9 Feywing.`}fwcR(t){const i=m.creatByTr(t);m.birth(`${"FWG"}1`,"R",i.owner,i.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,"TH"),this.rtext=`Replace ${this.name} with a level ${this.level} Frostmane Dragon.`}feggR(t){const i=m.creatByTr(t);m.birth(`${"FMD"}${this.level}`,"R",i.owner,i.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.trigB=this.rawNug(0,0,0,0,ut.dcWeight*.6,"TH"),this.rtext="Draw 2 cards."}mmovR(t){A.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.trigB.threat="TH",this.rtext="Spawn a random creature that was destroyed this game."}porshR(t){const i=V.gravedigger();i&&m.birth(i,"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.trigB=this.buffNug(0,this.iAttack,"TH"),this.rtext=`${this.name} gets ${y.jr9(this.iAttack,this.iAttack)}.`}runegR(t){m.creatByTr(t).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");const t=this.boof248;this.trigB=this.buffNug(t,t,"TH");const i=this.level===3;let r="";i&&(r=", and Breakthrough"),this.rtext=`Each friendly creature gets ${y.jr9(t,t,i)}${r}.`}solrevR(t){const i=this.boof248;m.ddf1().forEach(r=>{r.buff(i,i),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");const t=this.boof579;this.rtext=`Deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t,"TH")}spshamR(t){A.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.rtext=`Heal ${this.snoutbof} damage from ${this.name}.`,this.trigB=this.buffNug(0,this.iHealth)}snoutR(t){m.creatByTr(t).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");const t=this.mantbof;this.rtext=`You gain ${t} health.`,this.trigB=this.playerNug(t/3,"TH")}mantisR(t){A.heal(t.owner,this.mantbof,this.code)}get mantbof(){return this.lValN([8,10,12])}}class fs extends kt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Remembrance",this.text=`Banish a ${y.levelGateText(this.level)}creature from your discard pile, then Spawn a copy of it.`}playTargets(){const t=super.playTargets();if(this.remCrds().length===0)return t;const i=D.boardTarget("CARD",this.code);return i.param="P1",t.push(i),t}remCrds(){const t=A.getActive(),i=b.target("TD");return i.player=A.toTarget(t),i.card="C",i.level=D.ddf2(this.level),At.generateContent(t.discard,!1,i)}handleAction(t){if(t.param==="P1"){const i=this.remCrds(),r=i.map(c=>{const f=b.deckSelectAction("CARD",c.cardCode,c.sourceIdx);return f.host=this.code,f}),a=v.cancelAction();a.param="PM",r.push(a),At.showCustomDeck(i,r)}else{const i=t,r=A.getActive();r.discard.splice(i.position,1);const a=m.birth(i.card,"S",r.isPlayerA);this.logSpell(a),mt.popMode(),v.spellCast()}}}class gs extends F{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} ${y.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.interactive=!0,a.bonus=this.buffNug(this.iAttack,0,"TP"),r}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId&&t.owner===A.getActiveB()}jr8(t){const i=D.toActions(b.crEnemyActTarg("CARD",this.code,S.enTil(t.creatId,t.event.dmg)));i.length>0?(i.push(v.noneEndTrigger()),v.ddf5(i)):x.triggerDone()}handleAction(t){const i=S.deTil(t.param);m.ddf6(t).hurtDirect(parseInt(i[1]),this.code),v.actionDone(!0)}}class ms extends Yt{jr3(t,i){const r=super.jr3(t,i);return r.jr4("AS"),r}jr8(t){if(t.trigger.type==="AS"){let i=!0;for(;i;){const r=m.birth(this.code,"S",t.owner);r?r.opposed&&(i=!1):i=!1}x.triggerDone()}else super.jr8(t)}}class ps extends F{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 i=": ",r=1;this.level<3&&(i=", destroy another friendly creature: ",r=.5);const a=`Destroy an enemy ${y.levelGateText(this.level+1)}creature.`;this.text=`Activate${i}${a}`,this.bonus=this.multNug(this.avgSpawnNug(),r),this.bonus.threat="TX"}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){let i;this.level===3?i=this.enemies(t):i=this.friends(t),i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){const i=S.deTil(t.param),r=m.jr5(i[0]),a=m.ddf6(t);if(i[1]==="P1"){const c=this.enemies(r,a.id);c.push(v.cancelAction()),v.ddf5(c)}else{this.logAct(!0);const c=E.tick();this.level<3&&V.destroy(m.jr5(i[2]),this.code,c),V.destroy(a,this.code,c),r.endActivation()}}friends(t){const i=b.crFriendNotMeActTarg("CARD",t.id,this.code,S.enTil(t.id,"P1"));return D.toActions(i)}enemies(t,i=""){const r=b.crEnemyActTarg("CARD",this.code,S.enTil(t.id,"P2",i));return r.level=D.ddf2(this.level+1),D.toActions(r)}}class ys extends F{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Scourge Knights",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("ZB");const i=this.boof246n;this.text=`Formation: Give an enemy creature ${y.jr9(i,i)}.`}get formation(){return!0}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FM");return a.interactive=!0,r}jr8(t){if(t.owner!==A.getActiveB()){x.triggerDone();return}const i=b.crEnemyActTarg("CARD",this.code,""),r=D.toActions(i);r.length>0?v.ddf5(r):x.triggerDone()}handleAction(t){const i=m.ddf6(t);this.logAct(!1,i);const r=this.boof246n;i.buff(r,r),v.actionDone(!0)}}class bs extends F{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=this.rawNug(0,0,0,0,this.level*.5,"TW")}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){const i=this.enemies(t);i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){const i=S.deTil(t.param),r=m.jr5(i[1]);if(i[0]==="P1"){const a=this.empties(r,m.ddf6(t).id);a.push(v.cancelAction()),v.ddf5(a)}else{const a=m.jr5(i[2]);this.logAct(!0,a),a.move(t.lane),r.endActivation()}}empties(t,i=""){const r=b.emptyPlayerActTarg("E","CARD",this.code,S.enTil("P2",t.id,i));return D.toActions(r)}enemies(t){const i=b.crEnemyActTarg("CARD",this.code,S.enTil("P1",t.id));return D.toActions(i)}}class ks extends F{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,i){const r=super.jr3(t,i),a=r.jr4("EF");return a.bonus=this.rawNug(0,0,0,0,.5,"TW"),a.interactive=!0,r}handleAction(t){L.levelAndDiscardA(t),v.actionDone(!0)}ddf8(t){const i=$.toCreature(t.event);return i.creature.owner===t.owner&&t.owner===A.activePlayer&&i.creature.isTribe("DF")}jr8(t){const i=b.lvlHandActTarg(this.code,t.creatId),r=D.toActions([i,D.buttonTarget("NOTR")]);r.length>1?v.ddf5(r):x.triggerDone()}}class Oe extends F{constructor(t){super(t),this.rarity="R",this.iAttack=this.boof4612,this.iHealth=this.boof61016;const i=this.cardCode();i==="SSS"?this.steel():i==="LSS"?this.life():i==="FSS"?this.flame():i==="DSS"&&this.dark(),this.level>1?this.text=`When you play a ${y.levelGateText(this.level-1)}${y.factionText(this.faction)} card, you may ${this.tuxt}.`: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 ${y.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 ${y.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,i){const r=super.jr3(t,i);if(this.level>1){const a=r.jr4("PC");a.interactive=!0,a.bonus=this.rawNug(0,0,0,0,this.level*.5,"TX")}return r}ddf8(t){if(t.event.playerA===t.owner){const i=G.getCard(t.event.cardCode);if(i.level0?v.ddf5(r):x.triggerDone()}else{const i=m.qPlayerCreats(!t.owner);if(i.length>0){this.logAct(!1);const r=this.splat;i.forEach(a=>a.addPoison(r))}x.triggerDone()}}}class vs extends F{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Slumbering Shrine",this.iAttack=0,this.iHealth=this.lValN([14,20,30]),this.iDefend=!0,this.tribe.push("ER","EL"),this.text="When you play an spell, you may Negate Defender from a friendly creature."}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.bonus=this.rawNug(0,0,0,0,.5,"TX"),a.interactive=!0,r}handleAction(t){const i=m.ddf6(t);i.negateDefender=!0,this.logAct(!1,i),v.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&G.getCard(t.event.cardCode).type==="S"}jr8(t){const i=b.crFriendActTarg("CARD",this.code,""),r=D.toActions([i,D.buttonTarget("NOTR")]);r.length>1?v.ddf5(r):x.triggerDone()}}class Ss extends F{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Snowdrift Alpha",this.iAttack=this.boof61224,this.iHealth=this.boof4816,this.tribe.push("ST","WF"),this.hints=[this.lValH(["ZZ-2","ZZ-3","ZZ-5"])];const i=G.getCard(this.hc());this.text=`Activate: Put a ${y.tokName(i)} into an available lane.`,this.bonus=this.spawnNug(i,"TX")}hc(){return "HTP"+this.level}canActivate(t){return this.empties(t).length>0}startActivation(t){const i=this.empties(t);i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){this.logAct(!0),m.birth(`${this.hc()}`,"P",t.playerA,t.lane),m.jr5(t.param).endActivation()}empties(t){const i=b.emptyPlayerActTarg("F","CARD",this.code,t.id);return D.toActions(i)}}class Cs extends F{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,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){if(t.status==="A"){const r=b.mod("ND",!0,t.id);m.qActiveCreats().forEach(a=>a.addModSafe(r))}else m.qActiveCreats().forEach(r=>r.removeModSafe(t.id))}}class ws extends kt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Spiritcleave",this.text=`Destroy a ${y.levelGateText(this.level+1)}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 i=-1;const r=m.qActiveCreats();r.forEach(f=>{f.health>i&&(i=f.health)});const a=r.filter(f=>f.health===i).map(f=>f.id),c=b.crActTarg("CARD",this.code,"");return c.level=D.ddf2(this.level+1),c.victims=S.enTil(...a),this.level<3&&(c.hint=["KL"]),t.push(c),t}handleAction(t){this.logSpell();const i=m.ddf6(t);V.destroy(i,this.code),this.level===3&&A.heal(A.getActiveB(),i.health,this.code),v.spellCast()}}class Ds extends kt{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Spiritleash";const i=this.boof5814;this.text=`Destroy a friendly creature.~Give a creature ${y.jr9(i,i)}.`}playTargets(){const t=super.playTargets(),i=b.crFriendActTarg("CARD",this.code,"P1");return m.creatByTarget(i).length>0&&m.qActiveCreats().length>1&&t.push(i),t}handleAction(t){const i=S.deTil(t.param),r=m.ddf6(t);if(i[0]==="P1"){const a=b.crNotMeActTarg("CARD",r.id,this.code,S.enTil("P2",r.id));a.hint=["BF"];const c=D.toActions(a);c.push(v.cancelAction()),v.ddf5(c)}else{this.logSpell(r);const a=this.boof5814;V.destroy(m.jr5(i[1]),this.code),r.buff(a,a),v.spellCast()}}}class xs extends F{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} ${y.dbdtac()}, this gets ${y.jr9(this.level,this.level)}.~Allied Tempys: Activate: Deal ${this.level} damage to another creature. This gets ${y.jr9(this.level,this.level)}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("DM");return a.bonus=this.buffNug(this.level,this.level),r}zapTargs(t){const i=b.crNotMeActTarg("CARD",t,this.code,t);return i.hint=["HR"],D.toActions([i,D.buttonTarget("CANC")])}canActivate(t){return this.zapTargs(t.id).length>1&&t.hasMod(t.id)}startActivation(t){v.ddf5(this.zapTargs(t.id))}ddf8(t){return t.event.battle&&t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId}handleAction(t){const i=m.jr5(t.param);this.logAct(!0),m.ddf6(t).hurtDirect(this.level,this.code),i.buff(this.level,this.level),i.endActivation()}jr8(t){const i=m.creatByTr(t);if(t.trigger.type==="FR"){if(L.allied("T")){i.addMod(b.mod("AL",!0,i.id)),i.changed=!0;const r=i.jr4("NT");r.bonus=this.buffNug(this.boof246,this.level,"TS")}}else t.trigger.type==="DM"&&i.buff(this.level,this.level);x.triggerDone()}}class Bs extends F{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,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.interactive=!0,a.bonus=this.rawNug(0,0,0,0,.5),r}handleAction(t){const i=m.ddf6(t);this.logAct(!1,i);const r=b.mod("DF",!0);r.expiry="EN",i.addMod(r),v.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&G.getCard(t.event.cardCode).type==="S"}jr8(t){const i=b.crFriendActTarg("CARD",this.code,t.creatId);i.canDefender=!0;const r=D.toActions(i);r.length===0?x.triggerDone():(r.push(v.noneEndTrigger()),v.ddf5(r))}}class Hs extends F{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 ${y.daluac()}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("UP");return a.interactive=!0,r}handleAction(t){L.levelAndDiscardA(t),v.actionDone(!0)}jr8(t){const i=b.lvlHandActTarg(this.code,t.creatId),r=D.toActions(i);r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}}class Ns extends F{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.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=this.rawNug(0,0,0,0,this.lValN([.8,1.7,3]),"TX")}jr3(t,i){const r=super.jr3(t,i);return this.level===3&&(r.jr4("TS"),this.addExtraActivate(r)),r}ddf8(t){return t.event.playerA===t.owner}jr8(t){this.addExtraActivate(m.creatByTr(t)),x.triggerDone()}canActivate(t){return A.toPlayer(t.owner).hand.some(r=>G.getCard(r).canLevel())}startActivation(t){const i=b.lvlHandActTarg(this.code,t.id);i.hint?.push("DF"),v.ddf5(D.toActions([i,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const i=m.jr5(t.param),r=A.toPlayer(i.owner);this.level===3||r.rank>parseInt(t.card.slice(3))?r.hand[t.position]=G.getCard(t.card).levelUpCard():L.levelAndDiscardA(t),i.endActivation()}}class Fs extends F{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 i=this.boof246;this.addSp("M",i),this.text=`While each other friendly creature has Defender, ${this.name} gets ${y.jr9(this.iAttack,0)}, Armor ${i}, and Breakthrough.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("DF",this.code);a.area="C";const c=r.addEffect("PS",this.code);return c.area="C",r}enforceEffect(t){const i=b.crNotMeTarg(t.id);if(i.player=A.toTarget(t.owner),m.creatByTarget(i).some(a=>!a.defender))t.removeModSafe(t.id);else{const a=b.mod("AT",this.iAttack,t.id),c=b.mod("AR",this.boof246,t.id),f=b.mod("BT",!0,t.id);t.addModSafe(a),t.addModSafe(c),t.addModSafe(f)}}}class Ps extends F{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 i=this.boof246;this.addSp("D",i),this.text=`At the start of each turn, ${this.name} moves to an available lane at random. Flank: Deal ${i} damage to the opposing creature.`}jr3(t,i){const r=this.boof246,a=super.jr3(t,i),c=a.jr4("TS");c.bonus=this.rawNug(0,0,r,0,.2);const f=a.jr4("FK");return f.bonus=this.buffNug(r,0,"TW"),a}ddf8(t){return!0}jr8(t){if(t.trigger.type==="TS")m.fling(m.creatByTr(t)),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 Ms extends F{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=this.buffNug(6,0,"TX"),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,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const i=this.friends(t.id);i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){const i=S.deTil(t.param),r=m.ddf6(t);if(i[1]==="P1"){const a=this.enemies(i[0],r.id);a.push(v.cancelAction()),v.ddf5(a)}else if(i[1]==="P2"){const a=m.jr5(i[2]);this.logAct(!0,a),r.hurtDirect(a.armor,this.code),m.jr5(i[0]).endActivation()}}jr8(t){m.ddf1().forEach(i=>i.addArmor(6)),x.triggerDone()}friends(t){const i=b.crFriendActTarg("CARD",this.code,S.enTil(t,"P1"));return i.hasArmor=!0,D.toActions(i)}enemies(t,i=""){const r=b.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",i));return D.toActions(r)}}class Rs extends F{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");let i;this.level===3?(this.text="Activate: Level up a card in your hand.",i=1):(this.text=`Activate: ${y.daluac(!0)}.`,i=.5),this.bonus=this.rawNug(0,0,0,0,i,"TX")}canActivate(t){return A.toPlayer(t.owner).hand.some(r=>G.getCard(r).canLevel())}startActivation(t){const i=b.lvlHandActTarg(this.code,t.id);i.hint?.push("DF"),v.ddf5(D.toActions([i,D.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const i=m.jr5(t.param),r=A.toPlayer(i.owner);this.level===3?r.hand[t.position]=G.getCard(t.card).levelUpCard():L.levelAndDiscardA(t),i.endActivation()}}class Es extends dt{jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}jr8(t){if(t.trigger.type==="FR"){const i=t.owner?L.deathsA.length:L.deathsB.length;if(i>0){const r=E.tick();for(let a=0;a0}}class Gs extends F{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 ${y.jr9(0,this.iHealth)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}jr8(t){const i=b.crActTarg("CARD",this.code,"");i.hint=["BF"];const r=b.actionTarget("TP","CARD",this.code,"");r.hint=["BF"];const a=[i,r,D.buttonTarget("NOTR")],c=D.toActions(a);v.ddf5(c)}handleAction(t){if(t.zone==="P")A.heal(t.playerA,this.iHealth,this.code);else{const i=m.ddf6(t);this.logAct(!1,i),i.buff(0,this.iHealth)}v.actionDone(!0)}}class Ws extends F{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,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.buffNug(this.boof3610,0,"TS"),r}ddf8(t){return!t.event.isCreatTarg&&t.event.target===t.owner}jr8(t){const i=this.level===3?2:1;m.creatByTr(t).buff(t.event.dmg*i,0),x.triggerDone()}}class Is extends kt{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Trial by Combat";const i=this.boof369;this.text=`Give a friendly creature ${y.jr9(i,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(b.crFriendActTarg("CARD",this.code,"P1")),t}handleAction(t){const i=S.deTil(t.param),r=m.ddf6(t);if(i[0]==="P1"){const a=v.cancelAction(),c=this.baddies(r.id);c.push(a),v.ddf5(c)}else{const a=m.jr5(i[1]),c=b.mod("AT",this.boof369);a.addMod(c);const f=E.tick();r.hurtDirect(a.attack,this.code,f),a.hurtDirect(r.attack,this.code,f),v.spellCast()}}baddies(t=""){return D.toActions(b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t)))}}class Pe extends F{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,i){const r=super.jr3(t,i),a=r.jr4("TE");return a.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 i=t.event;return this.mPlayer===1?i.playerA===t.owner:i.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,"TX"),this.text=`At the end of your turn, deal ${this.iAttack} damage to `+t}ikaT(t){const i=m.qEnemyCreats(),r=i.length>0;let a=this.level>2,c=-1;if(this.level===4&&r){const f=E.tick();i.forEach(p=>p.hurtDirect(this.iAttack,this.code,f))}if(this.level===3&&r&&(c=S.randInt(0,i.length)),this.level<3){const f=S.randInt(0,i.length+1);f===i.length?a=!0:c=f}c>-1&&i[c].hurtDirect(this.iAttack,this.code),a&&A.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,"TX"),this.text=`At the end of your turn, you and each other friendly creature gets ${y.jr9(0,t)}.`}rsdT(t){const i=this.lValN([1,2,5]);m.creatByTarget(b.crFriendNotMeTarg(t.creatId)).forEach(a=>a.buff(0,i)),A.heal(t.owner,i,this.code)}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,"TX"),this.text=`At the end of your turn, deal ${t} damage to each enemy creature.`}ssdT(t){const i=m.qEnemyCreats();if(i.length>0){const r=E.tick(),a=this.boof135;i.forEach(c=>c.hurtDirect(a,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,"TW"),this.text=`At the end of your turn, gain ${t} health.`}stagT(t){A.heal(t.owner,this.boof246,this.code)}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.trigB.threat="TW",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 i=b.target("DK");i.player=A.toTarget(t.owner),i.tribe="RB";const r=D.deckByTarget(i),a=r.length;if(a>0){const c=r[S.randInt(0,a)][0],f=m.creatByTr(t);m.birth(c,"R",f.owner,f.lane)}}}class Rt extends F{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)},["MNM"]:{c:()=>this.mnmC(),t:r=>this.mnmT(r)},["NUG"]:{c:()=>this.nugC(),t:r=>this.nugT(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)},["USS"]:{c:()=>this.ussC(),t:r=>this.ussT(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,i){const r=super.jr3(t,i),a=r.jr4("TS");a.bonus=this.trigB;const c=Nt.extractCardCode(this.code);return(c==="ZSH"||c==="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.trigB=this.buffNug(5,4,"TX"),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 i=A.toPlayer(t.owner),r=i.hand.map((c,f)=>{const p=G.getCard(c);return{idx:f,lvl:p.level,nxt:p.canLevel()?p.levelUpCard():""}}).filter(c=>c.nxt&&(this.level===3||c.lvl===1)),a=r.length;if(a>0){const c=r[S.randInt(0,a)];i.hand[c.idx]=c.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");const t=this.level===1?"":"s";this.trigB=this.rawNug(0,0,0,0,this.level*ut.dcWeight,"TX"),this.text=`At the start of your turn, draw ${this.level} card${t}.`}gmpT(t){A.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.trigB=this.playerNug(this.boof3610,"TW"),this.text=`At the start of your turn, you gain ${this.boof137} to ${this.boof5914-1} health.`}lbcT(t){A.heal(t.owner,S.randInt(this.boof137,this.boof5914),this.code)}mnmC(){this.faction="N",this.rarity="L",this.name="Murderous Necromancer",this.iAttack=this.boof61017,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.trigB=this.avgSpawnNug(),this.trigB.threat="TX";let t;this.level===3?(t=" If that creature is opposed, destroy the creature opposing it.",this.hints=["ZZ-5"]):(t="",this.hints=["ZZ-3"]),this.text=`At the start of your turn, Spawn a random ${y.levelGateText(this.level)}creature that was destroyed this game.${t}`}mnmT(t){const i=V.gravedigger("X",D.ddf2(this.level));if(i){const r=m.birth(i,"S",t.owner);if(r&&(this.logAct(!1,r),this.level===3)){const a=r.opposed;a&&V.destroy(a,this.code)}}}nugC(){this.faction="T",this.rarity="L",this.name="Nug, Fury Fists",this.iAttack=this.boof71015,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.hints=["ZZ-3"],this.trigB=this.rawNug(0,0,0,0,1.5,"TX"),this.text="At the start of your turn, each other friendly creature deals battle damage equal to its attack to the creature opposing it."}nugT(t){const i=m.creatByTarget(b.crFriendNotMeTarg(t.creatId));if(i.length>0){const r=E.tick();i.forEach(a=>{if(a.attack>0){const c=a.opposed;c&&c.hurtDirect(a.attack,a.code,r)}})}}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){m.creatByTr(t).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,i=K.minionName(this.level);this.trigB=this.statSpawnNug(t,t,"TW"),this.text=`At the start of your turn, Spawn a ${t}/${t} ${i}.`}sseT(t){const i=this.lValS(["SXD","SXP","SXT"])+this.level.toString();m.birth(i,"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");const t=this.boof246;this.trigB=this.buffNug(t,t,"TS"),this.text=`At the start of your turn, ${this.name} gets ${y.jr9(t,t)}.`}spdT(t){const i=this.boof246;m.creatByTr(t).buff(i,i)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.iAttack=this.boof91421,this.iHealth=this.iAttack,this.tribe.push("IN"),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 i=A.toPlayer(t.owner);if(i.hand.length>2){let r=i.hand.slice(),a=[];for(;r.length>2;)a.push(r.splice(S.randInt(0,r.length),1)[0]);i.discard.push(...a),i.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.level===3?this.trigB=this.multNug(this.avgSpawnNug(),.5):this.hints=["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){L.regularPlays+=1}ussC(){this.faction="T",this.rarity="H",this.name="Uranti Stormshaper",this.iAttack=0,this.iHealth=this.lValN([9,12,18]),this.iDefend=!0,this.tribe.push("YT");const t=G.getCard("LWY"+this.level);this.trigB=this.spawnNug(t,"TX");const i=this.level===3?" into each available lane":"";this.text=`At the start of your turn, Spawn a ${y.tokName(t)}${i}.`}ussT(t){const i="LWY"+this.level;if(this.level===3){const r=m.emptyLanes(t.owner);if(r.length>0){const a=E.tick();r.forEach(c=>m.birth(i,"P",t.owner,c,a))}}else m.birth(i,"S",t.owner)}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.trigB=this.playerNug(this.boof3610,"TW"),this.text=`At the start of your turn, deals ${this.boof137} to ${this.boof5914-1} damage to the enemy player.`}vgT(t){const i=S.randInt(this.boof137,this.boof5914);A.hurtDirect(!t.owner,i,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.trigB=this.playerNug(0,"TW"),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 i=b.crTarg();this.level===3&&(i.player=A.toTarget(!t.owner));const r=m.creatByTarget(i);let a=99999,c=[];r.forEach(p=>{p.attack===a?c.push(p):p.attack0){const p=c[S.randInt(0,f)];V.destroy(p,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,"TX")}zyxT(t){m.creatByTr(t).extraBattles+=1}}class $s extends F{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 ${y.levelGateText(this.level)}Plant into an available lane.`,this.bonus=this.multNug(this.avgSpawnNug(),.5),this.bonus.threat="TX"}canActivate(t){return this.emptySloots(t.id).length>0&&this.buddies(t.id).length>0}startActivation(t){const i=this.buddies(t.id);i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.emptySloots(i[1],m.ddf6(t).code);r.push(v.cancelAction()),v.ddf5(r)}else{const r=m.jr5(i[1]),a=m.birth(i[2],"P",r.owner,t.lane);this.logAct(!0,a),r.endActivation()}}emptySloots(t,i=""){const r=b.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P2",t,i));return D.toActions(r)}buddies(t){const i=b.crFriendActTarg("CARD",this.code,S.enTil("P1",t));return i.tribe="PL",i.level=D.ddf2(this.level),D.toActions(i)}}class gi 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.free=this.level===2),this.text="Discard and level up two cards."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(v.shiftPlayCard(t.position),t.param==="P1"){this.logSpell(),L.levelAndDiscardA(t);const i=this.targParty("P2"),r=D.toActions(i);r.length===0?v.spellCast():v.ddf5(r)}else L.levelAndDiscardA(t),v.spellCast()}targParty(t){const i=b.lvlHandActTarg(this.code,t);return i.deckPositionSkip=v.playPosition(),i}}class ze extends kt{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(r,a)=>this.confZ(r,a)},["CSG"]:{c:()=>this.cystgC(),z:(r,a)=>this.cystgZ(r,a)},["GRN"]:{c:()=>this.grenC(),z:(r,a)=>this.grenZ(r,a)},["TWG"]:{c:()=>this.twstrC(),z:(r,a)=>this.twstrZ(r,a)}}[t]}cardCast(t,i,r){this.lookup(t).z(i,r)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=b.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",m.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const i=S.deTil(t.param),r=m.ddf6(t);if(i[0]==="P1"){this.playTarg.notMe=r.id,this.playTarg.param=S.enTil("P2",r.id);const a=D.toActions([this.playTarg,D.buttonTarget("CANC")]);v.ddf5(a)}else{const a=m.jr5(i[1]);this.xl?this.logSpell(a,r):this.logSpell(),this.cardCast(this.cardCode(),a,r),v.spellCast()}}confC(){this.faction="T",this.rarity="C",this.name="Conflagrate",this.xl=!1,this.text=`Deal ${this.boof369} to two enemy creatures.`,this.playTarg.player="E"}confZ(t,i){const r=E.tick(),a=this.boof369;t.hurtDirect(a,this.code,r),i.hurtDirect(a,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,i){const r=this.boof246;t.addArmor(r),i.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,i){const r=this.boof246;t.addRegen(r),i.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 ${y.jr9(t,t)}.`,this.playTarg.player="F"}twstrZ(t,i){const r=this.tsboof;t.buff(r,r),i.buff(r,r)}}class Us extends F{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} ${y.dbdtap()}, deal that much damage to that player.~Allied Uterra: This gets ${y.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("DM");return a.bonus=this.playerNug(this.boof357,"TP"),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(L.allied("U")){const i=m.creatByTr(t);i.breakthrough=!0,i.buff(2,2)}}else t.trigger.type==="DM"&&A.hurtDirect(t.event.target,t.event.dmg,this.code);x.triggerDone()}}class Vs extends F{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} ${y.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}handleAction(t){m.ddf6(t).hurtDirect(parseInt(t.param),this.code),v.actionDone(!0)}ddf8(t){const i=$.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId&&i.srcCreat.owner===A.getActiveB()}jr8(t){if(t.trigger.type==="FR"){if(L.allied("T")){const i=m.creatByTr(t),r=i.jr4("DM");r.interactive=!0,r.bonus=this.buffNug(this.iAttack,0,"TP"),i.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const i=t.event,r=D.toActions(b.crEnemyActTarg("CARD",this.code,i.dmg.toString()));r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}}}class Ze extends F{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,i){this.lookup(t).f(i)}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,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}handleAction(t){this.targAction(this.cardCode(),m.ddf6(t)),v.actionDone(!0)}jr8(t){if(m.creatByTr(t).rank>this.level){const r=b.crActTarg("CARD",this.code,t.creatId);this.enemy?r.player="E":r.hint=["BF"];const a=D.toActions(r);a.length>0?v.ddf5(a):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 ${y.jr9(t,t)}.`}ebwF(t){this.logAct(!1,t);const i=this.boof369n;t.buff(i,i)}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 ${y.jr9(t,t)}.`}sbiF(t){this.logAct(!1,t);const i=this.boof359;t.buff(i,i)}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 ${y.jr9(t,0)}.`}ibrfF(t){this.logAct(!1,t),t.buff(this.boof5812,0)}}class Os extends F{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,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}jr8(t){const i=m.creatByTr(t);if(this.emptySloots(i).length>0){const r=b.crFriendNotMeActTarg("CARD",i.id,this.code,S.enTil("P1",i.id)),a=D.toActions(r);a.length>0?(a.push(v.noneEndTrigger()),v.ddf5(a)):x.triggerDone()}else x.triggerDone()}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.emptySloots(m.jr5(i[1]),m.ddf6(t).id);r.push(v.cancelAction()),v.ddf5(r)}else{const r=m.jr5(i[1]);this.logAct(!1,r),r.move(t.lane),v.actionDone(!0)}}emptySloots(t,i=""){return v.emptyAdjacents(t,S.enTil("P2",i))}}class zs extends F{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=this.buffNug(this.iAttack/2,0,"TW")}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){const i=this.findVictims(t.id);i.push(v.cancelAction()),v.ddf5(i)}handleAction(t){if(t.zone==="F"){const i=m.ddf6(t);this.logAct(!0,i),i.hurtDirect(this.iAttack,this.code)}else{this.logAct(!0);const i=t;A.hurtDirect(i.playerA,this.iAttack,this.code)}m.jr5(t.param).endActivation()}findVictims(t){const i=this.iAttack,r=b.crEnemyTarg(),c=m.creatByTarget(r).filter(p=>p.health===i).map(p=>b.fieldSelectAction("CARD",p.lane,p.owner)),f=A.toPlayer("E");return f.health===i&&c.push(b.playerSelectAction("CARD",f.isPlayerA)),c.forEach(p=>{p.host=this.code,p.param=t}),c}}class Zs extends F{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.text="Each friendly creature battles an additional time on each of your turns."}jr3(t,i){const r=super.jr3(t,i);r.jr4("EF");const a=r.jr4("TS");return a.bonus=this.buffNug(20,0,"TX"),r}ddf8(t){if(t.event.code==="ENT"){const i=$.toCreature(t.event);return t.owner===i.creature.owner&&t.owner===A.getActiveB()}else if(t.event.code==="TRS")return t.event.playerA===t.owner;return!1}giveXtra(t,i){t.hasMod(i)||(t.extraBattles+=1,t.addMod(b.mod("TK",!0,i)))}jr8(t){if(t.event.code==="ENT"){const i=$.toCreature(t.event);i.creature.id===t.creatId?m.ddf1().forEach(r=>{this.giveXtra(r,t.creatId)}):dt.itBirthedFirst(i.creature.id,t.creatId)&&this.giveXtra(i.creature,t.creatId)}else t.event.code==="TRS"&&m.ddf1().forEach(i=>{i.extraBattles+=1,i.hasMod(t.creatId)||i.addMod(b.mod("TK",!0,t.creatId))});x.triggerDone()}}class O extends F{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(),["LTM"]:()=>this.ltam(),["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(),["TNM"]:()=>this.tiggy(),["TWS"]:()=>this.tscout(),["TWT"]:()=>this.tund(),["URD"]:()=>this.unrelenting(),["VBK"]:()=>this.vblock(),["VTC"]:()=>this.vtech(),["WHC"]:()=>this.wardog(),["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}shite(){this.level<3&&(this.hints=["LB"])}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.shite(),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.shite(),this.level===1&&this.hints.push("ZZ+1")}ltam(){this.faction="T",this.rarity="C",this.name="Lightning Tamer",this.iAttack=this.lValN([6,8,10]),this.iHealth=1,this.tribe.push("LT","AS"),this.iAggro=!0}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.shite(),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.shite(),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.shite(),this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.free=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")}tiggy(){this.faction="U",this.rarity="C",this.name="Tigrin Nomad",this.iAttack=this.lValN([8,10,12]),this.iHealth=this.boof246,this.iBT=!0,this.shite(),this.tribe.push("TG")}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.shite(),this.tribe.push("RB")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.iAttack=this.boof7911,this.iHealth=this.iAttack+1,this.shite(),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")}wardog(){this.faction="T",this.rarity="T",this.name="Warhound Courser",this.iAttack=this.level,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("FR","EL"),this.free=!0}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 i=this.lValS(["a","two","three"]),r=this.level===1?"":"s",a=this.level===1?"was":"were";this.text=`Put ${i} random creature${r} that ${a} destroyed this game into ${i} lane${r}.`}playTargets(){const t=super.playTargets();return t.push(this.fieldTarget("P1",[])),t}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1")if(this.level===1)this.endSpell([t.lane],t.playerA);else{const r=this.fieldTarget("P2",[t.lane]);v.ddf5(D.toActions(r))}else if(i[0]==="P2"){const r=[t.lane,parseInt(i[1])];if(this.level===2)this.endSpell(r,t.playerA);else{const a=this.fieldTarget("P3",r);v.ddf5(D.toActions(a))}}else this.endSpell([t.lane,parseInt(i[1]),parseInt(i[2])],t.playerA)}endSpell(t,i){this.logSpell();const r=E.tick();t.forEach(a=>{const c=V.gravedigger();c&&m.birth(c,"R",i,a,r)}),v.spellCast()}fieldTarget(t,i){const r=b.actionTarget("TF","CARD",this.code,S.enTil(t,...i));return r.player="F",r.hint=["FL"],r.lanes=m.laneIdx.filter(a=>!i.includes(a)),r}}class Ys extends F{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,i){const r=super.jr3(t,i),a=r.jr4("HG");return a.bonus=this.buffNug(0,this.boof369,"TW"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const i=b.crNotMeTarg(t.creatId);i.player=A.toTarget(t.owner),m.creatByTarget(i).forEach(r=>r.heal(t.event.healAmt)),x.triggerDone()}}class Xs extends F{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Voltaic Prophet",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("HM");const i="evel up each card in your hand",r=this.lValS(["You may discard and level up a card","Discard and l"+i,"L"+i]);this.text="Formation: "+r+"."}get formation(){return!0}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FM");return a.interactive=this.level===1,r}handleAction(t){L.levelAndDiscardA(t),v.actionDone(!0)}jr8(t){if(t.owner!==A.getActiveB()){x.triggerDone();return}if(this.level===1){const i=b.lvlHandActTarg(this.code,t.creatId),r=D.toActions([i,D.buttonTarget("NOTR")]);r.length>1?v.ddf5(r):x.triggerDone()}else{const i=A.getActive();this.logAct(!1);const r=i.hand.map(a=>G.getCard(a).levelUpCard());this.level===2?(i.discard.push(...r),i.hand=[]):i.hand=r,x.triggerDone()}}}class qs extends F{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Warhound Raider",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("FR","AS"),this.text=`If there is a friendly Warhound Courser in play, ${this.name} has Aggressive.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){const i=b.crNotMeTarg(t.id);i.player=A.toTarget(t.owner),i.cardCode="WHC",m.creatByTarget(i).length===0?t.removeModSafe(t.id):t.addModSafe(b.mod("AG",!0,t.id))}}class js extends He{jr3(t,i){const r=super.jr3(t,i),a=r.jr4("LG"),c=this.boof124*5;return a.bonus=this.buffNug(c,c,"TS"),r}ddf8(t){return t.owner===t.event.playerA}jr8(t){const i=this.boof124*t.event.healAmt;m.creatByTr(t).buff(i,i),x.triggerDone()}}class Js extends F{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 i=G.getCard(K.minionCode(this.level));this.text=`When you play a spell, you may put a ${y.tokName(i)} into an available lane.`,this.spB=this.spawnNug(i,"TW")}spB;jr3(t,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.interactive=!0,a.bonus=this.spB,r}handleAction(t){m.birth(K.minionCode(this.level),"P",t.playerA,t.lane),v.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&G.getCard(t.event.cardCode).type==="S"}jr8(t){const i=b.emptyPlayerActTarg("F","CARD",this.code,""),r=D.toActions(i);r.length===0?x.triggerDone():(r.push(v.noneEndTrigger()),v.ddf5(r))}}class Qs extends F{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 ${y.levelGateText(this.level)}creature to an available lane adjacent to ${this.name}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}jr8(t){const i=m.creatByTr(t);if(this.emptySloots(i).length>0){const r=b.crFriendNotMeActTarg("CARD",i.id,this.code,S.enTil("P1",i.id));r.level=D.ddf2(this.level);const a=D.toActions(r);a.length>0?(a.push(v.noneEndTrigger()),v.ddf5(a)):x.triggerDone()}else x.triggerDone()}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.emptySloots(m.jr5(i[1]),m.ddf6(t).id);r.push(v.cancelAction()),v.ddf5(r)}else{const r=m.jr5(i[1]);this.logAct(!1,r),r.move(t.lane),v.actionDone(!0)}}emptySloots(t,i=""){return v.emptyAdjacents(t,S.enTil("P2",i))}}class _s extends F{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,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.playerNug(this.boof246,"TX"),r}ddf8(t){const i=$.toDamage(t.event);return!i.battle&&i.isCreatTarg&&i.hurtCreat.owner!==t.owner}jr8(t){A.hurtDirect(!t.owner,this.boof246,this.code),x.triggerDone()}}class ta extends F{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 i=-this.boof135;this.text=`When ${this.name} becomes opposed, it gets ${y.jr9(i,i)}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("EF");const a=r.jr4("MV"),c=-this.boof135;return a.bonus=this.buffNug(c,c),r}ddf8(t){const i=$.toCreature(t.event);return t.trigger.creatId===i.creature.id&&t.trigger.type==="MV"||i.creature.owner!==t.owner}jr8(t){let i=!1;const r=m.creatByTr(t),a=$.toCreature(t.event);if((r.id===a.creature.id&&r.opposed||a.creature.lane===m.oppositeLane(r.lane))&&(i=!0),i){const c=-this.boof135;r.buff(c,c)}x.triggerDone()}}class ea extends F{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 ${y.dbdtap()} on your turn, you may deal that much damage to an enemy creature.~Allied Nekrium: When a creature is destroyed, Zarox gets ${y.jr9(this.boof124,0)}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("DM");return a.interactive=!0,a.bonus=this.buffNug(this.lValN([3,6,14]),0,"TP"),r}handleAction(t){m.ddf6(t).hurtDirect(parseInt(t.param),this.code),v.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const i=$.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId&&i.srcCreat.owner===A.getActiveB()}else return!0}jr8(t){if(t.trigger.type==="FR"){if(L.allied("N")){const i=m.creatByTr(t),r=i.jr4("DS");r.bonus=this.buffNug(this.boof124,0,"TS"),i.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const i=t.event,r=D.toActions(b.crEnemyActTarg("CARD",this.code,i.dmg.toString()));r.length>0?(r.push(v.noneEndTrigger()),v.ddf5(r)):x.triggerDone()}else t.trigger.type==="DS"&&(this.logAct(!1),m.creatByTr(t).buff(this.boof124,0),x.triggerDone())}}class ia extends F{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 i=this.boof234;this.text=`While ${this.name} is in a side lane, it gets ${y.jr9(i,i,!0)} and Regenerate ${this.level}.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){if(t.lane===1||t.lane===5){const i=this.boof234;[b.mod("AT",i,t.id),b.mod("HL",i,t.id),b.mod("MH",i,t.id),b.mod("RG",this.level,t.id)].forEach(a=>{t.addModSafe(a)})}else t.removeModSafe(t.id)}}class ra{cardCache=new Map;mapper={["AAK"]:zi,["ABB"]:Zi,["ABM"]:ft,["AGC"]:ft,["AGK"]:z,["AGP"]:nt,["AGW"]:W,["ASG"]:W,["AMS"]:z,["AFO"]:ge,["ATG"]:Gt,["ATP"]:Te,["ART"]:Gt,["ATS"]:Gt,["AGM"]:ue,["ALG"]:Ne,["AHL"]:Ki,["ALS"]:Ne,["ASB"]:te,["AAA"]:Yi,["ABE"]:nt,["ATZ"]:W,["AEC"]:Mt,["AVB"]:W,["ARB"]:Gt,["AEN"]:O,["APM"]:Xi,["AQE"]:W,["AGD"]:qi,["AFS"]:ee,["AWU"]:Fe,["ASQ"]:yt,["AOP"]:W,["AMD"]:ji,["ABR"]:Yt,["AFR"]:z,["AMY"]:Yt,["ABL"]:oe,["ATT"]:dt,["AMP"]:Se,["AGU"]:O,["AIV"]:Wt,["ATI"]:z,["BRS"]:ui,["BTB"]:hi,["BTH"]:O,["BTI"]:ft,["BTN"]:Ne,["BBB"]:O,["BLH"]:Gt,["BFT"]:W,["BZH"]:W,["BSP"]:Wt,["BWK"]:ue,["BLW"]:O,["BTD"]:de,["BZS"]:z,["BBR"]:W,["BBD"]:W,["BBL"]:W,["BBN"]:W,["BSR"]:ft,["BMY"]:Ji,["BSW"]:yt,["BWW"]:ce,["BTM"]:W,["BLP"]:W,["BOS"]:K,["BAW"]:ft,["BWG"]:O,["BTR"]:z,["BWD"]:ve,["BOF"]:Ht,["BSG"]:_i,["BSS"]:z,["BTS"]:ve,["BST"]:pe,["BWT"]:Qi,["BRF"]:ue,["BRH"]:dt,["BWH"]:tr,["BWN"]:dt,["BRN"]:me,["BZD"]:z,["BFM"]:z,["BSM"]:er,["CKB"]:ft,["CDT"]:ue,["CMF"]:Qe,["CTL"]:nt,["CCS"]:yt,["CDM"]:dt,["CHY"]:O,["CSR"]:ui,["CSL"]:O,["CGG"]:Tt,["CHV"]:ir,["CCC"]:nt,["CRS"]:ge,["COD"]:nt,["CHT"]:W,["CTI"]:z,["CHA"]:ft,["CHH"]:z,["CHR"]:te,["CBB"]:Ze,["CDC"]:O,["CFB"]:Yt,["CNM"]:O,["CSW"]:z,["CTG"]:O,["CCT"]:$e,["CFG"]:ze,["CGF"]:Tt,["CGL"]:yt,["CSU"]:W,["CCR"]:ft,["CSB"]:Tt,["CNT"]:W,["CWK"]:O,["CRC"]:Wt,["CMR"]:rr,["CYP"]:sr,["CYC"]:Gt,["COZ"]:K,["CYS"]:Tt,["CYW"]:Mt,["CTW"]:W,["CTV"]:W,["CYR"]:dt,["CAG"]:W,["CBS"]:W,["CEX"]:nt,["CIN"]:He,["CSH"]:yt,["CSG"]:ze,["CTM"]:ar,["DFM"]:K,["DFR"]:z,["DHC"]:nr,["DHW"]:Gt,["DRS"]:ft,["DSS"]:Oe,["DSW"]:z,["DSE"]:ft,["DSA"]:ft,["DCR"]:nt,["DSK"]:Tt,["DPO"]:W,["DBA"]:z,["DBP"]:O,["DMR"]:O,["DBR"]:O,["DFS"]:nt,["DCS"]:Rt,["DPG"]:hr,["DWW"]:lr,["DDF"]:W,["DGZ"]:nt,["DNK"]:cr,["DBN"]:z,["DOV"]:Se,["DDS"]:ur,["DIS"]:Mt,["DSV"]:dr,["DDD"]:z,["DPB"]:fr,["DZA"]:K,["DZD"]:te,["DRE"]:Mt,["DKS"]:de,["DGS"]:ft,["DGW"]:gr,["DRD"]:mr,["DBT"]:W,["DTR"]:te,["DFB"]:Ht,["DMW"]:ee,["DCH"]:Mt,["DTD"]:O,["DHM"]:dt,["DSZ"]:O,["DYB"]:oe,["DBQ"]:pr,["DYF"]:W,["DYS"]:yr,["DYL"]:br,["EBW"]:Ze,["ESD"]:kr,["ESK"]:Wt,["EHW"]:Ar,["ETN"]:W,["EWE"]:Fe,["EVT"]:Mt,["ENP"]:W,["ESU"]:Mt,["ENR"]:W,["EPD"]:nt,["EPH"]:Tr,["EPS"]:Yt,["ESG"]:vr,["ESC"]:ve,["ESP"]:Sr,["EWT"]:z,["EHN"]:ve,["EWF"]:K,["EWV"]:nt,["EFA"]:W,["EFM"]:Yt,["EFP"]:Cr,["EFE"]:wr,["EXD"]:W,["FWB"]:O,["FWR"]:O,["FFG"]:O,["FST"]:Tt,["FWK"]:Tt,["FIN"]:W,["FRR"]:nt,["FVA"]:oe,["FSL"]:ue,["FWG"]:K,["FWC"]:Wt,["FFU"]:yt,["FLH"]:Qe,["FMS"]:O,["FSM"]:nt,["FOR"]:W,["FBC"]:Yt,["FBI"]:Gt,["FFS"]:yt,["FLN"]:W,["FJT"]:W,["FRI"]:ft,["FSS"]:Oe,["FLS"]:Gt,["FSH"]:yt,["FFD"]:Tt,["FRV"]:ft,["FSC"]:Tt,["FSP"]:dt,["FPR"]:O,["FFL"]:W,["FGA"]:O,["FGB"]:O,["FGD"]:dt,["FGG"]:ee,["FGO"]:O,["FOL"]:ge,["FPM"]:O,["FPS"]:O,["FWS"]:te,["FLC"]:ft,["FFM"]:Fe,["FRH"]:K,["FMD"]:Dr,["FME"]:Wt,["FSK"]:xr,["FKS"]:Br,["FWT"]:z,["FZS"]:W,["FUN"]:K,["GOS"]:Hr,["GHS"]:ee,["GHB"]:$e,["GHR"]:Nr,["GRN"]:ze,["GTH"]:W,["GSC"]:ue,["GMP"]:Rt,["GTT"]:Fr,["GCL"]:O,["GCR"]:W,["GLF"]:ft,["GRW"]:ft,["GSW"]:z,["GVS"]:Tt,["GSS"]:z,["GPV"]:Pr,["GBG"]:Tt,["GGE"]:O,["GGH"]:O,["GRP"]:Mr,["GGB"]:Ht,["GGD"]:Ht,["GGR"]:Ht,["GGP"]:Ht,["GGS"]:O,["GGW"]:Ht,["GRM"]:nt,["GHT"]:ft,["GMR"]:Tt,["GSF"]:Rr,["GAS"]:Er,["HMF"]:dt,["HOS"]:dt,["HTR"]:ce,["HAR"]:W,["HFA"]:Ie,["HOD"]:dt,["HMO"]:de,["HRM"]:Lr,["HWM"]:He,["HVE"]:de,["HOX"]:Mt,["HGS"]:Gr,["HTP"]:Wr,["IBF"]:nt,["IGR"]:Mt,["ITO"]:Mt,["ISB"]:$e,["IKA"]:Pe,["IME"]:Mt,["IDF"]:dt,["IRT"]:fi,["IVS"]:nt,["ICD"]:Ir,["IWC"]:O,["IBA"]:Gt,["IHA"]:ue,["IBR"]:Ze,["IMD"]:te,["IMA"]:z,["IZL"]:$r,["IZR"]:Ur,["IZK"]:Gt,["IFL"]:me,["IFR"]:W,["JPK"]:W,["KDC"]:O,["KSB"]:z,["KAW"]:Gt,["KOD"]:yt,["KBE"]:Vr,["KIW"]:Or,["KTS"]:Ve,["KKK"]:ce,["LOD"]:nt,["LFA"]:zr,["LVG"]:ce,["LKP"]:Zr,["LGT"]:z,["LLD"]:Be,["LLG"]:Be,["LLS"]:Be,["LLT"]:Be,["LLV"]:Be,["LMD"]:Se,["LBD"]:z,["LSS"]:Oe,["LBL"]:Rt,["LBC"]:Kr,["LBR"]:W,["LSK"]:me,["LTT"]:ce,["LTM"]:O,["LWY"]:O,["LSP"]:He,["LVH"]:Yr,["LTU"]:de,["LCE"]:Mt,["LUC"]:Fe,["LMV"]:z,["LHY"]:O,["LYR"]:me,["LYS"]:W,["MMH"]:ft,["MMY"]:W,["MHR"]:Xr,["MRF"]:O,["MMG"]:ee,["MOE"]:z,["MXW"]:ft,["MSP"]:Mt,["MDR"]:Se,["MMA"]:z,["MMR"]:z,["MMX"]:Tt,["MMI"]:O,["MMO"]:O,["MMV"]:Wt,["MPH"]:W,["MSC"]:W,["MTS"]:gi,["MTT"]:qr,["MML"]:jr,["MMW"]:Jr,["MBR"]:z,["MDE"]:di,["MBP"]:yt,["MTD"]:z,["MND"]:yt,["MNM"]:Rt,["NNS"]:W,["NGB"]:ft,["NGW"]:O,["NSL"]:W,["NCF"]:W,["NCM"]:te,["POZ"]:K,["NCP"]:Se,["NCS"]:yt,["NCW"]:O,["NCV"]:W,["NSW"]:Qr,["NDY"]:W,["NDR"]:_r,["NEM"]:Mt,["NSH"]:nt,["NXA"]:ts,["NXB"]:fi,["NXC"]:O,["NXG"]:es,["NXO"]:ge,["NXP"]:ci,["NXT"]:Ne,["NGT"]:Ht,["NGQ"]:is,["NSD"]:K,["NCL"]:nt,["NFF"]:yt,["NUG"]:Rt,["NAM"]:O,["NOZ"]:Tt,["NSY"]:z,["ONN"]:rs,["OXA"]:ss,["OXM"]:z,["OXP"]:as,["OOZ"]:K,["OBB"]:ns,["OEX"]:W,["OWH"]:os,["ORC"]:Se,["OBD"]:O,["OFM"]:z,["OJC"]:dt,["OPK"]:z,["OSV"]:pe,["OSS"]:W,["OWW"]:ee,["OHV"]:yt,["ODC"]:hs,["OSP"]:O,["OAP"]:ls,["OSL"]:O,["OWF"]:nt,["OXS"]:cs,["PHM"]:z,["PPM"]:yt,["PSM"]:z,["PLW"]:nt,["POA"]:ft,["POD"]:ve,["POK"]:z,["POT"]:z,["PRG"]:O,["PRI"]:gi,["PHS"]:ft,["PHC"]:nt,["PTB"]:nt,["PLI"]:Te,["PSC"]:yt,["PSH"]:Wt,["PTR"]:W,["PSG"]:W,["PVA"]:us,["PMI"]:z,["PMS"]:W,["POX"]:Tt,["PMP"]:W,["PYG"]:$e,["PYM"]:Ue,["PYS"]:nt,["QSW"]:de,["RBH"]:ds,["ROK"]:nt,["REW"]:z,["RPT"]:K,["RHY"]:O,["RTS"]:Yt,["RTW"]:de,["RHU"]:pe,["RSC"]:Ve,["RMB"]:fs,["RPR"]:W,["RLW"]:dt,["RFL"]:gs,["RHC"]:O,["ROG"]:oe,["ROU"]:nt,["ROE"]:nt,["RWC"]:ve,["RFA"]:Ie,["RWD"]:ft,["RSD"]:Pe,["RSE"]:ms,["RBG"]:Ue,["RGG"]:Wt,["RSZ"]:Tt,["RSP"]:O,["RHW"]:dt,["SBF"]:Rt,["SAP"]:W,["SPL"]:K,["SVO"]:W,["SSE"]:Rt,["SXP"]:K,["SXD"]:K,["SST"]:ee,["SXT"]:K,["STS"]:nt,["SCS"]:O,["SMD"]:z,["SFS"]:ps,["SHY"]:ft,["SKN"]:ys,["SCD"]:O,["SFT"]:O,["SOC"]:W,["SOA"]:W,["SOD"]:W,["SOK"]:me,["SOT"]:W,["SDL"]:K,["SAD"]:bs,["SCZ"]:dt,["SFE"]:ce,["SWS"]:ks,["SHA"]:dt,["SHG"]:W,["SBI"]:Ze,["SCC"]:Ve,["SPB"]:As,["SPD"]:Rt,["SPG"]:oe,["SPM"]:Rt,["SPT"]:Ts,["STD"]:ft,["STB"]:me,["SHS"]:ue,["SSP"]:dt,["SGF"]:yt,["SKG"]:ci,["SLS"]:vs,["SSD"]:Pe,["SDA"]:Ss,["SSR"]:Wt,["SNB"]:W,["SNP"]:nt,["SRD"]:nt,["SSH"]:Te,["SRM"]:yt,["SRH"]:Ht,["SDN"]:z,["SHV"]:W,["SRP"]:W,["SGG"]:z,["SBA"]:O,["SKB"]:O,["SBR"]:O,["SKS"]:pe,["SEL"]:Cs,["STM"]:O,["SWA"]:Gt,["SFG"]:yt,["S01"]:te,["SPR"]:Ht,["SLG"]:z,["SBD"]:z,["SCV"]:ws,["SFM"]:Tt,["SSN"]:O,["SSM"]:Wt,["SLH"]:Ds,["SPN"]:K,["SSI"]:He,["SND"]:Ve,["SNT"]:Tt,["SRV"]:Ue,["STR"]:W,["SPU"]:K,["XYR"]:K,["SPH"]:xs,["SSA"]:yt,["STO"]:W,["SDR"]:dt,["SOL"]:Pe,["SOV"]:W,["SMS"]:de,["SHK"]:me,["SIX"]:ft,["SWR"]:Bs,["SMN"]:O,["SER"]:Hs,["SES"]:Ns,["SFA"]:Ie,["STG"]:Fs,["SSS"]:Oe,["SSK"]:z,["SNK"]:ge,["SWG"]:pe,["SWM"]:yt,["SIV"]:nt,["STN"]:W,["SGI"]:O,["SBG"]:Ps,["SCL"]:O,["SGA"]:Ie,["STP"]:W,["SSG"]:Wt,["SVH"]:Yt,["SIN"]:W,["SYL"]:z,["SEV"]:ft,["SMA"]:O,["SML"]:O,["SYO"]:Rs,["TST"]:nt,["TBA"]:Rt,["TGL"]:W,["TGS"]:O,["TPT"]:W,["TDW"]:dt,["TNL"]:Es,["TEX"]:ge,["TGN"]:O,["TSM"]:ge,["TUP"]:W,["TOT"]:W,["TAB"]:di,["TGI"]:z,["TDS"]:te,["TSP"]:Ls,["TNM"]:O,["TPG"]:Te,["TMG"]:Te,["TMM"]:Gs,["TRA"]:z,["TRS"]:z,["TRV"]:z,["TRW"]:z,["TBB"]:Qe,["TOB"]:oe,["TCN"]:ce,["TWS"]:O,["TVG"]:hi,["TXB"]:W,["TXS"]:W,["TFK"]:K,["TFD"]:K,["TFF"]:K,["TCG"]:W,["TMS"]:Ws,["TBC"]:Is,["TWT"]:O,["TRN"]:nt,["TGK"]:Ue,["TSL"]:$s,["TTF"]:K,["TWG"]:ze,["UGM"]:Wt,["USY"]:dt,["UGL"]:z,["UIC"]:Us,["ULR"]:Vs,["ULG"]:oe,["URD"]:O,["USA"]:Tt,["UBL"]:W,["UCM"]:yt,["UEM"]:Os,["UHS"]:zs,["UIM"]:yt,["USS"]:Rt,["UWL"]:z,["UWS"]:z,["UIW"]:z,["URS"]:W,["UTM"]:z,["UTR"]:dt,["URB"]:Yt,["UPM"]:ee,["VIC"]:z,["VIK"]:z,["VRP"]:Ks,["VBK"]:O,["VIN"]:Te,["VTC"]:O,["VTW"]:pe,["VGN"]:Tt,["VND"]:z,["VNF"]:ft,["VNS"]:z,["VSK"]:W,["VCH"]:nt,["VGR"]:W,["VSP"]:W,["VTR"]:W,["VGL"]:W,["VGW"]:Ys,["VOB"]:oe,["VCG"]:Rt,["VPR"]:Xs,["VES"]:Yt,["VYE"]:W,["WBY"]:ft,["WBU"]:ft,["WHC"]:O,["WHR"]:qs,["WMC"]:z,["WMR"]:yt,["WMM"]:W,["WTK"]:Pe,["WTW"]:O,["WEB"]:pe,["WGE"]:oe,["WTA"]:js,["WWP"]:z,["WWR"]:yt,["WOD"]:nt,["WFM"]:ee,["WWS"]:Js,["WBH"]:Fe,["WCS"]:Qs,["WPD"]:O,["WSE"]:_s,["WPC"]:nt,["WFB"]:z,["WFS"]:yt,["WBG"]:Rt,["XTE"]:ee,["XCR"]:O,["XDH"]:ft,["XHS"]:Tt,["XHU"]:O,["XRF"]:ta,["XSH"]:yt,["XTR"]:z,["XDV"]:ce,["XRW"]:W,["YWC"]:O,["YNS"]:Ht,["ZXR"]:ea,["ZPM"]:yt,["ZTR"]:K,["ZTU"]:Tt,["ZIN"]:O,["ZDK"]:z,["ZBS"]:K,["ZST"]:K,["ZMT"]:ia,["ZMB"]:K,["ZSH"]:Rt};makeCard(t){try{let i;if(t==="SOV3"?i=new Zs(t):t==="SOC3"?i=new z(t):t==="LOD3"?i=new or(t):t==="GOS3"?i=new Ms(t):i=new this.mapper[Nt.extractCardCode(t)](t),i.type==="C"){const r=i;r.spice=[{icon:"A",num:r.iAttack},{icon:"H",num:r.iHealth}].concat(r.spice??[])}return i}catch(i){throw console.error("Make card screwed up on code: "+t),i}}getCard(t){let i=this.cardCache.get(t);return i||(i=this.makeCard(t),this.cardCache.set(t,i)),i}}const G=new ra;class sa{registry;constructor(){this.registry=[]}find(t){const i=this.registry.find(r=>r.action===t);if(i)return i;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,i){const r=this.find(t);r.enabled=i}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const i=this.registry.findIndex(r=>r.action===t);i>-1&&this.registry.splice(i,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,i,r){if(E.ui.animating)return;let a,c;this.scaleFactor===1?(a=t,c=i):(a=Math.round(t*this.scaleFactor),c=Math.round(i*this.scaleFactor));let f,p=S.clickMode;return p==="M"?f=r:r===st.ForceRight?f=st.Right:p==="T"?f=st.Left:f=st.Right,je.arrayHit(this.registry,a,c,f)}updateScale(t){t===1?this.scaleFactor=1:this.scaleFactor=1/t}scaleFactor=1}const Q=new sa;class aa{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)),bt.drawAll()}handleMenuPick(t,i){let r=!0;if(t==="CI"||t==="CV")this.vsAI=t==="CI",S.writeBoolStorage("cAI",this.vsAI);else if(t==="CN")r=!1,this.ezDeck(this.p1)?this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",v.ddf5(this.generateDeckPickerActions())):(this.step="A",v.ddf5(this.generateDeckPickerActions()));else{const a=i==="A"?this.p1:this.p2;t==="LK"?(r=!1,Et.loadFromFile().then(c=>{typeof c=="string"?new Xe().iAmError(c):(a.deck=c,a.mode=t,S.writeStorage("cMode"+i,t),bt.drawAll())})):(a.mode=t,S.writeStorage("cMode"+i,t))}r&&bt.drawAll()}ezDeck(t){return t.mode==="CP"?!1:(t.mode==="CR"?t.deck=Et.randomStockDeck():t.mode==="CX"&&(t.deck=Et.treatsAbound(!0)),!0)}handleDeckPick(t){const i=Et.stockDeckByPram(t);this.step==="A"?(this.p1.deck=i,this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",v.ddf5(this.generateDeckPickerActions()))):(this.p2.deck=i,this.launchConstructed())}previewDeckPick(t){const i=Et.stockDeckByPram(t);At.showDeck(Et.parseDeck(i.cards))}generateDeckPickerActions(t=-1){const i=Ae.map((r,a)=>{const c=b.basicAction("DSET");return c.param=a.toString(),c});if(t>-1){const r=Ae[t],a=r.decks.map(c=>{const f=b.basicAction("DECK");f.param=S.enTil(r.id,c.name);const p=b.basicAction("DPVW");return p.param=f.param,[f,p]});return i.concat(a.flat())}return i}launchConstructed(){E.aiMode=this.vsAI,mt.setMode("G"),E.newGame(this.p1.deck.cards,this.p2.deck.cards)}replay(){E.newGame(this.p1.deck.cards,this.p2.deck.cards)}dud(){return{mode:"CP",deck:{cards:[],name:"",factions:[]}}}}const Pt=new aa;class na{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 i=JSON.parse(t);this.deathOrder=i.dO,this.graveyard=i.gY}deathCheck(){const t=E.tick();m.qActiveCreats().forEach(a=>{a.health<1&&(y.lawg(a.code," died."),this.smite(a,t))});const i=A.toPlayer(!0),r=A.toPlayer(!1);(i.health<1||r.health<1)&&(i.healthr.creatId===t.id)&&(this.deathOrder=this.deathOrder.filter(r=>r.creatId!==t.id))}findDeathTime(t){const i=this.deathOrder.filter(r=>r.creatId===t).map(r=>r.time);if(i.length!==0)return Math.min(...i)}destroy(t,i,r=void 0){t.status==="A"?(y.lawg(t.code," was destroyed by ",i,"."),this.smite(t,r)):(console.warn(`Attempted to destroy creature that was not active. Targ creat ${t.code}; Killer creat ${i}`),console.trace())}gravedigger(t="X",i="LA"){if(t==="X"&&i==="LA"){const r=this.graveyard.length;return r===0?"":this.graveyard[S.randInt(0,r)].cardCode}else{let r;if(t==="X")r=this.graveyard;else{const c=A.toBool(t);r=this.graveyard.filter(f=>f.owner===c)}i!=="LA"&&(r=r.filter(c=>D.levelTargetTest(i,parseInt(c.cardCode.slice(3)))));const a=r.length;return a===0?"":r[S.randInt(0,a)].cardCode}}smite(t,i=void 0){t.status="D",this.deathOrder.push({creatId:t.id,time:i||E.tick()}),this.graveyard.push({cardCode:t.code,owner:t.owner}),x.addEvents($.creature("DIE",t)),fe.positionChange(t.owner),t.owner?L.deathsA.push(t.code):L.deathsB.push(t.code)}}const V=new na;class oa{get youi(){return E.ui}initDeck(t,i){this.youi.deckContents=t,this.youi.deckScroll=0,this.youi.deckSummary=i,mt.setMode("T")}get canPageDown(){return this.youi.deckContents.length-this.youi.deckScroll>15}get canPageUp(){return this.youi.deckScroll>0}paginate(t){t?this.youi.deckScroll+=15:this.youi.deckScroll-=15}visibleContent(){const t=this.youi.deckScroll;return this.youi.deckContents.slice(t,t+15)}generateContent(t,i,r){const a=D.cardByTarget(t,r);if(E.aiActive||a.sort((c,f)=>{const p=c[0],k=f[0];return k===p?0:p>k?1:-1}),i){const c=a.length;let f=0,p="",k=0;const w=[];for(;f0&&w.push({cardCode:p,sourceIdx:-1,cardCount:k}),p=a[f][0],k=1),f++;return c>0&&w.push({cardCode:p,sourceIdx:-1,cardCount:k}),w}else return a.map(c=>({cardCode:c[0],sourceIdx:c[1],cardCount:0}))}handleShowDeck(t){let i;const r=S.deTil(t.param);if(r[0]==="VE")i=A.activeCardItems(S.txt2bool(r[1]));else{const a=A.getActive();i=t.param==="VR"?a.deck:a.discard}this.showDeck(i)}handleDeckScroll(t){this.paginate(t.param==="D"),bt.drawAll()}showCustomDeck(t,i){this.initDeck(t,!1);const r=this.rightClickers(),a=i.concat(r);return v.ddf5(a),a}showDeck(t){this.initDeck(this.generateContent(t,!0),!0);const i=v.cancelAction();i.key="CNCL",i.param="PM";const r=this.rightClickers();r.push(i),v.ddf5(r)}rightClickers(){return E.aiActive?[]:this.youi.deckContents.map((t,i)=>{const r=b.deckSelectAction("DEET",t.cardCode,i);return r.param=t.cardCode,r})}}const At=new oa;class ha{friends;friendText;get browseStack(){return E.ui.detailStack}n(t,i){return`${t}${i}`}friendo(t,i){const r=Array.isArray(i)?i:[i];[1,2,3].forEach(a=>{this.friends[this.n(t,a)]=r.map(c=>this.n(c,a))})}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),i=this.n("AVB",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)],[this.n("EWV",1)]:[this.n("EWF",1)],[t]:[this.n("FWG",1)],[this.n("IBA",1)]:[i],[this.n("IBA",2)]:[i],[this.n("IBA",3)]:[i],[this.n("IBA",4)]:[i],[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("ROE",1)]:[this.n("FRH",1),this.n("LVG",1),this.n("LTT",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("SLS",1)]:[this.n("MMY",1)],[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.friendo("FME","FMD"),this.plont("GMR"),this.friendo("IZL",["IFL","IFR","IZR"]),this.friendo("IZR",["IFL","IFR","IZL"]),this.friendo("IZK",["IFL","IFR","IZL","IZR"]),this.friendo("LVH","KBE"),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("SST"),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("USS","LWY"),this.friendo("VIC",["IFL","IFR"]),this.friendo("WHR","WHC"),this.plont("WWS"),this.friendo("YNS","XYR");const r=42,a=31,c=40,f=51,p=38,k=52,w=66;this.friendText={["AVB"]:[42,"Hammer"],["BOS"]:[f,""],["BWT"]:[68,"Bron"],["BRF"]:[18,""],["CGF"]:[65,"Fiend"],["CYP"]:[4,""],["COZ"]:[a,""],["DFM"]:[33,"Mimic"],["DNK"]:[8,""],["DZA"]:[59,"Dozer"],["DYF"]:[38,"Infusion"],["EPS"]:[49,"Soldier"],["EWF"]:[18,""],["FWG"]:[44,""],["FWC"]:[28,"Chrysalis"],["FGA"]:[65,"Alpha"],["FGB"]:[77,"Beta"],["FGG"]:[53,"Gamma"],["FGO"]:[57,"Omega"],["FRH"]:[21,""],["FMD"]:[47,"Dragon"],["FME"]:[78,"Egg"],["FUN"]:[49,""],["HTP"]:[38,"Hunting"],["ITO"]:[r,"Torrent"],["IZL"]:[42,"Av Flame"],["IZR"]:[44,"Av Frost"],["IFL"]:[65,"Flame"],["IFR"]:[67,"Frost"],["KBE"]:[83,"Bee"],["LVG"]:[16,""],["LTT"]:[65,"Titan"],["LWY"]:[65,"Wyrm"],["MMY"]:[40,""],["POZ"]:[a,""],["NDR"]:[3,""],["NSD"]:[c,""],["OOZ"]:[a,""],["PTR"]:[r,"Torrent"],["RPT"]:[51,""],["RSC"]:[60,"Scout"],["SPL"]:[f,""],["SXP"]:[f,""],["SXD"]:[c,""],["SXT"]:[p,""],["SDL"]:[c,""],["SLG"]:[25,""],["SPN"]:[w,""],["STR"]:[r,"Torrent"],["SPU"]:[w,""],["XYR"]:[w,""],["STO"]:[r,"Torrent"],["TOT"]:[40,"Tendrils"],["TFK"]:[p,""],["TFD"]:[p,""],["TFF"]:[p,""],["TTF"]:[p,""],["WHC"]:[41,"Courser"],["WEB"]:[78,""],["ZTR"]:[32,"Returned"],["ZBS"]:[k,""],["ZST"]:[k,""],["ZMB"]:[k,""]}}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(!E.aiActive)if(E.ui.detailStack=[t],mt.mode!=="R"){mt.setMode("R");const i=b.basicAction("CNCL");i.zone=mt.baseMode==="G"?"B":"N",i.param="PM",v.ddf5([i])}else bt.drawAll()}changeLevel(t){const i=this.browseStack,r=i.length-1,a=i[r];i[r]=this.n(Nt.extractCardCode(a),t)}goBack(){this.browseStack.pop()}goToFriend(t){this.browseStack.push(t)}friendTxt(t){const i=this.friendText[t];return i||[3,"I am error"]}goBackAction(){const t=b.basicAction("DTUP");return t.param="DB",t}levelAction(t){const i=b.basicAction("DTUP");return i.param=S.enTil("DL",t),i}friendAction(t){const i=b.basicAction("DTUP");return i.param=S.enTil("DF",t),i}updateDetails(t){const i=S.deTil(t.param),r=i[0];r==="DB"?this.goBack():r==="DF"?this.goToFriend(i[1]):r==="DL"?this.changeLevel(parseInt(i[1])):console.error("Unknown detail arg",t)}}const ie=new ha,ti=[1,2,3,4,5,6,7].map(o=>o.toString());class la{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(ke.map(t=>[t,!0])),this.setFilters=new Map(ti.map(t=>[t,!0])),this.stats=new ni}getRarity(t){return this.rarityFilters.get(t)??!0}toggleRarity(t){const i=!this.rarityFilters.get(t);return this.rarityFilters.set(t,i),i}getSet(t){return this.setFilters.get(t.toString())??!0}toggleSet(t){const i=t.toString(),r=!this.setFilters.get(i);return this.setFilters.set(i,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),ti.forEach(t=>{this.setFilters.set(t,S.readBoolStorage("dSet"+t,!0))}),ke.forEach(t=>{this.rarityFilters.set(t,S.readBoolStorage("dRare"+t,!0))})),bt.drawAll()}setFArr(){let t=ti.filter(i=>this.setFilters.get(i)).map(i=>parseInt(i));return t.length===7&&(t=[]),t}validRarities(){return ke.filter(t=>this.rarityFilters.get(t))}startDraftPicks(){const t=this.setFArr();ke.forEach(i=>{this.getRarity(i)?this.rarityCache[i]=Et.getDeckCards([i],[],t):this.rarityCache[i]=[]}),ke.every(i=>this.rarityCache[i].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 ni,this.resumeDraft("")}resumeDraft(t){if(t){this.picks.push(t),this.picksAsDeck=this.picksToDeck();const a=this.overdraft?60:30;if(this.picks.length===a){this.step==="A"?(this.pAdeck=this.picksAsDeck.slice(),this.step="B",this.startDraftPicks()):(this.pBdeck=this.picksAsDeck.slice(),this.launchDraft());return}const c=G.getCard(t);if(this.aiPicking||this.stats.addStat(c.type,c.faction),!this.factionLock){const f=c.faction;if(this.faction1==="X")this.faction1=f;else if(f!==this.faction1){this.faction2=f,this.factionLock=!0;const p=this.setFArr();this.validRarities().forEach(k=>{this.rarityCache[k]=Et.getDeckCards([k],[this.faction1,this.faction2],p)})}}}const i=this.generatePack().slice(-1*(6-this.picks.length%5)),r=this.fillPack(i);if(this.aiPicking)this.resumeDraft(r[r.length-1]);else{this.currentPack=r;const a=r.map((c,f)=>{const p=b.draftSelectAction("DRFT",f,!0);return p.param=c,p});Q.removeAll(),v.ddf5(a)}}replay(){this.vsAI?(this.step="B",this.startDraftPicks()):this.launchDraft()}picksToDeck(){const t=[];return this.picks.forEach(i=>{const r=t.findIndex(a=>a.card===i);r===-1?t.push({card:i,num:1}):t[r].num+=1}),t.sort((i,r)=>{const a=G.getCard(i.card+"1"),c=G.getCard(r.card+"1");return a.name.toLowerCase(){const a=this.rarityCache[r].length;let c=!0,f=0;for(;c&&f<100;){const p=this.rarityCache[r][S.randInt(0,a)];i.includes(p)?f++:(i.push(p),c=!1)}}),i}handleMenuPick(t,i){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=i;S.writeBoolStorage("dRare"+i,this.toggleRarity(r))}else t==="DT"?S.writeBoolStorage("dSet"+i,this.toggleSet(i)):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));bt.drawAll()}launchDraft(){E.aiMode=this.vsAI,mt.setMode("G"),E.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 la;class ca{allCanvases=["game-ui","field","player","hand","effects","decklist","card"];allBackgrounds=["playmat","blueface","mainmenu"];async drawAll(){if(lt.simOn)return;const t=mt.mode;if(Q.removeAll(),this.clearDetails(),t==="G")if(this.clearDeck(),await Promise.all([this.drawHand(A.getLocal()),this.drawPlayers(),this.drawField(),this.drawActions(v.activeActions)]),E.winFlag!==0)await this.drawGameOver(),setTimeout(()=>{mt.mode==="G"&&E.winFlag!==0&&this.drawField().then(()=>{this.drawGameOver(!0)})},1500);else{await this.drawCommonButtons(!0,!0,!0);const i=b.basicAction("DBUG");i.param="AB";const r=new ot(i,0,0,40,35,st.Right);Q.add(r)}else t==="R"?await this.drawDetails(v.activeActions):t==="T"?E.aiActive||await this.drawDeck(v.activeActions):t==="D"?await this.drawDraft(v.activeActions):t==="C"?await this.drawConstructed():t==="I"?await this.drawInfoMenu():t==="X"?await this.drawExit(v.activeActions):t==="S"?await this.drawSwap():await this.drawMenu()}async drawGameOver(t=!1){await new Me().drawGameOver(t)}async drawHand(t){await new ki().drawCards(t)}async drawField(){await new ri().drawCards()}async drawPlayers(){await new Me().drawAllPlayers()}async drawDeck(t){const i=t.find(f=>f.zone==="B"),r=mt.baseMode==="G";r&&await new Ke().drawActions(i?[i]:[]);const a=ht.get("decklist");a.clear();const c=new xa;if(c.makeHaze(a),!r&&i){const f=new De,p=631,k=712;await f.drawFactionButton(a,631,712,"A"),await f.drawSprite(a,"ui/arrow/x.png",p+28,k+12);const w=f.makeFactButtonClick(p,k,i);Q.add(w)}await c.drawActions(t,a),await c.drawCards(a),await this.drawCommonButtons(!0,!0,!1)}async drawActions(t){if(lt.simOn)return;const i=new Ke;if(E.aiActive)await i.drawActions([]);else{ht.get("effects").clear();const a=new ki,c=new ri,f=new Me;await Promise.all([a.drawActions(t),c.drawActions(t),i.drawActions(t),f.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;E.ui.animating=!0,ht.get("effects").clear(),await new ri().drawFight(t),E.ui.animating=!1}async drawDraft(t){ht.get("effects").clear();const r=new Ha,a=ht.get("game-ui");a.clear(),Q.removeAll(),pt.step==="O"?await r.drawDraftMenu(a):(await new Re().drawPickerPlayer(a,pt.step==="A",!1),await r.drawList(t,a),await r.drawStats(a),await this.drawCommonButtons(!0,!0,!1),await r.drawPack(t,a))}async drawMenu(){const t=new Na,i=ht.get("game-ui");i.clear(),Q.removeAll(),await t.drawMenu(i)}async drawInfoMenu(){const t=new Re,i=ht.get("game-ui");i.clear(),Q.removeAll(),await t.drawExtrasMenu(i)}async drawConstructed(){if(Pt.step==="O"){const t=new Xe,i=ht.get("game-ui");i.clear(),Q.removeAll(),await t.drawConstrMenu(i)}else await this.drawDeckPick(v.activeActions)}async drawDeckPick(t){const i=new Xe,r=new Re;ht.get("decklist").clear();const c=ht.get("game-ui");c.clear(),Q.removeAll(),await r.drawPickerPlayer(c,Pt.step==="A",Pt.vsAI),await i.drawSets(t,c),await i.drawList(t,c)}clearDetails(){ht.get("card").clear()}clearDeck(){ht.get("decklist").clear()}async drawDetails(t){await this.drawActions(t),await this.drawCommonButtons(!0,!0,!1),ht.get("card").clear();const r=new Ba,a=t.find(c=>c.key==="CNCL");a?await r.drawDetails(a):console.error("Attempted to show details view with no cancel action")}async drawCommonButtons(t,i,r){let a=979;const c=723,f=new De,p=ht.get("game-ui");if(r&&p.clear(),t&&(await f.makeIconButton(p,a,c,"EX"),a-=50,await f.makeIconButton(p,a,c,"HL"),a-=50),i){const k=S.clickMode;k!=="M"&&await f.makeIconButton(p,a,c,k==="I"?"TM":"DM")}}async drawExit(t){const i=ht.get("card"),r=new we;await r.drawButton(i,151,488,t[1],"Quit Game",24,!1),await r.drawButton(i,478,488,t[0],"Resume",52,!1)}async drawSwap(){const t=ht.get("decklist");t.clear(),t.context.fillStyle="#000000",t.context.fillRect(0,0,S.gameWidth,S.gameHeight);const i=new Me,r=A.getActive(),a="#AAF0C1",c=b.basicAction("USWP");c.param="PM",await i.drawPlayer(r,t,200,300);const f={fontSize:22,colour:a};await i.drawText(t,"Player "+(r.isPlayerA?"1":"2"),480,360,f),await i.drawText(t,"Click to start turn",480,420,f);const p=new ot(c,0,0,S.gameWidth,S.gameHeight,st.Both);Q.add(p)}setBackground(t){const i="hide";this.allBackgrounds.forEach(r=>{const a=document.getElementById(r);a&&(t===r?a.classList.remove(i):a.classList.add(i))})}playmatSetup(){let t=!1;const i=S.options.playmat,r=document.getElementById("playmat");if(r?r.dataset.pic!==i&&(t=!0,r.remove()):t=!0,t){const a=new Image(S.gameWidth,S.gameHeight);a.id="playmat",a.classList.add("hide",this.scaleCSS(S.options.scale)),a.dataset.pic=i,a.src=S.imgRoot+`background/playfield-${i}.jpg`,document.getElementById("mainmenu").before(a)}}scaleCSS(t){return`uiSize${t}`}changeScale(t){this.clearAll();let i=S.options.scale;i===t&&(i="100");const r=t==="100"?1:.90625;Q.updateScale(r);const a=this.scaleCSS(i),c=this.scaleCSS(t);this.allCanvases.forEach(k=>{ht.get(k).dom.classList.replace(a,c)}),this.allBackgrounds.forEach(k=>{const w=document.getElementById(k);w&&w.classList.replace(a,c)}),document.getElementById("solforge").classList.replace(`gameSize${i}`,`gameSize${t}`),document.getElementById("log").classList.replace(`logSize${i}`,`logSize${t}`),S.options.scale=t,S.writeStorage("scale",t)}clearAll(){this.allCanvases.forEach(t=>{ht.get(t).clear()})}}const bt=new ca;class ua{positionChange(t){m.creatByTarget().forEach(i=>{i.enforceEffects("PS",t)}),A.enforceEffects(t)}defenderChange(t){m.qPlayerCreats(t).forEach(r=>{r.effects.filter(a=>a.watch==="DF").forEach(a=>G.getCard(a.logicCode).enforceEffect(r))})}playerHealthChange(){m.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){m.qActiveCreats().forEach(i=>{i.enforceEffects("AT"),i.enforceEffects("AR"),i.enforceEffects("CH"),i.enforceEffects("DF",i.owner)})}}const fe=new ua;class da{getC(t){return m.jr5(t)}creature(t,i){return{code:t,creatId:i.id}}creatHeal(t,i){return{code:"CHL",creatId:t.id,healAmt:i}}damage(t,i,r,a,c,f,p){let k;return f instanceof Le?k=f.id:k=f,{code:"DMG",battle:t,dmg:i,life:r,isCreatSrc:a,isCreatTarg:c,target:k,srcId:p?.id}}enterField(t){return{code:"ENT",creatId:t.id,forged:!1,formation:!1}}playCard(t,i){return{code:"PLC",playerA:i,cardCode:t}}player(t,i){return{code:t,playerA:i}}playerHeal(t,i){return{code:"PHL",playerA:t,healAmt:i}}replaced(t,i){return{code:"RPL",creatId:t.id,replCreatId:i.id}}toCreature(t){const i=t;return{code:i.code,creatId:i.creatId,creature:this.getC(i.creatId)}}toDamage(t){const i=t;let r,a,c;return i.isCreatTarg?c=this.getC(i.target):a=A.toPlayer(i.target),i.isCreatSrc&&(r=this.getC(i.srcId)),{code:i.code,battle:i.battle,dmg:i.dmg,life:i.life,isCreatSrc:i.isCreatSrc,srcId:i.srcId,target:i.target,isCreatTarg:i.isCreatTarg,srcCreat:r,hurtCreat:c,hurtPlayer:a}}toEnterField(t){const i=t;return{code:i.code,creatId:i.creatId,forged:i.forged,formation:i.formation,creature:this.getC(i.creatId)}}toReplaced(t){const i=t;return{code:i.code,creatId:i.creatId,creature:this.getC(i.creatId),replCreatId:i.replCreatId,replCreat:this.getC(i.replCreatId)}}}const $=new da;class fa{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(i=>i.getState()),bO:this.birthOrder};return JSON.stringify(t)}setState(t){const i=JSON.parse(t);this.field=i.field.map(r=>new Le(r)),this.birthOrder=i.bO}jr5(t){const i=this.searchById(t);if(i)return i;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByTr(t){return this.jr5(t.creatId)}creatByLane(t,i){const r=this.searchByLane(t,i);if(r)return r;throw console.error("naughty creature lane ",t,i),new Error("Could not find creature by lane")}ddf6(t){const i=this.searchByFSA(t);if(i)return i;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return this.field.find(i=>i.id===t)}searchByLane(t,i){return this.field.find(r=>r.lane===t&&r.owner===i&&r.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let i=this.field;if(t){if(t.player!=="X"){const r=A.toBool(t.player);i=i.filter(a=>a.owner===r)}if(t.creatStatus!=="A"){const r=this.creatStatusTargetToCS(t.creatStatus);i=i.filter(a=>a.status===r)}if(!S.isUn(t.lanes)){const r=D.lanesToArr(t.lanes);i=i.filter(a=>r.includes(a.lane))}if(S.isUn(t.maxAttack)||(i=i.filter(r=>r.attack<=t.maxAttack)),t.notMe&&(i=i.filter(r=>r.id!==t.notMe)),t.victims){const r=S.deTil(t.victims);i=i.filter(a=>r.includes(a.id))}if(t.tribe!=="AN"&&(i=i.filter(r=>r.isTribe(t.tribe))),t.canLevel&&(i=i.filter(r=>G.getCard(r.code).canLevel())),t.level!=="LA"){const r=D.levelTargetToLevel(t.level);i=i.filter(a=>r.includes(a.level))}t.cardCode&&(i=i.filter(r=>G.getCard(r.code).cardCode()===t.cardCode)),t.canDefender&&(i=i.filter(r=>!r.negateDefender)),t.hasDefender&&(i=i.filter(r=>r.defender)),t.canArmor&&(i=i.filter(r=>!r.negateArmor)),t.hasArmor&&(i=i.filter(r=>r.armor>0)),t.canMove&&(i=i.filter(r=>!r.negateMobility)),t.hasMobility&&(i=i.filter(r=>r.mobility>0)),t.hasPoison&&(i=i.filter(r=>r.poison>0)),t.canRegen&&(i=i.filter(r=>!r.negateRegen)),t.hasRegen&&(i=i.filter(r=>r.regen>0)),t.faction!=="X"&&(i=i.filter(r=>r.faction===t.faction))}return i}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(i=>!this.field.find(a=>a.owner===t&&a.lane===i&&a.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(i=>Math.abs(t.lane-i)<=t.mobility):[]}fling(t){const i=this.emptyLanes(t.owner),r=i.length;r>0&&t.move(i[S.randInt(0,r)])}birth(t,i,r,a=0,c=void 0){if(i==="S"){const w=this.emptyLanes(r);if(w.length===0)return;a=w[S.randInt(0,w.length)]}else if(i==="P"&&!this.emptyLanes(r).includes(a))return;const f=typeof t=="string"?G.getCard(t):t,p=f.jr3(r,a);if(r===A.getActiveB()&&L.birthRegistrar(p.id),i==="F"||i==="R"){const w=this.searchByLane(a,r);if(w){if(!lt.simOn){const P=[w.code," was replaced"];i==="R"&&P.push(" with ",p.code),P.push("."),y.lawg(...P)}w.status="R",x.addEvents($.replaced(p,w))}}this.field.push(p);const k=$.enterField(p);return k.forged=i==="F",f.formation&&p.lane!==1&&p.lane!==5&&(k.formation=p.adjacent.every(w=>!S.isUn(this.searchByLane(w,r)))),this.birthOrder.push({creatId:p.id,time:c||E.tick()}),x.addEvents(k),p.enforceEffects("PH"),fe.positionChange(r),p}findBirthTime(t){const i=this.birthOrder.filter(r=>r.creatId===t).map(r=>r.time);if(i.length!==0)return i.length>1&&console.warn("wery curious, more than one birth record for creat "+t),i[0]}qActiveCreats(){return this.creatByTarget(b.crTarg())}qPlayerCreats(t){const i=b.crTarg();return i.player=A.toTarget(t),this.creatByTarget(i)}ddf1(){return this.creatByTarget(b.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(b.crEnemyTarg())}}const m=new fa;class ga{creatFightState(t,i){return t?i===1||t.defender||t.sleeping&&!t.aggressive?1:i===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t,i,r,a,c){if(t>0){let f=0;if(i>0){const p=t===2&&r.breakthrough;f=a.hurtBattle(c,r,p)}else t===2&&(f=c);f>0&&A.hurtBattle(!r.owner,f,r)}}fight(t){const i=!lt.simOn;i&&y.add("FIGHT!");let r=2,a=1;t&&(L.mainBattle=!1,r=0,a=0);const c=A.getActiveB(),f=[],p=[];m.laneIdx.forEach(w=>{const P=m.searchByLane(w,c),I=m.searchByLane(6-w,!c),U=this.creatFightState(P,r),J=this.creatFightState(I,a);(U===2||J===2)&&(p.push([U,J,P,I,P?.attack||0],[J,U,I,P,I?.attack||0]),U===2&&(L.ffs++,f.push([w,c])),J===2&&f.push([m.oppositeLane(w),!c]))}),this.barking&&f.length>0&&i&&S.dogBark();let k;i?k=bt.drawCombat(f):k=Promise.resolve(),k.then(()=>{p.forEach(w=>this.dukeItOut(...w)),fe.playerHealthChange(),V.deathCheck(),x.type="C0",v.actionDone()})}barking=!0}const mi=new ga;class ma{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,i){this.idnum=t,this.clock=i}newGame(t,i){this.idnum=0,this.clock=0,mi.barking=S.options.bark,A.activePlayer=S.randInt(0,2)===0,this.aiActive=!A.activePlayer&&this.aiMode,A.isLocalA=this.aiMode||A.activePlayer,v.actionHistory=[],lt.turnSims=0,lt.turnTime=0,m.reset(),V.reset(),x.reset(),this.ui=this.freshUI(),L.firstTurn=!0,this.winFlag=0;const r=A.nameOSaurus();A.initPlayer(!0,t,"Forgy McGhee",25),A.initPlayer(!1,i,r[0],r[1]),y.setup(),y.add("Ready...FIGHT!"),L.startTurn()}freshUI(){return{handScrollLeft:0,detailStack:[],deckContents:[],deckScroll:0,deckSummary:!1,animating:!1}}}const E=new ma;class pa{loglist;you=!0;localPlayerKey="";oppPlayerKey="";localPlayerSpan="";oppPlayerSpan="";constructor(){this.loglist=document.getElementById("loglist")}setup(){this.you=A.getLocalB(),this.localPlayerKey=this.you?"^pa":"^pb",this.oppPlayerKey=this.you?"^pb":"^pa",this.localPlayerSpan=this.span(A.toPlayer(this.you).name,"green"),this.oppPlayerSpan=this.span(A.toPlayer(!this.you).name,"red")}addLi(t){const i=document.createElement("li");i.innerHTML=t,this.loglist.appendChild(i),i.scrollIntoView({behavior:"smooth",block:"end"})}span(t,i,r=""){const a=r.length>0?` onclick="sfapi.details('${r}')"`:"";return`${t}`}add(t){this.addLi(t)}debug(t,i=!0){(i||S.options.debug)&&this.addLi(this.span(t,"debug"))}clearAll(){this.loglist.innerHTML=""}crdRgx=/^[A-Z\d]{3}[1234S]$/;lawg(...t){if(lt.simOn)return;let i="";t.forEach(r=>{if(typeof r=="string")r.match(this.crdRgx)===null?i+=r:i+="^c"+r;else{const a=A.toBool(r);i+="^p"+(a?"a":"b")}}),this.parse(i)}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let i=!0;for(;i;){const r=t.indexOf("^c");if(r===-1)i=!1;else{const a=t.slice(r+2,r+6);if(a==="POIS")t=t.replaceAll("^c"+a,this.span("Poison","green"));else{const c=G.getCard(a);t=t.replaceAll("^c"+a,this.span(`${c.name} ${c.level}`,this.factMap[c.faction],a))}}}return t}parse(t){const r=t.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),a=this.parseCards(r);this.add(a)}cardText(t){let i;if(t.type==="C"){const r=t,a=[];r.iRegen>0&&a.push("Regenerate "+r.iRegen),r.iArmor>0&&a.push("Armor "+r.iArmor),r.iMobile>0&&a.push("Mobility "+r.iMobile),r.iBT&&a.push("Breakthrough"),r.iDefend&&a.push("Defender"),r.iAggro&&a.push("Aggressive"),r.consistent&&a.push("Consistent"),a.length>0&&a.push(""),i=a.join(". ")+t.text}else i=t.text;return(t.free?"Free. ":"")+(t.overload?"Overload. ":"")+i}cardTextSplit(t){const i=[];if(t.free&&i.push("Free"),t.consistent&&i.push("Consistent"),t.overload&&i.push("Overload"),t.type==="C"){const r=t;r.iRegen>0&&i.push("Regenerate "+r.iRegen),r.iArmor>0&&i.push("Armor "+r.iArmor),r.iMobile>0&&i.push("Mobility "+r.iMobile),r.iBT&&i.push("Breakthrough"),r.iDefend&&i.push("Defender"),r.iAggro&&i.push("Aggressive")}if(t.text.length>0&&i.push(...t.text.split("~")),t.level===1){const r=t.cardCode(),a=ai.find(c=>c[0]===r);if(a){let c;const f=a[1];f.length===2&&f[0]===f[1]?c="2x "+G.getCard(`${f[0]}1`).name:c=f.map(p=>G.getCard(`${p}1`).name).join(", "),i.push("Solbind: "+c)}}return i}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){return t===1?"level 1 ":t===2?"level 2 or lower ":""}jr9(t,i,r=!1){return t!==0&&i!==0?`${this.bufferson(t,!0)}${r?",":" and"} ${this.bufferson(i,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(i,!1)}bufferson(t,i){return`${t>0?"+":""}${t} ${i?"attack":"health"}`}dbdtac(t=-1){return`deals battle damage to a ${t===-1?"":this.levelGateText(t)}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 i=G.getCard(t);return i.name+" "+i.level}pName(t){return t?"A":"B"}tokName(t){return`${t.iAttack}/${t.iHealth} ${t.name}`}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 y=new pa;class ya{handleMainMenuButton(t){t.param==="D"?(mt.setMode("D"),S.options.wasDrafting=!0,bt.playmatSetup(),pt.initDraft()):t.param==="C"?(mt.setMode("C"),S.options.wasDrafting=!1,bt.playmatSetup(),Pt.initConstructed()):t.param==="I"?(mt.setMode("I"),bt.drawAll()):window.open("deckbuilder.html")}handleMenuButton(t){const i=S.deTil(t.param),r=i[0];let a=!0;if(r==="RP")a=!1,y.clearAll(),S.options.wasDrafting?pt.replay():Pt.replay();else if(r==="MM")mt.setMode("M"),y.clearAll();else if(r==="CN"||r==="CP"||r==="CX"||r==="CR"||r==="CI"||r==="CV"||r==="LK")a=!1,Pt.handleMenuPick(r,i[1]);else if(r==="DN"||r==="DR"||r==="DI"||r==="DV"||r==="LD"||r==="GP"||r==="OD"||r==="DT")a=!1,pt.handleMenuPick(r,i[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 c=S.options.scale==="90"?"100":"90";bt.changeScale(c)}else r==="RU"?(a=!1,this.halp()):r==="FQ"?(a=!1,window.open("https://grousewood-games.github.io/solforge/docs/faq")):r==="SB"?(a=!1,window.open("https://stoneblade.com/")):r==="GW"?(a=!1,window.open("https://github.com/grousewood-games")):r==="VR"?(a=!1,window.open("https://github.com/grousewood-games/solforge/releases/tag/"+S.ver)):(a=!1,console.error("missing handler for menu button param "+t.param));a&&bt.drawAll()}handleUIButton(t){t.param==="DM"?(S.setClickMode("I"),bt.drawAll()):t.param==="TM"?(S.setClickMode("T"),bt.drawAll()):t.param==="EX"?(mt.setMode("X"),v.ddf5(this.generateExitActions())):t.param==="HL"?this.halp():console.error("missing handler for common button param "+t.param)}generateExitActions(){const t=b.basicAction("CANC");return t.param="PM",[t,b.menuButtonAction("MM")]}halp(){window.open("https://grousewood-games.github.io/solforge/docs/rules")}}const ei=new ya;class ba{stack=["M"];setMode(t){this.deetMode(t)||t==="X"||t==="S"?this.stack.push(t):(this.stack=[t],t==="G"?(ht.get("game-ui").clear(),bt.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(ht.get("game-ui").clear(),bt.setBackground("blueface")):t==="M"&&(bt.clearAll(),bt.setBackground("mainmenu")))}popMode(){this.stack.pop()}get mode(){const t=this.stack;return t[t.length-1]}get isDetailMode(){return this.deetMode(this.mode)}get baseMode(){return this.stack[0]}deetMode(t){return t==="R"||t==="T"}}const mt=new ba;class ka{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const i=A.toPlayer(t),r=[],a=[];if(i.deck.forEach(c=>{G.getCard(c).consistent?r.push(c):a.push(c)}),r.length===0)this.shuffle(i.deck);else{this.shuffle(a);const c=20-r.length,f=r.concat(a.slice(0,c));this.shuffle(f),i.deck=a.slice(c).concat(f)}}shuffle(t){const i=t.length,r=(a,c)=>{const f=t[a];t[a]=t[c],t[c]=f};if(i>0){let a,c;const f=i*4;for(let p=0;pr.decks).flat(),i=S.randInt(0,t.length);return t[i]}stockDeckByName(t,i){let r;if(Ae.some(a=>a.id===t?a.decks.some(c=>{c.name===i&&(r=c)}):!1),r)return r;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+i)}stockDeckByPram(t){const i=S.deTil(t);return this.stockDeckByName(i[0],i[1])}ripper(t,i,r){const a=[[15,8,5],[30,15,10]],c=this.getDeckCards([],[t]),f=[],p=a[r===15?0:1][i-1];for(;f.lengthI===P)||f.push(P)}const k=f.map(w=>({card:w,num:i}));return i===2&&r===15&&(k[0].num=1),k}deckify(t){const i=t.map(r=>{const a=ai.find(c=>c[0]===r);return a?a[1]:[]}).flat();return t.concat(i).map(r=>`${r}1`)}parseDeck(t){const i=t.map(r=>Array(r.num).fill(r.card)).flat();return this.deckify(i)}validDeck(t){const i={};t.forEach(w=>{i[w.card]?i[w.card]+=w.num:i[w.card]=w.num});const r=Object.entries(i).map(w=>({card:w[0],num:w[1]})),a=r.map(w=>w.num).reduce((w,P)=>w+P,0);if(a!==30)return"Deck must have 30 cards, found "+a;const c=[];let f="";if(r.some(w=>{const P=Ut.findIndex(I=>I.c===w.card);return P===-1?(f=w.card,!0):(c.push(Ut[P].f),!1)}))return`Invalid card code: '${f}'`;let p=0;if(r.some(w=>w.num>3?(f=w.card,p=w.num,!0):!1))return`${p} copies of '${f}' ${y.fastName(f).slice(0,-2)}`;const k=[...new Set(c)];return k.length>2?"Deck must have two or less factions, found: "+k.join():""}getDeckCards(t=[],i=[],r=[]){return t.length===0&&i.length===0&&r.length===0?Ut.map(a=>a.c):t.length>0&&i.length>0&&r.length===0?Ut.filter(a=>t.includes(a.r)&&i.includes(a.f)).map(a=>a.c):t.length>0&&i.length===0&&r.length===0?Ut.filter(a=>t.includes(a.r)).map(a=>a.c):t.length===0&&i.length>0&&r.length===0?Ut.filter(a=>i.includes(a.f)).map(a=>a.c):t.length>0&&i.length>0&&r.length>0?Ut.filter(a=>t.includes(a.r)&&i.includes(a.f)&&r.includes(Math.floor(a.s))).map(a=>a.c):t.length>0&&i.length===0&&r.length>0?Ut.filter(a=>t.includes(a.r)&&r.includes(Math.floor(a.s))).map(a=>a.c):t.length===0&&i.length>0&&r.length>0?Ut.filter(a=>i.includes(a.f)&&r.includes(Math.floor(a.s))).map(a=>a.c):Ut.filter(a=>r.includes(Math.floor(a.s))).map(a=>a.c)}getCardFaction(t){const i=Ut.find(r=>r.c===t);return i?i.f:"X"}getCardRarity(t){const i=Ut.find(r=>r.c===t);return i?i.r:"T"}cardStats(){Ee.forEach(t=>{const i=`${y.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,r=ke.map(a=>`${y.rarityText(a)}: ${this.getDeckCards([a],[t]).length}`).join("; ");console.log(i+r)})}loadPromise=new We;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new We,this.loader.click(),await this.loadPromise.getPromise(),this.fileguts==="")return"";if(this.fileguts.startsWith("!")){const a=this.fileguts.substring(1);return this.fileguts="",a}const t=JSON.parse(this.fileguts);this.fileguts="";const i=t.cards,r=this.validDeck(i);return r||t}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const i=this.loader.files;if(i&&i.length>0){const a=i[0];var r=new FileReader;r.onload=c=>{try{var f=r.result;if(f){var p=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(f)));p.cards&&Array.isArray(p.cards)&&!p.cards.some(k=>!(k&&typeof k.card=="string"&&Number.isInteger(k.num)))?(this.fileguts=JSON.stringify(p),this.loadPromise.resolveMe()):this.readError("File format is invalid.")}else this.readError("File read was empty.")}catch(k){console.error(k),this.readError("Error reading file.")}};try{r.readAsArrayBuffer(a)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}const Et=new ka;class Aa{phase="ST";enterMainPhase(){this.phase="MN";const t=A.getActive(),i=this.getMainPhaseActions(t);E.aiActive&<.hitMainPhase(),v.ddf5(i,!0)}async whatNext(t=!1){if(E.winFlag!==0){lt.simOn?(lt.simEndpoint(E.winFlag===1?"L":"W"),E.winFlag=0):(v.actionHistory=[],E.aiActive=!1,E.ui.animating=!1,await bt.drawAll());return}if(await bt.drawAll(),v.actionHistory.length>0)v.ddf5();else if(t)mt.setMode("S"),bt.drawAll();else if(x.getNextTrigger())ii.resolve(x.getNextTrigger());else if(!x.deathCheck)V.deathCheck(),this.whatNext();else if(x.events.length>0)x.startBatch();else switch(m.purge(),V.purge(),this.phase){case "MN":this.enterMainPhase();break;case "ET":this.phase="PT",x.addEvents($.player("PTN",A.getActiveB())),Lt.expireMods(),this.whatNext();break;case "PT":L.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),this.phase="MN",this.whatNext();break;case "ST":if(lt.simOn)lt.simEndpoint("T");else{const i=A.getInctive();i.triggers=i.triggers.filter(c=>c.type!=="NT"),this.phase="MN";const a=lt.cheater()?500:100;S.sleep(a).then(()=>this.whatNext())}break}}expireatron(t,i,r,a){i.mods.forEach(c=>{c.expiry===a?c.expiry=r:c.expiry===r&&t.push([i,c])})}expireMods(){const t=m.creatByTarget(b.crTarg());t.push(A.playerA,A.playerB);let i=[];this.phase==="PT"?t.forEach(r=>{this.expireatron(i,r,"ET","EN")}):this.phase==="ST"&&t.forEach(r=>{this.expireatron(i,r,"ST","SN")}),i.length>0&&(i.forEach(r=>{const a=r[0];a instanceof Le?a.expireMod(r[1]):A.expireMod(a,r[1])}),fe.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const i=this.getHandActions(t),r=this.getFieldActions(t);let a=L.mainBattle,c="M";return a||(a=m.ddf1().some(p=>p.extraBattles>0&&p.isActive&&!p.defender),c="E"),a&&i.push({key:"FITE",zone:"B",param:c,host:""}),a||i.push({key:"ENDT",zone:"B",param:"",host:""}),[i,r].flat()}getHandActions(t){const i=[...new Set(t.hand)],r=[],a=[];i.forEach(k=>{G.getCard(k).free?r.push(k):a.push(k)});const c=r.map(k=>[k,"FREE"]);L.freeCards.forEach(k=>{D.cardByTarget(a,k.condition).forEach(P=>{c.push([P[0],k.id]),a.splice(a.indexOf(P[0]),1)})}),c.push(...a.map(k=>[k,""]));const f=L.regularPlays>0;let p=t.hand.map((k,w)=>[k,w]);return f||(p=p.filter(k=>!a.includes(k[0]))),p.map(k=>{const w=c.find(P=>P[0]===k[0]);return w||console.error("No cost found for card"+k[0]),b.handSelectAction("HPLY",k[0],w[1],k[1])})}getFieldActions(t){const i=m.qPlayerCreats(t.isPlayerA),r=i.filter(c=>m.canMove(c).length>0).map(c=>{const f=b.fieldSelectAction("MOVE",c.lane,c.owner);return f.host=c.code,f}),a=i.filter(c=>c.isActive&&c.activationAvailable?G.getCard(c.code).canActivate(c):!1).map(c=>{const f=b.fieldSelectAction("ACTV",c.lane,c.owner);return f.host=c.code,f.param=c.id,f});return r.forEach(c=>{const f=a.findIndex(p=>p.lane===c.lane);f>-1&&(a.splice(f,1),c.param="ACTV")}),r.concat(a)}}const Lt=new Aa;class Ta{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,i){i.deck=t.deck,i.discard=t.discard,i.hand=t.hand,i.health=t.health,i.triggers=t.triggers,i.turn=t.turn,i.rank=t.rank,i.poison=t.poison,i.mods=t.mods,i.effects=t.effects,i.armor=t.armor,i.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 i=JSON.parse(t);this.setPlayerState(i.pA,this.playerA),this.setPlayerState(i.pB,this.playerB),this.activePlayer=i.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)}getInctive(){return this.b2p(!this.activePlayer)}getActiveB(){return this.activePlayer}getLocal(){return this.b2p(this.isLocalA)}getLocalB(){return this.isLocalA}hurtPlayer(t,i){if(i<1)return 0;const r=this.totalArmor(t),a=Math.max(Math.min(i,r-t.armorDmg),0);let c=i-a;return t.armorDmg+=a,t.health-=c,c}hurtDirect(t,i,r){const a=this.toPlayer(t),c=this.hurtPlayer(a,i);c>0&&(y.lawg(r,` dealt ${c} dmg to `,a,"."),x.addEvents($.damage(!1,c,a.health,!1,!1,a.isPlayerA,void 0)),fe.playerHealthChange())}hurtBattle(t,i,r){const a=this.toPlayer(t),c=this.hurtPlayer(a,i);c>0&&(y.lawg(r.code,` dealt ${c} battle dmg to `,a,"."),x.addEvents($.damage(!0,c,a.health,!0,!1,a.isPlayerA,r)))}heal(t,i,r){const a=this.toPlayer(t);a.health+=i,y.lawg(a,` gained ${i} health from `,r,"."),x.addEvents($.playerHeal(a.isPlayerA,i)),fe.playerHealthChange()}drawCard(t,i){const r=this.toPlayer(t);let a=!0;for(let c=0;c{parseInt(w.slice(3,4))>r.rank?k.push(w):p.push(w)}),p.length>0&&(r.deck=p,r.discard=k,Et.shuffle(r.deck),r.hand.push(r.deck.pop()))}}}totalArmor(t){const i=this.toPlayer(t);return this.modBool(i,"NA")?0:i.armor+this.modSum(i,"AR")}totalPoison(t){const i=this.toPlayer(t);return i.poison+this.modSum(i,"PN")}modSum(t,i){const r=this.toPlayer(t);return b.modSum(r.mods,i)}modBool(t,i){const r=this.toPlayer(t);return b.modBool(r.mods,i)}hasMod(t,i){const r=this.toPlayer(t);return b.hasModG(r.mods,i)}addMod(t,i){this.toPlayer(t).mods.push(i)}addModSafe(t,i){const r=this.toPlayer(t);b.hasMod(r.mods,i)||this.addMod(r,i)}removeMod(t,i){const r=this.toPlayer(t);r.mods=r.mods.filter(a=>a.granter===i?(a.type==="AR"&&(r.armorDmg=Math.max(0,r.armorDmg-a.value)),!1):!0)}removeModSafe(t,i){const r=this.toPlayer(t);this.hasMod(r,i)&&this.removeMod(r,i)}expireMod(t,i){const r=this.toPlayer(t);r.mods.splice(b.modIdx(r.mods,i),1)}enforceEffects(t){const i=this.toPlayer(t);i.effects.forEach(r=>G.getCard(r.logicCode).enforcePlayerEffect(r,i))}activeCardItems(t){const i=this.toPlayer(t),r=i.triggers.filter(c=>!(c.customCode==="AB"||c.type==="NT")).map(c=>c.logicCode.startsWith("EPH")?"EPS"+c.logicCode.slice(3,4):c.logicCode),a=i.effects.map(c=>c.logicCode);return r.concat(a)}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,i,r,a){const c=this.toPlayer(t);c.name=r,c.nameOffset=a,c.turn=1,c.rank=1,c.health=S.options.highHealth?360:120,c.discard=[],c.deck=Et.parseDeck(i),c.mods=[],c.triggers=[],c.effects=[],c.poison=0,c.armor=0,c.armorDmg=0,this.ambushScan(c),Et.shuffleDeck(c),c.hand=c.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"),this.boosh(t,"LLV","DS")}boosh(t,i,r){const a=i+"1";if(t.deck.includes(a)){const c=b.trigger(r,a);c.customCode="AB",t.triggers.push(c)}}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]],i=t[S.randInt(0,t.length)];return[i[0],i[1]+18]}}const A=new Ta;class va{stateStack=[];popCheck(){if(this.stateStack.length===0)throw new Error("Attempted to manipulate empty stack")}saveState(){const t={action:v.getState(),aiInPhase:lt.inPhase,batch:x.getState(),death:V.getState(),field:m.getState(),game:E.getState(),mode:JSON.stringify(mt.stack),phase:Lt.phase,player:A.getState(),turn:L.getState()};this.stateStack.push(t)}restoreState(){this.popCheck();const t=this.stateStack[this.stateStack.length-1];v.setState(t.action),lt.inPhase=t.aiInPhase,x.setState(t.batch),V.setState(t.death),m.setState(t.field),E.setState(t.game.i,t.game.t),mt.stack=JSON.parse(t.mode),Lt.phase=t.phase,A.setState(t.player),L.setState(t.turn)}popState(){this.popCheck(),this.stateStack.pop()}}const Ce=new va;class Sa{toActions(t){return(Array.isArray(t)?t:[t]).map(r=>{const a=this.actionTargGuts(r);return a.forEach(c=>{c.host=r.host,c.param=r.param,c.hint=r.hint}),a}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(i=>b.handSelectAction(t.key,i[0],"",i[1]));if(t.target==="TF"){if(t.field==="O")return m.creatByTarget(t).map(i=>b.fieldSelectAction(t.key,i.lane,i.owner));{const i=t.player==="X"?[!0,!1]:[A.toBool(t.player)],r=S.isUn(t.lanes)?m.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return i.map(a=>r.map(c=>b.fieldSelectAction(t.key,c,a))).flat();if(t.field==="E")return i.map(a=>m.emptyLanes(a).filter(c=>r.includes(c)).map(c=>b.fieldSelectAction(t.key,c,a))).flat()}}if(t.target==="TP")return t.player==="X"?[b.playerSelectAction(t.key,!0),b.playerSelectAction(t.key,!1)]:[b.playerSelectAction(t.key,A.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,i){let r=t.map((a,c)=>[a,c]);if(i){if(S.isUn(i.deckPositionSkip)||(r=r.filter(a=>a[1]!==i.deckPositionSkip)),i.faction!=="X"&&(r=r.filter(a=>G.getCard(a[0]).faction===i.faction)),i.tribe!=="AN"&&(r=r.filter(a=>{const c=G.getCard(a[0]);return c.type==="C"?c.isTribe(i.tribe):!1})),i.canLevel&&(r=r.filter(a=>G.getCard(a[0]).canLevel())),i.level!=="LA"){const a=D.levelTargetToLevel(i.level);r=r.filter(c=>{const f=parseInt(c[0].substring(3,4));return a.includes(f)})}if(i.card!=="A"){const a=i.card==="C"?"C":"S";r=r.filter(c=>G.getCard(c[0]).type===a),i.card==="C"&&!S.isUn(i.maxAttack)&&(r=r.filter(c=>G.getCard(c[0]).iAttack<=i.maxAttack))}i.cardCode&&(r=r.filter(a=>G.getCard(a[0]).cardCode()===i.cardCode))}return r}deckByTarget(t){const i=A.toPlayer(t.player);let r;if(t.target==="TH")r=i.hand;else if(t.target==="TD")r=i.discard;else if(t.target==="DK")r=i.deck;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(r,t)}buttonTarget(t,i="",r=""){return b.actionTarget("TB",t,i,r)}boardTarget(t,i){return b.actionTarget("TR",t,i,"")}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,i){return this.levelTargetToLevel(t).includes(i)}levelTestCommon(t,i){return this.levelTargetTest(this.ddf2(i),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}const D=new Sa;class Ca{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==="FM"?this.formationTriggerTest(t):t.trigger.type==="RD"?this.raidTriggerTest(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=m.creatByTr(t).lane),G.getCard(t.trigger.logicCode).jr8(t)}forgeTriggerTest(t,i){if(t.event.code==="ENT"&&t.event.forged){const r=m.creatByTr(t),a=r.id===t.event.creatId&&r.status==="A";return i&&a?!r.opposed:a}return!1}formationTriggerTest(t){if(t.event.code==="ENT"&&t.event.formation){const i=m.creatByTr(t);return i.id===t.event.creatId&&i.status==="A"}return!1}raidTriggerTest(t){if(t.event.code==="TRE"&&L.ffs>2){const i=m.creatByTr(t);return i.owner===t.event.playerA&&i.status==="A"}return!1}upgradeTriggerTest(t){if(t.event.code==="RPL"){const i=m.searchById(t.creatId);if(i)return i.id===t.event.creatId;console.warn("Upgrade trigger test could not find its creature",t)}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const i=t.event,r=m.searchById(t.creatId);if(r)return r.status==="D"&&r.id===i.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const i=t.event,r=m.creatByTr(t);return r.status==="A"&&r.id===i.creatId}return!1}generalTriggerTest(t){return G.getCard(t.trigger.logicCode).ddf8(t)}}const ii=new Ca;class wa{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 i=JSON.parse(t);this.mainBattle=i.mB,this.deathsA=i.dA,this.deathsB=i.dB,this.cardsPlayed=i.cP,this.ffs=i.ffs,this.freeCards=i.fC,this.regularPlays=i.rP,this.newPre=i.n1,this.newPost=i.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,i,r,a){const c=this.cardPlayed(i,r,a),f=A.getActive();y.lawg("Forged ",c.code,"."),m.birth(c,"F",f.isPlayerA,t.lane),v.actionDone()}levelAndDiscardA(t){return this.levelAndDiscard(t.card,t.position)}levelAndDiscard(t,i,r=!0,a="F"){const c=G.getCard(t),f=A.toPlayer(a);if(i>-1?f.hand.splice(i,1):y.debug("Bad play index: "+i+" ("+t+")"),!c.overload){const p=c.levelUpCard();f.discard.push(p),r&&p!==t&&y.lawg(f," leveled a card.")}return c}cardPlayed(t,i,r,a=!1){const c=this.levelAndDiscard(t,r,a),f=A.getActive();if(i==="")this.regularPlays-=1;else if(i!=="FREE"){const p=this.freeCards.findIndex(k=>k.id===i);p>-1?this.freeCards.splice(p,1):console.error("Could not find free card rule!")}if(this.cardsPlayed+=1,!a){const p=$.playCard(t,f.isPlayerA);x.addEvents(p)}return c}passTheTurn(){if(A.activePlayer=!A.activePlayer,Lt.phase="WT",E.aiMode){if(!lt.simOn)if(E.aiActive=!E.aiActive,E.aiActive)lt.turnSims=0,lt.turnTime=0;else{const t=`🤖: ${this.calma(lt.turnSims)} pontifications in ${(lt.turnTime/1e3).toFixed(1)} seconds.`;y.lawg(t)}}else A.isLocalA=A.activePlayer;this.startTurn()}calma(t){let i=t.toString();return i.length<4?i:i.length>6?i.slice(0,-6)+","+i.slice(-6,-3)+","+i.slice(-3):i.slice(0,-3)+","+i.slice(-3)}startTurn(){const t="------";lt.log&&E.aiActive&&E.aiMode&&console.log(t+" AI Turn Start "+t),lt.simOn||(y.lawg(t),y.lawg(A.getActiveB()," starts turn.")),this.resetTurnData(),Lt.phase="ST",x.addEvents($.player("TRS",A.getActiveB())),Lt.expireMods(),Lt.whatNext(!E.aiMode)}endTurn(){const t=A.getActive();t.discard.push(...t.hand),t.hand=[],t.turn++;const i=t.turn>4;x.addEvents($.player("TRE",t.isPlayerA)),i&&(t.turn=1,t.rank++,y.lawg(t," hits Rank "+t.rank+"."),x.addEvents($.player("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],Et.shuffleDeck(t)),m.qActiveCreats().forEach(r=>{r.extraBattles=0}),A.drawCard(t,5),Lt.phase="ET",v.actionDone()}mobility(t){const i=m.jr5(t.param);y.lawg(i.code," moved."),i.mobilityAvailable=!1,i.move(t.lane),v.actionDone()}allied(t,i){const r=i??A.getActive(),a=b.target("TH");return a.player=A.toTarget(r),a.faction=t,D.deckByTarget(a).length>0}patron(t){const i=b.target("TH");return i.player=A.toTarget(A.getActive()),i.faction=t,D.deckByTarget(i).length>2}freeCard(t){const i=b.freeCard(t);return this.freeCards.push(i),i}birthRegistrar(t){this.mainBattle?this.newPre.push(t):this.newPost.push(t)}}const L=new wa;class pi{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,i,r){this.context.drawImage(t,i,r)}updateScale(t){this.context.scale(t,t)}}class It{getCanv(t){return t instanceof pi?t:ht.get(t)}async drawSprite(t,i,r,a,c={}){const f=this.getCanv(t).context,p=await S.getSprite(S.imgRoot+i);let k=1;c&&(k=c.alpha??1),k<1&&(f.globalAlpha=k),f.drawImage(p,r,a,p.naturalWidth,p.naturalHeight),k<1&&(f.globalAlpha=1)}async drawText(t,i,r,a,c={}){const f=this.getCanv(t).context,p=c.fontSize??24;S.pxRatio===2&&(a=this.retinaTextY(a,p)),f.fillStyle=c.colour||"#000000",f.font=`${p}px ${c.fontName||"cinzel"}`,f.shadowColor=c.shadow?"#000000":"#00000000",f.fillText(i,r,a),f.shadowColor="#00000000"}async spriteNumber(t,i,r,a,c,f){let p=r-this.numOffset(i,c);const k=[];i.toString().split("").forEach(w=>{k.push(this.drawSprite(t,this.numSpriteUrl(w,c,f),p,a)),p+=this.numSize(w,c)}),await Promise.all(k)}async drawHighlight(t,i,r,a,c,f="#00FF00"){const p=f.length===7?f.concat("aa"):f,k=this.getCanv(t);k.context.strokeStyle=p,k.context.beginPath(),k.context.rect(i,r,a,c),k.context.stroke()}glowColour(t){const i=t.key;return i==="MOVE"||i==="ACTV"?"green":i==="CANC"?"red":i==="CARD"?"yellow":"blue"}drawRarity(t,i,r,a){return this.drawSprite(t,`icons/rarity/new/${y.rarityText(i).toLowerCase()}.png`,r,a)}drawFaction(t,i,r,a){const c=i==="T"?2:0;return this.drawSprite(t,`icons/faction/${y.factionText(i).toLowerCase()}.png`,r+c,a+3)}makeHaze(t,i=!0){t.context.fillStyle="#222222d8",t.context.fillRect(0,0,i?849:S.gameWidth,S.gameHeight)}retinaTextY(t,i){let r;return i<21?r=6:i<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,i){return i==="S"?this.smallNumSize[t]:this.bigNumSize[t]}numOffset(t,i){const r=t.toString().split("").reduce((a,c)=>a+this.numSize(c,i),0)-(i==="B"?2:1);return Math.floor(r/2)}numSpriteUrl(t,i,r){return`text/nums/${i}/${r}/${t}.png`}}class we extends It{async drawButton(t,i,r,a,c,f=7,p=!1,k=!0){let w,P;p?(w="ui/button/menu_on.png",P="#d7fc03"):(w="ui/button/menu_off.png",P="#00DEF7");const I=this.buttonBounds(i,r);if(await this.drawSprite(t,w,I[0],I[1]),await this.drawText(t,c,I[0]+7+f,I[1]+24,{colour:P,fontSize:30}),!p||k){const U=new ot(a,...I,st.Both);Q.add(U)}}async buttonMaker(t,i,r,a,c,f=7,p=!1,k=!0){const w=b.basicAction("MNBT");w.param=a,await this.drawButton(t,i,r,w,c,f,p,k)}buttonBounds(t,i){return[t-7,i-7,232,69]}}class De extends It{async makeIconButton(t,i,r,a){let f;f=`ui/button/ui_${a}.png`,await this.drawSprite(t,f,i,r);const p=b.basicAction("UIBT");p.param=a;const k=new ot(p,i,r,40,40,st.Both);Q.add(k)}async makeVScroller(t,i,r,a,c){const f={zone:"N",key:c,host:"",param:a?"U":"D"};await this.makeScroller(t,i,r,a?"up":"down",f)}async makeScroller(t,i,r,a,c){await this.drawFactionButton(t,i,r,"A"),await this.drawSprite(t,`ui/arrow/${a}.png`,i+30,r+14);const f=this.makeFactButtonClick(i,r,c);Q.add(f)}makeFactButtonClick(t,i,r){return new ot(r,t,i,...this.factionButtonBounds(),st.Both)}async drawFactionButton(t,i,r,a){await this.drawSprite(t,`ui/button/faction_${a}.png`,i,r)}factionButtonBounds(){return[77,44]}}class Ke extends It{async drawActions(t){if(mt.baseMode==="G"){const i=ht.get("effects"),r=t.filter(a=>a.zone==="B");if(r.length>1&&console.error("Two button actions encountered in one batch",r),r.length===0||E.aiActive||S.clickMode==="I"&&!mt.isDetailMode){const a=this.buttonBounds();await this.drawSprite(i,"ui/button/off.png",a[0],a[1])}else{const a=r[0],c=this.buttonBounds();await this.drawSprite(i,"ui/button/on.png",c[0],c[1]);let f;a.key==="CARD"?f=a.param:f=a.key,await this.drawSprite(i,`text/butt/${f}.png`,c[0]+23,c[1]+18);const p=this.highlightBounds(),k=new ot(a,...p);a.key==="CNCL"&&(k.mouse=st.Both),Q.add(k)}}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),i=5,r=[-1,-1,2,2];return t.map((a,c)=>a+i*r[c])}}class Xt extends It{async drawCard(t,i,r,a){const c=this.getCanv(i),f=this.extractStats(t),p=f.cardClass;if(await this.drawSprite(c,p.image(!1),r+14,a+35),await this.drawSprite(c,this.frameImg(p.level,p.faction,p.type,!1),r,a),await this.drawSprite(c,`text/card/${p.cardCode()}.png`,r+12,a+16),f.isCreature){const k=a+178;await this.spriteNumber(c,f.att,r+24,k,"S","Y"),await this.spriteNumber(c,f.hlt,r+127,k,"S","Y")}if(f.sleeping&&await this.drawSprite(c,"icons/effects/defensive.png",r+5,a+40,{alpha:.7}),f.iconList.length>0){const k=r+57-17*(f.iconList.length-1);await Promise.all(f.iconList.map(async(w,P)=>this.drawIcon(c,k+P*35,a+140,w[0],w[1])))}}async drawBigCard(t,i,r,a){const c=this.extractStats(i);if(await this.drawSprite(t,i.image(!0),r+(c.isCreature?38:35),a+117),await this.drawSprite(t,this.frameImg(i.level,i.faction,i.type,!0),r,a),i.rarity!=="T"&&await this.drawRarity(t,i.rarity,r+309,a+394),c.isCreature){const f=a+555;await this.spriteNumber(t,c.att,r+44,f,"B","Y"),await this.spriteNumber(t,c.hlt,r+325,f,"B","Y")}}async drawIcon(t,i,r,a,c=0){const f=this.getCanv(t);if(await this.drawSprite(f,`icons/effects/${a}.png`,i,r),c>0){const p=a==="poison"?12:9;await this.spriteNumber(f,c,i+17,r+p,"S","B")}}extractStats(t){let i,r=!1,a=0,c=0,f=!1,p=0,k=!1,w=!1,P=!1,I=!1,U=0,J=0,Z=0,et=!1,Ct=!1;if(!(t instanceof Nt))r=!0,a=t.attack,c=t.health,f=t.sleeping&&!t.aggressive,p=t.regen,k=t.breakthrough,w=t.defender,P=t.aggressive,U=t.armor,J=t.poison,Z=t.mobility,I=t.changed,i=G.getCard(t.code);else{if(t.type==="C"){r=!0;const ct=t;a=ct.iAttack,c=ct.iHealth,p=ct.iRegen,k=ct.iBT,w=ct.iDefend,P=ct.iAggro,U=ct.iArmor,Z=ct.iMobile}et=t.overload,Ct=t.consistent,i=t}const q=[];return et&&q.push(["overload",0]),Ct&&q.push(["consistent",0]),p>0&&q.push(["regenerate",p]),k&&q.push(["breakthrough",0]),w&&q.push(["defender",0]),P&&q.push(["aggressive",0]),U>0&&q.push(["armor",U]),J>0&&q.push(["poison",J]),Z>0&&q.push(["mobility",Z]),I&&q.push(["changed",0]),{cardClass:i,isCreature:r,iconList:q,hlt:c,att:a,sleeping:f}}async drawHilight(t,i,r,a){await this.drawSprite(t,`frames/glow_${a}.png`,i-22,r-36)}cardBounds(t,i){return[t,i,150,205]}highlightBounds(t,i){const r=this.cardBounds(t,i),a=5,c=[-1,-1,2,2];return r.map((f,p)=>f+a*c[p])}frameImg(t,i,r,a){return`frames/${a?"big":"small"}/lvl${t}_${i}${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 yi=30,Ye=540,bi=5;class ki extends It{async drawCards(t){const i=ht.get("hand");i.clear();const r=new Xt,a=r.highlightBounds(0,0)[2]+bi;let c=yi;const f=this.paginatron(t);for(let p=f[0];p<=f[1];p++){const k=G.getCard(t.hand[p]);await r.drawCard(k,i,c,Ye),c+=a}}async drawActions(t){const i=S.clickMode!=="I",r=ht.get("effects"),a=new Xt,c=a.highlightBounds(0,0)[2]+bi,f=new Ot(0,520,1e3,250),p=new Ot(0,520,1e3,250,st.Right),k=this.paginatron(A.getActive());await Promise.all(t.filter(w=>w.zone==="H").map(async w=>{const P=w;if(P.position>=k[0]&&P.position<=k[1]){const I=yi+(P.position-k[0])*c;if(w.key==="DEET"){const U=new ot(w,...a.highlightBounds(I,Ye),st.Right);p.addChild(U)}else if(i){const U=new ot(w,...a.highlightBounds(I,Ye));f.addChild(U),await a.drawHilight(r,I,Ye,this.glowColour(P))}}})),i&&Q.add(f),Q.add(p),k[0]>0&&await this.makeScroller(r,!1),k[1]0&&t.hand.length-i<5&&(i=Math.max(0,t.hand.length-5),E.ui.handScrollLeft=i),[i,Math.min(i+4,t.hand.length-1),t.hand.length-1]}async makeScroller(t,i){let r,a,c,f;i?(r=850,a=935,c="R",f="right"):(r=1,a=858,c="L",f="left");const w={zone:"N",key:"SCRH",host:"",param:c};await new De().makeScroller(t,a,235,f,w),await this.drawSprite(t,"icons/rewards/gold.png",r,726),await this.drawSprite(t,"icons/rewards/gold.png",r,726-24)}}class ri extends It{fieldBoundary=[17,62,821,443];async drawCards(t){const i=A.getLocalB(),r=ht.get("field");r.clear();const a=new Xt,c=m.qActiveCreats().map(f=>{let p=0;t&&t.scrappers.some(w=>w[0]===f.lane&&w[1]===f.owner)&&(p=t.battlePhase);const k=this.coordCalc(f.lane,f.owner,i,p);return a.drawCard(f,r,...k)});if(await Promise.all(c),x.iaTrigLane>0){const f=this.coordCalc(x.iaTrigLane,A.getActiveB(),i),p=a.cardBounds(...f),k=p[1]+p[3]+11,w=p[0]+p[2]/2;await this.drawSprite(r,"icons/rewards/gold.png",w-10,k),await this.drawSprite(r,"icons/rewards/gold.png",w-35,k),await this.drawSprite(r,"icons/rewards/gold.png",w-60,k),await this.drawSprite(r,"icons/rewards/gold.png",w+15,k),await this.drawSprite(r,"icons/rewards/gold.png",w+40,k)}}async drawActions(t){const i=S.clickMode!=="I",r=A.getLocalB(),a=ht.get("effects"),c=new Xt,f=new Ot(...this.fieldBoundary),p=new Ot(...this.fieldBoundary,st.Right);await Promise.all(t.filter(k=>k.zone==="F"||k.zone==="R").map(async k=>{if(k.zone==="R"&&i){const w=new ot(k,...this.fieldBoundary);Q.add(w),await this.drawSprite(a,"background/field-glow.png",this.fieldBoundary[0]-6,this.fieldBoundary[1]-9)}else{const w=k,P=this.coordCalc(w.lane,w.playerA,r);if(k.key==="DEET"){const I=new ot(k,...c.highlightBounds(...P),st.Right);p.addChild(I)}else if(i){const I=new ot(k,...c.highlightBounds(...P));f.addChild(I),await c.drawHilight(a,...P,this.glowColour(w))}}})),i&&f.childs.length>0&&Q.add(f),p.childs.length>0&&Q.add(p)}async drawFight(t){if(t.length>0){const i={battlePhase:1,scrappers:t},r=72;await new Ke().drawActions([]),await this.drawCards(i),await S.sleep(r),i.battlePhase=2,await this.drawCards(i),await S.sleep(r),i.battlePhase=3,await this.drawCards(i),await S.sleep(r),i.battlePhase=4,await this.drawCards(i),await S.sleep(r+70),i.battlePhase=3,await this.drawCards(i),await S.sleep(r),i.battlePhase=2,await this.drawCards(i),await S.sleep(r),i.battlePhase=1,await this.drawCards(i),await S.sleep(r)}}coordCalc(t,i,r,a=0){const c=r===i,f=166,p=5;let k,w,P;return[k,P,w]=c?[22,290,1]:[687,65,-1],[k+(t-1)*f*w,P+a*p*(-1*w)]}}class Me extends It{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,i,r,a){const c=this.getCanv(i);await this.drawSprite(c,`avatar/${this.avatars[t.avatar]}.jpg`,r+46,a+48),await this.drawSprite(c,"ui/player_frame.png",r,a),await this.drawSprite(c,"ui/player_health.png",r+10,a+102),await this.spriteNumber(c,t.health,r+45,a+149,"B","G"),await this.drawSprite(c,`ui/turn${t.turn}.png`,r+117,a+25),await this.drawSprite(c,"ui/rank.png",r+90,a+4),await this.spriteNumber(c,t.rank,r+121,a+28,"B","G"),await this.drawText(c,t.name,r+t.nameOffset,a+189,{colour:"#42a4f5",fontSize:20});const f=A.totalPoison(t),p=A.totalArmor(t),k=A.activeCardItems(t);if(f>0||p>0||k.length>0){const w=new Xt,P=a+9;if(f>0&&await w.drawIcon(c,r+15,P,"poison",f),p>0&&await w.drawIcon(c,r+150,P,"armor",p),k.length>0){await w.drawIcon(c,r+156,a+147,"changed");const I=b.basicAction("VWDK");I.param=S.enTil("VE",S.bool2txt(t.isPlayerA));const U=new ot(I,r+155,a+147,36,36,st.Both);Q.add(U)}}}async drawAllPlayers(){const t=ht.get("player");t.clear();const i=!E.aiActive,r=A.getLocal(),a=A.toPlayer(!r.isPlayerA);if(await this.drawPlayer(r,t,...this.playerOrigin(!0)),await this.drawPlayer(a,t,...this.playerOrigin(!1)),r.isPlayerA===A.getActiveB()){let c=862;const f=295,p=Array(L.regularPlays).fill("blue").concat(L.freeCards.map(w=>w.sourceCard)),k=[];p.forEach(w=>{let P;if(w==="blue")P=w;else if(P="green",i){const I={key:"DEET",zone:"N",host:"",param:w},U=new ot(I,c-1,f-1,28,41,st.Both);Q.add(U)}k.push(this.drawSprite(t,`ui/${P}card.png`,c,f)),c+=30}),await Promise.all(k)}await this.drawDeckButton(t,r,!0,i),await this.drawDeckButton(t,r,!1,i)}async drawDeckButton(t,i,r,a){let c,f,p;r?(c=i.discard.length,f=935,p="T"):(c=i.deck.length,f=858,p="U");const w=new De;if(await w.drawFactionButton(t,f,350,p),await this.spriteNumber(t,c,f+38,350+14,"S","Y"),c>0&&a){const P=b.basicAction("VWDK");P.param=r?"VD":"VR";const I=w.makeFactButtonClick(f,350,P);Q.add(I)}}async drawActions(t){if(S.clickMode==="I")return;const i=ht.get("effects"),r=A.getLocalB();await Promise.all(t.filter(a=>a.zone==="P").map(a=>{const c=a,f=this.playerOrigin(c.playerA===r),p=this.playerBounds(...f),k=new ot(a,...p);return Q.add(k),this.drawSprite(i,"ui/player_glow.png",f[0]+1,f[1]-1)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,i){return[t+18,i+18,170,170]}async drawGameOver(t=!1){const i=ht.get("field"),r=94,a=A.getLocalB(),c=E.winFlag,f=a&&c===1||!a&&c===-1;await this.drawSprite(i,`ui/you-${f?"win":"lose"}.png`,r,89,{alpha:t?.65:1}),Q.removeAll();const p=new we,k=ht.get("hand");await p.drawButton(k,r+62,520,b.menuButtonAction("MM"),"Main Menu",20,!1),await p.drawButton(k,r+389,520,b.menuButtonAction("RP"),"Replay",55,!1)}async drawAiGear(t,i){const c=t%6,f=Math.floor(t/6),p=ht.get("effects"),k=`icons/rewards/${i?"gold":"silver"}.png`;await this.drawSprite(p,k,862+c*24,255+f*24)}hwhipe(){ht.get("effects").clear()}}const Ai=15,Ti=15,Da=5;class xa extends It{constructor(){super();const i=new Xt().highlightBounds(0,0);this.xOffset=i[2]+Da,this.yOffset=i[3]+25}xOffset;yOffset;async drawCards(t){const i=new Xt,a=At.visibleContent().map((c,f)=>{const p=G.getCard(c.cardCode),k=this.listXY(f);return i.drawCard(p,t,...k).then(()=>{if(c.cardCount>0)return this.drawCount(t,k[0]+61,k[1]+166,c.cardCount)})});await Promise.all(a)}async drawActions(t,i){const r=new Xt,a=new De,c=S.clickMode!=="I",f=At.visibleContent(),p=E.ui,k=p.deckScroll,w=k+15,I=p.deckSummary?st.Both:st.Right,U=new Ot(...this.deckBoundary()),J=new Ot(...this.deckBoundary(),I),Z=[];t.forEach(et=>{if(et.key==="DEET"){const Ct=et;if(Ct.position>=k&&Ct.positionct.sourceIdx===Ct.position);if(q>-1){const ct=this.listXY(q),$t=new ot(et,...r.highlightBounds(...ct));U.addChild($t),Z.push(r.drawHilight(i,...ct,"blue"))}}}),c&&U.childs.length>0&&Q.add(U),J.childs.length>0&&Q.add(J),At.canPageDown&&Z.push(a.makeVScroller(i,299,712,!1,"SCRK")),At.canPageUp&&Z.push(a.makeVScroller(i,465,712,!0,"SCRK")),await Promise.all(Z)}async drawCount(t,i,r,a){await this.drawSprite(t,"ui/dullcard.png",i,r),await this.spriteNumber(t,a,i+13,r+12,"S","Y")}listXY(t){return[Ai+t%5*this.xOffset,Ti+Math.floor(t/5)*this.yOffset]}deckBoundary(){return[Ai,Ti,this.xOffset*5,this.yOffset*3]}}class Ba extends It{async drawDetails(t){const i=[],r=ht.get("card");r.clear(),this.makeHaze(r);const a=30,c=30,f=G.getCard(ie.currentCard),p=new Xt;S.options.bigCards?i.push(p.drawBigCard(r,f,a,c)):i.push(p.drawCard(f,r,134,280));const k=435;let w=30;const P="#f5f242",I="#03fcfc",U=33,J=23,Z=28;let et=f.name;for(;et.length>0;){w+=36;let Dt;if(et.length{for(;Dt.length>0;){let jt;if(Dt.length1){const Dt=f.cardCode(),jt=ct===3?[19,147,270]:ct===2?[78,216]:[0,98,196,294];q.forEach((ye,qe)=>{i.push(this.drawLevelButton(r,Dt,ye,40+jt[qe],658,ye===f.level))})}const $t=new we;let qt=0;const Kt=513,si=697,vi=74;mt.baseMode!=="G"&&(i.push($t.drawButton(r,Kt,si,t,"Close",62,!1)),qt++);const Ma=new ot(t,a,c,377,603,st.Both);if(Q.add(Ma),ie.canGoBack){const Dt=ie.goBackAction();i.push($t.drawButton(r,Kt,this.buttonY(si,qt,vi),Dt,"Back",72,!1)),qt++}ie.friendos.forEach(Dt=>{const jt=G.getCard(Dt),ye=ie.friendAction(Dt),qe=ie.friendTxt(jt.cardCode());i.push($t.drawButton(r,Kt,this.buttonY(si,qt,vi),ye,qe[1]||jt.name,qe[0],!1)),qt++}),await Promise.all(i)}buttonY(t,i,r){return t-i*r}cardSummary(t){const i=y.factionText(t.faction),r=y.rarityText(t.rarity),a=y.cardTypeText(t.type);return`${i}, ${r} ${a}`}tribeSummary(t){return t.tribe.map(i=>y.tribeText(i)).join(" ")}async drawLevelButton(t,i,r,a,c,f){if(await this.drawSprite(t,`icons/frame/level${r}.png`,a,c),!f){const P=ie.levelAction(r),I=new ot(P,a-15,c-5,88,112,st.Both);Q.add(I)}const k=G.getCard(`${i}${r}`).levelSpice(),w=[[-16,55],[41,55],[11,79]];await Promise.all(k.map((P,I)=>{const U=a+w[I][0],J=c+w[I][1];if(P.icon==="A"||P.icon==="H"){let Z,et;return P.icon==="A"?(Z="icons/frame/attack.png",et=U+17):(Z="icons/frame/health.png",et=U+16),this.drawSprite(t,Z,U-1,J-1).then(()=>this.spriteNumber(t,P.num,et,J+10,"S","Y"))}else{let Z=this.spiceIcon(P.icon);if(P.icon==="U"||P.icon==="D"||P.icon==="L"||P.icon==="N"){const et=`icons/effects/${Z}.png`;return this.drawSprite(t,et,U-1,J-1).then(()=>this.spriteNumber(t,P.num,U+16,J+10,"S","B"))}else return new Xt().drawIcon(t,U,J,Z,P.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 Ha extends It{packLeft=22;packTop=190;packBoundary=[this.packLeft-5,this.packTop-10,537,480];async drawPack(t,i){const r=new Xt,a=S.clickMode!=="I",c=[],f=new Ot(...this.packBoundary),p=new Ot(...this.packBoundary,st.Right);t.filter(w=>w.pack).forEach(w=>{const P=this.coordCalcPack(w.index);if(w.key==="DRFT"){const I=G.getCard(w.param+"1");if(c.push(r.drawCard(I,i,...P).then(()=>this.drawRarity(i,I.rarity,P[0]+112,P[1]+4))),a){const U=new ot(w,...r.highlightBounds(...P));f.addChild(U)}}else{const I=new ot(w,...r.highlightBounds(...P),st.Right);p.addChild(I)}}),await Promise.all(c),a&&f.childs.length>0&&Q.add(f),p.childs.length>0&&Q.add(p)}async drawList(t,i){let r=170;const a=570,c=[],f=pt.picksAsDeck,p=new Ot(a,r,600,600,st.Both),k=t,w=15,P=pt.scrollIdx;pt.canPageDown&&await this.makeScroller(i,!1),pt.canPageUp&&await this.makeScroller(i,!0),k.filter(I=>!I.pack).forEach(I=>{if(I.index>=P&&I.index{const f=i.getFactTotal(c);if(f[2]===0)return[Promise.resolve()];{r+=75;const p=this.threeLine(t,r,a,f),k=this.drawFaction(t,c,r-8,a-39);return[p,k]}}).flat())}async threeLine(t,i,r,a){const c={colour:"#ffd865",fontSize:18,fontName:"serif"},f=30;await Promise.all(a.map((p,k)=>this.drawText(t,p.toString(),i,r+f*k,c)))}async drawDraftMenu(t){const i=new we,r=new Re,a=240,c=80,f=45,p=34;let k=50,w=a;await r.headerText(k+28,w,"Opponent",t),w+=f,await i.buttonMaker(t,k,w,"DI","DUMB BOT",27,pt.vsAI,!1),w+=c,await i.buttonMaker(t,k,w,"DV","HUMAN",47,!pt.vsAI,!1),w+=c+16,await r.headerText(k+17,w,"Rarity Filter",t),w+=c-p-6,await this.rarityButton(t,k+20,w,"L",pt.getRarity("L")),await this.rarityButton(t,k+125,w,"H",pt.getRarity("H")),w+=c,await this.rarityButton(t,k+20,w,"R",pt.getRarity("R")),await this.rarityButton(t,k+125,w,"C",pt.getRarity("C")),w=a+f+c*5,await i.buttonMaker(t,k,w,"MM","MAIN MENU",16),k=404,w=a,await r.headerText(k+5,w,"Draft Modes",t),w+=f,await i.buttonMaker(t,k,w,"GP","GOOD PACKS",9,pt.fatPacks),w+=c,await i.buttonMaker(t,k,w,"LD","LEGENDARY",17,pt.legDraft),w+=c,await i.buttonMaker(t,k,w,"OD","OVERDRAFT",17,pt.overdraft),k=757,w=a,await r.headerText(k+76,w,"Sets",t),w+=f,await this.chestButton(t,k+3,w,1,pt.getSet(1)),await this.chestButton(t,k+124,w,2,pt.getSet(2)),w+=88,await this.chestButton(t,k+3,w,3,pt.getSet(3)),await this.chestButton(t,k+124,w,4,pt.getSet(4)),w+=88,await this.chestButton(t,k+3,w,5,pt.getSet(5)),await this.chestButton(t,k+124,w,6,pt.getSet(6)),w+=88,await this.chestButton(t,k+3,w,7,pt.getSet(7)),w=a+f+c*5,await i.buttonMaker(t,k,w,"DN","NEXT",68)}async rarityButton(t,i,r,a,c){const f={key:"MNBT",zone:"N",host:"",param:S.enTil("DR",a)},p=`ui/button/rarity_${a}${c?"y":"n"}.png`;await this.drawSprite(t,p,i,r);const k=new ot(f,i,r,75,65,st.Both);Q.add(k)}async chestButton(t,i,r,a,c){const f={key:"MNBT",zone:"N",host:"",param:S.enTil("DT",a)};c&&await this.drawSprite(t,"icons/sets/chest-hl.png",i,r);const p=`icons/sets/Chest_Set${a}${c?"y":"n"}.png`;await this.drawSprite(t,p,i,r);const k=new ot(f,i,r,90,74,st.Both);Q.add(k)}}class Xe extends It{async drawSets(t,i){let r=200;const a=100,c=[],f=new Ot(a,r,400,600);t.filter(p=>p.key==="DSET").forEach(p=>{const k=Ae[parseInt(p.param)];c.push(this.drawText(i,k.name,a,r,{colour:"#f5f242"}),this.drawSprite(i,"icons/chest_small.png",a-48,r-5));const w=new ot(p,a,r-2,400,35,st.Both);f.addChild(w),r+=45}),Q.add(f),await Promise.all(c)}async drawList(t,i){let r=170;const a=570,c=42,f=33,p=[],k=new Ot(a,r,460,600),w=new Ot(a-c,r,f,600),P=t.filter(U=>U.key==="DPVW");t.filter(U=>U.key==="DECK").map(U=>{const J=P.find(Z=>Z.param===U.param);return[U,J]}).forEach(U=>{const J=Et.stockDeckByPram(U[0].param);p.push(this.drawFaction(i,J.factions[0],a,r),this.drawText(i,J.name,a+65,r+7,{colour:"#f5f242"})),J.factions.length===2&&p.push(this.drawFaction(i,J.factions[1],a+28,r));const Z=new ot(U[0],a,r-2,460,35,st.Both);k.addChild(Z),p.push(this.drawSprite(i,"icons/rarity/eye/legendary.png",a-c,r));const et=new ot(U[1],a-c,r-2,f,35,st.Both);w.addChild(et),r+=35}),await Promise.all(p),Q.add(k),Q.add(w)}packBoundary=[17,190,537,480];coordCalcPack(t){const a=t%3,c=Math.floor(t/3);return[22+a*176,200+c*235]}iAmError(t){const i=ht.get("game-ui");this.drawText(i,t,295,655,{colour:"#f5142e",fontSize:26})}async drawConstrMenu(t){const i=new we,r=new Re,a=240,c=80,f=45;let p=50,k=a;await r.headerText(p+28,k,"Opponent",t),k+=f,await i.buttonMaker(t,p,k,"CI","DUMB BOT",27,Pt.vsAI,!1),k+=c,await i.buttonMaker(t,p,k,"CV","HUMAN",47,!Pt.vsAI,!1),k+=c*4,await i.buttonMaker(t,p,k,"MM","MAIN MENU",16),p=404,k=a,await r.headerText(p+46,k,"Player 1",t);const w=Pt.p1.mode;k+=f,await i.buttonMaker(t,p,k,S.enTil("CP","A"),"PRE-CON",39,w==="CP",!1),k+=c,await i.buttonMaker(t,p,k,S.enTil("CR","A"),"RANDOM",36,w==="CR",!1),k+=c,await i.buttonMaker(t,p,k,S.enTil("CX","A"),"SCRAMBLE",30,w==="CX",!1),k+=c,await i.buttonMaker(t,p,k,S.enTil("LK","A"),"LOAD FILE",32,w==="LK"),w==="LK"&&await this.drawFileDeck(t,p,k,Pt.p1.deck),p=757,k=a,await r.headerText(p+44,k,"Player 2",t);const P=Pt.p2.mode;k+=f,await i.buttonMaker(t,p,k,S.enTil("CP","B"),"PRE-CON",39,P==="CP",!1),k+=c,await i.buttonMaker(t,p,k,S.enTil("CR","B"),"RANDOM",36,P==="CR",!1),k+=c,await i.buttonMaker(t,p,k,S.enTil("CX","B"),"SCRAMBLE",30,P==="CX",!1),k+=c,await i.buttonMaker(t,p,k,S.enTil("LK","B"),"LOAD FILE",32,P==="LK"),P==="LK"&&await this.drawFileDeck(t,p,k,Pt.p2.deck),k+=c*2,await i.buttonMaker(t,p,k,"CN","NEXT",68)}async drawFileDeck(t,i,r,a){const c=r+89;await this.drawText(t,a.name.slice(0,20),i,r+70,{colour:"#f5f242",fontSize:18}),a.factions.length===1?await this.drawFaction(t,a.factions[0],i+96,c):(await this.drawFaction(t,a.factions[0],i+78,c),await this.drawFaction(t,a.factions[1],i+113,c))}}class Re extends It{async drawExtrasMenu(t){const i=new we,r=240,a=80,c=45,f=34;let p=50,k=r;await this.headerText(p+28,k,"More Info",t),k+=c,await i.buttonMaker(t,p,k,"RU","RULES",66),k+=a,await i.buttonMaker(t,p,k,"FQ","INFO & FAQ",20),k+=a*4,await i.buttonMaker(t,p,k,"MM","MAIN MENU",16),p=404,k=r,await this.headerText(p+37,k,"UI Modes",t),k+=c,await i.buttonMaker(t,p,k,"90","90% SIZE",47,S.options.scale==="90"),k+=a,await i.buttonMaker(t,p,k,"BC","BIG CARDS",29,S.options.bigCards),k+=a+f,await this.headerText(p+12,k,"Game Modes",t),k+=a-f,await i.buttonMaker(t,p,k,"HH","BIG HEALTH",20,S.options.highHealth),k+=a,await i.buttonMaker(t,p,k,"CH","CHEATER",39,S.options.cheater),k+=a,await i.buttonMaker(t,p,k,"BB","BATTLE BARK",13,S.options.bark),p=757,k=r,await this.headerText(p+43,k,"Playmat",t),k+=c;const w=S.options.playmat==="vanilla";await i.buttonMaker(t,p,k,"vanilla","VANILLA",43,w,!w),k+=a;const P=S.options.playmat==="alloyin";await i.buttonMaker(t,p,k,"alloyin","ALLOYIN",43,P,!P),k+=a;const I=S.options.playmat==="nekrium";await i.buttonMaker(t,p,k,"nekrium","NEKRIUM",38,I,!I),k+=a;const U=S.options.playmat==="tempys";await i.buttonMaker(t,p,k,"tempys","TEMPYS",51,U,!U),k+=a;const J=S.options.playmat==="uterra";await i.buttonMaker(t,p,k,"uterra","UTERRA",52,J,!J);const Z=890;await this.drawText(t,S.ver,Z,46,{fontSize:18,colour:"#7b68ee"}),await this.drawText(t,"28-Dec-2023",Z,68,{fontSize:14,colour:"#7b68ee"});const et=b.basicAction("MNBT");et.param="VR";const Ct=new ot(et,Z,44,90,44,st.Both);Q.add(Ct)}async headerText(t,i,r,a){await this.drawText(a,r,t,i,{colour:"#f5f242",fontSize:30})}async drawPickerPlayer(t,i,r){let a;i?a="Player 1":r?a="Dumb Bot":a="Player 2",await this.headerText(54,75,a,t)}}class Na extends It{async drawMenu(t){let r=22;await this.drawSprite(t,"ui/button/constructed.png",778,r);const a=new ot(this.makeAction("C"),...this.buttHilightBounds(778,r),st.Both);Q.add(a),r=148,await this.drawSprite(t,"ui/button/draft.png",778,r);const c=new ot(this.makeAction("D"),...this.buttHilightBounds(778,r),st.Both);Q.add(c),r=508,await this.drawSprite(t,"ui/button/deck.png",778,r);const f=new ot(this.makeAction("B"),...this.buttHilightBounds(778,r),st.Both);Q.add(f),r=634,await this.drawSprite(t,"ui/button/info.png",778,r);const p=new ot(this.makeAction("I"),...this.buttHilightBounds(778,r),st.Both);Q.add(p);const k=b.basicAction("DBUG"),w=new ot(k,757,349,74,70,st.Right);Q.add(w),await this.drawSprite(t,"gwg/gwg_red.png",58,0);const P=b.basicAction("MNBT");P.param="SB";const I=new ot(P,10,10,44,52,st.Both);Q.add(I);const U=b.basicAction("MNBT");U.param="GW";const J=new ot(U,58,10,50,50,st.Both);Q.add(J)}buttBounds(t,i){return[t,i,242,113]}buttHilightBounds(t,i){const a=[-3,-3,6,6];return this.buttBounds(t,i).map((c,f)=>c+a[f])}makeAction(t){return{zone:"N",key:"MENU",host:"",param:t}}}class Fa{ver="v0.9.3";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,i){return Math.floor(Math.random()*(i-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(i=>{setTimeout(()=>{i()},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(i=>this.getSprite(`${this.imgRoot}${i}`)))}dogBark(){this.dogAudio.volume=.2,this.dogAudio.play()}toggleDebug(){const t=!this.options.debug;this.options.debug=t;const i="Debug mode "+(t?"ON":"OFF");mt.baseMode==="G"?y.debug(i):new Xe().iAmError(i)}enTil(...t){return t.join("~")}deTil(t){return t.split("~")}imageLoader(t){return new Promise(i=>{const r=new Image;r.onload=()=>{i(r)},r.src=t})}writeStorage(t,i){localStorage.setItem(t,i)}readStorage(t){return localStorage.getItem(t)}readStringStorage(t,i){const r=this.readStorage(t);return r===null?i:r}readBoolStorage(t,i){const r=this.readStorage(t);return r===null?i:this.txt2bool(r)}writeBoolStorage(t,i){this.writeStorage(t,this.bool2txt(i))}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 Fa;class Pa{log=!1;file=!1;makeReport(){}}window.onload=async()=>{await document.fonts.ready;let o=[];document.fonts.forEach(Z=>{Z.load(),o.push(Z.loaded)}),await Promise.all(o),["game-ui","field","player","hand","effects","decklist","card"].forEach(Z=>{ht.register(Z)}),S.pxRatio=window.devicePixelRatio;let i;(Z=>{Z.Neutral="N",Z.Cancel="C",Z.Down="D"})(i||(i={}));let r=!0,a=800,c="N",f;try{document.createEvent("TouchEvent"),S.setClickMode("T"),r=!1}catch{}const p=()=>{f&&(clearTimeout(f),f=void 0)},k=(Z,et,Ct)=>{const q=Q.hitTest(Z,et,Ct);q&&v.handleAction(q)},w=Z=>{k(Z.pageX,Z.pageY,Z.button)},P=Z=>{Z.touches.length>1?(c="C",p()):c==="N"&&(c="D",f=setTimeout(()=>{c="C";const et=Z.touches[0];k(et.pageX,et.pageY,st.ForceRight),f=void 0},a))},I=Z=>{if(c==="D"){if(p(),c="N",Z.changedTouches.length>0){const et=Z.changedTouches[0];k(et.pageX,et.pageY,st.Left)}}else Z.touches.length===0&&(c="N")},U=document.getElementById("solforge");r?(U.addEventListener("click",w),U.addEventListener("contextmenu",Z=>(Z.preventDefault(),w(Z),!1))):(U.addEventListener("touchstart",P),U.addEventListener("touchend",I)),window.sfapi={details:Z=>{ie.init(Z)},setLog:Z=>{lt.setLog(Z)},peekAll:()=>{lt.peekAllCards()},peekDeck:()=>{lt.peekDecks()},peekField:()=>{console.log(m.field)},dumb:()=>{console.log("Am I dumb? "+lt.dumb)},debug:()=>{S.toggleDebug()}},S.restoreOptions(),S.options.scale!=="100"&&bt.changeScale(S.options.scale),bt.drawAll(),new Pa().makeReport()}})(); +(function(){"use strict";const qe=["A","N","T","U"];const Ee=["C","R","H","L"];const ee=[{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:"AOP",f:"A",r:"R",s:7,t:"S",ds:["AH"]},{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:"AMP",f:"A",r:"H",s:7,t:"C",ds:["RB","AR"]},{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:"ATI",f:"T",r:"L",s:7.2,t:"C",dp:["SP"],ds:["FR","MV","DR"]},{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:"BZH",f:"T",r:"H",s:7.2,t:"S",ds:["BN"],dn:["MN"]},{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:"BTD",f:"T",r:"L",s:7,t:"C",ds:["MV","AG","DR","BN"]},{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:"BLP",f:"U",r:"H",s:7.2,t:"S",ds:["PS"],dn:["MT"]},{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:"BOF",f:"N",r:"C",s:7,t:"C",dp:["AB"],ds:["LG","SV"]},{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:"BWN",f:"A",r:"H",s:7,t:"C",ds:["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:"CDM",f:"T",r:"H",s:7,t:"C",ds:["YT","BN"]},{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:"CGG",f:"N",r:"H",s:7.1,t:"C",dp:["HL"],ds:["TK","LZ"]},{c:"CHV",f:"N",r:"L",s:2,t:"C",dp:["FB"],ds:["MV","RV"]},{c:"CCC",f:"N",r:"H",s:7.3,t:"S",dp:["ZB"],ds:["SV","TK","FR"]},{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:"CHT",f:"T",r:"R",s:7,t:"S",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:"CMR",f:"A",r:"L",s:7.1,t:"C",dp:["RP"],ds:["MM","AR","AL"]},{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:"CYW",f:"N",r:"R",s:7,t:"S",ds:["LG","BN"]},{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:"CYR",f:"T",r:"H",s:7.1,t:"C",dn:["FC"],ds:["MV"]},{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:"CEX",f:"A",r:"H",s:7.1,t:"S",ds:["AH","AR","HL"]},{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:"CTM",f:"N",r:"L",s:7.3,t:"C",dp:["AL"],ds:["SV"]},{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:"DPO",f:"N",r:"H",s:7.2,t:"S",dp:["AL"],ds:["TK","RV"],dn:["MA"]},{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:"DFS",f:"A",r:"C",s:7,t:"S",ds:["AR","TD"]},{c:"DCS",f:"A",r:"L",s:2,t:"C",ds:["LV"]},{c:"DPG",f:"U",r:"H",s:7,t:"C",ds:["PS"]},{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:"DOV",f:"N",r:"R",s:7,t:"C",ds:["LG","BN"]},{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:"DKS",f:"T",r:"R",s:7,t:"C",dn:["GW"]},{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:"DRD",f:"N",r:"L",s:7,t:"C",dp:["LZ"],ds:["TK","AB"]},{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:"ESD",f:"N",r:"L",s:7,t:"C",ds:["FR"]},{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:"EWV",f:"U",r:"C",s:7,t:"S",ds:["TD","TK"]},{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:"FSL",f:"N",r:"C",s:7,t:"C"},{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:"FOR",f:"T",r:"C",s:7,t:"S",ds:["TD","AH"]},{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:"FLC",f:"A",r:"L",s:7.2,t:"C",ds:["AR"],dn:["SQ"]},{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:"GSF",f:"A",r:"H",s:7.3,t:"C",dp:["MM"],ds:["AR"]},{c:"GAS",f:"A",r:"H",s:7,t:"S",dp:["VT"],ds:["FR","TK","NX"]},{c:"HMF",f:"T",r:"H",s:3,t:"C",ds:["YT","MV"]},{c:"HOS",f:"U",r:"R",s:7,t:"C",dp:["TK","SB"]},{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:"HMO",f:"U",r:"C",s:7,t:"C",ds:["DI"]},{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:"HVE",f:"U",r:"R",s:7,t:"C",ds:["PS"]},{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:"ISB",f:"T",r:"C",s:7,t:"C"},{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:"IDF",f:"N",r:"H",s:7,t:"C",dp:["UD","LZ"],ds:["TK","ZB"]},{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:"IBA",f:"A",r:"L",s:7,t:"C",dp:["FB"],ds:["AR","AL"],dn:["TD"]},{c:"IHA",f:"A",r:"L",s:2,t:"C",dp:["FB"],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","FB"]},{c:"KTS",f:"U",r:"H",s:4,t:"C",dp:["RP"],ds:["TK"]},{c:"KKK",f:"T",r:"L",s:2,t:"C",dp:["FB"],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",ds:["TK"],dn:["FR"]},{c:"LLG",f:"U",r:"H",s:5,t:"C",ds:["TK"],dn:["MV"]},{c:"LLS",f:"A",r:"H",s:5,t:"C",ds:["RB","TK"],dn:["TK","LZ"]},{c:"LLT",f:"T",r:"H",s:5,t:"C",ds:["TK"],dn:["LG"]},{c:"LLV",f:"U",r:"H",s:7.1,t:"C",dp:["PS"],ds:["TK"]},{c:"LMD",f:"N",r:"L",s:7.1,t:"C",ds:["DR","TK","MV"]},{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:"LBC",f:"U",r:"H",s:7,t:"C",dp:["FC","MU"],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:"LTM",f:"T",r:"C",s:7,t:"C",ds:["AG"]},{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:"LVH",f:"U",r:"L",s:7,t:"C",dp:["MS","PS","SQ"],ds:["TK","GW"]},{c:"LTU",f:"U",r:"L",s:7,t:"C",ds:["TK","GW"]},{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:"MDR",f:"A",r:"R",s:7,t:"C",ds:["NT","MM"]},{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:"MNM",f:"N",r:"L",s:7.2,t:"C",ds:["TK","GW"]},{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:"NCP",f:"N",r:"H",s:7,t:"C",dn:["CD"]},{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","FB"],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:"NUG",f:"T",r:"L",s:7.1,t:"C",ds:["YT"]},{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:"ORC",f:"A",r:"C",s:7,t:"C",ds:["AH"]},{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",dp:["FB"],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:"PVA",f:"U",r:"L",s:7.2,t:"C",ds:["TK","GW","LG","DI"]},{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:"QSW",f:"T",r:"L",s:7.3,t:"C",dp:["DI"],ds:["BN"]},{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:"REW",f:"U",r:"L",s:7.3,t:"C",ds:["TK","GW"]},{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:"RTW",f:"U",r:"H",s:7,t:"C",ds:["WD","TK"]},{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:"RPR",f:"A",r:"H",s:7.2,t:"S",ds:["AL","NT"],dn:["MU"]},{c:"RLW",f:"U",r:"H",s:1,t:"C",dp:["WD"]},{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:"ROU",f:"N",r:"C",s:7,t:"S",ds:["RG","GW"]},{c:"ROE",f:"T",r:"H",s:7.3,t:"S",ds:["TK","AG","AH"]},{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:"SST",f:"U",r:"C",s:7,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:"SKN",f:"N",r:"C",s:7,t:"C",ds:["ZB"]},{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:"SPT",f:"U",r:"L",s:7.1,t:"C",ds:["PS"]},{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:"SLS",f:"T",r:"L",s:7,t:"C",dp:["SQ"],ds:["SP","WL"],dn:["TD"]},{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:"S01",f:"A",r:"L",s:7.3,t:"C",dp:["MS"],ds:["AR","AH"]},{c:"SPR",f:"N",r:"R",s:7,t:"C",ds:["SV","SB"]},{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:["XA"],ds:["DR","MV"]},{c:"SMS",f:"T",r:"C",s:7,t:"C",ds:["DI","BN"]},{c:"SHK",f:"T",r:"H",s:1,t:"S",dp:[],ds:[],dn:[]},{c:"SIX",f:"A",r:"R",s:7,t:"C",ds:["MM","SP","WL"]},{c:"SWR",f:"A",r:"R",s:1,t:"C",ds:["MM","SP","WL"]},{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:"SNK",f:"A",r:"C",s:7,t:"C",dp:["LV"],ds:["WL"]},{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:"TNM",f:"U",r:"C",s:7,t:"C"},{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:"TCN",f:"A",r:"C",s:7,t:"C",dp:["WL"],ds:["RB"]},{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:"ULG",f:"N",r:"H",s:7,t:"S",dp:["LZ"],ds:["TK","TD"]},{c:"URD",f:"N",r:"H",s:1,t:"C",dp:[],ds:["ZB"],dn:[]},{c:"USA",f:"T",r:"H",s:7,t:"C",ds:["WL","VG","FC"]},{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:"USS",f:"T",r:"H",s:7,t:"C",dp:["SQ"],ds:["TK","YT"]},{c:"UWL",f:"T",r:"H",s:2,t:"C",dp:["YT"]},{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:["FB"],ds:["TK","SV"]},{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:"VTR",f:"U",r:"R",s:7,t:"S"},{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:"VPR",f:"A",r:"L",s:7,t:"C",ds:["LV"]},{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:"WHR",f:"T",r:"R",s:7,t:"C",ds:["AG"],dn:["TD"]},{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:"WGE",f:"U",r:"H",s:7.3,t:"S",ds:["FC","LG"]},{c:"WTA",f:"U",r:"L",s:4,t:"C",dp:["LG","SB"],ds:["PL"]},{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:[]}],wi=[["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 Di{raw={["C"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0},["S"]:{["A"]:0,["N"]:0,["T"]:0,["U"]:0}};addStat(t,i){this.raw[t][i]++}g(t,i){return this.raw[t][i]}typeSum(t){return qe.map(i=>this.g(t,i)).reduce((i,r)=>i+r,0)}getTotal(){const t=this.typeSum("C"),i=this.typeSum("S");return[t,i,t+i]}getFactTotal(t){const i=this.g("C",t),r=this.g("S",t);return[i,r,i+r]}}const s=(o,t)=>({card:o,num:t}),zi={name:"Official 2 - 3",id:"SBE1",decks:[{name:"Cruel Corrosion",factions:["A","N"],cards:[s("IHA",1),s("WBG",1),s("OXP",1),s("DFR",1),s("APM",1),s("SNP",1),s("GRM",2),s("ETN",2),s("DHW",2),s("OXM",2),s("AEN",2),s("ATG",2),s("CTI",2),s("CTW",2),s("FPS",2),s("GRW",2),s("MTT",2),s("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[s("ZTU",1),s("VRP",1),s("GGP",1),s("EPD",1),s("DBT",1),s("BSM",1),s("TDW",2),s("NGT",2),s("UBL",2),s("FWK",2),s("BZD",2),s("CSB",2),s("SLH",2),s("MMH",2),s("LSK",2),s("GBG",2),s("CFG",2),s("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[s("TDS",1),s("SSR",1),s("FRR",1),s("ULR",1),s("UTR",1),s("BTM",1),s("UGL",2),s("EHN",2),s("SPD",2),s("GHB",2),s("FLN",2),s("SML",2),s("RFL",2),s("OXS",2),s("UTM",2),s("TWG",2),s("ENR",2),s("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[s("CSW",1),s("SMD",1),s("FRR",1),s("UIC",1),s("CFB",1),s("UGL",2),s("FSH",2),s("FLN",2),s("WPD",1),s("TWG",2),s("TCG",2),s("TGS",2),s("SML",2),s("SVH",1),s("SCL",2),s("RTS",1),s("FWB",2),s("ENR",2),s("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[s("IMA",1),s("GMP",1),s("OXA",1),s("EPD",1),s("OJC",1),s("ESU",2),s("OXM",2),s("MMA",2),s("SAP",1),s("AFO",2),s("GBG",2),s("CTW",2),s("SRH",1),s("TSM",2),s("SLH",1),s("MTT",1),s("DCR",1),s("DFB",1),s("BSR",1),s("LGT",1),s("XRF",2),s("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[s("SBG",1),s("NSH",1),s("FFU",1),s("EWE",1),s("BFM",1),s("WBH",1),s("UWS",1),s("TGI",2),s("RFL",2),s("GRM",1),s("ASG",1),s("YWC",2),s("XRF",2),s("WPD",2),s("WCS",2),s("WBU",2),s("TCG",1),s("FSK",1),s("SLH",2),s("CFG",1),s("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[s("URB",1),s("AGK",1),s("ESP",1),s("FRR",1),s("NXT",1),s("ALG",1),s("FGB",1),s("PHS",2),s("TUP",1),s("EWT",2),s("PTR",1),s("VBK",1),s("AGC",1),s("AEN",2),s("ETN",1),s("FPS",2),s("MXW",2),s("GHT",1),s("TWG",2),s("SNB",1),s("SML",1),s("JPK",1),s("ENR",1),s("IWC",1)]},{name:"Spare Parts",factions:["N"],cards:[s("SEV",1),s("SHG",1),s("TPG",1),s("CGL",1),s("FRV",1),s("HFA",2),s("XDH",1),s("GRM",1),s("SCV",1),s("DFB",2),s("EBW",2),s("GBG",2),s("GLF",2),s("XHS",2),s("SOT",1),s("XRF",2),s("SCS",1),s("ZMT",1),s("SLH",1),s("VYE",1),s("XCR",2),s("XHU",1)]},{name:"Future Forged",factions:["A"],cards:[s("NXA",1),s("IMD",1),s("FOL",1),s("SFA",2),s("SFT",1),s("SCD",1),s("CAG",1),s("ESU",1),s("NNS",1),s("FPM",1),s("PRI",1),s("SSS",1),s("CTG",1),s("TSM",2),s("IWC",1),s("MMA",2),s("TGN",2),s("MTT",1),s("SKG",1),s("AFO",1),s("MMV",1),s("TWS",1),s("SBA",2),s("SSK",1),s("JPK",1)]},{name:"Burning Rage",factions:["T"],cards:[s("ROK",1),s("KKK",1),s("MOE",1),s("AFR",1),s("FBI",1),s("FSS",2),s("FLN",2),s("CCT",2),s("BRN",2),s("WPD",2),s("SSM",2),s("SOK",1),s("RTS",2),s("FSK",2),s("CWK",2),s("CFG",2),s("BSW",2),s("FMS",2)]},{name:"Awakened Fury",factions:["U"],cards:[s("DZD",1),s("SSE",1),s("BTR",1),s("TSL",1),s("MPH",1),s("CDT",1),s("DYB",1),s("BTH",2),s("TMG",2),s("BWD",2),s("RHY",2),s("SBD",2),s("GMR",2),s("STS",1),s("OSL",2),s("SBI",2),s("LYS",2),s("TGS",2),s("SOD",2)]},{name:"Titan's Assault",factions:["N","T"],cards:[s("ATT",1),s("TNL",1),s("RSE",1),s("SPH",1),s("SCV",2),s("ABB",2),s("TBB",2),s("BRN",2),s("FLN",2),s("CMF",2),s("XDH",2),s("FST",2),s("TAB",2),s("MDE",2),s("FSK",2),s("FLH",2),s("CBB",2)]},{name:"Verdant Fortress",factions:["A","U"],cards:[s("NGQ",1),s("RHU",1),s("VCH",1),s("ESG",1),s("PLW",2),s("NNS",2),s("SND",2),s("WOD",2),s("IBR",2),s("BWD",2),s("SBI",2),s("RWC",2),s("TEX",2),s("SER",2),s("SWG",2),s("SCC",2),s("DYB",2)]},{name:"Umbruk Uprising",factions:["T","U"],cards:[s("LUC",1),s("BWT",1),s("GHR",1),s("TSP",1),s("WBH",1),s("COD",1),s("SDR",1),s("ZPM",1),s("OXS",1),s("WOD",1),s("RWC",2),s("SSG",2),s("VGR",2),s("CFG",2),s("UEM",2),s("FFG",2),s("UGL",2),s("DMR",2),s("RTS",2),s("CWK",2)]},{name:"Onyxium Twilight",factions:["A","N"],cards:[s("EPH",1),s("DTD",1),s("POX",1),s("DDS",1),s("OHV",1),s("PHS",1),s("DFB",1),s("TDW",1),s("CAG",1),s("ALG",1),s("TUP",2),s("CTW",2),s("XCR",2),s("SSK",2),s("SRH",2),s("ATG",2),s("MTT",2),s("SLH",2),s("GLF",2),s("AFO",2)]}]},Zi={name:"Official 5 - 7",id:"SBE2",decks:[{name:"Blistering Chaos",factions:["T","U"],cards:[s("WSE",1),s("MHR",1),s("PMI",1),s("SIV",1),s("BRN",1),s("HOD",1),s("CHA",1),s("LYS",1),s("TRS",2),s("PSC",2),s("FLN",2),s("EFA",2),s("SHS",2),s("TXB",2),s("VNF",2),s("CFG",2),s("FSK",2),s("CBB",2),s("VND",2)]},{name:"Dark Retribution",factions:["A","N"],cards:[s("AAA",1),s("SNT",1),s("ABE",1),s("XTR",1),s("CNT",1),s("HOX",1),s("PLW",1),s("AGW",1),s("OHV",2),s("OXM",2),s("XDH",2),s("VGL",2),s("ETN",2),s("MTT",2),s("VYE",2),s("DSK",2),s("BFT",2),s("ATZ",2),s("IBR",2)]},{name:"Iron Tide",factions:["A","U"],cards:[s("EFE",1),s("DPB",1),s("HWM",1),s("HTR",1),s("OJC",1),s("RBG",1),s("EWT",1),s("CIN",1),s("TGK",2),s("CAG",2),s("TGN",3),s("SCC",3),s("URS",3),s("LSP",3),s("TSM",3),s("TMM",3)]},{name:"Dragon Forge",factions:["N","T"],cards:[s("DGW",1),s("VIK",1),s("DDD",1),s("SMD",1),s("FFM",1),s("SHV",1),s("GRP",1),s("TGI",1),s("SLH",1),s("WBH",2),s("BZD",2),s("EFA",2),s("WFB",3),s("BZS",3),s("CCR",3),s("DSK",3),s("RHC",3)]},{name:"Call of Deepwood",factions:["U"],cards:[s("EVT",1),s("POD",1),s("RFA",1),s("TMS",1),s("LSS",1),s("DYB",1),s("TRS",1),s("VGW",1),s("UTM",2),s("RHY",2),s("SMA",2),s("TMM",2),s("BBN",2),s("GHS",2),s("SBI",2),s("BTS",2),s("STS",2),s("SVO",2),s("GMR",2)]},{name:"Kadras' Fury",factions:["T"],cards:[s("IGR",1),s("POK",1),s("SWA",1),s("SGA",1),s("FLN",1),s("TRV",1),s("FSS",1),s("AWU",1),s("STB",2),s("CFG",2),s("BBL",2),s("KSB",2),s("NGW",2),s("ATS",2),s("ABR",2),s("BSW",2),s("TCG",2),s("CBB",2),s("WPD",2)]},{name:"Tarsus Unleashed",factions:["N"],cards:[s("IRT",1),s("POT",1),s("ZDK",1),s("HFA",1),s("GRM",1),s("DSS",1),s("TRW",1),s("ABB",1),s("XCR",2),s("CSB",2),s("SHY",2),s("BBD",2),s("EBW",2),s("NSY",2),s("TPT",2),s("XRF",2),s("GGS",2),s("ZMT",2),s("IVS",2)]},{name:"Might of Anvillon",factions:["A"],cards:[s("NXB",1),s("FWS",1),s("POA",1),s("SFA",1),s("SSS",1),s("TRA",1),s("BTB",1),s("BWH",1),s("TWT",2),s("TEX",2),s("IBR",2),s("VIN",2),s("BBR",2),s("NXP",2),s("CBS",2),s("FPS",2),s("ATG",2),s("SNB",2),s("SSK",2)]},{name:"Nature's Defenses",factions:["T","U"],cards:[s("RSD",1),s("PHC",1),s("SPG",1),s("TBC",1),s("GHR",1),s("NGB",1),s("DDF",1),s("VGW",3),s("UEM",3),s("FSK",2),s("TMM",2),s("VSP",2),s("BZS",2),s("SPD",3),s("RTS",3),s("TGK",3)]},{name:"Unlikely Alliance",factions:["A","N"],cards:[s("RMB",1),s("SFG",1),s("GGW",1),s("WPC",1),s("SBA",2),s("IBR",1),s("BSR",1),s("MMV",1),s("CRC",1),s("BSP",1),s("NNS",1),s("XDH",2),s("EBW",2),s("SLH",2),s("CTG",3),s("XRF",3),s("OHV",3),s("TSM",3)]},{name:"Toxic Shards",factions:["U"],cards:[s("SPT",1),s("MHR",1),s("KBE",1),s("DPG",1),s("LLV",1),s("HVE",2),s("PSC",2),s("VND",2),s("DSV",2),s("TXB",2),s("CSR",3),s("GSC",3),s("GVS",3),s("LHY",3),s("TGS",3)]},{name:"Winds of Fury",factions:["T"],cards:[s("NUG",1),s("FMD",1),s("CYR",1),s("FFM",1),s("AIV",1),s("WBH",2),s("UBL",2),s("FZS",2),s("EFA",2),s("WBY",2),s("KSB",3),s("SCL",3),s("TCG",3),s("CWK",3),s("ISB",3)]},{name:"Ghastly Echoes",factions:["N"],cards:[s("LMD",1),s("XTE",1),s("CGG",1),s("EPD",1),s("NCP",1),s("NOZ",2),s("OSP",2),s("PLI",2),s("GRP",2),s("DOV",2),s("CYS",3),s("IVS",3),s("MRF",3),s("GRW",3),s("FSL",3)]},{name:"Cypien Technology",factions:["A"],cards:[s("CMR",1),s("RHU",1),s("CEX",1),s("FOL",1),s("AHL",1),s("SSI",2),s("CAG",2),s("CIN",2),s("CNT",2),s("PHS",2),s("MXW",3),s("LSP",3),s("SSN",3),s("TWT",3),s("CSH",3)]}]},Yi={name:"Starters & Early Tournies",id:"T1309",decks:[{name:"Alloyin Starter",factions:["A"],cards:[s("SYO",1),s("BSS",1),s("SFT",2),s("SNP",2),s("TSM",2),s("SSS",2),s("ALG",2),s("MXW",3),s("TUP",3),s("FPS",3),s("MND",3),s("IWC",3),s("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[s("SFS",1),s("GGD",1),s("FFD",3),s("EPD",2),s("CCR",2),s("HGS",2),s("DSS",2),s("BWK",2),s("GBG",3),s("DSK",3),s("GRP",3),s("VGN",3),s("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[s("FBC",1),s("RBH",1),s("CFB",3),s("FSM",2),s("FSH",2),s("FSS",2),s("PMS",2),s("RFL",2),s("UBL",3),s("WPD",3),s("SGI",3),s("AMY",3),s("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[s("UPM",1),s("EHW",1),s("FRR",3),s("SPD",2),s("HTP",2),s("LSS",2),s("SDR",2),s("SRD",2),s("FWR",3),s("DBP",3),s("GHT",3),s("GSS",3),s("TXS",3)]},{name:"Axel: Lifegain",factions:["T","U"],cards:[s("AGD",3),s("EHW",3),s("FRR",3),s("FIN",1),s("UPM",1),s("LKP",2),s("BTM",2),s("LBL",3),s("GSS",3),s("RFA",3),s("GHB",3),s("EFP",3)]},{name:"Bryan: Knightbots",factions:["A","U"],cards:[s("AGK",3),s("AFS",3),s("BSG",2),s("BSS",3),s("JPK",3),s("VBK",2),s("FRR",3),s("TDS",3),s("WWP",3),s("MXW",2),s("OJC",3)]},{name:"Derk: Metaminds",factions:["A"],cards:[s("OJC",3),s("DMW",3),s("MMV",3),s("JPK",3),s("MMO",3),s("GMP",3),s("ALS",3),s("MMA",3),s("SFA",3),s("BTN",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[s("DBP",3),s("EHW",2),s("FRR",3),s("FWT",3),s("UPM",3),s("LKP",2),s("BTM",3),s("HTR",2),s("LBD",2),s("RFA",3),s("GHB",2),s("SDR",2)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[s("ALS",3),s("TDS",3),s("FRR",3),s("WWP",3),s("SML",2),s("BSG",3),s("JPK",2),s("ODC",3),s("NXT",2),s("WMM",3),s("GHB",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[s("SCS",3),s("ROG",1),s("GGP",1),s("GGD",3),s("WFS",1),s("DSS",3),s("ZTU",1),s("GBG",3),s("HFA",3),s("EXD",1),s("EPD",1),s("BSR",1),s("MRF",2),s("HGS",3),s("GTH",3)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[s("SHK",3),s("MOE",3),s("FRR",3),s("LSK",3),s("FFU",3),s("UBL",3),s("WWS",3),s("FSS",3),s("ENR",3),s("MMH",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[s("DBP",2),s("EHW",2),s("FRR",3),s("HTP",2),s("UPM",3),s("LKP",2),s("GHT",3),s("GGP",2),s("LBD",1),s("EPD",2),s("DBT",2),s("SPD",3),s("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[s("IWC",3),s("FSS",3),s("ETN",1),s("WPD",2),s("FSM",1),s("AHL",1),s("UBL",3),s("SMD",2),s("BTN",3),s("LSK",1),s("MMH",3),s("FFU",1),s("TSM",3),s("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[s("DSS",3),s("FSS",3),s("EPD",2),s("GTH",3),s("FSM",1),s("MOE",1),s("UBL",3),s("GGP",3),s("GBG",1),s("LSK",3),s("HGS",1),s("CTW",1),s("SHK",3),s("GGD",1),s("DBT",1)]}]},Ki={name:"The Forge",id:"TG10",decks:[{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[s("BWK",3),s("TDS",2),s("FRR",3),s("WWP",3),s("GGP",3),s("GGD",3),s("DBT",1),s("WFS",3),s("CTW",3),s("EPD",3),s("GHB",3)]},{name:"ErrorAsh: Burn",factions:["N","T"],cards:[s("UBL",2),s("EFM",2),s("FBI",3),s("ESK",3),s("FLN",3),s("EFP",3),s("MOE",3),s("FSS",3),s("SHK",3),s("EPD",3),s("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[s("WWS",3),s("DYB",3),s("FRR",3),s("SYL",3),s("EPD",3),s("SSE",2),s("NSH",2),s("TDW",3),s("NFF",2),s("CHR",2),s("LKP",2),s("EXD",2)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[s("NSH",2),s("SMD",2),s("DDD",3),s("TDW",3),s("VRP",3),s("WCS",3),s("BSM",3),s("SHG",2),s("TGI",2),s("EPD",3),s("FVA",2),s("DBT",1),s("TRN",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[s("UWL",3),s("FFU",3),s("WBY",3),s("UIM",3),s("WBU",3),s("SSR",1),s("TRN",1),s("GTT",1),s("GCR",3),s("FRR",3),s("UBL",3),s("WWP",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[s("DDD",3),s("DBT",3),s("EPD",3),s("EFP",3),s("GGP",3),s("LSK",3),s("SHK",3),s("UBL",3),s("WCS",3),s("ZTU",3)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[s("XSH",3),s("SPM",3),s("FRR",3),s("ODC",3),s("SSE",3),s("ESK",3),s("TGS",3),s("XRF",3),s("VRP",3),s("URB",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[s("RBH",3),s("TDS",3),s("FRR",3),s("WWP",3),s("EFP",3),s("AMY",2),s("FVA",2),s("ENR",3),s("ZSH",3),s("EHW",3),s("GHB",2)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[s("BWK",2),s("KOD",2),s("CYC",3),s("GRM",3),s("VYE",3),s("XRW",3),s("MOE",2),s("ZTU",3),s("BSM",3),s("EPD",3),s("DSS",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[s("AGM",3),s("TDS",2),s("FRR",3),s("WWP",3),s("CSW",3),s("FLN",3),s("EFP",2),s("UWL",3),s("WBY",2),s("WCS",2),s("EHW",2),s("SHS",2)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[s("UHS",2),s("FLN",3),s("STG",3),s("CRC",3),s("SHK",3),s("EFP",2),s("WMR",2),s("WMM",3),s("JPK",3),s("SMD",3),s("FVA",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[s("LSK",2),s("WBG",3),s("EPD",3),s("DDD",3),s("SHK",3),s("EFP",3),s("ZTU",2),s("GGD",2),s("GGP",3),s("CTW",3),s("DBT",3)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[s("DMW",3),s("GMP",3),s("MMA",3),s("MMV",2),s("TDW",3),s("VRP",3),s("EPD",3),s("SHG",2),s("OJC",2),s("ESK",2),s("CHV",2),s("CTW",2)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[s("CTW",1),s("GCR",1),s("CFG",1),s("FZS",1),s("FBI",3),s("MOE",3),s("EFP",3),s("LSK",3),s("FLN",3),s("SHK",3),s("RTS",3),s("GGP",3),s("UBL",2)]}]},Xi={name:"Team A1",id:"A1FU",decks:[{name:"Phytogaunt",factions:["N","U"],cards:[s("DTD",3),s("EPD",2),s("XTE",3),s("GGD",3),s("GGP",3),s("GGR",3),s("ROG",1),s("ESK",3),s("GGW",3),s("POT",3),s("PTB",3)]},{name:"ANfinity",factions:["A","N"],cards:[s("IMA",3),s("AAA",2),s("MMA",3),s("KIW",3),s("ESU",3),s("ABE",3),s("AFO",1),s("XDH",2),s("GBG",1),s("SHV",2),s("SCV",2),s("LCE",2),s("MTS",1),s("PRI",1),s("WPC",1)]},{name:"Icefinity",factions:["A","T"],cards:[s("IMA",3),s("AAA",1),s("MMA",2),s("MOE",3),s("ESU",3),s("ABE",3),s("NNS",1),s("IGR",2),s("SHK",1),s("OBB",2),s("LCE",2),s("ITO",1),s("PRI",3),s("BRN",3)]},{name:"Drain Tank",factions:["A","N"],cards:[s("DTD",3),s("SRP",2),s("LLS",3),s("ESK",3),s("CYC",3),s("BRS",3),s("PLI",1),s("SOC",2),s("EPD",2),s("ABE",2),s("HOX",2),s("DCR",2),s("VYE",2)]},{name:"Big Animals",factions:["N","U"],cards:[s("DTD",3),s("MHR",2),s("DZD",3),s("SPB",3),s("SHY",3),s("URB",3),s("VIK",1),s("ESK",3),s("DYS",3),s("LYS",3),s("IME",3)]},{name:"Explosive Dragon Rage",factions:["A","T"],cards:[s("FMD",3),s("SGA",2),s("AFR",3),s("FBI",3),s("POK",3),s("SHK",3),s("ROK",3),s("IGR",1),s("OEX",3),s("BWW",2),s("STB",2),s("BRN",2)]},{name:"Angry Tree",factions:["N","U"],cards:[s("DTD",3),s("EPD",2),s("CYC",3),s("SPB",3),s("IME",3),s("SOC",3),s("ODC",2),s("ESK",2),s("WTA",3),s("VYE",3),s("HOX",3)]},{name:"Commando",factions:["A","N"],cards:[s("GSF",3),s("SIX",2),s("GMP",3),s("DMW",3),s("IMA",3),s("MMA",3),s("MBR",3),s("POA",3),s("WMM",2),s("EXD",2),s("SFA",3)]},{name:"Our Robot Overlords",factions:["A","T"],cards:[s("AGK",3),s("AFS",3),s("ATT",3),s("BTB",3),s("BSS",3),s("FWS",3),s("FLC",3),s("GOS",3),s("RHU",3),s("WMC",3)]},{name:"Random Aggression",factions:["T","U"],cards:[s("SMA",3),s("EHW",3),s("KSB",3),s("FSH",3),s("RTW",3),s("SDR",3),s("LBD",3),s("KKK",3),s("FRR",3),s("SIV",3)]},{name:"The Crux of it All",factions:["A","N"],cards:[s("CMR",3),s("VPR",3),s("LLD",3),s("DCR",3),s("SCV",3),s("IBA",2),s("SRM",2),s("SRP",1),s("MMR",2),s("LCE",1),s("NXA",2),s("IMD",1),s("OJC",2),s("WPC",2)]}]},qi={name:"Fandom Wiki",id:"FDWK",decks:[{name:"Castles",factions:["A","U"],cards:[s("TDS",3),s("TMS",3),s("DTR",3),s("HTR",3),s("RSD",3),s("SPB",3),s("MHR",3),s("RHU",3),s("AEC",3),s("FRR",3)]},{name:"Runebark's Revenge",factions:["U"],cards:[s("RBG",3),s("EVT",3),s("EFE",3),s("SBI",3),s("RSD",3),s("SPB",3),s("ODC",3),s("GSS",3),s("BTR",3),s("POD",3)]},{name:"Don't Wake Boris",factions:["T","U"],cards:[s("AGD",3),s("EVT",3),s("EFE",3),s("DGW",3),s("LYS",3),s("SBD",3),s("ODC",3),s("GSS",3),s("BRN",3),s("POD",3)]},{name:"Shrink N' Squat",factions:["A","N"],cards:[s("DDS",3),s("ESK",3),s("EPD",3),s("GRW",3),s("GGP",3),s("HRM",3),s("PPM",3),s("SRM",3),s("MMG",3),s("WFS",3)]},{name:"Healthy Mystic",factions:["T","U"],cards:[s("LYR",3),s("PYM",3),s("EFE",3),s("TGS",3),s("LYS",3),s("SBD",3),s("TMG",3),s("TMM",3),s("SSH",3),s("SSE",3)]},{name:"Varna Control",factions:["A","N"],cards:[s("VIK",3),s("KIW",3),s("LCE",3),s("ABE",3),s("ZTU",3),s("SES",3),s("DCR",3),s("SCV",3),s("ESU",3),s("BRS",2),s("HOX",1)]},{name:"Barry's Buddies",factions:["A","T"],cards:[s("AAA",3),s("BRS",3),s("SMD",3),s("GOS",3),s("PMP",3),s("AGW",3),s("NNS",3),s("PLW",3),s("OBB",3),s("ABE",3)]},{name:"Heraldbomb",factions:["T","U"],cards:[s("UWL",3),s("HOD",3),s("PTB",3),s("BTM",3),s("LYS",3),s("DDF",3),s("MHR",3),s("WSE",3),s("SPB",3),s("WWP",3)]},{name:"Heartseeker",factions:["A","T"],cards:[s("UWL",3),s("FFU",3),s("FKS",3),s("OEX",3),s("POK",3),s("ROK",3),s("UHS",3),s("WBU",3),s("UCM",2),s("WSE",2),s("KKK",2)]},{name:"Punchy",factions:["A","U"],cards:[s("ODC",3),s("DBP",3),s("URB",3),s("RHU",3),s("CEX",3),s("GOS",3),s("LYS",3),s("PMP",3),s("WMM",3),s("ABE",3)]},{name:"Sea of Sludge",factions:["N","U"],cards:[s("ODC",3),s("WTA",3),s("GSS",3),s("DYL",3),s("AGD",3),s("GGW",3),s("CYC",3),s("VYE",3),s("DCR",3),s("SCV",3)]},{name:"Poison Control",factions:["A","U"],cards:[s("MHR",3),s("LOD",3),s("VNS",3),s("ESG",3),s("LCE",3),s("ESU",3),s("IMA",3),s("DSV",3),s("GSS",2),s("CSR",1),s("ABE",3)]},{name:"Original Fangsters",factions:["A","N"],cards:[s("VES",3),s("XTE",3),s("GGP",3),s("RHU",3),s("WBG",3),s("ABE",3),s("DDS",3),s("SOC",3),s("JPK",3),s("EPD",3)]},{name:"Hatorade",factions:["A","U"],cards:[s("MHR",3),s("ARB",3),s("DDF",3),s("IHA",3),s("LLG",3),s("NXA",3),s("OJC",3),s("RHU",3),s("SPB",3),s("LYS",3)]},{name:"Wegu Control",factions:["A","U"],cards:[s("MHR",3),s("CHR",3),s("KIW",3),s("ESG",3),s("WTA",3),s("ODC",3),s("GSS",3),s("OAP",2),s("NGQ",1),s("DDF",2),s("WPC",1),s("ABE",3)]}]},ji={name:"Battlebranded",id:"BTLB",decks:[{name:"Bucket of Spite",factions:["N","T"],cards:[s("SMD",2),s("SPH",3),s("BSM",3),s("EBW",3),s("UWL",3),s("BSW",2),s("BWW",1),s("FMD",3),s("BST",3),s("EPD",3),s("GGD",2),s("HOX",1),s("SOC",1)]},{name:"Overoverloaded",factions:["A","N"],cards:[s("XDH",3),s("RMB",3),s("ABE",3),s("IMA",3),s("EPD",3),s("TPG",3),s("ESU",3),s("KIW",2),s("LCE",2),s("ESK",2),s("STR",1),s("CYC",1),s("PRI",1)]},{name:"Dysian Forest",factions:["N","U"],cards:[s("POX",3),s("DBQ",3),s("TDS",3),s("NGQ",3),s("WWP",3),s("DTD",3),s("LBD",3),s("SSH",2),s("LYS",3),s("DYS",2),s("FRR",1),s("HOX",1)]},{name:"Statis Shenanigans",factions:["A","T"],cards:[s("OBB",3),s("SHK",3),s("ABE",3),s("IMA",3),s("SIX",3),s("GCR",2),s("ESU",3),s("NNS",2),s("LCE",3),s("OJC",2),s("BRS",1),s("VIC",1),s("PRI",1)]},{name:"Masochist Zoo",factions:["N","U"],cards:[s("DZD",3),s("TDW",3),s("LLD",3),s("LLG",3),s("RWC",3),s("BWT",3),s("DYS",2),s("SPB",3),s("SHY",3),s("IME",2),s("TDS",2)]},{name:"Pummelled by Gauntlets",factions:["A","N"],cards:[s("AGK",3),s("FWS",3),s("LLD",3),s("LLS",3),s("NXA",3),s("RHU",3),s("ARB",2),s("GOS",2),s("OJC",2),s("ESK",2),s("PMP",2),s("SOC",2)]},{name:"Nuada's Greenhouse",factions:["T","U"],cards:[s("NFF",3),s("NGQ",3),s("LKP",3),s("SYL",3),s("ATT",3),s("BWW",3),s("GMR",2),s("FRR",2),s("SSH",1),s("URB",2),s("BRN",2),s("SSE",3)]},{name:"Abominable Slaughter",factions:["N","T"],cards:[s("CGL",3),s("XDH",3),s("LLD",3),s("POX",3),s("ABM",3),s("ZXR",3),s("BWW",3),s("FMD",3),s("BST",2),s("ROK",3),s("HOX",1)]},{name:"Outraged Ingir",factions:["A","T"],cards:[s("OBB",3),s("FMD",3),s("IKA",3),s("BST",3),s("NXA",3),s("KKK",2),s("RHU",3),s("ROK",3),s("BWW",3),s("WSE",1),s("OEX",3)]},{name:"Lord of the Necros",factions:["N","T"],cards:[s("TPG",3),s("BSM",3),s("EBW",3),s("FST",3),s("TNL",3),s("BWW",3),s("XRW",3),s("CSB",3),s("GGD",3),s("SOC",3)]},{name:"Thar' Be Omegas",factions:["A","U"],cards:[s("AFS",3),s("BSS",3),s("ARB",3),s("FGA",3),s("FGB",3),s("FGG",3),s("FGD",3),s("TBA",3),s("SSH",3),s("NNS",3)]},{name:"Skillshriek",factions:["N","U"],cards:[s("POX",3),s("SEV",3),s("LLD",3),s("SPB",3),s("NSH",3),s("TDW",3),s("XDH",2),s("SBI",2),s("ATP",2),s("FRR",2),s("AEC",2),s("IME",2)]},{name:"Kitfinity",factions:["A","N"],cards:[s("XDH",3),s("MMX",3),s("GMP",2),s("IMA",3),s("VRP",3),s("SEV",3),s("ESU",3),s("KIW",3),s("SHG",2),s("SHV",2),s("SCV",1),s("CYC",1),s("AFO",1)]},{name:"There Can Be Only One",factions:["A","U"],cards:[s("AHL",3),s("WMM",3),s("ESU",3),s("PRI",3),s("JPK",3),s("MPH",3),s("LYS",3),s("BTM",2),s("FIN",1),s("SOD",3),s("VGR",3)]}]},Qi={name:"Misc. Web Decks",id:"WEB1",decks:[{name:"Steelscale Debuff",factions:["A","N"],cards:[s("STG",3),s("CTG",3),s("VTW",3),s("IME",3),s("NNS",3),s("PLW",3),s("SOC",3),s("SES",2),s("IMD",1),s("DFR",1),s("EXD",1),s("HOX",2),s("SHV",1),s("WMM",1)]},{name:"The Fun Train",factions:["T","U"],cards:[s("AMD",3),s("ATT",3),s("BWW",3),s("EFM",3),s("SPB",3),s("URB",3),s("AEC",3),s("BRN",3),s("LYS",3),s("SOV",2),s("TGL",1)]},{name:"Snouty's Sludges",factions:["N","U"],cards:[s("DYL",3),s("ODC",3),s("SOL",3),s("RSD",3),s("PVA",2),s("SFS",3),s("GRP",3),s("NCM",3),s("LBD",3),s("DYS",3),s("WGE",1)]},{name:"Metabuse",factions:["A","N"],cards:[s("POX",3),s("WMC",3),s("SEV",3),s("CKB",3),s("ARB",3),s("LLD",3),s("LLS",3),s("XDH",3),s("IME",3),s("GRM",2),s("HOX",1)]},{name:"Immortal Dino",factions:["N","U"],cards:[s("BTR",3),s("BWT",3),s("RWC",3),s("TDS",3),s("UTR",3),s("SEV",2),s("SMA",2),s("LSS",3),s("TDW",2),s("HOX",2),s("SOC",2),s("VRP",2)]},{name:"Redacted",factions:["A","U"],cards:[s("MDR",3),s("RHU",3),s("TBA",3),s("SPM",3),s("CTG",3),s("NXO",3),s("AFO",2),s("SVO",2),s("AGW",2),s("FRR",2),s("SBI",3),s("LLV",1)]},{name:"Ebonflame Thunderskull",factions:["N","T"],cards:[s("ATT",3),s("EFM",3),s("VES",3),s("ESK",3),s("BWW",3),s("SOV",3),s("NSH",3),s("DCR",2),s("SCV",2),s("DBT",2),s("IME",3)]},{name:"Binben the Math Nut",factions:["A","T"],cards:[s("BLH",3),s("KIW",3),s("GMP",3),s("SHK",3),s("OBB",3),s("BRN",3),s("STP",3),s("ESU",2),s("GOS",2),s("FLN",2),s("MTT",2),s("GCR",1)]},{name:"For Ever More the Oil's Chore",factions:["U"],cards:[s("VNS",3),s("VNF",3),s("SHS",3),s("STO",3),s("DSV",3),s("PSC",2),s("ODC",2),s("WWP",2),s("SBI",2),s("TDS",2),s("DZD",2),s("FRR",2),s("LYS",1)]},{name:"Aegis Boon",factions:["A","U"],cards:[s("AGK",3),s("ALS",3),s("BSG",3),s("IHA",3),s("NXT",3),s("OBD",3),s("FRR",3),s("DYB",2),s("WWP",3),s("SYL",2),s("TDS",2)]},{name:"Thanksgiving Dinner",factions:["N","T"],cards:[s("BTD",3),s("CSW",3),s("GBG",3),s("ICD",3),s("CDM",2),s("GGR",2),s("EFP",2),s("SOC",2),s("DCR",2),s("FSL",1),s("DRD",1),s("NCM",1),s("XSH",1),s("GRM",1),s("TBC",1),s("EXD",1),s("HGS",1)]},{name:"Warden of Ice",factions:["A","T"],cards:[s("GTT",3),s("SHK",3),s("GMP",3),s("MTT",3),s("SIX",3),s("GCR",3),s("ESU",3),s("CAG",2),s("UBL",3),s("AFO",2),s("ENP",2)]},{name:"Magmifly",factions:["T"],cards:[s("SLS",3),s("STM",3),s("LUC",3),s("POK",3),s("AWU",3),s("BTD",3),s("BMY",2),s("AGU",2),s("SWA",2),s("TST",2),s("ROK",2),s("BRN",2)]}]},Ji={name:"Fundecks 1",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[s("DFB",3),s("BSR",3),s("HGS",3),s("HFA",3),s("FFD",3),s("XSH",3),s("XHU",3),s("WBG",3),s("GBG",3),s("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[s("TBA",3),s("SVH",3),s("MBP",2),s("FSH",3),s("RBH",3),s("FBC",3),s("LBR",2),s("CFB",3),s("AAK",3),s("KKK",2),s("FRR",1),s("FIN",1),s("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[s("MMA",3),s("DMW",3),s("GMP",3),s("SYO",3),s("KAW",3),s("SHK",3),s("CTL",2),s("CAG",2),s("MSC",2),s("MTS",2),s("ASG",2),s("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[s("CTV",3),s("TDW",3),s("BTS",3),s("CHR",3),s("GMR",3),s("KOD",2),s("LKP",2),s("SHV",2),s("DBA",2),s("CCR",2),s("PTB",2),s("FIN",1),s("DBT",2)]},{name:"Voltron",factions:["A"],cards:[s("FGA",3),s("FGB",3),s("FGD",3),s("FGG",3),s("AFS",3),s("BSS",3),s("PRI",3),s("TUP",2),s("JPK",2),s("BWH",2),s("SFT",3)]},{name:"Do Fear the Reaper",factions:["A","N"],cards:[s("CTI",3),s("DFR",3),s("GRW",3),s("LGT",3),s("OXM",3),s("OXP",3),s("PHM",3),s("CTW",2),s("NNS",2),s("OXA",2),s("SDN",3)]},{name:"Muadib",factions:["N","U"],cards:[s("DBA",3),s("DYL",3),s("GSW",3),s("LBD",3),s("MMW",3),s("NCW",3),s("SRV",3),s("LBL",2),s("MSP",2),s("VYE",2),s("SBD",3)]},{name:"Triassic Park",factions:["T","U"],cards:[s("URB",3),s("UTR",3),s("UTM",3),s("ULR",3),s("UIC",3),s("UGL",3),s("RTS",3),s("BRN",2),s("LBR",2),s("IBF",2),s("GHB",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[s("DDD",3),s("WBH",3),s("HMF",3),s("WCS",3),s("GGP",3),s("SAD",3),s("SDN",3),s("EWE",3),s("SBG",3),s("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[s("WWP",3),s("EHN",2),s("SDR",2),s("HTR",2),s("MML",2),s("HTP",2),s("SHS",3),s("MND",2),s("NXC",2),s("CDT",2),s("PTB",2),s("SVO",2),s("MPH",2),s("SYO",2)]},{name:"Braaiins",factions:["N"],cards:[s("XDV",3),s("XRW",3),s("ONN",2),s("SLH",2),s("FWK",2),s("BWK",2),s("URD",2),s("TPG",2),s("DSS",2),s("KOD",2),s("ZMT",2),s("RSZ",2),s("BLW",2),s("CSB",2)]},{name:"Wanderin'",factions:["N","U"],cards:[s("LYS",3),s("STR",2),s("MBP",2),s("OSL",2),s("RLW",3),s("SSR",1),s("SVO",2),s("SSE",2),s("RHW",3),s("SYL",2),s("TGS",2),s("TMG",3),s("XDH",3)]},{name:"Walls",factions:["A","T"],cards:[s("CDC",3),s("CTG",3),s("CRC",3),s("DCS",3),s("FRI",3),s("FGA",2),s("OBB",3),s("FVA",2),s("TGN",2),s("OWH",3),s("STN",3)]},{name:"Snakes in a Lane",factions:["A","U"],cards:[s("AFO",3),s("DSV",3),s("PSC",3),s("SHS",3),s("STO",3),s("NCL",2),s("VNF",3),s("LYS",2),s("SVO",1),s("VNS",3),s("TXS",2),s("ART",2)]},{name:"Benny & Izzy",factions:["A","T"],cards:[s("BRN",3),s("EFM",2),s("IZK",3),s("JPK",1),s("MTT",1),s("NNS",1),s("OBB",2),s("OWF",2),s("OEX",3),s("PRI",2),s("PTR",1),s("TST",1),s("FLS",2),s("BLH",3),s("SHK",3)]}]},_i={name:"Fundecks 2",id:"FUN2",decks:[{name:"Ride the Lightning",factions:["T","U"],cards:[s("HOS",3),s("BLH",3),s("USS",3),s("LSK",3),s("SHK",3),s("CTL",3),s("LWY",3),s("KAW",3),s("RSP",3),s("DYB",2),s("SVO",1)]},{name:"Caught in a Web",factions:["A","N"],cards:[s("ASQ",3),s("IRT",3),s("OXA",2),s("OXM",3),s("DFS",3),s("HRM",3),s("ESD",3),s("ULG",3),s("DDS",3),s("CCS",2),s("DWW",2)]},{name:"Rando Calrissian",factions:["T","U"],cards:[s("CDM",3),s("BZS",3),s("PMI",3),s("IKA",3),s("ROE",3),s("PHC",3),s("DIS",3),s("DRE",3),s("SIV",3),s("HTP",3)]},{name:"Beards of Glory",factions:["A","U"],cards:[s("IBA",3),s("IHA",3),s("MBP",3),s("ESC",3),s("EWT",3),s("ESG",3),s("DBA",3),s("TGN",3),s("BLP",2),s("RPR",2),s("JPK",2)]},{name:"None More Verdant",factions:["U"],cards:[s("VCH",2),s("VSP",2),s("VGR",2),s("POD",2),s("MBP",2),s("EFE",3),s("VGW",3),s("WOD",1),s("SVO",1),s("RBG",3),s("RSD",3),s("SRD",2),s("ART",2),s("LYR",2)]},{name:"Exploding Cat",factions:["A","T"],cards:[s("SBF",3),s("OEX",3),s("ATI",3),s("KAW",3),s("ZSH",3),s("RSP",3),s("WMM",2),s("OWF",2),s("DFS",2),s("CHT",2),s("OBB",2),s("ABL",2)]},{name:"No, Not the Bees!",factions:["T","U"],cards:[s("LVH",3),s("HVE",3),s("SIV",3),s("TRS",3),s("KBE",3),s("SHK",3),s("LBR",3),s("RSP",3),s("VCH",2),s("VGR",2),s("CTL",2)]},{name:"Armored Column",factions:["A","U"],cards:[s("ESP",2),s("BTB",3),s("FLC",3),s("CEX",3),s("FRR",2),s("SSN",2),s("FSC",3),s("NXB",3),s("BWH",3),s("AMP",3),s("WMC",1),s("NXT",2)]},{name:"Angered Alyssa",factions:["A","T"],cards:[s("ASB",3),s("SHK",3),s("FSM",3),s("BST",3),s("SFM",3),s("BSW",3),s("VOB",3),s("TBC",3),s("SCD",3),s("MTT",2),s("ASG",1)]},{name:"Big Dawg Iniog",factions:["N","U"],cards:[s("ICD",3),s("DHC",3),s("ZDK",3),s("CCS",2),s("NCM",3),s("VCH",2),s("HTR",2),s("IRT",3),s("NGT",3),s("ROU",2),s("TOB",2),s("SPG",2)]},{name:"Rumblestone Clown Show",factions:["A","T"],cards:[s("RSE",3),s("OWF",3),s("AGP",3),s("DFS",3),s("FSM",3),s("IBF",3),s("TST",3),s("BWN",2),s("DKS",2),s("CHT",2),s("COD",1),s("LFA",2)]},{name:"Kills Bugs Dead",factions:["T","U"],cards:[s("TSP",3),s("SMS",3),s("BTD",3),s("HMO",3),s("QSW",3),s("UTR",3),s("VTR",3),s("GHB",3),s("STM",3),s("DKS",2),s("VCH",1)]},{name:"Aeon Buzzard",factions:["A","T"],cards:[s("EPH",3),s("BWN",3),s("TBB",3),s("CDM",2),s("SAD",3),s("LCE",2),s("MBR",3),s("COD",1),s("MMR",3),s("MMX",3),s("BZH",2),s("STD",2)]},{name:"Unholy Matrimony",factions:["N"],cards:[s("DFB",3),s("BOF",3),s("CGL",3),s("SGF",2),s("POX",3),s("ULG",3),s("IME",3),s("SHG",2),s("IRT",2),s("SHV",3),s("DRD",3)]},{name:"Dance of the Dryads",factions:["T","U"],cards:[s("NGQ",2),s("HOS",3),s("SDR",3),s("LBD",3),s("KTS",3),s("MPH",3),s("SSR",3),s("PYS",2),s("SVO",2),s("SBD",2),s("DYB",2),s("SND",2)]}]},tr={name:"Fundecks 3",id:"FUN3",decks:[{name:"Ashy Larry",factions:["A","T"],cards:[s("AMD",3),s("LFA",3),s("SSI",3),s("SAD",3),s("HMF",3),s("AMY",3),s("ABR",2),s("UEM",2),s("WFM",2),s("DCS",2),s("PHM",2),s("OBB",2)]},{name:"Wander These Lands",factions:["N","U"],cards:[s("LYS",3),s("CYW",1),s("RTW",3),s("RLW",3),s("SVO",2),s("DYS",2),s("RHW",3),s("GHB",2),s("ROU",2),s("IME",3),s("VCH",1),s("ULG",3),s("AEC",2)]},{name:"Blob Convention",factions:["A","N"],cards:[s("S01",3),s("NCM",3),s("NCS",3),s("CYS",3),s("FSL",3),s("NCP",3),s("NOZ",3),s("SLH",3),s("GRP",2),s("SHV",2),s("GRM",2)]},{name:"We Shall Not Cease",factions:["N","T"],cards:[s("CGG",3),s("FSM",3),s("EXD",3),s("GRP",3),s("SHV",3),s("HOX",2),s("SCV",1),s("VYE",3),s("COD",1),s("DCR",2),s("BRN",2),s("DBT",2),s("TOB",1),s("VOB",1)]},{name:"What Tek Iz This?",factions:["T","U"],cards:[s("IZK",3),s("VIC",3),s("IGR",3),s("SSH",3),s("DGW",3),s("BRN",3),s("LYS",3),s("ROK",3),s("DDF",3),s("EWV",3)]},{name:"Tromping Tuskins",factions:["A","U"],cards:[s("LBC",3),s("LBL",3),s("CTV",3),s("TGK",3),s("EWT",3),s("NFF",2),s("TSL",2),s("CSG",2),s("VPR",2),s("MXW",2),s("AOP",2),s("HRM",2),s("ESC",1)]},{name:"Enhanced Voltron",factions:["A"],cards:[s("FGA",3),s("FGB",3),s("FGD",3),s("FGG",3),s("SFG",3),s("GAS",3),s("WTK",3),s("MMG",3),s("HRM",3),s("LCE",2),s("PLW",1)]},{name:"Lazarus (Big Skills)",factions:["N","T"],cards:[s("TDW",3),s("NSH",3),s("PHC",3),s("PSH",3),s("IME",3),s("ULG",3),s("SHG",3),s("VIK",3),s("IDF",2),s("GRP",2),s("ASG",1),s("COD",1)]},{name:"Dogs! Dogs! Dogs!",factions:["T","U"],cards:[s("LTU",3),s("SDA",3),s("EHN",3),s("EWV",3),s("HTP",2),s("DYB",2),s("SVO",1),s("VCH",1),s("WHR",3),s("MMH",2),s("DBR",2),s("SIN",2),s("PYS",1),s("VTR",2)]},{name:"The Cackler",factions:["A","N"],cards:[s("CKB",3),s("ARB",3),s("GMP",3),s("LCE",2),s("PRI",2),s("RPR",3),s("DPO",3),s("SAP",3),s("DDS",3),s("OXP",3),s("ABE",2)]},{name:"Nugalug",factions:["N","T"],cards:[s("NUG",3),s("LUC",3),s("EWE",3),s("SBG",3),s("AWU",3),s("SPH",3),s("ROU",3),s("FFM",3),s("BZD",3),s("BFM",3)]},{name:"Blessed Shrine",factions:["A","T"],cards:[s("SLS",3),s("CTG",3),s("USS",3),s("MMG",3),s("CRC",3),s("STN",3),s("NXC",3),s("MND",2),s("SSD",2),s("USA",2),s("SES",1),s("OBB",2)]},{name:"The Dixie Pig",factions:["T","U"],cards:[s("SSD",3),s("WSE",3),s("NCL",3),s("STN",3),s("PYS",3),s("BSW",3),s("FKS",3),s("UCM",2),s("UHS",2),s("HTR",2),s("TBC",2),s("GHS",1)]},{name:"Wafer Thin Mint",factions:["N","T"],cards:[s("LFA",2),s("EXD",3),s("GBG",3),s("USA",3),s("PMS",3),s("STN",1),s("VOB",1),s("FSK",3),s("WFM",3),s("FFS",3),s("TBC",2),s("FOR",3)]},{name:"Cyrus the Virus",factions:["N","U"],cards:[s("CTM",3),s("PTB",3),s("POT",3),s("GRM",3),s("MNM",3),s("LMD",3),s("MPH",3),s("SOC",3),s("SRP",3),s("HGS",3)]}]},er={name:"Fundecks 4",id:"FUN4",decks:[{name:"Pain Forest",factions:["T","U"],cards:[s("TDS",3),s("TMS",3),s("DTR",3),s("HTR",3),s("EFE",3),s("SFM",3),s("SHK",3),s("VCH",2),s("BSW",2),s("UCM",2),s("MSP",1),s("VSP",1),s("IBF",1)]},{name:"Disrespect the Weak",factions:["A","N"],cards:[s("UIW",3),s("SRM",3),s("OXP",3),s("OXM",3),s("SRP",3),s("WFS",2),s("GRW",2),s("DGZ",2),s("VPR",2),s("DDS",2),s("PHM",2),s("OFM",2),s("LMV",1)]},{name:"I Love the Dead",factions:["N","U"],cards:[s("YNS",3),s("NSW",3),s("STS",2),s("SIV",2),s("SLH",3),s("CCR",3),s("GGW",3),s("REW",3),s("SST",2),s("MML",2),s("DYS",2),s("TPT",2)]},{name:"Silly Ol' Steelscale",factions:["A","T"],cards:[s("STG",3),s("DGW",3),s("FKS",3),s("FSK",3),s("USA",3),s("CEX",3),s("OBB",3),s("BWH",2),s("DRE",1),s("FVA",1),s("AGW",2),s("SOK",2),s("NNS",1)]},{name:"Poison Crush",factions:["T","U"],cards:[s("WBY",3),s("LOD",3),s("SPT",3),s("VND",3),s("DPG",3),s("FZS",3),s("GCR",3),s("UBL",2),s("MPH",3),s("FKS",2),s("STB",2)]},{name:"Dragons, Eh",factions:["N","T"],cards:[s("DGW",3),s("SMD",3),s("ATI",3),s("LMD",3),s("DDD",3),s("CSW",3),s("DTD",3),s("VIC",3),s("BTD",3),s("SOV",3)]},{name:"Hail Hydra",factions:["A","U"],cards:[s("ESG",3),s("DBA",3),s("CHY",3),s("LHY",3),s("RHY",3),s("SVH",3),s("SVO",2),s("EVT",3),s("AEC",2),s("AGW",2),s("SPG",1),s("VCH",2)]},{name:"Coral, Get to the Sides!",factions:["N"],cards:[s("IRT",3),s("IVS",3),s("ZMT",3),s("ZDK",3),s("XDV",3),s("TNL",3),s("ABB",3),s("SNT",3),s("XRW",3),s("CCC",3)]},{name:"The Bear and the Maiden Fair",factions:["T","U"],cards:[s("DZD",3),s("FWB",3),s("DBR",3),s("FFM",3),s("AMD",3),s("WFM",3),s("SHK",3),s("SIV",3),s("AIV",2),s("NCL",2),s("SOV",1),s("EFA",1)]},{name:"Bionic Darkforged",factions:["A","U"],cards:[s("SWS",3),s("DSE",3),s("DRS",3),s("SSP",3),s("DHM",3),s("SHA",3),s("ESC",3),s("LBD",3),s("AGP",2),s("CTV",2),s("SVO",1),s("NNS",1)]},{name:"Caustic Darkforged",factions:["N","T"],cards:[s("DSW",3),s("GGB",3),s("SFE",3),s("DSA",3),s("SCZ",3),s("USY",3),s("ZXR",3),s("SPH",3),s("BZH",2),s("IBF",1),s("VGL",2),s("CYW",1)]},{name:"Thralled Darkforged",factions:["A","N"],cards:[s("SWS",3),s("GGB",3),s("DSW",3),s("DSE",3),s("SCZ",3),s("SHA",3),s("PSH",3),s("STD",3),s("DDS",2),s("AOP",1),s("BFT",2),s("TPT",1)]},{name:"Roasted Darkforged",factions:["T","U"],cards:[s("DSA",3),s("DRS",3),s("SFE",3),s("SSP",3),s("DHM",3),s("USY",3),s("CDM",3),s("GHR",3),s("MPH",2),s("ENR",1),s("PYS",2),s("STB",1)]},{name:"Punchy Darkforged",factions:["A","T"],cards:[s("SWS",3),s("DSE",3),s("SFE",3),s("DSA",3),s("SHA",3),s("USY",3),s("WMR",3),s("AMD",3),s("OWF",2),s("SOA",1),s("UBL",2),s("SOK",1)]},{name:"Mouldy Darkforged",factions:["N","U"],cards:[s("DSW",3),s("GGB",3),s("DRS",3),s("SSP",3),s("DHM",3),s("SCZ",3),s("DBA",3),s("GGW",3),s("ROG",2),s("SIN",2),s("SLH",1),s("DYB",1)]}]},He=[Yi,zi,Zi,Ki,Xi,ji,qi,Qi,Ji,_i,tr,er];He.forEach(o=>{o.decks.forEach(t=>{t.cards.map(i=>i.num).reduce((i,r)=>i+r,0)!==30&&console.warn("Pre-con deck with not 30 cards: "+o.name+" -- "+t.name)})});const xt=()=>{p.dirt()};class je{state;constructor(t){this.state=t}getState(){return this.state}get adjacent(){return p.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,xt()}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){const i=this.state;i.breakthrough=t,xt(),K.addFactBoard("U",i.id,i.lane,i.owner)}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,xt()}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,xt(),this.enforceEffects("DF",this.owner))}get effects(){return this.state.effects}get extraBattles(){return this.state.extraBattles}set extraBattles(t){this.state.extraBattles=t}get faction(){return W.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 W.getCard(this.code).isTribe(t)}get lane(){return this.state.lane}get level(){return this.state.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){const i=this.state;i.negateArmor=t,xt(),this.enforceEffects("AR"),K.addFactBoard("U",i.id,i.lane,i.owner)}get negateDefender(){return this.state.negateDefender||this.modBool("ND")}negDefend(t){const i=this.state;i.negateDefender||(i.negateDefender=!0,xt(),this.enforceEffects("DF",this.owner),K.addFactBoard(t,i.id,i.lane,i.owner))}get negateMobility(){return this.state.negateMobility||this.modBool("NM")}set negateMobility(t){const i=this.state;i.negateMobility=t,xt(),K.addFactBoard("U",i.id,i.lane,i.owner)}get negateRegen(){return this.state.negateRegen}set negateRegen(t){this.state.negateRegen=t,xt()}get opposed(){return p.searchByLane(p.oppositeLane(this.lane),!this.owner)}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,i,r,a=void 0){this.state.status==="A"&&(t!==0&&(this.state.attack+=t,this.enforceEffects("AT"),xt()),i!==0&&(this.state.health+=i,this.state.maxHealth+=i,this.enforceEffects("CH"),Bt.deathProdder(this,a),xt(),i>0&&x.addEvents(I.creatHeal(this,i))),K.addFactBoard(r,this.id,this.lane,this.owner))}addArmor(t){if(!this.negateArmor&&this.state.status==="A"){const i=this.state.armor+t;this.state.armor=Math.max(0,i),this.enforceEffects("AR"),xt(),K.addFactBoard("A",this.id,this.lane,this.owner)}}addMobility(t,i){if(!this.negateMobility&&this.state.status==="A"){const r=this.state.mobility+t;this.state.mobility=Math.max(0,r),xt(),K.addFactBoard(i,this.id,this.lane,this.owner)}}addPoison(t){if(this.state.status==="A"){const i=this.state.poison+t;this.state.poison=Math.max(0,i),xt(),K.addFactBoard("U",this.id,this.lane,this.owner)}}addRegen(t,i){if(!this.negateRegen&&this.state.status==="A"){const r=this.state.regen+t;this.state.regen=Math.max(0,r),xt(),K.addFactBoard(i,this.id,this.lane,this.owner)}}heal(t,i=!0){if(t<1||this.state.status!=="A")return 0;const r=Math.min(this.health+t,this.maxHealth)-this.health;return r<1?0:(this.state.health+=r,xt(),this.enforceEffects("CH"),x.addEvents(I.creatHeal(this,r)),i&&K.addFactBoard("U",this.id,this.lane,this.owner),r)}setHealth(t){this.state.health=t,xt()}hurt(t,i=!1){if(t<1)return[0,0];const r=Math.max(Math.min(t,this.armor-this.armorDmg),0);let a=t-r,c=this.health-a;this.state.armorDmg+=r;let f=0;return i&&c<0&&(f=a-this.health,a=this.health),a>0&&(xt(),this.state.health-=a,this.enforceEffects("CH")),[a,f]}hurtBattle(t,i,r=!1){const a=this.hurt(t,r);return a[0]>0&&x.addEvents(I.damage(!0,a[0],this.health,!0,!0,this,i)),a[1]}hurtDirect(t,i,r,a=void 0){const c=this.hurt(t,!1);return c[0]>0&&(y.lawg(i,` dealt ${t} dmg to `,this.code,"."),K.addFactBoard(r,this.id,this.lane,this.owner),x.addEvents(I.damage(!1,c[0],this.health,!1,!0,this,void 0)),Bt.deathProdder(this,a)),c[0]}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),Bt.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF",this.owner)}modSum(t){return b.modSum(this.mods,t)}modBool(t){return b.modBool(this.mods,t)}hasMod(t){return b.hasModG(this.mods,t)}addMod(t,i){this.mods.push(t),this.modEffectPropagator(t),xt(),t.type!=="MH"&&K.addFactBoard(i,this.id,this.lane,this.owner)}anim8(t){K.addFactBoard(t,this.id,this.lane,this.owner)}addModSafe(t){b.hasMod(this.mods,t)||this.addMod(t,"X")}removeMod(t,i=!0){const r=this.state.mods.filter(a=>a.granter===t);r.length>0&&(xt(),this.state.mods=this.state.mods.filter(a=>a.granter!==t),r.forEach(a=>{i&&this.modEffectPropagator(a),a.type==="AR"&&(this.state.armorDmg=Math.max(0,this.state.armorDmg-a.value))}))}removeModSafe(t,i=!0){this.hasMod(t)&&this.removeMod(t,i)}expireMod(t){this.state.mods.splice(b.modIdx(this.state.mods,t),1)}bonusTotal(){let t=ft.sumNuggets(this.triggers);return this.state.bonus&&(t=ft.addNuggets(t,this.state.bonus)),t}threatTotal(){const t=this.triggers.map(i=>i.bonus?.threat).filter(Boolean);return this.state.bonus?.threat&&t.push(this.state.bonus.threat),t}endActivation(){this.modBool("EA")?this.removeMod(this.id):this.state.activationAvailable=!1,Bt.deathCheck(),T.actionDone()}move(t,i){this.state.status==="A"&&(K.addFactBoard(i,this.id,this.lane,this.owner),K.addLaneMove(this.id,this.lane,t,this.owner),xt(),this.state.lane=t,Be.positionChange(this.owner),x.addEvents(I.creature("MOV",this)))}addEffect(t,i){const r=b.effect(t,i);return this.effects.push(r),r}enforceEffects(t,i=!1){this.effects.filter(r=>r.watch===t).filter(r=>r.area==="A"||r.area==="C"&&this.owner===i).forEach(r=>W.getCard(r.logicCode).enforceEffect(this))}jr4(t,i=""){i===""&&(i=this.code);const r=b.trigger(t,i);return r.creatId=this.id,this.triggers.push(r),xt(),r}removeTrigger(t){const i=b.trigIdx(this.triggers,t);i>-1?(this.triggers.splice(i,1),t.changes&&xt()):console.error("Wery curious, could not find trigger to remove",t)}wipeAll(){this.preWipe();const t=this.state;t.hints=[],t.armor=0,t.mobility=0,t.poison=0,t.regen=0,t.aggressive=!1,t.defender=!1,t.breakthrough=!1,t.defender=!1,t.negateDefender=!1,t.negateArmor=!1,t.bonus=void 0,t.changed=!0,t.negateActivate=!0,k.removeModSafe(!0,t.id),k.removeModSafe(!1,t.id),p.creatByTarget(b.crTarg()).forEach(i=>{i.removeModSafe(t.id),i.enforceEffects("PS",t.owner)}),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),Be.defenderChange(t.owner),this.anim8("A"),xt()}preWipe(){this.state.mods=[],this.state.triggers=[],this.state.effects=[]}get hints(){return this.state.hints}aiHints(){return this.hints}}class b{static creatureState(t,i){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,bonus:void 0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:i,level:0,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,i){return{area:"A",watch:t,logicCode:i}}static freeCard(t){return{id:E.genId(),condition:b.target("TH"),sourceCard:t}}static mod(t,i,r=""){return{type:t,value:typeof i=="boolean"?i?1:0:i,granter:r,expiry:"NN"}}static modT(t,i,r=""){const a=b.mod(t,i,r);return a.expiry="ET",a}static trigger(t,i){return{id:E.genId(),type:t,logicCode:i,creatId:"",customCode:"",interactive:!1,changes:!1,bonus:void 0,batch:!1}}static triggerReaction(t,i,r,a){return{event:t,owner:r,creatId:"",cardCode:"",trigger:i,host:a,draw:!0}}static basicAction(t){return{zone:"N",key:t,host:"",param:""}}static fieldSelectAction(t,i=-1,r=!0){return{zone:"F",key:t,playerA:r,lane:i,host:"",param:""}}static deckSelectAction(t,i,r){return{zone:"N",key:t,card:i,position:r,host:"",param:""}}static handSelectAction(t,i="",r="",a=-1){return{zone:"H",key:t,card:i,cost:r,position:a,host:"",param:"",canPlay:!1,lvlOnly:!1}}static playerSelectAction(t,i){return{zone:"P",key:t,playerA:i,host:"",param:""}}static draftSelectAction(t,i,r){return{zone:"N",key:t,index:i,pack:r,host:"",param:""}}static menuButtonAction(t){return{zone:"N",key:"MNBT",host:"",param:t}}static actionifier(t,i,r,a){const c=t;return c.key=i,c.host=r,c.param=a,c}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,i,r,a){return b.actionifier(b.target(t),i,r,a)}static crTarg(){const t=b.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,i,r){return b.actionifier(b.crTarg(),t,i,r)}static crNotMeTarg(t){const i=b.target("TF");return i.field="O",i.creatStatus="V",i.notMe=t,i}static crNotMeActTarg(t,i,r,a){return b.actionifier(b.crNotMeTarg(i),t,r,a)}static crFriendTarg(){const t=b.crTarg();return t.player="F",t}static crFriendActTarg(t,i,r){return b.actionifier(b.crFriendTarg(),t,i,r)}static crFriendNotMeTarg(t){const i=b.crNotMeTarg(t);return i.player="F",i}static crFriendNotMeActTarg(t,i,r,a){return b.actionifier(b.crFriendNotMeTarg(i),t,r,a)}static crEnemyTarg(){const t=b.crTarg();return t.player="E",t}static crEnemyActTarg(t,i,r){return b.actionifier(b.crEnemyTarg(),t,i,r)}static playerTarg(t){const i=b.target("TP");return i.player=k.toTarget(t),i}static playerActTarg(t,i,r,a){return b.actionifier(b.playerTarg(t),i,r,a)}static lvlHandActTarg(t,i){const r=this.actionTarget("TH","CARD",t,i);return r.player="F",r.canLevel=!0,r.hint=["CD"],r}static emptyTarg(){const t=b.target("TF");return t.field="E",t}static emptyActTarg(t,i,r){return b.actionifier(b.emptyTarg(),t,i,r)}static emptyPlayerTarg(t){const i=b.emptyTarg();return i.player=k.toTarget(t),i}static emptyPlayerActTarg(t,i,r,a){return b.actionifier(b.emptyPlayerTarg(t),i,r,a)}static modSum(t,i){return t.filter(r=>r.type===i).map(r=>r.value).reduce((r,a)=>r+a,0)}static modBool(t,i){return t.some(r=>r.type===i&&r.value===1)}static hasModG(t,i){return t.findIndex(r=>r.granter===i)>-1}static hasMod(t,i){return b.modIdx(t,i)>-1}static modIdx(t,i){return t.findIndex(r=>r.granter===i.granter&&r.type===i.type)}static trigIdx(t,i){return t.findIndex(r=>r.id===i.id)}}class Wt{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return Wt.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,i){return`card/${i?"b":"s"}/${this.faction}/${t}.jpg`}free=!1;level;maxLevel=3;minLevel=1;name="";overload=!1;rarity="T";spice;text="";get type(){return "C"}hints;addSp(t,i){}aiHints(){return this.hints??[]}canLevel(){return this.level{c+=a[m]*r[0][m],f+=a[m]*r[1][m]}),[c,f]}rawNug(t,i,r,a,c=0,f=void 0){return ft.rawNugget(t,i,r,a,c,f)}buffNug(t,i,r=void 0){return this.rawNug(0,i+t,t,0,0,r)}playerNug(t,i=void 0){return this.rawNug(0,0,0,t,0,i)}spawnNug(t,i=void 0){const r=ft.cardCreatValueFormula(t);return this.rawNug(1,r,t.iAttack,0,0,i)}statSpawnNug(t,i,r=void 0){const a=this.buffNug(t,i,r);return a.count=1,a}avgSpawnNug(t){const i=this.avgCreatureStats(t);return this.statSpawnNug(i[0],i[1])}regnNug(t,i=void 0){return this.rawNug(0,ft.calcCreatValueFormula(0,0,0,0,t,!1,0),0,0,0,i)}multNug(t,i){return t.attack*=i,t.value*=i,t.count*=i,t.pHealth*=i,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 Wt{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,i){const r=b.creatureState(t,i);return r.id=E.genId(),r.code=this.code,r.level=this.level,r.health=this.iHealth,r.attack=this.iAttack,r.maxHealth=r.health,r.regen=this.iRegen,r.breakthrough=this.iBT,r.defender=this.iDefend,r.aggressive=this.iAggro,r.armor=this.iArmor,r.mobility=this.iMobile,r.hints=this.aiHints(),r.bonus=this.bonus,new je(r)}playTargets(){const t=b.actionTarget("TF","FORG",this.code,"");return t.player="F",[t]}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}get formation(){return!1}addExtraActivate(t){t.addMod(b.modT("EA",!0,t.id),"X")}}class vt extends Wt{constructor(t){super(t)}get type(){return "S"}logSpell(t=void 0,i=void 0){if(st.simOn)return;const r=["Casted ",this.code];t&&(r.push(" on ",t.code),i&&r.push(" and ",i.code)),r.push("."),y.lawg(...r)}}class Te{paStats;pbStats;constructor(t,i){this.paStats=t,this.pbStats=i}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const i=this.playerStats(t),r=this.playerStats(!t);return Te.deltafier(i,r)}static deltafier(t,i){const r=Te.blankStats(!0);return r.creatCount=t.creatCount-i.creatCount,r.creatValue=t.creatValue-i.creatValue,r.threatValue=t.threatValue-i.threatValue,r.playerHealth=t.playerHealth-i.playerHealth,r.bonus=t.bonus-i.bonus,r}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0,bonus:0}}}class ft{static dcWeight=.4;fromState(t=!1){const i=p.qActiveCreats(),a=[!0,!1].map(c=>{const f=Te.blankStats(c),m=k.toPlayer(c);f.playerHealth=ft.playerFormula(m.health,k.totalArmor(m),k.totalPoison(m),m.effects.length);const C=ft.sumNuggets(m.triggers);f.playerHealth+=C.pHealth,f.creatCount=C.count,f.creatValue=C.value,f.threatValue=C.attack,f.bonus=C.bonus;const D=i.filter(B=>B.owner===c);return D.forEach(B=>{const G=B.bonusTotal();f.playerHealth+=G.pHealth,f.bonus+=G.bonus,f.creatCount+=1+G.count,f.creatValue+=ft.creatValueFormula(B)+G.value,f.threatValue+=ft.threatFormula(B,i)+G.attack}),t&&c&&(D.forEach(B=>{f.bonus+=ft.threatEOT(B,m.turn,i)}),L.regularPlays>2&&(f.bonus+=(L.regularPlays-2)*(Math.min(m.rank,3)*2))),f});return new Te(a[0],a[1])}static ddp9(t,i,r,a,c=0){const f=t/4,m=i/10,C=r/12,D=a/8;return f+m+C+D+c}static creatValueFormula(t){return ft.calcCreatValueFormula(t.attack,t.health,t.armor,t.mobility,t.regen,t.breakthrough,t.poison)}static cardCreatValueFormula(t){return ft.calcCreatValueFormula(t.iAttack,t.iHealth,t.iArmor,t.iMobile,t.iRegen,t.iBT,0)}static calcCreatValueFormula(t,i,r,a,c,f,m){const C=f?1:0;return i+Math.max(0,t)+(r+Math.min(a,3)+C+c-m)*1.5}static playerFormula(t,i,r,a){return t+(i-r)*2+a*4}static threatFormula(t,i){let r=0,a=0;if(t.defender)r=t.attack;else{const c=ft.oppFinder(t,i);c?(t.breakthrough&&(a=Math.max(t.attack-c.health,0)),r=t.attack-a):a=t.attack,a>0&&(a+=ft.scalingBonus(a))}return Math.max(r,0)+Math.max(a,0)}static threatEOT(t,i,r){let a=0;return t.threatTotal().forEach(f=>{f==="TP"?t.attack>0&&S.isUn(ft.oppFinder(t,r))&&(t.defender?a+=t.level/2:a+=t.level):f==="TS"?a+=t.level*2*(t.health/(t.maxHealth||1)):f==="TX"||f==="TW"?a+=t.level*(f==="TX"?1.5:.5):f==="TH"&&i>1?a+=t.level*(i/4):f==="TL"&&i===4&&(a-=t.level)}),a}static oppFinder(t,i){const r=6-t.lane;return i.find(a=>a.owner!==t.owner&&a.lane===r)}static rawNugget(t,i,r,a,c=0,f=void 0){return{count:t,value:i,attack:r,pHealth:a,bonus:c,threat:f}}static addNuggets(t,i){return ft.rawNugget(t.count+i.count,t.value+i.value,t.attack+i.attack,t.pHealth+i.pHealth,t.bonus+i.bonus)}static sumNuggets(t){let i=ft.rawNugget(0,0,0,0,0);return t.forEach(r=>{r.bonus&&(i=ft.addNuggets(i,r.bonus))}),i}static scalingBonus(t){let i=7;if(t<=i)return 0;let r=!0,a=0,c=1;const f=7;for(;r;)t>i+f?(a+=c*f,i+=f,c++):(a+=c*(t-i),r=!1);return a}weighState(t,i,r){const a=t.deltaStats(r),c=i.deltaStats(r),f=Te.deltafier(c,a),m=f.playerHealth<0?-1:1,C=ft.scalingBonus(f.playerHealth*m)*m+f.playerHealth;return ft.ddp9(f.creatCount,f.creatValue,f.threatValue,C,f.bonus)}}class ir{aiPlayer;constructor(t){this.aiPlayer=t}jr7(t,i=3){return`${t}${i}`}jr6(t,i){const r=S.randInt(0,i.length),a=i[r];return i.splice(r,1),p.birth(t,"F",this.aiPlayer,a,"X")}cheatin(){const t=k.toPlayer(this.aiPlayer),i=k.toPlayer(!this.aiPlayer),r=i.health-t.health;let a=0;r>85?a=3:r>65?a=2:r>45&&(a=1);const c=p.emptyLanes(this.aiPlayer);if(a===0||c.length===0)return!1;y.lawg(this.aiPlayer," is a cheaty cheaterton.");let f=0;if(a===1){if(L.regularPlays-=1,f=S.randInt(0,13),f===0)this.jr6(this.jr7("HTR"),c);else if(f===1)this.jr6(this.jr7("AGM"),c).addRegen(8,"T");else if(f===2){const m=this.jr6(this.jr7("YNS"),c);m.buff(0,15,"N"),m.addRegen(4,"N")}else if(f===3)this.jr6(this.jr7("TBA"),c);else if(f===4)this.jr6(this.jr7("DCS"),c);else if(f===5)this.jr6(this.jr7("GGP"),c).addRegen(8,"N");else if(f===6){const m=this.jr6(this.jr7("WFM"),c);m.aggressive=!0}else if(f===7){const m=this.jr6(this.jr7("FFU"),c);m.aggressive=!0}else if(f===8){const m=this.jr6(this.jr7("URB"),c);m.aggressive=!0}else if(f===9){const m=this.jr6(this.jr7("KOD"),c);m.aggressive=!0,m.addRegen(6,"N")}else if(f===10)this.jr6(this.jr7("AGK"),c).addArmor(3);else if(f===11){const m=this.jr6(this.jr7("PSC"),c);m.aggressive=!0}else if(f===12){const m=this.jr6(this.jr7("SAD"),c);m.aggressive=!0}}else if(a===2)if(L.regularPlays-=1,f=S.randInt(0,17),f===0){const m=this.jr6(this.jr7("NDR"),c);m.aggressive=!0}else if(f===1){const m=this.jr6(this.jr7("CSW"),c);m.aggressive=!0}else if(f===2)this.jr6(this.jr7("GGD"),c).addRegen(6,"N");else if(f===3)this.jr6(this.jr7("EFP"),c);else if(f===4)this.jr6(this.jr7("ZTU"),c);else if(f===5){const m=this.jr6(this.jr7("DDD"),c);m.aggressive=!0}else if(f===6)this.jr6(this.jr7("RBH"),c).addRegen(8,"T");else if(f===7)this.jr6(this.jr7("SFT"),c);else if(f===8)this.jr6(this.jr7("GTT"),c);else if(f===9)this.jr6(this.jr7("SMD"),c);else if(c.length===5)this.jr6(this.jr7("DFB"),c),[1,2,3,4].forEach(m=>this.jr6(this.jr7("XHS"),c));else if(c.length===4)this.jr6(this.jr7("LMV"),c);else if(c.length===3)this.jr6(this.jr7("LHY"),c),this.jr6(this.jr7("SVH"),c),this.jr6(this.jr7("DBA"),c);else if(c.length===2)this.jr6(this.jr7("UTR"),c),this.jr6(this.jr7("TDS"),c);else if(t.turn===4)this.jr6(this.jr7("SSR"),c);else if(t.turn===1)this.jr6(this.jr7("ESK"),c);else{const m=this.jr6(this.jr7("XSH"),c);m.aggressive=!0}else if(a===3)if(f=S.randInt(0,20),f===0){const m=this.jr6(this.jr7("IHA",4),c);m.aggressive=!0}else if(f===1)this.jr6(this.jr7("CHR"),c);else if(f===2)this.jr6(this.jr7("FGO",1),c);else if(f===3)this.jr6(this.jr7("CHV",4),c);else if(f===4)this.jr6(this.jr7("KKK",4),c);else if(t.health<20){const m=this.jr6(this.jr7("ODC",4),c);m.aggressive=!0}else if(c.length===5){const m=S.randInt(0,4);if(m===0)[1,2,3,4,5].forEach(C=>this.jr6(this.jr7("UWL",2),c));else if(m===1)[1,2].forEach(C=>this.jr6(this.jr7("DFB"),c)),[1,2,3].forEach(C=>this.jr6(this.jr7("FFD"),c));else if(m===2)[1,2,3,4,5].forEach(C=>this.jr6(this.jr7("BWK"),c));else if(m===3){this.jr6(this.jr7("SBG"),c),this.jr6(this.jr7("EWE"),c);const C=this.jr6(this.jr7("BMY"),c);C.defender=!0,C.aggressive=!0}}else if(i.health>350)t.health<180&&(k.heal(t,180-t.health,"POZ1"),K.addHeal(t.isPlayerA)),this.jr6(this.jr7("AGD"),c);else if(i.health>250)this.jr6(this.jr7("FGO"),c);else if(c.length===4){const m=S.randInt(0,3);m===0?(this.jr6(this.jr7("AGK"),c),[1,2,3].forEach(C=>this.jr6(this.jr7("VBK"),c))):m===1?(this.jr6(this.jr7("TDS"),c),this.jr6(this.jr7("TDS"),c),this.jr6(this.jr7("UTR"),c)):m===2&&[1,2,3,4].forEach(C=>this.jr6(this.jr7("CDC"),c))}else if(c.length===3)if(S.randInt(0,2)){this.jr6(this.jr7("SDR"),c),this.jr6(this.jr7("SDR"),c);const m=this.jr6(this.jr7("UPM"),c);m.aggressive=!0}else{this.jr6(this.jr7("SDL"),c);const m=this.jr6(this.jr7("NFF"),c);m.aggressive=!0}else if(c.length===2)this.jr6(this.jr7("SPM"),c),this.jr6(this.jr7("SPM"),c);else{const m=this.jr6(this.jr7("NXC"),c);m.buff(10,0,"A"),m.aggressive=!0,m.addMobility(2,"A"),m.addRegen(5,"A")}return t.health<30&&(k.heal(t,50-t.health,"POZ1"),K.addHeal(t.isPlayerA)),!0}}var nt=(o=>(o[o.Left=0]="Left",o[o.Both=1]="Both",o[o.Right=2]="Right",o[o.ForceRight=3]="ForceRight",o))(nt||{});class ci{action;hitTest(t,i,r){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,i,r,a){let c,f=0;const m=t.length;for(;c===void 0&&f=t&&this.originY<=i&&this.endY>=i?this.action:void 0}}const rr={zone:"N",key:"BNDL",host:"",param:""};class Xt extends ht{constructor(t,i,r,a,c=0){super(rr,t,i,r,a,c)}static fromBox(t,i=0){return new Xt(t[0],t[1],t[2],t[3],i)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,i,r){if(super.hitTest(t,i,r))return ci.arrayHit(this.childs,t,i,r)}}class Re{realPromise;resolveMe(t){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,i)=>{this.resolveMe=t,this.rejectMe=i})}}const ui=25,di=9999,sr=-9999,ar=-999999,nr=["CANC","DEET","SCRH"],or=["HPLY","ACTV","MOVE"];class hr{dumb=!1;inPhase=!0;log=!1;simOff=!0;simOn=!1;boulos(t){this.simOff=!t,this.simOn=t}promStack=[];peekStack=[];peeking=!1;slowpoke=0;endCount=0;aiPlayer=!1;brdEval;rootBoardStats;turnSims=0;turnTime=0;kickOut=!1;kickTimer=0;constructor(){this.brdEval=new ft,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&&L.mainBattle&&(this.inPhase=!1)}simEndpoint(t){if(this.endCount++,this.promStack.length===0)y.debug("Tried to end a sim, but no promise to unlock."),console.trace();else{let i;if(t==="T"){const r=this.brdEval.fromState(!0);i=this.brdEval.weighState(this.rootBoardStats,r,this.aiPlayer)}else t==="W"?i=di:t==="L"?i=sr:i=ar;this.popProm(i)}}async processAction(t,i,r=!1){const a=this.simOff;let c=0,f=this.actionPruner(t);if(f=this.noHandDoubles(f),this.peeking){this.popPeeker(f);return}if(a&&this.dumb&&i&&(this.dumb=!1,y.debug("Smart Again.",!1)),this.dumb&&!this.inPhase){let B=f.filter(G=>G.key==="FITE"||G.key==="ENDT");B.length>0&&(f=B)}if(a){Ct.hwhipe();const B=f.map((q,pt)=>Ct.drawAiGear(pt,!1));await Promise.all(B),await $e.drawActions([]),await S.sleep(ui),this.kickOut=!1,this.boulos(!0),this.slowpoke=Date.now(),this.rootBoardStats=this.brdEval.fromState(),this.endCount=0;const G=await this.peeker(f),R=[];let X=0,V=0,tt=[];G.forEach(q=>{X+=q.peek.length,q.free&&(q.free==="FREE"?V++:tt.includes(q.free)||(V++,tt.push(q.free))),q.wasPeek&&q.peek.some(pt=>this.hasHint(pt,"DF"))&&R.push(q.root)}),R.length>0?(f=R,this.dumb=!0,y.debug("Do firsts; dumb mode. Action count "+f.length,!1)):r?(this.dumb=!0,y.debug("Forced dumb mode.",!1)):L.regularPlays+V>3?(this.dumb=!0,y.debug("4+ plays; dumb mode. Peek was "+X,!1)):k.getActive().hand.length>7?(this.dumb=!0,y.debug("8+ in hand; dumb mode. Peek was "+X,!1)):X>29&&S.options.debug&&this.peekerReport(G)}if(f.length===0){a&&(console.error("Root eval set consisted of 0 valid actions"),y.debug("!! Zero Action Root !!")),this.simEndpoint("D");return}let m=-99999;const C=[];let D=!0;if(a)if(f.length===1)C.push({a:f[0],weight:99}),D=!1;else{const B=f.findIndex(G=>G.key==="HPLY"&&G.card==="ESU2"||G.card==="ESU3");B>-1&&(C.push({a:f[B],weight:99}),D=!1)}if(D){We.saveState();let B=!0;for(let G=0;G4e4&&(this.kickOut=!0),V===di&&(B=!1),V+=this.hintWeight(R),V>m&&(m=V),We.restoreState(),a&&(C.push({a:R,weight:V}),await Ct.drawAiGear(G,!0),c++,await S.sleep(ui))}We.popState()}if(a)if(this.boulos(!1),this.kickOut)y.lawg("🤖: High complexity encountered. Recombobulating."),this.processAction(t,i,!0);else{const B=m-(i?.4:.2);let G=C.filter(q=>q.weight>B);G.length>1&&G.findIndex(q=>q.a.key==="ENDT")>-1&&(G=G.filter(q=>q.a.key!=="ENDT"));let R;if(B>di-100){const q=G.find(pt=>pt.a.key==="FITE");q?R=q.a:R=G[S.randInt(0,G.length)].a}else R=G[S.randInt(0,G.length)].a;const X=Date.now()-this.slowpoke,V=Math.max(1,350-X),tt=X-ui*c;this.turnSims+=this.endCount,this.turnTime+=tt,S.options.debug&&(i?(y.debug("▪"),y.debug("🧠 Main Choices 🧠"),C.sort((q,pt)=>pt.weight-q.weight).forEach(q=>{const pt=this.dazzler(q,R,B);let Mt="",ye;const kt=q.a.key;kt==="HPLY"?(Mt=q.a.card,ye="Play "):kt==="MOVE"||kt==="ACTV"?(Mt=q.a.host,ye=kt==="MOVE"?"Move ":"Actv "):kt==="FITE"||kt==="ENDT"?ye=kt==="FITE"?"Fite ":"Done ":ye=kt+" ??? ",y.lawg(ye,Mt," : "+this.lNum(q.weight)+pt)}),y.debug("🧠 ~~~~~~~~~~~~~~ 🧠"),y.debug("▪")):R.key==="FORG"&&(y.debug("🧠 Lane Choices 🧠"),C.filter(q=>q.a.key==="FORG").sort((q,pt)=>pt.weight-q.weight).forEach(q=>{y.lawg("Lane "+q.a.lane+" : "+this.lNum(q.weight)+this.dazzler(q,R,B))}),y.debug("🧠 ~~~~~~~~~~~~~~ 🧠"),y.debug("▪"))),S.sleep(V).then(()=>{T.handleAction(R)})}else this.popProm(m)}dazzler(t,i,r){return t.a===i?" 🏆":t.weight>r?" 🌻":""}actionPruner(t){let i=t.filter(r=>nr.indexOf(r.key)===-1);return L.mainBattle?i=i.filter(r=>r.key!=="HDSC"):i=i.filter(r=>!this.hasHint(r,"BB")),i=i.filter(r=>{if(this.hasHint(r,"HR")){if(r.zone==="P")return r.playerA!==this.aiPlayer;{const a=p.ddf6(r);return a.owner===this.aiPlayer?a.aiHints().includes("MC"):!0}}else return!0}),i=i.filter(r=>{if(this.hasHint(r,"KL")){const a=p.ddf6(r);return a.owner===this.aiPlayer?a.aiHints().includes("ST"):!0}else return!0}),i=i.filter(r=>this.hasHint(r,"BF")?r.playerA===this.aiPlayer:!0),i=i.filter(r=>this.hasHint(r,"DB")?r.playerA!==this.aiPlayer:!0),i=i.filter(r=>{if(this.hasHint(r,"PN")){if(r.zone==="P")return r.playerA!==this.aiPlayer;{const a=r,c=p.ddf6(a);return c.owner===this.aiPlayer?c.aiHints().includes("MC"):!0}}else return!0}),i=i.filter(r=>{const a=r.key==="FORG";if(a||this.hasHint(r,"FL")){const c=r,f=p.searchByFSA(c);return f&&(L.mainBattle?L.newPre:L.newPost).includes(f.id)?f.aiHints().includes("RT")?!0:a?W.getCard(c.host).aiHints().includes("RD"):!1:!0}else return!0}),i}noHandDoubles(t){const i=[],r=[],a=[];return t.forEach(c=>{c.key==="HPLY"?i.push(c):r.push(c)}),i.forEach(c=>{const f=c.card;a.includes(f)||(a.push(f),r.push(c))}),r}async peeker(t){this.peeking=!0;const i=[],r=[];t.forEach(a=>{or.includes(a.key)?r.push(a):i.push({root:a,peek:[a],wasPeek:!1,free:""})}),We.saveState();for(let a=0;a0){let C="";if(c.key==="HPLY"){const D=c;D.cost!==""&&(C=D.cost)}i.push({root:c,peek:m,wasPeek:!0,free:C})}We.restoreState()}return We.popState(),this.peeking=!1,i}peekerReport(t){let i=0,r=0,a=0,c=[],f=[];t.forEach(m=>{const C=m.peek.length;if(C>0){const D=m.root.key;if(D==="HPLY")if(m.peek[0].key==="FORG")r+=C;else{const B=y.fastName(m.root.card)+": "+C;c.push(B)}else if(D==="MOVE")a+=C;else if(D==="ACTV"){const B=y.fastName(m.root.host)+": "+C;f.push(B)}else i+=C}}),y.debug("High complexity hit: Root: "+t.length),r>0&&y.debug("Forges: "+r),a>0&&y.debug("Mobility: "+a),c.forEach(m=>y.debug(m)),f.forEach(m=>y.debug(m)),i>0&&y.debug("Other: "+i)}hintWeight(t){let i=!1,r=!1,a="",c=0;if(t.key==="HPLY"?a=t.card:t.key==="HDSC"?(r=!0,a=t.host):this.hasHint(t,"CD")&&(a=t.card,i=!0),a){const f=W.getCard(a);if(f.level0&&(r?c-=m:c+=m)}}return c}levelBonusFormula(t,i){let r=0;const a=t.aiHints();return a.includes("LG")?(r+=1,a.includes("LM")&&(r+=.8)):a.includes("LB")?r-=1.3:i&&(r+=.4),r}hintAdjuster(t){let i=0;const a=t.aiHints().find(c=>c.startsWith("ZZ"));return a&&(i=.5*parseInt(a.slice(2))),i}hasHint(t,i){return!t.hint||t.hint.length===0?!1:t.hint.includes(i)}logStats(t,i){const a=["Crt Cnt","Crt Val","Threat","P Health"].map((c,f)=>`${c}: ${this.numNum(i[f])}`).join(", ");console.log(t+a)}numNum(t){return t.length>6?t.charAt(0)==="-"?"NUNS":"KILL":t.padEnd(4)}cheater(){return E.aiMode&&E.aiActive&&S.options.cheater?new ir(this.aiPlayer).cheatin():!1}peekAllCards(){const t=k.toPlayer(this.aiPlayer),i=t.deck.concat(t.hand,t.discard).sort();console.log(i.map(r=>y.fastName(r)).join(` +`))}peekDecks(){const t=k.toPlayer(!1),i=t.deck.map(f=>y.fastName(f)).sort(),r=t.hand.map(f=>y.fastName(f)).sort(),a=t.discard.map(f=>y.fastName(f)).sort(),c=["-- Deck --"].concat(i,"-- Hand --",r,"-- Discard --",a);console.log(c.join(` +`))}}const st=new hr;class lr{getState(){const t={cCrd:this.currPlayCard,cCst:this.currPlayCost,cPos:this.currPlayPos,aa:this.actionHistory};return JSON.stringify(t)}setState(t){const i=JSON.parse(t);this.currPlayCard=i.cCrd,this.currPlayCost=i.cCst,this.currPlayPos=i.cPos,this.actionHistory=i.aa}handleAction(t){if(t.key==="DEET"){ge.init(t.param);return}if(t.key==="HPLY"){this.playCardSelect(t);return}if(t.key==="FORG"){L.forgeCard(t,this.currPlayCard,this.currPlayCost,this.currPlayPos);return}if(t.key==="FITE"){Ii.fight(t.param==="M");return}if(t.key==="ENDT"){L.endTurn();return}if(t.key==="MOVE"){this.mobilitySelect(t);return}if(t.key==="MEND"){L.mobility(t);return}if(t.key==="HDSC"){this.currPlayCost="",L.cardPlayed(this.currPlayCard,this.currPlayCost,this.currPlayPos,!0),this.actionDone();return}if(t.key==="ACTV"){const i=p.jr5(t.param);W.getCard(i.code).startActivation(i);return}if(t.key==="NOTR"){t.param==="PM"&>.popMode(),this.actionDone(!0);return}if(t.key==="CARD"){W.getCard(t.host).handleAction(t);return}if(t.key==="CANC"||t.key==="CNCL"){t.param==="PM"&>.popMode(),this.actionHistory.pop(),this.ddf5();return}if(t.key==="USWP"){gt.popMode(),Qt.whatNext();return}if(t.key==="DTUP"){ge.updateDetails(t),ut.drawAll();return}if(t.key==="VWDK"){bt.handleShowDeck(t);return}if(t.key==="SCRK"){bt.handleDeckScroll(t);return}if(t.key==="SCRH"){const i=k.getLocal();t.param==="R"?E.ui.handScrollLeft=Math.min(i.hand.length-5,E.ui.handScrollLeft+5):E.ui.handScrollLeft=Math.max(0,E.ui.handScrollLeft-5),ut.dirtyA=!0,ne.dirty=!0,ut.drawAll();return}if(t.key==="DRFT"){At.resumeDraft(t.param);return}if(t.key==="SCRD"){At.paginate(t.param==="D"),ut.drawAll();return}if(t.key==="UIBT"){ki.handleUIButton(t);return}if(t.key==="MENU"){ki.handleMainMenuButton(t);return}if(t.key==="MNBT"){ki.handleMenuButton(t);return}if(t.key==="DSET"){this.ddf5($t.generateDeckPickerActions(parseInt(t.param)));return}if(t.key==="DECK"){$t.handleDeckPick(t.param);return}if(t.key==="DPVW"){$t.previewDeckPick(t.param);return}if(t.key==="DBUG"){t.param==="AB"&&S.options.debug?y.clearAll():S.toggleDebug();return}}ddf5(t,i=!1){let r;if(t){const a=this.generateDetailActions();r=t.concat(a),this.actionHistory.push(r)}else r=this.actionHistory[this.actionHistory.length-1];E.aiActive?st.processAction(r,i):(gt.mode==="G"&&(ut.dirtyA=!0),ut.drawAll())}currPlayCard="";currPlayCost="";currPlayPos=-1;shiftPlayCard(t){t0&&i.canLevel()&&r.push(w.buttonTarget("HDSC",t.card));const a=w.toActions(r);return a.push(b.handSelectAction("CANC",t.card,"",t.position)),a}mobilitySelect(t){const i=this.getMoveCardActions(t);this.ddf5(i)}getMoveCardActions(t){const i=p.ddf6(t);let r=[];if(t.param==="ACTV"){const a=b.actionTarget("TB","ACTV",i.code,i.id);r=w.toActions(a)}return r.push(b.fieldSelectAction("CANC",t.lane,t.playerA)),p.canMove(i).map(a=>{const c=b.fieldSelectAction("MEND",a,t.playerA);return c.param=i.id,c}).concat(r)}noneEndTrigger(){return w.toActions(w.buttonTarget("NOTR"))[0]}cancelAction(){return w.toActions(w.buttonTarget("CANC"))[0]}emptyAdjacents(t,i){const r=i||t.id,a=b.emptyPlayerActTarg("F","CARD",t.code,r);return a.lanes=t.adjacent,w.toActions(a)}generateDetailActions(){const t=gt.mode;if(E.aiActive)return[];if(t==="G"){const i=k.getLocal().hand.map((a,c)=>{const f=b.handSelectAction("DEET",a,"",c);return f.param=a,f}),r=p.qActiveCreats().map(a=>{const c=b.fieldSelectAction("DEET",a.lane,a.owner);return c.param=a.code,c});return i.concat(r)}else if(t==="D"){const i=At.currentPack.map((a,c)=>{const f=b.draftSelectAction("DEET",c,!0);return f.param=`${a}1`,f}),r=At.picksAsDeck.map((a,c)=>{const f=b.draftSelectAction("DEET",c,!1);return f.param=`${a.card}1`,f});return i.concat(r)}return[]}}const T=new lr,cr=16.6,ur=200,dr="!CF",fr="!RU",Je=35,gr=.11,xi=40,fi=18,gi=18,Bi=32,Hi=40,mi=45,_e=["L1","L2","L3","L4","L5","L6"],Ni=["F1","F2","F3","F4"],pi=o=>Math.round(100*o)/100,mr=(o,t,i)=>Math.round((1-i)*o+i*t);class pr{active=!1;animBase=[];animOpac=[];animOver=[];animQ=[];blocker=new Re;cardCache=new Map;easingCache=new Map;eCanvas;hcFrame;fct2anm=new Map;initialzed=!1;lastStep=-1;movingBoard=[];movingHand=[];on=!0;pathCache=new Map;rafStartTime=0;speedCache=new Map;spriteCache=new Map;spriteToSchema=new Map;perf=[];actF(){return[this.animOpac,this.animBase,this.animOver].map(t=>t.filter(i=>i.active))}addArmorC(t){if(this.ok()){const i=new vn("M","M","F",t.id,18);i.setDelay(fi),i.preLoad("icons/effects/big/armor.png"),i.setField(t.lane,t.owner),i.nudge(40,76),i.dOrd=2,this.animQ.push(i)}}addArmorP(t){if(this.ok()){const i=new hi("M","I","P",t,this.speedCache.get("D"));i.preLoad("icons/effects/big/armor.png"),i.nudge(897,t===k.isLocalA?552:65),this.animQ.push(i)}}addCardFlash(t){if(this.ok()){const i=pe.fader("P",dr,t);i.x=861,i.y=200,this.animQ.push(i)}}addDeathBoard(t,i,r){if(this.ok()){const a=pe.fader("F",t,t);a.setField(i,r),this.animQ.push(a)}}addDirDmg(t){if(this.ok()){const i=new Me("Z","P",t);i.nudge(834,t===k.isLocalA?486:-1),this.animQ.push(i)}}addFactBoard(t,i,r,a){if(this.ok()&&t!=="X"){const c=new Tn(this.fct2anm.get(t),"F",i);c.setField(r,a),c.nudge(20,30),c.budge(),this.animQ.push(c)}}addFight(t){if(st.simOff){const i=new li("F","F",t.id,t.id);i.endWrite=!0,i.setField(t.lane,t.owner);const r=this.pathCache.get("F");i.moveY=r[k.isLocalA===t.owner?1:0],this.animQ.push(i)}}addForgeMove(t,i,r,a,c=void 0){if(this.ok()){const f=k.isLocalA===a,m=(r-(i+1))*(f?1:-1),C=m===0?"F0":Ni[Math.abs(m)-1],D=new li(C,"F",t,t);D.endWrite=!0,D.dOrd=2;const B=ne.fastCoord(i);f||(B[1]=-184),D.x=B[0],D.y=B[1];const G=this.pathCache.get(D.aId);if(D.moveY=G[f?1:0],m!==0){const R=this.pathCache.get(_e[Math.abs(m)-1]);D.moveX=R[m>0?0:1]}if(this.animQ.push(D),c){const R=pe.fixed("F",c.id,c.id);R.steps=D.steps,R.dOrd=0,R.setField(c.lane,c.owner),this.animQ.push(R)}}}addHandDiscard(t,i,r){if(this.ok()){const a=this.pathCache.get("D")[0];let c;c=pe.fader("H",t,i),c.setHand(r),c.moveY=a,this.animQ.push(c)}}addHandFling(t,i,r){if(this.ok()){const a="L6",c=this.pathCache.get(a)[0],f=pe.fader("H",t,i);f.setHand(-1),f.x+=40+100*r,f.moveX=c,this.animQ.push(f)}}addHandMove(t,i,r,a,c){if(this.ok()){const f=Math.min(Math.max(a-r,-5),5),m=_e[Math.abs(f)-1],D=this.pathCache.get(m)[f>0?0:1];let B;const G=a<0||a>4;G?B=pe.fader("H",t,i):(B=new li(m,"H",t,i),B.endWrite=!0,r>4?r=Math.min(r,a+5):r<0&&(r=Math.max(r,a-5))),B.setHand(r),B.moveX=D,c&&!G&&B.extend(15,!0,!1),this.animQ.push(B)}}addHeal(t){if(this.ok()){const i=new Me("H","P",t);i.slow(4),i.nudge(859,t===k.isLocalA?517:30),this.animQ.push(i)}}addLaneMove(t,i,r,a){if(this.ok()){const c=(r-i)*(k.isLocalA===a?1:-1),f=new li(_e[Math.abs(c)-1],"F",t,t);f.endWrite=!0,f.setField(i,a);const m=this.pathCache.get(f.aId);f.moveX=m[c>0?0:1],this.animQ.push(f)}}addLevel(t,i){if(this.ok()){const r=new Me("V","H",t);r.slow(4),r.setHand(i),r.nudge(20,72),this.animQ.push(r)}}addOverload(t,i){if(this.ok()){const r=new Me("O","H",t);r.slow(4),r.setHand(i),r.nudge(21,72),this.animQ.push(r)}}addPoison(t){if(this.ok()){const i=new hi("P","I","F",t.id,this.speedCache.get("D"));i.preLoad("icons/effects/big/poison.png"),i.setField(t.lane,t.owner),i.nudge(70,36),this.animQ.push(i)}}addRankup(t){if(this.ok()){const i=new Me("R","P",fr);i.slow(4),i.nudge(890,t===k.isLocalA?466:-21),this.animQ.push(i)}}addRegen(t){if(this.ok()){const i=new hi("G","I","F",t.id,this.speedCache.get("D"));i.preLoad("icons/effects/big/regenerate.png"),i.setField(t.lane,t.owner),i.nudge(10,35),this.animQ.push(i)}}addSlash(t){if(this.ok()){const i=new Vi("B","F",t.id);i.slow(3),i.setDelay(fi),i.setField(t.lane,t.owner),i.nudge(8,44),this.animQ.push(i)}}addSwipe(t){if(this.ok()){const i=new Vi("W","P",t);i.slow(3),i.setDelay(fi),i.nudge(877,t===k.isLocalA?531:44),this.animQ.push(i)}}aniProm(){return this.active?this.blocker.getPromise():Promise.resolve()}async done(t){const i=t??this.actF().flat();await Promise.all(i.map(r=>r.onEnd())),this.eCanvas.clear(),this.active=!1,this.purge(),this.blocker.resolveMe()}async draw(t){if(t-this.lastStep===0){requestAnimationFrame(c=>this.rafNext(c));return}let r=!1;const a=[];for(let c=this.lastStep+1;c<=t;c++)this.actF().forEach(f=>{f.forEach(m=>{m.steps===c?(m.active=!1,a.push(m)):(c===t&&(r=!0),m.moveX.length>c&&(m.x+=m.moveX[c]),m.moveY.length>c&&(m.y+=m.moveY[c]))})});if(r){const c=this.actF();this.hcFrame.clear(),c[0].length>0&&(this.hcFrame.context.globalAlpha=this.easingCache.get("D")[t],await Promise.all(c[0].map(f=>f.draw(t))),this.hcFrame.context.globalAlpha=1),c[1].length>0&&await Promise.all(c[1].map(f=>f.draw(t))),c[2].length>0&&await Promise.all(c[2].map(f=>f.draw(t))),await Promise.all(a.map(f=>f.onEnd())),this.eCanvas.clear(),this.eCanvas.writeHC(this.hcFrame,0,0),this.lastStep=t,t>ur?this.done(a):requestAnimationFrame(f=>this.rafNext(f))}else this.done(a)}easingFade(t){const i=Array(t);let r=0;for(let a=0;athis.fct2anm.set(kt[1],kt[0]));const i=[["A","effectA"],["B","slash"],["W","swipe"],["Z","boomer"],["H","heal"],["V","level"],["O","overload"],["N","effectN"],["R","rankup"],["T","effectT"],["U","effectU"]];(await Promise.all(i.map(kt=>S.imageLoader(`img/sprites/${kt[1]}.png`)))).forEach((kt,se)=>{this.spriteCache.set(i[se][0],kt)});const a=this.schemaBuilder(5,7,110,154,0),c=this.schemaBuilder(5,7,108,153,0),f=this.schemaBuilder(2,3,134,134,0),m=this.schemaBuilder(2,3,114,114,0),C=this.schemaBuilder(3,3,120,116,0),D=this.schemaBuilder(3,3,110,81,0),B=this.schemaBuilder(3,3,112,114,0),G=this.schemaBuilder(5,2,142,142,0),R=this.schemaBuilder(8,4,205,205,0);[["A",a],["N",a],["U",a],["T",c],["B",f],["W",m],["R",C],["V",D],["O",B],["H",G],["Z",R]].forEach(kt=>this.spriteToSchema.set(kt[0],kt[1])),[["D",Je],["F",xi],["L1",gi],["L2",Bi],["L3",Hi],["L4",mi],["L5",mi],["L6",Je],["F0",gi],["F1",gi],["F2",Bi],["F3",Hi],["F4",mi]].forEach(kt=>this.speedCache.set(kt[0],kt[1])),this.easingCache.set("D",this.easingFade(Je));const tt=(kt,se)=>{const wt=new Array(se.length),Vt=se.map(Yt=>mr(0,kt,Yt));return Vt.forEach((Yt,he)=>{he===0?wt[0]=Yt:wt[he]=Yt-Vt[he-1]}),wt},q=kt=>kt.map(se=>-se),pt=250;_e.forEach((kt,se)=>{const wt=this.easingLine(this.speedCache.get(kt)),Vt=(se+1)*oe.fieldGap,Yt=tt(Vt,wt);if(this.pathCache.set(kt,[Yt,q(Yt)]),se<5){const he=tt(pt,wt);this.pathCache.set(Ni[se],[he,q(he)])}se===0&&this.pathCache.set("F0",this.pathCache.get("F1"))});const Mt=tt(15,this.easingFight(xi));this.pathCache.set("F",[Mt,q(Mt)]);const ye=tt(100,this.easingLine(Je));this.pathCache.set("D",[ye,[]]),this.initialzed=!0}}ok(){return this.on&&st.simOff}async prep(){if(!this.on||this.animQ.length===0)return 0;if(!this.initialzed)return this.animQ=[],y.debug("Animation failed."),0;this.active=!0;const t=new Map;this.animQ.forEach(a=>{t.has(a.targId)?t.get(a.targId).push(a):t.set(a.targId,[a])});const i=[];let r=0;t.forEach((a,c)=>{const f=a[0].target,m=new Set,C=a.filter(D=>m.has(D.aId)?!1:(m.add(D.aId),!0));if(r+=C.length,a.some(D=>D.type==="F"||D.type==="C"||D.type==="X"?(i.push(D),!0):!1),f==="F"||f==="H"){const D=a.find(B=>B.moveX.length>0||B.moveY.length>0);if(D){if(f==="F")this.movingBoard.push(c);else if(f==="H"){const B=S.deTil(c);S.txt2bool(B[0])&&this.movingHand.push(parseInt(B[1]))}a.length>1&&a.forEach(B=>{B!==D&&(B.moveX=D.moveX,B.moveY=D.moveY)})}}C.forEach(D=>{D.type==="S"?this.animOver.push(D):D.type==="F"||D.type==="I"?this.animOpac.push(D):(D.type==="C"||D.type==="X"||D.type==="M")&&this.animBase.push(D)}),this.animBase.sort((D,B)=>D.dOrd-B.dOrd)});for(let a=0;athis.rafFirst(t)))}}const K=new pr;class yr{type="N0";events=[];reactions=[];deathCheck=!0;iaTrigLane=0;getState(){const t={type:this.type,events:this.events,tA:this.reactions,dC:this.deathCheck,tL:this.iaTrigLane};return JSON.stringify(t)}setState(t){const i=JSON.parse(t);this.type=i.type,this.events=i.events,this.reactions=i.tA,this.deathCheck=i.dC,this.iaTrigLane=i.tL}reset(){this.type="N0",this.events=[],this.reactions=[],this.deathCheck=!0}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 i;if(t==="N0")i=this.events.slice(),this.events=[];else{const a=this.events.filter(f=>f.code==="DIE"),c=this.events.filter(f=>f.code!=="DIE");t==="C1"?(i=c,this.events=a):(i=a,this.events=c)}const r=this.getReactions(i);this.reactions=this.sortReactions(r),Qt.whatNext()}getReactions(t){let i;const r=t.map(a=>{a.code==="TRS"&&(i=a);const c=p.field.map(m=>m.triggers.map(C=>{const D=b.triggerReaction(a,C,m.owner,"C");return D.creatId=m.id,D.cardCode=m.code,D}).filter(C=>Ti.ddf8(C))).flat(),f=[!0,!1].map(m=>k.toPlayer(m).triggers.map(D=>b.triggerReaction(a,D,m,"P")).filter(D=>Ti.ddf8(D))).flat();return c.concat(f)}).flat();return i&&this.handleTurnStart(i),r}sortReactions(t){const i=k.activeA;let r=t.filter(f=>!f.trigger.interactive&&f.owner===i),a=t.filter(f=>!f.trigger.interactive&&f.owner!==i);const c=t.filter(f=>f.trigger.interactive&&f.owner===i);return st.simOff&&(r=this.animBatching(r),a=this.animBatching(a)),c.concat(a,r)}animBatching(t){const i=new Map;if(t.forEach(f=>{if(f.trigger.batch){const m=f.trigger.id;i.set(m,1+(i.get(m)??0))}}),i.size===0)return t;const r=[];if(i.forEach((f,m)=>{f>1&&r.push(m)}),r.length===0)return t;const a=t.filter(f=>!r.includes(f.trigger.id));return r.map(f=>t.filter(m=>m.trigger.id===f).map((m,C)=>(C>0&&(m.draw=!1),m))).flat().concat(a)}handleTurnStart(t){p.dirt();const i=E.tick();p.qActiveCreats().forEach(r=>{r.owner===t.playerA&&(r.activationAvailable=!0,r.mobilityAvailable=!0,r.sleeping=!1),r.armorDmg=0,r.poison>0&&r.hurtDirect(r.poison,"POIS","X",i)&&K.addPoison(r),r.regen>0&&r.heal(r.regen,!1)>0&&K.addRegen(r),Bt.deathProdder(r,i)}),[k.playerA,k.playerB].forEach(r=>{r.armorDmg=0;const a=k.totalPoison(r);a>0&&k.hurtDirect(r,a,"POIS")>0&&K.addDirDmg(r.isPlayerA)})}getNextTrigger(){const t=this.reactions;if(t.length!==0)return t[t.length-1]}triggerDone(){this.reactions.length===0?console.error("batch.triggerDone() was called when there is no trigger actions"):(this.reactions.pop(),this.iaTrigLane=0),Qt.whatNext()}addEvents(...t){this.events.push(...t)}}const x=new yr;class br{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new rn(t)}get(t){return this.registry[t]}}const lt=new br;class Ar 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 i=this.lValS(["Give an adjacent creature","Each adjacent creature gets","Each other friendly creature gets"]);this.text=`Activate: ${i} 2x attack this turn.`,this.bonus=this.buffNug(this.iAttack,0,"TX")}targ(t){const i=b.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(i.lanes=t.adjacent),i}canActivate(t){return p.creatByTarget(this.targ(t)).length>0}startActivation(t){let i;this.level===1?i=this.targ(t):(i=w.boardTarget("CARD",this.code),i.param=t.id),i.hint=["BB"],T.ddf5(w.toActions([i,w.buttonTarget("CANC")]))}handleAction(t){const i=p.jr5(t.param);if(t.zone==="F"){const r=p.ddf6(t);this.logAct(!0,r),this.applyMod(r)}else{this.logAct(!0);const r=this.targ(i);p.creatByTarget(r).forEach(a=>{this.applyMod(a)})}i.endActivation()}applyMod(t){this.modA(t,b.modT("AT",t.attack))}}class kr 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 ${y.jr9(this.level,this.level,!0)} and Regenerate ${this.level}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("EF");a.bonus=this.buffNug(this.level,this.level,"TW");const c=r.jr4("MV");return c.bonus=this.regnNug(this.level),r}ddf8(t){const i=I.toCreature(t.event);return(i.creature.lane===1||i.creature.lane===5)&&i.creature.owner===t.owner}jr8(t){const i=I.toCreature(t.event);this.buffD(i.creature,this.level),this.regn(i.creature,this.level),x.triggerDone()}}class Tr extends P{constructor(t){super(t),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 ${y.jr9(this.boof4812,0)} and Armor ${this.boof248}.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){const i=b.crNotMeTarg(t.id);i.player=k.toTarget(t.owner),p.creatByTarget(i).length===0?[b.mod("AT",this.boof4812,t.id),b.mod("AR",this.boof248,t.id)].forEach(a=>{t.addModSafe(a)}):t.removeModSafe(t.id)}}class vr 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"),this.hints=["ZZ-3"];const i=this.boof101520;this.text=`While ${this.name} is your only friendly creature, you get Armor ${i}, and this gets Armor ${this.level+1} and Mobility 1.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){const i=t.status==="A",r=b.crNotMeTarg(t.id);r.player=k.toTarget(t.owner);const a=p.creatByTarget(r);if(i&&a.length===0){const c=b.mod("AR",this.boof101520,t.id);k.addModSafe(t.owner,c);const f=b.mod("AR",this.level+1,t.id),m=b.mod("MB",1,t.id);t.addModSafe(f),t.addModSafe(m)}else k.removeModSafe(t.owner,t.id),t.removeModSafe(t.id)}}class Oe 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)},["LLV"]:{c:()=>this.verC(),t:r=>this.verT(r)}}[t]}testAmbush(t,i){return this.lookup(t).t(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}ddf8(t){return st.simOff&&this.testAmbush(this.cardCode(),t)}jr8(t){const i=this.cardCode(),r=k.toPlayer(t.owner),a=r.hand.length;for(let c=a-1;c>-1;c--){const f=r.hand[c];f.startsWith(i)&&(y.lawg(f," Ambushed."),this.spawn(f,r.isPlayerA),L.levelAndDiscard(f,c,!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&&L.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 i=I.toCreature(t.event);return t.owner!==i.creature.owner&&k.activeA===i.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 i=I.toEnterField(t.event);return t.owner!==i.creature.owner&&k.activeA===i.creature.owner&&!i.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.activeA===t.event.playerA:!1}verC(){this.faction="U",this.rarity="H",this.name="Leyline Vermin",this.iAttack=this.boof61218,this.iHealth=this.boof358,this.tribe.push("IN"),this.text="Ambush: When an enemy creature with Poison is destroyed on the enemy player's turn, "+this.ambT()}verT(t){if(t.event.code==="DIE"){const i=I.toCreature(t.event);return t.owner!==i.creature.owner&&k.activeA===i.creature.owner&&i.creature.poison>0}else return!1}}class Sr 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,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.bonus=this.rawNug(0,0,0,0,.5,"TW"),a.interactive=!0,r}handleAction(t){L.levelAndDiscardA(t),this.anim8(t.param),T.actionDone(!0)}ddf8(t){if(t.event.playerA===t.owner){const i=W.getCard(t.event.cardCode);if(i.type==="S"&&i.faction==="A")return!0}return!1}jr8(t){const i=b.lvlHandActTarg(this.code,t.creatId),r=w.toActions([i,w.buttonTarget("NOTR")]);r.length>1?T.ddf5(r):x.triggerDone()}}class Cr 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 i=this.boof;this.text=`While you have over 120 health, Arboris gets ${y.jr9(i,i)}.`}jr3(t,i){const r=super.jr3(t,i);return r.addEffect("PH",this.code),r}enforceEffect(t){if(k.toPlayer(t.owner).health>120&&t.status==="A"){const r=this.boof;t.addModSafe(b.mod("HL",r,t.id)),t.addModSafe(b.mod("MH",r,t.id)),t.addModSafe(b.mod("AT",r,t.id))}else t.removeModSafe(t.id)}get boof(){return this.lValN([4,8,80])}}class wr 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 ${y.dbdtap()}, it gets ${y.jr9(this.level,this.level)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.buffNug(this.level,this.level,"TP"),r}ddf8(t){const i=I.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcCreat.owner===t.owner}jr8(t){const i=I.toDamage(t.event);this.logAct(!1,i.srcCreat),this.buffD(i.srcCreat,this.level),x.triggerDone()}}class ti extends P{constructor(t){super(t),this.rarity="H",this.iAttack=this.level+2,this.iHealth=this.iAttack;const i=this.cardCode();i==="SFA"?this.steel():i==="RFA"?this.root():i==="HFA"?this.hell():i==="SGA"&&this.storm(),this.text=`Forge: ${this.name} gets ${y.jr9(this.level,this.level)} for each ${y.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,i){const r=super.jr3(t,i);return r.jr4("FR"),r}jr8(t){const i=b.target("TH");i.player=k.toTarget(t.owner),i.faction=this.faction;const r=w.deckByTarget(i).length;if(r>0){const a=I.toEnterField(t.event);this.buffD(a.creature,r*this.level)}x.triggerDone()}}class Y extends P{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["COZ"]:()=>this.cooze(),["DFM"]:()=>this.dfmimic(),["DZA"]:()=>this.dozer(),["EWF"]:()=>this.woof(),["FWG"]:()=>this.feywing(),["FRH"]:()=>this.hulk(),["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 i=this.cardCode();this.imgKey=i,this.minLevel=this.level,this.maxLevel=this.level,this.lookup(i)()}image(t){return this.rawImage(this.imgKey,t)}static fgoc(t){return "FGO"+t}fixedNekSpirit(t){this.faction="N",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.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=Y.minionBuff(this.level),this.plont(),this.name=Y.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=Y.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.iAttack=t,this.plont(),this.name=Y.minionName(1),this.imgKey="SDL",this.hints=["RT"]}fixedTreefolk(t){this.iAttack=t,this.plont(),this.name=Y.minionName(3),this.imgKey="TFK"}tfFight(){this.iAttack=this.boof91421,this.plont(),this.name=Y.minionName(3),this.imgKey="TFK"}static bee(t){return "KBE"+t}dfmimic(){this.faction="U",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=9,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")}woof(){this.faction="U",this.name="Ether Wolf",this.tribe.push("ST","WF"),this.iHealth=5,this.iAttack=6,this.imgKey="EWV"}static zomc(t){return "ZMB"+t}zimus(){this.faction="N",this.name="Zimus, the Returned",this.tribe.push("ZB"),this.iAttack=10,this.iHealth=5,this.imgKey=`${"ZTU"}2`}zomb(t,i){this.faction="N",this.name="Zombie",this.tribe.push("ZB"),this.iAttack=t,this.iHealth=i,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)}hulk(){this.faction="T",this.name="Frost Hulk",this.iAttack=9,this.iHealth=9,this.tribe.push("IC","EL")}}class ct extends vt{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ(),t:()=>this.fcT()},["ABE"]:{c:()=>this.edicC(),z:()=>this.edicZ(),t:()=>this.edicT()},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ(),t:()=>this.fcT()},["CCC"]:{c:()=>this.ccalC(),z:()=>this.ccalZ(),t:()=>this.ccalT()},["COD"]:{c:()=>this.chontC(),z:()=>this.chontZ(),t:()=>this.ecT()},["CEX"]:{c:()=>this.cypeC(),z:()=>this.cypeZ(),t:()=>this.fcT()},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ(),t:()=>this.dcurT()},["DFS"]:{c:()=>this.defsC(),z:()=>this.defsZ(),t:()=>this.fcT()},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ(),t:()=>this.ecT()},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ(),t:()=>this.ecT()},["EWV"]:{c:()=>this.ewolC(),z:()=>this.ewolZ(),t:()=>this.foT()},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ(),t:()=>this.fcT()},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ(),t:()=>this.acT()},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ(),t:()=>this.acT()},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ(),t:()=>this.fcT()},["IVS"]:{c:()=>this.infvC(),z:()=>this.infvZ(),t:()=>this.infvT()},["LOD"]:{c:()=>this.lashC(),z:()=>this.lashZ(),t:()=>this.ecT()},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ(),t:()=>this.foT()},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ(),t:()=>this.ecT()},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ(),t:()=>this.fcT()},["PLW"]:{c:()=>this.palwC(),z:()=>this.palwZ(),t:()=>this.ecT()},["PHC"]:{c:()=>this.pcallC(),z:()=>this.pcallZ(),t:()=>this.foT()},["PTB"]:{c:()=>this.phyC(),z:()=>this.phyZ(),t:()=>this.aoT()},["PYS"]:{c:()=>this.pyreC(),z:()=>this.pyreZ(),t:()=>this.edicT()},["ROK"]:{c:()=>this.rokC(),z:()=>this.rokZ(),t:()=>this.fcT()},["ROU"]:{c:()=>this.riteC(),z:()=>this.riteZ(),t:()=>this.fcT()},["ROE"]:{c:()=>this.roteC(),z:()=>this.roteZ(),t:()=>this.foT()},["STS"]:{c:()=>this.stsC(),z:()=>this.stsZ(),t:()=>this.foT()},["SNP"]:{c:()=>this.pulseC(),z:()=>this.pulseZ(),t:()=>this.ecT()},["SRD"]:{c:()=>this.sradC(),z:()=>this.sradZ(),t:()=>this.fcT()},["SIV"]:{c:()=>this.beesC(),z:()=>this.beesZ(),t:()=>this.foT()},["TST"]:{c:()=>this.talinC(),z:()=>this.talinZ(),t:()=>this.talinT()},["TRN"]:{c:()=>this.turnbC(),z:()=>this.turnbZ(),t:()=>this.acT()},["VCH"]:{c:()=>this.verdC(),z:()=>this.verdZ(),t:()=>this.fcT()},["WOD"]:{c:()=>this.wdenC(),z:()=>this.wdenZ(),t:()=>this.fcT()},["WPC"]:{c:()=>this.wipeC(),z:()=>this.wipeZ(),t:()=>!0}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){const i=this.cardCode();return i==="NSH"||i==="PHC"?this.leveledImage(t):this.fixedImage(t)}canPlay(){return this.lookup(this.cardCode()).t()}playTargets(){return[w.boardTarget("CARD",this.code)]}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),T.spellCast()}acT(){return p.qActiveCreats().length>0}aoT(){return p.qActiveCreats().length<10}ecT(){return p.qEnemyCreats().length>0}fcT(){return p.ddf1().length>0}foT(){return p.ddf1().length<5}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;p.ddf1().forEach(i=>{i.addArmor(t)})}aeSides(){return[p.qPlayerCreats(!0),p.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."}edicT(){return this.aeSides().every(t=>t.length>0)}edicZ(){const t=this.aeSides(),i=E.tick();let r=[];t.forEach(m=>{if(m.length>1){let C=[],D=-999999;m.forEach(B=>{B.attack>D?(D=B.attack,r.push(...C),C=[B]):B.attack===D?C.push(B):r.push(B)}),C.length>1&&(C.splice(S.randInt(0,C.length),1),r.push(...C))}}),r.forEach(m=>this.kill(m,i));const a=k.getActive(),c=T.playPosition(),f=a.hand.length;for(let m=f-1;m>-1;m--)m!==c&&(Dt.cardDiscard(a,m),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 ${y.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;p.ddf1().forEach(i=>{this.modA(i,b.modT("AT",t)),this.wrang(i)})}ccalC(){this.faction="N",this.rarity="H",this.name="Cercee's Call",this.maxLevel=2,this.free=this.level===2,this.text="Spawn a copy of a friendly Zombie that was destroyed this turn."}ccalZ(){const t=this.ccz(),i=t.length;i>0&&this.spawn(t[S.randInt(0,i)],k.activeA)}ccalT(){return this.ccz().length>0}ccz(){return(k.activeA?L.deathsA:L.deathsB).filter(i=>{const r=W.getCard(i);return r.type==="C"&&r.isTribe("ZB")})}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,i=E.tick();p.qEnemyCreats().forEach(r=>{this.smack(r,t,i)})}get cyb(){return this.lValN([5,6,10])}cypeC(){this.faction="A",this.rarity="H",this.name="Cypien Experimentation";const t=this.cyb;this.text=`Give a random friendly creature ${y.jr9(t,0)}. Give a random friendly creature Armor ${t}`}cypeZ(){const t=p.ddf1(),i=t.length;if(i>0){const r=this.cyb,a=t[S.randInt(0,i)],c=t[S.randInt(0,i)];this.logAct(!1,a,c),this.buffA(a,r),c.addArmor(r)}}dcurC(){this.faction="N",this.rarity="R",this.name="Death Current";const t=this.lValS(["a level 2 or lower","an","two"]);this.text=`Destroy ${t} enemy creature at random.`}dcurZ(){const t=this.dctargs(),i=t.length;if(i>0){const r=S.randInt(0,i),a=E.tick();this.kill(t[r],a),this.level===3&&i>1&&(t.splice(r,1),this.kill(t[S.randInt(0,i-1)],a))}}dcurT(){return this.dctargs().length>0}dctargs(){const t=b.crEnemyTarg();return t.level=w.ddf2(this.level+1),p.creatByTarget(t)}defsC(){this.faction="A",this.rarity="C",this.name="Defense Spire",this.overload=!0,this.maxLevel=1,this.text="Each friendly creature gets Armor 6 this turn."}defsZ(){p.ddf1().forEach(t=>{this.modA(t,b.modT("AR",6))})}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${y.jr9(this.boof4812n,0)} this turn.`}digiZ(){const t=this.boof4812n;p.qEnemyCreats().forEach(i=>{this.modA(i,b.modT("AT",t))})}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${y.jr9(t,t)}.`}epiZ(){const t=this.boof246n,i=b.crEnemyTarg();p.creatByTarget(i).forEach(r=>{this.buffD(r,t)})}ewolC(){this.faction="U",this.rarity="C",this.name="Ether Wolves",this.maxLevel=1,this.overload=!0,this.hints=["ZZ-3"],this.text="Spawn two Ether Wolves."}ewolZ(){const t=E.tick(),i="EWF"+"1",r=k.activeA;this.spawn(i,r,t),this.spawn(i,r,t)}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${y.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;p.ddf1().forEach(i=>{this.buffD(i,t),this.level===3&&(i.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,i=E.tick();p.qActiveCreats().forEach(r=>{this.smack(r,t,i)})}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${y.jr9(-1*t,0)}. Each friendly creature gets ${y.jr9(t,0)}.`}mealZ(){const t=this.boof234,i=k.activeA;p.qActiveCreats().forEach(r=>{const a=r.owner===i?t:-1*t;this.buffA(r,a)})}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${y.jr9(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,i=b.crFriendTarg();p.creatByTarget(i).forEach(r=>{this.buffH(r,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 ${y.jr9(t,t,!0)} and Regenerate ${this.level}.`}infvZ(){const t=this.boof246;this.ivt().forEach(i=>{this.buffD(i,t),this.regn(i,this.level)})}infvT(){return this.ivt().length>0}ivt(){const t=b.crFriendTarg();return t.lanes=[1,5],p.creatByTarget(t)}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;p.qEnemyCreats().forEach(i=>{i.addPoison(t)})}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=W.getCard(this.ndc());this.text=`Spawn a ${y.tokName(t)}.`}shriekZ(){this.spawn(this.ndc(),k.activeA)}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;p.qEnemyCreats().forEach(i=>{i.addPoison(t)})}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${y.jr9(this.boof369,0)}.`)}oforceZ(){if(this.level===3)p.ddf1().forEach(t=>{this.buffA(t,t.attack)});else{const t=this.boof369;p.ddf1().forEach(i=>{this.buffA(i,t)})}}palwC(){this.faction="A",this.rarity="R",this.name="Palladium Wave",this.maxLevel=1,this.text=`Each enemy creature gets ${y.jr9(-1,0).replaceAll("1","X")}, where X is two times your rank.`}palwZ(){const t=-2*k.getActive().rank;p.qEnemyCreats().forEach(i=>{this.buffA(i,t)})}pcallC(){this.faction="T",this.rarity="L",this.name="Phoenix Call";const t=W.getCard(this.cpc());this.text=`Spawn a ${y.tokName(t)}.`}pcallZ(){this.spawn(this.cpc(),k.activeA)}cpc(){return "CYP"+this.level}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=W.getCard(Y.minionCode(this.level));this.text=`Put a ${y.tokName(t)} into each players available lanes.`}phyZ(){const t=Y.minionCode(this.level),i=E.tick();[!0,!1].forEach(r=>{p.emptyLanes(r).forEach(a=>{this.poot(t,r,a,i)})})}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,i=E.tick(),r=p.qEnemyCreats();p.ddf1().forEach(a=>{r.forEach(c=>{this.smack(c,t,i)})})}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=E.tick(),i=b.crFriendTarg();i.faction="T",p.creatByTarget(i).forEach(r=>{this.buffA(r,1);const a=r.opposed;a&&a.hurtDirect(r.attack,r.code,this.faction,t)})}riteC(){this.faction="N",this.rarity="C",this.name="Rite of Undeath",this.text=`Each friendly creature gets Regenerate ${this.boof468}.`}riteZ(){const t=this.boof468;p.ddf1().forEach(i=>{this.regn(i,t)})}roteC(){this.faction="T",this.rarity="H",this.name="Ritual of the Elements",this.maxLevel=1,this.hints=["ZZ-1"],this.text="Spawn a Lava Golem, Frost Hulk, or Lightning Titan at random."}roteZ(){const t=["FRH"+"1","LVG"+"1","LTT"+"1"];this.spawn(t[S.randInt(0,3)],k.activeA)}stsC(){this.faction="U",this.rarity="C",this.name="Scatter the Seeds";const t=W.getCard(Y.minionCode(this.level));this.text=`Spawn three ${y.tokName(t)}s.`}stsZ(){const t=Y.minionCode(this.level),i=E.tick();[1,2,3].forEach(r=>{this.spawn(t,k.activeA,i)})}get spboof(){return(this.level+1)*-2}pulseC(){this.faction="A",this.rarity="H",this.name="Sonic Pulse",this.text=`Each enemy creature gets ${y.jr9(this.spboof,0)}.`}pulseZ(){const t=this.spboof;p.qEnemyCreats().forEach(i=>{this.buffA(i,t)})}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;p.ddf1().forEach(i=>{i.heal(t)})}beesC(){this.faction="U",this.rarity="H",this.name="Stinging Invocation";const t=W.getCard(Y.bee(this.level));this.text=`Spawn one to three ${y.tokName(t)}s.`}beesZ(){const t=Y.bee(this.level),i=E.tick(),r=S.randInt(2,5);[1,2,3].every(a=>a{this.modA(i,b.modT("AT",t))})}talinT(){return this.taltar().length>0}taltar(){const t=b.crFriendTarg();return t.faction="T",p.creatByTarget(t)}turnbC(){this.faction="T",this.rarity="H",this.name="Turnabout",this.free=this.level===3;const t=this.boof235;this.text=`Each creature gets ${y.jr9(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,i=-1*t;p.qActiveCreats().forEach(r=>{this.modA(r,b.modT("AT",t)),this.modA(r,b.modT("HL",i)),this.modA(r,b.modT("MH",i))})}verdC(){this.faction="U",this.rarity="H",this.name="Verdant Charge";const t=this.verdb;this.text=`Each friendly creature gets ${y.jr9(t,t,!0)} and Regenerate ${t}.`}verdZ(){const t=this.verdb;p.ddf1().forEach(i=>{this.buffD(i,t),this.regn(i,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 ${y.jr9(1,1).replaceAll("1","X")}, where X is your rank.`}wdenZ(){const t=k.getActive().rank;p.ddf1().forEach(i=>{this.buffD(i,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(i=>{const r=k.toPlayer(i);r.effects=[],r.mods=[],r.triggers=r.triggers.filter(a=>a.customCode==="AB"||a.type==="NT"),r.poison=0,r.armor=0});const t=p.qActiveCreats();t.forEach(i=>{i.preWipe()}),t.forEach(i=>{i.wipeAll()})}}class Dr 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=this.rawNug(0,0,0,0,.5,"TW")}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){const i=this.buddies(t.id);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.emptySloots(p.jr5(i[1]),p.ddf6(t).id);r.push(T.cancelAction()),T.ddf5(r)}else{const r=p.jr5(i[2]);this.logAct(!0,r),this.lurk(r,t.lane),p.jr5(i[1]).endActivation()}}emptySloots(t,i=""){return T.emptyAdjacents(t,S.enTil("P2",t.id,i))}buddies(t){return w.toActions(b.crFriendNotMeActTarg("CARD",t,this.code,S.enTil("P1",t)))}}class xr 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 i=this.boof357;this.text=`Upgrade Dinosaur: Replace Bron with a level ${this.level} Dino Knight.~When this ${y.dbdtap()}, heal ${i} damage from each other friendly creature.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("UP");const a=r.jr4("DM");return a.bonus=this.buffNug(0,this.boof357,"TP"),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=I.toReplaced(t.event).replCreat;r.isTribe("DN")&&this.replc("DNK"+this.level,r.owner,r.lane)}else if(t.trigger.type==="DM"){const i=this.boof357,r=b.crNotMeTarg(t.creatId);r.player=k.toTarget(t.owner),p.creatByTarget(r).forEach(c=>c.heal(i))}x.triggerDone()}}class Br 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,i){const r=super.jr3(t,i);return r.jr4("PT"),r}ddf8(t){return t.event.playerA===t.owner}jr8(t){const i=p.creatByTr(t);this.modA(i,b.modT("AR",this.boof2510)),this.modA(i,b.modT("DF",!0)),x.triggerDone()}}class Hr extends vt{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Bulwark Bash",this.text=`Deal damage equal to ${this.level>1?this.level+"x ":""}the Armor on a friendly creature to an enemy creature.`}firstT(){if(this.enemyTargActions().length>0){const t=b.crFriendActTarg("CARD",this.code,"P1");return t.hasArmor=!0,t}else return}playTargets(){return[this.firstT()]}canPlay(){const t=this.firstT();return t?p.creatByTarget(t).length>0:!1}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.enemyTargActions(p.ddf6(t).id);r.push(T.cancelAction()),T.ddf5(r)}else{const r=p.jr5(i[1]);this.logSpell(r),this.smack(p.ddf6(t),r.armor*this.level),T.spellCast()}}enemyTargActions(t=""){const i=b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return w.toActions(i)}}class Nr 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} ${y.dbdtac(this.level)}, destroy it.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}ddf8(t){const i=I.toDamage(t.event);return i.battle&&i.isCreatSrc&&i.isCreatTarg&&i.srcId===t.creatId&&w.levelTestCommon(i.hurtCreat.level,this.level)}jr8(t){if(t.trigger.type==="FR"&&L.allied("N")){const i=p.creatByTr(t),r=i.jr4("DM");r.bonus=this.avgSpawnNug(),i.changed=!0,i.anim8("N")}else if(t.trigger.type==="DM"){const r=I.toDamage(t.event).hurtCreat;r.status==="A"&&Bt.destroy(r,this.code,"N")}x.triggerDone()}}class Fr 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 i=this.level===4?`When ${this.name} ${y.dbdtap()}, deal damamge to that player equal to their health.~`:"";this.text=i+`When ${this.name} ${y.dbdtac(this.level)}, destroy that creature.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return this.level===4?a.bonus=this.rawNug(0,0,0,0,5,"TP"):a.bonus=this.avgSpawnNug(),r}ddf8(t){const i=I.toDamage(t.event);if(i.battle&&i.isCreatSrc&&i.srcId===t.creatId){if(this.level===4)return!0;if(i.isCreatTarg){const r=i.hurtCreat;return w.levelTestCommon(r.level,this.level)}}return!1}jr8(t){const i=I.toDamage(t.event);if(i.isCreatTarg){const r=i.hurtCreat;r.status==="A"&&this.kill(r)}else this.ouch(i.hurtPlayer,i.hurtPlayer.health),this.anim8(i.srcCreat);x.triggerDone()}}class ve extends vt{lookup(t){return{["ABL"]:{c:()=>this.ablC(),z:r=>this.ablZ(r)},["DYB"]:{c:()=>this.drybC(),z:r=>this.drybZ(r)},["FVA"]:{c:()=>this.fervassC(),z:r=>this.fervassZ(r)},["ROG"]:{c:()=>this.rotgC(),z:r=>this.rotgZ(r)},["SPG"]:{c:()=>this.spgrC(),z:r=>this.spgrZ(r)},["TOB"]:{c:()=>this.blightC(),z:r=>this.blightZ(r)},["ULG"]:{c:()=>this.ulegC(),z:r=>this.ulegZ(r)},["VOB"]:{c:()=>this.vobC(),z:r=>this.vobZ(r)},["WGE"]:{c:()=>this.weguC(),z:r=>this.weguZ(r)}}[t]}playTarg;xl=!0;constructor(t){super(t),this.playTarg=b.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}canPlay(){return p.creatByTarget(this.playTarg).length>0}playTargets(){return[this.playTarg]}handleAction(t){const i=p.ddf6(t);this.logSpell(this.xl?i:void 0),this.lookup(this.cardCode()).z(i),T.spellCast()}ddf8(t){const i=Wt.extractCardCode(t.trigger.logicCode);if(i==="TOB"&&t.trigger.type==="DM"){const r=I.toDamage(t.event);if(r.battle&&r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId)return this.level===3?!0:W.getCard(r.hurtCreat.code).level<=this.level}else if((i==="ABL"||i==="VOB"||i==="WGE")&&t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId}else if(i==="DYB"&&t.trigger.type==="EF"){const r=I.toEnterField(t.event);return t.trigger.creatId!==r.creature.id&&r.creature.owner===t.owner}else{if(i==="SPG"&&t.trigger.type==="TS")return t.event.playerA===t.owner;if(i==="ROG"&&t.trigger.type==="DS"||i==="WGE"&&t.trigger.type==="PT"||i==="ULG"&&t.trigger.type==="VN"||i==="FVA"&&t.trigger.type==="FK")return!0}return!1}jr8(t){const i=Wt.extractCardCode(t.trigger.logicCode);if(i==="TOB"){const r=t.event,a=p.jr5(r.target);a.status==="A"&&this.kill(a)}else if(i==="FVA"){const r=p.creatByTr(t),a=p.searchByLane(p.oppositeLane(r.lane),!r.owner);a&&a.hurtDirect(this.boof3612,r.code,this.faction)}else if(i==="ROG"||i==="DYB"||i==="ABL"){const r=p.creatByTr(t);r.status==="A"&&(this.logAct(!1,r),r.buff(this.level,this.level,t.draw?this.faction:"X"))}else if(i==="VOB"){const r=I.toDamage(t.event);this.smack(r.srcCreat,r.dmg)}else if(i==="SPG"){const r=p.creatByTr(t);this.logAct(!1,r),this.buffD(r,this.boof246)}else if(i==="WGE"){if(t.trigger.type==="DM")this.balm(t.owner,t.event.dmg);else if(t.trigger.type==="PT"){const r=t.trigger.customCode,a=p.creatByTr(t);a.triggers.filter(f=>f.customCode===r).forEach(f=>a.removeTrigger(f))}}else if(i==="ULG"){const r=this.spawn(p.creatByTr(t).code,t.owner);r&&this.logAct(!1,r)}else super.jr8(t);x.triggerDone()}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${y.dbdtap()}, it gets ${y.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}ablZ(t){t.changed=!0;const i=t.jr4("DM",this.code);i.bonus=this.buffNug(this.level,this.level,"TP"),this.anim8(t)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${y.jr9(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${y.jr9(this.level,this.level)}."`,this.playTarg.hint=["BF"]}drybZ(t){this.buffD(t,this.level),t.changed=!0;const i=t.jr4("EF",this.code);i.bonus=this.buffNug(this.level,this.level,"TS"),i.batch=!0}fervassC(){this.faction="T",this.rarity="H",this.name="Fervent Assault",this.playTarg.player="F",this.text=`Give a friendly creature Mobility ${this.level} and "Flank: Deal ${this.boof3612} damage to the opposing creature.`}fervassZ(t){t.changed=!0,this.wings(t,this.level);const i=t.jr4("FK",this.code);i.bonus=this.buffNug(this.boof3612,0)}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 ${y.jr9(this.level,this.level)}."`}rotgZ(t){t.changed=!0;const i=t.jr4("DS",this.code);i.bonus=this.buffNug(this.level,this.level,"TS"),this.anim8(t)}spgrC(){this.faction="U",this.rarity="R",this.name="Shardplate Graft";const t=this.boof246;this.text=`Give a creature ${y.jr9(t,t,!0)}, and "At the start of your turn, this gets ${y.jr9(t,t)}."`,this.playTarg.hint=["BF"]}spgrZ(t){const i=this.boof246;this.buffD(t,i),t.changed=!0;const r=t.jr4("TS",this.code);r.bonus=this.buffNug(i,i,"TS")}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${y.dbdtac(this.level)}, destroy that creature."`,this.playTarg.hint=["BF"],this.level<3&&(this.hints=["LG"])}blightZ(t){t.changed=!0;const i=t.jr4("DM",this.code);i.bonus=this.avgSpawnNug(),this.anim8(t)}ulegC(){this.faction="N",this.rarity="H",this.name="Undying Legacy",this.text='Give a friendly creature "Vengeace: Spawn a copy of this."',this.playTarg.player="F",this.maxLevel=1,this.overload=!0}ulegZ(t){t.changed=!0;const i=t.jr4("VN",this.code),r=W.getCard(t.code);t.hints.push("ST"),i.bonus=this.spawnNug(r),this.anim8(t)}vobC(){this.faction="T",this.rarity="R",this.name="Violent Outburst",this.level===3?this.free=!0:this.hints=["LG"],this.text=`Give a ${y.levelGateText(this.level+1)}creature Aggressive and, "When this creature ${y.dbdtap()}, it also deals that much damage to itself."`}vobZ(t){t.aggressive=!0;const i=t.jr4("DM",this.code);i.changes=!0,this.anim8(t)}weguC(){this.faction="U",this.rarity="H",this.name="Wegu's Embrace";const t=this.boof3510;this.text=`Give a friendly creature ${y.jr9(t,t)}, and "When this deals ${y.dbdtap()} this turn, you gain that much health."`,this.playTarg.player="F"}weguZ(t){const i=E.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=i;const a=t.jr4("PT",this.code);a.customCode=i,this.buffD(t,this.boof3510)}}class Tt extends P{lookup(t){return{["ASQ"]:{c:()=>this.asqC(),a:(r,a)=>this.asqA(r,a),t:r=>this.asqT(r)},["BSW"]:{c:()=>this.bswC(),a:(r,a)=>this.bswA(r,a),t:r=>this.bswT(r)},["CCS"]:{c:()=>this.ccsC(),a:(r,a)=>this.ccsA(r,a),t:r=>this.ccsT(r)},["CGL"]:{c:()=>this.clordC(),a:(r,a)=>this.clordA(r,a),t:r=>this.clordT(r)},["CSH"]:{c:()=>this.cswC(),a:(r,a)=>this.cswA(r,a),t:r=>this.cswT(r)},["FFU"]:{c:()=>this.ffuC(),a:(r,a)=>this.ffuA(r,a),t:r=>this.ffuT(r)},["FFS"]:{c:()=>this.ffsC(),a:(r,a)=>this.ffsA(r,a),t:r=>this.ffsT(r)},["FSH"]:{c:()=>this.fssC(),a:(r,a)=>this.fssA(r,a),t:r=>this.fssT(r)},["KOD"]:{c:()=>this.kodC(),a:(r,a)=>this.kodA(r,a),t:r=>this.kodT(r)},["LOD"]:{c:()=>this.lashC(),a:(r,a)=>this.lashA(r,a),t:r=>this.lashT(r)},["MBP"]:{c:()=>this.mbpC(),a:(r,a)=>this.mbpA(r,a),t:r=>this.mbpT(r)},["MND"]:{c:()=>this.mndC(),a:(r,a)=>this.mndA(r,a),t:r=>this.mndT(r)},["NCS"]:{c:()=>this.ncsC(),a:(r,a)=>this.ncsA(r,a),t:r=>this.ncsT(r)},["NFF"]:{c:()=>this.nffC(),a:(r,a)=>this.nffA(r,a),t:r=>this.nffT(r)},["OHV"]:{c:()=>this.orghC(),a:(r,a)=>this.orghA(r,a),t:r=>this.orghT(r)},["PPM"]:{c:()=>this.ppmC(),a:(r,a)=>this.ppmA(r,a),t:r=>this.ppmT(r)},["PSC"]:{c:()=>this.pcoilC(),a:(r,a)=>this.pcoilA(r,a),t:r=>this.pcoilT(r)},["SGF"]:{c:()=>this.siggyC(),a:(r,a)=>this.siggyA(r,a),t:r=>this.siggyT(r)},["SRM"]:{c:()=>this.srmdC(),a:(r,a)=>this.srmdA(r,a),t:r=>this.srmdT(r)},["SFG"]:{c:()=>this.sfgdC(),a:(r,a)=>this.sfgdA(r,a),t:r=>this.sfgdT(r)},["SSA"]:{c:()=>this.ssaC(),a:(r,a)=>this.ssaA(r,a),t:r=>this.ssaT(r)},["SWM"]:{c:()=>this.swmC(),a:(r,a)=>this.swmA(r,a),t:r=>this.swmT(r)},["UCM"]:{c:()=>this.ucmC(),a:(r,a)=>this.ucmA(r,a),t:r=>this.ucmT(r)},["UIM"]:{c:()=>this.uimC(),a:(r,a)=>this.uimA(r,a),t:r=>this.uimT(r)},["WMR"]:{c:()=>this.warmC(),a:(r,a)=>this.warmA(r,a),t:r=>this.warmT(r)},["WWR"]:{c:()=>this.wwrC(),a:(r,a)=>this.wwrA(r,a),t:r=>this.wwrT(r)},["WFS"]:{c:()=>this.wfsC(),a:(r,a)=>this.wfsA(r,a),t:r=>this.wfsT(r)},["XSH"]:{c:()=>this.shambC(),a:(r,a)=>this.shambA(r,a),t:r=>this.shambT(r)},["ZPM"]:{c:()=>this.zpmC(),a:(r,a)=>this.zpmA(r,a),t:r=>this.zpmT(r)}}[t]}targAction(t,i,r){this.lookup(t).a(i,r)}actTargets(t,i){return this.lookup(t).t(i)}xl=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i);return this.doubleActivator()&&(r.jr4("TS"),this.addExtraActivate(r)),r}canActivate(t){return w.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){const i=w.toActions([this.actTargets(this.cardCode(),t),w.buttonTarget("CANC")]);T.ddf5(i)}handleAction(t){const i=p.ddf6(t),r=p.jr5(t.param);this.logAct(!0,this.xl?i:void 0),this.targAction(this.cardCode(),i,r),r.endActivation()}makeCreatTarg(t){return b.crActTarg("CARD",this.code,t.id)}makeOtherCreatTarg(t){const i=this.makeCreatTarg(t);return i.notMe=t.id,i}doubleActivator(){return this.code==="CGL"+"3"||this.code==="XSH"+"3"}ddf8(t){return Wt.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")this.spawn(p.jr5(t.event.creatId).code,t.owner),x.triggerDone();else if(t.trigger.type==="PT"){const i=t.trigger.customCode,r=p.creatByTr(t);r.triggers.filter(c=>c.customCode===i).forEach(c=>r.removeTrigger(c)),x.triggerDone()}else t.trigger.type==="TS"&&(this.addExtraActivate(p.creatByTr(t)),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=this.multNug(this.buffNug(t[0],t[1],"TS"),.7)}asqT(t){const i=this.makeCreatTarg(t);return i.tribe="WB",i}asqA(t,i){this.buffB(i,t.attack,t.health),this.kill(t)}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=this.buffNug(0,t,"TX")}bswT(t){const i=this.makeCreatTarg(t);return i.hint=["HR"],i}bswA(t,i){this.smack(t,this.boof234)}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=this.regnNug(t,"TW")}ccsT(t){const i=this.makeOtherCreatTarg(t);return i.canRegen=!0,i.hint=["BF"],i}ccsA(t,i){this.regn(t,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=this.multNug(this.avgSpawnNug(),.3),this.bonus.threat="TX"}clordT(t){const i=this.makeCreatTarg(t);return i.player="F",i.tribe="AB",i}clordA(t,i){this.kill(t),L.freePlay(),this.anim8(i)}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=this.regnNug(t,"TW")}cswT(t){const i=this.makeCreatTarg(t);return i.canArmor=!0,i.hint=["BF"],i}cswA(t,i){this.modA(t,b.modT("AR",this.boof246))}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=this.buffNug(0,this.iAttack,"TX")}ffuT(t){const i=this.makeCreatTarg(t);return i.hint=["HR"],t.attack<1&&(i.victims="???"),i}ffuA(t,i){this.smack(t,i.attack)}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 ${y.jr9(this.iAttack,0)} this turn.`,this.bonus=this.buffNug(this.iAttack,0,"TW")}ffsT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["BF"],i}ffsA(t,i){this.modA(t,b.modT("AT",this.iAttack))}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 ${y.levelGateText(this.level)}creature Aggressive.`,this.bonus=this.regnNug(1,"TX")}fssT(t){const i=this.makeCreatTarg(t);return i.level=w.ddf2(this.level),i.lanes=t.adjacent,i.player="F",i}fssA(t,i){t.aggressive=!0,this.anim8(t)}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 ${y.levelGateText(this.level)}creature gets "Vengeance: Spawn this" this turn.`,this.bonus=this.rawNug(0,0,0,0,.5,"TX")}kodT(t){const i=this.makeOtherCreatTarg(t);return i.level=w.ddf2(this.level),i.player="F",i}kodA(t,i){const r=t.jr4("VN",this.code);r.customCode=i.id,r.changes=!0;const a=t.jr4("PT",this.code);a.customCode=i.id,this.anim8(t)}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=this.rawNug(0,0,0,0,.1,"TW")}lashT(t){const i=this.makeCreatTarg(t);return i.player="E",i.hasPoison=!0,i.canDefender=!0,i}lashA(t,i){t.defender=!0,this.anim8(t)}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 ${y.jr9(0,t)}.`,this.bonus=this.buffNug(0,t,"TW")}mbpT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["BF"],i}mbpA(t,i){this.buffH(t,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 ${y.jr9(t,0)}.`,this.bonus=this.buffNug(t,0,"TX")}mndT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["BF"],i}mndA(t,i){this.buffA(t,this.boof357)}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 ${y.jr9(t,t)}.`,this.bonus=this.buffNug(t,t-3,"TS")}ncsT(t){const i=this.makeOtherCreatTarg(t);return i.player="F",i}ncsA(t,i){this.smack(t,3),this.buffD(i,this.boof248)}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=W.getCard(Y.tffc(this.level));this.text=`Activate: Replace a friendly Plant with a ${y.tokName(t)}.`,this.bonus=this.multNug(this.spawnNug(t,"TX"),.5)}nffT(t){const i=this.makeCreatTarg(t);return i.player="F",i.tribe="PL",i}nffA(t,i){this.replc(Y.tffc(this.level),i.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 ${y.levelGateText(this.level)}creature.`,this.bonus=this.multNug(this.avgSpawnNug(),.4),this.bonus.threat="TX"}orghT(t){const i=this.makeOtherCreatTarg(t);return i.level=w.ddf2(this.level),i.hint=["KL"],i}orghA(t,i){const r=E.tick();this.kill(t,r),this.kill(i,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 ${y.jr9(this.boof4812n,0)} this turn.`,this.bonus=this.buffNug(this.boof246,0,"TW")}ppmT(t){const i=this.makeCreatTarg(t);return i.hint=["DB","DF"],i}ppmA(t,i){this.modA(t,b.modT("AT",this.boof4812n))}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=this.regnNug(t,"TX")}pcoilT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["PN","DF"],i}pcoilA(t,i){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=this.playerNug(t,"TW")}siggyT(t){const i=this.makeOtherCreatTarg(t);return i.player="F",i}siggyA(t,i){this.kill(t);const r=this.boof4812;this.ouch(!i.owner,r),this.balm(i.owner,r),this.anim8(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=this.multNug(this.avgSpawnNug(),.4),this.bonus.threat="TX"}srmdT(t){const i=this.makeCreatTarg(t);return i.player="E",i.maxAttack=this.iAttack,i}srmdA(t,i){this.kill(t)}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=this.playerNug(5,"TW")}sfgdT(t){const i=this.makeOtherCreatTarg(t);return i.cardCode="SFG",this.level===3&&(i.level="L3"),i}sfgdA(t,i){const r=E.tick();this.kill(t,r),this.kill(i,r);const a=this.lValS(["SFG"+"2","SFG"+"3","FGO"+"1"]);this.spawn(a,i.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 ${y.jr9(t,t)}.`,this.bonus=this.buffNug(-t,0,"TX")}ssaT(t){const i=this.makeCreatTarg(t);return i.hint=["DB","BB"],i}ssaA(t,i){const r=this.boof246n,a=E.tick();this.smack(i,-r,a),this.buffD(t,r,a)}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=this.regnNug(this.level,"TW")}swmT(t){const i=this.makeOtherCreatTarg(t);return i.canArmor=!0,i.hint=["BF","BB"],i}swmA(t,i){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=this.buffNug(0,t,"TW")}ucmT(t){const i=this.makeCreatTarg(t);return i.hint=["HR"],i}ucmA(t,i){this.smack(t,this.boof135)}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 from a creature this turn.",this.bonus=this.regnNug(1,"TW")}uimT(t){const i=this.makeCreatTarg(t);return i.hasDefender=!0,i.hint=["BB"],i}uimA(t,i){this.modA(t,b.modT("ND",!0))}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 ${y.jr9(this.iAttack,t)}.`,this.bonus=this.multNug(this.buffNug(this.iAttack,t,"TX"),.5)}warmT(t){const i=this.makeCreatTarg(t);return i.lanes=3,i.hint=["BF","BB"],i}warmA(t,i){this.buffB(t,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 ${y.jr9(this.level,this.level)}.`,this.bonus=this.buffNug(this.level,this.level,"TW")}wwrT(t){const i=this.makeOtherCreatTarg(t);return i.hint=["BF"],i}wwrA(t,i){this.buffD(t,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 ${y.jr9(-t,-t)} this turn.`,this.bonus=this.buffNug(t,t,"TX")}wfsT(t){const i=this.makeCreatTarg(t);return i.hint=["DB","DF"],i}wfsA(t,i){const r=-this.boof357;this.modA(t,b.modT("AT",r)),this.modA(t,b.modT("HL",r)),this.modA(t,b.modT("MH",r))}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=this.rawNug(0,0,0,0,this.lValN([.6,1.2,2.2]),"TS")}shambT(t){const i=b.crFriendActTarg("CARD",this.code,t.id);return i.lanes=t.adjacent,i}shambA(t,i){const r=t.attack,a=t.health;this.kill(t),this.lurk(i,t.lane),this.buffB(i,r,a)}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 ${y.levelGateText(this.level)}creature Mobility ${this.level}.`,this.bonus=this.regnNug(this.level,"TW")}zpmT(t){const i=this.makeOtherCreatTarg(t);return i.level=w.ddf2(this.level),i.canMove=!0,i.hint=["BF","BB"],i}zpmA(t,i){this.wings(t,this.level)}}class yi extends P{lookup(t){return{["CMF"]:{c:()=>this.aconC(),f:(r,a)=>this.aconF(r,a)},["FLH"]:{c:()=>this.flhC(),f:(r,a)=>this.flhF(r,a)},["TBB"]:{c:()=>this.tbbC(),f:(r,a)=>this.tbbF(r,a)}}[t]}targAction(t,i,r){this.lookup(t).f(i,r)}playTarg;optional=!1;notme=!1;ftext="";constructor(t){super(t),this.playTarg=b.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("AS");return a.interactive=!0,r}handleAction(t){this.targAction(this.cardCode(),p.ddf6(t),p.jr5(t.param)),T.actionDone(!0)}jr8(t){this.notme&&(this.playTarg.notMe=t.creatId);const i=w.toActions(this.playTarg);i.length>0?(i.forEach(r=>{r.param=t.creatId}),this.optional&&i.push(T.noneEndTrigger()),T.ddf5(i)):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 ${y.jr9(t,t)}.`}aconF(t,i){this.logAct(!1,t),this.buffD(t,-this.boof234)}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,i){this.smack(t,this.iAttack)}tbbC(){this.faction="T",this.rarity="R",this.name="Totembound Berserker",this.iAttack=this.boof81318,this.iHealth=this.lValN([2,4,10]),this.tribe.push("GT"),this.playTarg.player="E",this.playTarg.level=w.ddf2(this.level),this.optional=!0,this.ftext=`You may move an enemy ${y.levelGateText(this.level)}creature to the space opposing ${this.name}.`}tbbF(t,i){i.opposed||(this.logAct(!1,t),this.lurk(t,p.oppositeLane(i.lane)))}}class mt extends P{lookup(t){return{["ABM"]:{c:()=>this.mawC(),f:(r,a)=>this.mawF(r,a)},["AGC"]:{c:()=>this.aconC(),f:(r,a)=>this.aconF(r,a)},["BTI"]:{c:()=>this.binvC(),f:(r,a)=>this.binvF(r,a)},["BSR"]:{c:()=>this.bsrC(),f:(r,a)=>this.bsrF(r,a)},["BAW"]:{c:()=>this.bawC(),f:(r,a)=>this.bawF(r,a)},["CKB"]:{c:()=>this.cacC(),f:(r,a)=>this.cacF(r,a)},["CHA"]:{c:()=>this.chaC(),f:(r,a)=>this.chaF(r,a)},["CCR"]:{c:()=>this.ccC(),f:(r,a)=>this.ccF(r,a)},["DRS"]:{c:()=>this.drsC(),f:(r,a)=>this.drsF(r,a)},["DSE"]:{c:()=>this.dseC(),f:(r,a)=>this.dseF(r,a)},["DSA"]:{c:()=>this.dsaC(),f:(r,a)=>this.dsaF(r,a)},["DGS"]:{c:()=>this.drslC(),f:(r,a)=>this.drslF(r,a)},["FRI"]:{c:()=>this.friC(),f:(r,a)=>this.friF(r,a)},["FRV"]:{c:()=>this.freavC(),f:(r,a)=>this.freavF(r,a)},["FLC"]:{c:()=>this.flcC(),f:(r,a)=>this.flcF(r,a)},["GLF"]:{c:()=>this.gfiendC(),f:(r,a)=>this.gfiendF(r,a)},["GRW"]:{c:()=>this.grwC(),f:(r,a)=>this.grwF(r,a)},["GHT"]:{c:()=>this.grhC(),f:(r,a)=>this.grhF(r,a)},["MMH"]:{c:()=>this.houndC(),f:(r,a)=>this.houndF(r,a)},["MXW"]:{c:()=>this.mtxC(),f:(r,a)=>this.mtxF(r,a)},["NGB"]:{c:()=>this.ngbC(),f:(r,a)=>this.ngbF(r,a)},["POA"]:{c:()=>this.poaC(),f:(r,a)=>this.poaF(r,a)},["PHS"]:{c:()=>this.phxsC(),f:(r,a)=>this.phxsF(r,a)},["RWD"]:{c:()=>this.rotC(),f:(r,a)=>this.rotF(r,a)},["SHY"]:{c:()=>this.schyC(),f:(r,a)=>this.schyF(r,a)},["STD"]:{c:()=>this.stdC(),f:(r,a)=>this.stdF(r,a)},["SIX"]:{c:()=>this.sdxC(),f:(r,a)=>this.sdxF(r,a)},["SEV"]:{c:()=>this.surzC(),f:(r,a)=>this.surzF(r,a)},["VNF"]:{c:()=>this.vnfC(),f:(r,a)=>this.vnfF(r,a)},["WBY"]:{c:()=>this.wbyC(),f:(r,a)=>this.wbyF(r,a)},["WBU"]:{c:()=>this.wbuC(),f:(r,a)=>this.wbuF(r,a)},["XDH"]:{c:()=>this.dogsC(),f:(r,a)=>this.dogsF(r,a)}}[t]}targAction(t,i,r){this.lookup(t).f(i,r)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=b.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}jr3(t,i){const r=super.jr3(t,i);if(this.forges){const a=r.jr4("FR");a.interactive=!0}return r}ddf8(t){return Wt.extractCardCode(t.trigger.logicCode)==="CKB"}handleAction(t){this.targAction(this.cardCode(),p.ddf6(t),p.jr5(t.param)),T.actionDone(!0)}jr8(t){const i=this.cardCode();if(t.trigger.type==="TS"&&i==="CKB"){this.logAct(!1),L.freePlay();const a=t.event,c=k.toPlayer(a.playerA),f=b.trigIdx(c.triggers,t.trigger);f>-1&&c.triggers.splice(f,1),x.triggerDone();return}if(i==="ABM"){const a=b.crFriendNotMeTarg(t.creatId);if(a.tribe="AB",p.creatByTarget(a).length===0){x.triggerDone();return}}if(i==="POA"&&!L.patron("A")){x.triggerDone();return}if((i==="DRS"||i==="DSE"||i==="DSA")&&this.dfbuff(t.creatId)===0){x.triggerDone();return}this.notme&&(this.playTarg.notMe=t.creatId);const r=w.toActions(this.playTarg);r.length>0?(r.forEach(a=>{a.param=t.creatId}),this.optional&&r.push(T.noneEndTrigger()),T.ddf5(r)):x.triggerDone()}dfbuff(t){const i=b.crFriendNotMeTarg(t);return i.tribe="DF",this.boof234*p.creatByTarget(i).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 ${y.jr9(t,t)}.`}mawF(t,i){this.logAct(!1,t),this.buffD(t,-this.boof359)}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,i){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 ${y.jr9(-this.iAttack,0)}.`}binvF(t,i){this.logAct(!1,t),this.buffA(t,-this.iAttack)}bsrC(){if(this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.iAttack=this.boof5813,this.iHealth=this.boof3712,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.playTarg.level=w.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy an enemy ${y.levelGateText(t)}creature.`,this.optional=!0}else this.hints=["LG"]}bsrF(t,i){this.kill(t)}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,i){this.logAct(!1,t),this.modA(t,b.modT("BT",!0))}cacC(){this.faction="N",this.rarity="H",this.name="Cacklebones",this.iAttack=this.boof5915,this.iHealth=this.iAttack-this.level,this.tribe.push("SK"),this.playTarg.level=w.ddf2(this.level),this.playTarg.player="E",this.ftext=`Destroy an enemy ${y.levelGateText(this.level)}creature. If you do, the enemy player may play an additional card next turn.`,this.optional=!0}cacF(t,i){this.kill(t),k.addTr(t.owner,b.trigger("TS",this.code))}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,i){this.smack(t,this.boof4816),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,i){this.kill(t)}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 ${y.jr9(0,t)} for each other friendly Darkforged.`}drsF(t,i){this.logAct(!1,t),this.buffH(t,this.dfbuff(i.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 ${y.jr9(t,0)} for each other friendly Darkforged.`}dseF(t,i){this.logAct(!1,t),this.buffA(t,this.dfbuff(i.id))}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,i){this.smack(t,this.dfbuff(i.id))}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=w.ddf2(this.level),this.playTarg.tribe="DG",this.ftext=`Destroy an enemy ${y.levelGateText(this.level)}Dragon.`}drslF(t,i){this.kill(t)}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,i){this.logAct(!1,t),t.negDefend("T")}freavC(){if(this.faction="N",this.rarity="H",this.name="Fleshreaver",this.iAttack=this.boof6915,this.iHealth=this.boof235,this.tribe.push("AB"),this.forges=this.level>1,this.forges){const t=this.level-1;this.consistent=!0,this.playTarg.level=w.ddf2(t),this.playTarg.player="E",this.ftext=`You may destroy a ${y.levelGateText(t)}enemy creature.`,this.optional=!0}else this.hints=["LG"]}freavF(t,i){this.kill(t)}flcC(){this.faction="A",this.rarity="L",this.name="Frontline Combatant",this.iAttack=this.boof4612,this.iHealth=this.iAttack,this.iArmor=this.iAttack,this.tribe.push("HM"),this.optional=!0,this.playTarg.player="E",this.ftext=`You may have ${this.name} deal damage equal to its Armor to an enemy creature. If you do, that creature deals damage equal to its attack back to ${this.name}.`}flcF(t,i){const r=E.tick(),a=t.attack;this.smack(t,i.armor,r),i.hurtDirect(a,t.code,this.faction,r)}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 ${y.jr9(t,t)}.`,this.optional=!0}gfiendF(t,i){this.logAct(!1,t),this.buffD(t,this.fiendBof)}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,i){this.kill(t)}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 ${y.jr9(t,t)}.`}grhF(t,i){this.logAct(!1,t),this.buffD(t,this.boof135)}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,i){this.smack(t,this.boof246)}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 ${y.jr9(t,0)}.`}mtxF(t,i){this.logAct(!1,t),this.buffA(t,this.boof3510)}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 ${y.jr9(0,t)}.`}ngbF(t,i){this.logAct(!1,t),this.buffH(t,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=w.ddf2(this.level),this.playTarg.hint=["BF"],this.ftext=`If you have three or more Alloyin cards in your hand, give a ${y.levelGateText(this.level)}creature 2x attack.`}poaF(t,i){this.logAct(!1,t),this.buffA(t,t.attack)}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 ${y.jr9(t,t)}.`}phxsF(t,i){this.logAct(!1,t),this.buffD(t,this.boof234)}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,i){this.kill(t)}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,i){this.smack(t,3)}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,i){this.logAct(!1,t);const r=t.regen;t.negateRegen=!0,this.regn(i,r)}sdxC(){this.faction="A",this.rarity="R",this.name="Stasis Indexer",this.iAttack=this.boof369,this.iHealth=this.boof71118,this.tribe.push("MM"),this.playTarg.level=w.ddf2(this.level),this.playTarg.canDefender=!0,this.ftext=`Give a ${y.levelGateText(this.level)}creature Defender until the end of the enemy player's next turn.`}sdxF(t,i){const r=b.mod("DF",!0);r.expiry="EN",this.modA(t,r)}surzC(){this.faction="N",this.rarity="L",this.name="Suruzal, Emissary of Varna",this.iAttack=this.boof4814,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.optional=!0,this.playTarg.player="F",this.playTarg.level=w.ddf2(this.level),this.notme=!0,this.ftext=`You may destroy another friendly ${y.levelGateText(this.level)}creature. If you do, spawn a copy of it.`}surzF(t,i){const r=E.tick();this.kill(t,r),this.spawn(t.code,i.owner,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,i){this.logAct(!1,t),t.addPoison(this.boof246)}wbyC(){this.faction="T",this.rarity="R",this.name="Wallbreaker Yeti",this.iAttack=this.boof4712,this.iHealth=this.boof71116,this.tribe.push("ER","YT"),this.playTarg.player="E",this.playTarg.level=w.ddf2(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${y.levelGateText(this.level)}enemy creature with Defender.`,this.optional=!0}wbyF(t,i){this.kill(t)}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 ${y.jr9(t,0)} this turn.`}wbuF(t,i){this.logAct(!1,t),this.modA(t,b.modT("AT",this.boof4812))}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 ${y.jr9(-4,-4)}.`}dogsF(t,i){this.logAct(!1,t),this.buffD(t,-4)}}class $ extends vt{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)},["AVB"]:{c:()=>this.anvbC(),z:r=>this.anvbZ(r)},["AQE"]:{c:()=>this.aqatC(),z:r=>this.aqatZ(r)},["AOP"]:{c:()=>this.armoC(),z:r=>this.armoZ(r)},["BFT"]:{c:()=>this.bftC(),z:r=>this.bftZ(r)},["BZH"]:{c:()=>this.bzhC(),z:r=>this.bzhZ(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)},["BLP"]:{c:()=>this.btpC(),z:r=>this.btpZ(r)},["CHT"]:{c:()=>this.chatC(),z:r=>this.chatZ(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)},["DPO"]:{c:()=>this.dpsC(),z:r=>this.dpsZ(r)},["DDF"]:{c:()=>this.dendC(),z:r=>this.dendZ(r)},["DBT"]:{c:()=>this.dreadC(),z:r=>this.dreadZ(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)},["FOR"]:{c:()=>this.fitrC(),z:r=>this.fitrZ(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)},["MMY"]:{c:()=>this.maggyC(),z:r=>this.maggyZ(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)},["RPR"]:{c:()=>this.rpsC(),z:r=>this.rpsZ(r)},["SAP"]:{c:()=>this.sapC(),z:r=>this.sapZ(r)},["SVO"]:{c:()=>this.soathC(),z:r=>this.soathZ(r)},["SOC"]:{c:()=>this.scythC(),z:r=>this.scythZ(r)},["SOA"]:{c:()=>this.soaC(),z:r=>this.soaZ(r)},["SOD"]:{c:()=>this.sodC(),z:r=>this.sodZ(r)},["SOT"]:{c:()=>this.sotC(),z:r=>this.sotZ(r)},["SHG"]:{c:()=>this.shgrC(),z:r=>this.shgrZ(r)},["SNB"]:{c:()=>this.snbC(),z:r=>this.snbZ(r)},["SHV"]:{c:()=>this.sharvC(),z:r=>this.sharvZ(r)},["SRP"]:{c:()=>this.sreapC(),z:r=>this.sreapZ(r)},["STR"]:{c:()=>this.sttorC(),z:r=>this.sttorZ(r)},["STO"]:{c:()=>this.sptorC(),z:r=>this.sptorZ(r)},["SOV"]:{c:()=>this.sovC(),z:r=>this.sovZ(r)},["STN"]:{c:()=>this.stbrnC(),z:r=>this.stbrnZ(r)},["STP"]:{c:()=>this.ssperC(),z:r=>this.ssperZ(r)},["SIN"]:{c:()=>this.sinC(),z:r=>this.sinZ(r)},["TGL"]:{c:()=>this.tanglC(),z:r=>this.tanglZ(r)},["TPT"]:{c:()=>this.tpactC(),z:r=>this.tpactZ(r)},["TUP"]:{c:()=>this.tugC(),z:r=>this.tugZ(r)},["TOT"]:{c:()=>this.totsC(),z:r=>this.totsZ(r)},["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)},["VTR"]:{c:()=>this.vrshC(),z:r=>this.vrshZ(r)},["VGL"]:{c:()=>this.vglchC(),z:r=>this.vglchZ(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,i){this.lookup(t).z(i)}playTarg;xl=!0;constructor(t){super(t),this.playTarg=b.crActTarg("CARD",this.code,""),this.lookup(this.cardCode()).c()}canPlay(){const t=this.cardCode();if(t==="NSL"&&p.ddf1().length<5)return!1;const i=t==="FOR"?this.fitTarg():this.playTarg;return p.creatByTarget(i).length>0}playTargets(){return this.cardCode()==="FOR"?[this.fitTarg()]:[this.playTarg]}handleAction(t){const i=p.ddf6(t);this.logSpell(this.xl?i:void 0),this.cardCast(this.cardCode(),i),T.spellCast()}ddf8(t){const i=Wt.extractCardCode(t.trigger.logicCode);if(i==="OEX"&&t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.isCreatTarg&&r.isCreatSrc&&r.srcId===t.creatId}else if((i==="FZS"||i==="IFR")&&t.trigger.type==="DM"){const r=t.event;if(r.isCreatTarg&&r.target===t.creatId)return!0}else if(i==="NDY"&&t.trigger.type==="DS"||i==="SHG"&&(t.trigger.type==="PT"||t.trigger.type==="VN")||(i==="IFR"||i==="OEX")&&t.trigger.type==="PT")return!0;return!1}jr8(t){const i=Wt.extractCardCode(t.trigger.logicCode);if(i==="FZS"||i==="IFR"&&t.trigger.type==="DM"){const r=p.creatByTr(t);r.status==="A"&&this.kill(r)}else if(i==="SHG"){if(t.trigger.type==="VN")this.spawn(p.jr5(t.event.creatId).code,t.owner);else if(t.trigger.type==="PT"){const r=t.trigger.customCode,a=p.creatByTr(t);a.triggers.filter(f=>f.customCode===r).forEach(f=>a.removeTrigger(f))}}else if(i==="IFR"&&t.trigger.type==="PT"){const r=S.deTil(t.trigger.customCode),a=r[1],c=p.creatByTr(t);if(r[0]==="P2"){const f=b.trigIdx(c.triggers,t.trigger);c.triggers[f].customCode=S.enTil("P1",a)}else{const f=c.triggers.find(m=>m.customCode===a);f&&c.removeTrigger(f),c.removeTrigger(t.trigger)}}else if(i==="OEX"){if(t.trigger.type==="DM"){const r=t.event,a=p.qEnemyCreats(),c=a.length,f=E.tick();let m;c>0&&(this.level===1?m=[a[S.randInt(0,c)]]:this.level===2?(m=a.splice(S.randInt(0,c),1),a.length>0&&m.push(a[S.randInt(0,c-1)])):m=a,m.forEach(C=>C.hurtDirect(r.dmg,this.code,"T",f)))}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,a=p.creatByTr(t);a.triggers.filter(f=>f.customCode===r).forEach(f=>a.removeTrigger(f))}}else if(i==="NDY"){const r=p.creatByTr(t);r.status==="A"&&(this.logAct(!1,r),this.buffD(r,this.ndcbuf))}else super.jr8(t);x.triggerDone()}rankT(){return`If you are rank ${this.level+1} or higher`}icaf(t){return`. If that creature is ${y.factionText(t)}, `}formFun(t){if(!(t.lane===1||t.lane===5)){const i=b.crTarg();i.player=k.toTarget(t.owner),i.lanes=t.adjacent;const r=p.creatByTarget(i);if(r.length===2)return r}return[]}awingC(){this.faction="A",this.rarity="R",this.name="Aegis Wings",this.text=`Give a creature ${y.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){this.buffA(t,this.boof369);const i=t.attack;p.qActiveCreats().every(r=>r.attack<=i)&&(this.wings(t,1),t.addArmor(this.boof246))}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.free=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){this.wings(t,this.level)}anatC(){this.faction="A",this.rarity="C",this.name="Anatomize",this.playTarg.hint=["DB"],this.text=`Give a creature ${y.jr9(-this.boof4816,0)}.~You may play an additional ${this.name} this turn.`}anatZ(t){this.buffA(t,-this.boof4816);const i=L.freeCard(this.code);i.condition.cardCode="ATZ"}anvbC(){this.faction="A",this.rarity="T",this.name="Anvilbreaker",this.free=!0,this.maxLevel=1,this.playTarg.player="E",this.text=`Give an enemy creature ${y.jr9(-2,0)}, then move it to another available lane at random.`}anvbZ(t){this.buffA(t,-2),p.fling(t,"A")}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${y.jr9(0,this.boof51015)}.`,this.playTarg.hint=["BF"]}aqatZ(t){this.buffH(t,this.boof51015)}armoC(){this.faction="A",this.rarity="R",this.name="Armory Outpost",this.playTarg.player="F";const t=y.jr9(this.boof4610,0);this.text=`Give a friendly creature ${t}. If it is in Formation, give the adjacent creatures ${t} as well.`}armoZ(t){const i=this.boof4610;this.formFun(t).concat(t).forEach(r=>this.buffA(r,i))}bftC(){this.faction="N",this.rarity="C",this.name="Bitterfrost Totem";const t=this.boof4812n;this.playTarg.hint=["DB"],this.text=`Give a creature ${y.jr9(t,t)}. ${this.rankT()}, it gets an additional ${y.jr9(-2,-2)}.`}bftZ(t){const i=this.boof4812n-(k.getActive().rank>this.level?2:0);this.buffD(t,i)}get bhos(){return this.lValN([6,9,20])}bzhC(){this.faction="T",this.rarity="H",this.name="Blazing Hostility";const t=this.bhos;this.playTarg.player="E",this.text=`Deal ${t} damage to an enemy creature${this.icaf("N")}deal ${t} damage to the enemy player as well.`}bzhZ(t){const i=this.bhos;this.smack(t,i),t.faction==="N"&&this.ouch(t.owner,i)}blod(){return L.deathsA.length>0||L.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 i=this.boof234;t.addArmor(i),this.blod()&&t.addArmor(i)}bbdC(){this.faction="N",this.rarity="C",this.name="Blood Bindings";const t=this.boof369n,i=y.jr9(t,t);this.text=`Give a creature ${i}.~If a creature was destroyed this turn, it gets an additional ${i}.`,this.playTarg.hint=["DB"]}bbdZ(t){const i=this.boof369n;this.buffD(t,i),this.blod()&&this.buffD(t,i)}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 i=this.lValN([5,6,10]),r=E.tick();this.smack(t,i,r),this.blod()&&this.smack(t,i,r)}bbnC(){this.faction="U",this.rarity="C",this.name="Blood Boon";const t=this.lValN([3,4,7]),i=y.jr9(t,t);this.text=`Give a creature ${i}.~If a creature was destroyed this turn, it gets an additional ${i}.`,this.playTarg.hint=["BF"]}bbnZ(t){const i=this.lValN([3,4,7]);this.buffD(t,i),this.blod()&&this.buffD(t,i)}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.xl=!1,this.text=`Replace an enemy ${y.levelGateText(this.level)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=w.ddf2(this.level),this.level<3&&(this.hints=["LG"])}botZ(t){this.replc(`${"BOS"}${this.level}`,t.owner,t.lane)}btpC(){this.faction="U",this.rarity="H",this.name="Bottomless Puncture",this.playTarg.player="E",this.text=`Give an enemy creature Poison ${this.boof369}${this.icaf("T")}give the enemy player Poison ${this.level} as well.`}btpZ(t){t.addPoison(this.boof369),t.faction==="T"&&k.addPoison(t.owner,this.level)}chatC(){this.faction="T",this.rarity="R",this.name="Chaos Twister",this.playTarg.player="E";const t=`eal ${this.twist} damage to `;this.text=`D${t}an enemy creature. If it is in Formation, d${t}the adjacent creatures as well.`}chatZ(t){const i=this.twist,r=E.tick();this.formFun(t).concat(t).forEach(a=>this.smack(a,i,r))}get twist(){return this.lValN([6,8,10])}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.free=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof123n;this.text=`Give a creature ${y.jr9(t,t)}.`,this.playTarg.hint=["DB"]}csurgeZ(t){this.buffD(t,this.boof123n)}ctmsC(){this.faction="A",this.rarity="R",this.name="Countermeasure";const t=this.boof4816;this.text=`Give an enemy creature ${y.jr9(-t,0)}, or give a friendly creature ${y.jr9(t,0)}.`}ctmsZ(t){const i=this.boof4816;t.owner===k.activeA?this.buffA(t,i):this.buffA(t,-i)}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"],this.level<3&&(this.hints=["LG"])}cullZ(t){this.kill(t)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate",this.xl=!1;const t=W.getCard(Y.tffc(this.level));this.text=`Replace a friendly Plant with a ${y.tokName(t)}.`,this.playTarg.player="F",this.playTarg.tribe="PL",this.level<3&&(this.hints=["LG"])}cultZ(t){this.replc(Y.tffc(this.level),t.owner,t.lane)}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.free=this.level>1,this.level===1&&(this.hints=["LG"]);const t=this.boof246;this.text=`Give a creature in a center lane ${y.jr9(t,t)}.`,this.playTarg.lanes=3,this.playTarg.hint=["BF"]}cypaZ(t){this.buffD(t,this.boof246)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${y.jr9(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.hint=["BF"],this.playTarg.faction="A"}cypbZ(t){this.buffA(t,this.boof51015),t.addArmor(this.boof124)}dpsC(){this.faction="N",this.rarity="H",this.name="Death's Possession";const t=this.boof4812;this.playTarg.maxAttack=t,this.text=`Destroy a creature with ${t} or less attack${this.icaf("A")}Spawn a copy of it.`}dpsZ(t){this.kill(t),t.faction==="A"&&this.spawn(t.code,k.activeA)}dendC(){this.faction="U",this.rarity="R",this.name="Dendrify",this.xl=!1,this.level===3&&(this.free=!0,this.overload=!0),this.text=`Replace a ${y.levelGateText(this.level+1)}creature with a 7/7 Treefolk.`,this.playTarg.level=w.ddf2(this.level+1)}dendZ(t){this.replc(`${"SXT"}${this.level}`,t.owner,t.lane)}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.xl=!1,this.level<3&&(this.hints=["LG"]),this.text=`Destroy a ${y.levelGateText(this.level)}creature.`,this.playTarg.level=w.ddf2(this.level),this.playTarg.hint=["KL"]}dreadZ(t){this.kill(t)}dyinC(){this.faction="U",this.rarity="T",this.name="Dysian Infusion",this.playTarg.hint=["BF"];const t=this.boof135,i=this.boof4710;this.text=`Give a creature ${y.jr9(i,i)} and Regenerate ${t}.`}dyinZ(t){this.buffD(t,this.boof4710),this.regn(t,this.boof135)}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.free=this.level===3,this.text=`Give a ${y.levelGateText(this.level)}creature Defender.`,this.playTarg.canDefender=!0,this.playTarg.level=w.ddf2(this.level),this.level<3&&(this.hints=["LG"])}enpZ(t){t.defender=!0,this.anim8(t)}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${y.jr9(-this.boof51015,0)}.`,this.playTarg.hint=["DB"]}elnZ(t){this.buffA(t,-this.boof51015)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${y.jr9(t,t)}.`,this.playTarg.hint=["BF"]}rageZ(t){this.buffD(t,this.boof3612)}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.activeA?this.wings(t,this.level):this.smack(t,this.level+6)}expdmC(){this.faction="N",this.rarity="H",this.name="Explosive Demise",this.xl=!1,this.text=`Destroy a friendly ${y.levelGateText(this.level+1)}creature.~Deal damage equal to its attack to the enemy player.${this.level===3?"~You gain that much health.":""}`,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.player="F"}expdmZ(t){const i=t.attack;this.kill(t),this.ouch("E",i),this.level===3&&this.balm("F",i)}fitrC(){this.faction="T",this.rarity="C",this.name="Fit of Rage",this.maxLevel=1,this.overload=!0,this.playTarg.player="F",this.text="Give a friendly creature +attack equal to the creature opposing it this turn."}fitrZ(t){this.modA(t,b.modT("AT",t.opposed?.attack||0))}fitTarg(){const t=b.crActTarg("CARD",this.code,"");return t.lanes=p.ddf1().filter(i=>i.opposed).map(i=>i.lane),t}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 ${y.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"]}feralZ(t){t.breakthrough=!0,this.buffD(t,this.fiboof)}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){this.smack(t,this.boof3915),k.getActive().rank>this.level&&this.smack(t,3)}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 i=this.boof579;this.smack(t,i),this.ouch("E",i)}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){this.modA(t,b.modT("AR",this.boof51020))}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=w.ddf2(this.level),this.playTarg.hint=["KL"],this.text=`Give a ${y.levelGateText(this.level)}creature "When this is dealt damage, destroy it".`,this.level<3&&(this.hints=["LG"])}frozZ(t){t.changed=!0;const i=t.jr4("DM",this.code);i.bonus=this.avgSpawnNug(),this.anim8(t)}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${y.jr9(t,t)}.`,this.playTarg.hint=["DB"]}ghastZ(t){this.buffD(t,-this.boof3612)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.xl=!1,this.free=this.level>1,this.free||(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 i=t.health;this.kill(t),this.level===3&&this.ouch(t.owner,i)}hartC(){this.faction="A",this.rarity="C",this.name="Heavy Artillery",this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(this.boof51015,0)}.`}hartZ(t){this.buffA(t,this.boof51015)}izftC(){this.faction="T",this.rarity="T",this.name="Iztek's Frost",this.free=this.level===3,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.hint=["KL"],this.text=`Until the end of the next turn, give a ${y.levelGateText(this.level+1)}creature "When this is dealt damage, destroy it".`,this.level===1&&(this.hints=["LG"])}izftZ(t){const i=E.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=i,r.bonus=this.avgSpawnNug();const a=t.jr4("PT",this.code);a.customCode=S.enTil("P2",i)}jpC(){this.faction="A",this.rarity="C",this.name="Jet Pack",this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(this.boof369,0)} and Mobility 1.`}jpZ(t){this.buffA(t,this.boof369),this.wings(t,1)}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=w.ddf2(this.level+1),this.playTarg.hint=["BF"],this.text=`Give a ${y.levelGateText(this.level+1)}creature ${y.jr9(this.boof124,0)} and Aggressive this turn.`,this.level===1&&(this.hints=["LG"])}lbrandZ(t){this.modA(t,b.modT("AT",this.boof124)),this.modA(t,b.modT("AG",!0))}shartC(){this.faction="U",this.rarity="R",this.name="Lysian Shard",this.overload=!0,this.maxLevel=1,this.hints=["ZZ-1"],this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(6,6)}.`}shartZ(t){this.buffD(t,6)}maggyC(){this.faction="T",this.rarity="T",this.name="Magmify",this.maxLevel=2,this.level===1?this.hints=["LG"]:this.free=!0,this.playTarg.player="F",this.text="Set a friendly creatures attack equal to its health."}maggyZ(t){const i=t.health-t.attack;i!==0&&this.buffA(t,i)}morphC(){this.faction="U",this.rarity="H",this.name="Metamorphosis",this.xl=!1,this.text=`Replace a ${y.levelGateText(this.level)}creature with a 0/3 Feywing Chrysalis.`,this.playTarg.level=w.ddf2(this.level),this.level<3&&(this.hints=["LG"])}morphZ(t){this.replc(`${"FWC"}1`,t.owner,t.lane)}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.level===3?this.free=!0:this.hints=["LG"],this.playTarg.level=w.ddf2(this.level+1),this.text=`Remove all abilities from a ${y.levelGateText(this.level+1)}creature.`,this.playTarg.hint=["DB"]}sculptZ(t){t.wipeAll()}nanoC(){this.faction="A",this.rarity="R",this.name="Nanoswarm",this.playTarg.level=w.ddf2(this.level),this.text=`Give a ${y.levelGateText(this.level)}creature ${y.jr9(-this.boof51015,0)} and remove all abilities from it.`,this.playTarg.hint=["DB"],this.level<3&&(this.hints=["LG"])}nanoZ(t){this.buffA(t,-this.boof51015),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 ${y.levelGateText(this.level)}creature.`,this.playTarg.level=w.ddf2(this.level),this.playTarg.hint=["KL"],this.level<3&&(this.hints=["LG"])}natselZ(t){this.kill(t)}nflayC(){this.faction="N",this.rarity="C",this.name="Necroflay";const t=-this.boof3711;this.text=`Give a creature ${y.jr9(t,t)}.~You may play an additional ${this.name} this turn.`,this.playTarg.hint=["DB"]}nflayZ(t){this.buffD(t,-this.boof3711);const i=L.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){this.regn(t,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 ${y.jr9(t,t)}."`,this.playTarg.hint=["DB"]}ntdcZ(t){t.changed=!0;const i=t.jr4("DS",this.code),r=this.ndcbuf;i.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 ${y.jr9(5,0)}.~Allied Tempys: This turn, when that creature ${y.dbdtap()}, deal that much damage to ${t}.`}oexpZ(t){if(this.buffA(t,5),L.allied("T")){const i=E.genId(),r=t.jr4("DM",this.code);r.changes=!0,r.customCode=i;const a=t.jr4("PT",this.code);a.customCode=i}}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 i=k.getActive().rank>this.level?1:0;t.addArmor(this.boof246+i)}pwtorC(){this.faction="A",this.rarity="R",this.name="Power Torrent",this.free=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(this.boof234,0)}.`}pwtorZ(t){this.buffA(t,this.boof234)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.free=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(this.level,this.level)}.`}psurgeZ(t){this.buffD(t,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(this.boof71116,0)} this turn.`}pslamZ(t){this.modA(t,b.modT("AT",this.boof71116))}pummC(){this.faction="A",this.rarity="R",this.name="Pummel Pack";const t=this.boof236,i=`${y.jr9(t,0)} and Armor ${t}.`;this.text=`Give a friendly creature ${i}~If it is the only friendly creature, it gets an additional ${i}`,this.playTarg.player="F"}pummZ(t){const i=this.boof236;this.buffA(t,i),t.addArmor(i),p.ddf1().length===1&&(this.buffA(t,i),t.addArmor(i))}get dennis(){return this.lValN([-3,-9,-25])}rpsC(){this.faction="A",this.rarity="H",this.name="Repress",this.playTarg.player="E",this.text=`Give an enemy creature ${y.jr9(this.dennis,0)}.${this.icaf("U")}remove all abilities from it.`}rpsZ(t){this.buffA(t,this.dennis),t.faction==="U"&&t.wipeAll()}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=w.ddf2(this.level),this.text=`Reduce a ${y.levelGateText(this.level)}creature's attack to 0.`,this.playTarg.hint=["DB"],this.level<3&&(this.hints=["LG"])}sapZ(t){this.buffA(t,-t.attack)}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 ${y.jr9(t,t,!0)} and Breakthrough.`,this.playTarg.hint=["BF"],this.playTarg.faction="U"}soathZ(t){this.buffD(t,this.saboof),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 ${y.jr9(-t,0)}. Give a friendly creature ${y.jr9(t,0)} for each enemy creature.`}scythZ(t){const i=-this.boof246,r=p.qEnemyCreats();r.forEach(a=>{this.buffA(a,i)}),r.length>0&&this.buffA(t,-i*r.length)}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 ${y.jr9(this.ubzap,0)}.`}soaZ(t){this.buffA(t,this.ubzap)}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 ${y.jr9(t,t)}.`}sodZ(t){this.buffD(t,this.derpboof)}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 ${y.jr9(t,t)}.`}sotZ(t){this.buffD(t,this.tars)}get tars(){return this.lValN([-2,-8,-16])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.free=this.level===3,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.player="F",this.text=`Give a ${y.levelGateText(this.level+1)}friendly creature "Vengeance: Spawn this" this turn.`,this.level===1&&(this.hints=["LG"])}shgrZ(t){const i=E.genId(),r=t.jr4("VN",this.code);r.customCode=i,r.changes=!0;const a=t.jr4("PT",this.code);a.customCode=i}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.playTarg.hint=["BF"],this.text=`Give a creature ${y.jr9(this.level,this.level)} for each friendly creature.`}sinZ(t){this.buffD(t,this.level*p.ddf1().length)}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 ${y.jr9(this.snbboof,0)}.`,this.level<3&&(this.hints=["LB"])}snbZ(t){this.buffA(t,this.snbboof)}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",this.level<3&&(this.hints=["LG"])}sharvZ(t){if(this.kill(t),this.level===1){const i=L.freeCard(this.code);i.condition.level=w.ddf2(1)}else L.freePlay(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,this.level<3&&(this.hints=["LG"])}sreapZ(t){this.kill(t),this.spawn(t.code,!t.owner)}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.free=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){this.regn(t,this.boof234)}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.free=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 ${y.levelGateText(this.level+1)}creature Mobility ${this.level}. That creature battles an additional time this turn.`,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.player="F"}sovZ(t){this.wrang(t),this.wings(t,this.level)}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${y.jr9(t,t,!0)} and Negate Defender from it.`,this.playTarg.hint=["BF"],this.playTarg.hasDefender=!0}stbrnZ(t){this.buffD(t,this.boof579),t.negDefend("T")}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){this.smack(t,this.sspb);const i=L.freeCard(this.code);i.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 ${y.levelGateText(this.level+1)}creature with Mobility.${t}`,this.playTarg.level=w.ddf2(this.level+1),this.playTarg.hasMobility=!0,this.level===1&&(this.hints=["LG"])}tanglZ(t){this.kill(t),this.level===3&&this.balm("F",t.attack)}tpactC(){this.faction="N",this.rarity="C",this.name="Tarsian Pact";const t=this.boof235;this.text=`Give a Nekrium creature ${y.jr9(t,t,!0)} and Regenerate ${t}.`,this.playTarg.hint=["BF"],this.playTarg.faction="N"}tpactZ(t){const i=this.boof235;this.buffD(t,i),this.regn(t,i)}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.playTarg.hint=["BF"],this.text=`Give a Robot ${y.jr9(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),this.buffA(t,this.boof4612)}totsC(){this.faction="N",this.rarity="T",this.name="Tendrils Of Twilight",this.free=!0;const t=-this.boof7911;this.text=`Give an enemy creature ${y.jr9(-1,-1)}.~If that creature is opposing a friendly Duskmaw, give that creature ${y.jr9(t,t)} instead.`,this.playTarg.player="E"}totsZ(t){this.buffD(t,this.duskBof(t))}duskBof(t){const i=t.opposed;let r=!1;return i&&(r=Wt.extractCardCode(i.code)==="DTD"),r?-this.boof7911:-1}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 ${y.jr9(t,t)}.`}txbnZ(t){const i=this.boof357;t.owner===k.activeA?this.buffD(t,i):t.addPoison(i)}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 ${y.jr9(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T",this.playTarg.hint=["BF"]}tremcZ(t){this.buffH(t,this.boof4812),this.wings(t,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){this.smack(t,this.ubzap);const i=b.mod("DF",!0);i.expiry="EN",this.modA(t,i)}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 ${y.jr9(t,t)}. ${this.rankT()}, it gets an additional ${y.jr9(2,2)}.`}urstZ(t){const i=this.boof3711+(k.getActive().rank>this.level?2:0);this.buffD(t,i)}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 i=L.freeCard(this.code);i.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 i=this.boof246;p.creatByTarget(b.crFriendNotMeTarg(t.id)).forEach(r=>{r.heal(i)})}vrdsC(){this.faction="U",this.rarity="C",this.name="Verdant Sphere";const t=this.boof5812;this.text=`Give a creature ${y.jr9(0,t)} and you gain ${t} health.`,this.playTarg.hint=["BF"]}vrdsZ(t){const i=this.boof5812;this.buffH(t,i),this.balm(k.getActive(),i)}vrshC(){this.faction="U",this.rarity="R",this.name="Victory Rush";const t=this.level+3,i=y.jr9(t,t);this.text=`Give a friendly creature ${i}. If a Raid occured this turn, give it an additional ${i}.`,this.playTarg.player="F"}vrshZ(t){const i=(this.level+3)*(L.ffs>2?2:1);this.buffD(t,i)}vglchC(){this.faction="N",this.rarity="R",this.name="Vigor Leech";const t=this.boof369n;this.text=`Give an enemy creature ${y.jr9(t,t)}, or give a friendly creature Regenerate ${-t}.`}vglchZ(t){const i=this.boof369n;t.owner===k.activeA?this.regn(t,-i):this.buffD(t,i)}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace",this.playTarg.hint=["DB"];const t=this.boof468,i=-t;this.text=`Give a creature ${y.jr9(i,i)}.~You gain ${t} health.`}vembZ(t){const i=this.boof468;this.buffD(t,-i),this.balm(k.getActive(),i)}warC(){this.faction="A",this.rarity="H",this.name="Warmonger Mod";let t=this.level,i=3;this.level===1&&(this.playTarg.level="LN",i=2,t=2),this.playTarg.hint=["BF"],this.text=`Give a ${y.levelGateText(i)}creature ${t}x attack.`}warZ(t){const i=this.level===3?2:1;this.buffA(t,t.attack*i)}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,this.level<3&&(this.hints=["LG"])}xwillZ(t){this.kill(t);const i=L.freeCard(this.code);i.condition.tribe="ZB"}}class Pr extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Crux, Metamind Rogue",this.iAttack=this.lValN([7,12,17]),this.iHealth=this.boof4812,this.tribe.push("MM"),this.hints=["RD"],this.text=`Forge: If Crux is your only friendly creature, it gets Armor ${this.level+2}.~Upgrade: Give an enemy creature ${y.jr9(-this.iHealth,0)}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("UP");return a.interactive=!0,r}handleAction(t){const i=p.ddf6(t);this.buffA(i,-this.iHealth),this.logAct(!1,i),T.actionDone(!0)}jr8(t){if(t.trigger.type==="UP"){const i=w.toActions(b.crEnemyActTarg("CARD",this.code,""));i.length===0?x.triggerDone():T.ddf5(i)}else if(t.trigger.type==="FR"){const i=p.creatByTarget(b.crFriendTarg());i.length===1&&i[0].addArmor(this.level+2),x.triggerDone()}}}class Mr 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,i){const r=super.jr3(t,i),a=r.jr4("FK");return a.bonus=this.playerNug(this.iAttack,"TX"),r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const r=I.toCreature(t.event).creature,a=r.opposed;a?this.smack(a,r.attack):(this.ouch(!r.owner,r.attack),this.anim8(r)),x.triggerDone()}}class Gt extends P{lookup(t){return{["BOF"]:{c:()=>this.bofC(),d:r=>this.bofD(r),t:r=>this.dfbT(r)},["CTM"]:{c:()=>this.ctmC(),d:r=>this.ctmR(r),t:r=>this.truLive(r)},["DFB"]:{c:()=>this.dfbC(),d:r=>this.dfbD(r),t:r=>this.dfbT(r)},["GGB"]:{c:()=>this.ggbC(),d:r=>this.ggbD(r),t:r=>this.ggbT(r)},["GGD"]:{c:()=>this.ggdC(),d:r=>this.ggdD(r),t:r=>this.truLive(r)},["GGR"]:{c:()=>this.ggdrC(),d:r=>this.ggdrD(r),t:r=>this.ggdrT(r)},["GGP"]:{c:()=>this.ggpC(),d:r=>this.ggpD(r),t:r=>this.ggpT(r)},["GGW"]:{c:()=>this.ggwC(),d:r=>this.ggwD(r),t:r=>this.ggwT(r)},["MHR"]:{c:()=>this.mhermC(),d:r=>this.mhermD(r),t:r=>this.mhermT(r)},["NGT"]:{c:()=>this.ngauntC(),d:r=>this.ngauntD(r),t:r=>this.truLive(r)},["SRH"]:{c:()=>this.sharvC(),d:r=>this.sharvD(r),t:r=>this.sharvT(r)},["SPR"]:{c:()=>this.sprC(),d:r=>this.sprD(r),t:r=>this.sprT(r)},["YNS"]:{c:()=>this.yuruC(),d:r=>this.yuruD(r),t:r=>this.yuruT(r)}}[t]}trigB;bDraw=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DS");return a.bonus=this.trigB,a.batch=this.bDraw,r}ddf8(t){return this.lookup(this.cardCode()).t(t)}bFac(t){return t.draw?this.faction:"X"}truLive(t){return p.creatByTr(t).status==="A"}jr8(t){this.lookup(this.cardCode()).d(t),x.triggerDone()}friendTribeTest(t,i,r){return i.id===t.id||t.owner===i.owner&&t.isTribe(r)&&Gt.itDiedFirst(t.id,i.id)}bofC(){this.faction="N",this.rarity="C",this.name="Bride of Frankenbaum",this.iAttack=this.boof5813,this.iHealth=this.iAttack+1,this.tribe.push("AB"),this.hints=["ZZ-1"];const t=this.boof234;this.text=`When a friendly Abomination is destroyed, you gain ${t} health.`,this.trigB=this.playerNug(t*2,"TW"),this.bDraw=!0}bofD(t){this.balm(t.owner,this.boof234,t.draw),t.draw&&this.anim8(p.creatByTr(t))}ctmC(){this.faction="N",this.rarity="L",this.name="Cyrus, the Merciless",this.iAttack=this.boof359,this.iHealth=this.iAttack+1,this.tribe.push("GG"),this.text=`Formation: Destroy each other creature with ${this.boof579} or less attack.~Whenever a creature is destroyed, Cyrus gets ${y.jr9(1,1)}.`,this.trigB=this.buffNug(2,2,"TS"),this.bDraw=!0}ctmR(t){p.creatByTr(t).buff(1,1,this.bFac(t))}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,"TX"),this.bDraw=!0}dfbT(t){const i=I.toCreature(t.event).creature;return this.friendTribeTest(i,p.creatByTr(t),"AB")}dfbD(t){this.ouch(!t.owner,this.boof234,t.draw),t.draw&&this.anim8(p.creatByTr(t))}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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(this.level,this.level,"TW")}ggbT(t){const i=I.toCreature(t.event).creature;return this.friendTribeTest(i,p.creatByTr(t),"DF")?i.opposed:!1}ggbD(t){const i=I.toCreature(t.event).creature.opposed;i&&(this.buffD(i,-this.level),this.logAct(!1,i))}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.text=`When a creature is destroyed, ${this.name} gets ${y.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level,"TS"),2),this.bDraw=!0}ggdD(t){p.creatByTr(t).buff(this.level,this.level,this.bFac(t))}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 ${y.jr9(t,t)}. Then give the opposing creature ${y.jr9(-t,-t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),2)}ggdrT(t){const r=I.toCreature(t.event).creature;return r.owner===t.owner&&r.id!==t.creatId?this.truLive(t)&&Gt.itDiedFirst(r.id,t.creatId):!1}ggdrD(t){const i=I.toCreature(t.event).creature;if(!p.searchByLane(i.lane,i.owner)){const a=p.creatByTr(t),c=this.doomb;this.lurk(a,i.lane),this.buffD(a,c);const f=a.opposed;f&&(this.logAct(!1,f),this.buffD(f,-c))}}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");const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS")}ggpT(t){const i=I.toCreature(t.event);if(i.creature.owner!==t.owner){const r=p.creatByTr(t);return r.status==="A"&&p.oppositeLane(r.lane)===i.creature.lane}return!1}ggpD(t){this.buffD(p.creatByTr(t),this.boof246),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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS"),this.bDraw}ggwT(t){const i=I.toCreature(t.event);if(i.creature.owner===t.owner){const r=p.creatByTr(t);return r.status==="A"&&r.adjacent.includes(i.creature.lane)}return!1}ggwD(t){const i=this.boof234;p.creatByTr(t).buff(i,i,this.bFac(t)),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 ${y.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),2),this.bDraw=!0}mhermT(t){return I.toCreature(t.event).creature.poison>0&&this.truLive(t)}mhermD(t){const i=I.toCreature(t.event);this.logAct(!1,i.creature);const r=this.boof124;p.creatByTr(t).buff(r,r,this.bFac(t))}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,"TS"),this.bDraw=!0}ngauntD(t){p.creatByTr(t).addRegen(1,this.bFac(t))}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,ft.dcWeight),this.bDraw=!0}sharvT(t){const r=I.toCreature(t.event).creature;return!!(r.owner===t.owner&&r.isTribe("AB")&&k.activeA===t.owner&&Gt.itDiedFirst(r.id,t.creatId))}sharvD(t){this.logAct(!1),k.drawCard(t.owner,1),t.draw&&this.anim8(t.creatId)}sprC(){this.faction="N",this.rarity="R",this.name="Spectral Rider",this.iAttack=this.lValN([6,8,13]),this.iHealth=this.iAttack-1,this.tribe.push("GG"),this.text=`When a friendly creature is destroyed, ${this.name} gets ${y.jr9(1,1)}.`,this.trigB=this.buffNug(2,2,"TS"),this.bDraw=!0}sprT(t){const i=I.toCreature(t.event);return t.owner===i.creature.owner&&this.truLive(t)}sprD(t){p.creatByTr(t).buff(1,1,this.bFac(t))}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=W.getCard(this.syc());this.text=`When an adjacent non-Spirit creature is destroyed, put a ${y.tokName(t)} into that lane.`,this.trigB=this.spawnNug(t,"TX")}yuruT(t){const i=p.creatByTr(t),a=I.toCreature(t.event).creature;return!!(a.owner===i.owner&&i.adjacent.includes(a.lane)&&!a.isTribe("ST")&&Gt.itDiedFirst(a.id,i.id))}yuruD(t){const i=I.toCreature(t.event);this.poot(this.syc(),t.owner,i.creature.lane)}syc(){return "XYR"+this.level}static itDiedFirst(t,i){if(t===i)return!0;let r=!1;const a=Bt.findDeathTime(i);if(S.isUn(a))r=!0;else{const c=Bt.findDeathTime(t);(S.isUn(c)||c<=a)&&(r=!0)}return r}}class Er extends Gt{get formation(){return!0}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FM"),r}jr8(t){if(t.trigger.type==="FM"){const i=b.crNotMeTarg(t.creatId);i.maxAttack=this.boof579;const r=p.creatByTarget(i);if(r.length>0){const a=E.tick();r.forEach(c=>this.kill(c,a))}x.triggerDone()}else super.jr8(t)}}class Le extends P{lookup(t){return{["ATP"]:{c:()=>this.phagC(),t:()=>this.phagT(),f:(r,a)=>this.hdiscardF(r,a)},["PLI"]:{c:()=>this.pimpC(),t:()=>this.pimpT(),f:(r,a)=>this.hdiscardF(r,a)},["SSH"]:{c:()=>this.sshmC(),t:()=>this.sshmT(),f:(r,a)=>this.sshmF(r,a)},["TPG"]:{c:()=>this.pillC(),t:()=>this.pillT(),f:(r,a)=>this.pillF(r,a)},["TMG"]:{c:()=>this.grootC(),t:()=>this.grootT(),f:(r,a)=>this.grootF(r,a)},["VIN"]:{c:()=>this.vintC(),t:()=>this.vintT(),f:(r,a)=>{}}}[t]}forgTargets(t){const i=this.lookup(t).t();return E.aiActive?bt.uniqueContent(i):i}forgAction(t,i,r){this.lookup(t).f(i,r),t!=="TMG"&&this.anim8(r)}optional=!0;ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Forge: "+this.ftext,this.ftext=""}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}handleAction(t){this.forgAction(this.cardCode(),t.position,p.jr5(t.param)),gt.popMode(),T.actionDone(!0)}jr8(t){const i=this.cardCode()==="VIN";if(i&&E.aiActive)x.triggerDone();else{const r=this.forgTargets(this.cardCode());if(r.length>0){let a;if(i?a=[]:a=r.map(c=>{const f=b.deckSelectAction("CARD",c.cardCode,c.sourceIdx);return f.param=t.creatId,f.host=this.code,f}),this.optional){const c=T.noneEndTrigger();c.param="PM",a.push(c)}bt.showCustomDeck(r,a)}else x.triggerDone()}}hdiscardF(t,i){const r=k.toPlayer(!i.owner),a=r.hand[t];Dt.cardDiscard(r,t),r.discard.push(a)}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 ${y.levelGateText(this.level)}spells in the enemy player's hand and choose one. The enemy player discards the chosen spell.`}phagT(){const t=k.getInctive(),i=b.target("TH");return i.player=k.toTarget(t),i.level=w.ddf2(this.level),i.card="S",bt.generateContent(t.hand,!1,i)}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.getInctive(),i=b.target("TH");return i.player=k.toTarget(t),i.maxAttack=this.boof369,i.card="C",bt.generateContent(t.hand,!1,i)}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=y.levelGateText(this.level),this.ftext=`You may put a ${t}creature from your discard pile into your hand.`}sshmT(){const t=k.getActive(),i=b.target("TD");return i.player=k.toTarget(t),i.card="C",this.level===3?i.level="HR":i.level=w.ddf2(this.level),bt.generateContent(t.discard,!1,i)}sshmF(t,i){const r=k.toPlayer(i.owner),a=r.discard.splice(t,1);Dt.addCard(r,a[0],!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(),i=b.target("TD");return i.player=k.toTarget(t),i.faction="N",bt.generateContent(t.discard,!1,i)}pillF(t,i){k.toPlayer(i.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 ${y.jr9(t,t)}.`}grootT(){const t=k.getActive(),i=b.target("TD");return i.player=k.toTarget(t),i.tribe="PL",bt.generateContent(t.discard,!1,i)}grootF(t,i){k.toPlayer(i.owner).discard.splice(t,1),this.buffD(i,this.boof358)}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.getInctive(),i=b.target("TH");return i.player=k.toTarget(t),bt.generateContent(t.hand,!1,i)}}class Rr 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,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.interactive=!0,a.bonus=this.regnNug(this.boof135,"TW"),r}handleAction(t){const i=p.ddf6(t);this.logAct(!1,i),this.regn(i,this.boof135),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&W.getCard(t.event.cardCode).type==="S"}jr8(t){const i=b.crFriendActTarg("CARD",this.code,"");i.canRegen=!0;const r=w.toActions(i);r.length===0?x.triggerDone():(r.push(T.noneEndTrigger()),T.ddf5(r))}}class Lr extends Tt{jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}jr8(t){p.qEnemyCreats().forEach(i=>{i.addPoison(6)}),x.triggerDone()}}class Gr extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Demara's Pitguard",this.iAttack=this.boof6914,this.iHealth=this.iAttack+2,this.tribe.push("NG"),this.text=`The opposing creature has Poison ${this.boof248}.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){const i=t.status==="A",r=p.oppositeLane(t.lane);p.qPlayerCreats(!t.owner).forEach(a=>{a.lane===r&&i?a.addModSafe(b.mod("PN",this.boof248,t.id)):a.removeModSafe(t.id)})}}class Ir 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 i=this.boof246n;this.text=`When an enemy creature with Aggressive deals battle damage, it gets ${y.jr9(i,i)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.buffNug(this.level,this.level),r}ddf8(t){const i=I.toDamage(t.event);return i.battle&&i.isCreatSrc&&i.srcCreat.owner!==t.owner&&i.srcCreat.aggressive}jr8(t){const i=I.toDamage(t.event);this.logAct(!1,i.srcCreat),this.buffD(i.srcCreat,this.boof246n),x.triggerDone()}}class Wr 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 i=this.boof357;this.text=`When this ${y.dbdtap()}, heal ${i} 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,i){const r=super.jr3(t,i),a=r.jr4("VN");a.bonus=this.buffNug(this.iAttack,this.iHealth);const c=r.jr4("DM");return c.bonus=this.buffNug(0,this.boof357,"TP"),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 i=p.creatByTr(t);this.poot("BWT"+this.level,i.owner,i.lane),x.triggerDone()}else if(t.trigger.type==="DM"){const i=this.boof357,r=b.crNotMeTarg(t.creatId);r.player=k.toTarget(t.owner),p.creatByTarget(r).forEach(c=>c.heal(i)),x.triggerDone()}}}class $r extends vt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Discordant Strike";const i=-this.boof4610;this.text=`Give an enemy creature ${y.jr9(i,0)}.~Allied Nekrium: Give an enemy creature ${y.jr9(0,i)}.`}playTargets(){return[b.crEnemyActTarg("CARD",this.code,"P1")]}canPlay(){return p.qEnemyCreats().length>0}handleAction(t){const i=S.deTil(t.param),r=-this.boof4610,a=p.ddf6(t);i[0]==="P1"?(this.logSpell(a),this.buffA(a,r),L.allied("N")?T.ddf5(w.toActions(b.crEnemyActTarg("CARD",this.code,"P2"))):T.spellCast()):(this.logSpell(a),a.buff(0,r,"N"),T.spellCast())}}class Ur extends vt{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.free=this.level===3,this.level<3&&(this.hints=["LG"]),this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}canPlay(){return p.creatByTarget(this.poisTarg()).length>0}playTargets(){return this.level===1?[this.poisTarg()]:[w.boardTarget("CARD",this.code)]}handleAction(t){if(this.level===1){const i=p.ddf6(t);this.logSpell(i),i.addPoison(i.poison)}else this.logSpell(),p.creatByTarget(this.poisTarg()).forEach(r=>{r.addPoison(r.poison)});T.spellCast()}poisTarg(){const t=b.crEnemyActTarg("CARD",this.code,"");return t.hasPoison=!0,t}}class Or 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 i="";const r=this.lValN([0,5,10]);this.level>1&&(i=`, then give it ${y.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${i}.`;const a=this.avgCreatureStats();this.bonus=this.buffNug(r+a[0]-this.iAttack,a[1],"TW")}canActivate(t){return k.toPlayer(!t.owner).hand.some(r=>W.getCard(r).type==="C")}startActivation(t){let i;if(st.simOn)i=[{cardCode:"VND"+this.level,sourceIdx:0,cardCount:0}];else{const a=k.getInctive(),c=b.target("TH");c.player=k.toTarget(a),c.card="C",i=bt.generateContent(a.hand,!1,c),E.aiActive&&(i=bt.uniqueContent(i))}const r=i.map(a=>{const c=b.deckSelectAction("CARD",a.cardCode,a.sourceIdx);return c.param=t.id,c.host=this.code,c});bt.showCustomDeck(i,r)}handleAction(t){this.logAct(!0);const i=p.jr5(t.param),r=this.replc(t.card,i.owner,i.lane);this.level>1&&r&&this.buffA(r,this.level===3?10:5),gt.popMode(),i.endActivation()}}class Vr extends vt{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Dragonwake",this.text=`Search your deck for a ${y.levelGateText(this.level+1)}Dragon and Spawn a copy of it. It gets Aggressive${this.level===3?".":' and "At the end of your turn, destroy this."'}`}canPlay(){return this.dragoons(!1).length>0}playTargets(){const t=w.boardTarget("CARD",this.code);return t.param="P1",[t]}dragoons(t){const i=k.getActive(),r=b.target("DK");r.player=k.toTarget(i),r.level=w.ddf2(this.level+1),r.tribe="DG";const a=bt.generateContent(i.deck,!1,r);return t?bt.uniqueContent(a):a}handleAction(t){if(t.param==="P1"){const i=this.dragoons(E.aiActive),r=i.map(c=>{const f=b.deckSelectAction("CARD",c.cardCode,c.sourceIdx);return f.host=this.code,f}),a=T.cancelAction();a.param="PM",r.push(a),bt.showCustomDeck(i,r)}else{const i=this.spawn(t.card,k.activeA);if(i){if(this.logSpell(i),i.aggressive=!0,this.level<3){const r=i.jr4("TE",this.code);r.creatId=i.id,r.changes=!0}}else this.logSpell();gt.popMode(),T.spellCast()}}ddf8(t){return!0}jr8(t){const i=p.creatByTr(t);i.status==="A"&&this.kill(i),x.triggerDone()}}class zr extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Dread",this.iAttack=this.boof6912,this.iHealth=this.boof234,this.tribe.push("AB"),this.text=`When ${this.name} enters play, it has a 50% chance to get the ability "Vengeance: Spawn a level ${this.level} Dread".`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(t.event.code==="ENT"){if(S.randInt(0,2)===0){const i=I.toEnterField(t.event),r=i.creature.jr4("VN");r.changes=!0,r.bonus=this.buffNug(this.iAttack,this.iHealth),this.anim8(i.creature)}}else this.spawn(this,t.owner);x.triggerDone()}}class Zr 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 i=W.getCard(this.bfc()),r=`Destroy an enemy ${y.levelGateText(this.level)}creature.`;this.text=`Activate, destroy another friendly creature: ${r}~Allied Uterra: Put a ${y.tokName(i)} into an available lane.`,this.bonus=this.multNug(this.avgSpawnNug(),.5),this.bonus.threat="TX"}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const i=this.friends(t.id);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const i=S.deTil(t.param);if(i[1]==="P1"){const r=this.enemies(i[0],p.ddf6(t).id);r.push(T.cancelAction()),T.ddf5(r)}else if(i[1]==="P2"){this.logAct(!0);const r=E.tick();this.kill(p.jr5(i[2]),r),this.kill(p.ddf6(t),r),p.jr5(i[0]).endActivation()}else p.birth(this.bfc(),"P",t.playerA,t.lane,"U"),T.actionDone(!0)}jr8(t){if(L.allied("U")){const i=b.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId),r=w.toActions(i);r.length>0?T.ddf5(r):x.triggerDone()}else x.triggerDone()}friends(t){const i=b.crFriendNotMeActTarg("CARD",t,this.code,S.enTil(t,"P1"));return w.toActions(i)}enemies(t,i=""){const r=b.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",i));return r.level=w.ddf2(this.level),w.toActions(r)}bfc(){return "BRF"+this.level}}class Yr extends vt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Dysian Siphon";const i=this.boof357;this.text=`Give an enemy creature ${y.jr9(-i,-i)}.~Allied Uterra: Give a friendly creature ${y.jr9(i,i)}. `}canPlay(){return p.creatByTarget(this.firstT()).length>0}playTargets(){return[this.firstT()]}firstT(){return b.crEnemyActTarg("CARD",this.code,"P1")}handleAction(t){const i=S.deTil(t.param),r=this.boof357,a=p.ddf6(t);if(i[0]==="P1"){const c=b.crFriendActTarg("CARD",this.code,S.enTil("P2",a.id)),f=w.toActions(c);L.allied("U")&&f.length>0?(f.push(T.cancelAction()),T.ddf5(f)):(this.logSpell(a),this.buffD(a,-r),T.spellCast())}else{const c=p.jr5(i[1]);this.logSpell(c,a),this.buffD(c,-r),a.buff(r,r,"U"),T.spellCast()}}}class Kr 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 i=-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 ${y.jr9(i,i)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,a.customCode=r.id,r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const i=I.toEnterField(t.event);if(i.forged&&i.creature.id===t.trigger.customCode)if(k.getActive().health>120){const r=b.actionTarget("TF","CARD",this.code,"");r.player="F",r.hint=["FL"],r.lanes=p.laneIdx.filter(c=>c!==i.creature.lane);const a=w.toActions(r);a.push(T.noneEndTrigger()),T.ddf5(a)}else x.triggerDone();else{const r=i.creature.opposed;if(r&&L.allied("N",i.creature.owner)){const a=-this.boof135;r.buff(a,a,"N")}x.triggerDone()}}handleAction(t){this.replc(this,t.playerA,t.lane),T.actionDone(!0)}}class Xr extends P{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Ebonskull Diabolist",this.iAttack=this.boof137,this.iHealth=this.boof4814,this.tribe.push("VP"),this.text=`Forge: At the start of your next turn, if ${this.name} is in play, you may play an additional card.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}ddf8(t){return t.event.playerA===t.owner}jr8(t){const i=p.creatByTr(t);if(t.trigger.type==="FR"){const r=i.jr4("TS");r.changes=!0,r.bonus=this.avgSpawnNug(),r.bonus.threat="TX",x.triggerDone()}else if(t.event.code==="TRS"){const r=b.trigIdx(i.triggers,t.trigger);r>-1&&i.removeTrigger(i.triggers[r]),L.freePlay(),this.anim8(i),this.logAct(!1),x.triggerDone()}}}class qr 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,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=this.level<3,r}jr8(t){if(this.level<3){const i=b.actionTarget("TF","CARD",this.code,"");i.player="F",i.lanes=p.creatByTr(t).adjacent,i.hint=["FL"];const r=w.toActions(i);r.push(T.noneEndTrigger()),T.ddf5(r)}else{const i=b.emptyPlayerActTarg("F","CARD",this.code,t.trigger.creatId);let r=w.toActions(i);if(r.length>0){const a=E.tick();r.forEach(c=>this.poot(this,c.playerA,c.lane,a))}x.triggerDone()}}handleAction(t){this.poot(this,t.playerA,t.lane),T.actionDone(!0)}}class Fi 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,i){return this.lookup(t).m(i)}armThreshold=1;wipe=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("AR",this.code);return a.area="A",r}enforceEffect(t){if(this.armThreshold<=t.armor){const i=this.createMods(this.cardCode(),t);if(this.wipe){const r=t.mods.find(a=>a.granter===t.id);r&&r.value!==t.armor&&t.removeModSafe(t.id)}t.addModSafe(i)}else t.removeModSafe(t.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 b.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 ${y.jr9(t,0)}.`}tvgM(t){return b.mod("AT",this.boof247,t.id)}}class Ve 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,i){return this.lookup(t).m(i)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i);return r.addEffect("AT",this.code),r}enforceEffect(t){this.attThreshold<=t.attack?this.createMods(this.cardCode(),t).forEach(i=>{t.addModSafe(i)}):t.removeModSafe(t.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[b.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 i=[b.mod("MB",3,t.id)];return this.level>1&&i.push(b.mod("AR",5,t.id)),this.level===3&&(i.push(b.mod("BT",!0,t.id)),i.push(b.mod("AG",!0,t.id)),i.push(b.mod("RG",5,t.id))),i}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[b.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[b.mod("MB",this.level,t.id),b.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,i=this.level===3?"it gets Breakthrough and ":"";this.text=`When you gain health, Wegu gets ${y.jr9(t,t)} for each health you gained.~While Wegu has ${this.attThreshold} or more attack, ${i}Negate Defender from it.`}weguM(t){const i=[b.mod("ND",!0,t.id)];return this.level===3&&i.push(b.mod("BT",!0,t.id)),i}}class Pi extends P{friendNotMe(t){const i=b.crNotMeTarg(t.id);return i.player=k.toTarget(t.owner),i}friendNone(t){const i=b.crTarg();return i.player=k.toTarget(t.owner),i.lanes=[],i}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforcementActive(t){return t.status==="A"}applyEffect(t,i,r){const a=this.friendNotMe(t),c=p.creatByTarget(a),f=p.creatByTarget(r);c.forEach(m=>{f.includes(m)?m.addModSafe(i):m.removeModSafe(t.id)})}}class we extends Pi{lookup(t){return{["BWW"]:{c:()=>this.bwwC(),m:r=>this.bwwM(r),t:r=>this.friendNotMe(r)},["HTR"]:{c:()=>this.hrtC(),m:r=>this.hrtM(r),t:r=>this.friendNotMe(r)},["KKK"]:{c:()=>this.kkkC(),m:r=>this.kkkM(r),t:r=>this.kkkT(r)},["LVG"]:{c:()=>this.lvgC(),m:r=>this.lvgM(r),t:r=>this.friendNotMe(r)},["LTT"]:{c:()=>this.lntC(),m:r=>this.lntM(r),t:r=>this.friendNotMe(r)},["SFE"]:{c:()=>this.sfeC(),m:r=>this.sfeM(r),t:r=>this.sfeT(r)},["TCN"]:{c:()=>this.tcanC(),m:r=>this.tcanM(r),t:r=>this.tcanT(r)},["XDV"]:{c:()=>this.xdvC(),m:r=>this.xdvM(r),t:r=>this.xdvT(r)}}[t]}createMod(t,i){return this.lookup(t).m(i)}effTargs(t,i){return this.lookup(t).t(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t){const i=this.cardCode(),r=this.createMod(i,t),a=this.enforcementActive(t)?this.effTargs(i,t):this.friendNone(t);this.applyEffect(t,r,a)}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 b.mod("MB",this.level,t.id)}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 b.mod("RG",this.iRegen,t.id)}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 b.mod("AG",!0,t.id)}kkkT(t){const i=this.friendNotMe(t);return this.level===1?i.lanes=[]:i.level=w.ddf2(this.level-1),i}lvgC(){this.faction="T",this.rarity="T",this.name="Lava Golem",this.iAttack=4,this.iHealth=6,this.maxLevel=1,this.tribe.push("FR","EL"),this.text=`Friendly creature have ${y.jr9(4,0)}.`}lvgM(t){return b.mod("AT",4,t.id)}lntC(){this.faction="T",this.rarity="T",this.name="Lightning Titan",this.iAttack=6,this.iHealth=4,this.maxLevel=1,this.tribe.push("LT","EL"),this.text="Friendly creature have Aggressive."}lntM(t){return b.mod("AG",!0,t.id)}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 b.mod("AG",!0,t.id)}sfeT(t){const i=this.friendNotMe(t);return i.tribe="DF",i}tcanC(){this.faction="A",this.rarity="C",this.name="Tower Cannoneer",this.iAttack=this.lValN([6,12,14]),this.iHealth=this.iAttack-2,this.tribe.push("RB"),this.level===2&&(this.hints=["LB"]),this.text=`Each friendly Defender gets ${y.jr9(this.boof369,0)}`}tcanM(t){return b.mod("AT",this.boof369,t.id)}tcanT(t){const i=this.friendNotMe(t);return i.hasDefender=!0,i}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 b.mod("RG",this.iRegen,t.id)}xdvT(t){const i=this.friendNotMe(t);return i.tribe="ZB",i}}class Mi 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,i){return this.lookup(t).m(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){t.lane===3?this.createMods(this.cardCode(),t).forEach(i=>{t.addModSafe(i)}):t.removeModSafe(t.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 ${y.jr9(this.iAttack,this.iHealth)}.`}nxpM(t){return[b.mod("AT",this.iAttack,t.id),b.mod("HL",this.iHealth,t.id),b.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[b.mod("MB",2,t.id)]}}class ei extends P{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:r=>this.cctM(r)},["GHB"]:{c:()=>this.ghbC(),m:r=>this.ghbM(r)},["ISB"]:{c:()=>this.isbC(),m:r=>this.isbM(r)},["PYG"]:{c:()=>this.pygC(),m:r=>this.pygM(r)}}[t]}createMods(t,i){return this.lookup(t).m(i)}eOpp=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){!!t.opposed===this.eOpp?this.createMods(this.cardCode(),t).forEach(i=>{t.addModSafe(i)}):t.removeModSafe(t.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 ${y.jr9(t,0)}.`}cctM(t){return[b.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.eOpp=!0,this.text=`While ${this.name} is opposed, it gets Aggressive.`}ghbM(t){return[b.mod("AG",!0,t.id)]}isbC(){this.faction="T",this.rarity="C",this.name="Iceshard Berserker",this.iAttack=this.boof358,this.iHealth=this.boof61016,this.tribe.push("IC","AS"),this.eOpp=!0,this.text=`While ${this.name} is opposed, it gets ${y.jr9(this.iHealth,0)}.`}isbM(t){return[b.mod("AT",this.iHealth,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 ${y.jr9(this.iAttack,0)}.`}pygM(t){return[b.mod("AT",this.iAttack,t.id)]}}class Ei 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,i){return this.lookup(t).m(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){const i=t.status==="A",r=this.targetPlayer(t);if(i){const a=this.createMod(this.cardCode(),t);k.addModSafe(r,a)}else k.removeModSafe(r,t.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 b.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 b.mod("PN",this.boof246,t.id)}}class ze extends Pi{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,i){return this.lookup(t).m(i)}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){const i=this.cardCode(),r=this.createMod(i,t);let a;this.enforcementActive(t)?(a=this.friendNotMe(t),this.nexus?a.lanes=[1,2,4,5]:a.lanes=t.adjacent):a=this.friendNone(t),this.applyEffect(t,r,a)}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 ${y.jr9(this.iAttack,0)}.`}algnM(t){return b.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 ${y.jr9(t,0)}.`}alstM(t){return b.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 ${y.jr9(t,0)}.`}btcM(t){return b.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 ${y.jr9(t,0)}. Otherwise this gets Armor ${t}.`}aeroM(t){return b.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 b.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){this.replc(this.spawnCode,t.playerA,t.lane)}adjacent=!1;optional=!1;needsEmpty=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const i=y.forglied(this.allied);this.text=i+": "+this.ftext}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}jr8(t){if(this.cardCode()==="POD"&&!L.patron("U")){x.triggerDone();return}if(this.allied==="X"||L.allied(this.allied)){const i=p.creatByTr(t),r=b.emptyPlayerActTarg("F","CARD",this.code,t.creatId);this.needsEmpty||(r.field="A",r.hint=["FL"],r.lanes=p.laneIdx.filter(c=>c!==i.lane)),this.adjacent&&(r.lanes=i.adjacent);const a=w.toActions(r);a.length>0?(this.optional&&a.push(T.noneEndTrigger()),T.ddf5(a)):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=W.getCard(this.spawnCode);this.ftext=`You may put a ${y.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=Y.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=W.getCard(this.spawnCode);this.ftext=`You may put a ${y.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","WF"),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 jr 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 i=W.getCard(this.soldier);this.addSp("N",i.iAttack),this.text=`While you have 6 or more cards in hand, this gets "Activate: Put a ${y.tokName(i)} into an available lane."`,this.bonus=this.multNug(this.spawnNug(i,"TX"),.3)}canActivate(t){return k.toPlayer(t.owner).hand.length>5&&p.emptyLanes(t.owner).length>0}startActivation(t){const i=b.emptyPlayerActTarg(t.owner,"CARD",this.code,t.id),r=w.toActions(i);r.push(T.cancelAction()),T.ddf5(r)}handleAction(t){this.logAct(!0),this.poot(this.soldier,t.playerA,t.lane),p.jr5(t.param).endActivation()}ddf8(t){return!0}jr8(t){const i=k.toPlayer(t.owner);k.drawCard(i,1);const r=b.trigIdx(i.triggers,t.trigger);r>-1&&i.triggers.splice(r,1),x.triggerDone()}get soldier(){return "EPS"+this.level}}class Qr 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,i){const r=super.jr3(t,i),a=r.jr4("FR");a.interactive=!0;const c=r.jr4("EF");return c.interactive=!0,r}handleAction(t){if(t.zone==="H")L.levelAndDiscardA(t),this.anim8(t.param);else{const i=t;p.birth(this.code,"R",i.playerA,i.lane,"U")}T.actionDone(!0)}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(t.trigger.type==="FR")if(L.allied("U")){const i=p.creatByTr(t),r=b.actionTarget("TF","CARD",this.code,t.creatId);r.player="F",r.lanes=p.laneIdx.filter(c=>c!==i.lane),r.hint=["FL"];const a=w.toActions(r);a.push(T.noneEndTrigger()),T.ddf5(a)}else x.triggerDone();else{const i=b.lvlHandActTarg(this.code,t.creatId),r=w.toActions(i);r.length>0?T.ddf5(r):x.triggerDone()}}}class Jr 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 i=this.boof358;this.addSp("H",i),this.text=`Activate: Heal ${i} damage from each other friendly creature.~Allied Alloyin: Armor ${this.boof247}.`,this.bonus=this.buffNug(0,i,"TW")}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){const i=b.crFriendNotMeTarg(t.id);return p.creatByTarget(i).length>0}startActivation(t){const i=w.boardTarget("CARD",this.code);i.param=t.id,T.ddf5(w.toActions([i,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const i=p.jr5(t.param),r=this.boof358,a=b.crFriendNotMeTarg(i.id);p.creatByTarget(a).forEach(c=>{c.heal(r)}),i.endActivation()}jr8(t){L.allied("A")&&p.creatByTr(t).addArmor(this.boof247),x.triggerDone()}}class _r 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=["LG"]):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this lane.`,this.hints=["ZZ-3"])}jr3(t,i){const r=super.jr3(t,i);if(this.level===2){const a=r.jr4("RU");a.bonus=this.buffNug(10,9,"TH")}else if(this.level===3){const a=r.jr4("VN");a.bonus=this.statSpawnNug(0,1)}return r}ddf8(t){return t.event.playerA===t.owner}jr8(t){if(t.trigger.type==="RU"){const i=p.creatByTr(t);this.replc(`${"EFP"}3`,i.owner,i.lane)}else if(t.trigger.type==="VN"){const r=I.toCreature(t.event).creature;this.replc(`${"EFP"}2`,r.owner,r.lane)}x.triggerDone()}}class ts 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,i){const r=super.jr3(t,i),a=r.jr4("HG");return a.bonus=this.playerNug(this.iHealth/2,"TW"),a.batch=!0,r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const i=this.level===3?2:1;this.balm(t.owner,t.event.healAmt*i,t.draw),t.draw&&this.anim8(t.creatId),x.triggerDone()}}class es 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.hints=["ZZ-1"],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,i){const r=super.jr3(t,i);return r.jr4("FR"),r}handleAction(t){this.poot(`${"FME"}${this.level}`,t.playerA,t.lane),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner}jr8(t){const i=p.creatByTr(t);if(t.event.code==="ENT"){const r=i.jr4("TS");r.interactive=!0,r.changes=!0,r.bonus=this.rawNug(1,0,6,0,0,"TX"),this.anim8(i),x.triggerDone()}else if(t.event.code==="TRS"){const r=b.trigIdx(i.triggers,t.trigger);r>-1&&i.removeTrigger(i.triggers[r]);const a=b.emptyPlayerActTarg("F","CARD",this.code,""),c=w.toActions(a);c.length===0?x.triggerDone():(c.push(T.noneEndTrigger()),T.ddf5(c))}}}class is extends vt{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const i=this.boof4711;this.text=`Deal ${i} damage to an enemy creature.~Give a friendly creature ${y.jr9(i,0)} this turn.`}canPlay(){const t=this.firstT();return t?p.creatByTarget(t).length>0:!1}playTargets(){return[this.firstT()]}firstT(){if(this.friends().length>0)return b.crEnemyActTarg("CARD",this.code,"P1")}handleAction(t){const i=S.deTil(t.param),r=p.ddf6(t);if(i[0]==="P1"){const a=this.friends(r.id);a.push(T.cancelAction()),T.ddf5(a)}else{this.logSpell(r);const a=this.boof4711;this.smack(p.jr5(i[1]),a),this.modA(r,b.modT("AT",a)),T.spellCast()}}friends(t=""){const i=b.crFriendActTarg("CARD",this.code,S.enTil("P2",t));return w.toActions(i)}}class rs 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=this.buffNug(this.iAttack,0,"TX")}canActivate(t){return!0}startActivation(t){const i=b.crEnemyActTarg("CARD",this.code,t.id),r=b.playerActTarg("E","CARD",this.code,t.id),a=w.toActions([i,r]);a.push(T.cancelAction()),T.ddf5(a)}handleAction(t){const i=p.jr5(t.param);if(t.zone==="F"){const r=p.ddf6(t);this.logAct(!0,r),this.smack(r,this.iAttack)}else{this.logAct(!0);const r=t;this.ouch(r.playerA,this.iAttack),this.anim8(i)}i.endActivation()}}class ss extends vt{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Gauntlets of Sulgrim";const i=this.boof2510;this.text=`Give a friendly creature Armor ${i}, then deal damage equal to its Armor to an enemy creature.`}firstT(){if(this.baddies().length>0){const t=b.crFriendActTarg("CARD",this.code,"P1");return t.canArmor=!0,t}else return}canPlay(){const t=this.firstT();return t?p.creatByTarget(t).length>0:!1}playTargets(){return[this.firstT()]}handleAction(t){const i=S.deTil(t.param),r=p.ddf6(t);if(i[0]==="P1"){const a=T.cancelAction(),c=this.baddies(r.id);c.push(a),T.ddf5(c)}else{const a=p.jr5(i[1]);this.logSpell(a);const c=this.boof2510;a.addArmor(c),this.smack(r,a.armor),T.spellCast()}}baddies(t=""){return w.toActions(b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t)))}}class as 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} ${y.dbdtap()}, you gain that much health.~Allied Tempys: Mobility ${this.level}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("DM");return a.bonus=this.playerNug(this.iAttack,"TP"),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")L.allied("T")&&p.creatByTr(t).addMobility(this.level,"T"),x.triggerDone();else if(t.trigger.type==="DM"){const i=t.event;this.balm(t.owner,i.dmg),this.anim8(t.creatId),x.triggerDone()}}}class ns 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");const i=`Gain Rank: each enemy ${y.levelGateText(this.level)}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+i}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("RU");if(a.bonus=this.statSpawnNug(0,0,"TH"),this.level===3){const c=r.jr4("TS");c.bonus=this.buffNug(3,0,"TW")}return r}ddf8(t){if(t.trigger.type==="DM"){const i=t.event;if(i.isCreatTarg&&i.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 i=b.crEnemyTarg();i.level=w.ddf2(this.level),p.creatByTarget(i).forEach(r=>{const a=r.jr4("DM",this.code);a.bonus=this.rawNug(0,0,0,0,-.5*this.level),a.changes=!0,this.anim8(r)})}else if(t.trigger.type==="TS"){const i=E.tick();p.qEnemyCreats().forEach(r=>{this.smack(r,1,i)})}else if(t.trigger.type==="DM"){const i=p.creatByTr(t);i.status==="A"&&this.kill(i)}x.triggerDone()}}class os 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,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){const i=p.qActiveCreats();t.status==="A"?i.forEach(r=>{r.addModSafe(b.mod("NM",!0,t.id))}):i.forEach(r=>{r.removeModSafe(t.id)})}}class hs extends vt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Grave Pact",this.free=this.level===3,this.free||(this.hints=["LG"]),this.text=`Destroy a friendly creature.~Destroy an ${y.levelGateText(this.level+1)}enemy creature.`}canPlay(){const t=this.firstT();return t?p.creatByTarget(t).length>0:!1}playTargets(){return[this.firstT()]}firstT(){if(this.enemyTargActions().length>0)return b.crFriendActTarg("CARD",this.code,"P1")}handleAction(t){const i=S.deTil(t.param),r=p.ddf6(t);if(i[0]==="P1"){const a=this.enemyTargActions(r.id);a.push(T.cancelAction()),T.ddf5(a)}else{this.logSpell();const a=E.tick();this.kill(p.jr5(i[1]),a),this.kill(r,a),T.spellCast()}}enemyTargActions(t=""){const i=b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return i.level=w.ddf2(this.level+1),w.toActions(i)}}class ls extends P{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="G.S.F. Commando",this.iAttack=this.lValN([3,6,11]),this.iHealth=this.lValN([8,12,19]),this.iArmor=this.level,this.tribe.push("MM"),this.text=`Forge: ${this.name} gets Armor 1 for each other friendly Metamind.~Activate: Deal damage equal to ${this.level}x ${this.name}'s Armor to an enemy creature.`,this.bonus=this.buffNug(0,2*this.level,"TX")}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return t.armor>0&&p.qEnemyCreats().length>0}startActivation(t){const i=b.crEnemyActTarg("CARD",this.code,t.id);T.ddf5(w.toActions([i,w.buttonTarget("CANC")]))}handleAction(t){const i=p.jr5(t.param);this.smack(p.ddf6(t),i.armor*this.level),i.endActivation()}jr8(t){const i=b.crFriendNotMeTarg(t.creatId);i.tribe="MM";const r=p.creatByTarget(i).length;r>0&&p.creatByTr(t).addArmor(r),x.triggerDone()}}class cs extends vt{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Guardians Assemble",this.free=this.level===3,this.free||(this.hints=["LG"]);const i=this.level===1?"Put a copy of a random Forge Guardian from your deck":"Search your deck for a Forge Guardian and put a copy";this.text=`${i} into the center lane.`}canPlay(){return this.voltrons(!1).length>0}playTargets(){const t=b.actionTarget("TF","CARD",this.code,"");return t.player="F",t.lanes=3,this.level>1&&(t.param="P1"),[t]}voltrons(t){const i=k.getActive(),r=b.target("DK");r.player=k.toTarget(i),r.tribe="GD";const a=bt.generateContent(i.deck,!1,r);return t?bt.uniqueContent(a):a}tron(t){this.replc(t,k.activeA,3)}handleAction(t){if(this.level===1){const i=this.voltrons(!1),r=i[S.randInt(0,i.length)].cardCode;this.logSpell(),this.tron(r),T.spellCast()}else if(t.param==="P1"){const i=this.voltrons(E.aiActive),r=i.map(c=>{const f=b.deckSelectAction("CARD",c.cardCode,c.sourceIdx);return f.host=this.code,f}),a=T.cancelAction();a.param="PM",r.push(a),bt.showCustomDeck(i,r)}else this.logSpell(),this.tron(t.card),gt.popMode(),T.spellCast()}}class us 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,i){const r=super.jr3(t,i),a=r.jr4("TE",this.code);a.bonus=this.playerNug(0,"TX");const c=r.addEffect("PS",this.code);return c.area="C",r}ddf8(t){return!0}jr8(t){const i=p.creatByTr(t);this.enforceEffect(i),this.anim8(i),x.triggerDone()}enforceEffect(t){const i=this.boof124,r=b.crNotMeTarg(t.id);r.player=k.toTarget(t.owner);const a=p.creatByTarget(r),c=t.status==="A",f=k.activeA===t.owner,m=Qt.phase==="ET"||Qt.phase==="PT";c&&(f&&m||!f&&!m)?a.forEach(C=>{C.addModSafe(b.mod("AR",i,t.id)),C.addModSafe(b.mod("DF",!0,t.id))}):a.forEach(C=>{C.removeModSafe(t.id)})}}class ds extends vt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const i=this.boof359;this.text=`Give a friendly creature +${i} attack.~Give an enemy creature -${i} attack.`}canPlay(){const t=this.firstT();return t?p.creatByTarget(t).length>0:!1}playTargets(){return[this.firstT()]}firstT(){if(this.enemyTargActions().length>0)return b.crFriendActTarg("CARD",this.code,"P1")}handleAction(t){const i=S.deTil(t.param),r=p.ddf6(t);if(i[0]==="P1"){const a=this.enemyTargActions(r.id);a.push(T.cancelAction()),T.ddf5(a)}else{const a=p.jr5(i[1]);this.logSpell(a,r);const c=this.boof359;this.buffA(a,c),this.buffA(r,-c),T.spellCast()}}enemyTargActions(t=""){const i=b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t));return w.toActions(i)}}class fs 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,i){const r=super.jr3(t,i),a=r.jr4("EF");return a.interactive=!0,r}handleAction(t){this.poot(this,t.playerA,t.lane),T.actionDone(!0)}ddf8(t){return t.event.creatId===t.creatId}jr8(t){if(S.randInt(0,st.simOn?4:2)===1){const r=b.emptyPlayerActTarg("F","CARD",this.code,""),a=b.actionTarget("TB","NOTR",this.code,""),c=w.toActions([r,a]);c.length===1?x.triggerDone():T.ddf5(c)}else x.triggerDone()}}class gs 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 i;this.level===1?(this.iDefend=!0,i=5):(this.iMobile=1,this.iRegen=this.level===2?5:10,i=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 ${i} or higher, replace it with a level ${this.level+1} Iniog.`,this.text=r}jr3(t,i){const r=super.jr3(t,i);if(this.level===3){const a=r.jr4("HG");a.bonus=this.playerNug(4,"TX"),a.batch=!0;const c=r.jr4("VN");c.bonus=this.buffNug(0,3)}else{const a=r.jr4("DS");a.bonus=this.regnNug(2);const c=r.jr4("TE"),f=W.getCard(this.levelUpCard());c.bonus=this.multNug(this.buffNug(f.iAttack,f.iHealth,"TX"),.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 i=p.creatByTr(t);if(t.trigger.type==="HG")this.ouch(!t.owner,t.event.healAmt,t.draw),t.draw&&this.anim8(i);else if(t.trigger.type==="VN")this.poot("ICD"+"1",i.owner,i.lane);else if(t.trigger.type==="DS")this.regn(i,1);else if(t.trigger.type==="TE"){const r=this.level===1?4:9;i.regen>r&&this.replc(this.levelUpCard(),i.owner,i.lane)}x.triggerDone()}}class ms 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 ${y.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,i){const r=super.jr3(t,i),a=r.jr4("PC");a.bonus=this.buffNug(0,this.iAttack);const c=r.jr4("DM");return c.bonus=this.buffNug(this.iAttack,0,"TP"),r}ddf8(t){if(t.trigger.type==="DM"){const i=t.event;return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId}else if(t.trigger.type==="PC"){const i=t.event;if(i.playerA===t.owner)return i.cardCode.slice(0,3)==="IFR"}return!1}jr8(t){const i=p.creatByTr(t);t.trigger.type==="DM"?(this.ouch(!t.owner,t.event.dmg),this.anim8(i)):t.trigger.type==="PC"&&this.replc(`${"IZR"}${this.level}`,i.owner,i.lane),x.triggerDone()}}class ps 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 i=this.boof2510;this.text=`When you play Iztek's Flame, replace this with a level ${this.level} Iztek, Avatar of Flame.~Activate: Deal ${i} damage to a creature.`,this.bonus=this.buffNug(i,0,"TW")}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.bonus=this.buffNug(0,this.iAttack,"TW"),r}canActivate(t){return!0}startActivation(t){const i=b.crActTarg("CARD",this.code,t.id);i.hint=["HR"];const r=w.toActions([i,w.buttonTarget("CANC")]);T.ddf5(r)}handleAction(t){this.logAct(!0),this.smack(p.ddf6(t),this.boof2510),p.jr5(t.param).endActivation()}ddf8(t){return t.event.playerA===t.owner&&t.event.cardCode.slice(0,3)==="IFL"}jr8(t){const i=p.creatByTr(t);this.replc(`${"IZL"}${this.level}`,i.owner,i.lane),x.triggerDone()}}class ys 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=[this.lValH(["ZZ+2","ZZ+2","ZZ+3"])];const i=this.lValS(["Poison 1","Poison 3","that much Poison"]);this.text=`When ${this.name} deals battle damage to a creature or player, they get ${i}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.regnNug(this.iAttack,"TP"),a.bonus.pHealth=this.iAttack,r}ddf8(t){return t.event.battle&&t.event.isCreatSrc&&t.event.srcId===t.creatId}jr8(t){const i=I.toDamage(t.event),r=this.lValN([1,3,i.dmg]);i.isCreatTarg?i.hurtCreat.addPoison(r):(k.addPoison(i.hurtPlayer,r),this.anim8(i.srcCreat)),x.triggerDone()}}class bs 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 i;this.level<3?i=`a ${y.levelGateText(this.level)}card in your`:this.level===3?i="a card in your hand and":i="each card in your hand, deck, and",this.text=`Forge: Level up ${i} discard pile.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=this.level<4,r}handleAction(t){const i=k.getActive();if(t.zone==="N"){const r=W.getCard(i.discard[t.position]);i.discard[t.position]=r.levelUpCard(),gt.popMode(),this.anim8(t.param),T.actionDone(!0)}else Dt.levelInHand(i,t.position,W.getCard(t.card).levelUpCard()),this.anim8(t.param),this.discardLevel(!0,t.param)}jr8(t){if(this.level<3)this.discardLevel(!1,t.creatId);else if(this.level===3){const i=w.toActions(b.lvlHandActTarg(this.code,t.creatId));i.length>0?T.ddf5(i):this.discardLevel(!1,t.creatId)}else{const i=k.getActive();this.levelDeck(i.deck),this.levelDeck(i.discard),i.hand.forEach((r,a)=>{const c=W.getCard(r).levelUpCard();c!==r&&Dt.levelInHand(i,a,c)}),this.anim8(t.creatId),x.triggerDone()}}discardLevel(t,i){const r=k.getActive(),a=b.target("TD");a.player=k.toTarget(r),a.level=w.ddf2(this.level),a.canLevel=!0;let c=bt.generateContent(r.discard,!1,a);if(c.length>0){E.aiActive&&(c=bt.uniqueContent(c));const f=c.map(m=>{const C=b.deckSelectAction("CARD",m.cardCode,m.sourceIdx);return C.param=i,C.host=this.code,C.hint=["CD"],C});bt.showCustomDeck(c,f)}else t?T.actionDone(!0):x.triggerDone()}levelDeck(t){t.map(r=>W.getCard(r).levelUpCard()).forEach((r,a)=>t[a]=r)}}class As 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 ${y.jr9(this.iAttack,0)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){const i=t.status!=="A",r=b.mod("AT",this.iAttack,t.id);p.qPlayerCreats(t.owner).forEach(a=>{a.opposed||i?a.removeModSafe(t.id):a.addModSafe(r)})}}class ks 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=this.statSpawnNug(3,3,"TW");else{this.text=`Activate: Replace this with a level ${this.level+1} ${this.name}.`;const i=3*this.level;this.bonus=this.buffNug(i,i,"TX")}}canActivate(t){return this.level===3?T.emptyAdjacents(t,"").length>0:!0}startActivation(t){let i;if(this.level===3)i=T.emptyAdjacents(t,"");else{const r=b.fieldSelectAction("CARD",t.lane,t.owner);r.param=t.id,r.host=this.code,i=[r]}i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){this.logAct(!0);const i=p.jr5(t.param);this.level===3?this.poot(this.leafCode(1),t.playerA,t.lane):this.replc(this.leafCode(this.level+1),i.owner,i.lane),i.endActivation()}leafCode(t){return`${"LKP"}${t}`}}class Ne extends P{cardConstruct(t){({["AFO"]:()=>this.aetorC(),["CRS"]:()=>this.scootC(),["FOL"]:()=>this.forcC(),["NXO"]:()=>this.nexoC(),["SNK"]:()=>this.tinkC(),["TEX"]:()=>this.texC(),["TSM"]:()=>this.tsmithC()})[t]()}playTarg;optional=!1;constructor(t){super(t),this.playTarg=b.lvlHandActTarg(this.code,""),this.cardConstruct(this.cardCode()),this.text="Forge: "+this.text}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}handleAction(t){L.levelAndDiscardA(t),this.anim8(t.param),T.actionDone(!0)}jr8(t){if(this.cardCode()==="NXO"&&p.creatByTr(t).lane!==3){x.triggerDone();return}const i=w.toActions(this.playTarg);i.length>0?(i.forEach(r=>{r.param=t.creatId}),this.optional&&i.push(T.noneEndTrigger()),T.ddf5(i)):x.triggerDone()}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.text="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.text="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.text="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.text=`If ${this.name} is in the center lane, you may ${y.daluac()}.`}tinkC(){this.faction="A",this.rarity="C",this.name="Steelspark Tinkerer",this.iAttack=this.boof147,this.iHealth=this.lValN([9,12,21]),this.iDefend=!0,this.tribe.push("HM"),this.optional=!0,this.text=`You may ${y.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.text="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.text=`You may ${y.daluac()}.`}}class Ts extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Lightbringer Council",this.iAttack=this.lValN([4,8,10]),this.iHealth=this.boof71116,this.tribe.push("TK"),this.text=`When a friendly Uterra creature ${y.dbdtap()}, you gain ${this.iAttack} health.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.playerNug(this.iAttack,"TP"),a.batch=!0,r}ddf8(t){const i=I.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcCreat.owner===t.owner&&i.srcCreat.faction==="U"}jr8(t){this.balm(t.owner,this.iAttack,t.draw),t.draw&&this.anim8(t.creatId),x.triggerDone()}}class de extends P{lookup(t){return{["ASB"]:{c:()=>this.asbC(),d:(r,a,c)=>this.asbD(r,a,c)},["CHR"]:{c:()=>this.crgC(),d:(r,a,c)=>this.crgD(r,a,c)},["DZD"]:{c:()=>this.dozC(),d:(r,a,c)=>this.dozD(r,a,c)},["DTR"]:{c:()=>this.dtrC(),d:(r,a,c)=>this.dtrD(r,a,c)},["FWS"]:{c:()=>this.fwsC(),d:(r,a,c)=>this.fwsD(r,a,c)},["IMD"]:{c:()=>this.eddieC(),d:(r,a,c)=>this.eddieD(r,a,c)},["LVH"]:{c:()=>this.hiveC(),d:(r,a,c)=>this.hiveD(r,a,c)},["NCM"]:{c:()=>this.ncmbC(),d:(r,a,c)=>this.ncmbD(r,a,c)},["S01"]:{c:()=>this.spcC(),d:(r,a,c)=>this.spcD(r,a,c)},["TDS"]:{c:()=>this.tsrC(),d:(r,a,c)=>this.tsrD(r,a,c)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}cares=!0;trigB;bDraw=!0;deadOk=!1;bFac(t){return t.draw?this.faction:"X"}cardDamaged(t,i){const r=I.toDamage(i.event);this.lookup(t).d(i,r.hurtCreat,r)}image(t){return this.cardCode()==="DZD"?this.fixedImage(t):super.image(t)}jr3(t,i){const r=super.jr3(t,i);if(this.cares){const a=r.jr4("DM");a.bonus=this.trigB,a.batch=this.bDraw}return r}ddf8(t){return t.event.isCreatTarg&&t.event.target===t.creatId&&(this.deadOk||p.creatByTr(t).status==="A")}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,"TS"),this.text=`When ${this.name} is dealt non-battle damage and survives, it gets ${y.jr9(this.level,1)} for each damage dealt.`}asbD(t,i,r){!r.battle&&r.life>0&&i.buff(r.dmg*this.level,r.dmg,this.bFac(t))}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.deadOk=!0,this.level>1&&(this.hints=["MC"],this.text="When Chrogias is dealt damage, you gain that much health.",this.trigB=this.playerNug(5,"TW")),this.level===1?(this.hints=["LG","LM","RT"],this.cares=!1):this.level===2?(this.iRegen=2,this.iDefend=!0,this.hints?.push("LG")):this.level===3&&(this.iBT=!0,this.iRegen=5)}crgD(t,i,r){this.balm(t.owner,r.dmg,t.draw),t.draw&&this.anim8(i)}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.bDraw=!1,this.level===1&&this.hints.push("ZZ-2"),this.trigB=this.buffNug(this.iHealth,0,"TW"),this.trigB.bonus=.3;const t=W.getCard(this.dz());this.text=`When ${this.name} is dealt damage and survives, replace it with a ${y.tokName(t)}.`}dozD(t,i,r){if(i.health>0&&i.status==="A"){const a=this.replc(this.dz(),i.owner,i.lane);a&&a.setHealth(i.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.bDraw=!1,this.deadOk=!0,this.level===3&&(this.iRegen=5),this.hints=["MC"],this.trigB=this.avgSpawnNug(),this.trigB.threat="TX",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,i,r){i.owner===k.activeA&&r.life>0&&(this.logAct(!1),L.freePlay(),this.anim8(i))}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.bDraw=!1,this.trigB=this.rawNug(0,0,0,0,-1),this.text=`When ${this.name} is dealt damage, destroy it.`}fwsD(t,i,r){i.status==="A"&&this.kill(i)}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.deadOk=!0,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,"TW")):(this.cares=!1,this.hints=["LG","LM","RT"])}eddieD(t,i,r){this.ouch(!t.owner,r.dmg,t.draw),t.draw&&this.anim8(i)}hiveC(){this.faction="U",this.rarity="L",this.name="Living Hive",this.iAttack=this.lValN([0,0,10]),this.iHealth=this.lValN([8,12,15]),this.tribe.push("IN","EL"),this.iDefend=this.level<3,this.deadOk=!0,this.bDraw=!1,this.hints=["MC"];const t=W.getCard(Y.bee(this.level));this.text=`When ${this.name} is dealt damage, Spawn a level ${y.tokName(t)}.`,this.iDefend||(this.iBT=!0,this.text+=`~Forge: ${this.name} gets +X attack and +X health, where X is the total amount of Poison the enemy player has.`),this.trigB=this.spawnNug(t,"TX")}hiveD(t,i,r){this.logAct(!1),this.spawn(Y.bee(this.level),t.owner)}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.deadOk=!0,this.bDraw=!1,this.hints=["MC"],this.level===1&&this.hints.push("ZZ-1");const t=W.getCard(Y.purpOzC(this.level));this.text=`When ${this.name} is dealt damage, Spawn a ${y.tokName(t)}.`,this.trigB=this.spawnNug(t,"TW")}ncmbD(t,i,r){this.logAct(!1),this.spawn(Y.purpOzC(this.level),t.owner)}spcC(){this.faction="A",this.rarity="L",this.name="Specimen 001",this.iAttack=this.boof234,this.iHealth=this.lValN([12,16,22]),this.tribe.push("OZ"),this.deadOk=!0,this.bDraw=!1,this.hints=["MC"],this.trigB=this.rawNug(0,ft.calcCreatValueFormula(this.iAttack,0,this.level,0,0,!1,0),0,0,0,"TX"),this.text=`When ${this.name} is dealt non-battle damage, each other friendly creature gets ${y.jr9(this.iAttack,0)} and Armor ${this.level}.`}spcD(t,i,r){if(!r.battle){const a=b.crNotMeTarg(i.id);a.player=k.toTarget(i.owner),p.creatByTarget(a).forEach(c=>{this.buffA(c,this.iAttack),c.addArmor(this.level)})}}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,"TS"),this.text=`When ${this.name} is dealt damage, it gets +1 attack for each damage dealt.`}tsrD(t,i,r){i.buff(r.dmg,0,this.bFac(t))}}class vs extends de{jr3(t,i){const r=super.jr3(t,i);return this.level===3&&r.jr4("FR"),r}jr8(t){if(t.trigger.type==="FR"){const i=k.totalPoison(!t.owner);i>0&&this.buffD(p.creatByTr(t),i),x.triggerDone()}else super.jr8(t)}}class Ss extends Gt{jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}jr8(t){if(t.trigger.type==="FR"){const i=p.creatByTarget(b.crNotMeTarg(t.creatId)),r=this.boof124;i.forEach(a=>a.addPoison(r)),x.triggerDone()}else super.jr8(t)}}class Cs extends vt{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metatransfer",this.text=`Give a creature ${y.jr9(-this.boof579,0)}.~Discard and level up a card.`}canPlay(){return p.qActiveCreats().length>0}playTargets(){const t=b.crActTarg("CARD",this.code,"P1");return t.hint=["DB"],[t]}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=p.ddf6(t),a=b.lvlHandActTarg(this.code,S.enTil("P2",r.id));a.deckPositionSkip=T.playPosition();const c=w.toActions(a);c.length===0?(this.logSpell(r),this.buffA(r,-this.boof579),T.spellCast()):(c.push(T.cancelAction()),T.ddf5(c))}else{const r=p.jr5(i[1]);this.logSpell(r),this.buffA(r,-this.boof579);const a=t;T.shiftPlayCard(a.position),L.levelAndDiscardA(a),T.spellCast()}}}class ws 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=this.statSpawnNug(this.iAttack,this.iHealth,"TW")}canActivate(t){return T.emptyAdjacents(t,"").length>0}startActivation(t){const i=T.emptyAdjacents(t,"");i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){this.logAct(!0);const i=p.jr5(t.param);this.poot(this,t.playerA,t.lane),i.endActivation()}}class Ds 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,i){const r=super.jr3(t,i);if(this.level>1){const a=r.jr4("FR");a.interactive=!0}return r}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1")if(this.level===3){this.wurmsign(2,t);const r=[t.lane,parseInt(i[1])],a=this.fieldActions("P2",r);T.ddf5(a)}else this.wurmsign(1,t),T.actionDone(!0);else this.wurmsign(1,t),T.actionDone(!0)}jr8(t){const i=I.toCreature(t.event);T.ddf5(this.fieldActions("P1",[i.creature.lane]))}fieldActions(t,i){const r=b.actionTarget("TF","CARD",this.code,S.enTil(t,i[0]));r.player="F",r.hint=["FL"],r.lanes=p.laneIdx.filter(c=>!i.includes(c));const a=w.toActions(r);return a.push(T.noneEndTrigger()),a}wurmsign(t,i){this.replc(this.wurmCode(t),i.playerA,i.lane)}wurmCode(t){return`${"MMW"}${t}`}}class Fe extends vt{lookup(t){return{["BRN"]:{c:()=>this.boutC(),z:(r,a)=>this.burner(r,a,8)},["IFL"]:{c:()=>this.izfmC(),z:(r,a)=>this.burner(r,a,this.boof6915)},["LSK"]:{c:()=>this.lspkC(),z:(r,a)=>this.burner(r,a,this.boof6812)},["LYR"]:{c:()=>this.rainC(),z:(r,a)=>this.rainZ(r,a)},["SOK"]:{c:()=>this.sealkC(),z:(r,a)=>this.burner(r,a,this.sealzap)},["STB"]:{c:()=>this.shatC(),z:(r,a)=>this.shatZ(r,a)},["SHK"]:{c:()=>this.shkC(),z:(r,a)=>this.shkZ(r,a)}}[t]}cardCast(t,i,r){this.lookup(t).z(i,r)}hurts=!0;burner(t,i,r){i?this.smack(t,r):this.ouch(t,r)}burnText(t){return`Deal ${t} damage to a creature or player.`}constructor(t){super(t),this.lookup(this.cardCode()).c()}playTargets(){const t=this.hurts?["HR"]:["BF"],i=b.crActTarg("CARD",this.code,"");i.hint=t;const r=b.actionTarget("TP","CARD",this.code,"");return r.hint=t,[i,r]}handleAction(t){let i,r;t.zone==="P"?(this.logSpell(),i=!1,r=t.playerA):(r=p.ddf6(t),this.logSpell(this.hurts?void 0:r),i=!0),this.cardCast(this.cardCode(),r,i),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,i){const r=this.boof7911;i?this.buffH(t,r):this.balm(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,i){const r=this.boof5914,a=b.modT("NA",!0);if(i){const c=t;this.modA(c,a),this.smack(c,r)}else{const c=k.toPlayer(t);k.addMod(c,a),this.ouch(c,r)}}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 ${y.levelGateText(this.level)}spell this turn.`}shkZ(t,i){this.burner(t,i,this.boof124);const r=L.freeCard(this.code);r.condition.level=w.ddf2(this.level),r.condition.card="S"}}class xs 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 i=W.getCard(this.spc());this.text=`Activate: Put a ${y.tokName(i)} into an available lane.~Forge: Destroy a friendly creature.`,this.bonus=this.spawnNug(i,"TX")}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}canActivate(t){return this.empties(t).length>0}startActivation(t){const i=this.empties(t);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const i=S.deTil(t.param);i[0]==="P1"?(this.logAct(!0),this.poot(this.spc(),t.playerA,t.lane),p.jr5(i[1]).endActivation()):(this.kill(p.ddf6(t)),T.actionDone(!0))}jr8(t){const i=b.crFriendActTarg("CARD",this.code,""),r=w.toActions(i);T.ddf5(r)}spc(){return "SPN"+this.level}empties(t){const i=b.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P1",t.id));return w.toActions(i)}}class Bs 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 ${y.levelGateText(this.level)}creature.`}image(t){return this.rawImage(`${"NSH"}${this.level}`,t)}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FK");return a.bonus=this.multNug(this.avgSpawnNug(),.5),a.bonus.threat="TX",r.jr4("EF"),r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const r=I.toCreature(t.event).creature.opposed;r&&w.levelTestCommon(r.level,this.level)&&this.kill(r),x.triggerDone()}}class Hs extends ze{enforceEffect(t){t.lane===3?t.removeModSafe(t.id):t.addModSafe(b.mod("AR",this.boof236,t.id)),super.enforceEffect(t)}}class Ns extends P{constructor(t){super(t),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 ${y.jr9(this.iAttack,0)}. Use this ability only if ${this.name} is in the center lane.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return t.lane===3}startActivation(t){const i=b.crActTarg("CARD",this.code,t.id);i.hint=["BF","BB"];const r=w.toActions(i);r.push(T.cancelAction()),T.ddf5(r)}handleAction(t){const i=p.ddf6(t);this.logAct(!0,i),this.buffA(i,this.iAttack),p.jr5(t.param).endActivation()}jr8(t){const i=p.creatByTr(t);if(i.lane===3){const r=i.jr4("NT");r.bonus=this.buffNug(this.iAttack/2,0,"TW")}x.triggerDone()}}class Fs 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 i=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 ${y.jr9(i,i)}.`}get nbuf(){return this.lValN([1,3,5,10])}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");this.level===1&&(a.interactive=!0);const c=r.jr4("RP"),f=this.nbuf;return c.bonus=this.buffNug(f,f,"TS"),r}ddf8(t){const i=I.toReplaced(t.event);return t.creatId!==i.replCreatId&&t.owner===i.replCreat.owner}jr8(t){const i=p.creatByTr(t);if(t.event.code==="RPL")this.buffD(i,this.nbuf),x.triggerDone();else{const r=p.emptyLanes(t.owner);if(this.level>1){const a=this.level===2?i.adjacent.filter(f=>r.includes(f)):r,c=E.tick();a.forEach(f=>{this.poot(this.seed,i.owner,f,c)}),x.triggerDone()}else{const a=i.adjacent.filter(c=>r.includes(c));if(a.length===0)x.triggerDone();else if(a.length===1)this.poot(this.seed,i.owner,a[0]),x.triggerDone();else{const c=T.emptyAdjacents(i,"");T.ddf5(c)}}}}handleAction(t){this.poot(this.seed,t.playerA,t.lane),T.actionDone(!0)}get seed(){return "NSD"+this.level}}class Ps extends vt{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const i=this.boof246,r=i*-1;this.text=`Give a friendly Zombie ${y.jr9(i,i,!0)}, and Regenerate ${i}.~Then give an enemy non-Zombie ${y.jr9(r,r)}.`}canPlay(){const t=this.firstT();return t?p.creatByTarget(t).length>0:!1}playTargets(){return[this.firstT()]}firstT(){if(this.nonZombies().length>0){const t=b.crFriendActTarg("CARD",this.code,"P1");return t.tribe="ZB",t}else return}handleAction(t){const i=S.deTil(t.param),r=p.ddf6(t);if(i[0]==="P1"){const a=T.cancelAction(),c=this.nonZombies(r.id);c.push(a),T.ddf5(c)}else{const a=p.jr5(i[1]);this.logSpell(a,r);const c=this.boof246;this.buffD(a,c),this.regn(a,c),this.buffD(r,-c),T.spellCast()}}nonZombies(t=""){return w.toActions(b.crEnemyActTarg("CARD",this.code,S.enTil("P2",t))).filter(i=>!p.ddf6(i).isTribe("ZB"))}}class Ms 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 i=this.boof358;this.text=`Activate: Discard and level up a card.~Allied Nekrium: Regenerate ${i}.`,this.bonus=this.rawNug(0,0,0,0,.5,"TW")}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>W.getCard(r).canLevel())}startActivation(t){const i=b.lvlHandActTarg(this.code,t.id);i.hint?.push("DF"),T.ddf5(w.toActions([i,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0),L.levelAndDiscardA(t);const i=p.jr5(t.param);this.anim8(i),i.endActivation()}jr8(t){L.allied("N")&&p.creatByTr(t).addRegen(this.boof358,"N"),x.triggerDone()}}class Es 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 i=this.boof4812n;this.addSp("A",i),this.text=`Allied Alloyin: Activate: Give a creature ${y.jr9(i,0)}`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return t.hasMod(t.id)}startActivation(t){const i=b.crActTarg("CARD",this.code,t.id);i.hint=["DF","DB"];const r=w.toActions(i);r.push(T.cancelAction()),T.ddf5(r)}handleAction(t){const i=p.ddf6(t);this.logAct(!0,i),this.buffA(i,this.boof4812n),p.jr5(t.param).endActivation()}jr8(t){if(L.allied("A")){const i=p.creatByTr(t);i.addMod(b.mod("AL",!0,i.id),"A"),i.changed=!0;const r=i.jr4("NT");r.bonus=this.buffNug(this.boof4812,0,"TX")}x.triggerDone()}}class Rs extends vt{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Oratek Battlebrand";const i=this.boof71013;this.addSp("D",i),this.text=`Deal ${i} damage to a creature.~Allied Alloyin: You may discard a card and level it.`}canPlay(){return p.qActiveCreats().length>0}playTargets(){const t=b.crActTarg("CARD",this.code,"");return t.hint=["HR"],[t]}handleAction(t){if(t.zone==="F")if(this.logSpell(),this.smack(p.ddf6(t),this.boof71013),L.allied("A")){const i=this.levelActs();i.length===1?T.spellCast():T.ddf5(i)}else T.spellCast();else if(t.zone==="H"){const i=t;T.shiftPlayCard(i.position),L.levelAndDiscardA(i),T.spellCast()}else t.zone==="B"&&t.param==="NOTR"?T.spellCast():super.handleAction(t)}levelActs(){const t=b.actionTarget("TB","CARD",this.code,"NOTR"),i=b.lvlHandActTarg(this.code,"");return i.deckPositionSkip=T.playPosition(),w.toActions([i,t])}}class Ls 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} ${y.dbdtap()} on your turn, you may discard and level up a card.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}handleAction(t){L.levelAndDiscardA(t),p.jr5(t.param).anim8("A"),T.actionDone(!0)}ddf8(t){const i=I.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId&&i.srcCreat.owner===k.activeA}jr8(t){if(t.trigger.type==="FR"){if(L.allied("A")){const i=p.creatByTr(t),r=i.jr4("DM");r.interactive=!0,r.bonus=this.rawNug(0,0,0,0,.5,"TP"),i.changed=!0,i.anim8("A")}x.triggerDone()}else if(t.trigger.type==="DM"){const i=w.toActions(b.lvlHandActTarg(this.code,t.creatId));i.length>0?(i.push(T.noneEndTrigger()),T.ddf5(i)):x.triggerDone()}}}class bi extends P{hitCreature;constructor(t,i){super(t),this.hitCreature=i}trigB;jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.trigB,r}ddf8(t){return t.event.battle&&t.event.isCreatTarg===this.hitCreature&&t.event.isCreatSrc&&t.event.srcId===t.creatId}}class Gs extends bi{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=["ZZ-2"];const i=`When Oros ${y.dbdtap()}, you gain that much health.`,r=this.level===4?"Oros gets +attack and +health equal to your health.~":"";this.text=r+i,this.trigB=this.playerNug(this.iAttack/2,"TP")}jr3(t,i){const r=super.jr3(t,i);return this.level===4&&r.addEffect("PH",this.code),r}jr8(t){const i=t.event;this.balm(t.owner,i.dmg),this.anim8(t.creatId),x.triggerDone()}enforceEffect(t){const i=k.toPlayer(t.owner).health;t.status==="A"&&(t.removeModSafe(t.id,!1),t.addMod(b.mod("HL",i,t.id),"X"),t.addMod(b.mod("MH",i,t.id),"X"),t.addMod(b.mod("AT",i,t.id),"X"))}}class Is 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.level===2?this.iDefend=!0:this.hints=["ZZ-1"])}jr3(t,i){const r=super.jr3(t,i);if(this.level===3){const a=r.jr4("DM");a.bonus=this.regnNug(10,"TP")}else{const a=r.jr4("RU");a.bonus=this.regnNug(this.level,"TH")}return r}ddf8(t){if(t.trigger.type==="DM"){const i=t.event;return i.battle&&i.isCreatSrc&&i.srcId===t.creatId}return t.trigger.type==="RU"?t.event.playerA===t.owner:!1}jr8(t){if(t.trigger.type==="RU"){const i=p.creatByTr(t);this.replc(this.levelUpCard(),i.owner,i.lane)}else if(t.trigger.type==="DM"){const i=I.toDamage(t.event);i.isCreatTarg?i.hurtCreat.addPoison(10):(k.addPoison(i.hurtPlayer,10),this.anim8(i.srcCreat))}x.triggerDone()}}class Ws 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,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!this.l3,r}jr8(t){if(this.l3)p.creatByTarget(b.crEnemyTarg()).forEach(i=>{i.negateArmor=!0}),x.triggerDone();else{const i=b.crEnemyActTarg("CARD",this.code,""),r=w.toActions(i);r.length>0?T.ddf5(r):x.triggerDone()}}handleAction(t){const i=p.ddf6(t);this.logAct(!1,i),i.negateArmor=!0,T.actionDone(!0)}}class fe 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)},["SST"]:{c:()=>this.sstC(),a:r=>this.sstA(r),t:r=>this.sstT(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,i){this.lookup(t).a(i)}testAct(t,i){return this.lookup(t).t(i)}constructor(t){super(t),this.lookup(this.cardCode()).c()}preFight=!1;prePlay=!1;canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){const i=w.boardTarget("CARD",this.code);i.param=t.id,this.preFight&&(i.hint=["BB"]),this.prePlay&&(i.hint=["DF"]),T.ddf5(w.toActions([i,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const i=p.jr5(t.param);this.runAct(this.cardCode(),i),i.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=[this.level===1?"ZZ-3":"ZZ-2"],this.prePlay=!0,this.text=`Activate: You may play an additional ${y.levelGateText(this.level)}Robot this turn.`,this.bonus=this.avgSpawnNug(),this.bonus.threat="TX"}afsT(t){return!0}afsA(t){const i=L.freeCard(this.code);i.condition.tribe="RB",i.condition.level=w.ddf2(this.level),this.anim8(t)}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 ${y.jr9(this.level,0)} for each card discarded this way.`,this.bonus=this.buffNug(3*this.level,0,"TX")}drixT(t){return k.getActive().hand.length>0}drixA(t){const i=k.toPlayer(t.owner),r=i.hand.length*this.level;Dt.cardDiscardAll(i);const a=b.crFriendTarg();a.tribe="MM",p.creatByTarget(a).forEach(c=>{this.buffA(c,r)})}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=W.getCard(Y.fgoc(this.level));this.addSp("N",t.iAttack),this.text=`Activate, destroy five friendly Robot Guardians: Put a ${y.tokName(t)} into this lane.`,this.bonus=this.rawNug(0,0,0,0,1,"TW")}fggT(t){return p.creatByTarget(this.fggTarg()).length===5}fggA(t){const i=t.lane,r=t.owner,a=E.tick();p.creatByTarget(this.fggTarg()).forEach(c=>this.kill(c,a)),this.poot(Y.fgoc(this.level),r,i)}fggTarg(){const t=b.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=this.playerNug(this.level*3,"TW")}mvpT(t){return!0}mvpA(t){const i=p.ddf1().length;this.balm(t.owner,i*this.level),this.anim8(t)}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 ${y.levelGateText(this.level)}Robot from your deck. That Robot gets ${y.jr9(this.level,0)} and Armor ${this.level}.`,this.bonus=this.avgSpawnNug(),this.bonus.threat="TX"}mmgT(t){return p.ddf1().length<5&&this.mmgBots().length>0}mmgA(t){const i=this.mmgBots(),r=i[S.randInt(0,i.length)],a=this.spawn(r,t.owner);a&&(a.addArmor(this.level),this.buffA(a,this.level))}mmgBots(){const t=b.target("DK");return t.player="F",t.tribe="RB",t.level=w.ddf2(this.level),w.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=this.buffNug(2*this.iAttack,0,"TX")}owwT(t){return!0}owwA(t){this.buffA(t,t.attack*this.owwbuff)}get owwbuff(){return this.lValN([1,1,2])}sstC(){this.faction="U",this.rarity="C",this.name="Scatterspore Tiller",this.iHealth=this.boof61014,this.iAttack=this.iHealth-1,this.tribe.push("PL");const t=W.getCard(Y.minionCode(this.level));this.text=`Activate: Spawn a ${y.tokName(t)}`,this.bonus=this.spawnNug(t,"TW")}sstT(t){return p.ddf1().length<5}sstA(t){this.spawn(Y.minionCode(this.level),t.owner)}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 ${y.jr9(t,t)}.`,this.bonus=this.multNug(this.buffNug(t,t,"TX"),1.5)}upakT(t){return p.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const i=this.boof124;p.creatByTarget(this.upakTarg(t.id)).forEach(r=>{this.buffD(r,i)})}upakTarg(t){const i=b.crFriendNotMeTarg(t);return i.faction="U",i}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=this.rawNug(0,0,0,0,.5,"TW")}wfmT(t){return!0}wfmA(t){const i=E.tick();p.creatByTarget(b.crEnemyTarg()).forEach(r=>{this.smack(r,t.attack,i)}),this.kill(t)}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 ${y.jr9(t,t)}.~If any enemy creatures are destroyed this way, Spawn one of them at random.`,this.bonus=this.buffNug(-t,-t,"TX")}xerxT(t){return this.xerxTargs().length>0}xerxA(t){const i=-this.boof135,r=[],a=E.tick();this.xerxTargs().forEach(f=>{this.buffD(f,i,a),f.owner!==t.owner&&f.health<1&&r.push(f)});const c=r.length;c>0&&this.spawn(r[S.randInt(0,c)].code,t.owner)}xerxTargs(){return p.qActiveCreats().filter(t=>t.faction!=="N")}}class Ri 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,i){this.lookup(t).f(i)}ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Assault: "+this.ftext,this.ftext=""}jr3(t,i){const r=super.jr3(t,i);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");const t=this.level+3;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health.`}misdF(t){const i=this.level+3;this.ouch(!t.owner,i),this.balm(t.owner,i),this.anim8(t.creatId)}thraC(){this.faction="T",this.rarity="C",this.name="Thranik Ambusher",this.iAttack=this.boof5813,this.iHealth=this.iAttack,this.tribe.push("DK");const t=this.boof234;this.ftext=`${this.name} gets ${y.jr9(t,t)}.`}thraF(t){this.buffD(p.creatByTr(t),this.boof234)}}class yt extends P{lookup(t){return{["ATT"]:{c:()=>this.atorC(),t:r=>this.atorT(r),b:r=>this.atorB(r)},["BRH"]:{c:()=>this.brhrC(),t:r=>this.friendTimeT(r),b:r=>this.brhrB(r)},["BWN"]:{c:()=>this.bulbC(),t:r=>this.friendTimeT(r),b:r=>this.bulbB(r)},["CDM"]:{c:()=>this.cmyC(),t:r=>this.cmyT(r),b:r=>this.cmyB(r)},["CYR"]:{c:()=>this.cycrC(),t:r=>this.cycrT(r),b:r=>this.cycrB(r)},["DHM"]:{c:()=>this.dhamC(),t:r=>this.donkforgeT(r),b:r=>this.donkforgeB(r)},["FGD"]:{c:()=>this.fgdC(),t:r=>this.fgdT(r),b:r=>this.fgdB(r)},["FSP"]:{c:()=>this.fspC(),t:r=>this.fspT(r),b:r=>this.fspB(r)},["HMF"]:{c:()=>this.hamfC(),t:r=>this.hamfT(r),b:r=>this.hamfB(r)},["HOS"]:{c:()=>this.hossC(),t:r=>this.hossT(r),b:r=>this.hossB(r)},["HOD"]:{c:()=>this.haroldC(),t:r=>this.haroldT(r),b:r=>this.haroldB(r)},["IDF"]:{c:()=>this.idfC(),t:r=>this.idfT(r),b:r=>this.idfB(r)},["OJC"]:{c:()=>this.ocarC(),t:r=>this.ocarT(r),b:r=>this.ocarB(r)},["RLW"]:{c:()=>this.restwandC(),t:r=>this.restwandT(r),b:r=>this.restwandB(r)},["RHW"]:{c:()=>this.ruthwandC(),t:r=>this.restwandT(r),b:r=>this.ruthwandB(r)},["SCZ"]:{c:()=>this.sczC(),t:r=>this.donkforgeT(r),b:r=>this.donkforgeB(r)},["SHA"]:{c:()=>this.smaC(),t:r=>this.donkforgeT(r),b:r=>this.donkforgeB(r)},["SSP"]:{c:()=>this.shspC(),t:r=>this.shspT(r),b:r=>this.shspB(r)},["SDR"]:{c:()=>this.spdryC(),t:r=>this.spdryT(r),b:r=>this.spdryB(r)},["TDW"]:{c:()=>this.tdwC(),t:r=>this.tdwT(r),b:r=>this.tdwB(r)},["TNL"]:{c:()=>this.tnlC(),t:r=>this.tnlT(r),b:r=>this.tnlB(r)},["USY"]:{c:()=>this.usyC(),t:r=>this.donkforgeT(r),b:r=>this.donkforgeB(r)},["UTR"]:{c:()=>this.urexC(),t:r=>this.urexT(r),b:r=>this.urexB(r)}}[t]}iTrigger=!0;trigB;bDraw=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i);if(this.iTrigger){const a=r.jr4("EF");a.bonus=this.trigB,a.batch=this.bDraw}return r}ddf8(t){return this.lookup(this.cardCode()).t(t)}jr8(t){this.lookup(this.cardCode()).b(t),x.triggerDone()}bFac(t){return t.draw?this.faction:"X"}truLive(t){return p.creatByTr(t).status==="A"}efp(t){return I.toEnterField(t.event)}efc(t){return this.efp(t).creature}friendTimeT(t){const i=this.efc(t);return t.creatId!==i.id&&i.owner===t.owner&&yt.itBirthedFirst(i.id,t.creatId)}friendGuts(t,i){return i.creatId!==t.creatId&&t.creature.owner===i.owner&&this.truLive(i)}donkforgeT(t){const i=this.efc(t);return t.creatId!==i.id&&i.owner===t.owner&&i.isTribe("DF")&&this.truLive(t)}donkforgeB(t){this.logAct(!1),p.creatByTr(t).buff(this.level,this.level,this.bFac(t))}dftxt(){this.text=`When another friendly Darkforged enters play, ${this.name} gets ${y.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level,"TS"),.5),this.bDraw=!0}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 ${y.levelGateText(this.level)}creature gets Assault: Aggressive.`,this.trigB=this.rawNug(0,0,0,0,.5,"TX")}atorT(t){const i=this.efp(t);return i.forged&&this.friendGuts(i,t)&&w.levelTargetTest(w.ddf2(this.level),i.creature.level)&&!i.creature.opposed&&!i.creature.getState().aggressive}atorB(t){const i=this.efc(t);i.aggressive=!0,this.anim8(i)}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 ${y.jr9(this.level,this.level)}. Then ${this.name} gets ${y.jr9(-this.level,-this.level)}.`}brhrB(t){const i=this.efc(t);this.logAct(!1,i),this.buffD(i,this.level),this.buffD(p.creatByTr(t),-this.level)}bulbC(){this.faction="A",this.rarity="H",this.name="Bulwark Battalion",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.tribe.push("GN");const t=this.boof468;this.text=`When another friendly creature enters play, it gets Armor ${t} until the end of the turn.`,this.trigB=this.regnNug(t,"TW")}bulbB(t){const i=this.efc(t);this.logAct(!1,i),this.modA(i,b.modT("AR",this.boof468))}cmyC(){this.faction="T",this.rarity="H",this.name="Cauldron Mystic",this.iAttack=this.boof357,this.iHealth=this.boof71015,this.tribe.push("YT"),this.text=`When a friendly creature enters play, deal ${this.boof234} damage to an enemy creature or player at random.`,this.trigB=this.buffNug(0,this.iAttack,"TX")}cmyT(t){const i=this.efc(t);return i.owner===t.owner&&yt.itBirthedFirst(i.id,t.creatId)}cmyB(t){const i=p.qPlayerCreats(!t.owner),r=S.randInt(0,i.length+1);r===i.length?(this.ouch(!t.owner,this.boof234),this.anim8(t.creatId)):this.smack(i[r],this.boof234)}cycrC(){this.faction="T",this.rarity="H",this.name="Cyclone Rider",this.iAttack=this.lValN([8,10,16]),this.iHealth=this.iAttack/2,this.tribe.push("WN","AS"),this.level===1&&(this.hints=["ZZ-2"]),this.text=`When an enemy creature enters play, if it is unopposed, move ${this.name} to the lane opposing that creature.`,this.trigB=this.rawNug(0,0,0,0,.5)}cycrT(t){const i=this.efc(t);return i.owner!==t.owner&&!i.opposed}cycrB(t){const i=this.efc(t);i.opposed||this.lurk(p.creatByTr(t),p.oppositeLane(i.lane))}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=W.getCard(Y.fgoc(this.level));this.text=`When ${this.name} enters play, if there is a friendly Alpha Beta, and Gamma, put a ${y.tokName(t)} in your discard pile.`}fgdT(t){return this.efc(t).id===t.creatId}fgdB(t){const i=p.qPlayerCreats(t.owner).map(r=>r.code.slice(0,3));if(i.includes("FGA")&&i.includes("FGB")&&i.includes("FGG")){const r=k.toPlayer(t.owner);r.discard.push(Y.fgoc(this.level));const a=b.trigger("NT",this.code);a.bonus=this.rawNug(0,0,0,0,10),k.addTr(r,a),this.anim8(t.creatId)}}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){this.text=`When you Forge a ${y.levelGateText(this.level-1)}creature, ${this.name} gets +attack equal to that creature's attack.`;const t=this.avgCreatureStats(this.level-1);this.trigB=this.buffNug(t[0],0,"TS")}}fspT(t){const i=this.efp(t);return i.forged&&i.creature.owner===t.owner&&i.creature.level0&&this.lurk(p.creatByTr(t),i[S.randInt(0,r)])}hossC(){this.faction="U",this.rarity="R",this.name="Harbinger of Spring",this.iAttack=this.lValN([5,8,11]),this.iHealth=this.iAttack,this.tribe.push("DY");const t=this.boof234;this.text=`When another friendly creature enters play, if it wasn't Forged, ${this.name} gets ${y.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),1.5),this.bDraw=!0}hossT(t){const i=this.efp(t);return this.friendGuts(i,t)&&!i.forged}hossB(t){this.logAct(!1,this.efc(t));const i=this.boof234;p.creatByTr(t).buff(i,i,this.bFac(t))}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,"TX"),this.bDraw=!0}haroldT(t){const i=this.efp(t);return i.creature.owner!==t.owner&&!i.forged&&this.truLive(t)}haroldB(t){const i=p.creatByTr(t);this.ouch(!i.owner,i.attack,t.draw),t.draw&&this.anim8(i)}idfC(){this.faction="N",this.rarity="H",this.name="Indomitable Fiend",this.iAttack=2,this.iHealth=2,this.maxLevel=1,this.tribe.push("ZB"),this.hints=["ST","ZZ+1"],this.text=`When ${this.name} enters play, if it wasn't Forged, it gets ${y.jr9(5,5)} for each player rank you are.`}idfT(t){const i=this.efp(t);return i.creature.id===t.creatId&&!i.forged}idfB(t){const i=5*k.toPlayer(t.owner).rank;this.buffD(this.efc(t),i)}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 ${y.jr9(t,0)}.`,this.trigB=this.buffNug(-.5*t,0,"TX")}ocarT(t){const i=this.efp(t);return i.creature.owner!==t.owner&&!i.forged&&yt.itBirthedFirst(i.creature.id,t.creatId)}ocarB(t){this.buffA(this.efc(t),this.ocarbuff)}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 ${y.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),.5)}restwandT(t){const i=this.efp(t);return i.creature.isTribe("WD")&&this.friendGuts(i,t)}restwandB(t){this.logAct(!1),this.buffD(p.creatByTr(t),this.boof369)}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,i=-t;this.text=`When another friendly Spirit Wanderer enters play, the creature opposing this gets ${y.jr9(i,i)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TW"),.5)}ruthwandB(t){const i=p.creatByTr(t).opposed;i&&(this.logAct(!1,i),this.buffD(i,-this.boof369))}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,"TX")}shspT(t){const i=this.efp(t);return i.forged&&i.creature.isTribe("DF")&&this.friendGuts(i,t)}shspB(t){this.spawn("DFM"+this.level,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 another friendly creature enters play, ${this.name} gets ${y.jr9(this.level,this.level)}.`,this.trigB=this.multNug(this.buffNug(this.level,this.level,"TS"),1.5),this.bDraw=!0}spdryT(t){return this.friendGuts(this.efp(t),t)}spdryB(t){this.logAct(!1,this.efc(t)),p.creatByTr(t).buff(this.level,this.level,this.bFac(t))}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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TX")}tdwT(t){const i=this.efp(t);return i.creature.owner===t.owner&&!i.forged&&yt.itBirthedFirst(i.creature.id,t.creatId)}tdwB(t){this.buffD(this.efc(t),this.boof246)}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,i=W.getCard(Y.zomc(this.level));this.text=`Forge: Spawn a ${y.tokName(i)} for each friendly creature that was destroyed this turn.~When a friendly Zombie enters play, ${this.name} gets ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS"),this.bDraw=!0}tnlT(t){const i=this.efp(t);return i.creature.isTribe("ZB")&&this.friendGuts(i,t)}tnlB(t){const i=this.boof124;p.creatByTr(t).buff(i,i,this.bFac(t))}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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TW")}urexT(t){const i=this.efc(t);return t.creatId!==i.id&&i.owner===t.owner&&i.isTribe("DN")&&yt.itBirthedFirst(i.id,t.creatId)}urexB(t){this.buffD(this.efc(t),this.boof124)}static itBirthedFirst(t,i){if(t===i)return!0;let r=!1;const a=Bt.findDeathTime(i);if(S.isUn(a))r=!0;else{const c=p.findBirthTime(t);(S.isUn(c)||c<=a)&&(r=!0)}return r}}class De extends bi{lookup(t){return{["AGM"]:{c:()=>this.agamC(),h:(r,a,c,f)=>this.agamH(r,a,c,f)},["BWK"]:{c:()=>this.blwalkC(),h:(r,a,c,f)=>this.blwalkH(r,a,c,f)},["BRF"]:{c:()=>this.bfangC(),h:(r,a,c,f)=>this.snek(r,a,c,f)},["CDT"]:{c:()=>this.cadtC(),h:(r,a,c,f)=>this.snek(r,a,c,f)},["FSL"]:{c:()=>this.fslmC(),h:(r,a,c,f)=>this.fslmH(r,a,c,f)},["GSC"]:{c:()=>this.gcobC(),h:(r,a,c,f)=>this.snek(r,a,c,f)},["IHA"]:{c:()=>this.ibhaC(),h:(r,a,c,f)=>this.ibhaH(r,a,c,f)},["SHS"]:{c:()=>this.shimfC(),h:(r,a,c,f)=>this.shimfH(r,a,c,f)}}[t]}image(t){return this.rarity==="T"?this.fixedImage(t):this.leveledImage(t)}cardConstruct(t){this.lookup(t).c()}creatHit(t,i,r,a,c){this.lookup(t).h(i,r,a,c)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}jr8(t){const i=I.toDamage(t.event);this.creatHit(this.cardCode(),t,i,i.srcCreat,i.hurtCreat),x.triggerDone()}poos(t,i){t.status==="A"&&t.addPoison(i)}snek(t,i,r,a){this.poos(a,this.iAttack)}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} ${y.dbdtac()} on your turn, this battles again.`,this.trigB=this.buffNug(this.iAttack/2,0)}agamH(t,i,r,a){t.owner===k.activeA&&r.status==="A"&&this.wrang(r)}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} ${y.dbdtac(this.level)}, destroy that creature.`,this.trigB=this.avgSpawnNug()}blwalkH(t,i,r,a){a.status==="A"&&w.levelTestCommon(a.level,this.level)&&this.kill(a)}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)}poisonText(t){return`When ${this.name} ${y.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)}fslmC(){this.faction="N",this.rarity="C",this.name="Festering Slime",this.iAttack=this.level,this.iHealth=this.boof61218,this.tribe.push("OZ");const t=this.level+2;this.text=`When ${this.name} ${y.dbdtac()}, that creature gets ${y.jr9(-t,-t)}.`,this.trigB=this.buffNug(t,t)}fslmH(t,i,r,a){a.status==="A"&&this.buffD(a,this.lValN([-3,-4,-5]))}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)}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 ${y.jr9(this.boof246n,0)}`;this.text=`When Ironbeard ${y.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,i,r,a){if(a.status==="A"){const c=this.level===4?a.attack*-1:this.boof246n;this.buffA(a,c),p.fling(a,"A")}}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} ${y.dbdtac()}, that creatures gets that much Poison.`,this.trigB=this.regnNug(this.iAttack)}shimfH(t,i,r,a){this.poos(a,i.dmg)}}class ae extends bi{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(r,a,c)=>this.ashyH(r,a,c)},["AMY"]:{c:()=>this.ashmC(),h:(r,a,c)=>this.ashyH(r,a,c)},["CFB"]:{c:()=>this.cfbC(),h:(r,a,c)=>this.cfbH(r,a,c)},["EPS"]:{c:()=>this.epsdC(),h:(r,a,c)=>this.epsdH(r,a,c)},["EFM"]:{c:()=>this.efmC(),h:(r,a,c)=>this.efmH(r,a,c)},["FBC"]:{c:()=>this.fbcC(),h:(r,a,c)=>this.fbcH(r,a,c)},["RTS"]:{c:()=>this.rzstC(),h:(r,a,c)=>this.rzstH(r,a,c)},["RSE"]:{c:()=>this.rselC(),h:(r,a,c)=>this.rselH(r,a,c)},["SVH"]:{c:()=>this.strhyC(),h:(r,a,c)=>this.strhyH(r,a,c)},["URB"]:{c:()=>this.uridC(),h:(r,a,c)=>this.uridH(r,a,c)},["VES"]:{c:()=>this.veskC(),h:(r,a,c)=>this.veskH(r,a,c)}}[t]}cardConstruct(t){this.lookup(t).c()}creatHit(t,i,r,a){this.lookup(t).h(i,r,a)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}jr8(t){const i=I.toDamage(t.event);i.srcCreat&&(this.bothTurns||i.srcCreat.owner===k.activeA)&&this.creatHit(this.cardCode(),t,i,i.srcCreat),x.triggerDone()}ashyC(){this.faction="T",this.rarity="C",this.tribe.push("FR","AS");const t=this.boof124;this.text=`When ${this.name} ${y.dbdtap()}, it gets ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TP")}ashyH(t,i,r){this.buffD(r,this.boof124)}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} ${y.dbdtap()}, deal that much damage to that player again.`,this.trigB=this.playerNug(this.iAttack/2,"TP")}cfbH(t,i,r){this.ouch(!r.owner,i.dmg),this.anim8(r)}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} ${y.dbdtap()} on your turn, draw a card at the end of the turn.`,this.trigB=this.rawNug(0,0,0,0,.2,"TP")}epsdH(t,i,r){const a=b.trigger("TE","EPH"+this.level);a.changes=!0,a.customCode=this.code,a.bonus=this.rawNug(0,0,0,0,ft.dcWeight),k.addTr(t.owner,a),this.anim8(r)}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.bothTurns=!1,this.text=`When ${this.name} ${y.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,"TP")}efmH(t,i,r){for(let a=0;athis.smack(c,i.dmg,a))}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} ${y.dbdtap()}, it gets ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TP")}rzstH(t,i,r){this.buffD(r,this.boof235)}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} ${y.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,i,r){this.smack(r,i.dmg)}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} ${y.dbdtap()}, it gets Regenerate ${this.level}.`,this.trigB=this.regnNug(this.level,"TP")}strhyH(t,i,r){this.regn(r,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} ${y.dbdtap()} on your turn, each friendly creature gets ${y.jr9(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`,this.trigB=this.buffNug(t,t,"TP")}uridH(t,i,r){const a=this.boof124,c=this.level===3;p.ddf1().forEach(f=>{this.buffD(f,a),c&&(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="",i=.5;this.level===3&&(t=" Then Spawn a copy of that creature."),this.text=`When Vyric ${y.dbdtap()}, destroy an enemy ${y.levelGateText(this.level)}creature at random.`+t,this.trigB=this.multNug(this.avgSpawnNug(),i),this.trigB.threat="TP"}veskH(t,i,r){const a=b.crTarg();a.player=k.toTarget(i.hurtPlayer),a.level=w.ddf2(this.level);const c=p.creatByTarget(a);if(c.length>0){const f=E.tick(),m=c[S.randInt(0,c.length)];this.kill(m,f),this.level===3&&this.spawn(m.code,r.owner,f)}}}class Z 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)},["ATI"]:{c:()=>this.atiC(),f:r=>this.atiF(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)},["REW"]:{c:()=>this.rewC(),f:r=>this.rewF(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,i){this.lookup(t).f(i)}ftext="";forges=!0;flanks;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let i="";this.flanks&&(i="Flank"),this.forges&&(i?i="Forge/"+i:i=y.forglied(this.allied)),i&&(this.text=i+": "+this.ftext),this.ftext=""}image(t){return this.rarity==="T"?super.fixedImage(t):super.image(t)}jr3(t,i){const r=super.jr3(t,i);if(this.forges&&r.jr4("FR"),this.flanks){const a=r.jr4("FK");a.bonus=this.flanks}return r}ddf8(t){return Wt.extractCardCode(t.trigger.logicCode)==="MMR"}jr8(t){const i=this.cardCode();if(t.trigger.type==="TE"&&i==="MMR"){this.logAct(!1);const r=t.event,a=k.toPlayer(r.playerA);k.drawCard(a,this.level);const c=b.trigIdx(a.triggers,t.trigger);c>-1&&a.triggers.splice(c,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 i=b.crFriendTarg();i.hasArmor=!0;const r=E.tick();p.creatByTarget(i).forEach(a=>{a.opposed&&a.opposed.hurtDirect(a.armor,a.code,this.faction,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 i=k.toPlayer(t.owner),r=b.target("TH");r.player=k.toTarget(i),r.tribe="MM";const a=w.deckByTarget(r),c=a.length;if(c>0){const f=a[S.randInt(0,c)];i.deck.splice(f[1],1),Dt.addCard(i,f[0]),this.anim8(t.creatId)}}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.forges&&(this.ftext=`You may play an additional ${y.levelGateText(this.level-1)}Tempys spell this turn.`,this.addSp("C",0))}afsF(t){const i=L.freeCard(this.code);i.condition.card="S",i.condition.level=w.ddf2(this.level-1),i.condition.faction="T",this.anim8(t.creatId)}atiC(){this.faction="T",this.rarity="L",this.name="Avarice, the Insatiable",this.iAttack=this.boof4814,this.iHealth=this.iAttack+2,this.iMobile=1,this.tribe.push("DG");let t="";this.level<3&&(t="Discard down to one card at random. "),this.ftext=`${t}You may play an additional spell this turn.`}atiF(t){if(this.level<3){const r=k.toPlayer(t.owner);if(r.hand.length>1){let a=r.hand.slice();const c=S.randInt(0,a.length);for(let f=a.length-1;f>-1;f--)f!==c&&Dt.cardDiscard(r,f)}}const i=L.freeCard(this.code);i.condition.card="S",this.anim8(t.creatId)}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 i=p.creatByTarget(b.crFriendNotMeTarg(t.creatId)),r=i.length;if(r<4&&r>0){const a=i[S.randInt(0,r)];p.fling(a,"T"),this.logAct(!1,a)}}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 ${y.levelGateText(t)}Uterra creature this turn.`,this.consistent=!0,this.addSp("C",0)}else this.hints=["LG"]}bwtF(t){const i=L.freeCard(this.code);i.condition.card="C",i.condition.faction="U",i.condition.level=w.ddf2(this.level-1),this.anim8(t.creatId)}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 i=this.boof51015,r=b.crFriendTarg();r.tribe="RB",r.canArmor=!0,p.creatByTarget(r).forEach(c=>{this.modA(c,b.modT("AR",i))})}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){L.allied(this.allied)&&p.creatByTr(t).addMobility(this.level,"T")}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,"TS"),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${y.jr9(-1*t,0)} and this gets ${y.jr9(t,0)}.~Allied Tempys: Mobility ${this.level}.`}bfmF(t){const r=I.toEnterField(t.event).creature;t.trigger.type==="FR"&&L.allied("T")&&r.addMobility(this.level,"T");const a=r.opposed;if(a){const c=this.boof246;this.buffA(a,-1*c),this.buffA(r,c)}}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 ${y.jr9(t,t)}.`}charnF(t){const i=this.boof357,r=b.crEnemyTarg();r.maxAttack=i,p.creatByTarget(r).length>0&&this.buffD(p.creatByTr(t),i)}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 ${y.jr9(1,0)} for each other friendly creature.`}chihF(t){const i=p.ddf1().length;i>1&&this.buffA(p.creatByTr(t),i-1)}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,"TX"),this.ftext="Deal damage equal to its attack to the opposing creature. If unopposed, deal that damage to the enemy player instead."}chickenF(t){const i=I.toCreature(t.event),r=i.creature.attack,a=i.creature.opposed;a?this.smack(a,r):(this.ouch(!t.owner,r),this.anim8(i.creature))}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 i=b.crTarg();i.maxAttack=1;const r=p.creatByTarget(i);if(r.length>0){const a=E.tick();r.forEach(c=>{this.kill(c,a)})}}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 i=b.crFriendNotMeTarg(t.creatId);i.tribe="DF";const r=this.boof234*p.creatByTarget(i).length;r>0&&(this.ouch(!t.owner,r),this.balm(t.owner,r),this.anim8(t.creatId))}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 ${y.jr9(this.iAttack,this.iHealth)}.`}dbaF(t){p.ddf1().length===5&&this.buffB(p.creatByTr(t),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");const t=this.boof246;this.flanks=this.buffNug(t*2,0),this.ftext=`If ${this.name} is opposed, the opposing creature gets ${y.jr9(-t,0)} and this gets ${y.jr9(t,0)}.`}drbF(t){const i=I.toEnterField(t.event),r=i.creature.opposed;if(r){const a=this.boof246;this.buffA(r,-a),this.buffA(i.creature,a)}}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.flanks.threat="TX",this.ftext=`Destroy the opposing ${y.levelGateText(this.level)}creature.`}dddF(t){const r=I.toCreature(t.event).creature.opposed;r&&w.levelTestCommon(r.level,this.level)&&this.kill(r)}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){L.allied(this.allied)&&p.creatByTr(t).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 ${y.levelGateText(t)}creature this turn.`,this.level===1&&(this.hints=["LG"])}fwtF(t){const i=L.freeCard(this.code);i.condition.card="C",i.condition.level=w.ddf2(this.level-1),this.anim8(t.creatId)}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 ${y.jr9(4,4)}.`}gwurmF(t){p.qEnemyCreats().length===0&&this.buffD(p.creatByTr(t),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 i=this.boof51015;this.balm(t.owner,i),this.anim8(t.creatId)}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&&(L.freePlay(),this.anim8(t.creatId))}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 i=I.toCreature(t.event);i.creature.hasMod(t.creatId)||this.modA(i.creature,b.modT("ND",!0,t.creatId))}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 ${y.jr9(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`}legtitF(t){const i=b.crEnemyTarg();i.maxAttack=this.boof357;const r=p.creatByTarget(i);r.length>0&&this.buffD(p.creatByTr(t),this.level*r.length)}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 ${y.jr9(t,t)}.`}lbdF(t){const i=p.creatByTarget(b.crFriendNotMeTarg(t.creatId));if(i.length===4){const r=this.boof236;i.forEach(a=>this.buffD(a,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 i=Bt.gravedigger();i&&this.spawn(i,t.owner)}else if(this.level===3){const i=p.emptyLanes(t.owner),r=i.map(a=>Bt.gravedigger());if(i.length>0&&r[0]){const a=E.tick();i.forEach((c,f)=>{this.poot(r[f],t.owner,c,a)})}}}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 ${y.levelGateText(this.level-1)}spell this turn.`}moeF(t){const i=L.freeCard(this.code);i.condition.card="S",i.condition.level=w.ddf2(this.level-1),this.anim8(t.creatId)}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),this.anim8(t.creatId)}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 i=b.crFriendNotMeTarg(t.creatId);if(i.tribe="MM",p.creatByTarget(i).length>0){const r=b.trigger("TE",this.code);r.changes=!0,r.bonus=this.rawNug(0,0,0,0,this.level*ft.dcWeight),k.addTr(t.owner,r),this.anim8(t.creatId)}}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 i=b.crFriendTarg();i.tribe="MM",k.drawCard(t.owner,p.creatByTarget(i).length),this.anim8(t.creatId)}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 ${y.jr9(0,this.boof357)}.`}mossF(t){const i=b.crFriendNotMeTarg(t.creatId);i.tribe="DN";const r=p.creatByTarget(i);if(r.length>0){const a=this.boof357;r.forEach(c=>this.buffH(c,a))}}nysymC(){this.faction="N",this.rarity="C",this.name="Nyrali Symbiote",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("OZ");const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`}nysymF(t){const i=I.toEnterField(t.event);i.creature.opposed&&this.regn(i.creature,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 ${y.jr9(t,0)}.`}ofmF(t){const i=p.creatByTarget(b.crFriendNotMeTarg(t.creatId));if(i.length>0){const r=this.boof135;i.forEach(a=>{this.buffA(a,r)})}}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.iAttack=this.boof4816,this.iHealth=this.boof248,this.tribe.push("RB"),this.ftext=`${this.name} gets Armor ${this.iAttack} this turn.`}orpF(t){this.modA(p.creatByTr(t),b.modT("AR",this.iAttack))}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){L.allied(this.allied)&&p.creatByTr(t).addRegen(this.level,"N")}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 ${y.jr9(this.boof123n,0)}.`}phmF(t){const i=p.qEnemyCreats();if(i.length>0){const r=this.boof123n;i.forEach(a=>{this.buffA(a,r)})}}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,"TW"),.5),this.ftext=`If ${this.name} is in the center lane, Spawn a copy.`}palsF(t){I.toEnterField(t.event).creature.lane===3&&this.spawn(this,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 ${y.jr9(this.iAttack,0)} this turn.`}pokF(t){L.patron("T")&&p.ddf1().forEach(i=>{this.modA(i,b.modT("AT",this.iAttack))})}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 ${y.jr9(t,t)}.`}potF(t){if(L.patron("N")){const i=p.qEnemyCreats();if(i.length>0){const r=this.potbuf;this.logAct(!1),i.forEach(a=>{this.buffD(a,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 i=p.creatByTarget(b.crEnemyTarg()),r=i.length;if(r===0)this.ouch(!t.owner,this.iHealth),this.anim8(t.creatId);else{const a=E.tick(),c=r+1,f=Array(c).fill(0);for(let m=0;m{f[C]>0&&this.smack(m,f[C],a)}),f[r]>0&&(this.ouch(!t.owner,f[r]),this.anim8(t.creatId))}}rewC(){this.faction="U",this.rarity="L",this.name="Ramble, Eternal Witness",this.iAttack=this.boof3712,this.iHealth=this.iAttack+3+this.level,this.tribe.push("HM"),this.level===3?this.ftext="Spawn a random creature from your deck.":this.ftext=`Shuffle the level ${this.level+1} version of this from your discard pile into your deck.`}rewF(t){if(this.level===3){const i=b.target("DK");i.player="F",i.card="C";const r=w.deckByTarget(i).map(a=>a[0]);r.length>0&&this.spawn(r[S.randInt(0,r.length)],t.owner)}else{const i=k.getActive(),r=this.levelUpCard();i.discard.splice(i.discard.lastIndexOf(r),1),i.deck.push(r),st.simOff&&(Ot.shuffleDeck(i),this.anim8(t.creatId))}}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 i=I.toEnterField(t.event),r=!t.owner;if(this.level===2){const a=i.creature.opposed;a&&this.smack(a,5)}else if(this.level===3){const a=E.tick();p.qPlayerCreats(r).forEach(c=>this.smack(c,5,a)),this.ouch(r,5),this.anim8(i.creature)}}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 ${y.jr9(-6,0)} and ${this.name} gets ${y.jr9(6,0)} for each enemy creature.`}scythF(t){const i=p.qEnemyCreats();i.forEach(r=>{this.buffA(r,-6)}),i.length>0&&this.buffA(p.creatByTr(t),6*i.length)}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.level===3){const t=this.avgCreatureStats();this.flanks=this.buffNug(t[0]*2,0,"TS")}this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`}souldrF(t){const i=I.toEnterField(t.event),r=i.creature.opposed;if(r){const a=r.attack;this.buffA(i.creature,a),this.buffA(r,-1*a)}}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 ${y.jr9(this.iAttack,this.iHealth)} for each creature that was destroyed this turn.`}ssggF(t){const i=this.iAttack*(L.deathsA.length+L.deathsB.length);i>0&&this.buffD(p.creatByTr(t),i)}splgC(){this.faction="N",this.rarity="T",this.name="Spiderling",this.iAttack=this.boof369,this.iHealth=this.iAttack+1,this.tribe.push("SP"),this.ftext=`Replace the opposing ${y.levelGateText(this.level)}creature with a Web.`}splgF(t){const i=I.toEnterField(t.event);if(i.creature.opposed){const r=i.creature.opposed;w.levelTestCommon(r.level,this.level)&&this.replc("WEB"+this.level,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 i=this.boof468;this.balm(!0,i),this.balm(!1,i),this.anim8(t.creatId)}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 i=p.searchByLane(3,t.owner);i&&i.id!==t.creatId&&!i.negateArmor&&i.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(I.toEnterField(t.event).creature.opposed){let r=!0;for(;r;){const a=p.emptyLanes(t.owner),c=a.length;if(c===0)r=!1;else{const f=a[S.randInt(0,c)];this.poot(this,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 i=p.creatByTr(t),r=i.lane,a=i.owner,c=[];if(r>2){const f=p.searchByLane(r-1,a);f&&(p.searchByLane(r-2,a)||(c.push(f),this.lurk(f,r-2)))}if(r<4){const f=p.searchByLane(r+1,a);f&&(p.searchByLane(r+2,a)||(c.push(f),this.lurk(f,r+2)))}c.length>0&&this.logAct(!1,...c)}tortex(t){return`Put a level ${this.level} ${t} into your hand.`}handhoss(t,i){const r=k.toPlayer(i.owner);Dt.addCard(r,t+this.level,!0),this.anim8(i.creatId)}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)}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)}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)}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)}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(L.allied(this.allied)){const i=p.creatByTr(t);i.breakthrough=!0,i.anim8("U")}}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.ftext=`Each friendly Yeti deals ${this.iAttack} damage to the opposing creature.`}uwarF(t){const i=b.crFriendTarg();i.tribe="YT";const r=E.tick();p.creatByTarget(i).forEach(a=>{const c=a.opposed;c&&c.hurtDirect(this.iAttack,a.code,this.faction,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 ${y.jr9(this.stokeboof,0)} this turn.`}ustokeF(t){const i=b.crFriendNotMeTarg(t.creatId);i.tribe="YT";const r=this.stokeboof;p.creatByTarget(i).forEach(a=>{this.modA(a,b.modT("AT",r))})}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,"TX");let i="";this.level===3&&(i=" If that creature has 0 or less attack, destroy it.",this.flanks.count=1),this.ftext=`The opposing creature gets ${y.jr9(t,0)}.${i}`}uiwF(t){const a=I.toEnterField(t.event).creature.opposed;a&&(this.buffA(a,this.boof246n),this.level===3&&a.attack<1&&this.kill(a))}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.iAttack=this.boof4712,this.iHealth=this.iAttack,this.tribe.push("DN");const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${y.jr9(t,t)}.`}umaulF(t){const i=I.toEnterField(t.event);i.creature.opposed&&this.buffD(i.creature,this.boof246)}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=(i,r)=>`If there is ${r?"an":"no"} opposing creature, put a level ${this.level} Iztek's ${i} into your hand.`;this.ftext=`${t("Frost",!0)} ${t("Flame",!1)}`}vlfxF(t){const i=I.toCreature(t.event);this.handhoss(i.creature.opposed?"IFR":"IFL",t)}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 a=p.creatByTarget(b.crNotMeTarg(t.creatId));if(a.length>0){const c=E.tick();a.forEach(f=>this.kill(f,c))}}const i=t.owner?L.deathsA:L.deathsB,r=i.length;r>0&&this.spawn(i[S.randInt(0,r)],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 ${y.jr9(1,1).replaceAll("1","X")}, where X is the total amount of Poison on each enemy creature.`}vdrkF(t){const i=p.qEnemyCreats();let r=0;i.forEach(a=>{r+=a.poison}),r>0&&this.buffD(p.creatByTr(t),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 i=b.crEnemyTarg();if(i.hasPoison=!0,p.creatByTarget(i).forEach(a=>{a.addPoison(a.poison)}),this.level===3){const a=k.toPlayer(!t.owner),c=k.totalPoison(a);c>0&&k.addPoison(a,c)}}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 ${y.jr9(3,0)}.`}warF(t){const i=b.crFriendNotMeTarg(t.creatId);p.creatByTarget(i).forEach(r=>this.buffA(r,3))}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 ${y.jr9(t,t)}.`}wwpF(t){const i=this.boof235,r=b.crFriendTarg();r.maxAttack=this.boof357,p.creatByTarget(r).forEach(a=>this.buffD(a,i))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.iAttack=this.boof3612,this.iHealth=this.iAttack,this.tribe.push("ST");const t=this.boof247n;this.flanks=this.buffNug(-t,-t),this.ftext=`The opposing creature gets ${y.jr9(t,t)}.`}wfbF(t){const r=I.toEnterField(t.event).creature.opposed;r&&this.buffD(r,this.boof247n)}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 i=p.creatByTarget(b.crFriendNotMeTarg(t.creatId));if(i.length>0){const r=E.tick();i.forEach(a=>this.kill(a,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 ${y.jr9(t,t)}.`}zdkF(t){const i=this.boof246,r=b.crFriendTarg();r.hasRegen=!0,p.creatByTarget(r).forEach(a=>this.buffD(a,i))}}class Ie extends P{lookup(t){return{["AMP"]:{c:()=>this.aprmC(),f:(r,a)=>this.aprmR(r,a)},["DOV"]:{c:()=>this.dovC(),f:(r,a)=>this.dovR(r,a)},["LMD"]:{c:()=>this.lmdC(),f:(r,a)=>this.lmdR(r,a)},["MDR"]:{c:()=>this.metaC(),f:(r,a)=>this.metaR(r,a)},["NCP"]:{c:()=>this.ncplC(),f:(r,a)=>this.ncplR(r,a)},["ORC"]:{c:()=>this.ordcC(),f:(r,a)=>this.ordcR(r,a)}}[t]}get formation(){return!0}actFormation(t,i){this.lookup(t).f(i,I.toEnterField(i.event))}ftext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Formation: "+this.ftext,this.ftext=""}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FM"),r}jr8(t){this.actFormation(this.cardCode(),t),x.triggerDone()}aprmC(){this.faction="A",this.rarity="H",this.name="Automation Prime",this.iHealth=this.boof468,this.iAttack=this.iHealth+4,this.tribe.push("RB"),this.ftext=`${this.name} gets Armor ${this.iHealth}.`}aprmR(t,i){i.creature.addArmor(this.iHealth)}dovC(){this.faction="N",this.rarity="R",this.name="Disciple of Vyric",this.iAttack=this.boof6915,this.iHealth=this.iAttack-2,this.tribe.push("VP");const t=this.boof468;this.ftext=`Deal ${t} damage to the enemy player and gain ${t} health.`}dovR(t,i){const r=this.boof468;this.ouch(!t.owner,r),this.balm(t.owner,r),this.anim8(i.creature)}lmdC(){this.faction="N",this.rarity="L",this.name="Lichmane Dragon",this.iAttack=this.boof6915,this.iHealth=this.iAttack+1,this.iMobile=1,this.tribe.push("ST","DG"),this.ftext="Spawn an enemy creature that was destroyed this game."}lmdR(t,i){const r=Bt.gravedigger(k.toTarget(!t.owner));if(r){const a=this.spawn(r,t.owner);a&&this.logAct(!1,a)}}metaC(){this.faction="A",this.rarity="R",this.name="Metadata Redactor",this.iAttack=this.boof6915,this.iHealth=this.iAttack-1,this.tribe.push("MM"),this.ftext="Remove all abilities from each friendly adjacent creature."}metaR(t,i){const r=b.crTarg();r.player=k.toTarget(t.owner),r.lanes=i.creature.adjacent,p.creatByTarget(r).forEach(a=>a.wipeAll())}ncplC(){this.faction="N",this.rarity="H",this.name="Necroplasm",this.iAttack=this.lValN([5,8,9]),this.iHealth=this.lValN([7,13,19]),this.tribe.push("OZ"),this.ftext="The enemy player discards a card at random."}ncplR(t,i){const r=k.toPlayer(!t.owner);if(r.hand.length>0){Dt.cardDiscard(r,S.randInt(0,r.hand.length));const a=b.trigger("NT",this.code);a.bonus=this.rawNug(0,0,0,0,.5),k.addTr(t.owner,a),this.anim8(t.creatId)}}ordcC(){this.faction="A",this.rarity="C",this.name="Ordnance Captain",this.iAttack=this.lValN([3,6,8]),this.iHealth=this.boof61014,this.tribe.push("HM"),this.ftext=`Each friendly creature gets ${y.jr9(this.boof235,0)}.`}ordcR(t,i){const r=this.boof235;p.qPlayerCreats(t.owner).forEach(a=>this.buffA(a,r))}}class ii extends P{lookup(t){return{["PYM"]:{c:()=>this.pymC(),g:(r,a)=>this.pymG(r,a)},["RBG"]:{c:()=>this.rbgC(),g:(r,a)=>this.rbgG(r,a)},["SRV"]:{c:()=>this.sprvC(),g:(r,a)=>this.sprvG(r,a)},["TGK"]:{c:()=>this.tgkC(),g:(r,a)=>this.tgkG(r,a)}}[t]}onGain(t,i){this.lookup(t).g(i,i.event)}hPlayer=0;trigB;bDraw=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("LG",this.code);return a.bonus=this.trigB,a.batch=this.bDraw,r}ddf8(t){return this.validPlayer(t)&&p.creatByTr(t).status==="A"}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,"TW")}pymG(t,i){this.ouch(i.playerA,i.healAmt*this.level,t.draw),t.draw&&this.anim8(t.creatId)}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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS")}rbgG(t,i){const r=this.boof135;p.creatByTr(t).buff(r,r,t.draw?"U":"X")}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 ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TS"),this.hints=["ZZ-1"]}sprvG(t,i){const r=this.boof234;p.creatByTr(t).buff(r,r,t.draw?"N":"X")}tgkC(){this.faction="U",this.rarity="R",this.name="Tuskin Grovekeeper",this.iAttack=this.boof6912,this.iHealth=this.iAttack,this.tribe.push("TK"),this.bDraw=!1,this.hPlayer=1,this.text=`When you gain health, Spawn a 3/3 ${Y.minionName(this.level)}.`,this.trigB=this.rawNug(.5,3,3,0,0,"TW")}tgkG(t,i){const r=this.lValS(["SXD","SPL","TTF"])+this.level;this.spawn(r,t.owner)}}class Ze extends P{lookup(t){return{["AWU"]:{c:()=>this.awuC(),m:r=>this.awuM(r)},["EWE"]:{c:()=>this.eweC(),m:r=>this.eweM(r)},["FFM"]:{c:()=>this.ffmC(),m:r=>this.ffmM(r)},["LUC"]:{c:()=>this.lugC(),m:r=>this.lugM(r)},["WBH"]:{c:()=>this.wbhC(),m:r=>this.wbhM(r)}}[t]}mPlayer=0;trigB;bDraw=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("MV");return a.bonus=this.trigB,a.batch=this.bDraw,r}ddf8(t){return this.validPlayer(t)&&p.creatByTr(t).status==="A"}jr8(t){this.lookup(this.cardCode()).m(t),x.triggerDone()}bFac(t){return t.draw?this.faction:"X"}validPlayer(t){if(this.mPlayer===0)return!0;const i=I.toCreature(t.event);return this.mPlayer===1?t.owner===i.creature.owner:t.owner!==i.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,"TW")}awuM(t){this.ouch(!t.owner,this.boof234,t.draw),t.draw&&this.anim8(t.creatId)}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,this.bDraw=!1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${y.jr9(t,t)}.`,this.trigB=this.buffNug(t,t,"TX")}eweM(t){this.buffD(I.toCreature(t.event).creature,this.boof124)}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.bDraw=!1,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,"TX")}ffmM(t){const i=I.toCreature(t.event).creature.opposed;i&&this.smack(i,this.ffbof)}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,"TX")}lugM(t){if(t.owner===k.activeA){const i=p.creatByTr(t);i.extraBattles+=1,t.draw&&this.anim8(i)}}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 ${y.jr9(this.level,this.level)}.`,this.trigB=this.buffNug(this.level,this.level,"TS")}wbhM(t){p.creatByTr(t).buff(this.level,this.level,this.bFac(t))}}class _t extends P{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.agrdP(r,a)},["ART"]:{c:()=>this.arootC(),t:(r,a)=>this.factionSpellMyTurn(r,a),p:(r,a)=>this.arootP(r,a)},["ATS"]:{c:()=>this.atrapC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.atrapP(r,a)},["ARB"]:{c:()=>this.arbysC(),t:(r,a)=>this.enemyPlayed(r,a),p:(r,a)=>this.arbysP(r,a)},["BLH"]:{c:()=>this.bblhC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.bblhP(r,a)},["CYC"]:{c:()=>this.ccC(),t:(r,a)=>this.factionSpellMyTurn(r,a),p:(r,a)=>this.ccP(r,a)},["DHW"]:{c:()=>this.dhwC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.dhwP(r,a)},["FBI"]:{c:()=>this.fbiC(),t:(r,a)=>this.factionSpellMyTurn(r,a),p:(r,a)=>this.fbiP(r,a)},["FLS"]:{c:()=>this.flspkC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.flspkP(r,a)},["IBA"]:{c:()=>this.beardC(),t:(r,a)=>this.beardT(r,a),p:(r,a)=>this.beardP(r,a)},["IZK"]:{c:()=>this.izzyC(),t:(r,a)=>this.izzyT(r,a),p:(r,a)=>this.izzyP(r,a)},["KAW"]:{c:()=>this.kasC(),t:(r,a)=>this.spellMyTurn(r,a),p:(r,a)=>this.kasP(r,a)},["SWA"]:{c:()=>this.swaC(),t:(r,a)=>this.factionSpellMyTurn(r,a),p:(r,a)=>this.swaP(r,a)}}[t]}testPlay(t,i){return this.lookup(t).t(i,i.event)}actPlay(t,i){this.lookup(t).p(i,i.event)}trigB;constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i);if(this.trigB){const a=r.jr4("PC");a.bonus=this.trigB}return r}ddf8(t){return t.event.code==="PLC"?this.testPlay(this.cardCode(),t):t.event.code==="TRE"&&this.cardCode()==="BLH"}jr8(t){t.event.code==="PLC"?this.actPlay(this.cardCode(),t):this.kill(p.creatByTr(t)),x.triggerDone()}spellMyTurn(t,i){return i.playerA===t.owner&&W.getCard(i.cardCode).type==="S"}factionSpellMyTurn(t,i){if(i.playerA===t.owner){const r=W.getCard(i.cardCode);if(r.type==="S"&&r.faction===this.faction)return!0}return!1}enemyPlayed(t,i){return i.playerA!==t.owner}ownerAlive(t){return p.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,ft.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,i){p.creatByTr(t).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 ${y.jr9(t,t)}.`,this.trigB=this.multNug(this.buffNug(t,t,"TS"),2)}arootP(t,i){this.buffD(p.creatByTr(t),this.boof234)}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.regnNug(1),this.text=`When you play a spell, ${this.name} gets Mobility 1 this turn.`}atrapP(t,i){this.modA(p.creatByTr(t),b.modT("MB",1))}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,"TX")}arbysP(t,i){if(L.cardsPlayed>1&&this.ownerAlive(t.creatId)){const r=k.getActive();r.hand.length>0&&(Dt.cardDiscardAll(r),this.anim8(t.creatId))}}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=W.getCard(this.lwy());this.text=`When you play a spell, Spawn a ${y.tokName(t)}. At the end of your turn, destroy it.`,this.trigB=this.spawnNug(t,"TX")}bblhP(t,i){if(this.ownerAlive(t.creatId)){const r=this.spawn(this.lwy(),t.owner);if(r){const a=r.jr4("TE",this.code);a.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,"TX")}ccP(t,i){this.ownerAlive(t.creatId)&&(this.ouch(!t.owner,this.iAttack),this.balm(t.owner,this.iAttack),this.anim8(t.creatId))}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,i){this.regn(p.creatByTr(t),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,"TX")}fbiP(t,i){if(this.ownerAlive(t.creatId)){const r=E.tick();p.qEnemyCreats().forEach(a=>{this.smack(a,this.level,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,"TX")}flspkP(t,i){this.ownerAlive(t.creatId)&&(this.ouch(!t.owner,this.boof235),this.anim8(t.creatId))}beardC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Ascendant",this.iAttack=this.lValN([6,9,14,20]),this.iHealth=this.iAttack,this.iArmor=this.level,this.maxLevel=4,this.tribe.push("FB");let t="";this.level>1&&(t=" and Armor "+(this.level-1));let i=this.lValS([this.name,this.name,this.name+" and adjacent friendly creatures","friendly creatures"]);this.text=`When you play Anvilbreaker, ${i} gets ${y.jr9(this.level+1,0)}${t}.`,this.trigB=this.rawNug(0,0,0,0,this.level/2,"TX")}beardT(t,i){return i.playerA===t.owner&&i.cardCode==="AVB"+"1"}beardP(t,i){const r=this.level+1,a=this.level-1,c=p.creatByTr(t);if(this.buffA(c,r),a>0&&c.addArmor(1),this.level>2){const f=b.crFriendTarg();this.level===3?f.lanes=c.adjacent.concat(c.lane):f.notMe=c.id,p.creatByTarget(f).forEach(m=>{this.buffA(m,r),m.addArmor(a)})}}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,"TX")}izzyT(t,i){if(i.playerA===t.owner){const r=i.cardCode.slice(0,3);return r==="IFL"||r==="IFR"}return!1}izzyP(t,i){const r=p.creatByTr(t),a=i.cardCode.slice(0,3)==="IFL"?"IZL":"IZR";this.replc(`${a}${this.level}`,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.text="When you play a spell, Kas battles an additional time this turn.",this.trigB=this.buffNug(this.iAttack,0,"TX")}kasP(t,i){this.wrang(p.creatByTr(t))}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 ${y.jr9(this.iAttack,0)} this turn.`,this.trigB=this.multNug(this.buffNug(this.iAttack,0,"TW"),.5)}swaP(t,i){this.modA(p.creatByTr(t),b.modT("AT",this.iAttack))}}class ri extends P{lookup(t){return{["KTS"]:{c:()=>this.kitC(),r:(r,a)=>this.kitR(r,a)},["RSC"]:{c:()=>this.scootC(),r:(r,a)=>this.scootR(r,a)},["SCC"]:{c:()=>this.shcrC(),r:(r,a)=>this.shcrR(r,a)},["SND"]:{c:()=>this.ssdC(),r:(r,a)=>this.ssdR(r,a)}}[t]}trigB;actReplace(t,i){this.lookup(t).r(i,I.toReplaced(i.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("RP");return a.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,"TW")}kitR(t,i){this.spawn(this,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.free=!0,this.tribe.push("RB"),this.hints=["RT"],this.text=`When ${this.name} is replaced, the creature that replaces it gets ${y.jr9(this.level,this.level,!0)} and Armor ${this.level}.`,this.trigB=this.buffNug(this.level,ft.calcCreatValueFormula(this.level,this.level,this.level,0,0,!1,0))}scootR(t,i){this.buffD(i.creature,this.level),i.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 ${y.jr9(this.iAttack,this.iAttack)}.`,this.trigB=this.multNug(this.buffNug(this.iAttack,this.iAttack,"TX"),.5)}shcrR(t,i){this.buffD(i.creature,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,"TW"),this.trigB.count=1}ssdR(t,i){const r=i.replCreat.adjacent,a=p.emptyLanes(t.owner),c=E.tick();r.forEach(f=>{a.includes(f)&&this.poot("SPU"+this.level,t.owner,f,c)})}}class Pe extends P{lookup(t){return{["BST"]:{c:()=>this.brimC(),u:(r,a)=>this.brimR(r,a)},["OSV"]:{c:()=>this.scavC(),u:(r,a)=>this.scavR(r,a)},["RHU"]:{c:()=>this.tiaC(),u:(r,a)=>this.tiaR(r,a)},["SKS"]:{c:()=>this.spsoC(),u:(r,a)=>this.spsoR(r,a)},["SWG"]:{c:()=>this.stgrC(),u:(r,a)=>this.stgrR(r,a)},["VTW"]:{c:()=>this.weldC(),u:(r,a)=>this.weldR(r,a)},["WEB"]:{c:()=>this.webC(),u:(r,a)=>this.webR(r,a)}}[t]}actUpgrade(t,i){this.lookup(t).u(i,I.toReplaced(i.event))}constructor(t){super(t),this.lookup(this.cardCode()).c()}image(t){return this.rarity==="T"?super.fixedImage(t):super.image(t)}jr3(t,i){const r=super.jr3(t,i);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,i){const r=E.tick(),a=this.boof468;p.creatByTarget(b.crNotMeTarg(t.creatId)).forEach(c=>this.smack(c,a,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,i){i.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,i){this.buffB(i.creature,i.replCreat.attack,i.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,i){i.creature.aggressive=!0,this.anim8(i.creature)}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 ${y.jr9(this.iAttack,this.iAttack)}.`}stgrR(t,i){this.buffD(i.creature,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,i){i.creature.negDefend("A")}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,i){this.buffB(i.creature,i.replCreat.attack,i.replCreat.health-1)}}class Ht extends P{lookup(t){return{["CGG"]:{c:()=>this.cggC(),v:(r,a)=>this.cggV(r,a)},["CGF"]:{c:()=>this.cfiendC(),v:(r,a)=>this.cfiendV(r,a)},["CSB"]:{c:()=>this.corpsC(),v:(r,a)=>this.corpsV(r,a)},["CYS"]:{c:()=>this.cslmC(),v:(r,a)=>this.cslmV(r,a)},["DSK"]:{c:()=>this.dskC(),v:(r,a)=>this.dskV(r,a)},["FST"]:{c:()=>this.fstrC(),v:(r,a)=>this.fstrV(r,a)},["FWK"]:{c:()=>this.fwlkC(),v:(r,a)=>this.fwlkV(r,a)},["FFD"]:{c:()=>this.ffC(),v:(r,a)=>this.ffV(r,a)},["FSC"]:{c:()=>this.flwcC(),v:(r,a)=>this.flwcV(r,a)},["GVS"]:{c:()=>this.ghsC(),v:(r,a)=>this.ghsV(r,a)},["GBG"]:{c:()=>this.ggC(),v:(r,a)=>this.ggV(r,a)},["GMR"]:{c:()=>this.gromC(),v:(r,a)=>this.gromV(r,a)},["MMX"]:{c:()=>this.mmeC(),v:(r,a)=>this.mmeV(r,a)},["NOZ"]:{c:()=>this.nyozC(),v:(r,a)=>this.nyozV(r,a)},["POX"]:{c:()=>this.poxC(),v:(r,a)=>this.poxV(r,a)},["RSZ"]:{c:()=>this.rszC(),v:(r,a)=>this.rszV(r,a)},["SFM"]:{c:()=>this.spirmC(),v:(r,a)=>this.spirmV(r,a)},["SNT"]:{c:()=>this.sssC(),v:(r,a)=>this.sssV(r,a)},["USA"]:{c:()=>this.usaC(),v:(r,a)=>this.usaV(r,a)},["VGN"]:{c:()=>this.vgfsC(),v:(r,a)=>this.vgfsV(r,a)},["XHS"]:{c:()=>this.xhostC(),v:(r,a)=>this.xhostV(r,a)},["ZTU"]:{c:()=>this.zimusC(),v:(r,a)=>this.zimusV(r,a)}}[t]}cardVengeance(t,i){this.lookup(t).v(i,I.toCreature(i.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,i){const r=super.jr3(t,i);if(this.trigB){const a=r.jr4("VN");a.bonus=this.trigB}return r}jr8(t){this.cardVengeance(this.cardCode(),t),x.triggerDone()}cggC(){this.faction="N",this.rarity="H",this.name="Ceaseless Grimgaunt",this.iAttack=this.boof5813,this.iHealth=1,this.tribe.push("GG"),this.vtext=`If there are no friendly creatures in play, Spawn a level ${this.level} ${this.name}.`,this.hints=["ST"],this.trigB=this.rawNug(0,0,0,0,.5)}cggV(t,i){p.qPlayerCreats(t.owner).length===0&&(this.logAct(!1),this.spawn(this,t.owner))}cfiendC(){this.faction="N",this.rarity="T",this.name="Contagion Fiend",this.iAttack=this.boof234,this.iHealth=this.boof5812,this.tribe.push("AB"),this.hints=["ST"],this.fixedImgCreat=!0;const t=-this.level;this.vtext=`Each enemy creature gets ${y.jr9(t,t)}.`;const i=this.boof246;this.trigB=this.buffNug(i,i)}cfiendV(t,i){const r=-this.level,a=E.tick();p.qPlayerCreats(!t.owner).forEach(c=>this.buffD(c,r,a))}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,i){const r=`${"ZBS"}${this.level}`;this.poot(r,i.creature.owner,i.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,i){const r=`${"COZ"}${this.level}`;this.poot(r,i.creature.owner,i.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,i){const r=`${"SPN"}${this.level}`;this.poot(r,i.creature.owner,i.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=W.getCard(this.fsz());this.vtext=`Spawn a ${y.tokName(t)}.`,this.trigB=this.multNug(this.buffNug(t.iAttack,t.iHealth),.5)}fstrV(t,i){this.spawn(this.fsz(),i.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"),this.hints=["ST"];const t=W.getCard(Y.zomc(this.level));this.vtext=`Put a ${y.tokName(t)} into this lane.`,this.trigB=this.buffNug(t.iAttack,t.iHealth)}fwlkV(t,i){this.poot(Y.zomc(this.level),i.creature.owner,i.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,i){const r=`${"FFD"}${this.level-1}`;this.poot(r,i.creature.owner,i.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,i){const r=b.crTarg();r.player=k.toTarget(t.owner),r.tribe="RB";const a=p.creatByTarget(r);if(a.length>0){const c=a[S.randInt(0,a.length)];c.addArmor(this.iHealth),this.logAct(!1,c)}}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,i){const r=S.randInt(this.boof124,this.gghigh);this.balm(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,i){const r=S.randInt(this.boof124,this.gghigh);this.ouch(!t.owner,r)}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=Y.minionBuff(this.level),i=Y.minionName(this.level);this.vtext=`Put a ${t}/${t} ${i} into this lane.`,this.trigB=this.buffNug(t,t)}gromV(t,i){const r=Y.minionCode(this.level);this.poot(r,i.creature.owner,i.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*ft.dcWeight)}mmeV(t,i){k.drawCard(t.owner,this.level),this.anim8(i.creature)}nyozC(){this.faction="N",this.rarity="R",this.name="Nyrali Ooze",this.iAttack=this.boof247,this.iHealth=this.iAttack,this.tribe.push("OZ"),this.hints=["ST"];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,i){const r=`${"OOZ"}${this.level}`;this.poot(r,i.creature.owner,i.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","ST"],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,i){const r=`${"POX"}${this.level+1}`;this.spawn(r,i.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 ${y.levelGateText(this.level)}spell at random from your discard pile into your hand.`,this.trigB=this.rawNug(0,0,0,0,.5)}rszV(t,i){const r=k.toPlayer(t.owner),a=b.target("TD");a.player=k.toTarget(r),a.card="S",a.level=w.ddf2(this.level);const c=w.deckByTarget(a);if(c.length>0){const f=c[S.randInt(0,c.length)];r.discard.splice(f[1],1),Dt.addCard(r,f[0],!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.hints=["ST"],this.vtext=`Deal ${this.boof246} damage to each creature.`,this.trigB=this.rawNug(0,0,0,0,.2)}spirmV(t,i){const r=this.boof246,a=E.tick();p.qActiveCreats().forEach(c=>this.smack(c,r,a))}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,i){(i.creature.lane===1||i.creature.lane===5)&&this.spawn(i.creature.code,t.owner)}usaC(){this.faction="T",this.rarity="H",this.name="Unstable Asir",this.iAttack=this.boof357,this.iHealth=this.boof61016,this.iDefend=!0,this.tribe.push("FR","AS"),this.hints=["ST"],this.vtext=`Deal damage equal to ${this.name}'s attack to the enemy player.`,this.trigB=this.playerNug(this.iAttack)}usaV(t,i){i.creature.attack>0&&this.ouch(!t.owner,i.creature.attack)}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=["ST"];const t=this.boof369n;this.vtext=`Give the opposing creature ${y.jr9(t,t)}.`,this.trigB=this.buffNug(-t,-t)}vgfsV(t,i){const r=i.creature.opposed;r&&this.buffD(r,this.boof369n)}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.iAttack=this.boof359,this.iHealth=this.boof135,this.tribe.push("AB"),this.hints=["ST"],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,i){const r=this.iAttack;this.ouch(!t.owner,r),this.balm(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,i){let r;this.level===2?r=`${"ZTR"}2`:r=`${"ZTU"}3`,this.spawn(r,t.owner)}}class Li extends vt{lookup(t){return{["IRT"]:{c:()=>this.infrC(),m:r=>this.infrM(r)},["NXB"]:{c:()=>this.nexbC(),m:r=>this.nexbM(r)}}[t]}createMod(t,i){return this.lookup(t).m(i)}constructor(t){super(t),this.overload=!0,this.maxLevel=1,this.lookup(this.cardCode()).c()}nexus=!1;playTargets(){return[b.playerActTarg("F","CARD",this.code,"")]}handleAction(t){this.logSpell();const i=k.toPlayer(t.playerA),r={effId:E.genId(),logicCode:this.code};i.effects.push(r),this.enforcePlayerEffect(r,i),T.spellCast()}enforcePlayerEffect(t,i){const r=this.cardCode(),a=this.createMod(r,t.effId),c=this.nexus?[3]:[1,5];p.qPlayerCreats(i.isPlayerA).forEach(f=>{f.faction===this.faction&&c.includes(f.lane)?f.addModSafe(a):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 b.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 b.mod("AR",3,t)}}class qt extends vt{lookup(t){return{["AEC"]:{c:()=>this.anceC(),p:r=>this.aeZ(r)},["CYW"]:{c:()=>this.wailC(),p:r=>this.wailZ(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,i){this.lookup(t).p(i)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){return[b.playerActTarg(this.playTarg,"CARD",this.code,"")]}handleAction(t){this.logSpell();const i=k.toPlayer(t.playerA);this.cardCast(this.cardCode(),i),T.spellCast()}ddf8(t){if(t.trigger.type==="TE")return t.event.playerA===t.owner;if(t.trigger.type==="PC"){const i=t.event,r=W.getCard(i.cardCode);return r.type==="S"&&r.faction==="T"&&i.playerA===t.owner}else if(t.trigger.type==="EF"){const i=I.toEnterField(t.event);return i.creature.faction==="U"&&i.creature.owner===t.owner}else return!1}jr8(t){const i=Wt.extractCardCode(t.trigger.logicCode),r=t.event;let a=!1;if(i==="LCE"){a=!0;const c=k.toPlayer(r.playerA),f=this.level===1?1:2;this.logAct(!1),k.drawCard(c,f)}else if(i==="IME"){a=!0;const c=Bt.gravedigger(k.toTarget(t.owner),w.ddf2(this.level+1));c&&this.spawn(c,r.playerA)}else if(i==="DRE"){a=!0;const c=this.level===1?11:21;this.ouch(!r.playerA,S.randInt(1,c))}else if(i==="IGR")this.ouch(!r.playerA,2);else if(i==="EVT"){const c=I.toEnterField(t.event);this.buffD(c.creature,1),this.logAct(!1,c.creature)}else if(i==="AEC"){a=!0;const c=p.qPlayerCreats(t.owner);if(c.length>0){const f=this.level===1?[1,2]:[2,4];c.forEach(m=>{this.logAct(!1,m),this.buffB(m,f[0],f[1])})}}else super.jr8(t);if(a&&this.level<3){const c=k.toPlayer(r.playerA),f=b.trigIdx(c.triggers,t.trigger);f>-1?t.trigger.customCode==="P2"?c.triggers[f].customCode="P1":c.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 i=b.trigger("TE",this.code);return this.level<3&&(i.customCode="P2"),i.changes=!0,k.addTr(t,i),i}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 ${y.jr9(t[0],t[1])}.`}aeZ(t){const i=this.echoZ(t),r=this.boof248;i.bonus=this.buffNug(r,r*2)}wailC(){this.faction="N",this.rarity="R",this.name="Crypt Wail",this.playTarg="E";const t=this.boof579;this.text=`Deal ${t} damage to the enemy player and gain ${t} health. If a Raid occured this turn, deal ${t*2} damage and gain ${t*2} health instead.`}wailZ(t){const i=this.boof579*(L.ffs>2?2:1);this.ouch(t,i),this.balm(!t.isPlayerA,i)}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){this.ouch(t,S.randInt(1,this.dshigh))}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 i=this.echoZ(t);i.bonus=this.playerNug(this.lValN([4,9,25]))}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){this.balm(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 ${y.jr9(1,1)}".`}endvZ(t){const i=b.trigger("EF",this.code);i.bonus=this.buffNug(4,4),i.changes=!0,k.addTr(t,i)}esrgC(){this.faction="A",this.rarity="R",this.name="Energy Surge",this.overload=this.level===3,this.level===1?this.hints=["LG"]:this.free=!0,this.playTarg="F",this.text=`Draw ${this.level} card${this.free?"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 i=k.getActive(),r=i.rank*3;this.ouch(t,r),this.balm(i,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 i=b.trigger("PC",this.code);i.bonus=this.playerNug(6),i.changes=!0,k.addTr(t,i)}itorC(){this.faction="T",this.rarity="R",this.name="Ice Torrent",this.free=this.level>1,this.level===1&&(this.hints=["LG"]),this.playTarg="E",this.text=`Deal ${this.boof234} damage to the enemy player.`}itorZ(t){this.ouch(t,this.boof234)}imecC(){this.faction="N",this.rarity="L",this.name="Immortal Echoes",this.playTarg="F";const t=`Spawn a random friendly ${y.levelGateText(this.level+1)}creature that was destroyed this game`;this.text=`${this.echTxt()}${t}.`}ieZ(t){const i=this.echoZ(t),r=this.lValN([1,1,3]);i.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 i=this.echoZ(t),r=this.boof124*ft.dcWeight;i.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){st.simOn?this.boof61224:this.mendboof+1,this.balm(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 i=this.boof4712;this.ouch(t,i),this.balm(!t.isPlayerA,i)}}class $s extends P{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Primeval Ancient",this.iAttack=this.boof359,this.iHealth=this.boof71117,this.tribe.push("DN"),this.text=`At the end of your turn, you gain ${this.healy} life.~Forge: If there are no enemy creatures, spawn a copy of this.`}get healy(){return this.level+2}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("TE");return a.bonus=this.playerNug(this.healy,"TW"),r}ddf8(t){return t.event.playerA===t.owner}jr8(t){t.trigger.type==="FR"?p.qEnemyCreats().length===0&&this.spawn(this,t.owner):t.event.code==="TRE"&&(this.balm(t.owner,this.healy),this.anim8(t.creatId)),x.triggerDone()}}class Us 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.text=`When a friendly creature ${y.dbdtap()}, ${this.name} gets ${y.jr9(this.level,this.level)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM"),c=this.boof246;return a.bonus=this.buffNug(c,c,"TP"),a.batch=!0,r}ddf8(t){const i=I.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcCreat.owner===t.owner}jr8(t){p.creatByTr(t).buff(this.level,this.level,t.draw?"T":"X"),x.triggerDone()}}class xe extends P{lookup(t){return{["BTD"]:{c:()=>this.btdC(),r:r=>this.btdR(r)},["DKS"]:{c:()=>this.dksC(),r:r=>this.dksR(r)},["HMO"]:{c:()=>this.hrdC(),r:r=>this.hrdR(r)},["HVE"]:{c:()=>this.hveC(),r:r=>this.hveR(r)},["LTU"]:{c:()=>this.ltuC(),r:r=>this.ltuR(r)},["QSW"]:{c:()=>this.qswC(),r:r=>this.qswR(r)},["RTW"]:{c:()=>this.rlwC(),r:r=>this.rlwR(r)},["SMS"]:{c:()=>this.smsC(),r:r=>this.smsR(r)}}[t]}trigB;rtext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Raid: "+this.rtext,this.rtext=""}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("RD");return a.bonus=this.trigB,r}jr8(t){this.lookup(this.cardCode()).r(t),x.triggerDone()}btdC(){this.faction="T",this.rarity="L",this.name="Blitzmane, the Destroyer",this.iAttack=this.lValN([5,8,10]),this.iHealth=this.iAttack-1,this.iAggro=!0,this.iMobile=1,this.tribe.push("DG"),this.trigB=this.buffNug(0,this.iAttack,"TX"),this.rtext="Deal damage equal to Blitzmane's attack to the opposing creature. If unopposed, deal the damage to the enemy player instead."}btdR(t){const i=p.creatByTr(t);if(i.attack>0){const r=i.opposed;r?this.smack(r,i.attack):(this.ouch(!i.owner,i.attack),this.anim8(i))}}dksC(){this.faction="T",this.rarity="R",this.name="Dragonkeeper Shaman",this.iAttack=this.boof61016,this.iHealth=this.boof369,this.tribe.push("HM");const t=this.level+2;this.trigB=this.buffNug(0,t,"TX"),this.rtext=`Deal ${t} damage to each enemy creature.`}dksR(t){const i=p.qEnemyCreats();if(i.length>0){const r=E.tick(),a=this.level+2;i.forEach(c=>this.smack(c,a,r))}}hrdC(){this.faction="U",this.rarity="C",this.name="Herd Mother",this.iAttack=this.boof5915,this.iHealth=this.iAttack,this.tribe.push("DN");const t=this.level+2;this.trigB=this.buffNug(this.level,this.level),"TS",this.rtext=`${this.name} gets ${y.jr9(t,t)}.`}hrdR(t){this.logAct(!1),this.buffD(p.creatByTr(t),this.level+2)}hveC(){this.faction="U",this.rarity="R",this.name="Hive Empress",this.iAttack=this.boof234,this.iHealth=this.boof61016,this.tribe.push("IN"),this.hints=[this.lValH(["ZZ+1","ZZ+2","ZZ+4"])],this.trigB=this.playerNug(this.iAttack,"TX"),this.rtext=`Give the enemy player Poison ${this.iAttack}.`}hveR(t){this.logAct(!1),k.addPoison(!t.owner,this.iAttack),this.anim8(t.creatId)}ltuC(){this.faction="U",this.rarity="L",this.name="Lorus, the Unrivaled",this.iAttack=this.boof2612,this.iHealth=this.boof71117,this.tribe.push("LP"),this.trigB=this.buffNug(3,3,"TX"),this.level===3?this.rtext=`Each other friendly creature gets ${y.jr9(3,3)}.`:this.rtext=`Replace this with a level ${this.level+1} ${this.name}.`}ltuR(t){if(this.logAct(!1),this.level===3)p.creatByTarget(b.crFriendNotMeTarg(t.creatId)).forEach(i=>this.buffD(i,3));else{const i=p.creatByTr(t);this.replc(this.levelUpCard(),i.owner,i.lane)}}qswC(){this.faction="T",this.rarity="L",this.name="Quakeasaurus Wrecks",this.iAttack=this.boof5814,this.iHealth=this.iAttack+2,this.tribe.push("DN");const t=this.boof234;this.trigB=this.playerNug(t,"TX"),this.rtext=`Deal damage to a random enemy creature and to the enemy player equal to ${t}x the number of friendly Dinosaurs.`}qswR(t){const i=b.crFriendTarg();i.tribe="DN";const r=p.creatByTarget(i).length*this.boof234,a=p.qEnemyCreats();a.length>0&&this.smack(a[S.randInt(0,a.length)],r),this.ouch(!t.owner,r),this.anim8(t.creatId)}rlwC(){this.faction="U",this.rarity="H",this.name="Relentless Wanderers",this.iAttack=this.boof51015,this.iHealth=this.iAttack-this.level,this.tribe.push("ST","WD"),this.hints=[this.lValH(["ZZ-1","ZZ-3","ZZ-3"])],this.trigB=this.multNug(this.statSpawnNug(this.iAttack,this.iHealth,"TW"),.5),this.rtext=`Spawn a ${y.tokName(this)}.`}rlwR(t){this.spawn(this,t.owner)&&this.logAct(!1)}smsC(){this.faction="T",this.rarity="C",this.name="Stampeding Mongosaur",this.iAttack=this.boof61015,this.iHealth=this.iAttack,this.tribe.push("DN");const t=this.lValN([6,8,10]);this.trigB=this.playerNug(t/2,"TW"),this.rtext=`Deal ${t} damage to the enemy player.`}smsR(t){this.ouch(!t.owner,this.lValN([6,8,10])),this.anim8(t.creatId)}}class te 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,i){const r=super.jr3(t,i),a=r.jr4("RU");return a.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");const t=this.boof3612;this.trigB=this.buffNug(t,0,"TH"),this.rtext=`Deal ${t} damage to each non-Tempys creature.`}avinvR(t){const i=this.boof3612,r=E.tick();p.qActiveCreats().filter(a=>a.faction!=="T").forEach(a=>this.smack(a,i,r))}bskphC(){this.faction="N",this.rarity="C",this.name="Blightskull Phantasm",this.iAttack=this.boof5814,this.iHealth=this.boof61017,this.tribe.push("ST");const t=this.boof369n;this.trigB=this.buffNug(0,-t,"TH"),this.rtext=`The opposing creature gets ${y.jr9(t,t)}.`}bskphR(t){const i=p.creatByTr(t).opposed;i&&this.buffD(i,this.boof369n)}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.trigB=this.rawNug(0,0,0,0,.2,"TH"),this.rtext=`Negate Defender from ${this.name}.`}crucR(t){p.creatByTr(t).negDefend("A"),t.trigger.bonus.threat=void 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.trigB=this.rawNug(0,0,0,0,-1,"TL"),this.rtext=`Destroy ${this.name}.`}ebknR(t){this.kill(p.creatByTr(t))}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,"TH"),this.rtext=`Replace ${this.name} with a 9/9 Feywing.`}fwcR(t){const i=p.creatByTr(t);this.replc(`${"FWG"}1`,i.owner,i.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,"TH"),this.rtext=`Replace ${this.name} with a level ${this.level} Frostmane Dragon.`}feggR(t){const i=p.creatByTr(t);this.replc(`${"FMD"}${this.level}`,i.owner,i.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.trigB=this.rawNug(0,0,0,0,ft.dcWeight*.6,"TH"),this.rtext="Draw 2 cards."}mmovR(t){k.drawCard(t.owner,2),this.anim8(t.creatId)}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.trigB.threat="TH",this.rtext="Spawn a random creature that was destroyed this game."}porshR(t){const i=Bt.gravedigger();i&&this.spawn(i,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.trigB=this.buffNug(0,this.iAttack,"TH"),this.rtext=`${this.name} gets ${y.jr9(this.iAttack,this.iAttack)}.`}runegR(t){this.buffD(p.creatByTr(t),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");const t=this.boof248;this.trigB=this.buffNug(t,t,"TH");const i=this.level===3;let r="";i&&(r=", and Breakthrough"),this.rtext=`Each friendly creature gets ${y.jr9(t,t,i)}${r}.`}solrevR(t){const i=this.boof248;p.ddf1().forEach(r=>{this.buffD(r,i),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");const t=this.boof579;this.rtext=`Deal ${t} damage to the enemy player.`,this.trigB=this.playerNug(t,"TH")}spshamR(t){this.ouch(!t.owner,this.boof579),this.anim8(t.creatId)}snoutC(){this.faction="U",this.rarity="C",this.name="Stouthide Stegadon",this.iAttack=this.boof4714,this.iHealth=this.boof71117,this.tribe.push("DN"),this.rtext=`Heal ${this.snoutbof} damage from ${this.name}.`,this.trigB=this.buffNug(0,this.iHealth)}snoutR(t){p.creatByTr(t).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");const t=this.mantbof;this.rtext=`You gain ${t} health.`,this.trigB=this.playerNug(t/3,"TH")}mantisR(t){this.balm(t.owner,this.mantbof),this.anim8(t.creatId)}get mantbof(){return this.lValN([8,10,12])}}class Os extends vt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Remembrance",this.text=`Banish a ${y.levelGateText(this.level)}creature from your discard pile, then Spawn a copy of it.`}canPlay(){return this.remCrds(!1).length>0}playTargets(){const t=w.boardTarget("CARD",this.code);return t.param="P1",[t]}remCrds(t){const i=k.getActive(),r=b.target("TD");r.player=k.toTarget(i),r.card="C",r.level=w.ddf2(this.level);const a=bt.generateContent(i.discard,!1,r);return t?bt.uniqueContent(a):a}handleAction(t){if(t.param==="P1"){const i=this.remCrds(E.aiActive),r=i.map(c=>{const f=b.deckSelectAction("CARD",c.cardCode,c.sourceIdx);return f.host=this.code,f}),a=T.cancelAction();a.param="PM",r.push(a),bt.showCustomDeck(i,r)}else{const i=t,r=k.getActive();r.discard.splice(i.position,1);const a=this.spawn(i.card,r.isPlayerA);this.logSpell(a),gt.popMode(),T.spellCast()}}}class Vs 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} ${y.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.interactive=!0,a.bonus=this.buffNug(this.iAttack,0,"TP"),r}ddf8(t){return t.event.battle&&!t.event.isCreatTarg&&t.event.isCreatSrc&&t.event.srcId===t.creatId&&t.owner===k.activeA}jr8(t){const i=w.toActions(b.crEnemyActTarg("CARD",this.code,S.enTil(t.creatId,t.event.dmg)));i.length>0?(i.push(T.noneEndTrigger()),T.ddf5(i)):x.triggerDone()}handleAction(t){const i=S.deTil(t.param);this.smack(p.ddf6(t),parseInt(i[1])),T.actionDone(!0)}}class zs extends ae{jr3(t,i){const r=super.jr3(t,i);return r.jr4("AS"),r}jr8(t){if(t.trigger.type==="AS"){let i=!0;for(;i;){const r=this.spawn(this,t.owner);r?r.opposed&&(i=!1):i=!1}x.triggerDone()}else super.jr8(t)}}class Zs 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 i=": ",r=1;this.level<3&&(i=", destroy another friendly creature: ",r=.5);const a=`Destroy an enemy ${y.levelGateText(this.level+1)}creature.`;this.text=`Activate${i}${a}`,this.bonus=this.multNug(this.avgSpawnNug(),r),this.bonus.threat="TX"}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){let i;this.level===3?i=this.enemies(t):i=this.friends(t),i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const i=S.deTil(t.param),r=p.jr5(i[0]),a=p.ddf6(t);if(i[1]==="P1"){const c=this.enemies(r,a.id);c.push(T.cancelAction()),T.ddf5(c)}else{this.logAct(!0);const c=E.tick();this.level<3&&this.kill(p.jr5(i[2]),c),this.kill(a,c),r.endActivation()}}friends(t){const i=b.crFriendNotMeActTarg("CARD",t.id,this.code,S.enTil(t.id,"P1"));return w.toActions(i)}enemies(t,i=""){const r=b.crEnemyActTarg("CARD",this.code,S.enTil(t.id,"P2",i));return r.level=w.ddf2(this.level+1),w.toActions(r)}}class Ys extends P{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Scourge Knights",this.iAttack=this.boof4814,this.iHealth=this.iAttack,this.tribe.push("ZB");const i=this.boof246n;this.text=`Formation: Give an enemy creature ${y.jr9(i,i)}.`}get formation(){return!0}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FM");return a.interactive=!0,r}jr8(t){if(t.owner!==k.activeA){x.triggerDone();return}const i=b.crEnemyActTarg("CARD",this.code,""),r=w.toActions(i);r.length>0?T.ddf5(r):x.triggerDone()}handleAction(t){const i=p.ddf6(t);this.logAct(!1,i),this.buffD(i,this.boof246n),T.actionDone(!0)}}class Ks 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=this.rawNug(0,0,0,0,this.level*.5,"TW")}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){const i=this.enemies(t);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const i=S.deTil(t.param),r=p.jr5(i[1]);if(i[0]==="P1"){const a=this.empties(r,p.ddf6(t).id);a.push(T.cancelAction()),T.ddf5(a)}else{const a=p.jr5(i[2]);this.logAct(!0,a),this.lurk(a,t.lane),r.endActivation()}}empties(t,i=""){const r=b.emptyPlayerActTarg("E","CARD",this.code,S.enTil("P2",t.id,i));return w.toActions(r)}enemies(t){const i=b.crEnemyActTarg("CARD",this.code,S.enTil("P1",t.id));return w.toActions(i)}}class Xs 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,i){const r=super.jr3(t,i),a=r.jr4("EF");return a.bonus=this.rawNug(0,0,0,0,.5,"TW"),a.interactive=!0,r}handleAction(t){L.levelAndDiscardA(t),this.anim8(t.param),T.actionDone(!0)}ddf8(t){const i=I.toCreature(t.event);return i.creature.owner===t.owner&&t.owner===k.activeA&&i.creature.isTribe("DF")}jr8(t){const i=b.lvlHandActTarg(this.code,t.creatId),r=w.toActions([i,w.buttonTarget("NOTR")]);r.length>1?T.ddf5(r):x.triggerDone()}}class si extends P{constructor(t){super(t),this.rarity="R",this.iAttack=this.boof4612,this.iHealth=this.boof61016;const i=this.cardCode();i==="SSS"?this.steel():i==="LSS"?this.life():i==="FSS"?this.flame():i==="DSS"&&this.dark(),this.level>1?this.text=`When you play a ${y.levelGateText(this.level-1)}${y.factionText(this.faction)} card, you may ${this.tuxt}.`: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 ${y.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 ${y.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,i){const r=super.jr3(t,i);if(this.level>1){const a=r.jr4("PC");a.interactive=!0,a.bonus=this.rawNug(0,0,0,0,this.level*.5,"TX")}return r}ddf8(t){if(t.event.playerA===t.owner){const i=W.getCard(t.event.cardCode);if(i.level0?T.ddf5(r):x.triggerDone()}else{const i=p.qPlayerCreats(!t.owner);if(i.length>0){this.logAct(!1);const r=this.splat;i.forEach(a=>a.addPoison(r))}x.triggerDone()}}}class Qs extends P{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Slumbering Shrine",this.iAttack=0,this.iHealth=this.lValN([14,20,30]),this.iDefend=!0,this.tribe.push("ER","EL"),this.text="When you play an spell, you may Negate Defender from a friendly creature."}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.bonus=this.rawNug(0,0,0,0,.5,"TX"),a.interactive=!0,r}handleAction(t){const i=p.ddf6(t);i.negDefend("T"),this.logAct(!1,i),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&W.getCard(t.event.cardCode).type==="S"}jr8(t){const i=b.crFriendActTarg("CARD",this.code,""),r=w.toActions([i,w.buttonTarget("NOTR")]);r.length>1?T.ddf5(r):x.triggerDone()}}class Js extends P{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Snowdrift Alpha",this.iAttack=this.boof61224,this.iHealth=this.boof4816,this.tribe.push("ST","WF"),this.hints=[this.lValH(["ZZ-2","ZZ-3","ZZ-5"])];const i=W.getCard(this.hc());this.text=`Activate: Put a ${y.tokName(i)} into an available lane.`,this.bonus=this.spawnNug(i,"TX")}hc(){return "HTP"+this.level}canActivate(t){return this.empties(t).length>0}startActivation(t){const i=this.empties(t);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){this.logAct(!0),this.poot(this.hc(),t.playerA,t.lane),p.jr5(t.param).endActivation()}empties(t){const i=b.emptyPlayerActTarg("F","CARD",this.code,t.id);return w.toActions(i)}}class _s 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,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="A",r}enforceEffect(t){if(t.status==="A"){const r=b.mod("ND",!0,t.id);p.qActiveCreats().forEach(a=>a.addModSafe(r))}else p.qActiveCreats().forEach(r=>r.removeModSafe(t.id))}}class ta extends vt{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Spiritcleave",this.text=`Destroy a ${y.levelGateText(this.level+1)}creature with the highest health among all creatures.${this.level===3?"~You gain health equal to that creature's health.":""}`}canPlay(){return p.creatByTarget(this.firstT()).length>0}playTargets(){return[this.firstT()]}firstT(){let t=-1;const i=p.qActiveCreats();i.forEach(c=>{c.health>t&&(t=c.health)});const r=i.filter(c=>c.health===t).map(c=>c.id),a=b.crActTarg("CARD",this.code,"");return a.level=w.ddf2(this.level+1),a.victims=S.enTil(...r),this.level<3&&(a.hint=["KL"]),a}handleAction(t){this.logSpell();const i=p.ddf6(t);this.kill(i),this.level===3&&this.balm(k.activeA,i.health),T.spellCast()}}class ea extends vt{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Spiritleash";const i=this.boof5814;this.text=`Destroy a friendly creature.~Give a creature ${y.jr9(i,i)}.`}canPlay(){return p.ddf1().length>0&&p.qActiveCreats().length>1}playTargets(){return[b.crFriendActTarg("CARD",this.code,"P1")]}handleAction(t){const i=S.deTil(t.param),r=p.ddf6(t);if(i[0]==="P1"){const a=b.crNotMeActTarg("CARD",r.id,this.code,S.enTil("P2",r.id));a.hint=["BF"];const c=w.toActions(a);c.push(T.cancelAction()),T.ddf5(c)}else this.logSpell(r),this.kill(p.jr5(i[1])),this.buffD(r,this.boof5814),T.spellCast()}}class ia 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} ${y.dbdtac()}, this gets ${y.jr9(this.level,this.level)}.~Allied Tempys: Activate: Deal ${this.level} damage to another creature. This gets ${y.jr9(this.level,this.level)}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("DM");return a.bonus=this.buffNug(this.level,this.level),r}zapTargs(t){const i=b.crNotMeActTarg("CARD",t,this.code,t);return i.hint=["HR"],w.toActions([i,w.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 i=p.jr5(t.param);this.logAct(!0),this.smack(p.ddf6(t),this.level),i.buff(this.level,this.level,"T"),i.endActivation()}jr8(t){const i=p.creatByTr(t);if(t.trigger.type==="FR"){if(L.allied("T")){i.addMod(b.mod("AL",!0,i.id),"T"),i.changed=!0;const r=i.jr4("NT");r.bonus=this.buffNug(this.boof246,this.level,"TS")}}else t.trigger.type==="DM"&&this.buffD(i,this.level);x.triggerDone()}}class ra 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,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.interactive=!0,a.bonus=this.rawNug(0,0,0,0,.5),r}handleAction(t){const i=p.ddf6(t);this.logAct(!1,i);const r=b.mod("DF",!0);r.expiry="EN",this.modA(i,r),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&W.getCard(t.event.cardCode).type==="S"}jr8(t){const i=b.crFriendActTarg("CARD",this.code,t.creatId);i.canDefender=!0;const r=w.toActions(i);r.length===0?x.triggerDone():(r.push(T.noneEndTrigger()),T.ddf5(r))}}class sa 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 ${y.daluac()}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("UP");return a.interactive=!0,r}handleAction(t){L.levelAndDiscardA(t),this.anim8(t.param),T.actionDone(!0)}jr8(t){const i=b.lvlHandActTarg(this.code,t.creatId),r=w.toActions(i);r.length>0?(r.push(T.noneEndTrigger()),T.ddf5(r)):x.triggerDone()}}class aa 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.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=this.rawNug(0,0,0,0,this.lValN([.8,1.7,3]),"TX")}jr3(t,i){const r=super.jr3(t,i);return this.level===3&&(r.jr4("TS"),this.addExtraActivate(r)),r}ddf8(t){return t.event.playerA===t.owner}jr8(t){this.addExtraActivate(p.creatByTr(t)),x.triggerDone()}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>W.getCard(r).canLevel())}startActivation(t){const i=b.lvlHandActTarg(this.code,t.id);i.hint?.push("DF"),T.ddf5(w.toActions([i,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const i=p.jr5(t.param),r=k.toPlayer(i.owner);this.level===3||r.rank>parseInt(t.card.slice(3))?Dt.levelInHand(r,t.position,W.getCard(t.card).levelUpCard()):L.levelAndDiscardA(t),this.anim8(i),i.endActivation()}}class na 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 i=this.boof246;this.addSp("M",i),this.text=`While each other friendly creature has Defender, ${this.name} gets ${y.jr9(this.iAttack,0)}, Armor ${i}, and Breakthrough.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("DF",this.code);a.area="C";const c=r.addEffect("PS",this.code);return c.area="C",r}enforceEffect(t){const i=b.crNotMeTarg(t.id);if(i.player=k.toTarget(t.owner),p.creatByTarget(i).some(a=>!a.defender))t.removeModSafe(t.id);else{const a=b.mod("AT",this.iAttack,t.id),c=b.mod("AR",this.boof246,t.id),f=b.mod("BT",!0,t.id);t.addModSafe(a),t.addModSafe(c),t.addModSafe(f)}}}class oa 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 i=this.boof246;this.addSp("D",i),this.text=`At the start of each turn, ${this.name} moves to an available lane at random. Flank: Deal ${i} damage to the opposing creature.`}jr3(t,i){const r=this.boof246,a=super.jr3(t,i),c=a.jr4("TS");c.bonus=this.rawNug(0,0,r,0,.2);const f=a.jr4("FK");return f.bonus=this.buffNug(r,0,"TW"),a}ddf8(t){return!0}jr8(t){if(t.trigger.type==="TS")p.fling(p.creatByTr(t),"T"),x.triggerDone();else if(t.trigger.type==="FK"){const r=I.toCreature(t.event).creature.opposed;r&&this.smack(r,this.boof246),x.triggerDone()}else super.jr8(t)}}class ha 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=this.buffNug(6,0,"TX"),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,i){const r=super.jr3(t,i);return r.jr4("FR"),r}canActivate(t){return this.enemies(t.id).length>0&&this.friends(t.id).length>0}startActivation(t){const i=this.friends(t.id);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const i=S.deTil(t.param),r=p.ddf6(t);if(i[1]==="P1"){const a=this.enemies(i[0],r.id);a.push(T.cancelAction()),T.ddf5(a)}else if(i[1]==="P2"){const a=p.jr5(i[2]);this.logAct(!0,a),this.smack(r,a.armor),p.jr5(i[0]).endActivation()}}jr8(t){p.ddf1().forEach(i=>i.addArmor(6)),x.triggerDone()}friends(t){const i=b.crFriendActTarg("CARD",this.code,S.enTil(t,"P1"));return i.hasArmor=!0,w.toActions(i)}enemies(t,i=""){const r=b.crEnemyActTarg("CARD",this.code,S.enTil(t,"P2",i));return w.toActions(r)}}class la 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");let i;this.level===3?(this.text="Activate: Level up a card in your hand.",i=1):(this.text=`Activate: ${y.daluac(!0)}.`,i=.5),this.bonus=this.rawNug(0,0,0,0,i,"TX")}canActivate(t){return k.toPlayer(t.owner).hand.some(r=>W.getCard(r).canLevel())}startActivation(t){const i=b.lvlHandActTarg(this.code,t.id);i.hint?.push("DF"),T.ddf5(w.toActions([i,w.buttonTarget("CANC")]))}handleAction(t){this.logAct(!0);const i=p.jr5(t.param),r=k.toPlayer(i.owner);this.level===3?Dt.levelInHand(r,t.position,W.getCard(t.card).levelUpCard()):L.levelAndDiscardA(t),this.anim8(i),i.endActivation()}}class ca extends yt{jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}jr8(t){if(t.trigger.type==="FR"){const i=t.owner?L.deathsA.length:L.deathsB.length;if(i>0){const r=E.tick();for(let a=0;a0}playTargets(){return[b.crEnemyActTarg("CARD",this.code,"P1")]}handleAction(t){const i=S.deTil(t.param),r=this.boof5812,a=p.ddf6(t);i[0]==="P1"?(this.logSpell(),this.smack(a,r),this.dino()?T.ddf5(w.toActions(b.crEnemyActTarg("CARD",this.code,"P2"))):T.spellCast()):(this.smack(a,r),T.spellCast())}dino(){const t=b.crFriendTarg();return t.tribe="DN",p.creatByTarget(t).length>0}}class da 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 ${y.jr9(0,this.iHealth)}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}jr8(t){const i=b.crActTarg("CARD",this.code,"");i.hint=["BF"];const r=b.actionTarget("TP","CARD",this.code,t.creatId);r.hint=["BF"];const a=[i,r,w.buttonTarget("NOTR")],c=w.toActions(a);T.ddf5(c)}handleAction(t){if(t.zone==="P")this.balm(t.playerA,this.iHealth),this.anim8(t.param);else{const i=p.ddf6(t);this.logAct(!1,i),this.buffH(i,this.iHealth)}T.actionDone(!0)}}class fa 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,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.buffNug(this.boof3610,0,"TS"),a.batch=!0,r}ddf8(t){return!t.event.isCreatTarg&&t.event.target===t.owner}jr8(t){const i=this.level===3?2:1;p.creatByTr(t).buff(t.event.dmg*i,0,t.draw?"U":"X"),x.triggerDone()}}class ga extends vt{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Trial by Combat";const i=this.boof369;this.text=`Give a friendly creature ${y.jr9(i,0)} this turn. Then it and an enemy creature deal damage equal to their attacks to each other.`}canPlay(){return p.qEnemyCreats().length>0&&p.ddf1().length>0}playTargets(){return[b.crFriendActTarg("CARD",this.code,"P1")]}handleAction(t){const i=S.deTil(t.param),r=p.ddf6(t);if(i[0]==="P1"){const a=w.toActions(b.crEnemyActTarg("CARD",this.code,S.enTil("P2",r.id)));a.push(T.cancelAction()),T.ddf5(a)}else{const a=p.jr5(i[1]);this.modA(a,b.mod("AT",this.boof369));const c=E.tick();this.smack(r,a.attack,c),this.smack(a,r.attack,c),T.spellCast()}}}class Ye 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,i){const r=super.jr3(t,i),a=r.jr4("TE");return a.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 i=t.event;return this.mPlayer===1?i.playerA===t.owner:i.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,"TX"),this.text=`At the end of your turn, deal ${this.iAttack} damage to `+t}ikaT(t){const i=p.qEnemyCreats(),r=i.length>0;let a=this.level>2,c=-1;if(this.level===4&&r){const f=E.tick();i.forEach(m=>this.smack(m,this.iAttack,f))}if(this.level===3&&r&&(c=S.randInt(0,i.length)),this.level<3){const f=S.randInt(0,i.length+1);f===i.length?a=!0:c=f}c>-1&&this.smack(i[c],this.iAttack),a&&(this.ouch("E",this.iAttack),this.anim8(t.creatId))}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,"TX"),this.text=`At the end of your turn, you and each other friendly creature gets ${y.jr9(0,t)}.`}rsdT(t){const i=this.lValN([1,2,5]);p.creatByTarget(b.crFriendNotMeTarg(t.creatId)).forEach(a=>this.buffH(a,i)),this.balm(t.owner,i),this.anim8(t.creatId)}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,"TX"),this.text=`At the end of your turn, deal ${t} damage to each enemy creature.`}ssdT(t){const i=p.qEnemyCreats();if(i.length>0){const r=E.tick(),a=this.boof135;i.forEach(c=>this.smack(c,a,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,"TW"),this.text=`At the end of your turn, gain ${t} health.`}stagT(t){this.balm(t.owner,this.boof246),this.anim8(t.creatId)}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.trigB.threat="TW",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 i=b.target("DK");i.player=k.toTarget(t.owner),i.tribe="RB";const r=w.deckByTarget(i),a=r.length;if(a>0){const c=r[S.randInt(0,a)][0],f=p.creatByTr(t);this.replc(c,f.owner,f.lane)}}}class jt 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)},["MNM"]:{c:()=>this.mnmC(),t:r=>this.mnmT(r)},["NUG"]:{c:()=>this.nugC(),t:r=>this.nugT(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)},["USS"]:{c:()=>this.ussC(),t:r=>this.ussT(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,i){const r=super.jr3(t,i),a=r.jr4("TS");a.bonus=this.trigB;const c=Wt.extractCardCode(this.code);return(c==="ZSH"||c==="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.trigB=this.buffNug(5,4,"TX"),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 i=k.toPlayer(t.owner),r=i.hand.map((c,f)=>{const m=W.getCard(c);return{idx:f,lvl:m.level,nxt:m.canLevel()?m.levelUpCard():""}}).filter(c=>c.nxt&&(this.level===3||c.lvl===1)),a=r.length;if(a>0){const c=r[S.randInt(0,a)];Dt.levelInHand(i,c.idx,c.nxt),this.anim8(t.creatId)}}}gmpC(){this.faction="A",this.rarity="L",this.name="Ghox, Metamind Paragon",this.iAttack=this.boof4814,this.iHealth=this.boof61218,this.tribe.push("MM");const t=this.level===1?"":"s";this.trigB=this.rawNug(0,0,0,0,this.level*ft.dcWeight,"TX"),this.text=`At the start of your turn, draw ${this.level} card${t}.`}gmpT(t){k.drawCard(t.owner,this.level),this.anim8(t.creatId)}lbcC(){this.faction="U",this.rarity="R",this.name="Lightbringer Cleric",this.iAttack=this.boof51015,this.iHealth=this.iAttack,this.tribe.push("TK"),this.trigB=this.playerNug(this.boof3610,"TW"),this.text=`At the start of your turn, you gain ${this.boof137} to ${this.boof5914-1} health.`}lbcT(t){this.balm(t.owner,S.randInt(this.boof137,this.boof5914)),this.anim8(t.creatId)}mnmC(){this.faction="N",this.rarity="L",this.name="Murderous Necromancer",this.iAttack=this.boof61017,this.iHealth=this.iAttack-1,this.tribe.push("HM"),this.trigB=this.avgSpawnNug(),this.trigB.threat="TX";let t;this.level===3?(t=" If that creature is opposed, destroy the creature opposing it.",this.hints=["ZZ-5"]):(t="",this.hints=["ZZ-3"]),this.text=`At the start of your turn, Spawn a random ${y.levelGateText(this.level)}creature that was destroyed this game.${t}`}mnmT(t){const i=Bt.gravedigger("X",w.ddf2(this.level));if(i){const r=this.spawn(i,t.owner);if(r&&(this.logAct(!1,r),this.level===3)){const a=r.opposed;a&&this.kill(a)}}}nugC(){this.faction="T",this.rarity="L",this.name="Nug, Fury Fists",this.iAttack=this.boof71015,this.iHealth=this.iAttack-1,this.tribe.push("YT"),this.hints=["ZZ-3"],this.trigB=this.rawNug(0,0,0,0,1.5,"TX"),this.text="At the start of your turn, each other friendly creature deals battle damage equal to its attack to the creature opposing it."}nugT(t){const i=p.creatByTarget(b.crFriendNotMeTarg(t.creatId));if(i.length>0){const r=E.tick();i.forEach(a=>{if(a.attack>0){const c=a.opposed;c&&c.hurtDirect(a.attack,a.code,this.faction,r)}})}}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){this.wrang(p.creatByTr(t))}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,i=Y.minionName(this.level);this.trigB=this.statSpawnNug(t,t,"TW"),this.text=`At the start of your turn, Spawn a ${t}/${t} ${i}.`}sseT(t){const i=this.lValS(["SXD","SXP","SXT"])+this.level.toString();this.spawn(i,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");const t=this.boof246;this.trigB=this.buffNug(t,t,"TS"),this.text=`At the start of your turn, ${this.name} gets ${y.jr9(t,t)}.`}spdT(t){this.buffD(p.creatByTr(t),this.boof246)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.iAttack=this.boof91421,this.iHealth=this.iAttack,this.tribe.push("IN"),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 i=k.toPlayer(t.owner);if(i.hand.length>2){let r=i.hand.slice();const a=S.randInt(0,r.length);let c=-1;for(;c===-1;){const f=S.randInt(0,r.length);f!==a&&(c=f)}for(let f=r.length-1;f>-1;f--)f===a||f===c||Dt.cardDiscard(i,f);this.anim8(t.creatId)}}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.level===3?this.trigB=this.multNug(this.avgSpawnNug(),.5):this.hints=["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){L.freePlay(),this.anim8(t.creatId)}ussC(){this.faction="T",this.rarity="H",this.name="Uranti Stormshaper",this.iAttack=0,this.iHealth=this.lValN([9,12,18]),this.iDefend=!0,this.tribe.push("YT");const t=W.getCard("LWY"+this.level);this.trigB=this.spawnNug(t,"TX");const i=this.level===3?" into each available lane":"";this.text=`At the start of your turn, Spawn a ${y.tokName(t)}${i}.`}ussT(t){const i="LWY"+this.level;if(this.level===3){const r=p.emptyLanes(t.owner);if(r.length>0){const a=E.tick();r.forEach(c=>this.poot(i,t.owner,c,a))}}else this.spawn(i,t.owner)}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.trigB=this.playerNug(this.boof3610,"TW"),this.text=`At the start of your turn, deals ${this.boof137} to ${this.boof5914-1} damage to the enemy player.`}vgT(t){const i=S.randInt(this.boof137,this.boof5914);this.ouch(!t.owner,i),this.anim8(t.creatId)}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.trigB=this.playerNug(0,"TW"),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 i=b.crTarg();this.level===3&&(i.player=k.toTarget(!t.owner));const r=p.creatByTarget(i);let a=99999,c=[];r.forEach(m=>{m.attack===a?c.push(m):m.attack0){const m=c[S.randInt(0,f)];this.kill(m)}}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,"TX")}zyxT(t){this.wrang(p.creatByTr(t))}}class ma 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 ${y.levelGateText(this.level)}Plant into an available lane.`,this.bonus=this.multNug(this.avgSpawnNug(),.5),this.bonus.threat="TX"}canActivate(t){return this.emptySloots(t.id).length>0&&this.buddies(t.id).length>0}startActivation(t){const i=this.buddies(t.id);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.emptySloots(i[1],p.ddf6(t).code);r.push(T.cancelAction()),T.ddf5(r)}else{const r=p.jr5(i[1]),a=this.poot(i[2],r.owner,t.lane);this.logAct(!0,a),r.endActivation()}}emptySloots(t,i=""){const r=b.emptyPlayerActTarg("F","CARD",this.code,S.enTil("P2",t,i));return w.toActions(r)}buddies(t){const i=b.crFriendActTarg("CARD",this.code,S.enTil("P1",t));return i.tribe="PL",i.level=w.ddf2(this.level),w.toActions(i)}}class Gi extends vt{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.free=this.level===2),this.text="Discard and level up two cards."}canPlay(){const t=w.cardByTarget(k.getActive().deck,b.lvlHandActTarg(this.code,"")).length;return this.code==="MTS"+"1"?t>1:t>0}playTargets(){return[this.targParty("P1")]}handleAction(t){if(T.shiftPlayCard(t.position),t.param==="P1"){this.logSpell(),L.levelAndDiscardA(t);const i=this.targParty("P2"),r=w.toActions(i);r.length===0?T.spellCast():T.ddf5(r)}else L.levelAndDiscardA(t),T.spellCast()}targParty(t){const i=b.lvlHandActTarg(this.code,t);return i.deckPositionSkip=T.playPosition(),i}}class ai extends vt{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(r,a)=>this.confZ(r,a),t:r=>this.confT(r)},["CSG"]:{c:()=>this.cystgC(),z:(r,a)=>this.cystgZ(r,a),t:r=>this.cystgT(r)},["GRN"]:{c:()=>this.grenC(),z:(r,a)=>this.grenZ(r,a),t:r=>this.grenT(r)},["TWG"]:{c:()=>this.twstrC(),z:(r,a)=>this.twstrZ(r,a),t:r=>this.twstrT(r)}}[t]}cardCast(t,i){this.lookup(this.cardCode()).z(t,i)}cardTarg(t,i){const r=this.lookup(this.cardCode()).t(b.crActTarg("CARD",this.code,""));return r.param=t,r.notMe=i,r}xl=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}canPlay(){return p.creatByTarget(this.cardTarg("P1","")).length>1}playTargets(){return[this.cardTarg("P1","")]}handleAction(t){const i=S.deTil(t.param),r=p.ddf6(t);if(i[0]==="P1"){const a=S.enTil("P2",r.id),c=w.toActions([this.cardTarg(a,r.id),w.buttonTarget("CANC")]);T.ddf5(c)}else{const a=p.jr5(i[1]);this.xl?this.logSpell(a,r):this.logSpell(),this.cardCast(a,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.`}confZ(t,i){const r=E.tick(),a=this.boof369;this.smack(t,a,r),this.smack(i,a,r)}confT(t){return t.player="E",t}cystgC(){this.faction="A",this.rarity="C",this.name="Cypien Steelgraft",this.text=`Two friendly creatures get Armor ${this.boof246}.`}cystgZ(t,i){const r=this.boof246;t.addArmor(r),i.addArmor(r)}cystgT(t){return t.player="F",t.canArmor=!0,t}grenC(){this.faction="N",this.rarity="C",this.name="Ghastly Renewal",this.text=`Give two friendly creatures Regenerate ${this.boof246}.`}grenZ(t,i){const r=this.boof246;this.regn(t,r),this.regn(i,r)}grenT(t){return t.player="F",t.canRegen=!0,t}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 ${y.jr9(t,t)}.`}twstrZ(t,i){const r=this.tsboof;this.buffD(t,r),this.buffD(i,r)}twstrT(t){return t.player="F",t}}class pa 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} ${y.dbdtap()}, deal that much damage to that player.~Allied Uterra: This gets ${y.jr9(2,2,!0)}, and Breakthrough.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("DM");return a.bonus=this.playerNug(this.boof357,"TP"),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(L.allied("U")){const i=p.creatByTr(t);i.breakthrough=!0,i.buff(2,2,"U")}}else t.trigger.type==="DM"&&(this.ouch(t.event.target,t.event.dmg),this.anim8(t.creatId));x.triggerDone()}}class ya 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} ${y.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`}jr3(t,i){const r=super.jr3(t,i);return r.jr4("FR"),r}handleAction(t){p.ddf6(t).hurtDirect(parseInt(t.param),this.code,"T"),T.actionDone(!0)}ddf8(t){const i=I.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId&&i.srcCreat.owner===k.activeA}jr8(t){if(t.trigger.type==="FR"){if(L.allied("T")){const i=p.creatByTr(t),r=i.jr4("DM");r.interactive=!0,r.bonus=this.buffNug(this.iAttack,0,"TP"),i.changed=!0}x.triggerDone()}else if(t.trigger.type==="DM"){const i=t.event,r=w.toActions(b.crEnemyActTarg("CARD",this.code,i.dmg.toString()));r.length>0?(r.push(T.noneEndTrigger()),T.ddf5(r)):x.triggerDone()}}}class ni 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,i){this.lookup(t).f(i)}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,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}handleAction(t){this.targAction(this.cardCode(),p.ddf6(t)),T.actionDone(!0)}jr8(t){if(p.creatByTr(t).rank>this.level){const r=b.crActTarg("CARD",this.code,t.creatId);this.enemy?r.player="E":r.hint=["BF"];const a=w.toActions(r);a.length>0?T.ddf5(a):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 ${y.jr9(t,t)}.`}ebwF(t){this.logAct(!1,t),this.buffD(t,this.boof369n)}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 ${y.jr9(t,t)}.`}sbiF(t){this.logAct(!1,t),this.buffD(t,this.boof359)}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){this.smack(t,this.boof6912)}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 ${y.jr9(t,0)}.`}ibrfF(t){this.logAct(!1,t),this.buffA(t,this.boof5812)}}class ba 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,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}jr8(t){const i=p.creatByTr(t);if(this.emptySloots(i).length>0){const r=b.crFriendNotMeActTarg("CARD",i.id,this.code,S.enTil("P1",i.id)),a=w.toActions(r);a.length>0?(a.push(T.noneEndTrigger()),T.ddf5(a)):x.triggerDone()}else x.triggerDone()}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.emptySloots(p.jr5(i[1]),p.ddf6(t).id);r.push(T.cancelAction()),T.ddf5(r)}else{const r=p.jr5(i[1]);this.logAct(!1,r),this.lurk(r,t.lane),T.actionDone(!0)}}emptySloots(t,i=""){return T.emptyAdjacents(t,S.enTil("P2",i))}}class Aa 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=this.buffNug(this.iAttack/2,0,"TW")}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){const i=this.findVictims(t.id);i.push(T.cancelAction()),T.ddf5(i)}handleAction(t){const i=p.jr5(t.param);if(t.zone==="F"){const r=p.ddf6(t);this.logAct(!0,r),this.smack(r,this.iAttack)}else{this.logAct(!0);const r=t;this.ouch(r.playerA,this.iAttack),this.anim8(i)}i.endActivation()}findVictims(t){const i=this.iAttack,r=b.crEnemyTarg(),c=p.creatByTarget(r).filter(m=>m.health===i).map(m=>b.fieldSelectAction("CARD",m.lane,m.owner)),f=k.toPlayer("E");return f.health===i&&c.push(b.playerSelectAction("CARD",f.isPlayerA)),c.forEach(m=>{m.host=this.code,m.param=t}),c}}class ka 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.text="Each friendly creature battles an additional time on each of your turns."}jr3(t,i){const r=super.jr3(t,i);r.jr4("EF");const a=r.jr4("TS");return a.bonus=this.buffNug(20,0,"TX"),r}ddf8(t){if(t.event.code==="ENT"){const i=I.toCreature(t.event);return t.owner===i.creature.owner&&t.owner===k.activeA}else if(t.event.code==="TRS")return t.event.playerA===t.owner;return!1}giveXtra(t,i){t.hasMod(i)||(this.wrang(t),t.addMod(b.mod("TK",!0,i),"X"))}jr8(t){if(t.event.code==="ENT"){const i=I.toCreature(t.event);i.creature.id===t.creatId?p.ddf1().forEach(r=>{this.giveXtra(r,t.creatId)}):yt.itBirthedFirst(i.creature.id,t.creatId)&&this.giveXtra(i.creature,t.creatId)}else t.event.code==="TRS"&&p.ddf1().forEach(i=>{this.wrang(i),i.hasMod(t.creatId)||i.addMod(b.mod("TK",!0,t.creatId),"X")});x.triggerDone()}}class O 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(),["LTM"]:()=>this.ltam(),["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(),["TNM"]:()=>this.tiggy(),["TWS"]:()=>this.tscout(),["TWT"]:()=>this.tund(),["URD"]:()=>this.unrelenting(),["VBK"]:()=>this.vblock(),["VTC"]:()=>this.vtech(),["WHC"]:()=>this.wardog(),["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}shite(){this.level<3&&(this.hints=["LB"])}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.shite(),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.shite(),this.level===1&&this.hints.push("ZZ+1")}ltam(){this.faction="T",this.rarity="C",this.name="Lightning Tamer",this.iAttack=this.lValN([6,8,10]),this.iHealth=1,this.tribe.push("LT","AS"),this.iAggro=!0}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.shite(),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.shite(),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.shite(),this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.iAttack=this.boof246,this.iHealth=this.iAttack,this.free=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")}tiggy(){this.faction="U",this.rarity="C",this.name="Tigrin Nomad",this.iAttack=this.lValN([8,10,12]),this.iHealth=this.boof246,this.iBT=!0,this.shite(),this.tribe.push("TG")}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.shite(),this.tribe.push("RB")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.iAttack=this.boof7911,this.iHealth=this.iAttack+1,this.shite(),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")}wardog(){this.faction="T",this.rarity="T",this.name="Warhound Courser",this.iAttack=this.level,this.iHealth=this.level,this.iAggro=!0,this.tribe.push("FR","EL"),this.free=!0}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 Ta extends vt{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Varna's Pact";const i=this.lValS(["a","two","three"]),r=this.level===1?"":"s",a=this.level===1?"was":"were";this.text=`Put ${i} random creature${r} that ${a} destroyed this game into ${i} lane${r}.`}playTargets(){return[this.fieldTarget("P1",[])]}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1")if(this.level===1)this.endSpell([t.lane],t.playerA);else{const r=this.fieldTarget("P2",[t.lane]);T.ddf5(w.toActions(r))}else if(i[0]==="P2"){const r=[t.lane,parseInt(i[1])];if(this.level===2)this.endSpell(r,t.playerA);else{const a=this.fieldTarget("P3",r);T.ddf5(w.toActions(a))}}else this.endSpell([t.lane,parseInt(i[1]),parseInt(i[2])],t.playerA)}endSpell(t,i){this.logSpell();const r=E.tick();t.forEach(a=>{const c=Bt.gravedigger();c&&this.replc(c,i,a,r)}),T.spellCast()}fieldTarget(t,i){const r=b.actionTarget("TF","CARD",this.code,S.enTil(t,...i));return r.player="F",r.hint=["FL"],r.lanes=p.laneIdx.filter(a=>!i.includes(a)),r}}class va 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,i){const r=super.jr3(t,i),a=r.jr4("HG");return a.bonus=this.buffNug(0,this.boof369,"TW"),a.batch=!0,r}ddf8(t){return t.event.creatId===t.creatId}jr8(t){const i=b.crNotMeTarg(t.creatId);i.player=k.toTarget(t.owner),p.creatByTarget(i).forEach(r=>r.heal(t.event.healAmt,t.draw)),x.triggerDone()}}class Sa extends P{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Voltaic Prophet",this.iAttack=this.boof61016,this.iHealth=this.iAttack,this.tribe.push("HM");const i="evel up each card in your hand",r=this.lValS(["You may discard and level up a card","Discard and l"+i,"L"+i]);this.text="Formation: "+r+"."}get formation(){return!0}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FM");return a.interactive=this.level===1,r}handleAction(t){L.levelAndDiscardA(t),this.anim8(t.param),T.actionDone(!0)}jr8(t){if(t.owner!==k.activeA){x.triggerDone();return}if(this.level===1){const i=b.lvlHandActTarg(this.code,t.creatId),r=w.toActions([i,w.buttonTarget("NOTR")]);r.length>1?T.ddf5(r):x.triggerDone()}else{const i=k.getActive();this.logAct(!1);const r=i.hand.slice();if(this.level===2)for(let a=r.length-1;a>-1;a--)W.getCard(r[a]).canLevel()?L.levelAndDiscard(r[a],a,!1):Dt.cardDiscard(i,a);else r.forEach((a,c)=>{const f=W.getCard(a).levelUpCard();f!==a&&Dt.levelInHand(i,c,f)});this.anim8(t.creatId),x.triggerDone()}}}class Ca extends P{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Warhound Raider",this.iAttack=this.boof5915,this.iHealth=this.iAttack+1,this.tribe.push("FR","AS"),this.text=`If there is a friendly Warhound Courser in play, ${this.name} has Aggressive.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){const i=b.crNotMeTarg(t.id);i.player=k.toTarget(t.owner),i.cardCode="WHC",p.creatByTarget(i).length===0?t.removeModSafe(t.id):t.addModSafe(b.mod("AG",!0,t.id))}}class wa extends Ve{jr3(t,i){const r=super.jr3(t,i),a=r.jr4("LG"),c=this.boof124*5;return a.bonus=this.buffNug(c,c,"TS"),a.batch=!0,r}ddf8(t){return t.owner===t.event.playerA}jr8(t){const i=this.boof124*t.event.healAmt;p.creatByTr(t).buff(i,i,t.draw?"U":"X"),x.triggerDone()}}class Da 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 i=W.getCard(Y.minionCode(this.level));this.text=`When you play a spell, you may put a ${y.tokName(i)} into an available lane.`,this.spB=this.spawnNug(i,"TW")}spB;jr3(t,i){const r=super.jr3(t,i),a=r.jr4("PC");return a.interactive=!0,a.bonus=this.spB,r}handleAction(t){this.poot(Y.minionCode(this.level),t.playerA,t.lane),T.actionDone(!0)}ddf8(t){return t.event.playerA===t.owner&&W.getCard(t.event.cardCode).type==="S"}jr8(t){const i=b.emptyPlayerActTarg("F","CARD",this.code,""),r=w.toActions(i);r.length===0?x.triggerDone():(r.push(T.noneEndTrigger()),T.ddf5(r))}}class xa 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 ${y.levelGateText(this.level)}creature to an available lane adjacent to ${this.name}.`}jr3(t,i){const r=super.jr3(t,i),a=r.jr4("FR");return a.interactive=!0,r}jr8(t){const i=p.creatByTr(t);if(this.emptySloots(i).length>0){const r=b.crFriendNotMeActTarg("CARD",i.id,this.code,S.enTil("P1",i.id));r.level=w.ddf2(this.level);const a=w.toActions(r);a.length>0?(a.push(T.noneEndTrigger()),T.ddf5(a)):x.triggerDone()}else x.triggerDone()}handleAction(t){const i=S.deTil(t.param);if(i[0]==="P1"){const r=this.emptySloots(p.jr5(i[1]),p.ddf6(t).id);r.push(T.cancelAction()),T.ddf5(r)}else{const r=p.jr5(i[1]);this.logAct(!1,r),this.lurk(r,t.lane),T.actionDone(!0)}}emptySloots(t,i=""){return T.emptyAdjacents(t,S.enTil("P2",i))}}class Ba 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,i){const r=super.jr3(t,i),a=r.jr4("DM");return a.bonus=this.playerNug(this.boof246,"TX"),a.batch=!0,r}ddf8(t){const i=I.toDamage(t.event);return!i.battle&&i.isCreatTarg&&i.hurtCreat.owner!==t.owner}jr8(t){this.ouch(!t.owner,this.boof246,t.draw),t.draw&&this.anim8(t.creatId),x.triggerDone()}}class Ha 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 i=-this.boof135;this.text=`When ${this.name} becomes opposed, it gets ${y.jr9(i,i)}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("EF");const a=r.jr4("MV"),c=-this.boof135;return a.bonus=this.buffNug(c,c),r}ddf8(t){const i=I.toCreature(t.event);return t.trigger.creatId===i.creature.id&&t.trigger.type==="MV"||i.creature.owner!==t.owner}jr8(t){let i=!1;const r=p.creatByTr(t),a=I.toCreature(t.event);(r.id===a.creature.id&&r.opposed||a.creature.lane===p.oppositeLane(r.lane))&&(i=!0),i&&this.buffD(r,-this.boof135),x.triggerDone()}}class Na 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 ${y.dbdtap()} on your turn, you may deal that much damage to an enemy creature.~Allied Nekrium: When a creature is destroyed, Zarox gets ${y.jr9(this.boof124,0)}.`}jr3(t,i){const r=super.jr3(t,i);r.jr4("FR");const a=r.jr4("DM");return a.interactive=!0,a.bonus=this.buffNug(this.lValN([3,6,14]),0,"TP"),r}handleAction(t){this.smack(p.ddf6(t),parseInt(t.param)),T.actionDone(!0)}ddf8(t){if(t.trigger.type==="DM"){const i=I.toDamage(t.event);return i.battle&&!i.isCreatTarg&&i.isCreatSrc&&i.srcId===t.creatId&&i.srcCreat.owner===k.activeA}else return!0}jr8(t){if(t.trigger.type==="FR"){if(L.allied("N")){const i=p.creatByTr(t),r=i.jr4("DS");r.bonus=this.buffNug(this.boof124,0,"TS"),r.batch=!0,i.changed=!0,i.anim8("N")}x.triggerDone()}else if(t.trigger.type==="DM"){const i=t.event,r=w.toActions(b.crEnemyActTarg("CARD",this.code,i.dmg.toString()));r.length>0?(r.push(T.noneEndTrigger()),T.ddf5(r)):x.triggerDone()}else t.trigger.type==="DS"&&(this.logAct(!1),p.creatByTr(t).buff(this.boof124,0,t.draw?"N":"X"),x.triggerDone())}}class Fa 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 i=this.boof234;this.text=`While ${this.name} is in a side lane, it gets ${y.jr9(i,i,!0)} and Regenerate ${this.level}.`}jr3(t,i){const r=super.jr3(t,i),a=r.addEffect("PS",this.code);return a.area="C",r}enforceEffect(t){if(t.lane===1||t.lane===5){const i=this.boof234;[b.mod("AT",i,t.id),b.mod("HL",i,t.id),b.mod("MH",i,t.id),b.mod("RG",this.level,t.id)].forEach(a=>{t.addModSafe(a)})}else t.removeModSafe(t.id)}}class Pa{cardCache=new Map;mapper={["AAK"]:Ar,["ABB"]:kr,["ABM"]:mt,["AGC"]:mt,["AGK"]:Z,["AGP"]:ct,["AGW"]:$,["ASG"]:$,["AMS"]:Z,["AFO"]:Ne,["ATG"]:_t,["ATP"]:Le,["ART"]:_t,["ATS"]:_t,["AGM"]:De,["ALG"]:ze,["AHL"]:Tr,["ALS"]:ze,["ASB"]:de,["AAA"]:vr,["ABE"]:ct,["ATZ"]:$,["AEC"]:qt,["AVB"]:$,["ARB"]:_t,["AEN"]:O,["APM"]:Sr,["AQE"]:$,["AGD"]:Cr,["AFS"]:fe,["AWU"]:Ze,["ASQ"]:Tt,["AOP"]:$,["AMD"]:wr,["ABR"]:ae,["AFR"]:Z,["AMY"]:ae,["ABL"]:ve,["ATT"]:yt,["AMP"]:Ie,["AGU"]:O,["AIV"]:te,["ATI"]:Z,["BRS"]:Ei,["BTB"]:Fi,["BTH"]:O,["BTI"]:mt,["BTN"]:ze,["BBB"]:O,["BLH"]:_t,["BFT"]:$,["BZH"]:$,["BSP"]:te,["BWK"]:De,["BLW"]:O,["BTD"]:xe,["BZS"]:Z,["BBR"]:$,["BBD"]:$,["BBL"]:$,["BBN"]:$,["BSR"]:mt,["BMY"]:Dr,["BSW"]:Tt,["BWW"]:we,["BTM"]:$,["BLP"]:$,["BOS"]:Y,["BAW"]:mt,["BWG"]:O,["BTR"]:Z,["BWD"]:Ge,["BOF"]:Gt,["BSG"]:Br,["BSS"]:Z,["BTS"]:Ge,["BST"]:Pe,["BWT"]:xr,["BRF"]:De,["BRH"]:yt,["BWH"]:Hr,["BWN"]:yt,["BRN"]:Fe,["BZD"]:Z,["BFM"]:Z,["BSM"]:Nr,["CKB"]:mt,["CDT"]:De,["CMF"]:yi,["CTL"]:ct,["CCS"]:Tt,["CDM"]:yt,["CHY"]:O,["CSR"]:Ei,["CSL"]:O,["CGG"]:Ht,["CHV"]:Fr,["CCC"]:ct,["CRS"]:Ne,["COD"]:ct,["CHT"]:$,["CTI"]:Z,["CHA"]:mt,["CHH"]:Z,["CHR"]:de,["CBB"]:ni,["CDC"]:O,["CFB"]:ae,["CNM"]:O,["CSW"]:Z,["CTG"]:O,["CCT"]:ei,["CFG"]:ai,["CGF"]:Ht,["CGL"]:Tt,["CSU"]:$,["CCR"]:mt,["CSB"]:Ht,["CNT"]:$,["CWK"]:O,["CRC"]:te,["CMR"]:Pr,["CYP"]:Mr,["CYC"]:_t,["COZ"]:Y,["CYS"]:Ht,["CYW"]:qt,["CTW"]:$,["CTV"]:$,["CYR"]:yt,["CAG"]:$,["CBS"]:$,["CEX"]:ct,["CIN"]:Ve,["CSH"]:Tt,["CSG"]:ai,["CTM"]:Er,["DFM"]:Y,["DFR"]:Z,["DHC"]:Rr,["DHW"]:_t,["DRS"]:mt,["DSS"]:si,["DSW"]:Z,["DSE"]:mt,["DSA"]:mt,["DCR"]:ct,["DSK"]:Ht,["DPO"]:$,["DBA"]:Z,["DBP"]:O,["DMR"]:O,["DBR"]:O,["DFS"]:ct,["DCS"]:jt,["DPG"]:Gr,["DWW"]:Ir,["DDF"]:$,["DGZ"]:ct,["DNK"]:Wr,["DBN"]:Z,["DOV"]:Ie,["DDS"]:$r,["DIS"]:qt,["DSV"]:Ur,["DDD"]:Z,["DPB"]:Or,["DZA"]:Y,["DZD"]:de,["DRE"]:qt,["DKS"]:xe,["DGS"]:mt,["DGW"]:Vr,["DRD"]:zr,["DBT"]:$,["DTR"]:de,["DFB"]:Gt,["DMW"]:fe,["DCH"]:qt,["DTD"]:O,["DHM"]:yt,["DSZ"]:O,["DYB"]:ve,["DBQ"]:Zr,["DYF"]:$,["DYS"]:Yr,["DYL"]:Kr,["EBW"]:ni,["ESD"]:Xr,["ESK"]:te,["EHW"]:qr,["ETN"]:$,["EWE"]:Ze,["EVT"]:qt,["ENP"]:$,["ESU"]:qt,["ENR"]:$,["EPD"]:ct,["EPH"]:jr,["EPS"]:ae,["ESG"]:Qr,["ESC"]:Ge,["ESP"]:Jr,["EWT"]:Z,["EHN"]:Ge,["EWF"]:Y,["EWV"]:ct,["EFA"]:$,["EFM"]:ae,["EFP"]:_r,["EFE"]:ts,["EXD"]:$,["FWB"]:O,["FWR"]:O,["FFG"]:O,["FST"]:Ht,["FWK"]:Ht,["FIN"]:$,["FRR"]:ct,["FVA"]:ve,["FSL"]:De,["FWG"]:Y,["FWC"]:te,["FFU"]:Tt,["FLH"]:yi,["FMS"]:O,["FSM"]:ct,["FOR"]:$,["FBC"]:ae,["FBI"]:_t,["FFS"]:Tt,["FLN"]:$,["FJT"]:$,["FRI"]:mt,["FSS"]:si,["FLS"]:_t,["FSH"]:Tt,["FFD"]:Ht,["FRV"]:mt,["FSC"]:Ht,["FSP"]:yt,["FPR"]:O,["FFL"]:$,["FGA"]:O,["FGB"]:O,["FGD"]:yt,["FGG"]:fe,["FGO"]:O,["FOL"]:Ne,["FPM"]:O,["FPS"]:O,["FWS"]:de,["FLC"]:mt,["FFM"]:Ze,["FRH"]:Y,["FMD"]:es,["FME"]:te,["FSK"]:is,["FKS"]:rs,["FWT"]:Z,["FZS"]:$,["FUN"]:Y,["GOS"]:ss,["GHS"]:fe,["GHB"]:ei,["GHR"]:as,["GRN"]:ai,["GTH"]:$,["GSC"]:De,["GMP"]:jt,["GTT"]:ns,["GCL"]:O,["GCR"]:$,["GLF"]:mt,["GRW"]:mt,["GSW"]:Z,["GVS"]:Ht,["GSS"]:Z,["GPV"]:os,["GBG"]:Ht,["GGE"]:O,["GGH"]:O,["GRP"]:hs,["GGB"]:Gt,["GGD"]:Gt,["GGR"]:Gt,["GGP"]:Gt,["GGS"]:O,["GGW"]:Gt,["GRM"]:ct,["GHT"]:mt,["GMR"]:Ht,["GSF"]:ls,["GAS"]:cs,["HMF"]:yt,["HOS"]:yt,["HTR"]:we,["HAR"]:$,["HFA"]:ti,["HOD"]:yt,["HMO"]:xe,["HRM"]:us,["HWM"]:Ve,["HVE"]:xe,["HOX"]:qt,["HGS"]:ds,["HTP"]:fs,["IBF"]:ct,["IGR"]:qt,["ITO"]:qt,["ISB"]:ei,["IKA"]:Ye,["IME"]:qt,["IDF"]:yt,["IRT"]:Li,["IVS"]:ct,["ICD"]:gs,["IWC"]:O,["IBA"]:_t,["IHA"]:De,["IBR"]:ni,["IMD"]:de,["IMA"]:Z,["IZL"]:ms,["IZR"]:ps,["IZK"]:_t,["IFL"]:Fe,["IFR"]:$,["JPK"]:$,["KDC"]:O,["KSB"]:Z,["KAW"]:_t,["KOD"]:Tt,["KBE"]:ys,["KIW"]:bs,["KTS"]:ri,["KKK"]:we,["LOD"]:ct,["LFA"]:As,["LVG"]:we,["LKP"]:ks,["LGT"]:Z,["LLD"]:Oe,["LLG"]:Oe,["LLS"]:Oe,["LLT"]:Oe,["LLV"]:Oe,["LMD"]:Ie,["LBD"]:Z,["LSS"]:si,["LBL"]:jt,["LBC"]:Ts,["LBR"]:$,["LSK"]:Fe,["LTT"]:we,["LTM"]:O,["LWY"]:O,["LSP"]:Ve,["LVH"]:vs,["LTU"]:xe,["LCE"]:qt,["LUC"]:Ze,["LMV"]:Z,["LHY"]:O,["LYR"]:Fe,["LYS"]:$,["MMH"]:mt,["MMY"]:$,["MHR"]:Ss,["MRF"]:O,["MMG"]:fe,["MOE"]:Z,["MXW"]:mt,["MSP"]:qt,["MDR"]:Ie,["MMA"]:Z,["MMR"]:Z,["MMX"]:Ht,["MMI"]:O,["MMO"]:O,["MMV"]:te,["MPH"]:$,["MSC"]:$,["MTS"]:Gi,["MTT"]:Cs,["MML"]:ws,["MMW"]:Ds,["MBR"]:Z,["MDE"]:Ri,["MBP"]:Tt,["MTD"]:Z,["MND"]:Tt,["MNM"]:jt,["NNS"]:$,["NGB"]:mt,["NGW"]:O,["NSL"]:$,["NCF"]:$,["NCM"]:de,["POZ"]:Y,["NCP"]:Ie,["NCS"]:Tt,["NCW"]:O,["NCV"]:$,["NSW"]:xs,["NDY"]:$,["NDR"]:Bs,["NEM"]:qt,["NSH"]:ct,["NXA"]:Hs,["NXB"]:Li,["NXC"]:O,["NXG"]:Ns,["NXO"]:Ne,["NXP"]:Mi,["NXT"]:ze,["NGT"]:Gt,["NGQ"]:Fs,["NSD"]:Y,["NCL"]:ct,["NFF"]:Tt,["NUG"]:jt,["NAM"]:O,["NOZ"]:Ht,["NSY"]:Z,["ONN"]:Ps,["OXA"]:Ms,["OXM"]:Z,["OXP"]:Es,["OOZ"]:Y,["OBB"]:Rs,["OEX"]:$,["OWH"]:Ls,["ORC"]:Ie,["OBD"]:O,["OFM"]:Z,["OJC"]:yt,["OPK"]:Z,["OSV"]:Pe,["OSS"]:$,["OWW"]:fe,["OHV"]:Tt,["ODC"]:Gs,["OSP"]:O,["OAP"]:Is,["OSL"]:O,["OWF"]:ct,["OXS"]:Ws,["PHM"]:Z,["PPM"]:Tt,["PSM"]:Z,["PLW"]:ct,["POA"]:mt,["POD"]:Ge,["POK"]:Z,["POT"]:Z,["PRG"]:O,["PRI"]:Gi,["PHS"]:mt,["PHC"]:ct,["PTB"]:ct,["PLI"]:Le,["PSC"]:Tt,["PSH"]:te,["PTR"]:$,["PSG"]:$,["PVA"]:$s,["PMI"]:Z,["PMS"]:$,["POX"]:Ht,["PMP"]:$,["PYG"]:ei,["PYM"]:ii,["PYS"]:ct,["QSW"]:xe,["RBH"]:Us,["ROK"]:ct,["REW"]:Z,["RPT"]:Y,["RHY"]:O,["RTS"]:ae,["RTW"]:xe,["RHU"]:Pe,["RSC"]:ri,["RMB"]:Os,["RPR"]:$,["RLW"]:yt,["RFL"]:Vs,["RHC"]:O,["ROG"]:ve,["ROU"]:ct,["ROE"]:ct,["RWC"]:Ge,["RFA"]:ti,["RWD"]:mt,["RSD"]:Ye,["RSE"]:zs,["RBG"]:ii,["RGG"]:te,["RSZ"]:Ht,["RSP"]:O,["RHW"]:yt,["SBF"]:jt,["SAP"]:$,["SPL"]:Y,["SVO"]:$,["SSE"]:jt,["SXP"]:Y,["SXD"]:Y,["SST"]:fe,["SXT"]:Y,["STS"]:ct,["SCS"]:O,["SMD"]:Z,["SFS"]:Zs,["SHY"]:mt,["SKN"]:Ys,["SCD"]:O,["SFT"]:O,["SOC"]:$,["SOA"]:$,["SOD"]:$,["SOK"]:Fe,["SOT"]:$,["SDL"]:Y,["SAD"]:Ks,["SCZ"]:yt,["SFE"]:we,["SWS"]:Xs,["SHA"]:yt,["SHG"]:$,["SBI"]:ni,["SCC"]:ri,["SPB"]:qs,["SPD"]:jt,["SPG"]:ve,["SPM"]:jt,["SPT"]:js,["STD"]:mt,["STB"]:Fe,["SHS"]:De,["SSP"]:yt,["SGF"]:Tt,["SKG"]:Mi,["SLS"]:Qs,["SSD"]:Ye,["SDA"]:Js,["SSR"]:te,["SNB"]:$,["SNP"]:ct,["SRD"]:ct,["SSH"]:Le,["SRM"]:Tt,["SRH"]:Gt,["SDN"]:Z,["SHV"]:$,["SRP"]:$,["SGG"]:Z,["SBA"]:O,["SKB"]:O,["SBR"]:O,["SKS"]:Pe,["SEL"]:_s,["STM"]:O,["SWA"]:_t,["SFG"]:Tt,["S01"]:de,["SPR"]:Gt,["SLG"]:Z,["SBD"]:Z,["SCV"]:ta,["SFM"]:Ht,["SSN"]:O,["SSM"]:te,["SLH"]:ea,["SPN"]:Y,["SSI"]:Ve,["SND"]:ri,["SNT"]:Ht,["SRV"]:ii,["STR"]:$,["SPU"]:Y,["XYR"]:Y,["SPH"]:ia,["SSA"]:Tt,["STO"]:$,["SDR"]:yt,["SOL"]:Ye,["SOV"]:$,["SMS"]:xe,["SHK"]:Fe,["SIX"]:mt,["SWR"]:ra,["SMN"]:O,["SER"]:sa,["SES"]:aa,["SFA"]:ti,["STG"]:na,["SSS"]:si,["SSK"]:Z,["SNK"]:Ne,["SWG"]:Pe,["SWM"]:Tt,["SIV"]:ct,["STN"]:$,["SGI"]:O,["SBG"]:oa,["SCL"]:O,["SGA"]:ti,["STP"]:$,["SSG"]:te,["SVH"]:ae,["SIN"]:$,["SYL"]:Z,["SEV"]:mt,["SMA"]:O,["SML"]:O,["SYO"]:la,["TST"]:ct,["TBA"]:jt,["TGL"]:$,["TGS"]:O,["TPT"]:$,["TDW"]:yt,["TNL"]:ca,["TEX"]:Ne,["TGN"]:O,["TSM"]:Ne,["TUP"]:$,["TOT"]:$,["TAB"]:Ri,["TGI"]:Z,["TDS"]:de,["TSP"]:ua,["TNM"]:O,["TPG"]:Le,["TMG"]:Le,["TMM"]:da,["TRA"]:Z,["TRS"]:Z,["TRV"]:Z,["TRW"]:Z,["TBB"]:yi,["TOB"]:ve,["TCN"]:we,["TWS"]:O,["TVG"]:Fi,["TXB"]:$,["TXS"]:$,["TFK"]:Y,["TFD"]:Y,["TFF"]:Y,["TCG"]:$,["TMS"]:fa,["TBC"]:ga,["TWT"]:O,["TRN"]:ct,["TGK"]:ii,["TSL"]:ma,["TTF"]:Y,["TWG"]:ai,["UGM"]:te,["USY"]:yt,["UGL"]:Z,["UIC"]:pa,["ULR"]:ya,["ULG"]:ve,["URD"]:O,["USA"]:Ht,["UBL"]:$,["UCM"]:Tt,["UEM"]:ba,["UHS"]:Aa,["UIM"]:Tt,["USS"]:jt,["UWL"]:Z,["UWS"]:Z,["UIW"]:Z,["URS"]:$,["UTM"]:Z,["UTR"]:yt,["URB"]:ae,["UPM"]:fe,["VIC"]:Z,["VIK"]:Z,["VRP"]:Ta,["VBK"]:O,["VIN"]:Le,["VTC"]:O,["VTW"]:Pe,["VGN"]:Ht,["VND"]:Z,["VNF"]:mt,["VNS"]:Z,["VSK"]:$,["VCH"]:ct,["VGR"]:$,["VSP"]:$,["VTR"]:$,["VGL"]:$,["VGW"]:va,["VOB"]:ve,["VCG"]:jt,["VPR"]:Sa,["VES"]:ae,["VYE"]:$,["WBY"]:mt,["WBU"]:mt,["WHC"]:O,["WHR"]:Ca,["WMC"]:Z,["WMR"]:Tt,["WMM"]:$,["WTK"]:Ye,["WTW"]:O,["WEB"]:Pe,["WGE"]:ve,["WTA"]:wa,["WWP"]:Z,["WWR"]:Tt,["WOD"]:ct,["WFM"]:fe,["WWS"]:Da,["WBH"]:Ze,["WCS"]:xa,["WPD"]:O,["WSE"]:Ba,["WPC"]:ct,["WFB"]:Z,["WFS"]:Tt,["WBG"]:jt,["XTE"]:fe,["XCR"]:O,["XDH"]:mt,["XHS"]:Ht,["XHU"]:O,["XRF"]:Ha,["XSH"]:Tt,["XTR"]:Z,["XDV"]:we,["XRW"]:$,["YWC"]:O,["YNS"]:Gt,["ZXR"]:Na,["ZPM"]:Tt,["ZTR"]:Y,["ZTU"]:Ht,["ZIN"]:O,["ZDK"]:Z,["ZBS"]:Y,["ZST"]:Y,["ZMT"]:Fa,["ZMB"]:Y,["ZSH"]:jt};makeCard(t){try{let i;if(t==="SOV3"?i=new ka(t):t==="SOC3"?i=new Z(t):t==="LOD3"?i=new Lr(t):t==="GOS3"?i=new ha(t):i=new this.mapper[Wt.extractCardCode(t)](t),i.type==="C"){const r=i;r.spice=[{icon:"A",num:r.iAttack},{icon:"H",num:r.iHealth}].concat(r.spice??[])}return i}catch(i){throw console.error("Make card screwed up on code: "+t),i}}getCard(t){let i=this.cardCache.get(t);return i||(i=this.makeCard(t),this.cardCache.set(t,i)),i}}const W=new Pa;class Ma{registry;constructor(){this.registry=[]}find(t){const i=this.registry.find(r=>r.action===t);if(i)return i;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,i){const r=this.find(t);r.enabled=i}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const i=this.registry.findIndex(r=>r.action===t);i>-1&&this.registry.splice(i,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,i,r){if(K.active)return;let a,c;this.scaleFactor===1?(a=t,c=i):(a=Math.round(t*this.scaleFactor),c=Math.round(i*this.scaleFactor));let f,m=S.clickMode;return m==="M"?f=r:r===nt.ForceRight?f=nt.Right:m==="T"?f=nt.Left:f=nt.Right,ci.arrayHit(this.registry,a,c,f)}updateScale(t){t===1?this.scaleFactor=1:this.scaleFactor=1/t}scaleFactor=1}const it=new Ma;class Ea{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)),ut.drawAll()}handleMenuPick(t,i){let r=!0;if(t==="CI"||t==="CV")this.vsAI=t==="CI",S.writeBoolStorage("cAI",this.vsAI);else if(t==="CN")r=!1,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 a=i==="A"?this.p1:this.p2;t==="LK"?(r=!1,Ot.loadFromFile().then(c=>{typeof c=="string"?Xe.iAmError(c):(a.deck=c,a.mode=t,a.bucket="File Upload",S.writeStorage("cMode"+i,t),ut.drawAll())})):(a.mode=t,S.writeStorage("cMode"+i,t))}r&&ut.drawAll()}ezDeck(t){return t.mode==="CP"?!1:(t.mode==="CR"?(t.deck=Ot.randomStockDeck(),t.bucket=Ot.bucketHunter(t.deck.name)):t.mode==="CX"&&(t.deck=Ot.treatsAbound(!0),t.bucket="Scramble"),!0)}handleDeckPick(t){const i=Ot.stockDeckByPram(t);this.step==="A"?(this.dekFun(this.p1,i),this.ezDeck(this.p2)?this.launchConstructed():(this.step="B",T.ddf5(this.generateDeckPickerActions()))):(this.dekFun(this.p2,i),this.launchConstructed())}dekFun(t,i){t.deck=i,t.bucket=Ot.bucketHunter(i.name)}previewDeckPick(t){const i=Ot.stockDeckByPram(t);bt.showDeck(Ot.parseDeck(i.cards))}generateDeckPickerActions(t=-1){const i=He.map((r,a)=>{const c=b.basicAction("DSET");return c.param=a.toString(),c});if(t>-1){const r=He[t],a=r.decks.map(c=>{const f=b.basicAction("DECK");f.param=S.enTil(r.id,c.name);const m=b.basicAction("DPVW");return m.param=f.param,[f,m]});return i.concat(a.flat())}return i}launchConstructed(){E.aiMode=this.vsAI,gt.setMode("G"),E.newGame(this.p1.deck.cards,this.p2.deck.cards)}replay(){E.newGame(this.p1.deck.cards,this.p2.deck.cards)}namenom(t){const i=t?this.p1:this.p2;return k.toPlayer(t).name+"'s deck: "+i.bucket+" - "+i.deck.name}dud(){return{mode:"CP",deck:{cards:[],name:"",factions:[]},bucket:"???"}}}const $t=new Ea;class Ra{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 i=JSON.parse(t);this.deathOrder=i.dO,this.graveyard=i.gY}deathCheck(){const t=E.tick();p.qActiveCreats().forEach(a=>{a.health<1&&(y.lawg(a.code," died."),this.smite(a,t))});const i=k.toPlayer(!0),r=k.toPlayer(!1);(i.health<1||r.health<1)&&(i.healthr.creatId===t.id)&&(this.deathOrder=this.deathOrder.filter(r=>r.creatId!==t.id))}findDeathTime(t){const i=this.deathOrder.filter(r=>r.creatId===t).map(r=>r.time);if(i.length!==0)return Math.min(...i)}destroy(t,i,r,a=void 0){t.status==="A"?(y.lawg(t.code," was destroyed by ",i,"."),K.addFactBoard(r,t.id,t.lane,t.owner),this.smite(t,a)):(console.warn(`Attempted to destroy creature that was not active. Targ creat ${t.code}; Killer creat ${i}`),console.trace())}gravedigger(t="X",i="LA"){if(t==="X"&&i==="LA"){const r=this.graveyard.length;return r===0?"":this.graveyard[S.randInt(0,r)].cardCode}else{let r;if(t==="X")r=this.graveyard;else{const c=k.toBool(t);r=this.graveyard.filter(f=>f.owner===c)}i!=="LA"&&(r=r.filter(c=>w.levelTargetTest(i,parseInt(c.cardCode.slice(3)))));const a=r.length;return a===0?"":r[S.randInt(0,a)].cardCode}}smite(t,i=void 0){t.status="D",this.deathOrder.push({creatId:t.id,time:i||E.tick()}),this.graveyard.push({cardCode:t.code,owner:t.owner}),x.addEvents(I.creature("DIE",t)),Be.positionChange(t.owner),K.addDeathBoard(t.id,t.lane,t.owner),t.owner?L.deathsA.push(t.code):L.deathsB.push(t.code),p.dirt()}}const Bt=new Ra;class La{get youi(){return E.ui}initDeck(t,i){this.youi.deckContents=t,this.youi.deckScroll=0,this.youi.deckSummary=i,gt.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,i,r){const a=w.cardByTarget(t,r);if(E.aiActive||a.sort((c,f)=>{const m=c[0],C=f[0];return C===m?0:m>C?1:-1}),i){const c=a.length;let f=0,m="",C=0;const D=[];for(;f0&&D.push({cardCode:m,sourceIdx:-1,cardCount:C}),m=a[f][0],C=1),f++;return c>0&&D.push({cardCode:m,sourceIdx:-1,cardCount:C}),D}else return a.map(c=>({cardCode:c[0],sourceIdx:c[1],cardCount:0}))}uniqueContent(t){const i=new Set;return t.filter(r=>i.has(r.cardCode)?!1:(i.add(r.cardCode),!0))}handleShowDeck(t){let i;const r=S.deTil(t.param);if(r[0]==="VE")i=k.activeCardItems(S.txt2bool(r[1]));else{const a=k.getActive();i=t.param==="VR"?a.deck:a.discard}this.showDeck(i)}handleDeckScroll(t){this.paginate(t.param==="D"),ut.drawAll()}showCustomDeck(t,i){this.initDeck(t,!1);const r=this.rightClickers(),a=i.concat(r);return T.ddf5(a),a}showDeck(t){this.initDeck(this.generateContent(t,!0),!0);const i=T.cancelAction();i.key="CNCL",i.param="PM";const r=this.rightClickers();r.push(i),T.ddf5(r)}rightClickers(){return E.aiActive?[]:this.youi.deckContents.map((t,i)=>{const r=b.deckSelectAction("DEET",t.cardCode,i);return r.param=t.cardCode,r})}}const bt=new La;class Ga{friends;friendText;get browseStack(){return E.ui.detailStack}n(t,i){return`${t}${i}`}friendo(t,i){const r=Array.isArray(i)?i:[i];[1,2,3].forEach(a=>{this.friends[this.n(t,a)]=r.map(c=>this.n(c,a))})}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),i=this.n("AVB",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)],[this.n("EWV",1)]:[this.n("EWF",1)],[t]:[this.n("FWG",1)],[this.n("IBA",1)]:[i],[this.n("IBA",2)]:[i],[this.n("IBA",3)]:[i],[this.n("IBA",4)]:[i],[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("ROE",1)]:[this.n("FRH",1),this.n("LVG",1),this.n("LTT",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("SLS",1)]:[this.n("MMY",1)],[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.friendo("FME","FMD"),this.plont("GMR"),this.friendo("IZL",["IFL","IFR","IZR"]),this.friendo("IZR",["IFL","IFR","IZL"]),this.friendo("IZK",["IFL","IFR","IZL","IZR"]),this.friendo("LVH","KBE"),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("SST"),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("USS","LWY"),this.friendo("VIC",["IFL","IFR"]),this.friendo("WHR","WHC"),this.plont("WWS"),this.friendo("YNS","XYR");const r=42,a=31,c=40,f=51,m=38,C=52,D=66;this.friendText={["AVB"]:[42,"Hammer"],["BOS"]:[f,""],["BWT"]:[68,"Bron"],["BRF"]:[18,""],["CGF"]:[65,"Fiend"],["CYP"]:[4,""],["COZ"]:[a,""],["DFM"]:[61,"Mimic"],["DNK"]:[8,""],["DZA"]:[59,"Dozer"],["DYF"]:[38,"Infusion"],["EPS"]:[49,"Soldier"],["EWF"]:[18,""],["FWG"]:[44,""],["FWC"]:[28,"Chrysalis"],["FGA"]:[65,"Alpha"],["FGB"]:[77,"Beta"],["FGG"]:[53,"Gamma"],["FGO"]:[57,"Omega"],["FRH"]:[21,""],["FMD"]:[47,"Dragon"],["FME"]:[78,"Egg"],["FUN"]:[49,""],["HTP"]:[38,"Hunting"],["ITO"]:[r,"Torrent"],["IZL"]:[42,"Av Flame"],["IZR"]:[44,"Av Frost"],["IFL"]:[65,"Flame"],["IFR"]:[67,"Frost"],["KBE"]:[83,"Bee"],["LVG"]:[16,""],["LTT"]:[65,"Titan"],["LWY"]:[65,"Wyrm"],["MMY"]:[40,""],["POZ"]:[a,""],["NDR"]:[3,""],["NSD"]:[c,""],["OOZ"]:[a,""],["PTR"]:[r,"Torrent"],["RPT"]:[51,""],["RSC"]:[60,"Scout"],["SPL"]:[f,""],["SXP"]:[f,""],["SXD"]:[c,""],["SXT"]:[m,""],["SDL"]:[c,""],["SLG"]:[25,""],["SPN"]:[D,""],["STR"]:[r,"Torrent"],["SPU"]:[D,""],["XYR"]:[D,""],["STO"]:[r,"Torrent"],["TOT"]:[40,"Tendrils"],["TFK"]:[m,""],["TFD"]:[m,""],["TFF"]:[m,""],["TTF"]:[m,""],["WHC"]:[41,"Courser"],["WEB"]:[78,""],["ZTR"]:[32,"Returned"],["ZBS"]:[C,""],["ZST"]:[C,""],["ZMB"]:[C,""]}}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(!E.aiActive)if(E.ui.detailStack=[t],gt.mode!=="R"){gt.setMode("R");const i=b.basicAction("CNCL");i.zone=gt.baseMode==="G"?"B":"N",i.param="PM",T.ddf5([i])}else ut.drawAll()}changeLevel(t){const i=this.browseStack,r=i.length-1,a=i[r];i[r]=this.n(Wt.extractCardCode(a),t)}goBack(){this.browseStack.pop()}goToFriend(t){this.browseStack.push(t)}friendTxt(t){const i=this.friendText[t];return i||[3,"I am error"]}goBackAction(){const t=b.basicAction("DTUP");return t.param="DB",t}levelAction(t){const i=b.basicAction("DTUP");return i.param=S.enTil("DL",t),i}friendAction(t){const i=b.basicAction("DTUP");return i.param=S.enTil("DF",t),i}updateDetails(t){const i=S.deTil(t.param),r=i[0];r==="DB"?this.goBack():r==="DF"?this.goToFriend(i[1]):r==="DL"?this.changeLevel(parseInt(i[1])):console.error("Unknown detail arg",t)}}const ge=new Ga,Ai=[1,2,3,4,5,6,7].map(o=>o.toString());class Ia{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(Ee.map(t=>[t,!0])),this.setFilters=new Map(Ai.map(t=>[t,!0])),this.stats=new Di}getRarity(t){return this.rarityFilters.get(t)??!0}toggleRarity(t){const i=!this.rarityFilters.get(t);return this.rarityFilters.set(t,i),i}getSet(t){return this.setFilters.get(t.toString())??!0}toggleSet(t){const i=t.toString(),r=!this.setFilters.get(i);return this.setFilters.set(i,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),Ai.forEach(t=>{this.setFilters.set(t,S.readBoolStorage("dSet"+t,!0))}),Ee.forEach(t=>{this.rarityFilters.set(t,S.readBoolStorage("dRare"+t,!0))})),ut.drawAll()}setFArr(){let t=Ai.filter(i=>this.setFilters.get(i)).map(i=>parseInt(i));return t.length===7&&(t=[]),t}validRarities(){return Ee.filter(t=>this.rarityFilters.get(t))}startDraftPicks(){const t=this.setFArr();Ee.forEach(i=>{this.getRarity(i)?this.rarityCache[i]=Ot.getDeckCards([i],[],t):this.rarityCache[i]=[]}),Ee.every(i=>this.rarityCache[i].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 Di,this.resumeDraft("")}resumeDraft(t){if(t){this.picks.push(t),this.picksAsDeck=this.picksToDeck();const a=this.overdraft?60:30;if(this.picks.length===a){this.step==="A"?(this.pAdeck=this.picksAsDeck.slice(),this.step="B",this.startDraftPicks()):(this.pBdeck=this.picksAsDeck.slice(),this.launchDraft());return}const c=W.getCard(t);if(this.aiPicking||this.stats.addStat(c.type,c.faction),!this.factionLock){const f=c.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(C=>{this.rarityCache[C]=Ot.getDeckCards([C],[this.faction1,this.faction2],m)})}}}const i=this.generatePack().slice(-1*(6-this.picks.length%5)),r=this.fillPack(i);if(this.aiPicking)this.resumeDraft(r[r.length-1]);else{this.currentPack=r;const a=r.map((c,f)=>{const m=b.draftSelectAction("DRFT",f,!0);return m.param=c,m});it.removeAll(),T.ddf5(a)}}replay(){this.vsAI?(this.step="B",this.startDraftPicks()):this.launchDraft()}picksToDeck(){const t=[];return this.picks.forEach(i=>{const r=t.findIndex(a=>a.card===i);r===-1?t.push({card:i,num:1}):t[r].num+=1}),t.sort((i,r)=>{const a=W.getCard(i.card+"1"),c=W.getCard(r.card+"1");return a.name.toLowerCase(){const a=this.rarityCache[r].length;let c=!0,f=0;for(;c&&f<100;){const m=this.rarityCache[r][S.randInt(0,a)];i.includes(m)?f++:(i.push(m),c=!1)}}),i}handleMenuPick(t,i){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=i;S.writeBoolStorage("dRare"+i,this.toggleRarity(r))}else t==="DT"?S.writeBoolStorage("dSet"+i,this.toggleSet(i)):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));ut.drawAll()}launchDraft(){E.aiMode=this.vsAI,gt.setMode("G"),E.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 At=new Ia;class Wa{allCanvases=["game-ui","field","player","hand","hilite","effects","decklist","card"];allBackgrounds=["playmat","blueface","mainmenu"];dirtyA=!0;pvCC=[];init(){[oe,ne].forEach(t=>t.init())}dirtyAll(){[oe,ne,Ct].forEach(t=>{t.dirty=!0}),this.dirtyA=!0}async drawAll(){if(st.simOn)return;const t=gt.mode;this.clearDetails(),t==="G"?await this.drawGame():(it.removeAll(),t==="R"?await this.drawDetails(T.activeActions):t==="T"?E.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 drawGame(){this.clearDeck(),Dt.genAnimations();const t=await K.prep();if(!E.aiActive&&t>0&&(lt.get("hilite").clear(),await $e.drawActions([]),this.dirtyA=!0),await Promise.all([this.drawHand(k.getLocal()),this.drawPlayers(),this.drawField()]),K.start(),await K.aniProm(),await this.drawActions(T.activeActions),this.pvCC.forEach(i=>it.add(i)),E.winFlag!==0)await this.drawGameOver(),setTimeout(()=>{gt.mode==="G"&&E.winFlag!==0&&(oe.dirty=!0,this.drawField().then(()=>{this.drawGameOver(!0)}))},1500);else{await this.drawCommonButtons(!0,!0,!0);const i=b.basicAction("DBUG");i.param="AB";const r=new ht(i,0,0,40,35,nt.Right);it.add(r)}}async drawGameOver(t=!1){await Ct.drawGameOver(t)}async drawHand(t){ne.dirty&&await ne.drawCards(t)}async drawField(){oe.dirty&&await oe.drawCards()}async drawPlayers(){Ct.dirty&&(this.pvCC=await Ct.drawAllPlayers())}async drawDeck(t){const i=t.find(c=>c.zone==="B"),r=gt.baseMode==="G";r&&await $e.drawActions(i?[i]:[]);const a=lt.get("decklist");if(a.clear(),Si.makeHaze(a),!r&&i){await re.drawFactionButton(a,631,712,"A"),await re.drawSprite(a,"ui/arrow/x.png",631+28,712+12);const m=re.makeFactButtonClick(631,712,i);it.add(m)}await Si.drawActions(t,a),await Si.drawCards(a),await this.drawCommonButtons(!0,!0,!1)}async drawActions(t){E.aiActive?await $e.drawActions([]):this.dirtyA&&(it.removeAll(),lt.get("hilite").clear(),await Promise.all([ne.drawActions(t),oe.drawActions(t),$e.drawActions(t),Ct.drawActions(t)]),this.dirtyA=!1)}async drawDraft(t){lt.get("hilite").clear();const r=lt.get("game-ui");r.clear(),it.removeAll(),At.step==="O"?await oi.drawDraftMenu(r):(await me.drawPickerPlayer(r,At.step==="A",!1),await oi.drawList(t,r),await oi.drawStats(r),await this.drawCommonButtons(!0,!0,!1),await oi.drawPack(t,r))}async drawMenu(){const t=lt.get("game-ui");t.clear(),it.removeAll(),await kn.drawMenu(t)}async drawInfoMenu(){const t=lt.get("game-ui");t.clear(),it.removeAll(),await me.drawExtrasMenu(t)}async drawConstructed(){if($t.step==="O"){const t=lt.get("game-ui");t.clear(),it.removeAll(),await Xe.drawConstrMenu(t)}else await this.drawDeckPick(T.activeActions)}async drawDeckPick(t){lt.get("decklist").clear();const r=lt.get("game-ui");r.clear(),it.removeAll(),await me.drawPickerPlayer(r,$t.step==="A",$t.vsAI),await Xe.drawSets(t,r),await Xe.drawList(t,r)}clearDetails(){lt.get("card").clear()}clearDeck(){lt.get("decklist").clear()}async drawDetails(t){gt.baseMode==="G"&&(this.dirtyA=!0,await this.drawActions(t)),await this.drawCommonButtons(!0,!0,!1),lt.get("card").clear();const r=t.find(a=>a.key==="CNCL");r?await mn.drawDetails(r):console.error("Attempted to show details view with no cancel action")}async drawCommonButtons(t,i,r){let a=979;const c=723,f=lt.get("game-ui");if(r&&f.clear(),t&&(await re.makeIconButton(f,a,c,"EX"),a-=50,await re.makeIconButton(f,a,c,"HL"),a-=50),i){const m=S.clickMode;m!=="M"&&await re.makeIconButton(f,a,c,m==="I"?"TM":"DM")}}async drawExit(t){const i=lt.get("card");await ot.drawButton(i,151,488,t[1],"Quit Game",24,!1),await ot.drawButton(i,478,488,t[0],"Resume",52,!1)}async drawSwap(){const t=lt.get("decklist");t.clear(),t.context.fillStyle="#000000",t.context.fillRect(0,0,S.gameWidth,S.gameHeight);const i=k.getActive(),r="#AAF0C1",a=b.basicAction("USWP");a.param="PM",await Ct.drawPlayer(i,t,200,300);const c={fontSize:22,colour:r};await Ct.drawText(t,"Player "+(i.isPlayerA?"1":"2"),480,360,c),await Ct.drawText(t,"Click to start turn",480,420,c);const f=new ht(a,0,0,S.gameWidth,S.gameHeight,nt.Both);it.add(f)}setBackground(t){const i="hide";this.allBackgrounds.forEach(r=>{const a=document.getElementById(r);a&&(t===r?a.classList.remove(i):a.classList.add(i))})}playmatSetup(){let t=!1;const i=S.options.playmat,r=document.getElementById("playmat");if(r?r.dataset.pic!==i&&(t=!0,r.remove()):t=!0,t){const a=new Image(S.gameWidth,S.gameHeight);a.id="playmat",a.classList.add("hide",this.scaleCSS(S.options.scale)),a.dataset.pic=i,a.src=S.imgRoot+`background/playfield-${i}.jpg`,document.getElementById("mainmenu").before(a)}}scaleCSS(t){return`uiSize${t}`}changeScale(t){this.clearAll();let i=S.options.scale;i===t&&(i="100");const r=t==="100"?1:.90625;it.updateScale(r);const a=this.scaleCSS(i),c=this.scaleCSS(t);this.allCanvases.forEach(C=>{lt.get(C).dom.classList.replace(a,c)}),this.allBackgrounds.forEach(C=>{const D=document.getElementById(C);D&&D.classList.replace(a,c)}),document.getElementById("solforge").classList.replace(`gameSize${i}`,`gameSize${t}`),document.getElementById("log").classList.replace(`logSize${i}`,`logSize${t}`),S.options.scale=t,S.writeStorage("scale",t)}clearAll(){this.allCanvases.forEach(t=>{lt.get(t).clear()})}}const ut=new Wa;class $a{positionChange(t){p.creatByTarget().forEach(i=>{i.enforceEffects("PS",t)}),k.enforceEffects(t)}defenderChange(t){p.qPlayerCreats(t).forEach(r=>{r.effects.filter(a=>a.watch==="DF").forEach(a=>W.getCard(a.logicCode).enforceEffect(r))})}playerHealthChange(){p.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){p.qActiveCreats().forEach(i=>{i.enforceEffects("AT"),i.enforceEffects("AR"),i.enforceEffects("CH"),i.enforceEffects("DF",i.owner)})}}const Be=new $a;class Ua{getC(t){return p.jr5(t)}creature(t,i){return{code:t,creatId:i.id}}creatHeal(t,i){return{code:"CHL",creatId:t.id,healAmt:i}}damage(t,i,r,a,c,f,m){let C;return f instanceof je?C=f.id:C=f,{code:"DMG",battle:t,dmg:i,life:r,isCreatSrc:a,isCreatTarg:c,target:C,srcId:m?.id}}enterField(t){return{code:"ENT",creatId:t.id,forged:!1,formation:!1}}playCard(t,i){return{code:"PLC",playerA:i,cardCode:t}}player(t,i){return{code:t,playerA:i}}playerHeal(t,i){return{code:"PHL",playerA:t,healAmt:i}}replaced(t,i){return{code:"RPL",creatId:t.id,replCreatId:i.id}}toCreature(t){const i=t;return{code:i.code,creatId:i.creatId,creature:this.getC(i.creatId)}}toDamage(t){const i=t;let r,a,c;return i.isCreatTarg?c=this.getC(i.target):a=k.toPlayer(i.target),i.isCreatSrc&&(r=this.getC(i.srcId)),{code:i.code,battle:i.battle,dmg:i.dmg,life:i.life,isCreatSrc:i.isCreatSrc,srcId:i.srcId,target:i.target,isCreatTarg:i.isCreatTarg,srcCreat:r,hurtCreat:c,hurtPlayer:a}}toEnterField(t){const i=t;return{code:i.code,creatId:i.creatId,forged:i.forged,formation:i.formation,creature:this.getC(i.creatId)}}toReplaced(t){const i=t;return{code:i.code,creatId:i.creatId,creature:this.getC(i.creatId),replCreatId:i.replCreatId,replCreat:this.getC(i.replCreatId)}}}const I=new Ua;class Oa{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(i=>i.getState()),bO:this.birthOrder};return JSON.stringify(t)}dirt(){st.simOff&&(oe.dirty=!0,ut.dirtyA=!0)}setState(t){const i=JSON.parse(t);this.field=i.field.map(r=>new je(r)),this.birthOrder=i.bO}jr5(t){const i=this.searchById(t);if(i)return i;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByTr(t){return this.jr5(t.creatId)}creatByLane(t,i){const r=this.searchByLane(t,i);if(r)return r;throw console.error("naughty creature lane ",t,i),new Error("Could not find creature by lane")}ddf6(t){const i=this.searchByFSA(t);if(i)return i;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return this.field.find(i=>i.id===t)}searchByLane(t,i){return this.field.find(r=>r.lane===t&&r.owner===i&&r.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let i=this.field;if(t){if(t.player!=="X"){const r=k.toBool(t.player);i=i.filter(a=>a.owner===r)}if(t.creatStatus!=="A"){const r=this.creatStatusTargetToCS(t.creatStatus);i=i.filter(a=>a.status===r)}if(!S.isUn(t.lanes)){const r=w.lanesToArr(t.lanes);i=i.filter(a=>r.includes(a.lane))}if(S.isUn(t.maxAttack)||(i=i.filter(r=>r.attack<=t.maxAttack)),t.notMe&&(i=i.filter(r=>r.id!==t.notMe)),t.victims){const r=S.deTil(t.victims);i=i.filter(a=>r.includes(a.id))}if(t.tribe!=="AN"&&(i=i.filter(r=>r.isTribe(t.tribe))),t.canLevel&&(i=i.filter(r=>W.getCard(r.code).canLevel())),t.level!=="LA"){const r=w.levelTargetToLevel(t.level);i=i.filter(a=>r.includes(a.level))}t.cardCode&&(i=i.filter(r=>W.getCard(r.code).cardCode()===t.cardCode)),t.canDefender&&(i=i.filter(r=>!r.negateDefender)),t.hasDefender&&(i=i.filter(r=>r.defender)),t.canArmor&&(i=i.filter(r=>!r.negateArmor)),t.hasArmor&&(i=i.filter(r=>r.armor>0)),t.canMove&&(i=i.filter(r=>!r.negateMobility)),t.hasMobility&&(i=i.filter(r=>r.mobility>0)),t.hasPoison&&(i=i.filter(r=>r.poison>0)),t.canRegen&&(i=i.filter(r=>!r.negateRegen)),t.hasRegen&&(i=i.filter(r=>r.regen>0)),t.faction!=="X"&&(i=i.filter(r=>r.faction===t.faction))}return i}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(i=>!this.field.find(a=>a.owner===t&&a.lane===i&&a.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(i=>Math.abs(t.lane-i)<=t.mobility):[]}fling(t,i){const r=this.emptyLanes(t.owner),a=r.length;a>0&&t.move(r[S.randInt(0,a)],i)}birth(t,i,r,a=0,c,f=void 0){if(i==="S"){const G=this.emptyLanes(r);if(G.length===0)return;a=G[S.randInt(0,G.length)]}else if(i==="P"&&!this.emptyLanes(r).includes(a))return;const m=typeof t=="string"?W.getCard(t):t,C=m.jr3(r,a);this.dirt(),r===k.activeA&&L.birthRegistrar(C.id),K.addFactBoard(c,C.id,C.lane,r);let D;if(i==="F"||i==="R"){if(D=this.searchByLane(a,r),D){if(st.simOff){const G=[D.code," was replaced"];i==="R"&&G.push(" with ",C.code),G.push("."),y.lawg(...G)}D.status="R",x.addEvents(I.replaced(C,D))}if(i==="F"){let G=2;r===k.isLocalA&&(G=T.playPosition()-E.ui.handScrollLeft),K.addForgeMove(C.id,G,a,r,D)}}this.field.push(C);const B=I.enterField(C);return B.forged=i==="F",m.formation&&C.lane!==1&&C.lane!==5&&(B.formation=C.adjacent.every(G=>!S.isUn(this.searchByLane(G,r)))),this.birthOrder.push({creatId:C.id,time:f||E.tick()}),x.addEvents(B),C.enforceEffects("PH"),Be.positionChange(r),C}findBirthTime(t){const i=this.birthOrder.filter(r=>r.creatId===t).map(r=>r.time);if(i.length!==0)return i.length>1&&console.warn("wery curious, more than one birth record for creat "+t),i[0]}qActiveCreats(){return this.creatByTarget(b.crTarg())}qPlayerCreats(t){const i=b.crTarg();return i.player=k.toTarget(t),this.creatByTarget(i)}ddf1(){return this.creatByTarget(b.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(b.crEnemyTarg())}}const p=new Oa;class Va{creatFightState(t,i){return t?i===1||t.defender||t.sleeping&&!t.aggressive?1:i===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t){if(t.aggState>0){let i=0;if(t.oppState>0){const r=t.aggState===2&&t.aggCreat.breakthrough;i=t.oppCreat.hurtBattle(t.aggAtt,t.aggCreat,r)}else t.aggState===2&&(i=t.aggAtt);i>0&&k.hurtBattle(!t.aggCreat.owner,i,t.aggCreat)}}genNugget(t,i,r,a,c){return{aggState:t,aggCreat:r,oppState:i,oppCreat:a,aggAtt:c,lurch:!1,slash:!1,armHit:!1}}nugPair(t,i,r,a){return[this.genNugget(t,i,r,a,r?.attack||0),this.genNugget(i,t,a,r,a?.attack||0)]}simbaCF(t,i,r,a){if(i.slash=!0,t.lurch&&t.aggCreat.breakthrough){const c=Math.max(0,r-t.oppCreat.health);c>0&&this.simbaP(a,c,!0)}}simbaC(t,i,r){if(t.aggState===0)return;let a=!1;if(t.aggState===2?(t.lurch=!0,a=!0):t.oppState===2&&(a=!0),a&&t.aggAtt>0)if(t.oppState>0){const c=Math.max(t.oppCreat.armor-t.oppCreat.armorDmg,0);if(c>0){i.armHit=!0;const f=t.aggAtt-c;f>0&&this.simbaCF(t,i,f,r)}else this.simbaCF(t,i,t.aggAtt,r)}else this.simbaP(r,t.aggAtt,t.lurch)}simbaP(t,i,r){if(!(i<1||!r||t[1]&&t[2]))if(t[0]>0){t[1]=!0;const a=Math.min(t[0],i);t[0]=t[0]-a,i-a>0&&(t[2]=!0)}else t[2]=!0}fight(t){st.simOff&&y.add("FIGHT!");let i=2,r=1;t&&(L.mainBattle=!1,i=0,r=0);const a=k.activeA,c=!a,f=[],m=k.makeAnim(a),C=k.makeAnim(c);p.laneIdx.forEach(B=>{const G=p.searchByLane(B,a),R=p.searchByLane(6-B,c),X=this.creatFightState(G,i),V=this.creatFightState(R,r);if(X===2||V===2){const tt=this.nugPair(X,V,G,R);this.simbaC(tt[0],tt[1],C),this.simbaC(tt[1],tt[0],m),X===2&&L.ffs++,f.push(tt[0],tt[1])}});let D;st.simOff&&K.on&&f.some(B=>B.lurch)?(this.barking&&S.dogBark(),f.forEach(B=>{B.lurch&&K.addFight(B.aggCreat),B.slash&&K.addSlash(B.aggCreat),B.armHit&&K.addArmorC(B.aggCreat)}),m[1]&&K.addArmorP(a),C[1]&&K.addArmorP(c),m[2]&&K.addSwipe(a),C[2]&&K.addSwipe(c),D=oe.drawFight()):D=Promise.resolve(),D.then(()=>{f.forEach(B=>this.dukeItOut(B)),Be.playerHealthChange(),Bt.deathCheck(),x.type="C0",T.actionDone()})}barking=!0}const Ii=new Va;class za{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,i){this.idnum=t,this.clock=i}newGame(t,i){this.idnum=0,this.clock=0,Ii.barking=S.options.bark,k.activeA=S.randInt(0,2)===0,this.aiActive=!k.activeA&&this.aiMode,k.isLocalA=this.aiMode||k.activeA,T.actionHistory=[],st.turnSims=0,st.turnTime=0,p.reset(),Bt.reset(),x.reset(),ut.dirtyAll(),this.ui=this.freshUI(),L.firstTurn=!0,this.winFlag=0;const r=k.nameOSaurus();k.initPlayer(!0,t,"Forgy McGhee",25),k.initPlayer(!1,i,r[0],r[1]),y.setup(),y.add("Ready...FIGHT!"),Dt.startState(k.getLocal()),L.startTurn()}freshUI(){return{handScrollLeft:0,detailStack:[],deckContents:[],deckScroll:0,deckSummary:!1}}}const E=new za;class Za{laneIdx=[1,2,3,4,5];state=[];addCard(t,i,r=!1){const a=t.hand.push(i);if(this.hd(t),this.ok(t)){const c=a-1;this.state.push({status:"A",ccode:i,idx:c,vIdx:r?5:-1})}}cardDiscard(t,i){if(t.discard.push(t.hand.splice(i,1)[0]),this.phd(t),this.ok(t)){const r=this.currHand()[i];r.status="D"}}cardDiscardAll(t){t.discard=t.discard.concat(t.hand),t.hand=[],this.phd(t),this.ok(t)&&this.currHand().forEach(r=>{r.status="D"})}hd(t){this.local(t)&&(ne.dirty=!0)}phd(t){this.local(t)&&(Ct.dirty=!0,ne.dirty=!0)}cardPlayOrLevel(t,i,r,a=!1){if(t.hand.splice(i,1),this.hd(t),this.ok(t)){const c=this.currHand();c[i].status=a?"O":r?"V":"D"}}currHand(){return this.state.filter(t=>t.status==="N"||t.status==="A"||t.status==="L")}genAnimations(){if(!K.on)return;let t=!1,i=0,r=!1;const a=k.getLocal();this.state.forEach(m=>{this.posInView(m.vIdx)&&((m.status==="D"||m.status==="V"||m.status==="O")&&(K.addHandDiscard(this.key(!1,m.idx,m.vIdx,-5),m.ccode,m.vIdx),t=!0,r=!0),m.status==="V"||m.status==="L"?(K.addLevel(this.key(!1,m.idx,m.vIdx,-5),m.vIdx),t=!0):m.status==="O"&&K.addOverload(this.key(!1,m.idx,m.vIdx,-5),m.vIdx))});let c=this.left();c>0&&a.hand.length-c<5&&(c=Math.max(0,a.hand.length-5),E.ui.handScrollLeft=c),this.currHand().map((m,C)=>({guts:m,newIdx:C,newVIdx:this.viewPos(C,c)})).forEach(m=>{if(m.guts.vIdx!==m.newVIdx){const C=this.key(!0,m.newIdx,m.guts.vIdx,m.newVIdx);m.guts.vIdx<0&&m.newVIdx>4?(K.addHandFling(C,m.guts.ccode,i),i++,t=!0):(this.posInView(m.guts.vIdx)||this.posInView(m.newVIdx))&&(K.addHandMove(C,m.guts.ccode,m.guts.vIdx,m.newVIdx,r),t=!0)}}),t&&this.genState(a)}genState(t){if(this.ok(t)){const i=this.left();this.state=t.hand.map((r,a)=>({ccode:r,idx:a,status:"N",vIdx:this.viewPos(a,i)}))}}key(t,i,r,a){return S.enTil(S.bool2txt(t),i,r,a)}left(){return E.ui.handScrollLeft}levelInHand(t,i,r){if(t.hand[i]=r,this.hd(t),this.ok(t)){const a=this.currHand();a[i].status="L"}}local(t){return t.isPlayerA===k.isLocalA}ok(t){return st.simOff&&K.on&&this.local(t)}posInView(t){return!(t>4||t<0)}startState(t){this.genState(t),this.state.forEach(i=>{i.vIdx=-1})}viewPos(t,i){return t-i}}const Dt=new Za;class Ya{loglist;you=!0;localPlayerKey="";oppPlayerKey="";localPlayerSpan="";oppPlayerSpan="";constructor(){this.loglist=document.getElementById("loglist")}setup(){this.you=k.isLocalA,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 i=document.createElement("li");i.innerHTML=t,this.loglist.appendChild(i),i.scrollIntoView({behavior:"smooth",block:"end"})}span(t,i,r=""){const a=r.length>0?` onclick="sfapi.details('${r}')"`:"";return`${t}`}add(t){this.addLi(t)}debug(t,i=!0){(i||S.options.debug)&&this.addLi(this.span(t,"debug"))}clearAll(){this.loglist.innerHTML=""}crdRgx=/^[A-Z\d]{3}[1234S]$/;lawg(...t){if(st.simOn)return;let i="";t.forEach(r=>{if(typeof r=="string")r.match(this.crdRgx)===null?i+=r:i+="^c"+r;else{const a=k.toBool(r);i+="^p"+(a?"a":"b")}}),this.parse(i)}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let i=!0;for(;i;){const r=t.indexOf("^c");if(r===-1)i=!1;else{const a=t.slice(r+2,r+6);if(a==="POIS")t=t.replaceAll("^c"+a,this.span("Poison","green"));else{const c=W.getCard(a);t=t.replaceAll("^c"+a,this.span(`${c.name} ${c.level}`,this.factMap[c.faction],a))}}}return t}parse(t){const r=t.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),a=this.parseCards(r);this.add(a)}cardText(t){let i;if(t.type==="C"){const r=t,a=[];r.iRegen>0&&a.push("Regenerate "+r.iRegen),r.iArmor>0&&a.push("Armor "+r.iArmor),r.iMobile>0&&a.push("Mobility "+r.iMobile),r.iBT&&a.push("Breakthrough"),r.iDefend&&a.push("Defender"),r.iAggro&&a.push("Aggressive"),r.consistent&&a.push("Consistent"),a.length>0&&a.push(""),i=a.join(". ")+t.text}else i=t.text;return(t.free?"Free. ":"")+(t.overload?"Overload. ":"")+i}cardTextSplit(t){const i=[];if(t.free&&i.push("Free"),t.consistent&&i.push("Consistent"),t.overload&&i.push("Overload"),t.type==="C"){const r=t;r.iRegen>0&&i.push("Regenerate "+r.iRegen),r.iArmor>0&&i.push("Armor "+r.iArmor),r.iMobile>0&&i.push("Mobility "+r.iMobile),r.iBT&&i.push("Breakthrough"),r.iDefend&&i.push("Defender"),r.iAggro&&i.push("Aggressive")}if(t.text.length>0&&i.push(...t.text.split("~")),t.level===1){const r=t.cardCode(),a=wi.find(c=>c[0]===r);if(a){let c;const f=a[1];f.length===2&&f[0]===f[1]?c="2x "+W.getCard(`${f[0]}1`).name:c=f.map(m=>W.getCard(`${m}1`).name).join(", "),i.push("Solbind: "+c)}}return i}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){return t===1?"level 1 ":t===2?"level 2 or lower ":""}jr9(t,i,r=!1){return t!==0&&i!==0?`${this.bufferson(t,!0)}${r?",":" and"} ${this.bufferson(i,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(i,!1)}bufferson(t,i){return`${t>0?"+":""}${t} ${i?"attack":"health"}`}dbdtac(t=-1){return`deals battle damage to a ${t===-1?"":this.levelGateText(t)}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 i=W.getCard(t);return i.name+" "+i.level}pName(t){return t?"A":"B"}tokName(t){return`${t.iAttack}/${t.iHealth} ${t.name}`}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 y=new Ya;class Ka{sneak(){ut.playmatSetup(),K.init()}handleMainMenuButton(t){t.param==="D"?(gt.setMode("D"),S.options.wasDrafting=!0,this.sneak,At.initDraft()):t.param==="C"?(gt.setMode("C"),S.options.wasDrafting=!1,this.sneak(),$t.initConstructed()):t.param==="I"?(gt.setMode("I"),ut.drawAll()):window.open("deckbuilder.html")}handleMenuButton(t){const i=S.deTil(t.param),r=i[0];let a=!0;if(r==="RP")a=!1,y.clearAll(),S.options.wasDrafting?At.replay():$t.replay();else if(r==="MM")gt.setMode("M"),y.clearAll();else if(r==="CN"||r==="CP"||r==="CX"||r==="CR"||r==="CI"||r==="CV"||r==="LK")a=!1,$t.handleMenuPick(r,i[1]);else if(r==="DN"||r==="DR"||r==="DI"||r==="DV"||r==="LD"||r==="GP"||r==="OD"||r==="DT")a=!1,At.handleMenuPick(r,i[1]);else if(r==="alloyin"||r==="nekrium"||r==="tempys"||r==="uterra"||r==="vanilla")S.options.playmat=r,S.writeStorage("playmat",r);else if(r==="AN"||r==="HH"||r==="CH"||r==="BB"||r==="BC")S.togOptViaPram(r);else if(r==="90"){const c=S.options.scale==="90"?"100":"90";ut.changeScale(c)}else r==="RU"?(a=!1,this.halp()):r==="FQ"?(a=!1,window.open("https://grousewood-games.github.io/solforge/docs/faq")):r==="SB"?(a=!1,window.open("https://stoneblade.com/")):r==="GW"?(a=!1,window.open("https://github.com/grousewood-games")):r==="VR"?(a=!1,window.open("https://github.com/grousewood-games/solforge/releases/tag/"+S.ver)):(a=!1,console.error("missing handler for menu button param "+t.param));a&&ut.drawAll()}handleUIButton(t){t.param==="DM"?(S.setClickMode("I"),ut.dirtyA=!0,ut.drawAll()):t.param==="TM"?(S.setClickMode("T"),ut.dirtyA=!0,ut.drawAll()):t.param==="EX"?(gt.setMode("X"),T.ddf5(this.generateExitActions())):t.param==="HL"?this.halp():console.error("missing handler for common button param "+t.param)}generateExitActions(){const t=b.basicAction("CANC");return t.param="PM",[t,b.menuButtonAction("MM")]}halp(){window.open("https://grousewood-games.github.io/solforge/docs/rules")}}const ki=new Ka;class Xa{stack=["M"];setMode(t){this.deetMode(t)||t==="X"||t==="S"?this.stack.push(t):(this.stack=[t],t==="G"?(lt.get("game-ui").clear(),ut.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(lt.get("game-ui").clear(),ut.setBackground("blueface")):t==="M"&&(ut.clearAll(),ut.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 gt=new Xa;class qa{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const i=k.toPlayer(t),r=[],a=[];if(i.deck.forEach(c=>{W.getCard(c).consistent?r.push(c):a.push(c)}),r.length===0)this.shuffle(i.deck);else{this.shuffle(a);const c=20-r.length,f=r.concat(a.slice(0,c));this.shuffle(f),i.deck=a.slice(c).concat(f)}}shuffle(t){const i=t.length,r=(a,c)=>{const f=t[a];t[a]=t[c],t[c]=f};if(i>0){let a,c;const f=i*4;for(let m=0;mr.decks).flat(),i=S.randInt(0,t.length);return t[i]}stockDeckByName(t,i){let r;if(He.some(a=>a.id===t?a.decks.some(c=>c.name===i?(r=c,!0):!1):!1),r)return r;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+i)}stockDeckByPram(t){const i=S.deTil(t);return this.stockDeckByName(i[0],i[1])}bucketHunter(t){let i="";return He.some(r=>r.decks.some(a=>a.name===t?(i=r.name,!0):!1)),i||"???"}ripper(t,i,r){const a=[[15,8,5],[30,15,10]],c=this.getDeckCards([],[t]),f=[],m=a[r===15?0:1][i-1];for(;f.lengthG===B)||f.push(B)}const C=f.map(D=>({card:D,num:i}));return i===2&&r===15&&(C[0].num=1),C}deckify(t){const i=t.map(r=>{const a=wi.find(c=>c[0]===r);return a?a[1]:[]}).flat();return t.concat(i).map(r=>`${r}1`)}parseDeck(t){const i=t.map(r=>Array(r.num).fill(r.card)).flat();return this.deckify(i)}validDeck(t){const i={};t.forEach(D=>{i[D.card]?i[D.card]+=D.num:i[D.card]=D.num});const r=Object.entries(i).map(D=>({card:D[0],num:D[1]})),a=r.map(D=>D.num).reduce((D,B)=>D+B,0);if(a!==30)return"Deck must have 30 cards, found "+a;const c=[];let f="";if(r.some(D=>{const B=ee.findIndex(G=>G.c===D.card);return B===-1?(f=D.card,!0):(c.push(ee[B].f),!1)}))return`Invalid card code: '${f}'`;let m=0;if(r.some(D=>D.num>3?(f=D.card,m=D.num,!0):!1))return`${m} copies of '${f}' ${y.fastName(f).slice(0,-2)}`;const C=[...new Set(c)];return C.length>2?"Deck must have two or less factions, found: "+C.join():""}getDeckCards(t=[],i=[],r=[]){return t.length===0&&i.length===0&&r.length===0?ee.map(a=>a.c):t.length>0&&i.length>0&&r.length===0?ee.filter(a=>t.includes(a.r)&&i.includes(a.f)).map(a=>a.c):t.length>0&&i.length===0&&r.length===0?ee.filter(a=>t.includes(a.r)).map(a=>a.c):t.length===0&&i.length>0&&r.length===0?ee.filter(a=>i.includes(a.f)).map(a=>a.c):t.length>0&&i.length>0&&r.length>0?ee.filter(a=>t.includes(a.r)&&i.includes(a.f)&&r.includes(Math.floor(a.s))).map(a=>a.c):t.length>0&&i.length===0&&r.length>0?ee.filter(a=>t.includes(a.r)&&r.includes(Math.floor(a.s))).map(a=>a.c):t.length===0&&i.length>0&&r.length>0?ee.filter(a=>i.includes(a.f)&&r.includes(Math.floor(a.s))).map(a=>a.c):ee.filter(a=>r.includes(Math.floor(a.s))).map(a=>a.c)}getCardFaction(t){const i=ee.find(r=>r.c===t);return i?i.f:"X"}getCardRarity(t){const i=ee.find(r=>r.c===t);return i?i.r:"T"}cardStats(){qe.forEach(t=>{const i=`${y.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,r=Ee.map(a=>`${y.rarityText(a)}: ${this.getDeckCards([a],[t]).length}`).join("; ");console.log(i+r)})}loadPromise=new Re;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new Re,this.loader.click(),await this.loadPromise.getPromise(),this.fileguts==="")return"";if(this.fileguts.startsWith("!")){const a=this.fileguts.substring(1);return this.fileguts="",a}const t=JSON.parse(this.fileguts);this.fileguts="";const i=t.cards,r=this.validDeck(i);return r||t}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const i=this.loader.files;if(i&&i.length>0){const a=i[0];var r=new FileReader;r.onload=c=>{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(C=>!(C&&typeof C.card=="string"&&Number.isInteger(C.num)))?(this.fileguts=JSON.stringify(m),this.loadPromise.resolveMe()):this.readError("File format is invalid.")}else this.readError("File read was empty.")}catch(C){console.error(C),this.readError("Error reading file.")}};try{r.readAsArrayBuffer(a)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}const Ot=new qa;class ja{phase="ST";enterMainPhase(){this.phase="MN";const t=k.getActive(),i=this.getMainPhaseActions(t);E.aiActive&&st.hitMainPhase(),T.ddf5(i,!0)}async whatNext(t=!1){if(E.winFlag!==0){st.simOn?(st.simEndpoint(E.winFlag===1?"L":"W"),E.winFlag=0):(T.actionHistory=[],E.aiActive=!1,await ut.drawAll());return}if(await ut.drawAll(),T.actionHistory.length>0)T.ddf5();else if(t)gt.setMode("S"),ut.drawAll();else if(x.getNextTrigger())Ti.resolve(x.getNextTrigger());else if(!x.deathCheck)Bt.deathCheck(),this.whatNext();else if(x.events.length>0)x.startBatch();else switch(p.purge(),Bt.purge(),this.phase){case "MN":this.enterMainPhase();break;case "ET":this.phase="PT",x.addEvents(I.player("PTN",k.activeA)),Qt.expireMods(),this.whatNext();break;case "PT":L.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),this.phase="MN",this.whatNext();break;case "ST":if(st.simOn)st.simEndpoint("T");else{const i=k.getInctive();i.triggers=i.triggers.filter(c=>c.type!=="NT"),this.phase="MN";const a=st.cheater()?500:100;S.sleep(a).then(()=>this.whatNext())}break}}expireatron(t,i,r,a){i.mods.forEach(c=>{c.expiry===a?c.expiry=r:c.expiry===r&&t.push([i,c])})}expireMods(){const t=p.creatByTarget(b.crTarg());t.push(k.playerA,k.playerB);let i=[];this.phase==="PT"?t.forEach(r=>{this.expireatron(i,r,"ET","EN")}):this.phase==="ST"&&t.forEach(r=>{this.expireatron(i,r,"ST","SN")}),i.length>0&&(p.dirt(),Ct.dirty=!0,i.forEach(r=>{const a=r[0];a instanceof je?a.expireMod(r[1]):k.expireMod(a,r[1])}),Be.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const i=this.getHandActions(t),r=this.getFieldActions(t);let a=L.mainBattle;if(a||(a=p.ddf1().some(c=>c.extraBattles>0&&c.isActive&&!c.defender)),a)i.push({key:"FITE",zone:"B",param:L.mainBattle?"M":"",host:""});else{const c=i.length===0&&r.length===0?"":"DIO";i.push({key:"ENDT",zone:"B",param:c,host:""})}return i.concat(r)}getHandActions(t){const i=[...new Set(t.hand)],r=[],a=[],c=[],f=[];i.forEach(B=>{const G=W.getCard(B);G.free?r.push(B):a.push(B),G.canLevel()&&c.push(B),G.canPlay()&&f.push(B)});const m=r.map(B=>[B,"FREE"]);L.freeCards.forEach(B=>{w.cardByTarget(a,B.condition).forEach(R=>{m.push([R[0],B.id]),a.splice(a.indexOf(R[0]),1)})}),m.push(...a.map(B=>[B,""]));const C=L.regularPlays>0;let D=t.hand.map((B,G)=>[B,G]);return C||(D=D.filter(B=>!a.includes(B[0]))),D.map(B=>{const G=m.find(tt=>tt[0]===B[0]),R=c.includes(B[0]),X=f.includes(B[0]);if(G[1]&&!X&&!C||!X&&!R)return;const V=b.handSelectAction("HPLY",B[0],G[1],B[1]);return V.canPlay=X,V.lvlOnly=R&&!X,V}).filter(Boolean)}getFieldActions(t){const i=p.qPlayerCreats(t.isPlayerA),r=i.filter(c=>p.canMove(c).length>0).map(c=>{const f=b.fieldSelectAction("MOVE",c.lane,c.owner);return f.host=c.code,f}),a=i.filter(c=>c.isActive&&c.activationAvailable?W.getCard(c.code).canActivate(c):!1).map(c=>{const f=b.fieldSelectAction("ACTV",c.lane,c.owner);return f.host=c.code,f.param=c.id,f});return r.forEach(c=>{const f=a.findIndex(m=>m.lane===c.lane);f>-1&&(a.splice(f,1),c.param="ACTV")}),r.concat(a)}}const Qt=new ja;class Qa{playerA;playerB;activeA;isLocalA;constructor(){this.playerA=this.newPlayer(!0),this.playerB=this.newPlayer(!1),this.activeA=!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,i){i.deck=t.deck,i.discard=t.discard,i.hand=t.hand,i.health=t.health,i.triggers=t.triggers,i.turn=t.turn,i.rank=t.rank,i.poison=t.poison,i.mods=t.mods,i.effects=t.effects,i.armor=t.armor,i.armorDmg=t.armorDmg}getState(){const t={pA:this.getPlayerState(this.playerA),pB:this.getPlayerState(this.playerB),actP:this.activeA};return JSON.stringify(t)}setState(t){const i=JSON.parse(t);this.setPlayerState(i.pA,this.playerA),this.setPlayerState(i.pB,this.playerB),this.activeA=i.actP}pt2pb={["X"]:()=>{throw new Error("goof passed any to player target boolean-o-fier")},["A"]:()=>!0,["B"]:()=>!1,["F"]:()=>this.activeA,["E"]:()=>!this.activeA};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.activeA)}getInctive(){return this.b2p(!this.activeA)}getLocal(){return this.b2p(this.isLocalA)}makeAnim(t){const i=this.toPlayer(t),r=this.totalArmor(i);return[Math.max(r-i.armorDmg,0),!1,!1]}hurtPlayer(t,i){if(i<1)return 0;const r=this.totalArmor(t),a=Math.max(Math.min(i,r-t.armorDmg),0);let c=i-a;return t.armorDmg+=a,t.health-=c,c}hurtDirect(t,i,r){const a=this.toPlayer(t),c=this.hurtPlayer(a,i);return c>0&&(Ct.dirty=!0,y.lawg(r,` dealt ${c} dmg to `,a,"."),x.addEvents(I.damage(!1,c,a.health,!1,!1,a.isPlayerA,void 0)),Be.playerHealthChange()),c}hurtBattle(t,i,r){const a=this.toPlayer(t),c=this.hurtPlayer(a,i);c>0&&(Ct.dirty=!0,y.lawg(r.code,` dealt ${c} battle dmg to `,a,"."),x.addEvents(I.damage(!0,c,a.health,!0,!1,a.isPlayerA,r)))}heal(t,i,r){const a=this.toPlayer(t);a.health+=i,Ct.dirty=!0,y.lawg(a,` gained ${i} health from `,r,"."),x.addEvents(I.playerHeal(a.isPlayerA,i)),Be.playerHealthChange()}drawCard(t,i){const r=this.toPlayer(t);let a=!0;for(let c=0;c{parseInt(D.slice(3,4))>r.rank?C.push(D):m.push(D)}),m.length>0&&(r.deck=m,r.discard=C,Ot.shuffle(r.deck),Dt.addCard(r,r.deck.pop()))}}r.isPlayerA===this.isLocalA&&(Ct.dirty=!0)}addPoison(t,i){const r=this.toPlayer(t);r.poison+=i,Ct.dirty=!0}totalArmor(t){const i=this.toPlayer(t);return this.modBool(i,"NA")?0:i.armor+this.modSum(i,"AR")}totalPoison(t){const i=this.toPlayer(t);return i.poison+this.modSum(i,"PN")}modSum(t,i){const r=this.toPlayer(t);return b.modSum(r.mods,i)}modBool(t,i){const r=this.toPlayer(t);return b.modBool(r.mods,i)}hasMod(t,i){const r=this.toPlayer(t);return b.hasModG(r.mods,i)}addMod(t,i){this.toPlayer(t).mods.push(i),Ct.dirty=!0}addModSafe(t,i){const r=this.toPlayer(t);b.hasMod(r.mods,i)||this.addMod(r,i)}removeMod(t,i){const r=this.toPlayer(t);r.mods=r.mods.filter(a=>a.granter===i?(a.type==="AR"&&(r.armorDmg=Math.max(0,r.armorDmg-a.value)),Ct.dirty=!0,!1):!0)}removeModSafe(t,i){const r=this.toPlayer(t);this.hasMod(r,i)&&this.removeMod(r,i)}expireMod(t,i){const r=this.toPlayer(t);r.mods.splice(b.modIdx(r.mods,i),1),Ct.dirty=!0}addTr(t,i){this.toPlayer(t).triggers.push(i),Ct.dirty=!0}enforceEffects(t){const i=this.toPlayer(t);i.effects.forEach(r=>W.getCard(r.logicCode).enforcePlayerEffect(r,i))}activeCardItems(t){const i=this.toPlayer(t),r=i.triggers.filter(c=>!(c.customCode==="AB"||c.type==="NT")).map(c=>c.logicCode.startsWith("EPH")?c.customCode:c.logicCode),a=i.effects.map(c=>c.logicCode);return r.concat(a)}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,i,r,a){const c=this.toPlayer(t);c.name=r,c.nameOffset=a,c.turn=1,c.rank=1,c.health=S.options.highHealth?360:120,c.discard=[],c.deck=Ot.parseDeck(i),c.mods=[],c.triggers=[],c.effects=[],c.poison=0,c.armor=0,c.armorDmg=0,this.ambushScan(c),Ot.shuffleDeck(c),c.hand=c.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"),this.boosh(t,"LLV","DS")}boosh(t,i,r){const a=i+"1";if(t.deck.includes(a)){const c=b.trigger(r,a);c.customCode="AB",t.triggers.push(c)}}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]],i=t[S.randInt(0,t.length)];return[i[0],i[1]+18]}}const k=new Qa;class Ja{stateStack=[];popCheck(){if(this.stateStack.length===0)throw new Error("Attempted to manipulate empty stack")}saveState(){const t={action:T.getState(),aiInPhase:st.inPhase,batch:x.getState(),death:Bt.getState(),field:p.getState(),game:E.getState(),mode:JSON.stringify(gt.stack),phase:Qt.phase,player:k.getState(),turn:L.getState()};this.stateStack.push(t)}restoreState(){this.popCheck();const t=this.stateStack[this.stateStack.length-1];T.setState(t.action),st.inPhase=t.aiInPhase,x.setState(t.batch),Bt.setState(t.death),p.setState(t.field),E.setState(t.game.i,t.game.t),gt.stack=JSON.parse(t.mode),Qt.phase=t.phase,k.setState(t.player),L.setState(t.turn)}popState(){this.popCheck(),this.stateStack.pop()}}const We=new Ja;class _a{toActions(t){return(Array.isArray(t)?t:[t]).map(r=>{const a=this.actionTargGuts(r);return a.forEach(c=>{c.host=r.host,c.param=r.param,c.hint=r.hint}),a}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(i=>b.handSelectAction(t.key,i[0],"",i[1]));if(t.target==="TF"){if(t.field==="O")return p.creatByTarget(t).map(i=>b.fieldSelectAction(t.key,i.lane,i.owner));{const i=t.player==="X"?[!0,!1]:[k.toBool(t.player)],r=S.isUn(t.lanes)?p.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return i.map(a=>r.map(c=>b.fieldSelectAction(t.key,c,a))).flat();if(t.field==="E")return i.map(a=>p.emptyLanes(a).filter(c=>r.includes(c)).map(c=>b.fieldSelectAction(t.key,c,a))).flat()}}if(t.target==="TP")return t.player==="X"?[b.playerSelectAction(t.key,!0),b.playerSelectAction(t.key,!1)]:[b.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,i){let r=t.map((a,c)=>[a,c]);if(i){if(S.isUn(i.deckPositionSkip)||(r=r.filter(a=>a[1]!==i.deckPositionSkip)),i.faction!=="X"&&(r=r.filter(a=>W.getCard(a[0]).faction===i.faction)),i.tribe!=="AN"&&(r=r.filter(a=>{const c=W.getCard(a[0]);return c.type==="C"?c.isTribe(i.tribe):!1})),i.canLevel&&(r=r.filter(a=>W.getCard(a[0]).canLevel())),i.level!=="LA"){const a=w.levelTargetToLevel(i.level);r=r.filter(c=>{const f=parseInt(c[0].substring(3,4));return a.includes(f)})}if(i.card!=="A"){const a=i.card==="C"?"C":"S";r=r.filter(c=>W.getCard(c[0]).type===a),i.card==="C"&&!S.isUn(i.maxAttack)&&(r=r.filter(c=>W.getCard(c[0]).iAttack<=i.maxAttack))}i.cardCode&&(r=r.filter(a=>W.getCard(a[0]).cardCode()===i.cardCode))}return r}deckByTarget(t){const i=k.toPlayer(t.player);let r;if(t.target==="TH")r=i.hand;else if(t.target==="TD")r=i.discard;else if(t.target==="DK")r=i.deck;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(r,t)}buttonTarget(t,i="",r=""){return b.actionTarget("TB",t,i,r)}boardTarget(t,i){return b.actionTarget("TR",t,i,"")}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,i){return this.levelTargetToLevel(t).includes(i)}levelTestCommon(t,i){return this.levelTargetTest(this.ddf2(i),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}const w=new _a;class tn{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==="FM"?this.formationTriggerTest(t):t.trigger.type==="RD"?this.raidTriggerTest(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=p.creatByTr(t).lane),W.getCard(t.trigger.logicCode).jr8(t)}forgeTriggerTest(t,i){if(t.event.code==="ENT"&&t.event.forged){const r=p.creatByTr(t),a=r.id===t.event.creatId&&r.status==="A";return i&&a?!r.opposed:a}return!1}formationTriggerTest(t){if(t.event.code==="ENT"&&t.event.formation){const i=p.creatByTr(t);return i.id===t.event.creatId&&i.status==="A"}return!1}raidTriggerTest(t){if(t.event.code==="TRE"&&L.ffs>2){const i=p.creatByTr(t);return i.owner===t.event.playerA&&i.status==="A"}return!1}upgradeTriggerTest(t){if(t.event.code==="RPL"){const i=p.searchById(t.creatId);if(i)return i.id===t.event.creatId;console.warn("Upgrade trigger test could not find its creature",t)}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const i=t.event,r=p.searchById(t.creatId);if(r)return r.status==="D"&&r.id===i.creatId;console.warn("Venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const i=t.event,r=p.creatByTr(t);return r.status==="A"&&r.id===i.creatId}return!1}generalTriggerTest(t){return W.getCard(t.trigger.logicCode).ddf8(t)}}const Ti=new tn;class en{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 i=JSON.parse(t);this.mainBattle=i.mB,this.deathsA=i.dA,this.deathsB=i.dB,this.cardsPlayed=i.cP,this.ffs=i.ffs,this.freeCards=i.fC,this.regularPlays=i.rP,this.newPre=i.n1,this.newPost=i.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,i,r,a){const c=this.cardPlayed(i,r,a),f=k.getActive();y.lawg("Forged ",c.code,"."),p.birth(c,"F",f.isPlayerA,t.lane,"X"),T.actionDone()}levelAndDiscardA(t){return this.levelAndDiscard(t.card,t.position)}levelAndDiscard(t,i,r=!0,a="F"){const c=W.getCard(t),f=k.toPlayer(a);let m=!1;if(!c.overload){const C=c.levelUpCard();f.discard.push(C),C!==t&&(m=!0)}return i>-1?Dt.cardPlayOrLevel(f,i,m,c.overload):y.debug("Bad play index: "+i+" ("+t+")"),f.isPlayerA===k.isLocalA&&(Ct.dirty=!0),r&&m&&y.lawg(f," leveled a card."),c}cardPlayed(t,i,r,a=!1){const c=this.levelAndDiscard(t,r,a),f=k.getActive();if(i==="")this.regularPlays-=1;else if(i!=="FREE"){const m=this.freeCards.findIndex(C=>C.id===i);m>-1?this.freeCards.splice(m,1):console.error("Could not find free card rule!")}if(this.cardsPlayed+=1,!a){const m=I.playCard(t,f.isPlayerA);x.addEvents(m)}return c}passTheTurn(){if(k.activeA=!k.activeA,Qt.phase="WT",E.aiMode){if(st.simOff)if(E.aiActive=!E.aiActive,E.aiActive)st.turnSims=0,st.turnTime=0;else{const t=`🤖: ${this.calma(st.turnSims)} pontifications in ${(st.turnTime/1e3).toFixed(1)} seconds.`;y.lawg(t)}}else k.isLocalA=k.activeA,Dt.genState(k.getLocal());this.startTurn()}calma(t){let i=t.toString();return i.length<4?i:i.length>6?i.slice(0,-6)+","+i.slice(-6,-3)+","+i.slice(-3):i.slice(0,-3)+","+i.slice(-3)}startTurn(){const t="------";st.log&&E.aiActive&&E.aiMode&&console.log(t+" AI Turn Start "+t),st.simOff&&(y.lawg(t),y.lawg(k.activeA," starts turn.")),this.resetTurnData(),Qt.phase="ST",x.addEvents(I.player("TRS",k.activeA)),Qt.expireMods(),Ct.dirty=!0,Qt.whatNext(!E.aiMode)}endTurn(){const t=k.getActive();Dt.cardDiscardAll(t),t.turn++;const i=t.turn>4;x.addEvents(I.player("TRE",t.isPlayerA)),i&&(t.turn=1,t.rank++,y.lawg(t," hits Rank "+t.rank+"."),K.addRankup(t.isPlayerA),x.addEvents(I.player("RKU",t.isPlayerA)),t.deck=t.deck.concat(t.discard),t.discard=[],Ot.shuffleDeck(t)),p.qActiveCreats().forEach(r=>{r.extraBattles=0}),k.drawCard(t,5),Qt.phase="ET",Ct.dirty=!0,T.actionDone()}mobility(t){const i=p.jr5(t.param);y.lawg(i.code," moved."),i.mobilityAvailable=!1,i.move(t.lane,"X"),T.actionDone()}allied(t,i){const r=i??k.getActive(),a=b.target("TH");return a.player=k.toTarget(r),a.faction=t,w.deckByTarget(a).length>0}patron(t){const i=b.target("TH");return i.player=k.toTarget(k.getActive()),i.faction=t,w.deckByTarget(i).length>2}freeCard(t){const i=b.freeCard(t);return this.freeCards.push(i),this.lpd(),i}freePlay(t=1){this.regularPlays+=t,this.lpd()}birthRegistrar(t){this.mainBattle?this.newPre.push(t):this.newPost.push(t)}lpd(){k.activeA===k.isLocalA&&(Ct.dirty=!0)}}const L=new en;class vi{id;dom;context;width;height;constructor(){this.id="",this.width=0,this.height=0}show(){}hide(){}get visible(){return!1}clear(){this.context.clearRect(0,0,this.width,this.height)}sprite(t,i,r){this.context.drawImage(t,i,r)}updateScale(t){this.context.scale(t,t)}writeHC(t,i,r){this.context.drawImage(t.dom,i,r)}}class rn extends vi{constructor(t){if(super(),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}}class Wi extends vi{constructor(t,i){super(),this.dom=new OffscreenCanvas(t,i),this.context=this.dom.getContext("2d"),this.width=t,this.height=i}}class Jt{getCanv(t){return t instanceof vi?t:lt.get(t)}init(){}dirty=!0;async drawSprite(t,i,r,a,c={}){const f=this.getCanv(t).context,m=await S.getSprite(S.imgRoot+i);let C=1;c&&(C=c.alpha??1),C<1&&(f.globalAlpha=C),f.drawImage(m,r,a),C<1&&(f.globalAlpha=1)}drawHC(t,i,r,a){t.context.drawImage(i.dom,r,a)}async drawText(t,i,r,a,c={}){const f=this.getCanv(t).context,m=c.fontSize??24;S.pxRatio===2&&(a=this.retinaTextY(a,m)),f.fillStyle=c.colour||"#000000",f.font=`${m}px ${c.fontName||"cinzel"}`,f.shadowColor=c.shadow?"#000000":"#00000000",f.fillText(i,r,a),f.shadowColor="#00000000"}async spriteNumber(t,i,r,a,c,f){let m=r-this.numOffset(i,c);const C=[];i.toString().split("").forEach(D=>{C.push(this.drawSprite(t,this.numSpriteUrl(D,c,f),m,a)),m+=this.numSize(D,c)}),await Promise.all(C)}glowColour(t){const i=t.key;return i==="MOVE"||i==="ACTV"?"green":i==="CANC"?"red":i==="CARD"?"yellow":"blue"}drawRarity(t,i,r,a){return this.drawSprite(t,`icons/rarity/new/${y.rarityText(i).toLowerCase()}.png`,r,a)}drawFaction(t,i,r,a){const c=i==="T"?2:0;return this.drawSprite(t,`icons/faction/${y.factionText(i).toLowerCase()}.png`,r+c,a+3)}makeHaze(t,i=!0){t.context.fillStyle="#222222d8",t.context.fillRect(0,0,i?849:S.gameWidth,S.gameHeight)}cBlu="#03fcfc";cYella="#f5f242";retinaTextY(t,i){let r;return i<21?r=6:i<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,i){return i==="S"?this.smallNumSize[t]:this.bigNumSize[t]}numOffset(t,i){const r=t.toString().split("").reduce((a,c)=>a+this.numSize(c,i),0)-(i==="B"?2:1);return Math.floor(r/2)}numSpriteUrl(t,i,r){return`text/nums/${i}/${r}/${t}.png`}}class sn extends Jt{async drawButton(t,i,r,a,c,f=7,m=!1,C=!0){let D,B;m?(D="ui/button/menu_on.png",B="#d7fc03"):(D="ui/button/menu_off.png",B="#00DEF7");const G=this.buttonBounds(i,r);await this.drawSprite(t,D,G[0],G[1]),await this.drawText(t,c,G[0]+7+f,G[1]+24,{colour:B,fontSize:30}),(!m||C)&&it.add(ht.fromArr(a,G,nt.Both))}async buttonMaker(t,i,r,a,c,f=7,m=!1,C=!0){const D=b.basicAction("MNBT");D.param=a,await this.drawButton(t,i,r,D,c,f,m,C)}buttonBounds(t,i){return[t-7,i-7,232,69]}}const ot=new sn;class an extends Jt{async makeIconButton(t,i,r,a){let f;f=`ui/button/ui_${a}.png`,await this.drawSprite(t,f,i,r);const m=b.basicAction("UIBT");m.param=a;const C=new ht(m,i,r,40,40,nt.Both);it.add(C)}async makeVScroller(t,i,r,a,c){const f={zone:"N",key:c,host:"",param:a?"U":"D"};await this.makeScroller(t,i,r,a?"up":"down",f)}async makeScroller(t,i,r,a,c){await this.drawFactionButton(t,i,r,"A"),await this.drawSprite(t,`ui/arrow/${a}.png`,i+30,r+14);const f=this.makeFactButtonClick(i,r,c);it.add(f)}makeFactButtonClick(t,i,r){return new ht(r,t,i,...this.factionButtonBounds(),nt.Both)}async drawFactionButton(t,i,r,a){await this.drawSprite(t,`ui/button/faction_${a}.png`,i,r)}factionButtonBounds(){return[77,44]}}const re=new an;class nn extends Jt{async drawActions(t){if(gt.baseMode==="G"){const i=lt.get("hilite"),r=t.filter(a=>a.zone==="B");if(r.length>1&&console.error("Two button actions encountered in one batch",r),r.length===0||E.aiActive||S.clickMode==="I"&&!gt.isDetailMode){const a=this.buttonBounds();await this.drawSprite(i,"ui/button/off.png",a[0],a[1])}else{const a=r[0],c=this.buttonBounds(),f=a.key==="CARD"?a.param:a.key,m=this.buttonHilite(f,a.param);await this.drawSprite(i,`ui/button/on_${m}.png`,c[0]-5,c[1]-5),await this.drawSprite(i,"ui/button/on.png",c[0],c[1]),await this.drawSprite(i,`text/butt/${f}.png`,c[0]+23,c[1]+18);const C=this.highlightBounds(),D=ht.fromArr(a,C);a.key==="CNCL"&&(D.mouse=nt.Both),it.add(D)}}}buttonBounds(){return[856,406,160,63]}buttonHilite(t,i){return t==="FITE"||t==="ENDT"&&i===""?"blue":t==="ENDT"&&i==="DIO"||t==="CANC"||t==="CNCL"?"red":"yellow"}highlightBounds(){return[851,401,170,73]}}const $e=new nn;class on extends Jt{async drawCard(t,i,r,a){const c=this.getCanv(i),f=this.extractStats(t),m=f.cardClass;if(await this.drawSprite(c,m.image(!1),r+14,a+35),await this.drawSprite(c,this.frameImg(m.level,m.faction,m.type,!1),r,a),await this.drawSprite(c,`text/card/${m.cardCode()}.png`,r+12,a+16),f.isCreature){const C=a+178;await this.spriteNumber(c,f.att,r+24,C,"S","Y"),await this.spriteNumber(c,f.hlt,r+127,C,"S","Y")}if(f.sleeping&&await this.drawSprite(c,"icons/effects/defensive.png",r+5,a+40,{alpha:.7}),f.iconList.length>0){const C=r+57-17*(f.iconList.length-1);await Promise.all(f.iconList.map(async(D,B)=>this.drawIcon(c,C+B*35,a+140,D[0],D[1])))}}async drawBigCard(t,i,r,a){const c=this.extractStats(i);if(await this.drawSprite(t,i.image(!0),r+(c.isCreature?38:35),a+117),await this.drawSprite(t,this.frameImg(i.level,i.faction,i.type,!0),r,a),i.rarity!=="T"&&await this.drawRarity(t,i.rarity,r+309,a+394),c.isCreature){const f=a+555;await this.spriteNumber(t,c.att,r+44,f,"B","Y"),await this.spriteNumber(t,c.hlt,r+325,f,"B","Y")}}async drawIcon(t,i,r,a,c=0){const f=this.getCanv(t);if(await this.drawSprite(f,`icons/effects/${a}.png`,i,r),c>0){const m=a==="poison"?12:9;await this.spriteNumber(f,c,i+17,r+m,"S","B")}}extractStats(t){let i,r=!1,a=0,c=0,f=!1,m=0,C=!1,D=!1,B=!1,G=!1,R=0,X=0,V=0,tt=!1,q=!1;if(!(t instanceof Wt))r=!0,a=t.attack,c=t.health,f=t.sleeping&&!t.aggressive,m=t.regen,C=t.breakthrough,D=t.defender,B=t.aggressive,R=t.armor,X=t.poison,V=t.mobility,G=t.changed,i=W.getCard(t.code);else{if(t.type==="C"){r=!0;const Mt=t;a=Mt.iAttack,c=Mt.iHealth,m=Mt.iRegen,C=Mt.iBT,D=Mt.iDefend,B=Mt.iAggro,R=Mt.iArmor,V=Mt.iMobile}tt=t.overload,q=t.consistent,i=t}const pt=[];return tt&&pt.push(["overload",0]),q&&pt.push(["consistent",0]),m>0&&pt.push(["regenerate",m]),C&&pt.push(["breakthrough",0]),D&&pt.push(["defender",0]),B&&pt.push(["aggressive",0]),R>0&&pt.push(["armor",R]),X>0&&pt.push(["poison",X]),V>0&&pt.push(["mobility",V]),G&&pt.push(["changed",0]),{cardClass:i,isCreature:r,iconList:pt,hlt:c,att:a,sleeping:f}}async drawHilight(t,i,r,a){await this.drawSprite(t,`frames/glow_${a}.png`,i-22,r-36)}cardBounds(t,i){return[t,i,150,205]}cardSize(){return[150,205]}highlightBounds(t){return[t[0]-5,t[1]-5,160,215]}frameImg(t,i,r,a){return`frames/${a?"big":"small"}/lvl${t}_${i}${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 St=new on,$i=22,Ke=540,hn=6;class ln extends Jt{handCan;highCan;xOffset=0;xCache=new Array(15);init(){this.handCan=lt.get("hand"),this.highCan=lt.get("hilite"),this.xOffset=St.highlightBounds([0,0])[2]+hn;for(let t=-5;t<10;t++)this.xCache[t+5]=$i+t*this.xOffset}async drawCards(t){const i=this.handCan;i.clear();let r=$i;const a=this.paginatron(t);for(let c=a[0];c<=a[1];c++){if(!K.active||!K.movingHand.includes(c)){const f=W.getCard(t.hand[c]);await St.drawCard(f,i,r,Ke)}r+=this.xOffset}this.dirty=!1}fastCoord(t){return[this.xCache[t+5],Ke]}async drawActions(t){const i=S.clickMode!=="I",r=this.highCan,a=new Xt(0,520,1e3,250),c=new Xt(0,520,1e3,250,nt.Right),f=this.paginatron(k.getActive());await Promise.all(t.filter(m=>m.zone==="H").map(async m=>{const C=m;if(C.position>=f[0]&&C.position<=f[1]){const D=this.xCache[C.position-f[0]+5];if(m.key==="DEET")c.addChild(ht.fromArr(m,St.highlightBounds([D,Ke]),nt.Right));else if(i){a.addChild(ht.fromArr(m,St.highlightBounds([D,Ke])));let B;C.key==="HPLY"?C.cost&&C.canPlay?B="green":C.lvlOnly?B="purple":B="blue":B=this.glowColour(C),await St.drawHilight(r,D,Ke,B)}}})),i&&it.add(a),it.add(c),f[0]>0&&await this.makeScroller(r,!1),f[1]0&&(i=i.filter(a=>!K.movingBoard.includes(a.id)));const r=i.map(a=>{const c=this.coordCalc(a.lane,a.owner);return St.drawCard(a,t,c[0],c[1])});await Promise.all(r),this.dirty=!1}async drawActions(t){const i=S.clickMode!=="I",r=this.highCan,a=Xt.fromBox(this.fieldBoundary),c=Xt.fromBox(this.fieldBoundary,nt.Right);if(await Promise.all(t.filter(f=>f.zone==="F"||f.zone==="R").map(async f=>{if(f.zone==="R"&&i)it.add(ht.fromArr(f,this.fieldBoundary)),await this.drawSprite(r,"background/field-glow.png",this.fieldBoundary[0]-6,this.fieldBoundary[1]-9);else{const m=f,C=this.coordCalc(m.lane,m.playerA);f.key==="DEET"?c.addChild(ht.fromArr(f,St.highlightBounds(C),nt.Right)):i&&(a.addChild(ht.fromArr(f,St.highlightBounds(C))),await St.drawHilight(r,C[0],C[1],this.glowColour(m)))}})),i&&a.childs.length>0&&it.add(a),c.childs.length>0&&it.add(c),x.iaTrigLane>0){const f=this.coordCalc(x.iaTrigLane,k.activeA),m=St.cardBounds(f[0],f[1]),C=m[1]+m[3]+11,D=m[0]+m[2]/2;await this.drawSprite(r,"icons/rewards/gold.png",D-10,C),await this.drawSprite(r,"icons/rewards/gold.png",D-35,C),await this.drawSprite(r,"icons/rewards/gold.png",D-60,C),await this.drawSprite(r,"icons/rewards/gold.png",D+15,C),await this.drawSprite(r,"icons/rewards/gold.png",D+40,C)}}drawCacheCard(t,i,r){this.drawHC(this.fieldCan,t,i,r)}async drawFight(){lt.get("hilite").clear(),await $e.drawActions([]),await K.prep(),K.movingBoard.length>0&&(await this.drawCards(),K.start(),await K.aniProm())}}const oe=new cn;class un extends Jt{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,i,r,a){const c=this.getCanv(i);await this.drawSprite(c,`avatar/${this.avatars[t.avatar]}.jpg`,r+46,a+48),await this.drawSprite(c,"ui/player_frame.png",r,a),await this.drawSprite(c,"ui/player_health.png",r+10,a+102),await this.spriteNumber(c,t.health,r+45,a+149,"B","G"),await this.drawSprite(c,`ui/turn${t.turn}.png`,r+117,a+25),await this.drawSprite(c,"ui/rank.png",r+90,a+4),await this.spriteNumber(c,t.rank,r+121,a+28,"B","G"),t.isPlayerA===k.activeA&&await this.drawSprite(c,"icons/rarity/drop/common.png",r+84,a+153),await this.drawText(c,t.name,r+t.nameOffset,a+189,{colour:this.cBlu,fontSize:20});const f=k.totalPoison(t),m=k.totalArmor(t),C=k.activeCardItems(t);if(f>0||m>0||C.length>0){const D=a+9;if(f>0&&await St.drawIcon(c,r+15,D,"poison",f),m>0&&await St.drawIcon(c,r+150,D,"armor",m),C.length>0){await St.drawIcon(c,r+156,a+147,"changed");const B=b.basicAction("VWDK");return B.param=S.enTil("VE",S.bool2txt(t.isPlayerA)),new ht(B,r+155,a+147,36,36,nt.Both)}}}async drawAllPlayers(){const t=lt.get("player");t.clear();const i=[],r=!E.aiActive,a=k.getLocal(),c=k.toPlayer(!a.isPlayerA),f=await this.drawPlayer(a,t,...this.playerOrigin(!0)),m=await this.drawPlayer(c,t,...this.playerOrigin(!1));let C,D;if(a.isPlayerA===k.activeA){let B=862;const G=295,R=Array(L.regularPlays).fill("blue").concat(L.freeCards.map(V=>V.sourceCard)),X=[];R.forEach(V=>{let tt;if(V==="blue")tt=V;else if(tt="green",r){const q={key:"DEET",zone:"N",host:"",param:V};i.push(new ht(q,B-1,G-1,28,41,nt.Both))}X.push(this.drawSprite(t,`ui/${tt}card.png`,B,G)),B+=30}),await Promise.all(X),C=await this.drawDeckButton(t,a,!0,r),D=await this.drawDeckButton(t,a,!1,r)}return this.dirty=!1,i.concat([f,m,C,D]).filter(Boolean)}async drawDeckButton(t,i,r,a){let c,f,m;if(r?(c=i.discard.length,f=935,m="T"):(c=i.deck.length,f=858,m="U"),await re.drawFactionButton(t,f,350,m),await this.spriteNumber(t,c,f+38,350+14,"S","Y"),c>0&&a){const D=b.basicAction("VWDK");return D.param=r?"VD":"VR",re.makeFactButtonClick(f,350,D)}}async drawActions(t){if(S.clickMode==="I")return;const i=lt.get("hilite"),r=k.isLocalA;await Promise.all(t.filter(a=>a.zone==="P").map(a=>{const c=a,f=this.playerOrigin(c.playerA===r),m=this.playerBounds(...f);return it.add(ht.fromArr(a,m)),this.drawSprite(i,"ui/player_glow.png",f[0]+1,f[1]-1)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,i){return[t+18,i+18,170,170]}async drawGameOver(t=!1){const i=lt.get("field"),r=94,a=k.isLocalA,c=E.winFlag,f=a&&c===1||!a&&c===-1;await this.drawSprite(i,`ui/you-${f?"win":"lose"}.png`,r,89,{alpha:t?.65:1}),it.removeAll();const m=lt.get("hand");if(await ot.drawButton(m,r+62,488,b.menuButtonAction("MM"),"Main Menu",20,!1),await ot.drawButton(m,r+389,488,b.menuButtonAction("RP"),"Replay",55,!1),t&&!S.options.wasDrafting){m.context.fillStyle="#222222d8",m.context.fillRect(0,0,849,50);const C={colour:this.cBlu,fontSize:20};await this.drawText(m,$t.namenom(!a),5,2,C),await this.drawText(m,$t.namenom(a),5,29,C)}}async drawAiGear(t,i){const c=t%6,f=Math.floor(t/6),m=lt.get("hilite"),C=`icons/rewards/${i?"gold":"silver"}.png`;await this.drawSprite(m,C,862+c*24,255+f*24)}hwhipe(){lt.get("hilite").clear()}}const Ct=new un,Ui=15,Oi=15,dn=5;class fn extends Jt{constructor(){super();const t=St.highlightBounds([0,0]);this.xOffset=t[2]+dn,this.yOffset=t[3]+25}xOffset;yOffset;async drawCards(t){const r=bt.visibleContent().map((a,c)=>{const f=W.getCard(a.cardCode),m=this.listXY(c);return St.drawCard(f,t,...m).then(()=>{if(a.cardCount>0)return this.drawCount(t,m[0]+61,m[1]+166,a.cardCount)})});await Promise.all(r)}async drawActions(t,i){const r=S.clickMode!=="I",a=bt.visibleContent(),c=E.ui,f=c.deckScroll,m=f+15,D=c.deckSummary?nt.Both:nt.Right,B=Xt.fromBox(this.deckBoundary()),G=Xt.fromBox(this.deckBoundary(),D),R=[];t.forEach(X=>{if(X.key==="DEET"){const V=X;V.position>=f&&V.positionq.sourceIdx===V.position);if(tt>-1){const q=this.listXY(tt);B.addChild(ht.fromArr(X,St.highlightBounds(q))),R.push(St.drawHilight(i,q[0],q[1],"blue"))}}}),r&&B.childs.length>0&&it.add(B),G.childs.length>0&&it.add(G),bt.canPageDown&&R.push(re.makeVScroller(i,299,712,!1,"SCRK")),bt.canPageUp&&R.push(re.makeVScroller(i,465,712,!0,"SCRK")),await Promise.all(R)}async drawCount(t,i,r,a){await this.drawSprite(t,"ui/dullcard.png",i,r),await this.spriteNumber(t,a,i+13,r+12,"S","Y")}listXY(t){return[Ui+t%5*this.xOffset,Oi+Math.floor(t/5)*this.yOffset]}deckBoundary(){return[Ui,Oi,this.xOffset*5,this.yOffset*3]}}const Si=new fn;class gn extends Jt{async drawDetails(t){const i=[],r=lt.get("card");r.clear(),this.makeHaze(r);const a=30,c=30,f=W.getCard(ge.currentCard);S.options.bigCards?i.push(St.drawBigCard(r,f,a,c)):i.push(St.drawCard(f,r,134,280));const m=435;let C=30;const D=33,B=23,G=28;let R=f.name;for(;R.length>0;){C+=36;let wt;if(R.length{for(;wt.length>0;){let Vt;if(wt.length1){const wt=f.cardCode(),Vt=tt===3?[19,147,270]:tt===2?[78,216]:[-15,91,197,302];V.forEach((Yt,he)=>{i.push(this.drawLevelButton(r,wt,Yt,27+Vt[he],639,Yt===f.level))})}let q=0;const pt=513,Mt=697,ye=74;gt.baseMode!=="G"&&(i.push(ot.drawButton(r,pt,Mt,t,"Close",62,!1)),q++);const kt=new ht(t,a,c,377,603,nt.Both);if(it.add(kt),ge.canGoBack){const wt=ge.goBackAction();i.push(ot.drawButton(r,pt,this.buttonY(Mt,q,ye),wt,"Back",72,!1)),q++}ge.friendos.forEach(wt=>{const Vt=W.getCard(wt),Yt=ge.friendAction(wt),he=ge.friendTxt(Vt.cardCode());i.push(ot.drawButton(r,pt,this.buttonY(Mt,q,ye),Yt,he[1]||Vt.name,he[0],!1)),q++}),await Promise.all(i)}buttonY(t,i,r){return t-i*r}cardSummary(t){const i=y.factionText(t.faction),r=y.rarityText(t.rarity),a=y.cardTypeText(t.type);return`${i}, ${r} ${a}`}tribeSummary(t){return t.tribe.map(i=>y.tribeText(i)).join(" ")}async drawLevelButton(t,i,r,a,c,f){if(await this.drawSprite(t,`icons/frame/l${r}.png`,a,c),!f){const B=ge.levelAction(r),G=new ht(B,a-7,c-5,103,112,nt.Both);it.add(G)}const C=W.getCard(`${i}${r}`).levelSpice(),D=[[-7,84],[60,84],[11,79]];await Promise.all(C.map((B,G)=>{const R=a+D[G][0],X=c+D[G][1];if(B.icon==="A"||B.icon==="H"){let V,tt;return B.icon==="A"?(V="icons/frame/attack.png",tt=R+17):(V="icons/frame/health.png",tt=R+16),this.drawSprite(t,V,R-1,X-1).then(()=>this.spriteNumber(t,B.num,tt,X+10,"S","Y"))}else{let V=this.spiceIcon(B.icon);if(B.icon==="U"||B.icon==="D"||B.icon==="L"||B.icon==="N"){const tt=`icons/effects/${V}.png`;return this.drawSprite(t,tt,R-1,X-1).then(()=>this.spriteNumber(t,B.num,R+16,X+10,"S","B"))}else return St.drawIcon(t,R,X,V,B.num)}}))}spiceIcon(t){return t==="N"?"new":t==="D"?"damage":t==="U"?"buff":t==="V"?"mobility":t==="P"?"poison":t==="M"?"armor":t==="G"?"aggressive":t==="F"?"defender":t==="B"?"breakthrough":t==="R"?"regenerate":t==="L"?"life":t==="C"?"consistent":t==="O"?"overload":"whoops"}levelFun(t){return t.maxLevel===3?t.minLevel===1?[1,2,3]:[3]:t.maxLevel===t.minLevel?[t.minLevel]:t.maxLevel===4?[1,2,3,4]:[1,2]}}const mn=new gn;class pn extends Jt{packLeft=22;packTop=190;packBoundary=[this.packLeft-5,this.packTop-10,537,480];async drawPack(t,i){const r=S.clickMode!=="I",a=[],c=Xt.fromBox(this.packBoundary),f=Xt.fromBox(this.packBoundary,nt.Right);t.filter(C=>C.pack).forEach(C=>{const D=this.coordCalcPack(C.index);if(C.key==="DRFT"){const B=W.getCard(C.param+"1");a.push(St.drawCard(B,i,...D).then(()=>this.drawRarity(i,B.rarity,D[0]+112,D[1]+4))),r&&c.addChild(ht.fromArr(C,St.highlightBounds(D)))}else f.addChild(ht.fromArr(C,St.highlightBounds(D),nt.Right))}),await Promise.all(a),r&&c.childs.length>0&&it.add(c),f.childs.length>0&&it.add(f)}async drawList(t,i){let r=170;const a=570,c=[],f=At.picksAsDeck,m=new Xt(a,r,600,600,nt.Both),C=t,D=15,B=At.scrollIdx;At.canPageDown&&await this.makeScroller(i,!1),At.canPageUp&&await this.makeScroller(i,!0),C.filter(G=>!G.pack).forEach(G=>{if(G.index>=B&&G.index{const f=i.getFactTotal(c);if(f[2]===0)return[Promise.resolve()];{r+=75;const m=this.threeLine(t,r,a,f),C=this.drawFaction(t,c,r-8,a-39);return[m,C]}}).flat())}async threeLine(t,i,r,a){const c={colour:"#ffd865",fontSize:18,fontName:"serif"},f=30;await Promise.all(a.map((m,C)=>this.drawText(t,m.toString(),i,r+f*C,c)))}async drawDraftMenu(t){let f=50,m=240;await me.headerText(f+28,m,"Opponent",t),m+=45,await ot.buttonMaker(t,f,m,"DI","DUMB BOT",27,At.vsAI,!1),m+=80,await ot.buttonMaker(t,f,m,"DV","HUMAN",47,!At.vsAI,!1),m+=80+16,await me.headerText(f+17,m,"Rarity Filter",t),m+=80-34-6,await this.rarityButton(t,f+20,m,"L",At.getRarity("L")),await this.rarityButton(t,f+125,m,"H",At.getRarity("H")),m+=80,await this.rarityButton(t,f+20,m,"R",At.getRarity("R")),await this.rarityButton(t,f+125,m,"C",At.getRarity("C")),m=240+45+80*5,await ot.buttonMaker(t,f,m,"MM","MAIN MENU",16),f=404,m=240,await me.headerText(f+5,m,"Draft Modes",t),m+=45,await ot.buttonMaker(t,f,m,"GP","GOOD PACKS",9,At.fatPacks),m+=80,await ot.buttonMaker(t,f,m,"LD","LEGENDARY",17,At.legDraft),m+=80,await ot.buttonMaker(t,f,m,"OD","OVERDRAFT",17,At.overdraft),f=757,m=240,await me.headerText(f+76,m,"Sets",t),m+=45,await this.chestButton(t,f+3,m,1,At.getSet(1)),await this.chestButton(t,f+124,m,2,At.getSet(2)),m+=88,await this.chestButton(t,f+3,m,3,At.getSet(3)),await this.chestButton(t,f+124,m,4,At.getSet(4)),m+=88,await this.chestButton(t,f+3,m,5,At.getSet(5)),await this.chestButton(t,f+124,m,6,At.getSet(6)),m+=88,await this.chestButton(t,f+3,m,7,At.getSet(7)),m=240+45+80*5,await ot.buttonMaker(t,f,m,"DN","NEXT",68)}async rarityButton(t,i,r,a,c){const f={key:"MNBT",zone:"N",host:"",param:S.enTil("DR",a)},m=`ui/button/rarity_${a}${c?"y":"n"}.png`;await this.drawSprite(t,m,i,r);const C=new ht(f,i,r,75,65,nt.Both);it.add(C)}async chestButton(t,i,r,a,c){const f={key:"MNBT",zone:"N",host:"",param:S.enTil("DT",a)};c&&await this.drawSprite(t,"icons/sets/chest-hl.png",i,r);const m=`icons/sets/Chest_Set${a}${c?"y":"n"}.png`;await this.drawSprite(t,m,i,r);const C=new ht(f,i,r,90,74,nt.Both);it.add(C)}}const oi=new pn;class yn extends Jt{async drawSets(t,i){let r=200;const a=100,c=[],f=new Xt(a-50,r,450,600);t.filter(m=>m.key==="DSET").forEach(m=>{const C=He[parseInt(m.param)];c.push(this.drawText(i,C.name,a,r,{colour:this.cYella}),this.drawSprite(i,"icons/chest_small.png",a-48,r-5));const D=new ht(m,a-50,r-2,450,35,nt.Both);f.addChild(D),r+=45}),it.add(f),await Promise.all(c)}async drawList(t,i){let r=170;const a=570,c=42,f=33,m=[],C=new Xt(a,r,460,600),D=new Xt(a-c,r,f,600),B=t.filter(R=>R.key==="DPVW");t.filter(R=>R.key==="DECK").map(R=>{const X=B.find(V=>V.param===R.param);return[R,X]}).forEach(R=>{const X=Ot.stockDeckByPram(R[0].param);m.push(this.drawFaction(i,X.factions[0],a,r),this.drawText(i,X.name,a+65,r+7,{colour:this.cYella})),X.factions.length===2&&m.push(this.drawFaction(i,X.factions[1],a+28,r));const V=new ht(R[0],a,r-2,460,35,nt.Both);C.addChild(V),m.push(this.drawSprite(i,"icons/rarity/eye/legendary.png",a-c,r));const tt=new ht(R[1],a-c,r-2,f,35,nt.Both);D.addChild(tt),r+=35}),await Promise.all(m),it.add(C),it.add(D)}packBoundary=[17,190,537,480];coordCalcPack(t){const a=t%3,c=Math.floor(t/3);return[22+a*176,200+c*235]}iAmError(t){const i=lt.get("game-ui");this.drawText(i,t,295,655,{colour:"#f5142e",fontSize:26})}async drawConstrMenu(t){let c=50,f=240;await me.headerText(c+28,f,"Opponent",t),f+=45,await ot.buttonMaker(t,c,f,"CI","DUMB BOT",27,$t.vsAI,!1),f+=80,await ot.buttonMaker(t,c,f,"CV","HUMAN",47,!$t.vsAI,!1),f+=80*4,await ot.buttonMaker(t,c,f,"MM","MAIN MENU",16),c=404,f=240,await me.headerText(c+46,f,"Player 1",t);const m=$t.p1.mode;f+=45,await ot.buttonMaker(t,c,f,S.enTil("CP","A"),"PRE-CON",39,m==="CP",!1),f+=80,await ot.buttonMaker(t,c,f,S.enTil("CR","A"),"RANDOM",36,m==="CR",!1),f+=80,await ot.buttonMaker(t,c,f,S.enTil("CX","A"),"SCRAMBLE",30,m==="CX",!1),f+=80,await ot.buttonMaker(t,c,f,S.enTil("LK","A"),"LOAD FILE",32,m==="LK"),m==="LK"&&await this.drawFileDeck(t,c,f,$t.p1.deck),c=757,f=240,await me.headerText(c+44,f,"Player 2",t);const C=$t.p2.mode;f+=45,await ot.buttonMaker(t,c,f,S.enTil("CP","B"),"PRE-CON",39,C==="CP",!1),f+=80,await ot.buttonMaker(t,c,f,S.enTil("CR","B"),"RANDOM",36,C==="CR",!1),f+=80,await ot.buttonMaker(t,c,f,S.enTil("CX","B"),"SCRAMBLE",30,C==="CX",!1),f+=80,await ot.buttonMaker(t,c,f,S.enTil("LK","B"),"LOAD FILE",32,C==="LK"),C==="LK"&&await this.drawFileDeck(t,c,f,$t.p2.deck),f+=80*2,await ot.buttonMaker(t,c,f,"CN","NEXT",68)}async drawFileDeck(t,i,r,a){const c=r+89;await this.drawText(t,a.name.slice(0,20),i,r+70,{colour:this.cYella,fontSize:18}),a.factions.length===1?await this.drawFaction(t,a.factions[0],i+96,c):(await this.drawFaction(t,a.factions[0],i+78,c),await this.drawFaction(t,a.factions[1],i+113,c))}}const Xe=new yn;class bn extends Jt{async drawExtrasMenu(t){let f=50,m=240;await this.headerText(f+37,m,"UI Modes",t),m+=45,await ot.buttonMaker(t,f,m,"90","90% SIZE",47,S.options.scale==="90"),m+=80,await ot.buttonMaker(t,f,m,"BC","BIG CARDS",29,S.options.bigCards),m+=80,await ot.buttonMaker(t,f,m,"AN","ANIMATIONS",10,S.options.anim8),m+=80*3,await ot.buttonMaker(t,f,m,"MM","MAIN MENU",16),f=404,m=240,await this.headerText(f+28,m,"More Info",t),m+=45,await ot.buttonMaker(t,f,m,"RU","RULES",66),m+=80,await ot.buttonMaker(t,f,m,"FQ","INFO & FAQ",20),m+=80+34,await this.headerText(f+12,m,"Game Modes",t),m+=80-34,await ot.buttonMaker(t,f,m,"HH","BIG HEALTH",20,S.options.highHealth),m+=80,await ot.buttonMaker(t,f,m,"CH","CHEATER",39,S.options.cheater),m+=80,await ot.buttonMaker(t,f,m,"BB","BATTLE BARK",13,S.options.bark),f=757,m=240,await this.headerText(f+43,m,"Playmat",t),m+=45;const C=S.options.playmat==="vanilla";await ot.buttonMaker(t,f,m,"vanilla","VANILLA",43,C,!C),m+=80;const D=S.options.playmat==="alloyin";await ot.buttonMaker(t,f,m,"alloyin","ALLOYIN",43,D,!D),m+=80;const B=S.options.playmat==="nekrium";await ot.buttonMaker(t,f,m,"nekrium","NEKRIUM",38,B,!B),m+=80;const G=S.options.playmat==="tempys";await ot.buttonMaker(t,f,m,"tempys","TEMPYS",51,G,!G),m+=80;const R=S.options.playmat==="uterra";await ot.buttonMaker(t,f,m,"uterra","UTERRA",52,R,!R);const X=890;await this.drawText(t,S.ver,X,46,{fontSize:18,colour:"#7b68ee"}),await this.drawText(t,"29-Jan-2024",X,68,{fontSize:14,colour:"#7b68ee"});const V=b.basicAction("MNBT");V.param="VR",it.add(new ht(V,X,44,90,44,nt.Both))}async headerText(t,i,r,a){await this.drawText(a,r,t,i,{colour:this.cYella,fontSize:30})}async drawPickerPlayer(t,i,r){let a;i?a="Player 1":r?a="Dumb Bot":a="Player 2",await this.headerText(54,75,a,t)}}const me=new bn;class An extends Jt{async drawMenu(t){let r=22;await this.drawSprite(t,"ui/button/constructed.png",778,r),it.add(ht.fromArr(this.makeAction("C"),this.buttHilightBounds(778,r),nt.Both)),r=148,await this.drawSprite(t,"ui/button/draft.png",778,r),it.add(ht.fromArr(this.makeAction("D"),this.buttHilightBounds(778,r),nt.Both)),r=508,await this.drawSprite(t,"ui/button/deck.png",778,r),it.add(ht.fromArr(this.makeAction("B"),this.buttHilightBounds(778,r),nt.Both)),r=634,await this.drawSprite(t,"ui/button/info.png",778,r),it.add(ht.fromArr(this.makeAction("I"),this.buttHilightBounds(778,r),nt.Both));const a=b.basicAction("DBUG");it.add(new ht(a,757,349,74,70,nt.Right)),await this.drawSprite(t,"gwg/gwg_red.png",58,0);const c=b.basicAction("MNBT");c.param="SB",it.add(new ht(c,10,10,44,52,nt.Both));const f=b.basicAction("MNBT");f.param="GW",it.add(new ht(f,58,10,50,50,nt.Both))}buttBounds(t,i){return[t,i,242,113]}buttHilightBounds(t,i){const a=[-3,-3,6,6];return this.buttBounds(t,i).map((c,f)=>c+a[f])}makeAction(t){return{zone:"N",key:"MENU",host:"",param:t}}}const kn=new An;class Ci{active=!0;aId;moveX=[];moveY=[];dOrd=1;steps=0;target;targId;type;x=0;y=0;constructor(t,i,r,a){this.aId=t,this.type=i,this.target=r,this.targId=a}async draw(t){console.log("Draw not overridden")}async onEnd(){}extend(t,i,r){if(this.steps+=t,i||r){const a=new Array(t).fill(0);i&&(this.moveX=a.concat(this.moveX)),r&&(this.moveY=a.concat(this.moveY))}}setHand(t){const i=ne.fastCoord(t);this.x=i[0],this.y=i[1]}setField(t,i){const r=oe.coordCalc(t,i);this.x=r[0],this.y=r[1]}nudge(t,i){this.x+=t,this.y+=i}}class pe extends Ci{constructor(t,i,r,a,c){super(t,i,r,a),this.drawId=c,this.steps=K.speedCache.get(t)??0}drawId;async draw(t){K.hcFrame.writeHC(K.getCC(this.drawId),this.x,this.y)}static fader(t,i,r){return new pe("D","F",t,i,r)}static fixed(t,i,r){return new pe("C","X",t,i,r)}}class hi extends Ci{imgProm;constructor(t,i,r,a,c){super(t,i,r,a),this.steps=c}async draw(t){const i=await this.imgProm;K.hcFrame.context.drawImage(i,this.x,this.y)}preLoad(t){this.imgProm=S.getSprite(S.imgRoot+t)}}class li extends pe{endWrite=!1;constructor(t,i,r,a){super(t,"C",i,r,a)}async onEnd(){this.endWrite&&(this.target==="F"?oe.drawCacheCard(K.getCC(this.drawId),this.x,this.y):this.target==="H"&&ne.drawCacheCard(K.getCC(this.drawId),this.x,this.y))}}class Me extends Ci{holf=1;img;schema;constructor(t,i,r){super(t,"S",i,r),this.img=K.getSS(t),this.schema=K.getSSS(t),this.steps=this.schema.count}async draw(t){this.holf>1&&(t=(t-t%this.holf)/this.holf);const i=this.schema.origins[t];K.hcFrame.context.drawImage(this.img,i[0],i[1],this.schema.width,this.schema.height,this.x,this.y,this.schema.width,this.schema.height)}slow(t){this.holf=t,this.steps=this.schema.count*t}}class Tn extends Me{offset;constructor(t,i,r){super(t,i,r),t==="U"?this.offset=[-1,0]:t==="N"?this.offset=[-2,-1]:t==="T"?this.offset=[-1,-1]:this.offset=[0,0]}budge(){this.x+=this.offset[0],this.y+=this.offset[1]}}class Vi extends Me{delay=0;setDelay(t){this.delay=t,this.steps+=t}async draw(t){t>=this.delay&&await super.draw(t-this.delay)}}class vn extends hi{delay=0;setDelay(t){this.delay=t,this.steps+=t}async draw(t){t>=this.delay&&await super.draw(t)}}class Sn{ver="v0.10.0";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={anim8:!0,bark:!0,bigCards:!0,highHealth:!1,cheater:!1,playmat:"uterra",wasDrafting:!1,scale:"100",debug:!1}}randInt(t,i){return Math.floor(Math.random()*(i-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(i=>{setTimeout(()=>{i()},t)})}async getSprite(t){return this.spriteCache[t]||(this.spriteCache[t]=this.imageLoader(t)),this.spriteCache[t]}async bulkLoadP(t){await Promise.all(t.map(i=>this.getSprite(this.imgRoot+i)))}async bulkLoadS(t){for(let i=0;i{const r=new Image;r.onload=()=>{i(r)},r.src=t})}writeStorage(t,i){localStorage.setItem(t,i)}readStorage(t){return localStorage.getItem(t)}readStringStorage(t,i){const r=this.readStorage(t);return r===null?i:r}readBoolStorage(t,i){const r=this.readStorage(t);return r===null?i:this.txt2bool(r)}writeBoolStorage(t,i){this.writeStorage(t,this.bool2txt(i))}bool2txt(t){return t?"Y":"N"}txt2bool(t){return t==="Y"}restoreOptions(){const t=this.options;t.anim8=this.readBoolStorage("anim8",!0),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])}togOptViaPram(t){let i;if(t==="HH")i="highHealth";else if(t==="CH")i="cheater";else if(t==="BB")i="bark";else if(t==="BC")i="bigCards";else if(t==="AN")i="anim8";else throw new Error("whooops"+t);this.toggleOption(i)}setClickMode(t){this._clickMode=t}get clickMode(){return this._clickMode}}const S=new Sn;window.onload=async()=>{await document.fonts.ready;let o=[];document.fonts.forEach(R=>{R.load(),o.push(R.loaded)}),await Promise.all(o),ut.allCanvases.forEach(R=>{lt.register(R)}),S.pxRatio=window.devicePixelRatio;let t;(R=>{R.Neutral="N",R.Cancel="C",R.Down="D"})(t||(t={}));let i=!0,r=800,a="N",c;try{document.createEvent("TouchEvent"),S.setClickMode("T"),i=!1}catch{}const f=()=>{c&&(clearTimeout(c),c=void 0)},m=(R,X,V)=>{const tt=it.hitTest(R,X,V);tt&&T.handleAction(tt)},C=R=>{m(R.pageX,R.pageY,R.button)},D=R=>{R.touches.length>1?(a="C",f()):a==="N"&&(a="D",c=setTimeout(()=>{a="C";const X=R.touches[0];m(X.pageX,X.pageY,nt.ForceRight),c=void 0},r))},B=R=>{if(a==="D"){if(f(),a="N",R.changedTouches.length>0){const X=R.changedTouches[0];m(X.pageX,X.pageY,nt.Left)}}else R.touches.length===0&&(a="N")},G=document.getElementById("solforge");i?(G.addEventListener("click",C),G.addEventListener("contextmenu",R=>(R.preventDefault(),C(R),!1))):(G.addEventListener("touchstart",D),G.addEventListener("touchend",B)),window.sfapi={details:R=>{ge.init(R)},setLog:R=>{st.setLog(R)},peekAll:()=>{st.peekAllCards()},peekDeck:()=>{st.peekDecks()},peekField:()=>{console.log(p.field)},dumb:()=>{console.log("Am I dumb? "+st.dumb)},debug:()=>{S.toggleDebug()}},S.restoreOptions(),S.options.scale!=="100"&&ut.changeScale(S.options.scale),ut.init(),ut.drawAll().then(()=>{const R=["ui/player_frame.png","ui/button/on.png","ui/button/off.png"];[1,2,3].forEach(V=>["C","S"].forEach(tt=>["A","N","T","U"].forEach(q=>{R.push("frames/small/lvl"+V+"_"+q+tt+".png")}))),["poison","regenerate","armor","aggressive","breakthrough","changed","consistent","defender","defensive","mobility","overload"].forEach((V,tt)=>{R.push("icons/effects/"+V+".png"),tt<3&&R.push("icons/effects/big/"+V+".png")}),["common","heroic","legendary","rare"].forEach(V=>{R.push("icons/rarity/new/"+V+".png")}),[1,2,3,4].forEach(V=>{R.push("ui/turn"+V+".png")}),["blue","green","purple","red","yellow"].forEach(V=>{R.push("frames/glow_"+V+".png")});const X=new Jt;for(let V=0;V<10;V++)["B","S"].forEach(tt=>{(tt==="B"?["G","Y"]:["B","Y"]).forEach(pt=>{R.push(X.numSpriteUrl(V,tt,pt))})});S.bulkLoadS(R)})}})(); diff --git a/play/index.html b/play/index.html index 6b758b4..a03b9aa 100644 --- a/play/index.html +++ b/play/index.html @@ -100,9 +100,12 @@ touch-action: manipulation; } #card { - z-index: 8; + z-index: 9; } #decklist { + z-index: 8; + } + #effects { z-index: 7; } #hand { @@ -114,7 +117,7 @@ #field { z-index: 4; } - #effects { + #hilite { z-index: 3; } #game-ui { @@ -154,10 +157,11 @@ + - +